From 49d35c25b4e313969c854d557b2d5947b3672e18 Mon Sep 17 00:00:00 2001 From: guanxiaohan Date: Thu, 8 Aug 2024 11:37:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E8=B5=9E=E7=82=B9=E8=B8=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/task.vue | 253 ++++++++++++++--------------------- pages/knowledge/index.vue | 57 ++++---- 2 files changed, 138 insertions(+), 172 deletions(-) diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 4bcc9e0..dbc7948 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -385,11 +385,12 @@ 取消 + showProblem = false; + hiddenDangerList2 = []; + describe.hdDesc = ''; + describe.hdInfo = ''; + ">取消 + 存在隐患 确认 @@ -941,7 +942,7 @@ }, showInvestigationTag2(v) { - // console.log(v, this.investigationSelectList) + console.log('gxh查看1', v, this.investigationSelectList, this.hiddenDangerList) if (this.checked.includes(v.id)) { this.showInvestigation2 = true; this.showInvestigation2Item = v @@ -997,6 +998,7 @@ this.showPicker = true }, select2(v, list, list2) { + console.log('select2') list.dangerItems.forEach(item => { // 假设this.troubleshootingData中没有与当前item.id相同的id let found = false; @@ -1064,6 +1066,7 @@ }, select3(v) { + console.log('select3') // this.investigationSelectList.map((r) => { // if (r.nid == v.nid) { // r = v; @@ -1291,155 +1294,107 @@ }, // "/hiddenDanger/highDanger/getSectionInfo", getBaseData(businessId) { - this.$request - .globalRequest( - "/hiddenDanger/highDanger/getSectionInfo", { - nuserid: this.$.getData("token"), - businessId - }, - "GET" - ) - .then((res) => { - if (res.code === 200) { - for (let k in res.result) { - if (res.result[k] == 0) { - res.result[k] = "" - } + this.$request.globalRequest("/hiddenDanger/highDanger/getSectionInfo", {nuserid: this.$.getData("token"), businessId}, "GET").then((res) => { + if (res.code === 200) { + for (let k in res.result) { + if (res.result[k] == 0) { + res.result[k] = "" } - this.formData = { - ...this.formData, - ...res.result - }; - console.log('this.columnsdlPicker', this.columnsdlPicker) - this.columnsdlPicker[0]?.forEach(item => { - if(item.enumvalue == this.formData.roadType) { - this.$set(this.formData, 'roadTypeName', item.enumName) - } - }) - this.getStreetCommunityByXq() - this.getBaseDefaultData() } - }); - this.$request - .globalRequest( - "/hiddenDanger/highDanger/getSectionTraffic", { - nuserid: this.$.getData("token"), - businessId - }, - "GET" - ) - .then((res) => { - if (res.code === 200) { - // todo 无数据结构 - this.formData = { - ...this.formData, - ...res.result - }; + this.formData = { + ...this.formData, + ...res.result + }; + console.log('this.columnsdlPicker', this.columnsdlPicker) + this.columnsdlPicker[0]?.forEach(item => { + if(item.enumvalue == this.formData.roadType) { + this.$set(this.formData, 'roadTypeName', item.enumName) + } + }) + this.getStreetCommunityByXq() + this.getBaseDefaultData() + } + }); + this.$request.globalRequest("/hiddenDanger/highDanger/getSectionTraffic", {nuserid: this.$.getData("token"), businessId}, "GET").then((res) => { + if (res.code === 200) { + // todo 无数据结构 + this.formData = { + ...this.formData, + ...res.result + }; + } + }); + this.$request.globalRequest("/hiddenDanger/highDanger/getImportDangerDisplay", {sid: "02", businessId}, "GET").then((res) => { + if (res.code === 200) { + // todo 无数据结构 + for (let items of res.result) { + for (let item of items.dangerItems) { + item.nid = items.nid + } } - }); - this.$request - .globalRequest( - "/hiddenDanger/highDanger/getImportDangerDisplay", { - sid: "02", - businessId - }, - "GET" - ) - .then((res) => { - if (res.code === 200) { - // todo 无数据结构 - for (let items of res.result) { - for (let item of items.dangerItems) { - item.nid = items.nid - } + // console.log(res.result,11111) + this.investigationSelectList = res.result; + this.investigationSelectList.map((r) => { + this.troubleshootingData = [...this.troubleshootingData, ...r.dangerItems] + }); + console.log('this.troubleshootingData', this.troubleshootingData) + // console.log(this.troubleshootingData, 11111) + this.checked = this.troubleshootingData.map(r => { + if (r.checked == 1) { + return r.id } - // console.log(res.result,11111) - this.investigationSelectList = res.result; - this.investigationSelectList.map((r) => { - this.troubleshootingData = [...this.troubleshootingData, ...r.dangerItems] - }); - console.log('this.troubleshootingData', this.troubleshootingData) - // console.log(this.troubleshootingData, 11111) - this.checked = this.troubleshootingData.map(r => { - if (r.checked == 1) { - return r.id - } - }) - this.checked = this.checked.filter(item => item !== undefined); - for (let i in this.troubleshootingData) { - if (this.troubleshootingData[i].checked == 1) { - // alert(111) - - this.initTroubleshootingData(this.troubleshootingData[i].id, i) - } + }) + this.checked = this.checked.filter(item => item !== undefined); + for (let i in this.troubleshootingData) { + if (this.troubleshootingData[i].checked == 1) { + // alert(111) + this.initTroubleshootingData(this.troubleshootingData[i].id, i) } - this.initCheckedSelect() - // console.log(this.troubleshootingData) - // this.$request - // .globalRequest( - // "/hiddenDanger/highDanger/getImportDangerDisplayDetail", { - // nuserid: this.$.getData("token"), - // businessId, - // dangerId: '26' - // }, - // "GET" - // ) - // .then((res) => { - // if (res.code === 200) { - // this.investigationSelectList.map((r) => { - // r.extraConfigs = []; - // res.result.map((m) => { - // if (r.nid == m.scenesId) { - // r.extraConfigs.push(m); - // } - // }); - // }); - // } - // }); - } - }); - this.$request - .globalRequest( - "/hiddenDanger/highDanger/getImportDangers", { - nuserid: this.$.getData("token"), - businessId - }, - "GET" - ) - .then((res) => { - if (res.code === 200) { - this.investigationList = res.result; - } - }); - this.$request - .globalRequest( - "/hiddenDanger/highDanger/getUserHiddenDangerList", { - // nuserid: this.$.getData("token"), - pcType: 2, - businessId - }, - "GET" - ) - .then((res) => { - if (res.code === 200) { - this.hiddenDangerList.push(...res.result) - } - }); - this.$request - .globalRequest( - "/hiddenDanger/highDanger/getDangerItems", { - nuserid: this.$.getData("token"), - businessId - }, - "GET" - ) - .then((res) => { - if (res.code === 200) { - this.problemTreeSelectConfirmList = res.result; } - }); + this.initCheckedSelect() + // console.log(this.troubleshootingData) + // this.$request + // .globalRequest( + // "/hiddenDanger/highDanger/getImportDangerDisplayDetail", { + // nuserid: this.$.getData("token"), + // businessId, + // dangerId: '26' + // }, + // "GET" + // ) + // .then((res) => { + // if (res.code === 200) { + // this.investigationSelectList.map((r) => { + // r.extraConfigs = []; + // res.result.map((m) => { + // if (r.nid == m.scenesId) { + // r.extraConfigs.push(m); + // } + // }); + // }); + // } + // }); + } + }); + this.$request.globalRequest("/hiddenDanger/highDanger/getImportDangers", {nuserid: this.$.getData("token"), businessId}, "GET").then((res) => { + if (res.code === 200) { + this.investigationList = res.result; + } + }); + this.$request.globalRequest("/hiddenDanger/highDanger/getUserHiddenDangerList", {pcType: 2, businessId}, "GET").then((res) => { + if (res.code === 200) { + this.hiddenDangerList.push(...res.result) + } + }); + + this.$request.globalRequest("/hiddenDanger/highDanger/getDangerItems", {nuserid: this.$.getData("token"), businessId}, "GET") + .then((res) => { + if (res.code === 200) { + this.problemTreeSelectConfirmList = res.result; + } + }); }, handleSelectProblem(item, index) { // this.problemTreeSelectConfirmList.push(item) @@ -1465,7 +1420,7 @@ ) .then((res) => { if (res.code === 200 && res.result.length != 0) { - this.hiddenDangerList.push(...res.result) + // this.hiddenDangerList.push(...res.result) console.log(this.troubleshootingData, 123) console.log(res.result, 321) @@ -1861,7 +1816,7 @@ this.extraConfigs = extraConfigs this.describeArr = describe this.temporary = temporary - console.log(this.extraConfigs, this.describeArr) + console.log('describeArrdescribeArrdescribeArr', this.extraConfigs, this.describeArr) if (!temporary) { this.postSaveManualInvestigation() return diff --git a/pages/knowledge/index.vue b/pages/knowledge/index.vue index 3fda7fd..9976a23 100644 --- a/pages/knowledge/index.vue +++ b/pages/knowledge/index.vue @@ -38,13 +38,13 @@ @@ -167,23 +167,34 @@ }, methods: { async clickIcon(type, qaId) { - if(this.iconsType == '') { - this.iconsType = type - } else { - if(this.iconsType == 'handUp') { - if(type == 'handUp') { - this.iconsType = '' - } else { - this.iconsType = 'handDown' - } - } else { - if(type == 'handUp') { - this.iconsType = 'handUp' + console.log(this.msgList) + this.msgList.forEach(item => { + if(item.qaId == qaId) { + if(item.iconsType == '' || !item.hasOwnProperty('iconsType')) { + this.iconsType = type + this.$set(item, 'iconsType', type) } else { - this.iconsType = '' + if(item.iconsType == 'handUp') { + if(type == 'handUp') { + this.iconsType = '' + this.$set(item, 'iconsType', '') + } else { + this.iconsType = 'handDown' + this.$set(item, 'iconsType', 'handDown') + } + } else { + if(type == 'handUp') { + this.iconsType = 'handUp' + this.$set(item, 'iconsType', 'handUp') + } else { + this.iconsType = '' + this.$set(item, 'iconsType', '') + } + } } } - } + }) + const params = { qaId, feedbackStatus : this.iconsType == '' ? 0 : (this.iconsType == 'handUp' ? 1 : 2), @@ -201,12 +212,12 @@ }, data: params }) - - uni.showToast({ - title: res.data.result, - // icon: 'success', - duration: 2000 - }); + this.$.toast(res.data.result); + // uni.showToast({ + // title: res.data.result, + // // icon: 'success', + // duration: 2000 + // }); }, handleTouchStart(e) { // 获取触摸开始时的坐标