diff --git a/App.vue b/App.vue index 02b7e7e..d904710 100644 --- a/App.vue +++ b/App.vue @@ -40,4 +40,7 @@ uni-toast{ background: linear-gradient( 135deg, #5282CC 0%, #1246B3 100%); color: #ffffff; } + .uni-system-preview-image{ + z-index: 1000000!important; + } diff --git a/manifest.json b/manifest.json index 9d44709..98c10e0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name" : "隐患排查", - "appid" : "__UNI__CAFA804", + "appid" : "__UNI__68B38F3", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", @@ -65,33 +65,33 @@ }, "icons" : { "android" : { - "hdpi" : "unpackage/res/icons/72x72.png", - "xhdpi" : "unpackage/res/icons/96x96.png", - "xxhdpi" : "unpackage/res/icons/144x144.png", - "xxxhdpi" : "unpackage/res/icons/192x192.png" + "hdpi" : "", + "xhdpi" : "", + "xxhdpi" : "", + "xxxhdpi" : "" }, "ios" : { - "appstore" : "unpackage/res/icons/1024x1024.png", + "appstore" : "", "ipad" : { - "app" : "unpackage/res/icons/76x76.png", - "app@2x" : "unpackage/res/icons/152x152.png", - "notification" : "unpackage/res/icons/20x20.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "proapp@2x" : "unpackage/res/icons/167x167.png", - "settings" : "unpackage/res/icons/29x29.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "spotlight" : "unpackage/res/icons/40x40.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png" + "app" : "", + "app@2x" : "", + "notification" : "", + "notification@2x" : "", + "proapp@2x" : "", + "settings" : "", + "settings@2x" : "", + "spotlight" : "", + "spotlight@2x" : "" }, "iphone" : { - "app@2x" : "unpackage/res/icons/120x120.png", - "app@3x" : "unpackage/res/icons/180x180.png", - "notification@2x" : "unpackage/res/icons/40x40.png", - "notification@3x" : "unpackage/res/icons/60x60.png", - "settings@2x" : "unpackage/res/icons/58x58.png", - "settings@3x" : "unpackage/res/icons/87x87.png", - "spotlight@2x" : "unpackage/res/icons/80x80.png", - "spotlight@3x" : "unpackage/res/icons/120x120.png" + "app@2x" : "", + "app@3x" : "", + "notification@2x" : "", + "notification@3x" : "", + "settings@2x" : "", + "settings@3x" : "", + "spotlight@2x" : "", + "spotlight@3x" : "" } } } diff --git a/pages/investigation/components/investigation-item.vue b/pages/investigation/components/investigation-item.vue index 907ef57..7dfb5ab 100644 --- a/pages/investigation/components/investigation-item.vue +++ b/pages/investigation/components/investigation-item.vue @@ -167,6 +167,7 @@ sid }, 'GET').then(res => { if (res.code == 200) { + console.log(res.result) this.investigationDetailList = res.result.map(item => { switch (item.type) { diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 9b50845..ebcee12 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -247,7 +247,8 @@ - + @@ -579,6 +580,11 @@ if (this.checked.includes(v.id)) { this.showInvestigation2 = true; this.showInvestigation2Item = v + for (let item of this.hiddenDangerList) { + if (v.id == item.hdTerm) { + this.$set(this.showInvestigation2Item, 'checkedSelect', item) + } + } } }, @@ -706,7 +712,7 @@ this.fileList = []; let arr = [] try { - arr=v.hdPic.split(',') + arr = v.hdPic.split(',') } catch (error) { console.error(error) } @@ -800,16 +806,32 @@ .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, 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) + } + + } + // console.log(this.troubleshootingData) // this.$request // .globalRequest( // "/hiddenDanger/highDanger/getImportDangerDisplayDetail", { @@ -857,10 +879,10 @@ ) .then((res) => { if (res.code === 200) { - console.log(res.result); - this.hiddenDangerList = res.result; + this.hiddenDangerList.push(...res.result) } }); + this.$request .globalRequest( "/hiddenDanger/highDanger/getDangerItems", { @@ -886,9 +908,68 @@ JSON.stringify(this.hiddenDangerList3) ); } - console.log(this.hiddenDangerList2) }, + initCheckedSelect() { + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getUserHiddenDangerList", { + nuserid: this.$.getData("token"), + pcType: 1, + businessId: this.businessId + }, + "GET" + ) + .then((res) => { + if (res.code === 200) { + this.hiddenDangerList.push(...res.result) + console.log(this.troubleshootingData, 123) + console.log(res.result, 321) + + for (let i in this.troubleshootingData) { + for (let j in res.result) { + if (this.troubleshootingData[i].id == res.result[j].hdTerm) { + this.$set(this.troubleshootingData[i], "checkedSelect", { + hdInfo: res.result[j].hdInfo, + hdPic: res.result[j].hdPic, + hdDesc: res.result[j].hdDesc, + hdTerm: res.result[j].hdTerm, + pcType: 1 + }) + } + } + } + } + }); + }, + initTroubleshootingData(id, index) { + this.troubleshootingData[index].extraConfigs = [] + this.$request + .globalRequest( + "/hiddenDanger/highDanger/getImportDangerDisplayDetail", + { + dangerId: id, + businessId: this.businessId, + }, + "GET" + ) + .then((res) => { + if (res.code == 200) { + this.troubleshootingData[index].extraConfigs.push(...res.result) + } + if (this.checked.length - 1 == index) { + // alert(1111) + this.initCheckedSelect(index) + + } + + }); + // this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => { + // if (res.code == 200) { + // this.investigationList = res.result + // } + // }) + }, select(v) { this.hiddenDangerList3 = v; }, @@ -1057,7 +1138,7 @@ return uni.navigateBack(); } let checkedArr = this.troubleshootingData.filter(r => this.checked.includes(r.id)) - console.log(checkedArr) + // console.log(11111111, checkedArr) let extraConfigs = []; checkedArr.map((r) => { @@ -1074,7 +1155,9 @@ extraConfigs.push(s); }); }); + let describe = JSON.parse(JSON.stringify(this.hiddenDangerList)) + console.log(describe) try { for (let item of describe) { if (item.nid) { @@ -1094,37 +1177,108 @@ } catch (e) { //TODO handle the exception } + setTimeout(() => { + // let describe = [{ hdTerm: 1 }, { hdTerm: 2 }, { hdTerm: 3 }]; + // let checkedArr = [{ id: 1 }, { hdTerm: 5 }, { hdTerm: 3 }]; + + // 用于存储不存在于checkedArr.id中的describe元素的副本 + let notFoundIncheckedArr = []; + + // 用于记录describe和checkedArr中元素的索引 + let indexes = []; + if (describe.length <= 0) { + checkedArr.map(r => { + describe.push({ + hdTerm: r.id, + hdDesc: r.checkedSelect ? r.checkedSelect.hdDesc : '', + hdPic: r.checkedSelect ? r.checkedSelect.hdPic : '', + hdInfo: r.checkedSelect ? r.checkedSelect.hdInfo : '', + pcType: 1 + }) + }) + } else { + checkedArr.forEach((item2, index2) => { + let idToFind = item2.id; + let foundIndex = describe.findIndex(item1 => item1.hdTerm === idToFind); - checkedArr.map(r => { - describe.push({ - hdTerm: r.id, - hdDesc: r.checkedSelect ? r.checkedSelect.hdDesc : '', - hdPic: r.checkedSelect ? r.checkedSelect.hdPic : '', - hdInfo: r.checkedSelect ? r.checkedSelect.hdInfo : '', - pcType: 1 - }) - }) - console.log(this.investigationSelectList); - console.log(this.troubleshootingData); - console.log({ - ...this.formData, - businessId: this.businessId, - extraConfigs: extraConfigs, - describe: describe, - }); - this.extraConfigs = extraConfigs - this.describeArr = describe - this.temporary = temporary - console.log(this.extraConfigs, this.describeArr) - if (!temporary) { - this.postSaveManualInvestigation() - return - } - if (this.extraConfigs.length <= 0 || this.describeArr.length <= 0) { - this.modalShow = true - } else { - this.postSaveManualInvestigation() - } + if (foundIndex === -1) { + if (item2.checkedSelect) { + describe.push({ ...item2.checkedSelect, pcType: 1, hdTerm: item2.id, }); + } + // 如果在describe中找不到对应的hdTerm,将item2添加到describe中 + + // console.log(`添加: ${idToFind} 到 describe`); + } else { + let obj = { + hdTerm: item2.id, + hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '', + hdPic: item2.checkedSelect ? item2.checkedSelect.hdPic : '', + hdInfo: item2.checkedSelect ? item2.checkedSelect.hdInfo : '', + pcType: 1 + } + console.log(obj, 111111) + describe[foundIndex] = obj; + // 如果找到匹配的hdTerm,替换describe中的对应项 + // describe[foundIndex] = { hdTerm: idToFind }; + // console.log(`替换: describe[${foundIndex}] = ${idToFind}`); + } + + // console.log(`describe:`, describe); + }); + // describe.forEach((item1, index1) => { + // let found = false; + // checkedArr.forEach((item2, index2) => { + // if (item1.hdTerm === item2.id) { + // found = true; + // let obj = { + // hdTerm: item2.id, + // hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '', + // hdPic: item2.checkedSelect ? item2.checkedSelect.hdPic : '', + // hdInfo: item2.checkedSelect ? item2.checkedSelect.hdInfo : '', + // pcType: 1 + // } + // describe.splice(index1, 1, obj); + // // indexes.push({ describeIndex: index1, checkedArrIndex: index2 }); + // } + // if (!found) { + // // 注意:这里不直接push到arr1,而是到notFoundIncheckedArr + // describe.push({ ...item2 }); // 创建副本以避免直接修改arr1 + // } + // }); + + // }); + } + + console.log("Not found in checkedArr:", notFoundIncheckedArr); + console.log("Indexes of matching elements:", indexes); + + // 如果确实需要将这些元素添加到arr1(虽然通常不推荐),可以这样做: + // arr1.push(...notFoundInArr2); // 但这里我们没有做,因为可能改变原始意图 + + // console.log(describe) + // return false + // console.log(this.investigationSelectList); + // console.log(this.troubleshootingData); + // console.log({ + // ...this.formData, + // businessId: this.businessId, + // extraConfigs: extraConfigs, + // describe: describe, + // }); + this.extraConfigs = extraConfigs + this.describeArr = describe + this.temporary = temporary + console.log(this.extraConfigs, this.describeArr) + if (!temporary) { + this.postSaveManualInvestigation() + return + } + if (this.extraConfigs.length <= 0 || this.describeArr.length <= 0) { + this.modalShow = true + } else { + this.postSaveManualInvestigation() + } + }, 1); }, postSaveManualInvestigation() { @@ -1158,11 +1312,11 @@ } else { this.$.toast("暂存成功"); } - // setTimeout(() => { - // uni.navigateBack({ - // delta: 2, // 默认值是1,表示返回的页面层数 - // }); - // }, 1000); + setTimeout(() => { + uni.navigateBack({ + delta: 2, // 默认值是1,表示返回的页面层数 + }); + }, 1000); // this.data = res.result; // this.rname = this.data[0].name; diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 14d369d..2e2a79e 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -264,7 +264,7 @@ .u-cell-group { margin: 0 32rpx; padding: 15rpx 20rpx; - background-color: rgba(255, 255, 255, 0.6); + background-color: rgba(255, 255, 255, 0.75); border-radius: 13rpx; @@ -314,7 +314,7 @@ .logout { width: 690rpx; - background-color: rgba(255, 255, 255, 0.6); + background-color: rgba(255, 255, 255, 0.75); text-align: center; margin-top: 20rpx; margin-left: 30rpx;