调整图片、再次查询未渲染问题

This commit is contained in:
yunkexin 2025-10-29 09:01:04 +08:00
parent d7f01a3069
commit b7378267cf

View File

@ -142,7 +142,7 @@
onLoad(option) {
this.OrgId = option.OrgId // 'B043B28B-BBC3-C452-6052-4FBA1457ABFA'
// const orgId = uni.getStorageSync('orgId')
this.fetchEnums(['SKEvaluateLevelEnum','SKProductionUnit']);
this.fetchEnums(['SKEvaluateLevelEnum', 'SKProductionUnit']);
},
// onReady() {
// //setRules
@ -198,10 +198,10 @@
if (item.Nav_Librarys && item.Nav_Librarys.length > 0) {
item.Nav_Librarys.map(item1 => {
item1.EVALUATE_LEVELName = item1.EVALUATE_LEVEL !== undefined ? this.enumsData['SKEvaluateLevelEnum'].find(item => item.code === item1.EVALUATE_LEVEL).name : '';
if(!item1.MINE_NAME){
if (!item1.MINE_NAME) {
item1.MINE_NAME = item1.MineType !== undefined ? this.enumsData['SKProductionUnit'].find(item => item.code === item1.MineType).name : '';
}
})
}
})
@ -278,13 +278,15 @@
}
},
filterData() {
this.checkedItems = []
this.allData.map(item => {
if (item.DEPARTMENT_ID == this.model.DEPARTMENT_ID && item.POST_NAME == this.model.Nav_Post.NAME) {
this.filterDatas = item
//
const allIds= this.filterDatas.Nav_Librarys.map(item => item.ID);
this.checkedItems = ['all', ...allIds];
this.$set(this, 'filterDatas', item);
this.$nextTick(() => { // DOM
const allIds = this.filterDatas.Nav_Librarys.map(item1 => item1.ID);
this.checkedItems = ['all', ...allIds];
});
}
})
},
@ -316,21 +318,21 @@
}, {});
//
// 1. RISK_NAME RISK_DESCRIPTION
const allPhotos = [];
const photoNames = new Set(); // name
arr.forEach(item => {
// Nav_Photo
if (Array.isArray(item.Nav_Photo)) {
item.Nav_Photo.forEach(photo => {
// name
if (!photoNames.has(photo.name)) {
allPhotos.push(photo);
photoNames.add(photo.name);
}
});
}
// Nav_Photo
if (Array.isArray(item.Nav_Photo)) {
item.Nav_Photo.forEach(photo => {
// name
if (!photoNames.has(photo.NAME)) {
allPhotos.push(photo);
photoNames.add(photo.NAME);
}
});
}
});
// allPhotos Nav_Photo
let newarr = {
@ -363,34 +365,34 @@
`\n${riskName}\n ${measuresList}`;
})
.join(''),
RISK_DESCRIPTION: this.handleData(arr,'RISK_DESCRIPTION'),
EMERGENCY: this.handleData(arr,'EMERGENCY'),
Nav_Photo:allPhotos
RISK_DESCRIPTION: this.handleData(arr, 'RISK_DESCRIPTION'),
EMERGENCY: this.handleData(arr, 'EMERGENCY'),
Nav_Photo: allPhotos
}
uni.setStorageSync('detailData', newarr);
uni.navigateTo({
url: '/pages/apply/jobRiskShow'
})
},
handleData(arr,namekey){
handleData(arr, namekey) {
const oneData = {};
arr.forEach(item => {
const name = item.RISK_NAME;
const desc = item[namekey];
//
if (oneData[name]) {
oneData[name].add(desc);
} else {
oneData[name] = new Set([desc]);
}
const name = item.RISK_NAME;
const desc = item[namekey];
//
if (oneData[name]) {
oneData[name].add(desc);
} else {
oneData[name] = new Set([desc]);
}
});
const resultArr = [];
for (const [name, descList] of Object.entries(oneData)) {
// Set 12
const descStr = Array.from(descList).join('');
resultArr.push(`${name}${descStr}`);
// Set 12
const descStr = Array.from(descList).join('');
resultArr.push(`${name}${descStr}`);
}
// 3. \n
const finalResult = resultArr.join('\n');
return finalResult