Procházet zdrojové kódy

文案库 页面 修改

jiayufei před 4 roky
rodič
revize
3e3f2d280e
1 změnil soubory, kde provedl 78 přidání a 36 odebrání
  1. 78 36
      src/views/modules/copy-library/copy-library.vue

+ 78 - 36
src/views/modules/copy-library/copy-library.vue

@@ -19,15 +19,17 @@
                     <a-form-model-item v-if="controlTypeModel === '2'" label="项目:">
                         <a-select
                             class="common-input-long"
+                            show-search
                             v-model="configForm.adConvertId"
                             placeholder="请选择"
+                            :filter-option="filterOption"
                         >
                             <a-select-option
                                 v-for="(item, index) in optimizationOption"
                                 :key="index"
-                                :value="item.convert_id"
+                                :value="item.projectId"
                             >
-                                {{ item.external_name }}
+                                {{ item.projectName }}
                             </a-select-option>
                         </a-select>
                     </a-form-model-item>
@@ -67,6 +69,7 @@
                         :columns="currencyColumns"
                         :dataSource="currencyData"
                         :pagination="false"
+                        :scroll="{x: 1500}"
                     >
                     </a-table>
                     <a-pagination
@@ -90,6 +93,7 @@
                         :columns="appointColumns"
                         :dataSource="appointData"
                         :pagination="false"
+                        :scroll="{x: 1500}"
                     >
                     </a-table>
                     <a-pagination
