简化主页
1. 新增简化主页界面;
2. 优化拆分了原主页的页面逻辑;
已修改15个文件
已删除1个文件
已添加14个文件
| | |
| | | "pages/inspection/scene/search/index", |
| | | "pages/inspection/scene/info/index", |
| | | "pages/inspection/scene/info/device-info/index", |
| | | "pages/inspection/scene/info/device-status/index" |
| | | "pages/inspection/scene/info/device-status/index", |
| | | "pages/simple-home/index" |
| | | ], |
| | | "tabBar": { |
| | | "custom": true, |
| | |
| | | import { |
| | | fetchLoginPW, |
| | | fetchUserInfo, |
| | | fetchUserBaseInfo, |
| | | } from '../services/usercenter/fetchUser'; |
| | | import { fetchLoginPW, fetchUserInfo, fetchUserBaseInfo } from '../services/usercenter/fetchUser'; |
| | | import { loadConfig } from '../behaviors/loadConfig'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | |
| | | app.globalData.accessToken.suserId = data.suserId; |
| | | app.globalData.accessToken.openId = data.openId; |
| | | if (accessTokenPW.userName) { |
| | | app.globalData.accessToken.userName = |
| | | accessTokenPW.userName; |
| | | app.globalData.accessToken.userName = accessTokenPW.userName; |
| | | } |
| | | if (accessTokenPW.password) { |
| | | app.globalData.accessToken.password = |
| | | accessTokenPW.password; |
| | | app.globalData.accessToken.password = accessTokenPW.password; |
| | | } |
| | | wx.setStorage({ |
| | | key: 'accessToken', |
| | |
| | | key: 'userInfo', |
| | | data: data, |
| | | success: result => { |
| | | loadConfig().then(res => { |
| | | wx.switchTab({ |
| | | url: '/pages/home/index', |
| | | loadConfig() |
| | | .then(res => { |
| | | // å¤æç¨æ·æ¯å¦è¿å
¥ç®å主页 |
| | | if (app.globalData.userConfig.ucExtension1 == 'simple') { |
| | | wx.redirectTo({ |
| | | url: '/pages/simple-home/index', |
| | | }); |
| | | } else { |
| | | wx.switchTab({ |
| | | url: '/pages/home/index', |
| | | }); |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.setData({ |
| | | loading: false, |
| | | }); |
| | | }); |
| | | }, |
| | | fail: err => { |
| | | this.setData({ |
| | | loading: false, |
| | | }); |
| | | }, |
| | | }); |
| | |
| | | |
| | | // 线ä¸ç管 |
| | | const inspectUrl = 'https://fyami.com.cn:447'; |
| | | // const inspectUrl = 'http://192.168.0.138:8082'; |
| | | // const inspectUrl = 'http://192.168.0.138:9001'; |
| | | // const inspectUrl = 'http://192.168.0.138:8080'; |
| | | // const inspectUrl = 'http://192.168.1.8:8080'; |
| | | |
| | |
| | | * åå§å è½½ |
| | | * 彿æç鿡件é½è·åå°åå§å¼åï¼æ§è¡ä¸æ¬¡åå§åå è½½ |
| | | * å
æ¬åºæ¯ç±»åãåºåãæ¶é´ä¸ä¸ªé项ï¼å
¨é¨è·ååå§å¼åï¼æ§è¡å è½½ |
| | | * @see options-proxy.js |
| | | */ |
| | | optionsCount: 0, |
| | | init() { |
| | |
| | | fetchInspectionStatistic, |
| | | fetchSubtaskSummaryByArea, |
| | | } from '../../services/inspection/fetchInspection'; |
| | | 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') |
| | | fetchSubtaskSummaryByArea({ |
| | | provincecode: provinceCode, |
| | | citycode: cityCode, |
| | |
| | | towncode: townCode, |
| | | scensetypeid: sceneTypeValue[0], |
| | | starttime: time, |
| | | endtime: time, |
| | | endtime: eTime, |
| | | }) |
| | | .then(res => { |
| | | this.setData({ |
| | |
| | | <train-card values="{{trainingList}}" /> |
| | | <!-- <train-card values="{{trainingList}}" /> --> |
| | | <info-cards cardTitle="æ§æ³å¨æ" infoList="{{infoList}}" bindnavTo="navToInfoPage"></info-cards> |
| | | <load-more list-is-empty="{{!infoList.length}}" status="{{loadStatus}}" bind:retry="_startLoad" /> |
| | |
| | | <view class="home-supervision-title"> |
| | | <!-- <view> --> |
| | | <!-- <text>线ä¸ç管</text> --> |
| | | <!-- <text class="home-supervision-title__note">æ¬æææ°</text> --> |
| | | <!-- <text>线ä¸ç管</text> --> |
| | | <!-- <text class="home-supervision-title__note">æ¬æææ°</text> --> |
| | | <!-- </view> --> |
| | | <!-- <view style="display: flex;align-items: center;"> --> |
| | | <t-time-picker |
| | | color="var(--td-font-white-1)" |
| | | picker-class="picker-location" |
| | | bind:timeInitValue="initTime" |
| | | bind:timePickerChange="onTimePickerConfirm" |
| | | > |
| | | </t-time-picker> |
| | | <location-picker |
| | | color="var(--td-font-white-1)" |
| | | style-mode="picker" |
| | | picker-class="picker-location" |
| | | bind:onChange="onLocationChange" |
| | | bind:locationInitValue="initLocation" |
| | | ></location-picker> |
| | | <t-time-picker |
| | | color="var(--td-font-white-1)" |
| | | picker-class="picker-location" |
| | | bind:timeInitValue="initTime" |
| | | bind:timePickerChange="onTimePickerConfirm" |
| | | > |
| | | </t-time-picker> |
| | | <location-picker |
| | | color="var(--td-font-white-1)" |
| | | style-mode="picker" |
| | | picker-class="picker-location" |
| | | bind:onChange="onLocationChange" |
| | | bind:locationInitValue="initLocation" |
| | | ></location-picker> |
| | | <!-- </view> --> |
| | | </view> |
| | | <scene-picker sceneMode="{{1}}" bind:sceneInitValue="initScene" bind:scenePickerChange="onScenePickerConfirm"> |
| | | <scene-picker |
| | | sceneMode="{{1}}" |
| | | bind:sceneInitValue="initScene" |
| | | bind:scenePickerChange="onScenePickerConfirm" |
| | | > |
| | | </scene-picker> |
| | |
| | | import dayjs from 'dayjs'; |
| | | |
| | | export function _getParamsArea(data) { |
| | | const { inspection, sceneTypeValue: scensetypeid, time, sort } = data; |
| | | const { inspection, sceneTypeValue: scensetypeid, time, sort, sortBy } = data; |
| | | const params = { |
| | | provincecode: inspection.provinceCode, |
| | | provincename: inspection.provinceName, |
| | |
| | | townname: inspection.townName, |
| | | scensetypeid: scensetypeid[0], |
| | | sort: sort, |
| | | sortBy: sortBy |
| | | }; |
| | | const t = dayjs(time); |
| | | params.starttime = t.startOf('month').format('YYYY-MM-DD HH:mm:ss'); |
| | |
| | | import dayjs from 'dayjs'; |
| | | import { useLoading } from '../../../behaviors/loading'; |
| | | import { useProblemChangeList } from "./problem-change-list.js"; |
| | | import { useStatistic } from "./statistic.js"; |
| | | import { useSortOptions } from "./sort-options.js"; |
| | | import { fetchSceneProSummary } from '../../../services/inspection/fetchScene'; |
| | | import { fetchProblemsStatistic } from '../../../services/inspection/fetchInspection'; |
| | | import { _getParamsArea } from '../param-util.js'; |
| | | |
| | | Page({ |
| | | behaviors: [useLoading], |
| | | behaviors: [useLoading, useProblemChangeList, useStatistic, useSortOptions], |
| | | data: { |
| | | summaryList: [], |
| | | sort: '', |
| | | sortBy: 'pro', |
| | | statistic: { |
| | | proNum: 0, |
| | | changeNum: 0, |
| | | }, |
| | | // summaryList: [], |
| | | // sort: '', |
| | | // sortBy: 'pro', |
| | | // statistic: { |
| | | // proNum: 0, |
| | | // changeNum: 0, |
| | | // }, |
| | | }, |
| | | |
| | | onLoad(options) { |
| | |
| | | }, |
| | | |
| | | _fetchData(page) { |
| | | const f1 = this.fetchSceneProSummary(page); |
| | | const f2 = this.fetchProblems(page); |
| | | const params = _getParamsArea(this.data); |
| | | const f1 = this.fetchSceneProSummary(params, page); |
| | | const f2 = this.fetchProblems(params, page); |
| | | return Promise.all([f1, f2]).then(res => { |
| | | // è¿å请æ±f1çåé¡µä¿¡æ¯ |
| | | return res[0]; |
| | | }); |
| | | }, |
| | | |
| | | fetchSceneProSummary(page) { |
| | | const params = _getParamsArea(this.data); |
| | | const { sortBy } = this.data; |
| | | return fetchSceneProSummary({ area: params, sortBy, 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; |
| | | }); |
| | | }, |
| | | // 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(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; |
| | | }); |
| | | }, |
| | | // 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._startLoad(); |
| | | }, |
| | | |
| | | // é®é¢æ°æåºæ´æ¹ |
| | | onProNumSortChange(e) { |
| | | const { sorts } = e.detail; |
| | | this.setData({ |
| | | sort: sorts, |
| | | }); |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | // æ´æ¹çæåºæ´æ¹ |
| | | onChangePerSortChange(e) {}, |
| | | |
| | | 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, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | // 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, |
| | | // }); |
| | | // }, |
| | | // }); |
| | | // }, |
| | | }); |
| | |
| | | <import src="/pages/common/template/template-loading.wxml" /> |
| | | <!-- <import src="/pages/common/template/template-loading.wxml" /> --> |
| | | <wxs src="./util.wxs" module="_" /> |
| | | |
| | | <view class="page"> |
| | |
| | | bind:scenePickerChange="onScenePickerConfirm" |
| | | /> |
| | | </view> |
| | | <view class="ranking-summary__item-abstract" style="margin-left: var(--td-spacer)"> |
| | | <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> |
| | | <view class="filter-wrap"> |
| | | </view> --> |
| | | <include src="/pages/inspection/ranking/sort-options.wxml" /> |
| | | <!-- <view class="filter-wrap"> |
| | | <sort-btn |
| | | text="é®é¢æ°" |
| | | custom-class="flex-start " |
| | |
| | | defaultSort="{{changeSort}}" |
| | | bind:sortsChange="onSortChange" |
| | | ></sort-btn> |
| | | </view> |
| | | </view> --> |
| | | </view> |
| | | </t-sticky> |
| | | <view class="page-container"> |
| | | <template is="pulldown-loading" wx:if="{{pageLoading && summaryList.length != 0}}" /> |
| | | <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" |
| | |
| | | list-is-empty="{{!summaryList.length}}" |
| | | status="{{loadStatus}}" |
| | | bind:retry="_startLoad" |
| | | /> |
| | | /> --> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | </view> |
| | |
| | | @import '../../../components/filter/index.wxss'; |
| | | @import './problem-change-list.wxss'; |
| | | @import './statistic.wxss'; |
| | | @import './sort-options.wxss'; |
| | | |
| | | .page .page-header { |
| | | background: linear-gradient(var(--td-primary-color-7), var(--td-bg-color)); |
| | |
| | | .fy-loading-indicator, |
| | | .fy-loading-text { |
| | | color: var(--td-text-color-placeholder) !important; |
| | | } |
| | | |
| | | .ranking-summary__item { |
| | | background-color: var(--td-bg-color-fade); |
| | | border-radius: var(--td-border-radius); |
| | | box-shadow: var(--td-shadow-4); |
| | | padding: var(--td-spacer); |
| | | margin-top: var(--td-spacer); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | gap: 2px; |
| | | color: var(--td-text-color-primary); |
| | | } |
| | | |
| | | .ranking-summary__item:active { |
| | | background-color: var(--td-gray-color-1); |
| | | } |
| | | |
| | | .ranking-summary__item .ranking-summary__item-name { |
| | | --ei-font-size: var(--td-font-size-m); |
| | | --ei-line-height: calc(var(--td-text-line-height) * var(--ei-font-size)); |
| | | font-size: var(--ei-font-size); |
| | | line-height: var(--ei-line-height); |
| | | height: calc(var(--ei-line-height) * 2); |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .ranking-summary__item-abstract { |
| | | font-size: var(--td-font-size-s); |
| | | color: var(--td-text-color-secondary); |
| | | } |
| | | |
| | | .flex-v { |
| | | position: relative; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .ranking-summary__item-tag__wrap{ |
| | | position: relative; |
| | | display: flex; |
| | | gap: 2px; |
| | | } |
| | | |
| | | .ranking-summary__item-tag__wrap .ranking-summary__item-tag { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | gap: 2px; |
| | | } |
| | | |
| | | .ranking-summary__item-tag .ranking-summary__tag-count { |
| | | /* background-color: var(--td-primary-color-10); */ |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | /* color: var(--td-text-color-anti); */ |
| | | border: 6rpx solid var(--td-success-color-5); |
| | | border-radius: var(--td-border-radius); |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .ranking-summary__tag-count__error { |
| | | border-color: var(--td-error-color-5) !important; |
| | | } |
| | | |
| | | .ranking-summary__tag-count__warning { |
| | | border-color: var(--td-warning-color) !important; |
| | | } |
| | | |
| | | .ranking-summary__nav-icon { |
| | | position: relative; |
| | | bottom: 0px; |
| | | right: 0px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | /* margin-top: var(--td-spacer); */ |
| | | /* background-color: blanchedalmond; */ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { fetchSceneProSummary } from '../../../services/inspection/fetchScene'; |
| | | |
| | | export const useProblemChangeList = Behavior({ |
| | | data: { |
| | | summaryList: [], |
| | | }, |
| | | methods: { |
| | | fetchSceneProSummary(params, page) { |
| | | 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; |
| | | }); |
| | | }, |
| | | |
| | | 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, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <import src="/pages/common/template/template-loading.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" |
| | | /> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .ranking-summary__item { |
| | | background-color: var(--td-bg-color-fade); |
| | | border-radius: var(--td-border-radius); |
| | | box-shadow: var(--td-shadow-4); |
| | | padding: var(--td-spacer); |
| | | margin-top: var(--td-spacer); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | gap: 2px; |
| | | color: var(--td-text-color-primary); |
| | | } |
| | | |
| | | .ranking-summary__item:active { |
| | | background-color: var(--td-gray-color-1); |
| | | } |
| | | |
| | | .ranking-summary__item .ranking-summary__item-name { |
| | | --ei-font-size: var(--td-font-size-m); |
| | | --ei-line-height: calc(var(--td-text-line-height) * var(--ei-font-size)); |
| | | font-size: var(--ei-font-size); |
| | | line-height: var(--ei-line-height); |
| | | height: calc(var(--ei-line-height) * 2); |
| | | display: -webkit-box; |
| | | -webkit-box-orient: vertical; |
| | | -webkit-line-clamp: 2; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | |
| | | .flex-v { |
| | | position: relative; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .ranking-summary__item-tag__wrap{ |
| | | position: relative; |
| | | display: flex; |
| | | gap: 2px; |
| | | } |
| | | |
| | | .ranking-summary__item-tag__wrap .ranking-summary__item-tag { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | gap: 2px; |
| | | } |
| | | |
| | | .ranking-summary__item-tag .ranking-summary__tag-count { |
| | | /* background-color: var(--td-primary-color-10); */ |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | /* color: var(--td-text-color-anti); */ |
| | | border: 6rpx solid var(--td-success-color-5); |
| | | border-radius: var(--td-border-radius); |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .ranking-summary__tag-count__error { |
| | | border-color: var(--td-error-color-5) !important; |
| | | } |
| | | |
| | | .ranking-summary__tag-count__warning { |
| | | border-color: var(--td-warning-color) !important; |
| | | } |
| | | |
| | | .ranking-summary__nav-icon { |
| | | position: relative; |
| | | bottom: 0px; |
| | | right: 0px; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | /* margin-top: var(--td-spacer); */ |
| | | /* background-color: blanchedalmond; */ |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export const useSortOptions = Behavior({ |
| | | data: { |
| | | sort: '', |
| | | sortBy: 'pro', |
| | | }, |
| | | methods: { |
| | | 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', |
| | | }); |
| | | if (typeof this._startSortLoad === 'function') { |
| | | this._startSortLoad() |
| | | } else { |
| | | this._startLoad(); |
| | | } |
| | | }, |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="filter-wrap"> |
| | | <sort-btn |
| | | text="é®é¢æ°" |
| | | icon-color="var(--td-warning-color-4)" |
| | | data-type="pro" |
| | | defaultSort="{{proSort}}" |
| | | bind:sortsChange="onSortChange" |
| | | ></sort-btn> |
| | | <sort-btn |
| | | text="æ´æ¹ç" |
| | | icon-color="var(--td-warning-color-4)" |
| | | data-type="changePer" |
| | | defaultSort="{{changeSort}}" |
| | | bind:sortsChange="onSortChange" |
| | | ></sort-btn> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .filter-wrap { |
| | | background: initial; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { fetchProblemsStatistic } from '../../../services/inspection/fetchInspection'; |
| | | |
| | | export const useStatistic = Behavior({ |
| | | data: { |
| | | statistic: { |
| | | proNum: 0, |
| | | changeNum: 0, |
| | | }, |
| | | }, |
| | | methods: { |
| | | fetchProblems(params, page) { |
| | | 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; |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="ranking-summary__item-abstract" style="margin-left: var(--td-spacer)"> |
| | | é®é¢æ»è®¡{{statistic.proNum}}个ï¼å·²æ´æ¹{{statistic.changeNum}}ä¸ªï¼æªæ´æ¹{{statistic.proNum - |
| | | statistic.changeNum}}ä¸ªï¼æ´æ¹ç{{statistic.changePer}} |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .ranking-summary__item-abstract { |
| | | font-size: var(--td-font-size-s); |
| | | color: var(--td-text-color-secondary); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from "dayjs"; |
| | | import { useLoading } from '../../behaviors/loading'; |
| | | import { useOptions } from '../home/options-proxy.js'; |
| | | import { useInsepction } from '../home/inspection-proxy.js'; |
| | | // import { useSupervision } from '../home/supervision-proxy.js'; |
| | | // import { useNotice } from '../home/notice-proxy.js'; |
| | | // import { useNews } from '../home/news-proxy.js'; |
| | | import { useProblemChangeList } from '../inspection/ranking/problem-change-list.js'; |
| | | import { useStatistic } from '../inspection/ranking/statistic.js'; |
| | | import { useSortOptions } from '../inspection/ranking/sort-options.js'; |
| | | |
| | | const app = getApp(); |
| | | |
| | | Page({ |
| | | behaviors: [ |
| | | useLoading, |
| | | useOptions, |
| | | useInsepction, |
| | | // useSupervision, |
| | | // useNotice, |
| | | // useNews, |
| | | useStatistic, |
| | | useSortOptions, |
| | | useProblemChangeList, |
| | | ], |
| | | data: { |
| | | placeholder: 'æç´¢ä¼ä¸è¯¦æ
', |
| | | userName: app.globalData.userInfo.name, |
| | | }, |
| | | |
| | | onLoad(options) { |
| | | this.setData({ userName: app.globalData.userInfo.name }); |
| | | }, |
| | | |
| | | onShow() { |
| | | // this.getTabBar().init(); |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | onReachBottom() { |
| | | this._loadMore(); |
| | | }, |
| | | |
| | | /** |
| | | * åå§å è½½ |
| | | * 彿æç鿡件é½è·åå°åå§å¼åï¼æ§è¡ä¸æ¬¡åå§åå è½½ |
| | | * å
æ¬åºæ¯ç±»åãåºåãæ¶é´ä¸ä¸ªé项ï¼å
¨é¨è·ååå§å¼åï¼æ§è¡å è½½ |
| | | */ |
| | | optionsCount: 0, |
| | | init() { |
| | | this.optionsCount++; |
| | | if (this.optionsCount == 3) this._startLoad(); |
| | | }, |
| | | |
| | | _fetchData(page) { |
| | | const array = []; |
| | | // // æ§æ³å¨æ |
| | | // const f3 = this._enforcementNews(page); |
| | | // array.push(f3); |
| | | if (page == 1) { |
| | | // // 线ä¸ç管 |
| | | // this.fetchSupervision(page); |
| | | // ç°åºå·¡æ¥ |
| | | this.fetchInspection(page); |
| | | const params = this.getParam(); |
| | | const f1 = this.fetchSceneProSummary(params, page); |
| | | array.push(f1); |
| | | const f2 = this.fetchProblems(params, page); |
| | | array.push(f2); |
| | | // // 工使é |
| | | // const f1 = this._fetchNotice(page); |
| | | // array.push(f1); |
| | | // const f4 = this._fetchUnReadNoticeNum(page); |
| | | // array.push(f4); |
| | | // // 宿³å¹è® |
| | | // const f2 = this._complianceTraining(page); |
| | | // array.push(f2); |
| | | } |
| | | return Promise.all(array).then(res => { |
| | | return res[0]; |
| | | }); |
| | | }, |
| | | |
| | | // æåºåæ¢åçå è½½å½æ° |
| | | _startSortLoad() { |
| | | const params = this.getParam(); |
| | | this.setData({ pageLoading: true }); |
| | | this.fetchSceneProSummary(params, 1).finally(() => this.setData({ pageLoading: false })); |
| | | }, |
| | | |
| | | getParam() { |
| | | const { provinceCode, cityCode, districtCode, townCode, sceneTypeValue, time, sort, sortBy } = |
| | | this.data; |
| | | const params = { |
| | | provincecode: provinceCode, |
| | | // provincename: provinceName, |
| | | citycode: cityCode, |
| | | // cityname: cityName, |
| | | districtcode: districtCode, |
| | | // districtname: districtName, |
| | | towncode: townCode, |
| | | // townname: townName, |
| | | scensetypeid: sceneTypeValue[0], |
| | | sort: sort, |
| | | sortBy: sortBy, |
| | | }; |
| | | const t = dayjs(time); |
| | | params.starttime = t.startOf('month').format('YYYY-MM-DD HH:mm:ss'); |
| | | params.endtime = t.endOf('month').format('YYYY-MM-DD HH:mm:ss'); |
| | | |
| | | return params; |
| | | }, |
| | | |
| | | navToSearchPage() { |
| | | wx.navigateTo({ |
| | | url: '/pages/enterprise/search/index', |
| | | success: result => {}, |
| | | fail: res => {}, |
| | | complete: res => {}, |
| | | }); |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "é¦é¡µ", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "enablePullDownRefresh": true, |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarBackgroundColor": "#389AFF", |
| | | "navigationStyle":"custom", |
| | | "usingComponents": { |
| | | "stat-card": "/components/stat-card/index", |
| | | "info-cards": "/components/info-cards/index", |
| | | "load-more": "/components/load-more/index", |
| | | "notice-card": "/components/notice-card/index", |
| | | "train-card": "/components/train-card/index", |
| | | "scene-picker": "/components/scene-picker/index", |
| | | "location-picker": "/components/picker/location-picker/index", |
| | | "t-time-picker": "/components/time-picker/index", |
| | | "sort-btn": "/components/sort-btn/index", |
| | | "t-empty-page": "/components/empty-page/index" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <import src="/pages/common/template/template-loading.wxml" /> |
| | | |
| | | <t-navbar> |
| | | <view slot="left" class="t-class-navbar"> |
| | | <t-icon name="user" size="36rpx" /> |
| | | <view class="t-class-navbar-title"> {{userName}} </view> |
| | | </view> |
| | | </t-navbar> |
| | | <view class="page"> |
| | | <template is="pulldown-loading" wx:if="{{pageLoading}}" /> |
| | | <view class="page-header"> |
| | | <!-- <view slot="left" bind:tap="navToSearchPage"> |
| | | <t-search shape="square" placeholder="{{placeholder}}" disabled /> |
| | | </view> --> |
| | | <include src="/pages/home/options.wxml" /> |
| | | <include src="/pages/home/inspection.wxml" /> |
| | | </view> |
| | | |
| | | <view class="page-container"> |
| | | <!-- <t-sticky> --> |
| | | <include src="/pages/inspection/ranking/statistic.wxml" /> |
| | | <include src="/pages/inspection/ranking/sort-options.wxml" /> |
| | | <!-- </t-sticky> --> |
| | | <!-- <view class="home-supervision-wrap"> --> |
| | | <include src="/pages/inspection/ranking/problem-change-list.wxml" /> |
| | | <!-- <include src="/pages/home/supervision.wxml" /> --> |
| | | <!-- </view> --> |
| | | <!-- <include src="/pages/home/notice.wxml" /> |
| | | <include src="/pages/home/news.wxml" /> --> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @import '/components/filter/index.wxss'; |
| | | @import '/pages/home/index.wxss'; |
| | | @import '/pages/inspection/ranking/statistic.wxss'; |
| | | @import '/pages/inspection/ranking/sort-options.wxss'; |
| | | @import '/pages/inspection/ranking/problem-change-list.wxss'; |
| | | |
| | | page { |
| | | --header-bottom-padding: 150rpx; |
| | | } |
| | | /* .page { |
| | | background: linear-gradient(var(--td-primary-color-7), var(--td-bg-color),); |
| | | } */ |
| | | |
| | | .page .page-header { |
| | | /* background: transparent; */ |
| | | background: linear-gradient(var(--td-primary-color-7), var(--td-bg-color)); |
| | | padding-bottom: var(--header-bottom-padding); |
| | | /* padding-bottom: initial; */ |
| | | /* min-height: 380rpx; */ |
| | | /* border-bottom-left-radius: 40%; |
| | | border-bottom-right-radius: 40%; */ |
| | | } |
| | | |
| | | /* .page .page-container { |
| | | margin-top: initial; |
| | | } */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ç®å主页ï¼ç¨äºé¨å次级管çåææ¿åºé¨é¨ä½¿ç¨ï¼ä¸»è¦å±ç¤ºç°åºç管ç¸å
³å
容 |
| | |
| | | </view> --> |
| | | </view> |
| | | <view class="page-footer"> |
| | | <view>ä¸å¡æå¯¼ï¼ä¸æµ·å¸çæç¯å¢å±æ§æ³æ»é</view> |
| | | <!-- <view>ä¸å¡æå¯¼ï¼ä¸æµ·å¸çæç¯å¢å±æ§æ³æ»é</view> --> |
| | | <view>ææ¯æ¯æï¼ä¸æµ·é£ç¾½ç¯ä¿ç§ææéå
¬å¸</view> |
| | | </view> |
| | | </view> |
| | |
| | | </view> --> |
| | | </view> |
| | | <view class="page-footer"> |
| | | <view>ä¸å¡æå¯¼ï¼ä¸æµ·å¸çæç¯å¢å±æ§æ³æ»é</view> |
| | | <!-- <view>ä¸å¡æå¯¼ï¼ä¸æµ·å¸çæç¯å¢å±æ§æ³æ»é</view> --> |
| | | <view>ææ¯æ¯æï¼ä¸æµ·é£ç¾½ç¯ä¿ç§ææéå
¬å¸</view> |
| | | </view> |
| | | </view> |
| | |
| | | // è·åå·¡æ¥ä»»å¡æ°ååèªé®é¢æ°ç»è®¡ |
| | | function fetchInspectionStatistic(area) { |
| | | // 两个系ç»ä¹é´çåºæ¯ç±»åéè¦è½¬æ¢ |
| | | area.scensetypeid = transSceneType(area.scensetypeid); |
| | | const data = {...area} |
| | | data.scensetypeid = transSceneType(area.scensetypeid); |
| | | return post( |
| | | { |
| | | url: `/task/progress`, |
| | | data: area, |
| | | data: data, |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |
| | |
| | | |
| | | // è·ååé®é¢ç±»ååççæ°éç»è®¡ |
| | | function fetchProblemsStatistic(area) { |
| | | area.scensetypeid = transSceneType(area.scensetypeid); |
| | | const data = {...area} |
| | | data.scensetypeid = transSceneType(area.scensetypeid); |
| | | return post( |
| | | { |
| | | url: `/problemlist/getStatisticalResult`, |
| | | data: area, |
| | | data: data, |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |
| | |
| | | |
| | | // |
| | | function fetchSubtasksByProType({ area, pType }) { |
| | | area.scensetypeid = transSceneType(area.scensetypeid); |
| | | const data = {...area} |
| | | data.scensetypeid = transSceneType(area.scensetypeid); |
| | | return post( |
| | | { |
| | | url: `/problemlist/type/subtask`, |
| | | params: { pType: pType }, |
| | | data: area, |
| | | data: data, |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |
| | |
| | | } |
| | | |
| | | function fetchSubtaskSummaryByArea(area) { |
| | | area.scensetypeid = transSceneType(area.scensetypeid); |
| | | const data = {...area} |
| | | data.scensetypeid = transSceneType(area.scensetypeid); |
| | | return post( |
| | | { |
| | | url: `/subtask/summary/area`, |
| | | data: area, |
| | | data: data, |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |
| | |
| | | * æ¥æ¾åºæ¯ |
| | | */ |
| | | function searchScene(area, page = 1, perPage = 20) { |
| | | area.scensetypeid = transSceneType(area.scensetypeid); |
| | | const data = {...area} |
| | | data.scensetypeid = transSceneType(area.scensetypeid); |
| | | return post( |
| | | { |
| | | url: `/scense/find`, |
| | |
| | | page: page, |
| | | per_page: perPage, |
| | | }, |
| | | data: area, |
| | | data: data, |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => res.data); |
| | | } |
| | | |
| | | // |
| | | function fetchSceneProSummary({ area, sortBy, page = 1, per_page = 30 }) { |
| | | area.scensetypeid = transSceneType(area.scensetypeid); |
| | | function fetchSceneProSummary({ area, page = 1, per_page = 30 }) { |
| | | const data = {...area} |
| | | data.scensetypeid = transSceneType(area.scensetypeid); |
| | | return post( |
| | | { |
| | | url: `/problemlist/summary/scene`, |
| | | params: { |
| | | sortBy: sortBy, |
| | | page: page, |
| | | per_page: per_page, |
| | | }, |
| | | data: area, |
| | | data: data, |
| | | }, |
| | | inspectUrl, |
| | | ).then(res => { |