线索任务
1. 新增任务完成统计接口
2. 新增任务完成状态展示
| | |
| | | } |
| | | }, |
| | | "requiredPrivateInfos": [ |
| | | "chooseLocation" |
| | | "chooseLocation", |
| | | "getLocation" |
| | | ] |
| | | } |
| | |
| | | |
| | | // 道路应急线索 |
| | | const clueUrl = 'https://fyami.com.cn:448/'; |
| | | // const clueUrl = 'http://192.168.0.110:8080/'; |
| | | // const clueUrl = 'http://192.168.0.110:8084/'; |
| | | const cu = 'https://fyami.com.cn:448'; |
| | | // const cu = 'http://192.168.0.110:8080'; |
| | | // const cu = 'http://192.168.0.110:8084'; |
| | | const cluePicUrl = `${cu}/images/`; |
| | | |
| | | // 运行模式 |
| | |
| | | import dayjs from 'dayjs'; |
| | | |
| | | import { useLoading } from '../../../behaviors/loading'; |
| | | import { useOptions } from './options-proxy.js'; |
| | | import { useStatistic } from './statistic-proxy.js'; |
| | | import { useTasks } from './tasks-proxy.js'; |
| | | |
| | | import { fetchClueTask } from '../../../services/clue/fetchClue'; |
| | | |
| | | const app = getApp(); |
| | | |
| | |
| | | |
| | | onShow() { |
| | | if (this.getTabBar()) { |
| | | this.getTabBar().init(); |
| | | this.getTabBar().init(); |
| | | } |
| | | this.refresh(); |
| | | // this.refresh(); |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | |
| | | }, |
| | | |
| | | refresh() { |
| | | this._startLoad(); |
| | | if (this.optionsCount >= 2) this._startLoad(); |
| | | }, |
| | | |
| | | _fetchData(page) { |
| | | return fetchClueTask({}).then(res => { |
| | | this.setData({ clueTaskList: res.data }); |
| | | this.calClueCount(); |
| | | this.formatClueTask(); |
| | | const array = []; |
| | | array.push(this.searchClueTask(page)); |
| | | if (page == 1) { |
| | | array.push(this.fetchClueTaskSummary(page)); |
| | | } |
| | | return Promise.all(array).then(res => { |
| | | return res[0].head; |
| | | }); |
| | | }, |
| | | |
| | | _getOptions() { |
| | | const { location, time } = this.data; |
| | | return { |
| | | ...location, |
| | | startTime: dayjs(time).startOf('month').format('YYYY-MM-DD HH:mm:ss'), |
| | | endTime: dayjs(time).endOf('month').format('YYYY-MM-DD HH:mm:ss'), |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | */ |
| | | export const useOptions = Behavior({ |
| | | data: { |
| | | time:'', |
| | | time: '', |
| | | }, |
| | | methods: { |
| | | setLocation(e) { |
| | |
| | | locationValue, |
| | | } = e.detail; |
| | | this.setData({ |
| | | provinceName, |
| | | cityName, |
| | | districtName, |
| | | townName, |
| | | provinceCode, |
| | | cityCode, |
| | | districtCode, |
| | | townCode, |
| | | locationValue, |
| | | location: { |
| | | provinceName, |
| | | cityName, |
| | | districtName, |
| | | townName, |
| | | provinceCode, |
| | | cityCode, |
| | | districtCode, |
| | | townCode, |
| | | locationValue, |
| | | }, |
| | | }); |
| | | }, |
| | | initLocation(e) { |
| | |
| | | // 行政区划切换时,获取新的线上监管信息以及线下巡查监管信息 |
| | | onLocationChange(e) { |
| | | this.setLocation(e); |
| | | this.fetchSupervision(); |
| | | this.fetchInspection(); |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | // 时间更改 |
| | |
| | | import { getClueStatistic } from '../../../model/clue/clueTask'; |
| | | import { fetchClueTaskSummary } from '../../../services/clue/fetchClue'; |
| | | |
| | | |
| | | /** |
| | | * 线索任务统计相关信息获取逻辑 |
| | |
| | | clueCountRes: [], |
| | | }, |
| | | methods: { |
| | | fetchClueTaskSummary(page) { |
| | | const options = this._getOptions(); |
| | | fetchClueTaskSummary(options).then(res => { |
| | | const { |
| | | totalCount, |
| | | internalTaskCount, |
| | | externalTaskCount, |
| | | finishedCount, |
| | | unfinishedCount, |
| | | internalFinishedCount, |
| | | internalUnFinishedCount, |
| | | externalFinishedCount, |
| | | externalUnFinishedCount, |
| | | } = res.data; |
| | | const p1 = Math.round((finishedCount / totalCount) * 1000) / 10; |
| | | const p2 = Math.round((unfinishedCount / totalCount) * 1000) / 10; |
| | | this.setData({ |
| | | clueCountRes: [ |
| | | { |
| | | name: '总计', |
| | | value: totalCount, |
| | | diff: '', |
| | | clickable: false, |
| | | }, |
| | | { |
| | | name: '已完成', |
| | | value: finishedCount, |
| | | diff: totalCount == 0 ? '0%' : `${p1}%`, |
| | | clickable: false, |
| | | }, |
| | | { |
| | | name: '待完成', |
| | | value: unfinishedCount, |
| | | diff: totalCount == 0 ? '0%' : `${p2}%`, |
| | | clickable: false, |
| | | }, |
| | | // { |
| | | // name: '待完成', |
| | | // value: unfinishedCount, |
| | | // diff: totalCount == 0 ? '0%' : `${p2}%`, |
| | | // clickable: false, |
| | | // }, |
| | | ], |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 计算线索巡查完成情况 |
| | | */ |
| | | calClueCount() { |
| | | this.setData({ |
| | | clueCountRes: getClueStatistic(this.data.clueTaskList), |
| | | }); |
| | | }, |
| | | // calClueCount() { |
| | | // this.setData({ |
| | | // clueCountRes: getClueStatistic(this.data.clueTaskList), |
| | | // }); |
| | | // }, |
| | | }, |
| | | }); |
| | |
| | | import dataResponseLevel from '../../../common/clue/dataResponseLevel'; |
| | | import dataTravelMode from '../../../common/clue/dataTravelMode'; |
| | | |
| | | import { searchClueTask } from '../../../services/clue/fetchClue'; |
| | | |
| | | |
| | | /** |
| | | * 线索任务列表展示相关逻辑 |
| | | */ |
| | | export const useTasks = Behavior({ |
| | | data: {}, |
| | | methods: { |
| | | searchClueTask(page) { |
| | | const options = this._getOptions() |
| | | options.finished = false |
| | | return searchClueTask(options, page, 30).then(res => { |
| | | this.setData({ clueTaskList: res.data }); |
| | | this.formatClueTask(); |
| | | |
| | | return res.head; |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | | * 格式化 |
| | | */ |
| | |
| | | bindtap="handleClueTaskClick" |
| | | > |
| | | <view class="clue-task__title-wrap"> |
| | | <view class="clue-task__title">{{item._taskTime}}</view> |
| | | <view class="clue-task__title"> |
| | | <t-tag variant="light" theme="{{item.finished ? 'success' : 'danger'}}" |
| | | >{{item.finished ? '完成' : '待处理'}}</t-tag |
| | | > |
| | | {{item._taskTime}} |
| | | </view> |
| | | <view class="clue-task__abstract"> |
| | | 应急巡查 |
| | | <t-icon name="chevron-right" size="var(--icon-width)" color="black" /> |
| | |
| | | } |
| | | |
| | | .clue-task__title { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 4px; |
| | | font-weight: 550; |
| | | font-size: var(--td-font-size-m); |
| | | } |
| | |
| | | |
| | | // 添加图片 |
| | | handleAddImg(e) { |
| | | wx.chooseAddress({ |
| | | |
| | | }) |
| | | wx.getLocation({ |
| | | type:'wgs84', |
| | | success:res=>{ |
| | | this.setData({ |
| | | locations: { |
| | | ...res, |
| | | coorTxt: `${res.longitude},${res.latitude}`, |
| | | }, |
| | | }); |
| | | } |
| | | }) |
| | | const { fileList } = this.data; |
| | | const { files } = e.detail; |
| | | this.setData({ |
| | |
| | | /> |
| | | </t-cell> |
| | | <view wx:if="{{validated && (!fileList || fileList.length == 0)}}" class="tips"> |
| | | 问题图片至少选一张 |
| | | </view> |
| | | 问题图片至少选一张 |
| | | </view> |
| | | </t-form> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | |
| | | "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": true |
| | | }, |
| | | "libVersion": "3.7.12" |
| | |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 查询线索任务 |
| | | * @param {object} options 查询条件 |
| | | * @param {Number} page 页码 |
| | | * @param {Number} per_page 单页数据量 |
| | | * @returns |
| | | */ |
| | | function searchClueTask(options, page, per_page) { |
| | | return post( |
| | | { |
| | | url: `clue/task/search`, |
| | | params:{page, per_page}, |
| | | data: options, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | return res.data; |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 查询线索任务 |
| | | * @param {object} options 查询条件 |
| | | * @returns |
| | | */ |
| | | function fetchClueTaskSummary(options) { |
| | | return post( |
| | | { |
| | | url: `clue/task/summary`, |
| | | data: options, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | return res.data; |
| | | }); |
| | | } |
| | | /******************************************************************************* */ |
| | | /** |
| | | * 获取线索结论 |
| | |
| | | fetchClue, |
| | | fetchClueInternal, |
| | | fetchClueTask, |
| | | searchClueTask, |
| | | fetchClueTaskSummary, |
| | | getConclusion, |
| | | uploadConclusion, |
| | | updateQuestion, |