@@ -400,6 +404,7 @@ export default {
                 {
                     title: '文案',
                     align: 'center',
+                    width: 200,
                     dataIndex: 'textCopywriter'
                 },
                 {
@@ -411,131 +416,132 @@ export default {
                     title: '花费(元)',
                     align: 'center',
                     dataIndex: 'sumCost',
-                    sorter: () => {}
+                    sorter: (a, b) => a.sumCost - b.sumCost
                 },
                 {
                     title: '展示数',
                     dataIndex: 'sumShowMaterial',
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.sumShowMaterial - b.sumShowMaterial
                 },
                 {
                     title: '平均千次展现费用',
                     dataIndex: 'costPerThousandShow',
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.costPerThousandShow - b.costPerThousandShow
                 },
                 {
                     title: '点击数',
                     dataIndex: 'sumClick',
                     width: 180,
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.sumClick - b.sumClick
                 },
                 {
                     title: '平均点击单价',
                     dataIndex: 'costPerClick',
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.costPerClick - b.costPerClick
                 },
                 {
                     title: '点击率',
                     dataIndex: 'clickRate',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.clickRate - b.clickRate
                 },
                 {
                     title: '转化数',
                     dataIndex: 'sumConvertMaterial',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.sumConvertMaterial - b.sumConvertMaterial
                 },
                 {
                     title: '转化率',
                     dataIndex: 'convertRate',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.convertRate - b.convertRate
                 },
                 {
                     title: '转化成本',
                     dataIndex: 'costConvert',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.costConvert - b.costConvert
                 }
             ],
             appointColumns: [
                 {
                     title: '文案',
                     align: 'center',
-                    dataIndex: 'status'
+                    width: 200,
+                    dataIndex: 'slogan'
                 },
                 {
                     title: '相关创意',
                     align: 'center',
-                    dataIndex: 'accountId_dictText'
+                    dataIndex: 'count'
                 },
                 {
                     title: '花费(元)',
                     align: 'center',
-                    dataIndex: 'accountId',
-                    sorter: () => {}
+                    dataIndex: 'cost',
+                    sorter: (a, b) => a.cost - b.cost
                 },
                 {
                     title: '展示数',
-                    dataIndex: 'createTime',
+                    dataIndex: 'showNum',
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.showNum - b.showNum
                 },
                 {
                     title: '平均千次展现费用',
-                    dataIndex: 'validBalance',
+                    dataIndex: 'costPerThousandShow',
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.costPerThousandShow - b.costPerThousandShow
                 },
                 {
                     title: '点击数',
-                    dataIndex: 'accountBudget',
+                    dataIndex: 'click',
                     width: 180,
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.click - b.click
                 },
                 {
                     title: '平均点击单价',
-                    dataIndex: 'adCpaBidStr',
+                    dataIndex: 'costPerClick',
                     align: 'center',
-                    sorter: () => {}
+                    sorter: (a, b) => a.costPerClick - b.costPerClick
                 },
                 {
                     title: '点击率',
-                    dataIndex: 'cost',
+                    dataIndex: 'clickRate',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.clickRate - b.clickRate
                 },
                 {
                     title: '转化数',
-                    dataIndex: 'zhuanhualv',
+                    dataIndex: 'convertNum',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.convertNum - b.convertNum
                 },
                 {
                     title: '转化率',
-                    dataIndex: 'zhuanhuashu',
+                    dataIndex: 'convertRate',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.convertRate - b.convertRate
                 },
                 {
                     title: '转化成本',
-                    dataIndex: 'zhuanhuachengben',
+                    dataIndex: 'costConvert',
                     align: 'center',
                     width: 150,
-                    sorter: () => {}
+                    sorter: (a, b) => a.costConvert - b.costConvert
                 }
             ],
             appointData: [],
@@ -579,9 +585,27 @@ export default {
     mounted() {
         this.handleGetCurrencyList();
         this.hendleMaterialInfo();
+        this.handleGetProjectList();
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        filterOption(input, option) {
+            return (
+                option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+            );
+        },
+        handleGetProjectList() {
+            getAction('/ctop/projectMember/bytedanceProjectParticipateInList').then(result => {
+                if (result.code === 0) {
+                    this.optimizationOption = result.result;
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
         hendleMaterialInfo() {
             const paramsData = {
                 startDate: this.masterTimes[0],
@@ -591,7 +615,6 @@ export default {
             };
             getAction('/ctop/materialInfo/listV2', paramsData).then(result => {
                 if (result.code === 0) {
-                    console.log(result.data.list, '-----result-----');
                     this.viedoDefaultList = result.data.list;
                     this.materTotalAll = result.data.total;
                 }
@@ -609,6 +632,12 @@ export default {
             };
             this.currencyPag = page;
             this.appointPag = page;
+            this.configForm = {
+                acountId: '',
+                num: '',
+                adConvertId: '',
+                launchDateRange: []
+            };
             if (e === '1') {
                 this.handleGetCurrencyList();
             }
@@ -620,6 +649,7 @@ export default {
             let paramsData = {
                 accountId: this.configForm.acountId,
                 keyWord: this.configForm.num,
+                userId: this.userInfo().id,
                 startTime: this.configForm.launchDateRange[0],
                 endTime: this.configForm.launchDateRange[0],
                 pageNo: this.currencyPag.page,
@@ -639,7 +669,8 @@ export default {
         },
         handleGetAppointList() {
             let paramsData = {
-                prodId: this.configForm.adConvertId,
+                projectId: this.configForm.adConvertId,
+                userId: this.userInfo().id,
                 keyWord: this.configForm.num,
                 startTime: this.configForm.launchDateRange[0],
                 endTime: this.configForm.launchDateRange[0],
@@ -1022,13 +1053,24 @@ export default {
             }
         },
         handleResetList() {
-            console.log(this.configForm, '重置操作');
             this.configForm = {
                 acountId: '',
-                num : '',
+                num: '',
+                adConvertId: '',
                 launchDateRange: []
             };
-            this.handleInitTable();
+            const page = {
+                page: 1,
+                size: 10
+            };
+            this.currencyPag = page;
+            this.appointPag = page;
+            if (this.controlTypeModel === '1') {
+                this.handleGetCurrencyList();
+            }
+            else if (this.controlTypeModel === '2') {
+                this.handleGetAppointList();
+            }
         },
         handleCurrentPage(current, pageSize) {
             this.currencyPag = {