Browse Source

动态词包 账户配置

jiayufei 4 years ago
parent
commit
1de9b1a2d0

+ 2 - 2
src/utils/request.js

@@ -16,8 +16,8 @@ else if (process.env.NODE_ENV == 'debug') {
 else if (process.env.NODE_ENV == 'production') { 
   
   // axios.defaults.baseURL = 'http://apipre.tjyourong.com.cn/jeecg-boot';//预生产
-  axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
-  // axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
+  // axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
+  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 7 - 0
src/views/modules/creative-copywrit/creative-copywrit.less

@@ -6,6 +6,13 @@
         height: 500px !important;
         overflow-y: auto;
     }
+    .ad-name-tags-class {
+        width: 500px;
+        display: flex;
+        .name-tags-left {
+            width: 350px;
+        }
+    }
     .acount-title {
         display: flex;
         font-size: 14px;

+ 61 - 4
src/views/modules/creative-copywrit/creative-copywrit.vue

@@ -1501,11 +1501,25 @@
                                         ]}
                                     ]"
                                     class="examin-form-input"
+                                    :id="item.name"
                                     placeholder="请输入"
                                     @change="handleFormInputChang($event, item)"
                                 />
                                 <span class="examin-form-num">{{ handleFilterName(item.name) }}/30</span>
                                 <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
+                                <div class="ad-name-tags-class">
+                                    <div class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in adNameTags"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleGetChangeAll(val.name, item.name)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div><a @click="handleGetCreativeWord">更多</a></div>
+                                </div>
                             </a-form-item>
                         </a-form>
                     </div>
@@ -1563,6 +1577,19 @@
                                 />
                                 <span class="examin-form-num">{{ handleFilterName(item.name) }}/30</span>
                                 <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
+                                <div class="ad-name-tags-class">
+                                    <div class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in adNameTags"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleGetChangeAll(val.name, item.name)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div><a @click="handleGetCreativeWord">更多</a></div>
+                                </div>
                             </a-form-item>
                         </a-form>
                     </div>
@@ -1603,6 +1630,7 @@ export default {
     },
     data() {
         return {
+            adNameTags: [],
             batchVisible: false,
             showTabsTitle: '',
             taobaoSpecialOfferTitle: 'taobao',
@@ -1875,6 +1903,7 @@ export default {
             }
         });
         this.getHangye();
+        this.handleGetCreativeWord();
     },
     watch: {
         $route(n, o) {
@@ -1927,6 +1956,38 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleGetCreativeWord() {
+            // adNameTags
+            getAction('/ctop/ByteDanceCreativeWordPackage/list', this.tagsPage).then(result => {
+                if (result.code === 0) {
+                    console.log(result, 'result--result--result');
+                    this.adNameTags = result.result.records;
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
+        // 点击获取光标位置进行字段插入
+        handleGetChangeAll(item, field) {
+            let node = document.getElementById(field);
+            let startPos = node.selectionStart; // input 第0个字符到选中的字符
+            let endPos = node.selectionEnd; // 选中的字符到最后的字符
+            let txt = node.value;
+            if (startPos === 0 || endPos === 0) {
+                txt += '-{{' + item + '}}-';
+                this.examinForm.setFieldsValue({[field]: txt});
+            }
+            else {
+                this.examinForm.setFieldsValue({[field]: txt.substring(0, startPos) + '-{{' + item + '}}-' + txt.substring(endPos)});
+                node.selectionStart = startPos + item.length + 6;
+                node.selectionEnd = startPos + item.length + 6;
+            }
+            node.focus();
+            node.blur();
+        },
         handleApprovedClick() {
             const batchList = [];
             this.defaultFormList = [];
@@ -1935,7 +1996,6 @@ export default {
                     batchList.push(item);
                 }
             });
-            console.log(batchList, 'batchList');
             this.modalShowBatchList = batchList;
             this.batchVisible = true;
             for (let i = 0; i < 3; i++) {
@@ -1974,7 +2034,6 @@ export default {
             });
         },
         handleBatchCancel() {
-            console.log('批量取消按钮');
             this.batchVisible = false;
         },
         handleFodderWind() {
@@ -2589,8 +2648,6 @@ export default {
             }
         },
         onChangeCheck(checkedList, data) {
-            console.log(data, 'data--data');
-            console.log(checkedList, this.checkArr, this.dataSource, '-------');
             if (data.value === '0') {
                 this.showTabsTitle = '0';
             }

+ 2 - 2
vue.config.js

@@ -87,8 +87,8 @@ module.exports = {
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目 
         // target:'http://118.24.244.213:8804',
         // target: 'http://192.168.1.43:8080', // 子安
-        // target: 'http://192.168.1.8:8806', // 学超
-       target:'http://139.186.165.84:8806', //测试
+        target: 'http://192.168.1.8:8806', // 学超
+      //  target:'http://139.186.165.84:8806', //测试
 
         ws: false,