Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-vue

zhuxinbo 4 years ago
parent
commit
5cffeb515f

+ 17 - 17
src/views/modules/BatchCreate/components/material.vue

@@ -437,7 +437,7 @@
           var sel = document.selection.createRange()
           sel.text = v
           sel.select()
-          item.textIds.push(tag.creative_word_id)
+          item.creativeWordIds.push(tag.creative_word_id)
         } else if (node.selectionStart || node.selectionStart == '0') {
           //MOZILLA/GOOGLE
           var startPos = node.selectionStart
@@ -448,14 +448,14 @@
             node.scrollTop = restoreTop
           }
           item.text = node.value
-          item.textIds.push(tag.creative_word_id)
+          item.creativeWordIds.push(tag.creative_word_id)
           node.focus()
           node.selectionStart = startPos + v.length
           node.selectionEnd = startPos + v.length
         } else {
           //OTHER
           node.value += v
-          item.textIds.push(tag.creative_word_id)
+          item.creativeWordIds.push(tag.creative_word_id)
           item.text = node.value
           node.focus()
         }
@@ -472,7 +472,7 @@
         }
         var node = document.getElementsByClassName('rending-all')[index]
         var v = '{' + tag.name + '}'
-        item.textIds.push(tag.name)
+        item.creativeWordIds.push(tag.name)
         if (document.selection) {
           //IE
           node.focus()
@@ -576,11 +576,11 @@
         this.getTags()
         if (type === 'CREATIVE_IMAGE_MODE_SMALL') {
           this.HorizontalLargeImageListSmall.push({
-            typeCode: type,
+            ImageMode: type,
             imageUrl: '',
             imageId: '',
             text: '',
-            textIds: [],
+            creativeWordIds: [],
             vadioUrl: '',
             videoId: '',
             multiple: [],
@@ -592,11 +592,11 @@
         }
         if (type === 'CREATIVE_IMAGE_MODE_LARGE') {
           this.HorizontalLargeImageListBig.push({
-            typeCode: type,
+            imageMode: type,
             imageUrl: '',
             imageId: '',
             text: '',
-            textIds: [],
+            creativeWordIds: [],
             vadioUrl: '',
             videoId: '',
             multiple: [],
@@ -609,11 +609,11 @@
         if (type === 'CREATIVE_IMAGE_MODE_GROUP') {
           this.HorizontalLargeImageListZu.push({
             creativeType: this.creativeType,
-            typeCode: type,
+            imageMode: type,
             imageUrl: '',
             imageId: '',
             text: '',
-            textIds: [],
+            creativeWordIds: [],
             vadioUrl: '',
             videoId: '',
             multiple: [],
@@ -626,11 +626,11 @@
         if (type === 'CREATIVE_IMAGE_MODE_VIDEO') {
           this.HorizontalLargeImageListShu.push({
             creativeType: this.creativeType,
-            typeCode: type,
+            imageMode: type,
             imageUrl: '',
             imageId: '',
             text: '',
-            textIds: [],
+            creativeWordIds: [],
             vadioUrl: '',
             videoId: '',
             multiple: [],
@@ -643,11 +643,11 @@
         if (type === 'CREATIVE_IMAGE_MODE_LARGE_VERTICAL') {
           this.HorizontalLargeImageListBigShu.push({
             creativeType: this.creativeType,
-            typeCode: type,
+            imageMode: type,
             imageUrl: '',
             imageId: '',
             text: '',
-            textIds: [],
+            creativeWordIds: [],
             vadioUrl: '',
             videoId: '',
             multiple: [],
@@ -660,11 +660,11 @@
         if (type === 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL') {
           this.HorizontalLargeImageListHeng.push({
             creativeType: this.creativeType,
-            typeCode: type,
+            imageMode: type,
             imageUrl: '',
             imageId: '',
             text: '',
-            textIds: [],
+            creativeWordIds: [],
             vadioUrl: '',
             videoId: '',
             multiple: [],
@@ -698,7 +698,7 @@
         this.titleData.push({
           text: '',
           titleMany: 0,
-          textIds: []
+          creativeWordIds: []
         })
       },
       tetleDetele(index) {

+ 23 - 6
src/views/modules/BatchCreate/newCreate.vue

@@ -239,8 +239,8 @@
             </div>
             <div class="input-item">
               <a-form-item>
-                <a-cascader :options="createOptions" :fieldNames="fieldNames" v-decorator="['thirdIndustryId']"
-                  placeholder="请选择创意分类" />
+                <a-cascader :options="createOptions" :fieldNames="fieldNames"
+                  placeholder="请选择创意分类" @change="createChange" />
               </a-form-item>
             </div>
           </div>
@@ -431,7 +431,8 @@
           label: 'name',
           value: 'id',
           children: 'children'
-        }
+        },
+        thirdIndustryId:undefined,
       }
     },
     components: {
@@ -477,6 +478,16 @@
       addCreate() {
 
       },
+      createChange(value){
+        console.log(value);
+        this.thirdIndustryId=value[2]
+        //  this.form.getFieldDecorator('thirdIndustryId')
+         
+        //  this.form.setFieldsValue({
+        //    thirdIndustryId:value[2]
+        // });
+        console.log(this.form.getFieldsValue())
+      },
       // //获取表单的某一个属性值
       getFormData(className) {
         return this.form.getFieldValue(className)
@@ -508,6 +519,7 @@
       initFormValue() {
         this.form.getFieldDecorator('inventoryType')
         this.form.getFieldDecorator('smartInventory')
+        this.form.getFieldDecorator('thirdIndustryId')
         // this.form.getFieldDecorator('sceneInventory')
       },
       // 验证网址
@@ -571,7 +583,8 @@
               var params = {
                 ...values
               }
-              params.thirdIndustryId = params.thirdIndustryId.pop()
+
+              // params.thirdIndustryId = params.thirdIndustryId.pop()
               var dataCreatives = this.$refs.material.HorizontalLargeImageListBig.concat(
                 this.$refs.material.HorizontalLargeImageListHeng,
                 this.$refs.material.HorizontalLargeImageListShu,
@@ -585,15 +598,19 @@
                 //   params.titles = this.titleData
                 params.titles = this.$refs.material.titleData
               }
+              values.thirdIndustryId=this.thirdIndustryId
                 postAction('/bytedance/batch/create/creative', {
-                  accountId: '1649600126891015',
+                  accountId:this.accountInfo.value,
                   adIds: ["1673732908509245"],
                   ...values,
                   creatives: dataCreatives
                 }).then((res) => {
                   console.log(res)
                   if (res.success) {
-                    if (res.code == 0) {} else {
+                     console.log(res)
+                    if (res.code == 0) {
+                     
+                    } else {
                       this.$message.error(res.message)
                     }