| | |
| | | "pages/inspection/scene/info/index", |
| | | "pages/inspection/scene/info/device-info/index", |
| | | "pages/inspection/scene/info/device-status/index", |
| | | "pages/simple-home/index" |
| | | "pages/simple-home/index", |
| | | "pages/inspection/ranking/search/index" |
| | | ], |
| | | "tabBar": { |
| | | "custom": true, |
| | |
| | | { label: 'å
±åæ°è·¯è¡é', value: '310106018' }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'æ®éåº', |
| | | value: '310107', |
| | | children: [ |
| | | { label: 'å
¨é¨è¡é', value: '-310107' }, |
| | | { label: 'æ¹æ¨æ°æè¡é', value: '310107005' }, |
| | | { label: 'ä¸éè¡é', value: '310107021' }, |
| | | { label: 'çå¦éè¡é', value: '310107022' }, |
| | | { label: 'é¿å¾é', value: '310107102' }, |
| | | { label: 'æ¡æµ¦é', value: '310107103' }, |
| | | { label: 'ç³æ³è·¯è¡é', value: '310107017' }, |
| | | { label: 'çæ³è·¯è¡é', value: '310107016' }, |
| | | { label: 'é¿å¯¿è·¯è¡é', value: '310107015' }, |
| | | { label: 'é¿é£æ°æè¡é', value: '310107014' }, |
| | | { label: 'å®å·è·¯è¡é', value: '310107020' }, |
| | | ], |
| | | }, |
| | | { |
| | | label: 'éµè¡åº', |
| | | value: '310112', |
| | | children: [ |
| | | { label: 'å
¨é¨è¡é', value: '-310112' }, |
| | | { label: 'æ±å·è·¯è¡é', value: '310112001' }, |
| | | { label: 'å¤ç¾è¡é', value: '310112006' }, |
| | | { label: 'æ°è¹è¡é', value: '310112008' }, |
| | | { label: '浦é¦è¡é', value: '310112009' }, |
| | | { label: 'èåºé', value: '310112101' }, |
| | | { label: 'ä¸å®é', value: '310112102' }, |
| | | { label: '颿¡¥é', value: '310112103' }, |
| | | { label: 'åæ¼é', value: '310112106' }, |
| | | { label: 'è¹æ¡¥é', value: '310112107' }, |
| | | { label: 'æ¢
éé', value: '310112108' }, |
| | | { label: 'å´æ³¾é', value: '310112110' }, |
| | | { label: '马桥é', value: '310112112' }, |
| | | { label: '浦æ±é', value: '310112114' }, |
| | | { label: 'èåºå·¥ä¸åº', value: '310112501' }, |
| | | ], |
| | | }, |
| | | // { |
| | | // label: 'æ®éåº', |
| | | // value: '310107', |
| | | // children: [ |
| | | // { label: 'å
¨é¨è¡é', value: '-310107' }, |
| | | // { label: 'æ¹æ¨æ°æè¡é', value: '310107005' }, |
| | | // { label: 'ä¸éè¡é', value: '310107021' }, |
| | | // { label: 'çå¦éè¡é', value: '310107022' }, |
| | | // { label: 'é¿å¾é', value: '310107102' }, |
| | | // { label: 'æ¡æµ¦é', value: '310107103' }, |
| | | // { label: 'ç³æ³è·¯è¡é', value: '310107017' }, |
| | | // { label: 'çæ³è·¯è¡é', value: '310107016' }, |
| | | // { label: 'é¿å¯¿è·¯è¡é', value: '310107015' }, |
| | | // { label: 'é¿é£æ°æè¡é', value: '310107014' }, |
| | | // { label: 'å®å·è·¯è¡é', value: '310107020' }, |
| | | // ], |
| | | // }, |
| | | // { |
| | | // label: 'éµè¡åº', |
| | | // value: '310112', |
| | | // children: [ |
| | | // { label: 'å
¨é¨è¡é', value: '-310112' }, |
| | | // { label: 'æ±å·è·¯è¡é', value: '310112001' }, |
| | | // { label: 'å¤ç¾è¡é', value: '310112006' }, |
| | | // { label: 'æ°è¹è¡é', value: '310112008' }, |
| | | // { label: '浦é¦è¡é', value: '310112009' }, |
| | | // { label: 'èåºé', value: '310112101' }, |
| | | // { label: 'ä¸å®é', value: '310112102' }, |
| | | // { label: '颿¡¥é', value: '310112103' }, |
| | | // { label: 'åæ¼é', value: '310112106' }, |
| | | // { label: 'è¹æ¡¥é', value: '310112107' }, |
| | | // { label: 'æ¢
éé', value: '310112108' }, |
| | | // { label: 'å´æ³¾é', value: '310112110' }, |
| | | // { label: '马桥é', value: '310112112' }, |
| | | // { label: '浦æ±é', value: '310112114' }, |
| | | // { label: 'èåºå·¥ä¸åº', value: '310112501' }, |
| | | // ], |
| | | // }, |
| | | { |
| | | label: 'é¿å®åº', |
| | | value: '310105', |
| | |
| | | <view class="wrap"> |
| | | <view class="stat-card__title-wrap"> |
| | | <view class="stat-card__title"> |
| | | <t-icon wx:if="{{icon}}" class="stat-card__title-icon" name="{{icon}}" size="36rpx" color="var(--td-brand-color)" /> |
| | | <t-icon |
| | | wx:if="{{icon}}" |
| | | class="stat-card__title-icon" |
| | | name="{{icon}}" |
| | | size="36rpx" |
| | | color="var(--td-brand-color)" |
| | | /> |
| | | <text class="stat-card__title-text">{{title}}</text> |
| | | </view> |
| | | <text class="stat-card__sub-title" bind:tap="onSubTitleClick">{{subTitle}}</text> |
| | |
| | | <t-loading theme="dots" size="50rpx" /> |
| | | </view> |
| | | <view wx:else class="stat-card__tags"> |
| | | <!-- <block wx:else> --> |
| | | <view |
| | | bindtap="handleClick" |
| | | data-index="{{index}}" |
| | |
| | | wx:index="index" |
| | | > |
| | | <view class="name"> |
| | | <text>{{item.name}}</text> |
| | | <t-icon name="chevron-right" size="var(--icon-width)" color="black" /> |
| | | <block wx:if="{{item.clickable != false}}"> |
| | | <text class="icon-text">{{item.name}}</text> |
| | | <t-icon name="chevron-right" size="var(--icon-width)" color="black" /> |
| | | </block> |
| | | <text wx:else>{{item.name}}</text> |
| | | </view> |
| | | <view class="value" style="{{item.color ? 'color:' + item.color + ';' : ''}}"> {{item.value}} </view> |
| | | <view class="diff {{item.diff == '' ? 'diff-2' : ''}}"> {{item.diff == '' ? '0' : item.diff}} </view> |
| | | <view class="value" style="{{item.color ? 'color:' + item.color + ';' : ''}}"> |
| | | {{item.value}} |
| | | </view> |
| | | <view class="diff {{item.diff == '' ? 'diff-2' : ''}}"> |
| | | {{item.diff == '' ? '0' : item.diff}} |
| | | </view> |
| | | </view> |
| | | <!-- </block> --> |
| | | </view> |
| | | </view> |
| | |
| | | /* border: 1px black solid; */ |
| | | } |
| | | |
| | | .stat-card__tag .name>text { |
| | | .icon-text { |
| | | margin-left: var(--icon-width); |
| | | } |
| | | |
| | |
| | | } |
| | | .t-progress__canvas--circle .t-progress__info { |
| | | margin: 0; |
| | | font-size: 40rpx; |
| | | font-size: var(--td-progress-info-font-size, 40rpx); |
| | | font-weight: 700; |
| | | line-height: 56rpx; |
| | | overflow: hidden; |
| | |
| | | value: first, |
| | | // diff: first == 0 ? '0%' : '100%', |
| | | diff: '', |
| | | clickable: false, |
| | | }, |
| | | { |
| | | name: 'è¿è¥ä¸', |
| | | value: second, |
| | | diff: first == 0 ? '0%' : `${p1}%`, |
| | | clickable: false, |
| | | }, |
| | | { |
| | | name: 'å
³é', |
| | | value: third, |
| | | diff: first == 0 ? '0%' : `${p2}%`, |
| | | clickable: false, |
| | | }, |
| | | ]; |
| | | } |
| | |
| | | let s = sceneMap[value] |
| | | if (s == undefined) { |
| | | if (value != undefined) { |
| | | s = '-1' |
| | | s = value |
| | | } |
| | | } |
| | | return s |
| | |
| | | fetchInspectionStatistic, |
| | | fetchSubtaskSummaryByArea, |
| | | } from '../../services/inspection/fetchInspection'; |
| | | import dayjs from "dayjs"; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | /** |
| | | * ç°åºå·¡æ¥ç管ç¸å
³ä¿¡æ¯è·åé»è¾ |
| | |
| | | fetchInspection(page) { |
| | | this.setData({ inspectionLoading: true }); |
| | | const { provinceCode, cityCode, districtCode, townCode, sceneTypeValue, time } = this.data; |
| | | const eTime = dayjs(time).endOf('M').format('YYYY-MM-DD HH:mm:ss') |
| | | const eTime = dayjs(time).endOf('M').format('YYYY-MM-DD HH:mm:ss'); |
| | | fetchSubtaskSummaryByArea({ |
| | | provincecode: provinceCode, |
| | | citycode: cityCode, |
| | |
| | | this.setData({ |
| | | inspectionRes: res.data, |
| | | }); |
| | | this.fetchSupervisionByDistrict(this.data.tabIndex); |
| | | }) |
| | | .finally(() => { |
| | | this.setData({ inspectionLoading: false }); |
| | |
| | | }, |
| | | onTabsChange(e) { |
| | | this.setData({ tabIndex: e.detail.value }); |
| | | this.fetchSupervisionByDistrict(e.detail.value); |
| | | }, |
| | | |
| | | fetchSupervisionByDistrict(index) { |
| | | if (this.data.inspectionRes.length == 0) return; |
| | | |
| | | const { sceneTypeValue } = this.data; |
| | | const { provinceName, cityName, districtName } = this.data.inspectionRes[index]; |
| | | const params = { provinceName, cityName, districtName, sceneTypes: sceneTypeValue }; |
| | | this._fetchSupervision(1, params); |
| | | }, |
| | | |
| | | navToInspection(e) { |
| | | const i1 = e.detail.index; |
| | | const { inspectionRes, time, sceneTypeText, sceneTypeValue, tabIndex } = this.data; |
| | |
| | | </t-tabs> |
| | | |
| | | <stat-card |
| | | wx:elif="{{inspectionRes.length == 1}}" |
| | | wx:else |
| | | title="ç°åºå·¡æ¥" |
| | | subTitle="é®é¢åæ >" |
| | | stats="{{inspectionRes[0].count}}" |
| | |
| | | riskRes: [], |
| | | creditPeriod: '', |
| | | creditRes: [], |
| | | // åæ¶ç½ç»è¯·æ±æ å¿ |
| | | cancelFetch: [], |
| | | }, |
| | | lifetimes: { |
| | | attached: function () {}, |
| | |
| | | * 线ä¸ç管ç»è®¡ä¿¡æ¯ |
| | | */ |
| | | fetchSupervision(page) { |
| | | const { provinceName, cityName, districtName, townName, sceneTypeValue } = this.data; |
| | | const params = { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue }; |
| | | this._fetchSupervision(page, params); |
| | | }, |
| | | |
| | | _fetchSupervision(page, params) { |
| | | // åæ¶æ£å¨è¿è¡ä¸çä¸ä¸æ¬¡è¯·æ± |
| | | let { cancelFetch } = this.data; |
| | | if (cancelFetch.length > 0) { |
| | | cancelFetch[0] = true; |
| | | cancelFetch = []; |
| | | } |
| | | let abort = false; |
| | | cancelFetch.push(abort); |
| | | this.setData({ cancelFetch }); |
| | | this.setData({ supervisionLoading: true }); |
| | | // ä¼ä¸æ°é |
| | | const { provinceName, cityName, districtName, townName, sceneTypeValue } = this.data; |
| | | const f1 = fetchEnterpriseCount({ |
| | | data: { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue }, |
| | | data: params, |
| | | }).then(res => { |
| | | this.setData({ |
| | | enterpriseCountRes: res.data, |
| | | }); |
| | | if (!abort) { |
| | | this.setData({ |
| | | enterpriseCountRes: res.data, |
| | | }); |
| | | } |
| | | }); |
| | | // 综åé£é© |
| | | const f2 = fetchRiskCount({ |
| | | data: { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue }, |
| | | data: params, |
| | | }).then(res => { |
| | | this.setData({ |
| | | riskPeriod: res.data.period, |
| | | riskRes: res.data.count, |
| | | }); |
| | | if (!abort) { |
| | | this.setData({ |
| | | riskPeriod: res.data.period, |
| | | riskRes: res.data.count, |
| | | }); |
| | | } |
| | | }); |
| | | // ç¯ä¿¡ç |
| | | const f3 = fetchCreditCodeCount({ |
| | | data: { provinceName, cityName, districtName, townName, sceneTypes: sceneTypeValue }, |
| | | data: params, |
| | | }).then(res => { |
| | | this.setData({ |
| | | creditPeriod: res.data.period, |
| | | creditRes: res.data.count, |
| | | }); |
| | | if (!abort) { |
| | | this.setData({ |
| | | creditPeriod: res.data.period, |
| | | creditRes: res.data.count, |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | Promise.all([f1, f2, f3]).finally(() => { |
| | |
| | | }, |
| | | |
| | | _navParams() { |
| | | const { provinceName, cityName, districtName, townName, sceneTypeValue, locationValue } = this.data; |
| | | const { provinceName, cityName, districtName, townName, sceneTypeValue, locationValue } = |
| | | this.data; |
| | | let url = `?sceneType=${sceneTypeValue[0]}`; |
| | | if (provinceName) url += `&province=${provinceName}`; |
| | | if (cityName) url += `&city=${cityName}`; |
| | |
| | | Page({ |
| | | behaviors: [useLoading, useProblemChangeList, useStatistic, useSortOptions], |
| | | data: { |
| | | // summaryList: [], |
| | | // sort: '', |
| | | // sortBy: 'pro', |
| | | // statistic: { |
| | | // proNum: 0, |
| | | // changeNum: 0, |
| | | // }, |
| | | placeholder: 'è¾å
¥å
³é®åæç´¢åºæ¯', |
| | | }, |
| | | |
| | | onLoad(options) { |
| | |
| | | }); |
| | | }, |
| | | |
| | | // fetchSceneProSummary(params, page) { |
| | | // const params = _getParamsArea(this.data); |
| | | // return fetchSceneProSummary({ area: params, page }).then(res => { |
| | | // if (res.success) { |
| | | // this.setData({ |
| | | // summaryList: page == 1 ? res.data : this.data.summaryList.concat(res.data), |
| | | // }); |
| | | // } else { |
| | | // this.setData({ |
| | | // summaryList: [], |
| | | // }); |
| | | // } |
| | | // return res.head; |
| | | // }); |
| | | // }, |
| | | |
| | | // fetchProblems(params, page) { |
| | | // const params = _getParamsArea(this.data); |
| | | // return fetchProblemsStatistic(params).then(res => { |
| | | // let proNum = 0, |
| | | // changeNum = 0, |
| | | // changePer = 0; |
| | | // res.data.forEach(r => { |
| | | // proNum += r.count; |
| | | // changeNum += r.changeCount; |
| | | // }); |
| | | // if (proNum > 0) { |
| | | // changePer = Math.round((changeNum / proNum) * 1000) / 10; |
| | | // changePer += '%'; |
| | | // } |
| | | // this.setData({ |
| | | // statistic: { proNum, changeNum, changePer }, |
| | | // }); |
| | | // return res.head; |
| | | // }); |
| | | // }, |
| | | |
| | | onTimePickerConfirm(e) { |
| | | const { timeValue } = e.detail; |
| | | this.setData({ |
| | |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | onSortChange(e) { |
| | | const { sorts } = e.detail; |
| | | const { type } = e.currentTarget.dataset; |
| | | this.setData({ |
| | | sort: sorts, |
| | | sortBy: type, |
| | | proSort: type == 'pro' ? sorts : 'default', |
| | | changeSort: type == 'changePer' ? sorts : 'default', |
| | | }); |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | // navToDetail(e) { |
| | | // const { index } = e.currentTarget.dataset; |
| | | // const summary = this.data.summaryList[index]; |
| | | // wx.navigateTo({ |
| | | // url: '/pages/inspection/detail/index', |
| | | // success: result => { |
| | | // result.eventChannel.emit('acceptInspectionDetailData', { |
| | | // scene: summary.scene, |
| | | // time: this.data.time, |
| | | // }); |
| | | // }, |
| | | // onSortChange(e) { |
| | | // const { sorts } = e.detail; |
| | | // const { type } = e.currentTarget.dataset; |
| | | // this.setData({ |
| | | // sort: sorts, |
| | | // sortBy: type, |
| | | // proSort: type == 'pro' ? sorts : 'default', |
| | | // changeSort: type == 'changePer' ? sorts : 'default', |
| | | // }); |
| | | // this._startLoad(); |
| | | // }, |
| | | |
| | | navToSearchPage() { |
| | | wx.navigateTo({ |
| | | url: '/pages/inspection/ranking/search/index', |
| | | success: result => {}, |
| | | fail: res => {}, |
| | | complete: res => {}, |
| | | }); |
| | | }, |
| | | }); |
| | |
| | | <view class="page"> |
| | | <t-sticky> |
| | | <view class="page-header"> |
| | | <view class="supervision-search" bind:tap="navToSearchPage"> |
| | | <t-search placeholder="{{placeholder}}" leftIcon="search" disabled> </t-search> |
| | | </view> |
| | | <view class="filter-wrap"> |
| | | <t-time-picker |
| | | color="var(--td-font-white-1)" |
| | |
| | | /> |
| | | </view> |
| | | <include src="/pages/inspection/ranking/statistic.wxml" /> |
| | | <!-- <view class="ranking-summary__item-abstract" style="margin-left: var(--td-spacer)"> |
| | | é®é¢æ»è®¡{{statistic.proNum}}个ï¼å·²æ´æ¹{{statistic.changeNum}}ä¸ªï¼æªæ´æ¹{{statistic.proNum - |
| | | statistic.changeNum}}ä¸ªï¼æ´æ¹ç{{statistic.changePer}} |
| | | </view> --> |
| | | <include src="/pages/inspection/ranking/sort-options.wxml" /> |
| | | <!-- <view class="filter-wrap"> |
| | | <sort-btn |
| | | text="é®é¢æ°" |
| | | custom-class="flex-start " |
| | | icon-color="var(--td-warning-color-4)" |
| | | data-type="pro" |
| | | defaultSort="{{proSort}}" |
| | | bind:sortsChange="onSortChange" |
| | | ></sort-btn> |
| | | <sort-btn |
| | | text="æ´æ¹ç" |
| | | custom-class="flex-start " |
| | | icon-color="var(--td-warning-color-4)" |
| | | data-type="changePer" |
| | | defaultSort="{{changeSort}}" |
| | | bind:sortsChange="onSortChange" |
| | | ></sort-btn> |
| | | </view> --> |
| | | </view> |
| | | </t-sticky> |
| | | <view class="page-container"> |
| | | <include src="./problem-change-list.wxml" /> |
| | | <!-- <template is="pulldown-loading" wx:if="{{pageLoading && summaryList.length != 0}}" /> |
| | | <block wx:if="{{summaryList.length > 0}}"> |
| | | <view |
| | | class="ranking-summary__item" |
| | | wx:for="{{summaryList}}" |
| | | data-index="{{index}}" |
| | | bind:tap="navToDetail" |
| | | > |
| | | <view style="flex: 1"> |
| | | <view class="ranking-summary__item-name">{{item.scene.name}} </view> |
| | | <t-divider /> |
| | | <view class="ranking-summary__item-tag__wrap"> |
| | | <view class="ranking-summary__item-abstract">å°åï¼{{item.scene.location}} </view> |
| | | </view> |
| | | </view> |
| | | <view class="flex-v"> |
| | | <view class="ranking-summary__item-abstract flex-end" |
| | | >æ´æ¹çï¼{{_.changePercent(item.proNum, item.changeNum)}}</view |
| | | > |
| | | <view class="ranking-summary__item-tag__wrap"> |
| | | <view class="ranking-summary__item-tag"> |
| | | <view class="ranking-summary__tag-count"> {{item.proNum}} </view> |
| | | <t-tag |
| | | max-width="{{130}}" |
| | | shape="square" |
| | | size="small" |
| | | theme="default" |
| | | variant="light-outline" |
| | | >é®é¢</t-tag |
| | | > |
| | | </view> |
| | | <view class="ranking-summary__item-tag"> |
| | | <view |
| | | class="ranking-summary__tag-count {{_.tagBorderColor(item.proNum, item.changeNum)}}" |
| | | > |
| | | <text>{{item.changeNum}}</text> |
| | | <view></view> |
| | | </view> |
| | | <t-tag |
| | | max-width="{{130}}" |
| | | shape="square" |
| | | size="small" |
| | | theme="default" |
| | | variant="light-outline" |
| | | >æ´æ¹</t-tag |
| | | > |
| | | </view> |
| | | </view> |
| | | <view class="ranking-summary__nav-icon"> |
| | | <t-icon name="chevron-right" size="24rpx" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </block> |
| | | <t-empty-page wx:elif="{{!pageLoading}}" description="ææ ç¸å
³è®°å½" /> |
| | | <load-more |
| | | list-is-empty="{{!summaryList.length}}" |
| | | status="{{loadStatus}}" |
| | | bind:retry="_startLoad" |
| | | /> --> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | </view> |
| | |
| | | padding: initial; |
| | | } |
| | | |
| | | .supervision-search { |
| | | padding: 0 var(--td-spacer-1); |
| | | padding-top: 1px; |
| | | } |
| | | |
| | | .filter-wrap { |
| | | background: initial; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { searchScene } from '../../../../services/inspection/fetchScene'; |
| | | import { useLoading } from '../../../../behaviors/loading'; |
| | | |
| | | Page({ |
| | | behaviors: [useLoading], |
| | | data: { |
| | | placeholder: 'è¾å
¥å
³é®è¯æç´¢åºæ¯', |
| | | searchValue: '', |
| | | isSearch: false, |
| | | searchResult: [], |
| | | historyWords: [], |
| | | dialog: { |
| | | title: '确认å é¤å½ååå²è®°å½', |
| | | showCancelButton: true, |
| | | message: '', |
| | | }, |
| | | dialogShow: false, |
| | | }, |
| | | |
| | | historyTag: 'inspectionScene', |
| | | deleteType: 0, |
| | | deleteIndex: '', |
| | | |
| | | onLoad(options) {}, |
| | | |
| | | onShow() { |
| | | this.queryHistory(); |
| | | }, |
| | | |
| | | onReachBottom() { |
| | | this._loadMore(); |
| | | }, |
| | | |
| | | queryHistory() { |
| | | wx.getStorage({ |
| | | key: this.historyTag, |
| | | success: res => { |
| | | this.setData({ |
| | | historyWords: res.data, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | //å é¤æä¸ªåå²è®°å½ |
| | | deleteCurr(e) { |
| | | const { index } = e.currentTarget.dataset; |
| | | const { dialog } = this.data; |
| | | this.deleteIndex = index; |
| | | this.setData({ |
| | | dialog: { |
| | | ...dialog, |
| | | message: '确认å é¤å½ååå²è®°å½', |
| | | deleteType: 0, |
| | | }, |
| | | dialogShow: true, |
| | | }); |
| | | }, |
| | | |
| | | //æ¸
空åå²è®°å½ |
| | | handleClearHistory() { |
| | | const { dialog } = this.data; |
| | | this.deleteType = 1; |
| | | this.setData({ |
| | | dialog: { |
| | | ...dialog, |
| | | message: '确认å 餿æåå²è®°å½', |
| | | }, |
| | | dialogShow: true, |
| | | }); |
| | | }, |
| | | |
| | | confirm() { |
| | | const { historyWords } = this.data; |
| | | const { deleteType, deleteIndex } = this; |
| | | if (deleteType === 0) { |
| | | historyWords.splice(deleteIndex, 1); |
| | | this.setData({ |
| | | historyWords, |
| | | dialogShow: false, |
| | | }); |
| | | } else { |
| | | this.setData({ historyWords: [], dialogShow: false }); |
| | | } |
| | | wx.setStorage({ |
| | | key: this.historyTag, |
| | | data: [], |
| | | }); |
| | | }, |
| | | |
| | | close() { |
| | | this.setData({ dialogShow: false }); |
| | | }, |
| | | |
| | | //ç¹å»åå²è®°å½ |
| | | handleHistoryTap(e) { |
| | | const { historyWords } = this.data; |
| | | const { dataset } = e.currentTarget; |
| | | const _searchValue = historyWords[dataset.index || 0] || ''; |
| | | if (_searchValue) { |
| | | this.setData({ searchValue: _searchValue }); |
| | | this._startLoad(); |
| | | } |
| | | }, |
| | | |
| | | //ç¹å»æç´¢ |
| | | handleSubmit() { |
| | | const { historyWords, searchValue } = this.data; |
| | | if (historyWords.indexOf(searchValue) == -1) { |
| | | historyWords.push(searchValue); |
| | | this.setData({ historyWords }); |
| | | } |
| | | wx.setStorage({ |
| | | key: this.historyTag, |
| | | data: historyWords, |
| | | }); |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | //æ¸
é¤æç´¢ |
| | | handleClear() { |
| | | this.setData({ searchValue: '', searchResult: [], isSearch: false }); |
| | | }, |
| | | |
| | | handleChange() { |
| | | if (this.data.searchValue == '') { |
| | | this.setData({ searchResult: [], isSearch: false }); |
| | | } |
| | | }, |
| | | |
| | | _fetchData(page) { |
| | | const { searchValue } = this.data; |
| | | if (searchValue.length === 0) return; |
| | | this.setData({ isSearch: true }); |
| | | const area = { |
| | | sceneName: searchValue, |
| | | }; |
| | | return searchScene(area, page).then(res => { |
| | | this.setData({ |
| | | searchResult: page == 1 ? res.data : this.data.searchResult.concat(res.data), |
| | | }); |
| | | return res.head; |
| | | }); |
| | | }, |
| | | |
| | | handCellClick(e) { |
| | | const scene = e.detail; |
| | | wx.navigateTo({ |
| | | url: '/pages/inspection/detail/index', |
| | | success: result => { |
| | | result.eventChannel.emit('acceptInspectionDetailData', { |
| | | scene: scene, |
| | | time: new Date(), |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "æç´¢", |
| | | "onReachBottomDistance": 10, |
| | | "usingComponents": { |
| | | "scene-search-result": "/pages/inspection/scene/search/components/scene-search-result/index" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="page"> |
| | | <view class="page-header"> |
| | | <t-search |
| | | placeholder="{{placeholder}}" |
| | | model:value="{{searchValue}}" |
| | | bind:submit="handleSubmit" |
| | | bind:clear="handleClear" |
| | | bind:change="handleChange" |
| | | focus |
| | | > |
| | | </t-search> |
| | | </view> |
| | | |
| | | <view class="page-container"> |
| | | <scene-search-result |
| | | wx:for="{{searchResult}}" |
| | | wx:key="index" |
| | | wx:for-index="index" |
| | | result="{{item}}" |
| | | bind:click="handCellClick" |
| | | ></scene-search-result> |
| | | <load-more |
| | | list-is-empty="{{!searchResult.length}}" |
| | | status="{{loadStatus}}" |
| | | bind:retry="_startLoad" |
| | | /> |
| | | <t-empty |
| | | wx:if="{{loadStatus == 2 && isSearch && searchResult.length == 0}}" |
| | | icon="info-circle-filled" |
| | | description="æ å¹é
è®°å½" |
| | | /> |
| | | <block wx:if="{{!isSearch}}"> |
| | | <view wx:if="{{historyWords.length > 0}}" class="history-wrap"> |
| | | <view class="search-header"> |
| | | <text class="search-title">åå²æç´¢</text> |
| | | <text class="search-clear" bind:tap="handleClearHistory">æ¸
é¤</text> |
| | | </view> |
| | | <view class="search-content"> |
| | | <view |
| | | class="search-item" |
| | | hover-class="hover-history-item" |
| | | wx:for="{{historyWords}}" |
| | | bind:tap="handleHistoryTap" |
| | | bindlongpress="deleteCurr" |
| | | data-index="{{index}}" |
| | | wx:key="index" |
| | | > |
| | | {{item}} |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <t-empty |
| | | wx:else |
| | | t-class-image="t-empty__image" |
| | | image="/res/nodata.png" |
| | | description="请æç´¢" |
| | | /> |
| | | </block> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | <t-dialog |
| | | visible="{{dialogShow}}" |
| | | content="{{dialog.message}}" |
| | | bindconfirm="confirm" |
| | | bind:close="close" |
| | | confirm-btn="ç¡®å®" |
| | | cancel-btn="{{dialog.showCancelButton ? 'åæ¶' : null}}" |
| | | t-class-confirm="add-notes__confirm" |
| | | /> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .page { |
| | | background-color: var(--td-white-color1); |
| | | } |
| | | |
| | | .history-wrap { |
| | | margin-top: 44rpx; |
| | | } |
| | | |
| | | .search-header { |
| | | display: flex; |
| | | flex-flow: row nowrap; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search-title { |
| | | font-size: 30rpx; |
| | | font-family: PingFangSC-Semibold, PingFang SC; |
| | | font-weight: 600; |
| | | color: rgba(51, 51, 51, 1); |
| | | line-height: 42rpx; |
| | | } |
| | | |
| | | .search-clear { |
| | | font-size: 24rpx; |
| | | font-family: PingFang SC; |
| | | line-height: 32rpx; |
| | | color: #999999; |
| | | font-weight: normal; |
| | | } |
| | | |
| | | .search-content { |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-flow: row wrap; |
| | | justify-content: flex-start; |
| | | align-items: flex-start; |
| | | margin-top: 24rpx; |
| | | } |
| | | |
| | | .search-item { |
| | | color: #333333; |
| | | font-size: 24rpx; |
| | | line-height: 32rpx; |
| | | font-weight: normal; |
| | | margin-right: 24rpx; |
| | | margin-bottom: 24rpx; |
| | | background: #f5f5f5; |
| | | border-radius: 38rpx; |
| | | padding: 12rpx 24rpx; |
| | | } |
| | | |
| | | .add-notes__confirm { |
| | | color: #fa4126 !important; |
| | | /* color: #0d80a3 !important; */ |
| | | } |
| | | |
| | | .t-empty__image { |
| | | width: 240rpx !important; |
| | | height: 240rpx !important; |
| | | } |
| | |
| | | } |
| | | |
| | | .t-class-progress { |
| | | /* åæ¡æ¶ä¸çæ´ä½å®½é«æ¯åæ»ç224rpxï¼ä¿®æ¹äºæ¡æ¶æ·»å 两个宽é«åé */ |
| | | --td-progress-width: 80rpx; |
| | | --td-progress-height: 80rpx; |
| | | /* æå大å°åç */ |
| | | /* ï¼2023.10.11ï¼åæ¡æ¶ä¸çæ´ä½å®½é«æ¯åæ»ç224rpxï¼ä¿®æ¹äºæ¡æ¶æ·»å 两个宽é«åéï¼ï¼2024.11.19ï¼æ°æ¡æ¶çæ¬1.5.1 å·²ç»å å
¥ç¸åºçåé */ |
| | | --td-progress-circle-width: 80rpx; |
| | | /* --td-progress-width: 80rpx; |
| | | --td-progress-height: 80rpx; */ |
| | | /* æå大å°åæ¡æ¶ä¸æ·»å äºä»¥ä¸èªå®ä¹åé */ |
| | | --td-progress-info-font-size: 20rpx; |
| | | /* å
å宽é«åç */ |
| | | --td-progress-inner-size: calc(100% - 12rpx*1); |
| | | /* å
å宽é«åçï¼ï¼2024.11.19ï¼æ°æ¡æ¶çæ¬1.5.1 å·²ç»å å
¥ç¸åºçåé*/ |
| | | --td-progress-stroke-circle-width: 6rpx; |
| | | } |
| | | |
| | | /* .page .page-footer { |
| | |
| | | this._loadMore(); |
| | | }, |
| | | |
| | | onScenePickerConfirm(e) { |
| | | this.setScene(e); |
| | | this.fetchSupervision(); |
| | | this.fetchInspection(); |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | /** |
| | | * åå§å è½½ |
| | | * 彿æç鿡件é½è·åå°åå§å¼åï¼æ§è¡ä¸æ¬¡åå§åå è½½ |
| | |
| | | "description": "项ç®ç§æé
ç½®æä»¶ãæ¤æä»¶ä¸çå
容å°è¦ç project.config.json ä¸çç¸ååæ®µã项ç®çæ¹å¨ä¼å
忥尿¤æä»¶ä¸ãè¯¦è§ææ¡£ï¼https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", |
| | | "projectname": "ep-law-abiding-manage-weixin", |
| | | "setting": { |
| | | "compileHotReLoad": false, |
| | | "compileHotReLoad": true, |
| | | "urlCheck": false |
| | | }, |
| | | "libVersion": "3.5.3" |