| | |
| | | "pages/usercenter/login/login-home/index", |
| | | "pages/home/index", |
| | | "pages/supervision/index", |
| | | "pages/cluetask/home/index", |
| | | "pages/assist/index", |
| | | "pages/usercenter/index", |
| | | "pages/enterprise/search/index", |
| | |
| | | "pages/inspection/scene/info/device-status/index", |
| | | "pages/simple-home/index", |
| | | "pages/inspection/ranking/search/index", |
| | | "pages/cluetask/home/index" |
| | | "pages/cluetask/manage/index", |
| | | "pages/cluetask/question/index", |
| | | "pages/cluetask/conclusion/index" |
| | | ], |
| | | "tabBar": { |
| | | "custom": true, |
| | |
| | | { |
| | | "pagePath": "pages/supervision/index", |
| | | "text": "ç²¾ç»åç管" |
| | | }, |
| | | { |
| | | "pagePath": "pages/cluetask/home/index", |
| | | "text": "åºæ¥çº¿ç´¢" |
| | | }, |
| | | { |
| | | "pagePath": "pages/selfpatrol/index", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // åºæ¥çº¿ç´¢ä»»å¡ååºçº§å« |
| | | const ConclusionType = [ |
| | | { value: 'æé®é¢', label: 'æé®é¢' }, |
| | | { value: 'æ é®é¢', label: 'æ é®é¢' }, |
| | | { value: '已解å³', label: '已解å³' }, |
| | | ]; |
| | | |
| | | export default { |
| | | ConclusionType, |
| | | toLabel(value) { |
| | | let r = ConclusionType.find(item => { |
| | | return item.value == value; |
| | | }); |
| | | if (!r) r = ConclusionType[0]; |
| | | return r.label; |
| | | }, |
| | | |
| | | toLabel2(value) { |
| | | let l = this.toLabel(value); |
| | | if (l == ConclusionType[0].label) { |
| | | l = '/'; |
| | | } |
| | | return l; |
| | | }, |
| | | |
| | | toValue(label) { |
| | | const r = ConclusionType.find(item => { |
| | | return item.label == label; |
| | | }); |
| | | return r.value; |
| | | }, |
| | | }; |
| | |
| | | } |
| | | |
| | | function toLabel(value) { |
| | | for (const iterator of Towns) { |
| | | let r = iterator.value.find(item => { |
| | | for (const key in Towns) { |
| | | let r = Towns[key].find(item => { |
| | | return item.value == value; |
| | | }); |
| | | if (r) { |
| | |
| | | } |
| | | |
| | | function toValue(label) { |
| | | for (const iterator of Towns) { |
| | | let r = iterator.value.find(item => { |
| | | for (const key in Towns) { |
| | | let r = Towns[key].find(item => { |
| | | return item.label == label; |
| | | }); |
| | | if (r) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // components/descriptions-list-item/index.js |
| | | Component({ |
| | | options: { |
| | | addGlobalClass: true, |
| | | multipleSlots: true, |
| | | }, |
| | | /** |
| | | * ç»ä»¶ç屿§å表 |
| | | */ |
| | | properties: { |
| | | label: { |
| | | type: String, |
| | | value: undefined, |
| | | }, |
| | | content: { |
| | | type: String, |
| | | value: undefined, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * ç»ä»¶çåå§æ°æ® |
| | | */ |
| | | data: {}, |
| | | |
| | | /** |
| | | * ç»ä»¶çæ¹æ³å表 |
| | | */ |
| | | methods: {}, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": {} |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="tr"> |
| | | <view wx:if="{{label}}" class="td td-1">{{ label }}</view> |
| | | <view wx:else class="td td-1"><slot name="label"></slot></view> |
| | | <view wx:if="{{content}}" class="td td-2">{{ content }}</view> |
| | | <view wx:else class="td td-2"><slot name="content"></slot></view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .tr { |
| | | display: flex; |
| | | font-size: var(--td-font-size-s); |
| | | margin-top: -1px; |
| | | } |
| | | .td { |
| | | border: 1px solid var(--td-gray-color-3); |
| | | padding: 2px 6px; |
| | | } |
| | | .td-1 { |
| | | width: 68px; |
| | | background-color: var(--td-primary-color-1); |
| | | color: var(--td-text-color-secondary); |
| | | } |
| | | |
| | | .td-2 { |
| | | display: inline-block; |
| | | width: 100%; |
| | | color: var(--td-text-color-primary); |
| | | margin-left: -1px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // components/descriptions-list/index.js |
| | | Component({ |
| | | options: { |
| | | addGlobalClass: true, |
| | | multipleSlots: true, |
| | | }, |
| | | /** |
| | | * ç»ä»¶ç屿§å表 |
| | | */ |
| | | properties: { |
| | | title: { |
| | | type: String, |
| | | value: undefined, |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * ç»ä»¶çåå§æ°æ® |
| | | */ |
| | | data: {}, |
| | | |
| | | /** |
| | | * ç»ä»¶çæ¹æ³å表 |
| | | */ |
| | | methods: {}, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "component": true, |
| | | "usingComponents": {} |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="wrapper"> |
| | | <view class="title-wrapper"> |
| | | <view v-if="{{title}}" class="descriptions-list__title">{{ title }}</view> |
| | | <slot name="extra"></slot> |
| | | </view> |
| | | <view> |
| | | <slot></slot> |
| | | </view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .wrapper { |
| | | background-color: var(--td-gray-color-1); |
| | | padding: 4px; |
| | | border-radius: var(--td-border-radius); |
| | | box-shadow: var(--td-shadow-4); |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .title-wrapper { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .descriptions-list__title { |
| | | padding: 8px 8px; |
| | | font-size: var(--td-font-size-m); |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | font-weight: 600; |
| | | } |
| | |
| | | Component({ |
| | | options: { |
| | | addGlobalClass: true, |
| | | multipleSlots: true, |
| | | }, |
| | | /** |
| | | * ç»ä»¶ç屿§å表 |
| | |
| | | <!--components/empty-page/index.wxml--> |
| | | <t-empty description="{{description}}" > |
| | | <t-empty description="{{description}}"> |
| | | <view slot="image"> |
| | | <t-image src="/res/nodata.png" mode="aspectFill" width="180rpx" height="180rpx"/> |
| | | <t-image src="/res/nodata.png" mode="aspectFill" width="180rpx" height="180rpx" /> |
| | | </view> |
| | | <view slot="action"> |
| | | <slot name="action" /> |
| | | </view> |
| | | </t-empty> |
| | |
| | | * @param {String} _label æ ç¾åç§° |
| | | * @param {String} _name åæ®µåç§° |
| | | * @param {Boolean} _required æ¯å¦ä¸ºå¿
填项 |
| | | * @param {String} _type è¾å
¥ç±»å ï¼text: è¾å
¥æ¡; switch: 忢æé®; picker: 䏿æ¡é项; cascader: 级èéæ©ï¼ |
| | | * @param {String} _type è¾å
¥ç±»å ï¼text: è¾å
¥æ¡; textarea: å¤è¡è¾å
¥æ¡; switch: 忢æé®; picker: 䏿æ¡é项; cascader: 级èéæ©ï¼ |
| | | * @param {Array} _options å½è¾å
¥ç±»å为pickeræcascaderæ¶ï¼æä¾å¯é项 |
| | | * @param {Array} cascaderTitles å½è¾å
¥ç±»å为cascaderæ¶ï¼æä¾æ¯å±éé¡¹çæ é¢ |
| | | * @param {Array} referItems å½è¾å
¥ç±»å为cascaderæ¶ï¼æä¾å
³èç屿§name |
| | |
| | | return { |
| | | required: _required, |
| | | label: _label, |
| | | placeholder: (_type == 'text' ? '请è¾å
¥' : 'è¯·éæ©') + _label, |
| | | placeholder: (_type == 'text' || _type == 'textarea' ? '请è¾å
¥' : 'è¯·éæ©') + _label, |
| | | name: _name, |
| | | value: null, |
| | | status: 'success', |
| | |
| | | * @param {Object} defaultValue åå§æ°æ® |
| | | */ |
| | | function setDefaultValue(items, defaultValue) { |
| | | if (typeof defaultValue === 'object') { |
| | | if (defaultValue && typeof defaultValue === 'object') { |
| | | items.forEach(e => { |
| | | // ææ¬åå¼å
³ç±»åç´æ¥èµå¼ |
| | | if (e.inputType == 'text' || e.inputType == 'switch') { |
| | | if (e.inputType == 'text' || e.inputType == 'switch' || e.inputType == 'textarea') { |
| | | if (defaultValue.hasOwnProperty(e.name)) { |
| | | e.value = defaultValue[e.name]; |
| | | } |
| | |
| | | this.setData({ formArray: v }); |
| | | }, |
| | | }, |
| | | // ç¡®è®¤ææ¬ |
| | | submitText: { |
| | | type: String, |
| | | value: 'ä¿å', |
| | | }, |
| | | // åæ¶ææ¬ |
| | | cancelText: { |
| | | type: String, |
| | | value: 'åæ¶', |
| | | }, |
| | | // æ¯å¦æ§è¡æ ¡éª |
| | | validated: { |
| | | type: Boolean, |
| | | value: false, |
| | | }, |
| | | // æ¯å¦å¯ç¼è¾ |
| | | editable: { |
| | | type: Boolean, |
| | | value: true, |
| | | }, |
| | | }, |
| | | |
| | |
| | | // ä¿å |
| | | onSubmit() { |
| | | const formObj = {}; |
| | | let fail = false; |
| | | this.data.formArray.forEach(e => { |
| | | if (e.required && !e.value) { |
| | | fail = true; |
| | | this.setData({ validated: true }); |
| | | return; |
| | | } |
| | | if (e.inputType == 'picker') { |
| | | formObj[e.name] = e.value; |
| | | } else if (e.inputType == 'cascader') { |
| | |
| | | formObj[e.name] = e.value; |
| | | } |
| | | }); |
| | | this.triggerEvent('submit', formObj); |
| | | if (!fail) { |
| | | this.triggerEvent('submit', formObj); |
| | | } |
| | | }, |
| | | // åæ¶ |
| | | onCancel() { |
| | |
| | | bind:change="onInputChange" |
| | | /> |
| | | </block> |
| | | <block wx:elif="{{item.inputType == 'textarea'}}"> |
| | | <t-textarea |
| | | label="{{item.label}}" |
| | | model:value="{{item.value}}" |
| | | bordered |
| | | autofocus |
| | | autosize |
| | | confirm-type="next" |
| | | data-index="{{index}}" |
| | | placeholder="{{item.placeholder}}" |
| | | bind:change="onInputChange" |
| | | ></t-textarea> |
| | | </block> |
| | | <block wx:elif="{{item.inputType == 'switch'}}"> |
| | | <t-cell title="{{item.label}}"> |
| | | <t-switch |
| | |
| | | bind:change="onCascaderChange" |
| | | /> |
| | | </block> |
| | | <block wx:if="{{validated && item.required && !item.value}}"> |
| | | <view class="tips">{{item.tips}}</view> |
| | | </block> |
| | | </block> |
| | | </block> |
| | | <slot></slot> |
| | | <view class="btn-group"> |
| | | <view wx:if="editable" class="btn-group"> |
| | | <t-button |
| | | block |
| | | theme="light" |
| | |
| | | justify-content: space-between; |
| | | padding: 8px; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .tips { |
| | | margin-left: 16px; |
| | | color: var(--td-error-color); |
| | | font-size: var(--td-font-size-s); |
| | | } |
| | |
| | | // const inspectPicUrl = `${inspectUrl}/images/`; |
| | | |
| | | // éè·¯åºæ¥çº¿ç´¢ |
| | | // const clueUrl = 'https://fyami.com.cn:448/'; |
| | | const clueUrl = 'http://192.168.0.110:8084/'; |
| | | const clueUrl = 'https://fyami.com.cn:448/'; |
| | | // const clueUrl = 'http://192.168.0.110:8080/'; |
| | | const cu = 'https://fyami.com.cn:448'; |
| | | // const cu = 'http://192.168.0.110:8080'; |
| | | const cluePicUrl = `${cu}/images/`; |
| | | |
| | | // è¿è¡æ¨¡å¼ |
| | | const mode = 'debug'; |
| | | // const mode = 'prod'; |
| | | // const mode = 'debug'; |
| | | const mode = 'prod'; |
| | | |
| | | export { |
| | | basePicUrl, |
| | |
| | | url: 'pages/supervision/index', |
| | | level: 2, |
| | | }, |
| | | // { |
| | | // icon: 'fact-check', |
| | | // text: 'åºæ¥çº¿ç´¢', |
| | | // url: 'pages/cluetask/home/index', |
| | | // level: 1, |
| | | // }, |
| | | { |
| | | icon: 'fact-check', |
| | | text: 'åºæ¥çº¿ç´¢', |
| | | url: 'pages/cluetask/home/index', |
| | | level: 1, |
| | | }, |
| | | { |
| | | // icon: `${baseIconUrl}tab-slef-patrol.png`, |
| | | icon: 'root-list', |
| | | text: 'åºæ¥èªå·¡æ¥', |
| | | url: 'pages/selfpatrol/index', |
| | |
| | | level: 2, |
| | | }, |
| | | ]; |
| | | |
| | | // const menu = [ |
| | | // { |
| | | // icon: 'home', |
| | | // text: 'é¦é¡µ', |
| | | // url: 'pages/home/index', |
| | | // level: 2, |
| | | // }, |
| | | // { |
| | | // icon: 'app', |
| | | // text: 'ç²¾ç»åç管', |
| | | // url: 'pages/supervision/index', |
| | | // level: 2, |
| | | // }, |
| | | // { |
| | | // icon: 'fact-check', |
| | | // text: 'åºæ¥çº¿ç´¢', |
| | | // url: 'pages/cluetask/home/index', |
| | | // level: 1, |
| | | // }, |
| | | // { |
| | | // icon: 'root-list', |
| | | // text: 'åºæ¥èªå·¡æ¥', |
| | | // url: 'pages/selfpatrol/index', |
| | | // level: 2, |
| | | // }, |
| | | // // { |
| | | // // icon: 'system-device', |
| | | // // text: '设å¤ç®¡ç', |
| | | // // url: 'pages/inspection/scene/index', |
| | | // // level: 1, |
| | | // // }, |
| | | // { |
| | | // icon: 'user', |
| | | // text: '个人ä¸å¿', |
| | | // url: 'pages/usercenter/index', |
| | | // level: 2, |
| | | // }, |
| | | // ]; |
| | | |
| | | // function getMenu(usertypeid) { |
| | | // const menu = []; |
| | | // menu.forEach(v => { |
| | | // if (app.globalData.userInfo.usertypeid <= v.level) { |
| | | // menu.push(v); |
| | | // } |
| | | // }); |
| | | // return menu; |
| | | // } |
| | | |
| | | // export { getMenu }; |
| | |
| | | import TabMenu from './data'; |
| | | // import { getMenu } from './data'; |
| | | |
| | | const app = getApp(); |
| | | |
| | | Component({ |
| | | data: { |
| | | active: 0, |
| | | list: TabMenu, |
| | | // list: getMenu(app.globalData.userInfo.usertypeid), |
| | | }, |
| | | attached() { |
| | | const menu = [] |
| | | TabMenu.forEach(v => { |
| | | if (app.globalData.userInfo.usertypeid <= v.level) { |
| | | menu.push(v) |
| | | } |
| | | }); |
| | | // TabMenu.map(v => { |
| | | // v.visible = app.globalData.userInfo.usertypeid <= v.level; |
| | | // return v; |
| | | // const menu = []; |
| | | // TabMenu.forEach(v => { |
| | | // if (app.globalData.userInfo.usertypeid <= v.level) { |
| | | // menu.push(v); |
| | | // } |
| | | // }); |
| | | this.setData({ list: menu }); |
| | | // this.setData({ list: menu }); |
| | | // const index = []; |
| | | // TabMenu.forEach((v, i) => { |
| | | // if (app.globalData.userInfo.usertypeid > v.level) { |
| | | // index.push(i); |
| | | // } |
| | | // }); |
| | | // let offset = 0; |
| | | // index.forEach(e => { |
| | | // TabMenu.splice(e + offset, 1); |
| | | // offset--; |
| | | // }); |
| | | // this.setData({ list: TabMenu }); |
| | | }, |
| | | methods: { |
| | | onChange(event) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import dayjs from 'dayjs'; |
| | | |
| | | function getClue(data) { |
| | | data._releaseTimeTxt = dayjs(data.creleaseTime).format('YYYY-MM-DD HH:mm:ss'); |
| | | return data; |
| | | } |
| | | |
| | | function getClueList(dataList) { |
| | | return dataList.map(v => { |
| | | return getClue(v); |
| | | }); |
| | | } |
| | | |
| | | export { getClue, getClueList }; |
| | |
| | | import { cluePicUrl } from '../../config/index'; |
| | | |
| | | function getClueQuestion(data) { |
| | | data.cqFilePath = data.cqFilePath.split(';').map((val) => { |
| | | data._filePath = data.cqFilePath.split(';').map((val) => { |
| | | return cluePicUrl + val; |
| | | }); |
| | | return data; |
| | |
| | | name: 'æ»è®¡', |
| | | value: total, |
| | | diff: '', |
| | | clickable: false, |
| | | }, |
| | | { |
| | | name: '已宿', |
| | | value: finished, |
| | | diff: total == 0 ? '0%' : `${p1}%`, |
| | | clickable: false, |
| | | }, |
| | | { |
| | | name: 'å¾
宿', |
| | | value: unfinished, |
| | | diff: total == 0 ? '0%' : `${p2}%`, |
| | | clickable: false, |
| | | }, |
| | | ]; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { baseInputItem, hideInputItem, setDefaultValue } from '../../components/form/form-util.js'; |
| | | import dataConclusionType from '../../common/clue/dataConclusionType'; |
| | | import { Towns } from '../../common/dataTowns'; |
| | | |
| | | export function conclusionForm(defaultValue) { |
| | | const items = [ |
| | | hideInputItem('id', 'ccId'), |
| | | hideInputItem('线索id', 'cid'), |
| | | |
| | | baseInputItem('é®é¢ç±»å', 'ccQuestionType', true, 'picker', dataConclusionType.ConclusionType), |
| | | baseInputItem('线索ç»è®º', 'ccConclusion', true), |
| | | baseInputItem('è¯¦ç»æè¿°', 'ccDetails', true, 'textarea'), |
| | | ]; |
| | | |
| | | // å¡«å
é»è®¤æ°æ® |
| | | setDefaultValue(items, defaultValue); |
| | | |
| | | return items; |
| | | } |
| | | |
| | | export function questionForm(defaultValue) { |
| | | const items = [ |
| | | hideInputItem('id', 'cqId'), |
| | | hideInputItem('é®é¢ç¼å·', 'cqUid'), |
| | | hideInputItem('线索id', 'cid'), |
| | | hideInputItem('é®é¢å¾ç', 'cqFilePath'), |
| | | |
| | | baseInputItem('é®é¢åç§°', 'cqName', true), |
| | | baseInputItem('é®é¢æè¿°', 'cqDescription', true, 'textarea'), |
| | | baseInputItem('æå¨è¡é', 'cqStreet', true, 'picker', Towns[310106]), |
| | | |
| | | // baseInputItem('详ç»å°å', 'cqAddress', true), |
| | | // baseInputItem('åæ ', '_coordinate', true), |
| | | ]; |
| | | |
| | | // å¡«å
é»è®¤æ°æ® |
| | | setDefaultValue(items, defaultValue); |
| | | |
| | | return items; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { conclusionForm } from '../clue-item.js'; |
| | | |
| | | import { uploadConclusion } from '../../../services/clue/fetchClue'; |
| | | Page({ |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | formArray: [], |
| | | // 模å¼ï¼add: æ°å¢ï¼updateï¼æ´æ° |
| | | mode: 'add', |
| | | submitText: 'ä¿å', |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | this.getOpenerEventChannel().on('acceptConclusionData', data => { |
| | | const { conclusion, clue, isInternal } = data; |
| | | const formArray = conclusionForm(conclusion); |
| | | const mode = conclusion ? 'update' : 'add'; |
| | | |
| | | this.setData({ formArray, mode, clue, isInternal }); |
| | | }); |
| | | }, |
| | | |
| | | // æäº¤è¡¨å |
| | | submit(e) { |
| | | const { mode, clue, isInternal } = this.data; |
| | | |
| | | const formObj = e.detail; |
| | | formObj.cid = clue.cid; |
| | | formObj.ccInternal = isInternal; |
| | | if (mode == 'add') { |
| | | this.create(formObj); |
| | | } else { |
| | | this.update(formObj); |
| | | } |
| | | }, |
| | | |
| | | // åæ¶è¡¨å |
| | | cancel() { |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | }, |
| | | |
| | | // æ°å¢ |
| | | create(formObj) { |
| | | uploadConclusion(formObj).then(res => { |
| | | if (res.success) { |
| | | this.getOpenerEventChannel().emit('uploadOver'); |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | success: () => { |
| | | wx.showToast({ |
| | | title: 'ç»è®ºæäº¤æå', |
| | | duration: 2000, |
| | | icon: 'success', |
| | | mask: true, |
| | | }); |
| | | }, |
| | | }); |
| | | } else { |
| | | wx.showToast({ |
| | | title: res.message, |
| | | duration: 2000, |
| | | icon: 'error', |
| | | mask: true, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // æ´æ° |
| | | update(formObj) { |
| | | this.create(formObj); |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "线索ç»è®º", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarBackgroundColor": "#389AFF", |
| | | "usingComponents": { |
| | | "t-form": "/components/form/index" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="page"> |
| | | <view class="page-header"> </view> |
| | | <view class="page-container"> |
| | | <t-form |
| | | formArr="{{formArray}}" |
| | | submit-text="{{submitText}}" |
| | | bind:submit="submit" |
| | | bind:cancel="cancel" |
| | | ></t-form> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .page .page-container { |
| | | padding: 0; |
| | | } |
| | |
| | | import { useStatistic } from './statistic-proxy.js'; |
| | | import { useTasks } from './tasks-proxy.js'; |
| | | |
| | | import clueApi from '../../../services/clue/fetchClue'; |
| | | import { fetchClueTask } from '../../../services/clue/fetchClue'; |
| | | |
| | | const app = getApp(); |
| | | |
| | |
| | | onLoad(options) {}, |
| | | |
| | | onShow() { |
| | | this.getTabBar().init(); |
| | | if (this.getTabBar()) { |
| | | this.getTabBar().init(); |
| | | } |
| | | this.refresh(); |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | |
| | | optionsCount: 0, |
| | | init() { |
| | | this.optionsCount++; |
| | | if (this.optionsCount == 2) this._startLoad(); |
| | | this.refresh(); |
| | | }, |
| | | |
| | | refresh() { |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | _fetchData(page) { |
| | | return clueApi.fetchClueTask({}).then(res => { |
| | | return fetchClueTask({}).then(res => { |
| | | this.setData({ clueTaskList: res.data }); |
| | | this.calClueCount(); |
| | | this.formatClueTask(); |
| | |
| | | formatClueTask() { |
| | | const { clueTaskList } = this.data; |
| | | clueTaskList.forEach(t => { |
| | | t._taskTime = dayjs(t.taskTime).format('YYYY-MM-DD') |
| | | t._taskTime = dayjs(t.taskTime).format('YYYY-MM-DD'); |
| | | let note = ''; |
| | | note += t.provinceName ? t.provinceName : ''; |
| | | note += t.provinceName == t.cityName ? '' : t.cityName ? `/${t.cityName}` : ''; |
| | |
| | | }); |
| | | this.setData({ clueTaskList }); |
| | | }, |
| | | |
| | | handleClueTaskClick(e) { |
| | | const { index } = e.currentTarget.dataset; |
| | | const clueTask = this.data.clueTaskList[index]; |
| | | wx.navigateTo({ |
| | | url: '/pages/cluetask/manage/index', |
| | | events: { |
| | | uploadOver: () => { |
| | | // 线索æäº¤å®æåæ´æ°ç¶æ |
| | | }, |
| | | }, |
| | | success: res => { |
| | | res.eventChannel.emit('acceptClueTask', clueTask); |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
| | |
| | | <view> |
| | | <view wx:for="{{clueTaskList}}" wx:key="index" wx:for-index="index"> |
| | | <t-cell title="任塿¶é´" note="{{item._taskTime}}" /> |
| | | <t-cell title="ä»»å¡ä½ç½®" note="{{item._location}}"/> |
| | | <t-cell title="ååºæ¶é´" note="{{item._resLevelTxt}}"/> |
| | | <t-cell title="åºè¡æ¹å¼" note="{{item._travelModeTxt}}"/> |
| | | <t-cell title="æ 人æº" note="{{item._hasUavTxt}}"/> |
| | | |
| | | <view |
| | | class="clue-task__wrap" |
| | | wx:for="{{clueTaskList}}" |
| | | wx:key="index" |
| | | wx:for-index="index" |
| | | data-index="{{index}}" |
| | | bindtap="handleClueTaskClick" |
| | | > |
| | | <view class="clue-task__title-wrap"> |
| | | <view class="clue-task__title">{{item._taskTime}}</view> |
| | | <view class="clue-task__abstract"> |
| | | åºæ¥å·¡æ¥ |
| | | <t-icon name="chevron-right" size="var(--icon-width)" color="black" /> |
| | | </view> |
| | | </view> |
| | | <view class="clue-task__abstract"> 线索ç¼å·ï¼{{item.clueId}} </view> |
| | | <view class="clue-task__abstract"> ä»»å¡ä½ç½®ï¼{{item._location}} </view> |
| | | <t-divider /> |
| | | <view class="clue-task__tags"> |
| | | <view class="clue-task__tag-item"> |
| | | <span>{{item._resLevelTxt}}</span> |
| | | <span class="clue-task__label">ååºæ¶é´</span> |
| | | </view> |
| | | <view class="clue-task__tag-item"> |
| | | <span>{{item._travelModeTxt}}</span> |
| | | <span class="clue-task__label">åºè¡æ¹å¼</span> |
| | | </view> |
| | | <view class="clue-task__tag-item"> |
| | | <span>{{item._hasUavTxt}}</span> |
| | | <span class="clue-task__label">æ 人æº</span> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | .clue-task__wrap { |
| | | border-radius: var(--td-border-radius); |
| | | background-color: var(--td-bg-color-block); |
| | | padding: var(--td-spacer-1); |
| | | margin-bottom: var(--td-spacer); |
| | | } |
| | | |
| | | .clue-task__title-wrap { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .clue-task__title { |
| | | font-weight: 550; |
| | | font-size: var(--td-font-size-m); |
| | | } |
| | | |
| | | .clue-task__abstract { |
| | | font-size: var(--td-font-size-s); |
| | | color: var(--td-text-color-secondary); |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .clue-task__tags { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .clue-task__tags .clue-task__tag-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | |
| | | .clue-task__tag-item .clue-task__label { |
| | | font-size: var(--td-font-size-s); |
| | | color: var(--td-text-color-secondary); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { getConclusion } from '../../../services/clue/fetchClue'; |
| | | |
| | | export const useConclusion = Behavior({ |
| | | data: { |
| | | conclusion: undefined, |
| | | }, |
| | | methods: { |
| | | fetchClueConclusion() { |
| | | const { clueTask } = this.data; |
| | | getConclusion(clueTask.clueId, clueTask.internalTask).then(res => { |
| | | this.setData({ conclusion: res.data }); |
| | | }); |
| | | }, |
| | | |
| | | navToConclusion() { |
| | | wx.navigateTo({ |
| | | url: '/pages/cluetask/conclusion/index', |
| | | events: { |
| | | uploadOver: () => { |
| | | // ç»è®ºæäº¤å®æåæ´æ°ç¶æ |
| | | this.fetchClueConclusion(); |
| | | }, |
| | | }, |
| | | success: res => { |
| | | const { conclusion, clue, clueTask } = this.data; |
| | | res.eventChannel.emit('acceptConclusionData', { |
| | | conclusion: conclusion, |
| | | clue: clue, |
| | | isInternal: clueTask.internalTask, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <DescriptionsList wx:if="{{conclusion}}" title="线索ç»è®º"> |
| | | <view slot="extra"> |
| | | <t-button |
| | | theme="primary" |
| | | size="extra-small" |
| | | disabled="{{conclusion.ccUploaded}}" |
| | | bind:tap="navToConclusion" |
| | | >ä¿®æ¹ç»è®º</t-button |
| | | > |
| | | </view> |
| | | <DescriptionsListItem label="é®é¢ç±»å" content="{{conclusion.ccQuestionType}}" /> |
| | | <DescriptionsListItem label="线索ç»è®º" content="{{conclusion.ccConclusion}}" /> |
| | | <DescriptionsListItem label="è¯¦ç»æè¿°" content="{{conclusion.ccDetails}}" /> |
| | | </DescriptionsList> |
| | | <view wx:else class="dashed-border"> |
| | | <t-empty-page description="线索ç»è®ºæªä¸ä¼ "> |
| | | <t-button slot="action" size="small" theme="primary" bind:tap="navToConclusion" |
| | | >åé¦ä¸æ¥</t-button |
| | | > |
| | | </t-empty-page> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { useLoading } from '../../../behaviors/loading'; |
| | | import { useConclusion } from './conclusion-proxy.js'; |
| | | import { useQuestion } from './question-proxy.js'; |
| | | |
| | | import { fetchClue, fetchClueInternal } from '../../../services/clue/fetchClue'; |
| | | |
| | | Page({ |
| | | behaviors: [useLoading, useConclusion, useQuestion], |
| | | |
| | | data: { |
| | | clue: {}, |
| | | }, |
| | | |
| | | onLoad(options) { |
| | | this.getOpenerEventChannel().on('acceptClueTask', data => { |
| | | this.setData({ |
| | | clueTask: data, |
| | | }); |
| | | this._startLoad(); |
| | | }); |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | this._startLoad(); |
| | | }, |
| | | |
| | | onReachBottom() { |
| | | this._loadMore(); |
| | | }, |
| | | |
| | | /*********************************************************************************** */ |
| | | _fetchData(page) { |
| | | const array = []; |
| | | array.push(this.fetchClueQuestion()); |
| | | if (page == 1) { |
| | | array.push(this.fetchClueData()); |
| | | array.push(this.fetchClueConclusion()); |
| | | } |
| | | return Promise.all(array).then(res => { |
| | | return res[0]; |
| | | }); |
| | | }, |
| | | |
| | | fetchClueData() { |
| | | const { clueTask } = this.data; |
| | | const func = clueTask.internalTask ? fetchClueInternal : fetchClue; |
| | | func({ cid: clueTask.clueId }).then(res => { |
| | | if (res.data.length > 0) { |
| | | this.setData({ clue: res.data[0] }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /*********************************************************************************** */ |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "åºæ¥çº¿ç´¢", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "enablePullDownRefresh": true, |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarBackgroundColor": "#389AFF", |
| | | "usingComponents": { |
| | | "DescriptionsList": "/components/descriptions-list/index", |
| | | "DescriptionsListItem": "/components/descriptions-list-item/index", |
| | | "t-empty-page": "/components/empty-page/index" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <import src="/pages/common/template/template-loading.wxml" /> |
| | | |
| | | <view class="page"> |
| | | <template is="pulldown-loading" wx:if="{{pageLoading}}" /> |
| | | <view class="page-header"> |
| | | <DescriptionsList title="线索æ¸
å详æ
"> |
| | | <DescriptionsListItem label="æ¯å¦ä¸ä¼ " content="{{clue.cuploaded ? 'å·²ä¸ä¼ ' : 'æªä¸ä¼ '}}" /> |
| | | <DescriptionsListItem label="线索ç¼å·" content="{{clue.cid}}" /> |
| | | <DescriptionsListItem label="线索åç§°" content="{{clue.cclueName}}" /> |
| | | <DescriptionsListItem label="ä¸åæ¶é´" content="{{clue._releaseTimeTxt}}" /> |
| | | </DescriptionsList> |
| | | </view> |
| | | <view class="page-container"> |
| | | <include src="./conclusion.wxml" /> |
| | | <include src="./question.wxml" /> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | page { |
| | | --header-bottom-padding: 600rpx; |
| | | } |
| | | |
| | | .page .page-header { |
| | | background: linear-gradient(var(--td-primary-color-7), var(--td-bg-color)); |
| | | padding-bottom: var(--header-bottom-padding); |
| | | } |
| | | |
| | | .page .page-container { |
| | | margin-top: calc(0rpx - var(--header-bottom-padding)); |
| | | } |
| | | |
| | | .btn-wrap { |
| | | display: flex; |
| | | justify-content: center; |
| | | padding: 16px; |
| | | } |
| | | |
| | | .dashed-border { |
| | | border: 1px dashed var(--td-font-gray-3); |
| | | border-radius: var(--td-border-radius); |
| | | padding-bottom: 4px; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { getQuestion, deleteQuestion } from '../../../services/clue/fetchClue'; |
| | | |
| | | export const useQuestion = Behavior({ |
| | | data: { |
| | | questionList: [], |
| | | }, |
| | | methods: { |
| | | fetchClueQuestion() { |
| | | const { clueTask } = this.data; |
| | | getQuestion(clueTask.clueId, clueTask.internalTask).then(res => { |
| | | this.setData({ questionList: res.data }); |
| | | }); |
| | | }, |
| | | |
| | | deleteQuestion(e) { |
| | | const { index } = e.currentTarget.dataset; |
| | | this.setData({ showDelete: true, currentIndex: index }); |
| | | }, |
| | | |
| | | onDeleteConfirm() { |
| | | const { currentIndex, questionList } = this.data; |
| | | const q = questionList[currentIndex]; |
| | | |
| | | deleteQuestion(q.cqId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | const index = questionList.indexOf(q); |
| | | questionList.splice(index, 1); |
| | | this.setData({ questionList }); |
| | | } |
| | | }) |
| | | .finally(() => this.closeDialog()); |
| | | }, |
| | | |
| | | checkQuestion(e) { |
| | | const { index } = e.currentTarget.dataset; |
| | | const question = this.data.questionList[index]; |
| | | |
| | | wx.navigateTo({ |
| | | url: '/pages/cluetask/question/index', |
| | | events: { |
| | | uploadOver: () => { |
| | | // é®é¢ä¿®æ¹å®æåæ´æ°ç¶æ |
| | | this.fetchClueQuestion(); |
| | | }, |
| | | }, |
| | | success: res => { |
| | | res.eventChannel.emit('acceptClueQuestionData', { |
| | | question, |
| | | clue: this.data.clue, |
| | | isInternal: this.data.clueTask.internalTask, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | addQuestion() { |
| | | wx.navigateTo({ |
| | | url: '/pages/cluetask/question/index', |
| | | events: { |
| | | uploadOver: () => { |
| | | // é®é¢æäº¤å®æåæ´æ°ç¶æ |
| | | this.fetchClueQuestion(); |
| | | }, |
| | | }, |
| | | success: res => { |
| | | res.eventChannel.emit('acceptClueQuestionData', { |
| | | clue: this.data.clue, |
| | | isInternal: this.data.clueTask.internalTask, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | closeDialog() { |
| | | this.setData({ showDelete: false }); |
| | | }, |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="title-primary-1">线索é®é¢</view> |
| | | <block wx:if="{{questionList.length > 0}}"> |
| | | <block wx:for="{{questionList}}" wx:key="index" wx:for-index="index"> |
| | | <DescriptionsList title="{{item.cqUid}}"> |
| | | <view slot="extra"> |
| | | <t-button |
| | | wx:if="{{!clue.cuploaded}}" |
| | | theme="danger" |
| | | size="extra-small" |
| | | icon="delete" |
| | | shape="square" |
| | | data-index="{{index}}" |
| | | bind:tap="deleteQuestion" |
| | | ></t-button> |
| | | <t-button |
| | | style="margin-left: 4px" |
| | | theme="primary" |
| | | size="extra-small" |
| | | data-index="{{index}}" |
| | | bind:tap="checkQuestion" |
| | | >{{ clue.cuploaded ? 'é®é¢è¯¦æ
' : 'ä¿®æ¹é®é¢' }}</t-button |
| | | > |
| | | </view> |
| | | <DescriptionsListItem label="é®é¢åç§°" content="{{item.cqName}}" /> |
| | | <DescriptionsListItem label="é®é¢æè¿°" content="{{item.cqDescription}}" /> |
| | | <DescriptionsListItem label="详ç»å°å" content="{{item.cqAddress}}" /> |
| | | </DescriptionsList> |
| | | </block> |
| | | <view class="btn-wrap"> |
| | | <t-button wx:if="{{!clue.cuploaded}}" size="extra-small" theme="primary" bind:tap="addQuestion" |
| | | >æ·»å é®é¢</t-button |
| | | > |
| | | </view> |
| | | </block> |
| | | <view wx:else class="dashed-border"> |
| | | <t-empty-page description="æ 线索é®é¢"> |
| | | <t-button slot="action" size="small" theme="primary" bind:tap="addQuestion">åé¦ä¸æ¥</t-button> |
| | | </t-empty-page> |
| | | </view> |
| | | <t-dialog |
| | | visible="{{showDelete}}" |
| | | title="å é¤ç¡®è®¤" |
| | | content="" |
| | | confirm-btn="{{ { content: 'ç¡®å®', variant: 'base' } }}" |
| | | cancel-btn="åæ¶" |
| | | bind:confirm="onDeleteConfirm" |
| | | bind:cancel="closeDialog" |
| | | /> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { cluePicUrl } from '../../../config/index'; |
| | | import { questionForm } from '../clue-item.js'; |
| | | import { toLabel, toValue } from '../../../common/dataTowns'; |
| | | |
| | | import { uploadQuestion, updateQuestion } from '../../../services/clue/fetchClue'; |
| | | |
| | | Page({ |
| | | /** |
| | | * 页é¢çåå§æ°æ® |
| | | */ |
| | | data: { |
| | | validated: false, |
| | | formArray: [], |
| | | // 模å¼ï¼add: æ°å¢ï¼updateï¼æ´æ° |
| | | mode: 'add', |
| | | submitText: 'ä¿å', |
| | | |
| | | // å¾çä¸ä¼ å表 |
| | | fileList: [], |
| | | // æ´æ°æ¨¡å¼ä¸ï¼è®°å½è¢«å é¤çåæå¾ç |
| | | deletedFileList: [], |
| | | // å¾çå±ç¤ºæ¹å¼ |
| | | gridConfig: { |
| | | column: 3, |
| | | width: 210, |
| | | height: 210, |
| | | }, |
| | | // å¾çéå¶å¤§å° |
| | | sizeLimit: { size: 5, unit: 'MB', message: 'å¾ç大å°ä¸è¶
è¿5MB' }, |
| | | |
| | | // å®ä½ä¿¡æ¯ |
| | | locations: { |
| | | // ä½ç½®åç§° |
| | | name: '', |
| | | address: '', |
| | | // ä½¿ç¨ gcj02 彿µå±åæ ç³» |
| | | longitude: '', |
| | | latitude: '', |
| | | coorTxt: '', |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * çå½å¨æå½æ°--çå¬é¡µé¢å è½½ |
| | | */ |
| | | onLoad(options) { |
| | | this.getOpenerEventChannel().on('acceptClueQuestionData', data => { |
| | | const { question, clue, isInternal } = data; |
| | | if (question) { |
| | | this.setData({ uploaded: question.cqUploaded }); |
| | | question.cqStreet = toValue(question.cqStreet); |
| | | this.setData({ |
| | | locations: { |
| | | address: question.cqAddress, |
| | | longitude: question.cqLongitude, |
| | | latitude: question.cqLatitude, |
| | | coorTxt: question.cqLongitude + ',' + question.cqLatitude, |
| | | }, |
| | | fileList: question._filePath.map(v => { |
| | | return { |
| | | url: v, |
| | | }; |
| | | }), |
| | | }); |
| | | } |
| | | const formArray = questionForm(question); |
| | | const mode = question ? 'update' : 'add'; |
| | | |
| | | this.setData({ formArray, mode, clue, isInternal }); |
| | | }); |
| | | }, |
| | | |
| | | // æäº¤è¡¨å |
| | | submit(e) { |
| | | // é¢å¤çå®ä½ä¿¡æ¯åå¾çæ ¡éª |
| | | this.setData({ validated: true }); |
| | | const { fileList, locations } = this.data; |
| | | if (locations.address == '' || !fileList || fileList.length == 0) { |
| | | return; |
| | | } |
| | | |
| | | const formObj = e.detail; |
| | | formObj.cId = this.data.clue.cid; |
| | | formObj.cqStreet = toLabel(formObj.cqStreet); |
| | | formObj.cqAddress = locations.address; |
| | | formObj.cqLongitude = locations.longitude; |
| | | formObj.cqLatitude = locations.latitude; |
| | | formObj.cqInternal = this.data.isInternal; |
| | | |
| | | const images = []; |
| | | // çéæ°å¢çæ¬å°å¾çä½ä¸ºä¸ä¼ å¾ç |
| | | fileList.forEach(v => { |
| | | if (v.url.indexOf(cluePicUrl) == -1) { |
| | | images.push(v.url); |
| | | } |
| | | }); |
| | | |
| | | const { mode } = this.data; |
| | | if (mode == 'add') { |
| | | this.create(formObj, images); |
| | | } else { |
| | | this.update(formObj, images); |
| | | } |
| | | }, |
| | | |
| | | // åæ¶è¡¨å |
| | | cancel() { |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | }, |
| | | |
| | | // æ°å¢ |
| | | create(formObj, images) { |
| | | uploadQuestion(formObj, images).then(res => this.modifySuccess(res)); |
| | | }, |
| | | |
| | | // æ´æ° |
| | | update(formObj, images) { |
| | | // wx.showToast({ |
| | | // title: 'é®é¢ä¸å
è®¸æ´æ°', |
| | | // duration: 2000, |
| | | // icon: 'error', |
| | | // mask: true, |
| | | // }); |
| | | // return; |
| | | |
| | | const deleteImgUrl = this.data.deletedFileList.join(';'); |
| | | updateQuestion(formObj, deleteImgUrl, images).then(res => this.modifySuccess(res)); |
| | | }, |
| | | |
| | | // é®é¢æ°å¢æä¿®æ¹æåå |
| | | modifySuccess(res) { |
| | | if (res.success) { |
| | | this.getOpenerEventChannel().emit('uploadOver'); |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | success: () => { |
| | | wx.showToast({ |
| | | title: this.data.mode == 'add' ? 'é®é¢æäº¤æå' : 'é®é¢æ´æ°æå', |
| | | duration: 2000, |
| | | icon: 'success', |
| | | mask: true, |
| | | }); |
| | | }, |
| | | }); |
| | | } else { |
| | | wx.showToast({ |
| | | title: res.message, |
| | | duration: 2000, |
| | | icon: 'error', |
| | | mask: true, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | /************************************************************** */ |
| | | // æå¨ä¿®æ¹å®ä½ä½ç½®æè¿° |
| | | handleLocation(e) { |
| | | const { value } = e.detail; |
| | | // console.log(e); |
| | | // console.log(this.data.locations); |
| | | const { location } = this.data; |
| | | location.address = value; |
| | | this.setData({ locations }); |
| | | }, |
| | | |
| | | // handleCoorTxt(e) { |
| | | // console.log(e); |
| | | // const { value } = e.detail; |
| | | // }, |
| | | |
| | | // ä»å°å¾éæ©å®ä½ |
| | | chooseLocation() { |
| | | const { locations } = this.data; |
| | | wx.chooseLocation({ |
| | | longitude: locations.longitude, |
| | | latitude: locations.latitude, |
| | | success: res => { |
| | | this.setData({ |
| | | locations: { |
| | | ...res, |
| | | coorTxt: `${res.longitude},${res.latitude}`, |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // æ·»å å¾ç |
| | | handleAddImg(e) { |
| | | const { fileList } = this.data; |
| | | const { files } = e.detail; |
| | | this.setData({ |
| | | fileList: [...fileList, ...files], |
| | | }); |
| | | }, |
| | | // ç§»é¤å¾ç |
| | | handleRemoveImg(e) { |
| | | const { index } = e.detail; |
| | | const { fileList, mode } = this.data; |
| | | |
| | | const [deletedfile] = fileList.splice(index, 1); |
| | | |
| | | // 卿´æ°æ¨¡å¼ä¸ï¼è®°å½å é¤çåæå¾çï¼ç¨äºæ´æ°é®é¢æ¥å£çåæ° |
| | | if (mode == 'update') { |
| | | // éè¿æä»¶è·¯å¾å¤ææ¯å¦ä¸ºè¿ç¨httpè·¯å¾ï¼ |
| | | if (deletedfile.url.indexOf(cluePicUrl) != -1) { |
| | | const originUrl = deletedfile.url.replace(cluePicUrl, ''); |
| | | const { deletedFileList } = this.data; |
| | | deletedFileList.push(originUrl); |
| | | |
| | | console.log(deletedFileList); |
| | | } |
| | | } |
| | | this.setData({ |
| | | fileList, |
| | | }); |
| | | }, |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "navigationBarTitleText": "线索é®é¢", |
| | | "onReachBottomDistance": 10, |
| | | "backgroundTextStyle": "light", |
| | | "navigationBarTextStyle": "white", |
| | | "navigationBarBackgroundColor": "#389AFF", |
| | | "usingComponents": { |
| | | "t-form": "/components/form/index" |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <view class="page"> |
| | | <view class="page-header"> </view> |
| | | <view class="page-container"> |
| | | <t-form |
| | | editable="{{!uploaded}}" |
| | | formArr="{{formArray}}" |
| | | submit-text="{{submitText}}" |
| | | bind:submit="submit" |
| | | bind:cancel="cancel" |
| | | > |
| | | <t-input |
| | | label="é®é¢å®ä½" |
| | | placeholder="请è¾å
¥é®é¢å®ä½" |
| | | value="{{locations.address}}" |
| | | bind:change="handleLocation" |
| | | > |
| | | </t-input> |
| | | <t-input |
| | | disabled |
| | | label="é®é¢åæ " |
| | | placeholder="请è¾å
¥é®é¢åæ ï¼ç¨éå·åå²" |
| | | value="{{locations.coorTxt}}" |
| | | > |
| | | <t-button slot="suffix" theme="primary" size="extra-small" bindtap="chooseLocation"> |
| | | å°å¾å®ä½ |
| | | </t-button> |
| | | </t-input> |
| | | <view wx:if="{{validated && locations.address == ''}}" class="tips"> é®é¢å®ä½ä¸è½ä¸ºç©º </view> |
| | | <t-cell title="é®é¢å¾ç"> |
| | | <t-upload |
| | | slot="description" |
| | | media-type="{{['image']}}" |
| | | files="{{fileList}}" |
| | | gridConfig="{{gridConfig}}" |
| | | max="{{3}}" |
| | | size-limit="{{sizeLimit}}" |
| | | bind:add="handleAddImg" |
| | | bind:remove="handleRemoveImg" |
| | | /> |
| | | </t-cell> |
| | | <view wx:if="{{validated && (!fileList || fileList.length == 0)}}" class="tips"> |
| | | é®é¢å¾çè³å°éä¸å¼ |
| | | </view> |
| | | </t-form> |
| | | </view> |
| | | <view class="page-footer"></view> |
| | | </view> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | .page .page-container { |
| | | padding: 0; |
| | | } |
| | | |
| | | .tips { |
| | | margin-left: 16px; |
| | | color: var(--td-error-color); |
| | | font-size: var(--td-font-size-s); |
| | | } |
| | |
| | | }, |
| | | |
| | | onClickCell({ currentTarget }) { |
| | | const { type } = currentTarget.dataset; |
| | | |
| | | const { type, url } = currentTarget.dataset; |
| | | wx.navigateTo({ url }); |
| | | return |
| | | switch (type) { |
| | | case 'clue': { |
| | | wx.navigateTo({ url: '/pages/cluetask/home/index' }); |
| | | break; |
| | | } |
| | | case 'supervision': { |
| | | wx.navigateTo({ url: '/pages/inspection/scene/index' }); |
| | | break; |
| | |
| | | arrow="{{!xitem.icon}}" |
| | | note="{{xitem.tit}}" |
| | | data-type="{{xitem.type}}" |
| | | data-url="{{xitem.url}}" |
| | | bordered="{{false}}" |
| | | bind:click="onClickCell" |
| | | t-class="t-cell-padding" |
| | |
| | | export const menuData = [ |
| | | [ |
| | | { |
| | | title: 'åºæ¥çº¿ç´¢', |
| | | tit: '', |
| | | url: '/pages/cluetask/home/index', |
| | | type: 'clue', |
| | | level: 1, |
| | | }, |
| | | { |
| | | title: '设å¤ç®¡ç', |
| | | tit: '', |
| | | url: '', |
| | | url: '/pages/inspection/scene/index', |
| | | type: 'supervision', |
| | | level: 1 |
| | | level: 1, |
| | | }, |
| | | { |
| | | title: 'éç¥ç®¡ç', |
| | | tit: '', |
| | | url: '', |
| | | url: '/pages/usercenter/notice/index', |
| | | type: 'notice', |
| | | level: 2 |
| | | level: 2, |
| | | }, |
| | | { |
| | | title: 'æ§æ³å¨æ', |
| | | tit: '', |
| | | url: '', |
| | | url: '/pages/news/law-enforcement/index', |
| | | type: 'info', |
| | | level: 2 |
| | | level: 2, |
| | | }, |
| | | // { |
| | | // title: 'èªå·¡æ¥ç®¡ç', |
| | | // tit: '', |
| | | // url: '', |
| | | // url: '/pages/selfpatrol/index', |
| | | // type: 'patrol', |
| | | // }, |
| | | { |
| | | title: 'ç¯ä¿æ¥ç¨', |
| | | tit: '', |
| | | url: '', |
| | | type: 'schedule', |
| | | level: 2 |
| | | }, |
| | | // { |
| | | // title: 'ç¯ä¿æ¥ç¨', |
| | | // tit: '', |
| | | // url: '', |
| | | // type: 'schedule', |
| | | // level: 2 |
| | | // }, |
| | | ], |
| | | [ |
| | | { |
| | | title: 'ææ¯æ¯æ', |
| | | tit: '', |
| | | url: '', |
| | | url: '/pages/usercenter/support/index', |
| | | type: 'support', |
| | | level: 3 |
| | | level: 3, |
| | | }, |
| | | { |
| | | title: 'å
³äº', |
| | | tit: '', |
| | | url: '', |
| | | url: '/pages/usercenter/about/index', |
| | | type: 'about', |
| | | // icon: 'service', |
| | | level: 3 |
| | | level: 3, |
| | | }, |
| | | ], |
| | | ]; |
| | |
| | | "description": "项ç®ç§æé
ç½®æä»¶ãæ¤æä»¶ä¸çå
容å°è¦ç project.config.json ä¸çç¸ååæ®µã项ç®çæ¹å¨ä¼å
忥尿¤æä»¶ä¸ãè¯¦è§ææ¡£ï¼https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", |
| | | "projectname": "ep-law-abiding-manage-weixin", |
| | | "setting": { |
| | | "compileHotReLoad": true, |
| | | "urlCheck": false |
| | | "compileHotReLoad": false, |
| | | "urlCheck": true |
| | | }, |
| | | "libVersion": "3.5.3" |
| | | "libVersion": "3.7.12" |
| | | } |
| | |
| | | import { get, post, _delete } from '../baseRequset'; |
| | | import { clueUrl, cluePicUrl } from '../../config/index'; |
| | | import { getClueQuestionList } from '../../model/clue/clueQuestion'; |
| | | import { getClueList } from '../../model/clue/clue'; |
| | | |
| | | export default { |
| | | /******************************************************************************* */ |
| | | /** |
| | | * æ¥è¯¢çº¿ç´¢ä»»å¡ |
| | | * @param {*} clueTask |
| | | * @returns |
| | | */ |
| | | fetchClueTask(clueTask) { |
| | | return post( |
| | | { |
| | | url: `clue/task/fetch`, |
| | | data: clueTask, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | return res.data; |
| | | }); |
| | | }, |
| | | /******************************************************************************* */ |
| | | /** |
| | | * æ¥è¯¢çº¿ç´¢ |
| | | * @param {*} clue |
| | | * @returns |
| | | */ |
| | | function fetchClue(clue) { |
| | | return post( |
| | | { |
| | | url: `clue/search`, |
| | | data: clue, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | res.data.data = getClueList(res.data.data); |
| | | return res.data; |
| | | }); |
| | | } |
| | | |
| | | /******************************************************************************* */ |
| | | /** |
| | | * è·å线索ç»è®º |
| | | * @param {string} clueId 线索id |
| | | */ |
| | | getConclusion(clueId) { |
| | | return get({ |
| | | /** |
| | | * æ¥è¯¢çº¿ç´¢ |
| | | * @param {*} clue |
| | | * @returns |
| | | */ |
| | | function fetchClueInternal(clue) { |
| | | return post( |
| | | { |
| | | url: `clue/internal/search`, |
| | | data: clue, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | res.data.data = getClueList(res.data.data); |
| | | return res.data; |
| | | }); |
| | | } |
| | | /******************************************************************************* */ |
| | | /** |
| | | * æ¥è¯¢çº¿ç´¢ä»»å¡ |
| | | * @param {*} clueTask |
| | | * @returns |
| | | */ |
| | | function fetchClueTask(clueTask) { |
| | | return post( |
| | | { |
| | | url: `clue/task/fetch`, |
| | | data: clueTask, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | return res.data; |
| | | }); |
| | | } |
| | | |
| | | /******************************************************************************* */ |
| | | /** |
| | | * è·å线索ç»è®º |
| | | * @param {string} clueId 线索id |
| | | */ |
| | | function getConclusion(clueId, internal) { |
| | | return get( |
| | | { |
| | | url: `clue/conclusion/fetch`, |
| | | params: { |
| | | clueId: clueId, |
| | | clueId, |
| | | internal, |
| | | }, |
| | | clueUrl, |
| | | }).then(res => res.data); |
| | | }, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => res.data); |
| | | } |
| | | |
| | | /** |
| | | * æäº¤çº¿ç´¢ç»è®º |
| | | * @param {object} conclusion 线索 |
| | | * @returns |
| | | */ |
| | | uploadConclusion(conclusion) { |
| | | return post( |
| | | { |
| | | url: `clue/conclusion/upload`, |
| | | data: conclusion, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => res.data); |
| | | }, |
| | | /** |
| | | * æäº¤çº¿ç´¢ç»è®º |
| | | * @param {object} conclusion 线索 |
| | | * @returns |
| | | */ |
| | | function uploadConclusion(conclusion) { |
| | | return post( |
| | | { |
| | | url: `clue/conclusion/upload`, |
| | | data: conclusion, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => res.data); |
| | | } |
| | | |
| | | /******************************************************************************* */ |
| | | /** |
| | | * è·åå·²æäº¤ç线索é®é¢ |
| | | * @param {string} clueId 线索id |
| | | */ |
| | | getQuestion(clueId) { |
| | | return get({ |
| | | /******************************************************************************* */ |
| | | /** |
| | | * è·åå·²æäº¤ç线索é®é¢ |
| | | * @param {string} clueId 线索id |
| | | */ |
| | | function getQuestion(clueId, internal) { |
| | | return get( |
| | | { |
| | | url: `clue/question/fetch`, |
| | | params: { |
| | | clueId: clueId, |
| | | clueId, |
| | | internal, |
| | | }, |
| | | clueUrl, |
| | | }).then(res => { |
| | | return getClueQuestionList(res.data); |
| | | }, |
| | | clueUrl, |
| | | ).then(res => { |
| | | res.data.data = getClueQuestionList(res.data.data); |
| | | return res.data; |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ 线索é®é¢ |
| | | * @param {object} question é®é¢æè¿° |
| | | * @param {*} files é®é¢å¾ç |
| | | * @returns |
| | | */ |
| | | function uploadQuestion(question, files) { |
| | | const fields = [ |
| | | { |
| | | name: 'question', |
| | | value: JSON.stringify(question), |
| | | }, |
| | | ]; |
| | | const images = files.map(f => { |
| | | return { |
| | | name: 'images', |
| | | filePath: f, |
| | | }; |
| | | }); |
| | | |
| | | return new Multipart({ |
| | | fields, |
| | | files: images, |
| | | }) |
| | | .submit(clueUrl + `/clue/question/upload`) |
| | | .then(res => { |
| | | return res.data; |
| | | }); |
| | | }, |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ 线索é®é¢ |
| | | * @param {object} question é®é¢æè¿° |
| | | * @param {*} files é®é¢å¾ç |
| | | * @returns |
| | | */ |
| | | uploadQuestion(question, files) { |
| | | const fields = [ |
| | | { |
| | | name: 'question', |
| | | value: JSON.stringify(question), |
| | | }, |
| | | ]; |
| | | const images = files.map(f => { |
| | | return { |
| | | name: 'images', |
| | | filePath: f, |
| | | }; |
| | | /** |
| | | * æ´æ°çº¿ç´¢é®é¢ |
| | | * @param {object} question é®é¢æè¿° |
| | | * @param {Sting} deleteImgUrl å é¤çå¾çç¸å¯¹è·¯å¾ï¼ç¨;åå² |
| | | * @param {*} files é®é¢å¾ç |
| | | * @returns |
| | | */ |
| | | function updateQuestion(question, deleteImgUrl, files) { |
| | | const fields = [ |
| | | { |
| | | name: 'question', |
| | | value: JSON.stringify(question), |
| | | }, |
| | | { |
| | | name: 'deleteImg', |
| | | value: deleteImgUrl, |
| | | }, |
| | | ]; |
| | | const images = files.map(f => { |
| | | return { |
| | | name: 'images', |
| | | filePath: f, |
| | | }; |
| | | }); |
| | | |
| | | return new Multipart({ |
| | | fields, |
| | | files: images, |
| | | }) |
| | | .submit(clueUrl + `/clue/question/update`) |
| | | .then(res => { |
| | | return res.data; |
| | | }); |
| | | } |
| | | |
| | | return new Multipart({ |
| | | fields, |
| | | images, |
| | | }) |
| | | .submit(clueUrl + `/clue/question/upload`) |
| | | .then(res => { |
| | | return res.data; |
| | | }); |
| | | }, |
| | | |
| | | deleteQuestion(questionId) { |
| | | return _delete({ |
| | | function deleteQuestion(questionId) { |
| | | return _delete( |
| | | { |
| | | url: `clue/question`, |
| | | params: { |
| | | questionId: questionId, |
| | | }, |
| | | clueUrl, |
| | | }).then(res => res.data); |
| | | }, |
| | | }, |
| | | clueUrl, |
| | | ).then(res => res.data); |
| | | } |
| | | export { |
| | | fetchClue, |
| | | fetchClueInternal, |
| | | fetchClueTask, |
| | | getConclusion, |
| | | uploadConclusion, |
| | | updateQuestion, |
| | | getQuestion, |
| | | uploadQuestion, |
| | | deleteQuestion, |
| | | }; |