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

attributes

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