瀏覽代碼

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

朱鑫波 4 年之前
父節點
當前提交
449c57f14a

+ 11 - 1
src/api/manage.js

@@ -20,7 +20,17 @@ export function postNoCacheAction(url, parameter) {
     }
   })
 }
-
+// post---文件
+export function postFileAction(url,parameter) {
+  return axios({
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    },
+    url: url,
+    method:'post' ,
+    data: parameter
+  })
+}
 //post
 export function postAction(url,parameter) {
   return axios({

+ 10 - 0
src/views/modules/account-config/account-config.vue

@@ -29,6 +29,7 @@
                 ref="table"
                 size="middle"
                 bordered
+                :loading="controlLoading"
                 :columns="columns"
                 :dataSource="dataSource"
                 :pagination="false"
@@ -263,6 +264,7 @@ export default {
             }
         };
         return {
+            controlLoading: true,
             adBudgetShowTitle: false,
             budgetVisible: false,
             budgetForm: {
@@ -404,6 +406,7 @@ export default {
             }
             this.$refs.ruleForm.validate(valid => {
                 if (valid) {
+                    this.controlLoading = true;
                     this.handlePopoverChange(paramsData);
                 }
                 else {
@@ -447,6 +450,7 @@ export default {
             }
             this.$refs.budgetForm.validate(valid => {
                 if (valid) {
+                    this.controlLoading = true;
                     this.handlePopoverChange(paramsData);
                 }
                 else {
@@ -481,6 +485,7 @@ export default {
         },
         handleResetList() {
             this.acountId = '';
+            this.controlLoading = true;
             this.handleInitTable();
         },
         handleInitTable() {
@@ -499,6 +504,7 @@ export default {
                             item.accountBudget = '不限';
                         }
                     });
+                    this.controlLoading = false;
                     this.dataSource = result.result.records;
                     this.totalAll = result.result.total;
                 }
@@ -515,6 +521,7 @@ export default {
                 title: '删除提示',
                 content: '是否删除该条数据',
                 onOk() {
+                    that.controlLoading = true;
                     deleteAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/delete', {id: data.id}).then(result => {
                         if (result.code === 0) {
                             that.handleInitTable();
@@ -537,6 +544,7 @@ export default {
         },
         handleQueryList(event) {
             event.preventDefault();
+            this.controlLoading = true;
             this.handleInitTable();
         },
         onShowSizeChange(current, pageSize) {
@@ -544,9 +552,11 @@ export default {
                 page: current,
                 size: pageSize
             };
+            this.controlLoading = true;
             this.handleInitTable();
         },
         handleSwitchChang(checked, data) {
+            this.controlLoading = true;
             const paramsData = {
                 id: data.id,
                 state: checked ? 0 : 1,

+ 1 - 1
src/views/modules/account-config/components/configuration-modal.vue

@@ -1921,7 +1921,7 @@ export default {
                         const defaultList = result.result;
                         this.promotionTypeList.forEach(item => {
                             defaultList.forEach(val => {
-                                if (item.landing_type === val.value) {
+                                if (val.landing_type === item.value) {
                                     val.changeName = item.label;
                                 }
                             });

+ 10 - 0
src/views/modules/copy-library/copy-library-server.js

@@ -0,0 +1,10 @@
+/**
+ * @file 账户配置API
+ * @author jiayufei
+ */
+
+export const urlAcount = 'http://118.24.244.213:8080'; // 线上
+// export const urlAcount = 'http://apipre.tjyourong.com.cn'; // 预生产
+// export const urlAcount = 'http://192.168.1.43:8080'; // 子安
+// export const urlAcount = 'http://139.186.165.84:8080'; // 测试
+// export const urlAcount = 'http://192.168.1.8:8080'; // 学超

+ 163 - 0
src/views/modules/copy-library/copy-library.less

@@ -0,0 +1,163 @@
+.copy-library-content {
+    background: #fff;
+    height: calc(100vh - 137px);
+    padding: 20px;
+    overflow-y: auto;
+    .control-con-header {
+        margin-bottom: 20px;
+        position: relative;
+        .grid-form-options {
+            margin-top: 15px;
+        }
+        .common-input-long,
+        .acount-search-class {
+            width: 625px;
+        }
+        .common-input-long {
+            margin-left: 10px;
+        }
+        .reset-class {
+            margin-right: 10px !important;
+        }
+        .upload-person {
+            position: absolute;
+            right: 10px;
+            top: 0;
+        }
+    }
+    .pagin-table-class {
+        display: flex;
+        justify-content: flex-end;
+        margin-top: 20px;
+    }
+}
+.handle-p {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+/deep/ .copywrit-modal {
+    width: 700px !important;
+    .ant-modal-body {
+        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;
+        margin-top: 12px;
+        line-height: 32px;
+        .acount-title-left {
+            margin-right: 20px;
+            width: 100px;
+        }
+        .only-title-mater {
+            width: 400px;
+            .select-project {
+                width: 100%;
+            }
+            .mater-list-name {
+                display: flex;
+                height: 30px;
+                margin: 0;
+                .mater-list-show {
+                    display: inline-block;
+                    width: 400px;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                }
+                .mater-list-icon {
+                    margin-left: 10px;
+                    color: #1890ff;
+                    cursor: pointer;
+                }
+            }
+        }
+        .examin-form-model {
+            width: 500px;
+            position: relative;
+            .examin-form-num {
+                position: absolute;
+                top: -10px;
+                right: -50px;
+            }
+            .examin-form-icon {
+                position: absolute;
+                top: 0px;
+                right: -85px;
+                font-size: 18px;
+                color: #1890ff;
+                cursor: pointer;
+            }
+        }
+        .examin-form-input {
+            width: 380px;
+        }
+    }
+    .push-plate {
+        margin-bottom: 20px;
+        .examin-select-title {
+            margin: 0 20px 0 20px;
+        }
+    }
+}
+/deep/ .select-matermal-modal {
+    width: 1000px !important;
+    .common-input-long {
+        width: 280px;
+    }
+    .pagin-table-class {
+        display: flex;
+        justify-content: flex-end;
+        margin-top: 20px;
+    }
+    .mater-viedo-content {
+        .viedo-header-class {
+            display: flex;
+            justify-content: space-between;
+            border-bottom: 1px solid #eee;
+            .refush-btn-mat {
+                margin-left: 20px;
+            }
+        }
+        .viedo-serach-class {
+            margin-top: 20px;
+        }
+        .viedo-content-class {
+            .viedo-content-group {
+                display: flex;
+                flex-wrap: wrap;
+            }
+            .content-modal-li {
+                border: 1px solid #e4e4e4;
+                width: 180px;
+                height: 360px;
+                text-align: center;
+                position: relative;
+                margin: 0 10px 10px 0;
+                .checkbox-select-show,
+                .checkbox-select-time {
+                    margin-top: 14px;
+                }
+                img {
+                    width: 90%;
+                    margin-top: 20px;
+                }
+                .viedo-content-checkbox {
+                    position: absolute;
+                    z-index: 100;
+                    left: 0;
+                    top: 0;
+                }
+            }
+        }
+    }
+}

文件差異過大導致無法顯示
+ 1195 - 0
src/views/modules/copy-library/copy-library.vue


+ 12 - 1
src/views/modules/creative-copywrit/creative-copywrit.less

@@ -85,7 +85,7 @@
     }
     .solgan-form-class {
         .examin-form-input {
-            width: 380px;
+            width: 320px;
         }
         /deep/ .ant-form-item-children {
             display: inline-flex;
@@ -99,6 +99,17 @@
             text-overflow: ellipsis;
         }
         .solgan-form-model {
+            /deep/ .ant-form-item-children {
+                display: contents !important;
+            }
+            .solgan-tags-change {
+                width: 430px;
+                display: flex;
+                justify-content: space-between;
+            }
+            .solgan-icon-type {
+                width: 100px;
+            }
             .examin-form-num {
                 margin-left: 10px;
                 margin-right: 5px;

+ 341 - 106
src/views/modules/creative-copywrit/creative-copywrit.vue

@@ -145,7 +145,7 @@
     }
 
     .video-content {
-        width: 50%;
+        width: 45%;
         padding: 10px;
         box-sizing: border-box;
         display: flex;
@@ -316,6 +316,9 @@
                         <selectTable :projectId.sync="queryParam.productId" ref="selectTable"></selectTable>
                     </a-col>
                     <a-col :md="8" :sm="8">
+                        <selectTableProject :projectId.sync="queryParam.projectId" :productId="queryParam.productId" ref="selectTableProject"></selectTableProject>
+                    </a-col>
+                    <a-col :md="8" :sm="8">
                         <a-form-item label="素材名称">
                             <a-input placeholder="请输入素材名称" v-model="queryParam.materialName"></a-input>
                         </a-form-item>
@@ -345,6 +348,60 @@
                         </a-form-item>
                     </a-col>
                     <a-col :md="8" :sm="8">
+                        <a-form-item label="剪辑">
+                            <a-select
+                                v-model="queryParam.clipId"
+                                :filter-option="filterOption"
+                                allowClear
+                                show-search
+                            >
+                                <a-select-option
+                                    v-for="item in designList"
+                                    :key="item.userId"
+                                    :value="item.userId"
+                                >
+                                    {{ item.companyName + '_' + item.userName }}
+                                </a-select-option>
+                            </a-select>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="8" :sm="8">
+                        <a-form-item label="拍摄">
+                            <a-select
+                                v-model="queryParam.shotId"
+                                :filter-option="filterOption"
+                                allowClear
+                                show-search
+                            >
+                                <a-select-option
+                                    v-for="item in designList"
+                                    :key="item.userId"
+                                    :value="item.userId"
+                                >
+                                    {{ item.companyName + '_' + item.userName }}
+                                </a-select-option>
+                            </a-select>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="8" :sm="8">
+                        <a-form-item label="编导">
+                            <a-select
+                                v-model="queryParam.planId"
+                                :filter-option="filterOption"
+                                allowClear
+                                show-search
+                            >
+                                <a-select-option
+                                    v-for="item in designList"
+                                    :key="item.userId"
+                                    :value="item.userId"
+                                >
+                                    {{ item.companyName + '_' + item.userName }}
+                                </a-select-option>
+                            </a-select>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :md="8" :sm="8">
                         <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                             <a-button type="primary" @click="handleSubmit" icon="search">查询</a-button>
                             <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
@@ -620,7 +677,7 @@
                                 </a-dropdown>
                                 <a-checkbox :value="items.id" style="float: right" v-show="active == '0' || active == '1'"></a-checkbox>
                                 <br />
-                                {{ items.createTime | getDate }}
+                                {{ items.createTime }}
                             </span>
                             </div>
                         </div>
@@ -968,7 +1025,7 @@
                 </a-form-item>
             </a-form>
         </a-modal>
-        <a-modal title="素材详情" v-model="visibleDetail" width="70%" :footer="null">
+        <a-modal title="素材详情" v-model="visibleDetail" @cancel="handleBudgetCancel" width="70%" :footer="null">
             <div style="width: 100%; height: 35px">
                 <a-button type="primary" @click="setSuccess" style="float: right">
                     {{ excellent == 0 ? '标记为优秀素材' : '取消标记' }}
@@ -1212,7 +1269,7 @@
                         </div>
                     </a-form>
                     <div class="solgan-whole-content">
-                        <span class="solgan-title-header">广告语:</span>
+                        <span class="solgan-title-header" style="display: inline-block;width: 60px;">广告语:</span>
                         <a-form v-if="slogansDetail.length" :form="solganForm" class="solgan-form-class">
                             <a-form-item
                                 v-for="item in slogansDetail"
@@ -1222,33 +1279,53 @@
                                 :wrapper-col="wrapperCol"
                                 label=""
                             >
-                                <template v-if="item.name === defaultSolganTitle">
-                                    <a-input
-                                        v-decorator="[
-                                            item.name,
-                                            {
-                                                rules: [
-                                                    {
-                                                        required: true, message: '请输入'
-                                                    },
-                                                    {
-                                                        validator: compareToFirstPassword
-                                                    }
-                                                ],
-                                                initialValue: item.slogan
-                                            }
-                                        ]"
-                                        class="examin-form-input"
-                                        placeholder="请输入"
-                                    />
-                                    <span class="examin-form-num">{{ handleFilterSlogan(item.name) }}/30</span>
-                                    <a-icon class="examin-form-icon" type="check" @click="handleSolganCheck(item)"/>
-                                </template>
-                                <template v-else>
-                                    <span class="default-value-class">{{ item.slogan }}</span>
-                                    <a-icon class="examin-form-icon" type="edit" @click="handleSolganEdit(item)"/>
-                                </template>
-                                <a-icon class="examin-form-icon icon-delete" type="delete" @click="handleDelSolgan(item)"/>
+                                <div style="width: 430px;">
+                                    <template v-if="item.name === defaultSolganTitle">
+                                        <a-input
+                                            v-decorator="[
+                                                item.name,
+                                                {
+                                                    rules: [{validator: validatePass, trigger: 'blur'}],
+                                                    initialValue: item.value
+                                                }
+                                            ]"
+                                            class="examin-form-input"
+                                            placeholder="请输入"
+                                            @change="handleSloganSearchChange($event, item.name, item.id)"
+                                        />
+                                        <span class="examin-form-num">{{ item.lenSize }}/30</span>
+                                        <a-icon class="examin-form-icon" type="check" @click="handleSolganCheck(item)"/>
+                                    </template>
+                                    <template v-else>
+                                        <span class="default-value-class">{{ item.slogan }}</span>
+                                        <a-icon class="examin-form-icon" type="edit" @click="handleSolganEdit(item)"/>
+                                    </template>
+                                    <a-icon class="examin-form-icon icon-delete" type="delete" @click="handleDelSolgan(item)"/>
+                                </div>
+                                <div v-if="item.name === defaultSolganTitle" class="ad-name-tags-class solgan-tags-change">
+                                    <div v-if="item.tabStatus === 'alone'" class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in item.updateTagsList"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleSloganAddTags(val.name, item.name, item.id)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div v-if="item.tabStatus === 'all'" class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in item.defaultTagsList"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleSloganAddTags(val.name, item.name, item.id)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div v-if="item.tabStatus === 'alone'" class="solgan-icon-type"><a @click="handleExaminMoreList(item.id, 'more')">更多</a></div>
+                                    <div v-if="item.tabStatus === 'all'" class="solgan-icon-type"><a @click="handleExaminMoreList(item.id, 'little')">收起</a></div>
+                                </div>
                             </a-form-item>
                         </a-form>
                         <span v-else class="solgan-title-header">暂无</span>
@@ -1648,6 +1725,7 @@ import uploadFile from '@/components/uploadFile.vue';
 import {closeAllVideoFun, stopOtherVideo} from '@/utils/videoControl';
 import accountCheck from '@/views/modules/material/accountCheck';
 import accountCheckBytedance from '@/views/modules/material/accountCheckBytedance';
+import selectTableProject from '@/views/modules/Statistics/components/selectPagination.vue';
 import {urlAcount} from '../account-config/account-config-server.js';
 
 import qs from 'qs';
@@ -1664,10 +1742,12 @@ export default {
         selectTable,
         uploadFile,
         PermissionModal,
-        accountCheckBytedance
+        accountCheckBytedance,
+        selectTableProject
     },
     data() {
         return {
+            designList: [],
             adNameTags: [],
             materTitltStatus: false,
             accountMaster: {
@@ -1947,6 +2027,7 @@ export default {
         });
         this.getHangye();
         this.handleGetCreativeWord();
+        this.handleGetDesignList();
     },
     watch: {
         $route(n, o) {
@@ -1957,9 +2038,12 @@ export default {
                 this.loadData();
             }
         },
-        'queryParam.productId'(n, o) {
-            if (n !== '') {
+        'queryParam.productId': function (n, o) {
+            if (n != '') {
                 this.getList(n);
+                this.checkArr = [];
+                this.$refs.selectTableProject.keyValue = '';
+                this.$refs.selectTableProject.getData(n);
             }
         },
         visibleDetail(n, o) {
@@ -1999,10 +2083,45 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleBudgetCancel() {
+            this.defaultSolganTitle = 'test';
+            this.defaultSolganStatus = 'input';
+            this.visibleDetail = false;
+        },
+        // 获取设计人员
+        handleGetDesignList() {
+            postAction('/ctop/kuaishou/videoReport/getDesignList').then(result => {
+                if (result.success) {
+                    this.designList = result.result;
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
         handleSubmit() {
+            if (!this.queryParam.productId) {
+                this.$refs.selectTableProject.keyValue = '';
+                this.$refs.selectTableProject.getData();
+            }
             this.searchQuery();
             this.checkArr = [];
         },
+        handleExaminMoreList(val, type) {
+            if (type === 'more') {
+                this.slogansDetail.forEach(item => {
+                    if (item.id === val) {
+                        item.tabStatus = 'all';
+                    }
+                });
+            }
+            else if (type === 'little') {
+                this.slogansDetail.forEach(item => {
+                    if (item.id === val) {
+                        item.tabStatus = 'alone';
+                    }
+                });
+            }
+        },
         handleMoreTagsShow(val, type) {
             if (type === 'more') {
                 this.defaultFormList.forEach(item => {
@@ -2034,28 +2153,26 @@ export default {
         validatePass(rule, value, callback) {
             this.$nextTick(() => {
                 let finallyLenList = this.handleJudgeExec(value);
-                console.log(finallyLenList, 'finallyLenList---finallyLenList--finallyLenList');
                 let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
-                console.log(updateFinallyResult, '000000000000');
                 let resultSelectSize = 0;
-                if (finallyLenList.length) {
-                    const inputDefaultLen = value.length;
-                    let tagsLen = finallyLenList.length * 4;
+                if (updateFinallyResult.length) {
+                    const inputDefaultLen = this.handleExportRules(value);
+                    let tagsLen = updateFinallyResult.length * 2;
                     let tagsSureLen = 0;
                     this.adNameTags.forEach(item => {
-                        finallyLenList.forEach(val => {
+                        updateFinallyResult.forEach(val => {
                             if (item.name === val) {
                                 tagsSureLen += item.maxWordLen;
                             }
                         });
                     });
-                    finallyLenList.forEach(item => {
+                    updateFinallyResult.forEach(item => {
                         tagsLen += item.length;
                     });
-                    resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                    resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + updateFinallyResult.length;
                 }
                 else {
-                    resultSelectSize = value.length;
+                    resultSelectSize = this.handleExportRules(value);
                 }
                 if (resultSelectSize === 0) {
                     callback(new Error('请输入'));
@@ -2072,7 +2189,7 @@ export default {
             });
         },
         handleJudgeExec(item) {
-            let re = /\{\{(.+?)\}\}/g;
+            let re = /\{(.+?)\}/g;
             let array = [];
             let temp;
             while ((temp = re.exec(item))) {
@@ -2080,6 +2197,59 @@ export default {
             };
             return array;
         },
+        handleSloganAddTags(item, field, formId) {
+            let node = document.getElementById(field);
+            let startPos = node.selectionStart; // input 第0个字符到选中的字符
+            let endPos = node.selectionEnd; // 选中的字符到最后的字符
+            let txt = node.value;
+            this.$nextTick(() => {
+                let finallyLenList = this.handleJudgeExec(txt);
+                let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
+                if (updateFinallyResult.length >= 2) {
+                    this.$message.error('最多选择两个词包');
+                    return;
+                }
+                if (startPos === 0 || endPos === 0) {
+                    txt += '{' + item + '}';
+                    this.solganForm.setFieldsValue({[field]: txt});
+                }
+                else {
+                    this.solganForm.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();
+            });
+            this.$nextTick(() => {
+                const dynamicWordPackIds = [];
+                let changeData = this.handleJudgeExec(this.solganForm.getFieldsValue()[field]);
+                let updateChangeData = this.adNameTags.filter(item => changeData.includes(item.name)).map(val => val.name);
+                const inputDefaultLen = this.handleExportRules(this.solganForm.getFieldsValue()[field]);
+                let tagsLen = updateChangeData.length * 2;
+                let tagsSureLen = 0;
+                let resultSelectSize = 0;
+                this.adNameTags.forEach(item => {
+                    updateChangeData.forEach(val => {
+                        if (item.name === val) {
+                            tagsSureLen += item.maxWordLen;
+                            dynamicWordPackIds.push(item.creativeWordId);
+                        }
+                    });
+                });
+                updateChangeData.forEach(item => {
+                    tagsLen += item.length;
+                });
+                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + updateChangeData.length;
+                this.slogansDetail.forEach(item => {
+                    if (item.id === formId) {
+                        item.lenSize = resultSelectSize;
+                        item.value = this.solganForm.getFieldsValue()[field];
+                        item.wordPackId = dynamicWordPackIds;
+                    }
+                });
+            });
+        },
         // 点击获取光标位置进行字段插入
         handleGetChangeAll(item, field, formId) {
             let node = document.getElementById(field);
@@ -2094,11 +2264,11 @@ export default {
                     return;
                 }
                 if (startPos === 0 || endPos === 0) {
-                    txt += '{{' + item + '}}';
+                    txt += '{' + item + '}';
                     this.examinForm.setFieldsValue({[field]: txt});
                 }
                 else {
-                    this.examinForm.setFieldsValue({[field]: txt.substring(0, startPos) + '{{' + item + '}}' + txt.substring(endPos)});
+                    this.examinForm.setFieldsValue({[field]: txt.substring(0, startPos) + '{' + item + '}' + txt.substring(endPos)});
                     node.selectionStart = startPos + item.length + 6;
                     node.selectionEnd = startPos + item.length + 6;
                 }
@@ -2109,8 +2279,8 @@ export default {
                 const dynamicWordPackIds = [];
                 let changeData = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
                 let updateChangeData = this.adNameTags.filter(item => changeData.includes(item.name)).map(val => val.name);
-                const inputDefaultLen = this.examinForm.getFieldsValue()[field].length;
-                let tagsLen = updateChangeData.length * 4;
+                const inputDefaultLen = this.handleExportRules(this.examinForm.getFieldsValue()[field]);
+                let tagsLen = updateChangeData.length * 2;
                 let tagsSureLen = 0;
                 let resultSelectSize = 0;
                 this.adNameTags.forEach(item => {
@@ -2124,7 +2294,7 @@ export default {
                 updateChangeData.forEach(item => {
                     tagsLen += item.length;
                 });
-                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + updateChangeData.length;
                 this.defaultFormList.forEach(item => {
                     if (item.id === formId) {
                         item.lenSize = resultSelectSize;
@@ -2247,6 +2417,20 @@ export default {
                 callback();
             }
         },
+        handleExportRules(value) {
+            let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
+            let length = 0;
+            let strArr = value.split('');
+            strArr.forEach(item => {
+                if (cnReg.test(item)) {
+                    length += 1;
+                }
+                else {
+                    length += 0.5;
+                }
+            });
+            return Math.ceil(length);
+        },
         handleGetQueryById() {
             getAction('/ctop/materialInfo/queryById', {
                 id: this.id
@@ -2256,14 +2440,35 @@ export default {
                     this.name = res.result.watermarkCode;
                     this.materialName = res.result.materialName;
                     res.result.slogans.forEach(item => {
+                        let finallyLenList = this.handleJudgeExec(item.slogan);
+                        let resultSelectSize = 0;
+                        if (finallyLenList.length) {
+                            const inputDefaultLen = this.handleExportRules(item.slogan);
+                            let tagsLen = finallyLenList.length * 2;
+                            let tagsSureLen = 0;
+                            this.adNameTags.forEach(item => {
+                                finallyLenList.forEach(val => {
+                                    if (item.name === val) {
+                                        tagsSureLen += item.maxWordLen;
+                                    }
+                                });
+                            });
+                            finallyLenList.forEach(item => {
+                                tagsLen += item.length;
+                            });
+                            resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + finallyLenList.length;
+                        }
+                        else {
+                            resultSelectSize = this.handleExportRules(item.slogan);
+                        }
                         item.name = 'username' + item.id;
+                        item.value = item.slogan;
+                        item.lenSize = resultSelectSize;
+                        item.tabStatus = 'alone';
+                        item.defaultTagsList = this.adNameTags;
+                        item.updateTagsList = this.adNameTags.slice(0, 4);
                     });
                     this.slogansDetail = res.result.slogans;
-                    this.$nextTick(() => {
-                        this.slogansDetail.forEach(item => {
-                            this.solganForm.setFieldsValue({[item.name]: item.slogan});
-                        });
-                    });
                 }
                 else {
                     this.showUrlWater = null;
@@ -2276,6 +2481,9 @@ export default {
                 this.$message.error('删除失败,广告语不能少于三条');
                 return;
             }
+            if (this.defaultSolganStatus === 'edit') {
+                this.defaultSolganStatus = 'input';
+            }
             let formdata = new FormData();
             formdata.append('id', data.id);
             postAction('/ctop/bytedanceVideoSlogenInfo/delete', formdata).then(res => {
@@ -2286,14 +2494,19 @@ export default {
             });
         },
         handleSolganCheck(data) {
+            let changeSlogan = this.slogansDetail;
+            changeSlogan.forEach(item => {
+                item.title = item.value;
+                item.creative_word_ids = item.wordPackId;
+            });
             this.solganForm.validateFields(err => {
                 if (!err) {
-                    const paramsData = this.solganForm.getFieldsValue();
                     this.defaultSolganStatus = 'input';
                     this.defaultSolganTitle = 'test';
                     postAction('/ctop/bytedanceVideoSlogenInfo/edit', {
                         id: data.id,
-                        slogan: paramsData[data.name]
+                        slogan: changeSlogan.filter(item => item.id === data.id)[0].title,
+                        creativeWordIds: JSON.stringify(changeSlogan.filter(item => item.id === data.id)[0].creative_word_ids)
                     }).then(res => {
                         if (res.success) {
                             this.$message.success('修改成功');
@@ -2314,6 +2527,36 @@ export default {
                 this.solganForm.setFieldsValue({[data.name]: data.slogan});
             });
         },
+        handleSloganSearchChange(e, field, formId) {
+            this.$nextTick(() => {
+                const dynamicWordPackIds = [];
+                let finallyLenList = this.handleJudgeExec(e.target.value);
+                let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
+                const inputDefaultLen = this.handleExportRules(e.target.value);
+                let tagsLen = updateFinallyResult.length * 2;
+                let tagsSureLen = 0;
+                let resultSelectSize = 0;
+                this.adNameTags.forEach(item => {
+                    updateFinallyResult.forEach(val => {
+                        if (item.name === val) {
+                            tagsSureLen += item.maxWordLen;
+                            dynamicWordPackIds.push(item.creativeWordId);
+                        }
+                    });
+                });
+                updateFinallyResult.forEach(item => {
+                    tagsLen += item.length;
+                });
+                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + updateFinallyResult.length;
+                this.slogansDetail.forEach(item => {
+                    if (item.id === formId) {
+                        item.lenSize = resultSelectSize;
+                        item.wordPackId = dynamicWordPackIds;
+                        item.value = e.target.value;
+                    }
+                });
+            });
+        },
         handleFormInputChang(e, field, formId) {
             const changeFiled = [];
             this.defaultFormList.forEach(item => {
@@ -2330,8 +2573,8 @@ export default {
                 const dynamicWordPackIds = [];
                 let finallyLenList = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
                 let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
-                const inputDefaultLen = this.defaultFormList.filter(item => item.id === formId)[0].value.length;
-                let tagsLen = updateFinallyResult.length * 4;
+                const inputDefaultLen = this.handleExportRules(this.defaultFormList.filter(item => item.id === formId)[0].value);
+                let tagsLen = updateFinallyResult.length * 2;
                 let tagsSureLen = 0;
                 let resultSelectSize = 0;
                 this.adNameTags.forEach(item => {
@@ -2345,7 +2588,7 @@ export default {
                 updateFinallyResult.forEach(item => {
                     tagsLen += item.length;
                 });
-                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + updateFinallyResult.length;
                 this.defaultFormList.forEach(item => {
                     if (item.id === formId) {
                         item.lenSize = resultSelectSize;
@@ -2459,8 +2702,8 @@ export default {
                             let finallyLenList = this.handleJudgeExec(item.slogan);
                             let resultSelectSize = 0;
                             if (finallyLenList.length) {
-                                const inputDefaultLen = item.slogan.length;
-                                let tagsLen = finallyLenList.length * 4;
+                                const inputDefaultLen = this.handleExportRules(item.slogan);
+                                let tagsLen = finallyLenList.length * 2;
                                 let tagsSureLen = 0;
                                 this.adNameTags.forEach(item => {
                                     finallyLenList.forEach(val => {
@@ -2472,7 +2715,7 @@ export default {
                                 finallyLenList.forEach(item => {
                                     tagsLen += item.length;
                                 });
-                                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + finallyLenList.length;
                             }
                             else {
                                 resultSelectSize = item.slogan.length;
@@ -2485,11 +2728,6 @@ export default {
                             item.updateTagsList = this.adNameTags.slice(0, 4);
                         });
                         this.defaultFormList = res.result.slogans;
-                        // this.$nextTick(() => {
-                        //     this.defaultFormList.forEach(item => {
-                        //         this.defaultFormList.setFieldsValue({[item.name]: item.slogan});
-                        //     });
-                        // });
                     }
                     else {
                         for (let i = 0; i < 3; i++) {
@@ -2768,28 +3006,12 @@ export default {
         },
         moment,
         tongbu(value) {
-            // getAction('/ctop/project/queryById', {id: this.queryParam.projectId}).then(res => {
-            //     if (res.success) {
-            //         if (res.result.mediaId === '1' || res.result.mediaId === '3') {
-            //             this.$refs.check.getData('/ctop/userAllocation/getAccountListByProjectId', {
-            //                 userId: this.userInfo().id,
-            //                 projectId: this.queryParam.projectId
-            //             });
-            //         }
-            //         else if (res.result.mediaId === '2' || res.result.mediaId === '4') {
-            //             this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.projectId);
-            //         }
-            //     }
-            //     else {
-            //         this.$message.error('网络波动,请稍后再试');
-            //     }
-            // });
-            this.mediaId = value
+            this.mediaId = value;
             this.$refs.check.getData('/ctop/userAllocation/getAccountListByUserIdAndProductId', {
                 userId: this.userInfo().id,
                 productId: this.queryParam.productId,
-                mediaId: value,
-            })
+                mediaId: value
+            });
         },
         implement(data) {
             let params = {};
@@ -2874,24 +3096,16 @@ export default {
                 userId: this.userInfo().id,
                 status: this.active,
                 productId: ''
-            }
-            this.$refs.selectTable.keyValue = "";
-            this.$refs.selectTable.getData()
+            };
+            this.$refs.selectTable.keyValue = '';
+            this.$refs.selectTable.getData();
+            this.$refs.selectTableProject.keyValue = '';
+            this.$refs.selectTableProject.getData();
             this.labelValue = [];
             this.loadData(1);
             this.checkArr = [];
         },
         getList(value) {
-            // if (value) {
-            //     getAction('/ctop/projectMember/participateListV2', {
-            //         userId: this.userInfo().id,
-            //         projectId: value
-            //     }).then(res => {
-            //         if (res.code === 0) {
-            //             this.mediaId = res.result.records[0].mediaId;
-            //         };
-            //     });
-            // }
             this.loadData();
         },
         onChangeCheckImage(checkedList) {
@@ -2984,14 +3198,35 @@ export default {
                     this.name = res.result.watermarkCode;
                     this.materialName = res.result.materialName;
                     res.result.slogans.forEach(item => {
+                        let finallyLenList = this.handleJudgeExec(item.slogan);
+                        let resultSelectSize = 0;
+                        if (finallyLenList.length) {
+                            const inputDefaultLen = this.handleExportRules(item.slogan);
+                            let tagsLen = finallyLenList.length * 2;
+                            let tagsSureLen = 0;
+                            this.adNameTags.forEach(item => {
+                                finallyLenList.forEach(val => {
+                                    if (item.name === val) {
+                                        tagsSureLen += item.maxWordLen;
+                                    }
+                                });
+                            });
+                            finallyLenList.forEach(item => {
+                                tagsLen += item.length;
+                            });
+                            resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + finallyLenList.length;
+                        }
+                        else {
+                            resultSelectSize = this.handleExportRules(item.slogan);
+                        }
                         item.name = 'username' + item.id;
+                        item.value = item.slogan;
+                        item.lenSize = resultSelectSize;
+                        item.tabStatus = 'alone';
+                        item.defaultTagsList = this.adNameTags;
+                        item.updateTagsList = this.adNameTags.slice(0, 4);
                     });
                     this.slogansDetail = res.result.slogans;
-                    this.$nextTick(() => {
-                        this.slogansDetail.forEach(item => {
-                            this.solganForm.setFieldsValue({[item.name]: item.slogan});
-                        });
-                    });
                 }
                 else {
                     this.showUrlWater = null;
@@ -3201,7 +3436,7 @@ export default {
                         md5: [],
                         name: [],
                         size: []
-                    }
+                    };
                     this.imageArrList = [];
                     this.addImageVisible = false;
                     this.loadingImage = false;
@@ -3574,7 +3809,7 @@ export default {
             });
         },
         getDataSource(page, pageSize) {
-            this.ipagination.current = page
+            this.ipagination.current = page;
             this.checkArr = [];
             this.checkAll = false;
             this.loadData();

+ 2 - 2
src/views/modules/headline-view/headline-view-server.js

@@ -3,8 +3,8 @@
  * @author jiayufei
  */
 
-// export const urlAcount = 'http://118.24.244.213:8080'; // 线上
+export const urlAcount = 'http://118.24.244.213:8080'; // 线上
 // export const urlAcount = 'http://apipre.tjyourong.com.cn'; // 预生产
-export const urlAcount = 'http://192.168.1.43:8080'; // 子安
+// export const urlAcount = 'http://192.168.1.43:8080'; // 子安
 // export const urlAcount = 'http://139.186.165.84:8080'; // 测试
 // export const urlAcount = 'http://192.168.1.8:8080'; // 学超

+ 149 - 53
src/views/modules/headline-view/headline-view.vue

@@ -2,7 +2,7 @@
     <div class="accountPage">
         <div class="bodyBox accountBody">
             <div class="accountBodyLeft">
-                <div class="accountBodyLeftCost">
+                <div class="accountBodyLeftCost" @click.capture="handleAccountBodyCost">
                     <div class="accountBodyLeftCostLeft">
                         <div class="top">
                             <div class="title">花费</div>
@@ -63,26 +63,27 @@
                     </div>
                 </div>
                 <div class="accountBodyLeftOther">
-                    <div class="top">                       
+                    <div class="top">
                         <div class="item" v-for="item in throwColumns" :key="item.dataIndex">
                             <div class="todyCost">
-                                <span v-if="item.type === 'spend'">{{ Number(item.today) | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'double'">{{ Number(item.today) | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'string'">{{ Number(item.today) | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'int'">{{ item.today !== 0 ? item.today + '%' : 0 }}</span>
-                                <span class="sign">
+                                <span v-if="item.type === 'double'">{{ Number(item.today) | decimalsHandle }}</span>
+                                <span v-if="item.type === 'string'">{{ Number(item.today).toFixed(0) | decimalsHandle }}</span>
+                                <span v-if="item.type === 'int'">{{ item.today !== 0 ? item.today + '%' : 0 }}</span>
+                                <span v-if="item.type === 'average'">{{ Number(item.today) | decimalsHandle }}</span>
+                                <span v-if="item.type !== 'spend'" class="sign">
                                     <a-icon type="rise" class="rise" v-show="item.today - item.yesterday > 0"/>
                                     <a-icon type="fall" class="fall" v-show="item.today - item.yesterday < 0" />
                                 </span>
                             </div>
                             <div class="yesterdayCost">
-                                <span>/ 昨日: </span>
-                                <span v-if="item.type === 'spend'">{{ Number(item.yesterday) | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'double'">{{ Number(item.yesterday) | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'string'">{{ Number(item.yesterday) | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'int'">{{ item.yesterday !== 0 ? item.yesterday + '%' : 0 }}</span>
+                                <span v-if="item.type !== 'spend'">/ 昨日: </span>
+                                <span v-if="item.type === 'double'">{{ Number(item.yesterday) | decimalsHandle }}</span>
+                                <span v-if="item.type === 'string'">{{ Number(item.yesterday).toFixed(0) | decimalsHandle }}</span>
+                                <span v-if="item.type === 'int'">{{ item.yesterday !== 0 ? item.yesterday + '%' : 0 }}</span>
+                                <span v-if="item.type === 'average'">{{ Number(item.yesterday) | decimalsHandle }}</span>
                             </div>
                             <span
+                                v-if="item.type !== 'spend'"
                                 class="IndexName"
                                 :class="{'IndexNameActive': isActive === item.dataIndex}"
                                 @click="handleGetActiveIndexName(item)"
@@ -106,7 +107,7 @@
                             <div
                                 class="accountIndexEchart"
                                 id="accountIndexEchart"
-                                style='width:100%;height:150px;margin:0 auto;'
+                                style="width:100%;height:150px;margin:0 auto;"
                                 ref="accountIndexEchart"
                             >
                                 <a-empty/>
@@ -163,6 +164,10 @@
                         :pagination="false"
                         :scroll="{x: 1500}"
                     >
+                    <span slot="conver" slot-scope="text, record">
+                        <span v-if="Number(record.cpaBid) < Number(text)" style="color: #f00;">{{ text }}</span>
+                        <span v-else>{{ text }}</span>
+                    </span>
                     <span slot="optStatus" slot-scope="text, record">
                         <a-switch :checked="text === 'AD_STATUS_ENABLE'" @change="handleSwitchChang($event, record)"/>
                     </span>
@@ -260,7 +265,7 @@
                     </a-col>
                     <a-col :span="16">
                         <a-select
-                            style="width: 240px;"
+                            style="width: 320px;"
                             v-model="adAudiencePackageId"
                             allow-clear
                             placeholder="请选择已有定向包名称"
@@ -270,7 +275,10 @@
                                 :key="index"
                                 :value="item.audience_package_id"
                             >
-                                {{ item.name }}
+                                <div class="orient-list">
+                                    <span class="orient-option-left" style="display: inline-block;width: 150px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.name }}</span>
+                                    <span class="orient-option-right" style="display: inline-block;width: 150px;text-align:right;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.changeName }}</span>
+                                </div>
                             </a-select-option>
                         </a-select>
                     </a-col>
@@ -314,7 +322,12 @@
                     :wrapper-col="wrapperCol"
                 >
                     <a-form-model-item label="出价" prop="budget">
-                        <a-input-number v-model="budgetForm.budget"/> 元
+                        <a-input-number
+                            v-model="budgetForm.budget"
+                            :min="0.1"
+                            :max="10000"
+                            @change="handleChangeBudgetForm"
+                        /> 元
                     </a-form-model-item>
                 </a-form-model>
             </div>
@@ -341,14 +354,23 @@ require('echarts/lib/component/title');
 require('echarts/lib/component/graphic');
 require('echarts/lib/component/toolbox');
 require('echarts/lib/component/legend');
+
 export default {
     name: 'headline-view',
     components: {
         TreeSelect
     },
     data() {
+        let adCpaBidValidator = (rule, value, callback) => {
+            if (Number(this.currentUnit.adBudget) < Number(value)) {
+                callback('出价不能大于预算');
+            }
+            else {
+                callback();
+            }
+        };
         return {
-            adAudiencePackageId: '',
+            adAudiencePackageId: undefined,
             planRangePicker: [],
             labelCol: {span: 4},
             wrapperCol: {span: 14},
@@ -357,7 +379,8 @@ export default {
             },
             budgetRules: {
                 budget: [
-                    {required: true, message: '请输入', trigger: 'blur'}
+                    {required: true, message: '请输入', trigger: 'blur'},
+                    {validator: adCpaBidValidator, trigger: 'blur'}
                 ]
             },
             budgetVisible: false,
@@ -404,7 +427,7 @@ export default {
                     key: 'formCount',
                     today: 0,
                     yesterday: 0,
-                    type: 'int'
+                    type: 'average'
                 }
             ],
             newLink: '',
@@ -425,15 +448,16 @@ export default {
                     dataIndex: 'adName',
                     key: 'adName',
                     align: 'center',
+                    fixed: 'left',
                     width: 240
                 },
                 {
                     title: '花费',
-                    dataIndex: 'cost',
-                    key: 'cost',
+                    dataIndex: 'costStr',
+                    key: 'costStr',
                     align: 'center',
                     width: 180,
-                    sorter: (a, b) => a.cost - b.cost
+                    sorter: (a, b) => a.costStr - b.costStr
                 },
                 {
                     title: '出价',
@@ -505,6 +529,7 @@ export default {
                     key: 'conver',
                     align: 'center',
                     width: 180,
+                    scopedSlots: {customRender: 'conver'},
                     sorter: (a, b) => a.conver - b.conver
                 },
                 {
@@ -647,6 +672,44 @@ export default {
             materialSortCode: 'charge',
             materialSortType: 'DESC',
             directionalList: [],
+            promotionTypeList: [
+                {
+                    value: 'EXTERNAL',
+                    label: '落地页'
+                },
+                {
+                    value: 'ARTICLE',
+                    label: '文章推广'
+                },
+                {
+                    value: 'GOODS',
+                    label: '商品推广'
+                },
+                {
+                    value: 'DPA',
+                    label: '商品目录'
+                },
+                {
+                    value: 'STORE',
+                    label: '门店推广'
+                },
+                {
+                    value: 'AWEME',
+                    label: '抖音号推广'
+                },
+                {
+                    value: 'SHOP',
+                    label: '店铺直投'
+                },
+                {
+                    value: 'APP_ANDROID',
+                    label: '应用下载-安卓'
+                },
+                {
+                    value: 'APP_IOS',
+                    label: '应用下载-IOS'
+                }
+            ],
             selectDirectionalId: undefined,
             topAccountMsg: {},
             topCostList: {},
@@ -661,12 +724,27 @@ export default {
     },
     methods: {
         ...mapGetters(['userInfo']),
+        handleChangeBudgetForm(e) {
+            this.budgetForm.budget = Number(Number(e).toFixed(2));
+        },
+        handleAccountBodyCost() {
+            this.isActive = 'spendCost';
+            this.initEchart('accountIndexEchart', this.initAccountIndexEchart(this.yearCostReportList, 'spendCost'));
+        },
         // 获取所有的定向包的列表
         handleGetAdAudiencePackage(account) {
             getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', {accountId: account})
                 .then(result => {
                     if (result.code === 0) {
-                        this.selectiveList = result.result || [];
+                        const defaultList = result.result;
+                        this.promotionTypeList.forEach(item => {
+                            defaultList.forEach(val => {
+                                if (val.landing_type === item.value) {
+                                    val.changeName = item.label;
+                                }
+                            });
+                        });
+                        this.selectiveList = defaultList;
                     }
                     else {
                         this.$message.error(result.message);
@@ -724,13 +802,13 @@ export default {
                 if (valid) {
                     const paramsData = {
                         adId: this.currentUnit.adId,
-                        bid: this.budgetForm.budget,
+                        cpaBid: this.budgetForm.budget,
                         accountId: this.topCostList.account.accountId
                     };
-                    getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/updateADBid', paramsData).then(result => {
+                    getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/updateADCpaBid', paramsData).then(result => {
                         if (result.code === 0) {
                             this.$message.success(result.message);
-                            this.budgetForm.budget = '';
+                            this.budgetForm.budget = 0;
                             this.budgetVisible = false;
                             this.handleGetPlanTableList(this.topCostList);
                         }
@@ -749,20 +827,21 @@ export default {
         },
         // 调价修改取消按钮
         handleBudgetCancel() {
-            this.budgetForm.budget = '';
+            this.budgetForm.budget = 0;
             this.budgetVisible = false;
         },
         // 调价修改确定按钮
         handleModifyPrice(list) {
             this.currentUnit = list;
+            this.budgetForm.budget = list.cpaBid;
             this.budgetVisible = true;
         },
         // 获取计划列表数据
         handleGetPlanTableList(data) {
             const paramsData = {
                 accountId: data.account.accountId,
-                startTime: data.startTime,
-                endTime: data.endTime,
+                startTime: this.planRangePicker[0],
+                endTime: this.planRangePicker[1],
                 pageNum: this.planPagin.page,
                 pageSize: this.planPagin.size
             };
@@ -803,6 +882,7 @@ export default {
                     this.throwColumns[3].yesterday = Number(result.result.lastMap.converRate);
                     this.throwColumns[4].today = Number(result.result.nowMap.averageShow);
                     this.throwColumns[4].yesterday = Number(result.result.lastMap.averageShow);
+                    this.isActive = 'spendCost';
                 }
                 else {
                     this.$message.error(result.message);
@@ -880,6 +960,10 @@ export default {
         },
         // 修改定向的确定按钮
         handleTargethandleOk() {
+            if (!this.adAudiencePackageId) {
+                this.$message.error('请选择定向包');
+                return;
+            }
             const paramsData = {
                 accountId: this.topCostList.account.accountId,
                 adId: this.currentUnit.adId,
@@ -887,7 +971,7 @@ export default {
             };
             getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/updateADAudiencePackage', paramsData).then(result => {
                 if (result.code === 0) {
-                    this.adAudiencePackageId = '';
+                    this.adAudiencePackageId = undefined;
                     this.targetVisible = false;
                     this.$message.success(result.message);
                     this.handleGetPlanTableList(this.topCostList);
@@ -901,7 +985,7 @@ export default {
         },
         // 修改定向的取消按钮
         handleTargethandleCancel() {
-            this.adAudiencePackageId = '';
+            this.adAudiencePackageId = undefined;
             this.packageName = '';
             this.targetVisible = false;
         },
@@ -928,7 +1012,6 @@ export default {
         },
         // 计划点击分页操作
         handleOnShowSizeChange(current, pageSize) {
-            console.log(current, pageSize, 'current, pageSize');
             this.planPagin = {
                 page: current,
                 size: pageSize
@@ -1021,8 +1104,8 @@ export default {
         },
         // 默认echarts
         initAccountIndexEchart(data, type) {
-            const LastX = data.lastMap.costList.map(item => item.time);
-            const todayX = data.nowMap.costList.map(item => item.time);
+            const LastX = data.lastMap.costList.length ? data.lastMap.costList.map(item => item.time) : [];
+            const todayX = data.nowMap.costList.length ? data.nowMap.costList.map(item => item.time) : [];
             let specialIdentification = '';
             if (todayX.length && todayX[0].indexOf('-') !== -1) {
                 specialIdentification = '';
@@ -1033,31 +1116,31 @@ export default {
             let tadayShowY = [];
             let yestodayShowY = [];
             if (type === 'spendCost') {
-                tadayShowY = data.nowMap.costList.map(item => item.cost);
-                yestodayShowY = data.lastMap.costList.map(item => item.cost);
+                tadayShowY = data.nowMap.costList.length ? data.nowMap.costList.map(item => item.cost) : [];
+                yestodayShowY = data.lastMap.costList.length ? data.lastMap.costList.map(item => item.cost) : [];
             }
             else if (type === 'activationCost') {
-                tadayShowY = data.nowMap.costList.map(item => item.conver);
-                yestodayShowY = data.lastMap.costList.map(item => item.conver);
+                tadayShowY = data.nowMap.costList.length ? data.nowMap.costList.map(item => item.conver) : [];
+                yestodayShowY = data.lastMap.costList.length ? data.lastMap.costList.map(item => item.conver) : [];
             }
             else if (type === 'activation') {
-                tadayShowY = data.nowMap.costList.map(item => item.convertNum);
-                yestodayShowY = data.lastMap.costList.map(item => item.convertNum);
+                tadayShowY = data.nowMap.costList.length ? data.nowMap.costList.map(item => item.convertNum) : [];
+                yestodayShowY = data.lastMap.costList.length ? data.lastMap.costList.map(item => item.convertNum) : [];
             }
             else if (type === 'bclick') {
-                tadayShowY = data.nowMap.costList.map(item => item.converRate);
-                yestodayShowY = data.lastMap.costList.map(item => item.converRate);
+                tadayShowY = data.nowMap.costList.length ? data.nowMap.costList.map(item => item.converRate) : [];
+                yestodayShowY = data.lastMap.costList.length ? data.lastMap.costList.map(item => item.converRate) : [];
             }
             else if (type === 'formCount') {
-                tadayShowY = data.nowMap.costList.map(item => item.averageShow);
-                yestodayShowY = data.lastMap.costList.map(item => item.averageShow);
+                tadayShowY = data.nowMap.costList.length ? data.nowMap.costList.map(item => item.averageShow) : [];
+                yestodayShowY = data.lastMap.costList.length ? data.lastMap.costList.map(item => item.averageShow) : [];
             }
             let option = {
                 tooltip: {
                     trigger: 'axis',
                     formatter: params => {
                         let isType = '';
-                        let showBai = this.isActive === 'bclick' || this.isActive === 'formCount' ? '%' : '';
+                        let showBai = this.isActive === 'bclick' ? '%' : '';
                         this.throwColumns.forEach(item => {
                             if (item.dataIndex === this.isActive) {
                                 isType = item.title;
@@ -1082,17 +1165,16 @@ export default {
                         type: 'category',
                         show: false,
                         boundaryGap: false,
-                        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+                        data: [],
                         axisPointer: {
                             type: 'none'
                         }
-                        
                     },
                     {
                         type: 'category',
                         show: false,
                         boundaryGap: false,
-                        data: ['1', '2', '3', '4', '5', '6', '7'],
+                        data: [],
                         axisPointer: {
                             type: 'none'
                         }
@@ -1109,7 +1191,7 @@ export default {
                         type: 'line',
                         smooth: true,
                         showSymbol: false,
-                        xAxisIndex: 1,
+                        xAxisIndex: 0,
                         symbol: 'circle',
                         lineStyle: {
                             color: '#2461F1',
@@ -1143,7 +1225,7 @@ export default {
                         data: [],
                         type: 'line',
                         smooth: true,
-                        xAxisIndex: 0,
+                        xAxisIndex: 1,
                         showSymbol: false,
                         symbol: 'circle',
                         lineStyle: {
@@ -1176,6 +1258,8 @@ export default {
             };
             option.xAxis[0].data = todayX;
             option.xAxis[1].data = LastX;
+            option.series[0].name = data.nowMap.costList.length ? data.nowMap.costList[0].statDatetime : '';
+            option.series[1].name = data.lastMap.costList.length ? data.lastMap.costList[0].statDatetime : '';
             option.series[0].data = tadayShowY;
             option.series[1].data = yestodayShowY;
             return option;
@@ -1210,7 +1294,6 @@ export default {
                         },
                         axisTick: {
                             show: false
-
                         },
                         splitLine: {
                             show: false
@@ -1221,8 +1304,7 @@ export default {
                         detail: {
                             formatter: function(value) {
                                 if (value !== 0) {
-                                    let num = Math.round(value);
-                                    return parseInt(num).toFixed(0) + '%';
+                                    return value + '%';
                                 }
                                 else {
                                     return 0;
@@ -1340,6 +1422,17 @@ export default {
 };
 </script>
 <style lang="scss">
+    .orient-list {
+        display: flex;
+        justify-content: space-between;
+        width: 260px;
+        .orient-option-left {
+            float: left;
+        }
+        .orient-option-right {
+            float: right;
+        }
+    }
     .accountPage .accountBody {
         line-height: 1;
         .ant-input {
@@ -1563,6 +1656,9 @@ export default {
             .item {
                 width: 25%;
             }
+            .item:nth-child(1) {
+                width: 0;
+            }
             .todyCost {
                 font-size: 1.2rem;
                 font-weight: 700;

+ 3 - 3
vue.config.js

@@ -80,15 +80,15 @@ module.exports = {
         // target: 'http://192.168.1.219:8081', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // 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.43:8806', // 子安
         // target: 'http://192.168.1.8:8806', // 学超
-      //  target:'http://139.186.165.84:8806', //测试
+       target:'http://139.186.165.84:8806', //测试
         // target:'http://apipre.tjyourong.com.cn', //预生产
 
         ws: false,