fix 修改了选择资产模型(完善)

master
rouchen 2024-05-14 11:54:02 +08:00
parent 1690e8a676
commit 590221f5ce
2 changed files with 73 additions and 8 deletions

View File

@ -37,7 +37,7 @@
<el-col :span="6" v-for="asset in assetShowList" style="margin-top: 20px">
<el-descriptions :title="asset.key" direction="vertical" border :column="1">
<el-descriptions-item label="Type">
<el-tag size="small">{{asset.type}}</el-tag>
<el-tag size="small">{{asset.fieldName}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="Value">{{asset.value}}</el-descriptions-item>
</el-descriptions>

View File

@ -224,6 +224,9 @@
<el-button style="float: right; padding: 3px 0" type="text" @click="dataModelRandom"></el-button>
</div>
{{dataModelList}}
<br>
<br>
{{dataModeMapList}}
<el-descriptions direction="vertical" :column="3" border>
<el-descriptions-item v-for="_dataModel in dataModelList"
@ -282,6 +285,7 @@ import {
selectDataAuthorization, selectDataDisplayName, selectDataDisplayVal, selectDataStructureTableName,
selectKvt
} from '@/api/kvt/kvt'
import data from '@/views/system/dict/data.vue'
export default {
name: "EngineVersion",
@ -296,25 +300,84 @@ export default {
this.assetsList = res.data;
})
}
},
},// this.dataModeMapList2
//
// if (item.fieldName === this.dataModelList.common){
// this.dataModeMapList[index].value = this.dataModelList.name
// }
//
// this.dataModeMapList%this.dataModelList.size() this.dataModeMapListthis.dataModelListcommonname
'assets': {
handler(newVal){
console.log("val",newVal)
handler(newVal) {
console.log("val", newVal)
selectDataStructureTableName(newVal).then(res => {
this.dataModelList = res.data
for (let resKey in res.data) {
console.log("resKey",resKey)
this.dataName.push(res.data[resKey].name)
}
console.log("dataName",this.dataName)
console.log("ssssssssssssss", this.dataModelList)
})
//
selectDataDisplayName(newVal).then(res =>{
selectDataDisplayName(newVal).then(res => {
console.log("pp", res)
this.dataModeMapList = res.data
console.log("ss",this.dataModeMapList)
})
for (let resKey in res.data) {
this.dataVal.push({
key: res.data[resKey].fieldName,
value: res.data[resKey].value,
type: res.data[resKey].type
}
)
// // this.dataModeMapList dd
// for (let i = 0; i < this.dataModeMapList.length; i+=this.dataModelList.size) { // 使 i++ i+=this.dataModelList.size
// if (this.dataModelList.common == res.data[i].fieldName) { // someConditionToCheck this.dataModelList.common
// // value dd
// dd.push({
// [ res.data[i].fieldName]: this.dataModeMapList[i].value
// }); // 使 this.dataModeMapList[i].value this.dataModeMapList.value
// }
// }
}
if (this.dataVal != null) {
let keys = this.dataName
let count = keys.length
const newData = this.dataVal.reduce((acc, curr, index) => {
if (index % count === 0 && index + count - 1 < this.dataVal.length) { //
//
const tempObj = {};
// 使 keys tempObj
for (let i = 0; i < keys.length; i++) {
// 访 kvt
tempObj[keys[i]] = (i === 0 || i === 2) ? parseInt(this.dataVal[index + i].value, 10) : this.dataVal[index + i].value;
}
// acc
acc.push(tempObj);
}
//
return acc;
}, []);
this.newData=newData
}
this.dataModeMapList = this.newData
console.log("ss", this.dataModeMapList)
})
}
}
},
data() {
return {
dataName:[],
dataVal:[],
newData:[],
ruleEngine: this.$route.params && this.$route.params.id,
ruleEngineInfo: {},
ruleEngineInfoList: [
@ -607,8 +670,10 @@ export default {
},
//
dataModelRandom(){
this.dataModeMapIndex = Math.floor(Math.random()*this.dataModeMapList.length);
console.log("thisth",this.dataModeMapIndex)
console.log("thiss",this.dataModeMapList[this.dataModeMapIndex])
},
saveCoding(){
updataEngineVersionStatus(this.ruleEngineVersionInfoAndTest).then(res => {