From b839698591d7939675f32b1d3ef5c2562b0a9bb5 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Fri, 9 Aug 2024 18:05:59 +0800 Subject: [PATCH] 1 --- pages/index/index.vue | 2 +- pages/investigation/complete.vue | 120 +- pages/investigation/index.vue | 8 +- pages/investigation/task.vue | 190 ++- pages/map/index.vue | 2192 +++++++++++++++--------------- 5 files changed, 1333 insertions(+), 1179 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 52a3a08..7eee5a7 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -187,7 +187,7 @@ } else { this.$.open('/pages/map/index?businessId=' + row.businessId + '§ionId=' + row.sectionCode + '&operator=' + row.operator + '&deptId=' + row.handleDept + '&taskName=' + row.name + - '&pcType' + row.pcType + '§ionName=' + row.sectionName + '§ionCode=' + row.sectionCode) + '&pcType' + row.pcType + '§ionName=' + row.sectionName + '§ionCode=' + row.sectionCode+ '&enumname=' + row.enumname+ '&deadlineStatus=' + row.deadlineStatus) } }, konw() { diff --git a/pages/investigation/complete.vue b/pages/investigation/complete.vue index 654a858..b43121a 100644 --- a/pages/investigation/complete.vue +++ b/pages/investigation/complete.vue @@ -53,7 +53,7 @@ - {{ formData.roadType }} + {{ initDic(formData.roadType, columnsdlPicker) }} @@ -66,24 +66,24 @@ {{ formData.laneCount }} - + 车道 - {{ formData.roadStructure }} + {{ initDic(formData.roadStructure, columnsEnumPicker) }} - {{ formData.sideProtec }} + {{ initDic(formData.sideProtec, columnsEnum2Picker) }} - {{ formData.centerSeparate }} + {{ initDic(formData.centerSeparate, columnsEnum3Picker) }} @@ -254,13 +254,29 @@ investigationSelectList: [], hiddenDangerList: [], - +showEnumPicker: false, + columnsEnumPicker: [ +[] + ], + showEnum2Picker: false, + columnsEnum2Picker: [ +[] + ], + columnsdlPicker:[[]], + showEnum3Picker: false, + columnsEnum3Picker: [ + [] + ], } }, // 页面加载 onLoad(e) { this.boxHeight = uni.getSystemInfoSync().windowHeight; + this.getEnumValues1() + this.getRoadTypes() + this.getEnumValues2() + this.getEnumValues3() if (e.id) { this.businessId = e.id; this.name = e.taskName @@ -305,6 +321,98 @@ // 方法 methods: { + getEnumValues1() { + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getEnumValues", { + enumType: '3119' + }, + "GET" + ) + .then((res) => { + if (res.code === 200) { + console.log(res.result) + // console.log(res) + let arr = res.result + for (let item of arr) { + item.label = item.enumName + } + this.columnsEnumPicker = [arr] + } + }); + }, + // 数据回显 + initDic(val, arr, label='label', value = 'enumvalue') { + // console.log(val==0) + let str = '- -' + for (let item of arr[0]) { + if (item[value] == val) { + str = item[label] + } + } + return str + }, + getRoadTypes() { + + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getRoadTypes", { + enumType: '303' + }, + "GET" + ) + .then((res) => { + if (res.code === 200) { + console.log(res.result) + // console.log(res) + let arr = res.result + for (let item of arr) { + item.label = item.enumName + } + this.columnsdlPicker = [arr] + } + }); + }, + getEnumValues2() { + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getEnumValues", { + enumType: '3127' + }, + "GET" + ) + .then((res) => { + if (res.code === 200) { + console.log(res.result) + // console.log(res) + let arr = res.result + for (let item of arr) { + item.label = item.enumName + } + this.columnsEnum2Picker = [arr] + } + }); + }, + getEnumValues3() { + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getEnumValues", { + enumType: '3121' + }, + "GET" + ) + .then((res) => { + if (res.code === 200) { + console.log(res.result) + // console.log(res) + let arr = res.result + for (let item of arr) { + item.label = item.enumName + } + this.columnsEnum3Picker = [arr] + } + }); + }, handleTabClick(tab) { this.tab = tab; diff --git a/pages/investigation/index.vue b/pages/investigation/index.vue index 6341c53..a3bbf59 100644 --- a/pages/investigation/index.vue +++ b/pages/investigation/index.vue @@ -60,13 +60,13 @@ {{ item.enumname || '--' }} - {{ item.deadlineStatus || '--' }} + {{ item.deadlineStatus || '--' }} - + 超期 - + 临期 @@ -300,7 +300,7 @@ '&deptId=' + row.handleDept + '&pcType=' + row.pcType + '&type=' + (this.tab == 1 ? 'edit' : 'view') + '§ionName=' + row.sectionName + - '§ionCode=' + row.sectionCode + '&taskName=' + row.name) + '§ionCode=' + row.sectionCode + '&taskName=' + row.name+ '&enumname=' + row.enumname+ '&deadlineStatus=' + row.deadlineStatus) // this.$.open('/pages/map/index?businessId=' + row.businessId) } diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 694dfbd..ef6b32f 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -71,9 +71,10 @@ {{ formData.roadTypeName?formData.roadTypeName:'请选择道路类型' }} + @click="showdlPicker=true"> + {{ formData.roadTypeName?initDic(formData.roadType, columnsdlPicker) :'请选择道路类型' }} - {{ formData.roadTypeName }} + {{ initDic(formData.roadType, columnsdlPicker) }} @@ -87,8 +88,9 @@ - + {{ formData.laneCount }} 车道 @@ -97,17 +99,20 @@ - {{ formData.roadStructure?initDic(formData.roadStructure, columnsEnumPicker):'请选择路面结构' }} + {{ formData.roadStructure?initDic(formData.roadStructure, columnsEnumPicker):'请选择路面结构' }} + - {{ initDic(formData.roadStructure, columnsEnumPicker) }} + {{ initDic(formData.roadStructure, columnsEnumPicker) }} + {{ formData.sideProtec?initDic(formData.sideProtec, columnsEnum2Picker):'请选择路侧防护' }} + @click="showEnum2Picker=true"> + {{ formData.sideProtec?initDic(formData.sideProtec, columnsEnum2Picker):'请选择路侧防护' }} @@ -119,10 +124,12 @@ - {{ formData.centerSeparate?initDic(formData.centerSeparate, columnsEnum2Picker):'请选择中央隔离' }} + {{ formData.centerSeparate?initDic(formData.centerSeparate, columnsEnum3Picker):'请选择中央隔离' }} + - {{ initDic(formData.centerSeparate, columnsEnum2Picker) }} + {{ initDic(formData.centerSeparate, columnsEnum3Picker) }} + @@ -153,7 +160,7 @@ @confirm="pickerEnumConfirm"> - @@ -529,6 +536,7 @@ await this.getRoadTypes() await this.getEnumValues1() await this.getEnumValues2() + await this.getEnumValues3() await this.getBaseData(e.id); await this.getStreetCommunity() } @@ -840,17 +848,20 @@ showdlPicker: false, showtimePicker: false, columnsdlPicker: [ - + [] ], showEnumPicker: false, columnsEnumPicker: [ - + [] ], showEnum2Picker: false, columnsEnum2Picker: [ - + [] ], showEnum3Picker: false, + columnsEnum3Picker: [ + [] + ], nidZD: '', lockZD: false, nidYH: '', @@ -979,6 +990,27 @@ this.showInvestigation2 = true; this.showInvestigation2Item = v; }, + pickerEnumCancel(e) { + this.showEnumPicker = false + }, + pickerEnumConfirm(e) { + this.showEnumPicker = false + this.$set(this.formData, 'roadStructure', e.value[0].enumvalue) + }, + pickerEnum2Cancel(e) { + this.showEnum2Picker = false + }, + pickerEnum2Confirm(e) { + this.showEnum2Picker = false + this.$set(this.formData, 'sideProtec', e.value[0].enumvalue) + }, + pickerEnum3Cancel(e) { + this.showEnum3Picker = false + }, + pickerEnum3Confirm(e) { + this.showEnum3Picker = false + this.$set(this.formData, 'centerSeparate', e.value[0].enumvalue) + }, showInvestigationTag2(v) { console.log('gxh查看1', v, this.investigationSelectList, this.hiddenDangerList) @@ -1017,21 +1049,11 @@ }, pickerdlConfirm(e) { + console.log(e) this.showdlPicker = false this.$set(this.formData, 'roadType', e.value[0].enumvalue) this.$set(this.formData, 'roadTypeName', e.value[0].label) }, - // 数据回显 - initDic(val, arr, label='label', value = 'enumvalue') { - // console.log(val==0) - let str = '- -' - for (let item of arr[0]) { - if (item[value] == val) { - str = item[label] - } - } - return str - }, pickerdlCancel(e) { this.showdlPicker = false }, @@ -1039,29 +1061,6 @@ this.showtimePicker = false this.$set(this.formData, 'peakHours', e.value[0] + ' - ' + e.value[1]) }, - pickerEnumCancel(e) { - this.showEnumPicker = false - }, - pickerEnumConfirm(e) { - this.showEnumPicker = false - this.$set(this.formData, 'roadStructure', e.value[0].enumvalue) - }, - pickerEnum2Cancel(e) { - this.showEnum2Picker = false - }, - pickerEnum2Confirm(e) { - this.showEnum2Picker = false - this.$set(this.formData, 'sideProtec', e.value[0].enumvalue) - }, - pickerEnum3Cancel(e) { - this.showEnum3Picker = false - }, - pickerEnum3Confirm(e) { - this.showEnum3Picker = false - this.$set(this.formData, 'centerSeparate', e.value[0].enumvalue) - }, - - pickertimeCancel(e) { this.showtimePicker = false }, @@ -1296,6 +1295,7 @@ }); }, getRoadTypes() { + this.$request .globalRequest( "/hiddenDanger/highDanger/getRoadTypes", { @@ -1318,7 +1318,7 @@ getEnumValues1() { this.$request .globalRequest( - "/hiddenDanger/highDanger/getEnumValue", { + "/hiddenDanger/highDanger/getEnumValues", { enumType: '3119' }, "GET" @@ -1335,11 +1335,22 @@ } }); }, + // 数据回显 + initDic(val, arr, label = 'label', value = 'enumvalue') { + // console.log(val==0) + let str = '- -' + for (let item of arr[0]) { + if (item[value] == val) { + str = item[label] + } + } + return str + }, getEnumValues2() { this.$request .globalRequest( - "/hiddenDanger/highDanger/getEnumValue", { - enumType: '973' + "/hiddenDanger/highDanger/getEnumValues", { + enumType: '3127' }, "GET" ) @@ -1355,6 +1366,27 @@ } }); }, + getEnumValues3() { + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getEnumValues", { + enumType: '3121' + }, + "GET" + ) + .then((res) => { + if (res.code === 200) { + console.log(res.result) + // console.log(res) + let arr = res.result + for (let item of arr) { + item.label = item.enumName + } + this.columnsEnum3Picker = [arr] + } + }); + }, + getBaseDefaultData() { this.$request .globalRequest( @@ -1413,10 +1445,10 @@ if (res.code === 200) { for (let k in res.result) { if (res.result[k] == 0) { - if(k!='sideProtec'&&k!='centerSeparate'&&k!='roadStructure'){ + if (k != 'sideProtec' && k != 'centerSeparate' && k != 'roadStructure') { res.result[k] = "" } - + } } this.formData = { @@ -1459,7 +1491,9 @@ // console.log(res.result,11111) this.investigationSelectList = res.result; this.investigationSelectList.map((r) => { - this.troubleshootingData = [...this.troubleshootingData, ...r.dangerItems] + this.troubleshootingData = [...this.troubleshootingData, ...r + .dangerItems + ] }); console.log('this.troubleshootingData', this.troubleshootingData) // console.log(this.troubleshootingData, 11111) @@ -1665,7 +1699,8 @@ hdPic: hdPic, nid: $.createUUID(), hdInfo: this.describe.hdInfo, - dangerProblem: this.hiddenDangerList2[0].itemname + '/' + this.hiddenDangerList2[1].itemname + + dangerProblem: this.hiddenDangerList2[0].itemname + '/' + this.hiddenDangerList2[1] + .itemname + '/' + this.hiddenDangerList2[2].itemname } if (this.addInvestigationInfo.type == 'add') { @@ -1781,23 +1816,23 @@ } }, bottomButtonTwo() { - if (!this.type) { - if (!this.formData.roadType) { - return this.$.toast("请输入道路类型"); - } - if (!this.formData.roadWidth) { - return this.$.toast("请输入道路宽度"); - } - if (!this.formData.laneCount) { - return this.$.toast("请输入车道数"); - } - if (!this.formData.designSpeed) { - return this.$.toast("请输入设计时速"); - } - if (!this.formData.limitSpeed) { - return this.$.toast("请输入限速"); - } + // if (!this.type) { + if (!this.formData.roadType) { + return this.$.toast("请选择道路类型"); + } + if (!this.formData.roadWidth) { + return this.$.toast("请输入道路宽度"); + } + if (!this.formData.laneCount) { + return this.$.toast("请输入车道数"); } + if (!this.formData.designSpeed) { + return this.$.toast("请输入设计时速"); + } + if (!this.formData.limitSpeed) { + return this.$.toast("请输入限速"); + } + // } this.pageScrollTo() this.isEdit = false; this.active = 3; @@ -1877,7 +1912,8 @@ } else { checkedArr.forEach((item2, index2) => { let idToFind = item2.id; - let foundIndex = describe.findIndex(item1 => item1.hdTerm === idToFind); + let foundIndex = describe.findIndex(item1 => item1.hdTerm === + idToFind); if (foundIndex === -1) { if (item2.checkedSelect) { @@ -1893,9 +1929,12 @@ } else { let obj = { hdTerm: item2.id, - hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '', - hdPic: item2.checkedSelect ? item2.checkedSelect.hdPic : '', - hdInfo: item2.checkedSelect ? item2.checkedSelect.hdInfo : '', + hdDesc: item2.checkedSelect ? item2.checkedSelect + .hdDesc : '', + hdPic: item2.checkedSelect ? item2.checkedSelect + .hdPic : '', + hdInfo: item2.checkedSelect ? item2.checkedSelect + .hdInfo : '', pcType: 1 } // console.log(obj, 111111) @@ -1950,7 +1989,8 @@ this.extraConfigs = extraConfigs this.describeArr = describe this.temporary = temporary - console.log('describeArrdescribeArrdescribeArr', this.extraConfigs, this.describeArr) + console.log('describeArrdescribeArrdescribeArr', this.extraConfigs, this + .describeArr) if (!temporary) { this.postSaveManualInvestigation() return diff --git a/pages/map/index.vue b/pages/map/index.vue index b5dc652..fab223a 100644 --- a/pages/map/index.vue +++ b/pages/map/index.vue @@ -1,1094 +1,1100 @@ - - - - \ No newline at end of file