|
@@ -56,7 +56,7 @@
|
|
|
</a-form-item>
|
|
|
<div v-show="model.mediaId == '2' || model.mediaId == '4'">
|
|
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优化目标">
|
|
|
- <a-select @change="bidTypeChange($event)"
|
|
|
+ <a-select @change="bidTypeChange($event)" @deselect="bidtypedeselect"
|
|
|
v-decorator="['bidType', { rules: [{ required: true, message: '请选择优化目标' }], initialValue: 2 }]"
|
|
|
mode="multiple">
|
|
|
<a-select-option :value="2">点击数</a-select-option>
|
|
@@ -100,7 +100,7 @@
|
|
|
getFormFieldValue('bidType').findIndex((item) => item == 12) > -1 || getFormFieldValue('ocpxActionType').length == 0
|
|
|
" label="深度转化目标" :labelCol="labelCol" :wrapperCol="wrapperCol" >
|
|
|
<!-- v-model="model.ocpxActionType" -->
|
|
|
- <a-select @change="depthChange($event)" v-model="model.deepConversionType" mode="multiple">
|
|
|
+ <a-select @change="depthChange($event)" @deselect="depthChangedeselect" v-model="model.deepConversionType" mode="multiple">
|
|
|
<a-select-option :value="item.deepCode" v-for="(item, index) in depthList" :key="index">{{
|
|
|
item.deepName
|
|
|
}}</a-select-option>
|
|
@@ -234,25 +234,15 @@
|
|
|
console.log(item);
|
|
|
// this.maxBidShow = item.findIndex((item) => item == 2)
|
|
|
let odx = item.indexOf(2)
|
|
|
- if (odx == -1) {
|
|
|
- this.maxBidShow = false;
|
|
|
- } else {
|
|
|
+ if (item.length == 1 && odx > -1) {
|
|
|
this.maxBidShow = true;
|
|
|
- this.model.deepConversionType = [];
|
|
|
+ this.model.deepConversionType = [];
|
|
|
this.depthArray = [];
|
|
|
this.ocpxActionTypeArray = [];
|
|
|
- // this.maxBidShow = false;
|
|
|
+ }else if (odx > -1) {
|
|
|
+ this.maxBidShow = true;
|
|
|
}
|
|
|
- // item.indexOf(item=>{
|
|
|
- // console.log(item);
|
|
|
- // if (item == 2) {
|
|
|
- // console.log(this.maxBidShow);
|
|
|
- // this.maxBidShow = true;
|
|
|
- // }else{
|
|
|
- // this.maxBidShow = false;
|
|
|
-
|
|
|
- // }
|
|
|
- // })
|
|
|
+
|
|
|
if (item.length == 0) {
|
|
|
this.model.deepConversionType = [];
|
|
|
this.depthArray = [];
|
|
@@ -260,6 +250,12 @@
|
|
|
this.maxBidShow = false;
|
|
|
}
|
|
|
},
|
|
|
+ bidtypedeselect(item){
|
|
|
+ if (item ==2) {
|
|
|
+ this.maxBidShow = false
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
ocpxActionTypeChange(item) {
|
|
|
// this.ocpxActionTypeArray = [];
|
|
|
item.forEach(element => {
|
|
@@ -297,7 +293,7 @@
|
|
|
});
|
|
|
},
|
|
|
depthChange(event) {
|
|
|
- this.depthArray = [];
|
|
|
+ // this.depthArray = [];
|
|
|
event.forEach(element => {
|
|
|
this.depthList.find((par) => {
|
|
|
if (par.deepCode == element) {
|
|
@@ -306,7 +302,25 @@
|
|
|
|
|
|
})
|
|
|
});
|
|
|
- console.log(this.depthArray);
|
|
|
+ this.duplicate();
|
|
|
+ },
|
|
|
+ duplicate(){
|
|
|
+ for (var i = 0; i < this.depthArray.length - 1; i++) {
|
|
|
+ for (var j = i + 1; j < this.depthArray.length; j++) {
|
|
|
+ if (this.depthArray[i].deepName == this.depthArray[j].deepName) {
|
|
|
+ this.depthArray.splice(j, 1);
|
|
|
+ //因为数组长度减小1,所以直接 j++ 会漏掉一个元素,所以要 j--
|
|
|
+ j--;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ depthChangedeselect(item){
|
|
|
+ this.depthArray.forEach((element,index) => {
|
|
|
+ if (element.deepCode == item) {
|
|
|
+ this.depthArray.splice(index,1)
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
validateInputCode(rule, value, callback) {
|
|
|
if (value > 0) {
|