提交 5aaed118 authored 作者: 潘鹏's avatar 潘鹏

attributes

上级 20621a12
......@@ -1036,7 +1036,8 @@
<li class="prev-li" v-for="(item,index) in paramsters" :key="index" style="margin-top:40px;width: 700px;float: left">
<div>
<!-- <i-input v-model="item.paramName" size="small" type="text" placeholder="参数名称"/>-->
<span :style="`width:100px;line-height: 40px;text-align: center;height: 40px;`">{{item.attrName}}</span>
<span :style="`width:100px;line-height: 40px;text-align: center;height: 40px;`">
<span v-show="item.need" :style="`color:red`">*</span>{{item.attrName}}</span>
</div>
<div>
<!-- <i-input v-model="item.paramValue" size="small" type="text" placeholder="参数值"/>-->
......
......@@ -597,24 +597,19 @@ let vm = new Vue({
contentType: "application/json",
});
// this.paramster.forEach(item => {
// if (item.paramValue == '' || item.paramValue == null) {
// flag = false
// }
// })
this.paramsters.forEach(item => {
if (item.need == true&&item.value.length <= 0) {
flag = false
}
})
if (vm.prevItem.length === 0 || !flag) {
console.log(123);
alert('请编辑完属性或参数后再保存');
alert('请编辑完必填的属性或参数后再保存');
} else {
let resArr = [];
this.prevItem.forEach(item => {
resArr.push(item)
})
let paramArr = [];
this.paramster.forEach(item => {
paramArr.push(item)
})
// vm.tbCfStationItem.paramster = this.paramster;
// console.log(this.paramster)
// console.log(this.paramsters)
......@@ -627,8 +622,10 @@ let vm = new Vue({
obj.attrId = item.attrId
obj.attrDescId = item.value.join();
parArr.push(obj)
// console.log(item)
}
})
vm.tbCfStationItem.paramster = parArr
let label = null;
vm.tbCfStationItem.itemLabel = this.isSelectedArr.map(item => item.id).join(',');
......@@ -819,22 +816,25 @@ let vm = new Vue({
$.get('../attributes/queryAttrInfo?itemId='+itemId,res=>{
console.log(JSON.parse(res).list)
JSON.parse(res).list.forEach(item=>{
let flag = false
vm.paramsters.forEach(_item=>{
if(item.attrId==_item.attrId){
console.log(item)
console.log(_item)
let itemCobe = item.descValue
_item.value = itemCobe.split(",")
flag = true
let itemCobeid = item.attrDescId
// let itemArr = []
// for(let i =0;i<itemCobe.split(",").length;i++){
// let obj = {}
// obj.attrDescId = itemCobeid.split(",")[i]
// obj.attrValue = itemCobe.split(",")[i]
// itemArr.push(obj)
// }
// _item.value = itemArr
_item.value = itemCobeid.split(",")
_item.descValue = itemCobe.split(",")
console.log(_item)
}
})
if(!flag){
let obj = {}
obj.attrName = item.paramName
let itemCobe = item.paramValue
obj.value = itemCobe.split(",")
vm.paramsters.push(obj)
}
})
})
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论