浏览代码

修改页面展示

syh 5 年之前
父节点
当前提交
6d1539713d

+ 48 - 18
src/views/template/userorientation/modules/ByteDanceUserOrientationTemplateModal.vue

@@ -35,8 +35,8 @@
           class="else-width"
           v-if="areaType!='NONE'"
         >
-          <transfer-city v-if="areaType == 'CITY'" :checkData.sync="cityList"></transfer-city>
-          <transfer v-if="areaType == 'COUNTY'" :checkData.sync="areaList"></transfer>
+          <transfer-city v-if="areaType == 'CITY'" :checkData.sync="cityList" :dataValue="cityStr"></transfer-city>
+          <transfer v-if="areaType == 'COUNTY'" :checkData.sync="areaList" :dataValue="areaStr"></transfer>
         </a-form-item>
 
         <a-form-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
@@ -70,10 +70,7 @@
           class="else-width"
           v-if="intrestType=='ZDY'"
         >
-          <intrest-category v-if="intrestType == 'ZDY'" :checkData.sync="intrestCategoryList" :dataValue="editData"></intrest-category>
-          {{intrestCategoryList}}
-          
-          <div @click="addData">tianji</div>
+          <intrest-category v-if="intrestType == 'ZDY'" :checkData.sync="intrestCategoryList" :dataValue="adTagStr"></intrest-category>
         </a-form-item>
         <a-form-item label="平台" :labelCol="labelCol" :wrapperCol="wrapperCol">
           <a-radio-group v-model="platformType">
@@ -162,6 +159,9 @@ export default {
   },
   data() {
     return {
+      cityStr:[],
+      areaStr:[],
+      adTagStr:[],
       cityList:[],
       areaList:[],
       name:"",
@@ -169,7 +169,6 @@ export default {
       platformType:"NONE",
       mobileType:[],
       intrestCategoryList:[],
-      editData:[ { "label": "游戏", "value": 10001 }, { "label": "家装建材", "value": 10201 }, { "label": "家居家纺", "value": 10202 }, { "label": "家电维修", "value": 10204 }, { "label": "日用百货", "value": 10205 }],
       smartFl:"0",
       intrestType:"NONE",
       title: '操作',
@@ -185,9 +184,10 @@ export default {
         xs: { span: 24 },
         sm: { span: 16 }
       },
+      id:null,
       confirmLoading: false,
       form: this.$form.createForm(this),
-      tags:[],
+      tags:null,
       gender: "NONE",
       toutiaoSex: {},
       ageRange: [],
@@ -199,7 +199,6 @@ export default {
       showArticleCategory: false,
       articleCategoryList: [],
       isArticleCategory: "NONE",
-      zdyrq: [],
       areaType: "NONE",
       value: undefined,
       model1: {},
@@ -278,18 +277,42 @@ export default {
       this.close()
     },
     handleOk() {},
-    add() {
-      this.edit({})
+    add(record) {
+      this.id = null;
+      this.model = Object.assign({}, record);
+      this.visible = true;
+      this.gender="NONE";
+      this.ageRange=[];
+      this.isMobileBrand="NONE";
+      this.showMobileBrand=false;
+      this.showArticleCategory=false;
+      this.tags = [];
+      this.isArticleCategory="NONE";
+      this.areaType="NONE";
+      this.cityStr=[];
+      this.areaStr=[];
+      this.adTagStr=[];
+      this.cityList=[];
+      this.areaList=[];
+      this.name="";
+      this.netType=[];
+      this.platformType="NONE";
+      this.mobileType=[];
+      this.intrestCategoryList=[];
+      this.smartFl="0";
+      this.intrestType="NONE";
+      this.gender="NONE";
+      this.ageRange=null;
     },
     edit(record) {
-      // this.form.resetFields()
-      this.model = Object.assign({}, record)
+      console.log(record)
       this.visible = true;
       this.gender = record.gender;
-      this.ageRange = record.age;
+      this.ageRange = JSON.parse(record.age);
       this.intrestType = record.intrestType;
       this.platformType = record.platform;
-      this.netType = record.ac;
+      this.netType = JSON.parse(record.ac)
+      console.log(typeof this.netType)
       this.smartFl = record.autoExtendEnabled;
       this.isArticleCategory = record.articleCategoryType;
       this.tags = JSON.parse(record.articleCategory);
@@ -297,9 +320,15 @@ export default {
       this.mobileType = record.deviceBrand;
       this.name = record.name;
       this.areaType = record.areaType;
-      this.cityList = record.city;
-      this.areaList = record.district;
-      this.intrestCategoryList = JSON.parse(record.adTag);
+      this.cityList = JSON.parse(record.cityStr);
+      this.areaList = JSON.parse(record.districtStr);
+      this.intrestCategoryList = JSON.parse(record.adTagStr);
+      this.cityStr = JSON.parse(record.cityStr);
+      this.areaStr = JSON.parse(record.districtStr);
+      this.adTagStr = JSON.parse(record.adTagStr);
+      this.id = record.id;
+      // this.form.resetFields()
+      this.model = Object.assign({}, record)
     },
     close() {
       this.$emit('close')
@@ -348,6 +377,7 @@ export default {
         if (!err) {
           console.log('Received values of form: ', values);
           let params = {};
+          params.id = this.id;
           params.gender = this.gender;
           params.ageRange = this.ageRange;
           params.intrestType = this.intrestType;

+ 7 - 17
src/views/template/userorientation/modules/IntrestCategory.vue

@@ -65,7 +65,7 @@ p {
 
 <template>
   <div class="transfer">
-      
+
     <div class="transfer-box">
       <div class="content-box">
         <p class="content-title">兴趣分类</p>
@@ -94,14 +94,14 @@ p {
           </p>
         </div>
       </div>
-      
+
       <div
         class="content-box"
         :style="{borderRight:!showClass?'0px':'1px solid #dadfe3'}"
         v-show="showCityData"
       >
         <p class="content-title">二级分类</p>
-        
+
         <div class="content">
           <!-- <p>
             <input
@@ -191,21 +191,11 @@ export default {
       this.getData()
       if (this.dataValue.length > 0) {
         this.checkData = this.dataValue
-        this.checkMatched = this.dataValue.filter(item => {
-          if (item.value < 10090) {
-            return item.value
-          }
+        this.checkMatched = this.dataValue.map(item => {
+          return item.value;
         })
-        this.checkMatched = this.checkMatched.map(item => {
-          return item.value
-        })
-        this.checkMatchedCity = this.dataValue.filter(item => {
-          if (item.value > 10090) {
-            return item.value
-          }
-        })
-        this.checkMatchedCity = this.checkMatchedCity.map(item => {
-          return item.value
+        this.checkMatchedCity = this.dataValue.map(item => {
+          return item.value;
         })
         console.log(this.checkMatchedCity)
         this.$emit('update:checkData', this.checkData)

+ 1 - 1
src/views/template/userorientation/modules/transferCity.vue

@@ -161,7 +161,7 @@ export default {
   name: 'ByteDanceUserOrientationTemplateList',
   components: {},
   props: {
-    editData: {
+    dataValue: {
       type: Array,
       default() {
         return []