فهرست منبع

文案库 添加 编辑删除搜索

jiayufei 4 سال پیش
والد
کامیت
c246fd51d0
2فایلهای تغییر یافته به همراه83 افزوده شده و 45 حذف شده
  1. 81 43
      src/views/modules/copy-library/copy-library.vue
  2. 2 2
      vue.config.js

+ 81 - 43
src/views/modules/copy-library/copy-library.vue

@@ -433,43 +433,7 @@ export default {
             modalSelectMaterial: [],
             materTotalAll: 0,
             viedoCheckValue: [],
-            viedoDefaultList: [
-                {
-                    name: '北京市',
-                    id: 1,
-                    statDate: '2019-08-08'
-                },
-                {
-                    name: '上海市',
-                    id: 2,
-                    statDate: '2019-08-08'
-                },
-                {
-                    name: '天津市',
-                    id: 3,
-                    statDate: '2019-08-08'
-                },
-                {
-                    name: '武汉市',
-                    id: 4,
-                    statDate: '2019-08-08'
-                },
-                {
-                    name: '贵州市',
-                    id: 5,
-                    statDate: '2019-08-08'
-                },
-                {
-                    name: '太原市',
-                    id: 6,
-                    statDate: '2019-08-08'
-                },
-                {
-                    name: '大同市',
-                    id: 7,
-                    statDate: '2019-08-08'
-                }
-            ],
+            viedoDefaultList: [],
             visibleMatemal: false,
             advertisingAccount: [],
             copywrittypeName: 'horizontal',
@@ -713,13 +677,41 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleGetEditProjectList(data) {
+            const paramsData = {
+                slogan: data.slogan,
+                projectId: data.projectId
+            };
+            getAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/queryBySlogenAndProjectId', paramsData).then(result => {
+                if (result.code === 0) {
+                    const defaultData = result.result.materialNameArray;
+                    const updateData = [];
+                    defaultData.forEach((item, index) => {
+                        updateData.push({
+                            id: index + 1,
+                            materialName: item
+                        });
+                    });
+                    this.modalSelectMaterial = [...updateData];
+                }
+                else {
+                    that.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
         handleCurrencyEdit(data) {
-            console.log(data, this.controlTypeModel, this.modalSelectMaterial, 'data, --data');
             const defaultData = data;
             defaultData.controlTypeModel = this.controlTypeModel;
             if (this.controlTypeModel === '1') {
                 this.advertisingAccount[0] = defaultData.accountId;
             }
+            if (this.controlTypeModel === '2') {
+                this.$nextTick(() => {
+                    this.handleGetEditProjectList(defaultData);
+                });
+            }
             this.causeVisible = true;
             this.copywritingType = 'edit';
             this.copywrittypeName = this.controlTypeModel === '1' ? 'horizontal' : 'vertical';
@@ -794,7 +786,10 @@ export default {
                 title: '删除提示',
                 content: '是否删除该条数据',
                 onOk() {
-                    deleteAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/delete', {id: data.id}).then(result => {
+                    deleteAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/deleteBySlogenAndProjectId', {
+                        slogan: data.slogan,
+                        projectId: data.projectId
+                    }).then(result => {
                         if (result.code === 0) {
                             that.handleGetAppointList();
                             that.$message.success('删除成功');
@@ -1309,10 +1304,10 @@ export default {
                     postAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/addList', paramsData).then(result => {
                         if (result.code === 0) {
                             this.$message.success(result.message);
-                            this.controlTypeModel = '1';
+                            this.controlTypeModel = '2';
                             this.modalSelectMaterial = [];
                             this.handleCauseCancel();
-                            this.handleGetCurrencyList();
+                            this.handleGetAppointList();
                         }
                         else {
                             this.$message.error(result.message);
@@ -1324,10 +1319,53 @@ export default {
             });
         },
         handleUploadWxeclEdit() {
-            console.log('通用编辑');
+            if (!this.defaultFormList[0].value) {
+                this.$message.error('文案标题不能为空');
+                return;
+            }
+            const paramsData = {
+                id: this.copywritingEditList.id,
+                textCopywriter: this.defaultFormList[0].value
+            };
+            postAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/edit', paramsData).then(result => {
+                if (result.code === 0) {
+                    this.$message.success(result.message);
+                    this.causeVisible = false;
+                    this.controlTypeModel = '1';
+                    this.handleCauseCancel();
+                    this.handleGetCurrencyList();
+                }
+                else {
+                    this.$message.success(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
         },
         handleVerticalEdit() {
-            console.log('指定编辑');
+            if (!this.defaultFormList[0].value) {
+                this.$message.error('文案标题不能为空');
+                return;
+            }
+            const paramsData = {
+                slogan: this.copywritingEditList.slogan,
+                projectId: this.copywritingEditList.projectId,
+                newSlogan: this.defaultFormList[0].value
+            };
+            postAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/edit', paramsData).then(result => {
+                if (result.code === 0) {
+                    this.$message.success(result.message);
+                    this.causeVisible = false;
+                    this.controlTypeModel = '2';
+                    this.handleCauseCancel();
+                    this.handleGetAppointList();
+                }
+                else {
+                    this.$message.success(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
         },
         handleCauseSure() {
             if (this.copywritingType === 'add') {

+ 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:8806', // 子安
-				// 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', //测试
 				// target:'http://apipre.tjyourong.com.cn', //预生产
 
 				ws: false,