Pārlūkot izejas kodu

账户配置 上线代码

jiayufei 4 gadi atpakaļ
vecāks
revīzija
4d59051dff

+ 7 - 2
src/views/modules/account-config/account-config-server.js

@@ -1,4 +1,9 @@
-// export const urlAcount = 'http://118.24.244.213:8080'; // 线上
+/**
+ * @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://139.186.165.84:8080'; // 测试

+ 6 - 19
src/views/modules/account-config/account-config.vue

@@ -39,7 +39,7 @@
                         <template slot="title">
                             <span>当日花费</span>
                         </template>
-                        <a-icon type="smile-o"/>
+                        <a-icon type="question-circle"/>
                     </a-tooltip>
                 </span>
                 <span slot="acountRelax" slot-scope="text, record">
@@ -251,13 +251,6 @@ export default {
             }
         };
         let budgetValidator = (rule, value, callback) => {
-            // const finallyResult = Number(this.configForm.adMinBid) + Number(value);
-            // if (finallyResult < Number(this.configForm.adMaxBid)) {
-            //     callback();
-            // }
-            // else {
-            //     callback('最低出价+浮动间隔<最高出价');
-            // }
             const changeBudget = this.updateModTxt.accountBudget;
             if (Number(value) > Number(changeBudget) && Number(value) < (Number(changeBudget) + 100)) {
                 callback('单次修改预算幅度, 不能低于100.0元');
@@ -347,8 +340,9 @@ export default {
                     align: 'center'
                 },
                 {
-                    title: '账户日预算(元)',
+                    title: '账户日预算(元)',
                     dataIndex: 'accountBudget',
+                    width: 180,
                     align: 'center'
                 },
                 {
@@ -359,12 +353,14 @@ export default {
                 {
                     align: 'center',
                     dataIndex: 'cost',
+                    width: 150,
                     slots: {title: 'customTitle'}
                 },
                 {
                     title: '操作',
                     dataIndex: 'action',
                     align: 'center',
+                    width: '20%',
                     scopedSlots: {customRender: 'action'}
                 }
             ]
@@ -384,17 +380,7 @@ export default {
         },
         handleAccountBudget(e) {
             const adBudgetInput = e.target.value;
-            // const changeBudget = this.updateModTxt.accountBudget;
             this.budgetForm.budget = Number(Number(adBudgetInput).toFixed(2));
-            // if (Number(adBudgetInput) >= Number(changeBudget) && Number(adBudgetInput) < (Number(changeBudget) + 100)) {
-            //     this.adBudgetShowTitle = true;
-            // }
-            // else if (Number(adBudgetInput) <= Number(changeBudget) && Number(adBudgetInput) > (Number(changeBudget) - 100)) {
-            //     this.adBudgetShowTitle = true;
-            // }
-            // else {
-            //     this.adBudgetShowTitle = false;
-            // }
         },
         handleModeSure() {
             let paramsData = new FormData();
@@ -435,6 +421,7 @@ export default {
         },
         handleUpdateMod(record) {
             this.updateModTxt = record;
+            this.configForm.adCpaBid = record.adCpaBid;
             this.configForm.adMinBid = record.adMinBid;
             this.configForm.adMaxBid = record.adMaxBid;
             this.configForm.adStepBid = record.adStepBid;

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

@@ -822,7 +822,7 @@
                 <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用名" prop="creativeAppName">
                     <a-input
                         class="common-input-long"
-                        placeholder="请输入来源"
+                        placeholder="请输入应用名"
                         v-model="configForm.creativeAppName"
                         allow-clear
                     />
@@ -981,6 +981,9 @@ export default {
         let handleCharacterLen20 = (rule, value, callback) => {
             this.handleExportRules(value, 4, 20, callback);
         };
+        let handleCharacterLenCreativeApp = (rule, value, callback) => {
+            this.handleExportRules(value, 4, 20, callback);
+        };
         let floatingIntervalValidator = (rule, value, callback) => {
             const finallyResult = Number(this.configForm.adMinBid) + Number(value);
             if (finallyResult < Number(this.configForm.adMaxBid)) {
@@ -1200,7 +1203,7 @@ export default {
             rules: {
                 creativeAppName: [
                     {required: true, message: '请输入', trigger: 'blur'},
-                    {validator: handleCharacterLen20, trigger: 'blur'}
+                    {validator: handleCharacterLenCreativeApp, trigger: 'blur'}
                 ],
                 adExternalUrl: [
                     {required: true, message: '请输入', trigger: 'blur'},
@@ -1270,10 +1273,10 @@ export default {
                 adDirectionalFlag: 'add',
                 adInterestActionMode: 'UNLIMITED',
                 creativeDisplayMode: 'CREATIVE_DISPLAY_MODE_CTR',
-                creativeAppName: '',
+                creativeAppName: undefined,
                 creativeIsPresentedVideo: 0,
                 creativeGenerateDerivedAd: 0,
-                creativeIsCommentDisable: 1,
+                creativeIsCommentDisable: 0,
                 creativeDownloadStatus: 1,
                 creativeSubTitle: '',
                 adConvertedTimeDuration: 'THREE_MONTH',
@@ -1951,6 +1954,11 @@ export default {
                         this.configForm.campaignAdCnt = detailData.campaignAdCnt || '';
                         this.configForm.launchTarget = detailData.launchTarget || 'OCPM';
                         this.configForm.adDownloadType = detailData.adDownloadType;
+                        if (detailData.adDownloadType === 'DOWNLOAD_URL') {
+                            this.$nextTick(() => {
+                                this.configForm.creativeAppName = detailData.creativeAppName || undefined;
+                            });
+                        }
                         this.configForm.adPlatform = detailData.adPlatform;
                         this.configForm.adExternalUrl = detailData.adExternalUrl || '';
                         this.configForm.adOpenUrl = detailData.adOpenUrl || '';
@@ -2121,7 +2129,7 @@ export default {
                         }
                         this.configForm.adInterestActionMode = detailData.adInterestActionMode;
                         this.configForm.creativeDisplayMode = detailData.creativeDisplayMode;
-                        this.configForm.creativeAppName = detailData.creativeAppName;
+                        // this.configForm.creativeAppName = detailData.creativeAppName;
                         this.configForm.creativeIsPresentedVideo = detailData.creativeIsPresentedVideo;
                         this.configForm.creativeGenerateDerivedAd = detailData.creativeGenerateDerivedAd;
                         this.configForm.creativeIsCommentDisable = detailData.creativeIsCommentDisable;
@@ -2189,6 +2197,7 @@ export default {
                     this.$bus.$emit('remove', '/account-config/components/configuration-modal');
                 }
                 else {
+                    this.sureLoading = false;
                     this.$message.error(result.message);
                 }
             }).catch(error => {
@@ -2520,6 +2529,7 @@ export default {
                     this.$bus.$emit('remove', '/account-config/components/configuration-modal');
                 }
                 else {
+                    this.sureLoading = false;
                     this.$message.error(result.message);
                 }
             }).catch(error => {

+ 26 - 217
src/views/modules/creative-copywrit/creative-copywrit.vue

@@ -1476,9 +1476,8 @@
                     <div class="acount-title-left">创意标题</div>
                     <div class="acount-title-right">
                         <a-button type="primary" @click="handleAddOrigin"><a-icon type="plus" />创意标题</a-button>
-                        <!-- TODO 暂时功能隐藏 -->
                         <!-- <a-button class="examin-select-title" @click="handleSelectTitle">选标题</a-button> -->
-                        <span>已填:{{ titleFiledResult.length || 0 }}</span>
+                        <span style="margin-left: 20px;">已填:{{ titleFiledResult.length || 0 }}</span>
                     </div>
                 </div>
                 <div class="acount-title">
@@ -1497,41 +1496,16 @@
                                     v-decorator="[
                                         item.name,
                                         { rules: [
-                                            {required: true, message: '请输入创意标题'},
-                                            {validator: validatePass, trigger: 'blur'}
+                                            {required: true, message: '请输入创意标题', trigger: 'blur'},
+                                            {min: 5, max: 30, message: '创意标题5-30个字', trigger: 'blur'}
                                         ]}
                                     ]"
                                     class="examin-form-input"
-                                    :id="item.name"
                                     placeholder="请输入"
-                                    @change="handleFormInputChang($event, item.name, item.id)"
+                                    @change="handleFormInputChang($event, item)"
                                 />
-                                <span class="examin-form-num">{{ item.lenSize }}/30</span>
+                                <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 v-if="item.tabStatus === 'alone'" class="name-tags-left">
-                                        <a-tag
-                                            v-for="val in item.updateTagsList"
-                                            :key="val.id"
-                                            color="#1890ff"
-                                            @click="handleGetChangeAll(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="handleGetChangeAll(val.name, item.name, item.id)"
-                                        >
-                                            + {{ val.name }}
-                                        </a-tag>
-                                    </div>
-                                    <div v-if="item.tabStatus === 'alone'"><a @click="handleMoreTagsShow(item.id, 'more')">更多</a></div>
-                                    <div v-if="item.tabStatus === 'all'"><a @click="handleMoreTagsShow(item.id, 'little')">收起</a></div>
-                                </div>
                             </a-form-item>
                         </a-form>
                     </div>
@@ -1560,9 +1534,8 @@
                     <div class="acount-title-left">创意标题</div>
                     <div class="acount-title-right">
                         <a-button type="primary" @click="handleAddOrigin"><a-icon type="plus" />创意标题</a-button>
-                        <!-- TODO 暂时功能隐藏 -->
                         <!-- <a-button class="examin-select-title" @click="handleSelectTitle">选标题</a-button> -->
-                        <span>已填:{{ titleFiledResult.length || 0 }}</span>
+                        <span style="margin-left: 20px;">已填:{{ titleFiledResult.length || 0 }}</span>
                     </div>
                 </div>
                 <div class="acount-title">
@@ -1581,40 +1554,16 @@
                                     v-decorator="[
                                         item.name,
                                         { rules: [
-                                            {required: true, message: '请输入创意标题'},
-                                            {validator: validatePass, trigger: 'blur'}
+                                            {required: true, message: '请输入创意标题', trigger: 'blur'},
+                                            {min: 5, max: 30, message: '创意标题5-30个字', trigger: 'blur'}
                                         ]}
                                     ]"
                                     class="examin-form-input"
                                     placeholder="请输入"
                                     @change="handleFormInputChang($event, item)"
                                 />
-                                <span class="examin-form-num">{{ item.lenSize }}/30</span>
+                                <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 v-if="item.tabStatus === 'alone'" class="name-tags-left">
-                                        <a-tag
-                                            v-for="val in item.updateTagsList"
-                                            :key="val.id"
-                                            color="#1890ff"
-                                            @click="handleGetChangeAll(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="handleGetChangeAll(val.name, item.name, item.id)"
-                                        >
-                                            + {{ val.name }}
-                                        </a-tag>
-                                    </div>
-                                    <div v-if="item.tabStatus === 'alone'"><a @click="handleMoreTagsShow(item.id, 'more')">更多</a></div>
-                                    <div v-if="item.tabStatus === 'all'"><a @click="handleMoreTagsShow(item.id, 'little')">收起</a></div>
-                                </div>
                             </a-form-item>
                         </a-form>
                     </div>
@@ -1655,7 +1604,6 @@ export default {
     },
     data() {
         return {
-            adNameTags: [],
             materTitltStatus: false,
             accountMaster: {
                 height: '35px',
@@ -1933,7 +1881,6 @@ export default {
             }
         });
         this.getHangye();
-        this.handleGetCreativeWord();
     },
     watch: {
         $route(n, o) {
@@ -1986,110 +1933,6 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
-        handleMoreTagsShow(val, type) {
-            if (type === 'more') {
-                this.defaultFormList.forEach(item => {
-                    if (item.id === val) {
-                        item.tabStatus = 'all';
-                    }
-                });
-            }
-            else if (type === 'little') {
-                this.defaultFormList.forEach(item => {
-                    if (item.id === val) {
-                        item.tabStatus = 'alone';
-                    }
-                });
-            }
-        },
-        handleGetCreativeWord() {
-            getAction('/ctop/ByteDanceCreativeWordPackage/list').then(result => {
-                if (result.code === 0) {
-                    this.adNameTags = result.result.records;
-                }
-                else {
-                    this.$message.error(result.message);
-                }
-            }).catch(error => {
-                console.log(error, 'eeee');
-            });
-        },
-        validatePass(rule, value, callback) {
-            let finallyLenList = this.judge(value);
-            const inputDefaultLen = value;
-            let tagsLen = finallyLenList.length * 4;
-            let tagsSureLen = 0;
-            let resultSelectSize = 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;
-            if (resultSelectSize < 30 && resultSelectSize > 5) {
-                callback();
-            }
-            else {
-                callback(new Error('创意标题5-30个字'));
-            }
-        },
-        judge(item) {
-            // let re = /{{(.*?)}}/g;
-            let re = /\{\{(.+?)\}\}/g;
-            let array = [];
-            let temp;
-            while ((temp = re.exec(item))) {
-                array.push(temp[1]);
-            };
-            return array;
-        },
-        // 点击获取光标位置进行字段插入
-        handleGetChangeAll(item, field, formId) {
-            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();
-            this.$nextTick(() => {
-                let finallyLenList = this.judge(this.examinForm.getFieldsValue()[field]);
-                const inputDefaultLen = this.examinForm.getFieldsValue()[field].length;
-                let tagsLen = finallyLenList.length * 4;
-                let tagsSureLen = 0;
-                let resultSelectSize = 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;
-                this.defaultFormList.forEach(item => {
-                    if (item.id === formId) {
-                        item.lenSize = resultSelectSize;
-                        item.value = this.examinForm.getFieldsValue()[field];
-                    }
-                });
-            });
-        },
         handleMaterTitleClick() {
             this.materTitltStatus = !this.materTitltStatus;
             if (this.materTitltStatus) {
@@ -2114,16 +1957,17 @@ export default {
             });
             this.modalShowBatchList = batchList;
             this.batchVisible = true;
+            this.materTitltStatus = false;
+            this.accountMaster = {
+                height: '35px',
+                overflow: 'hidden'
+            };
             for (let i = 0; i < 3; i++) {
                 const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
                 this.defaultFormList.push({
                     id: randomNum,
                     name: 'username' + randomNum,
-                    value: '',
-                    lenSize: 0,
-                    tabStatus: 'alone',
-                    defaultTagsList: this.adNameTags,
-                    updateTagsList: this.adNameTags.slice(0, 4)
+                    value: ''
                 });
             }
         },
@@ -2159,6 +2003,7 @@ export default {
             });
         },
         handleBatchCancel() {
+            console.log('批量取消按钮');
             this.batchVisible = false;
         },
         handleFodderWind() {
@@ -2206,6 +2051,7 @@ export default {
                     this.showUrlWater = res.result.watermarkUrl;
                     this.name = res.result.watermarkCode;
                     this.materialName = res.result.materialName;
+                    // 0317淘特除螨仪.mp4     0317幸福里 没钱 高清版.mp4    0316幸福里来北京五年 高清  大妈和美女2高清.mp4  WIFIAQZS2004JYL.mp4
                     res.result.slogans.forEach(item => {
                         item.name = 'username' + item.id;
                     });
@@ -2265,10 +2111,10 @@ export default {
                 this.solganForm.setFieldsValue({[data.name]: data.slogan});
             });
         },
-        handleFormInputChang(e, field, formId) {
+        handleFormInputChang(e, data) {
             const changeFiled = [];
             this.defaultFormList.forEach(item => {
-                if (item.id === formId) {
+                if (item.id === data.id) {
                     item.value = e.target.value;
                 }
             });
@@ -2277,30 +2123,7 @@ export default {
                     changeFiled.push(item.value);
                 }
             });
-            this.$nextTick(() => {
-                let finallyLenList = this.judge(this.examinForm.getFieldsValue()[field]);
-                const inputDefaultLen = this.defaultFormList.filter(item => item.id === formId)[0].value.length;
-                let tagsLen = finallyLenList.length * 4;
-                let tagsSureLen = 0;
-                let resultSelectSize = 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;
-                this.defaultFormList.forEach(item => {
-                    if (item.id === formId) {
-                        item.lenSize = resultSelectSize;
-                    }
-                });
-                this.titleFiledResult = changeFiled;
-            });
+            this.titleFiledResult = changeFiled;
         },
         handleCheckBoxChang(data) {
             this.applyTypeOption = data;
@@ -2358,10 +2181,7 @@ export default {
                 this.defaultFormList.push({
                     id: dateTime,
                     name: name,
-                    value: item,
-                    tabStatus: 'alone',
-                    defaultTagsList: this.adNameTags,
-                    updateTagsList: this.adNameTags.slice(0, 4)
+                    value: item
                 });
             });
             this.titleResult = [];
@@ -2384,11 +2204,7 @@ export default {
             this.defaultFormList.push({
                 id: randomNum,
                 name: 'username' + randomNum,
-                value: '',
-                lenSize: 0,
-                tabStatus: 'alone',
-                defaultTagsList: this.adNameTags,
-                updateTagsList: this.adNameTags.slice(0, 4)
+                value: ''
             });
         },
         handleDelOrigin(list) {
@@ -2405,10 +2221,6 @@ export default {
                         res.result.slogans.forEach(item => {
                             item.name = 'username' + item.id;
                             item.value = item.slogan;
-                            item.lenSize = item.slogan.length,
-                            item.tabStatus = 'alone';
-                            item.defaultTagsList = this.adNameTags;
-                            item.updateTagsList = this.adNameTags.slice(0, 4);
                         });
                         this.defaultFormList = res.result.slogans;
                         this.$nextTick(() => {
@@ -2423,11 +2235,7 @@ export default {
                             this.defaultFormList.push({
                                 id: randomNum,
                                 name: 'username' + randomNum,
-                                value: '',
-                                lenSize: 0,
-                                tabStatus: 'alone',
-                                defaultTagsList: this.adNameTags,
-                                updateTagsList: this.adNameTags.slice(0, 4)
+                                value: ''
                             });
                         }
                     }
@@ -2815,6 +2623,8 @@ export default {
             }
         },
         onChangeCheck(checkedList, data) {
+            console.log(data, 'data--data');
+            console.log(checkedList, this.checkArr, this.dataSource, '-------');
             if (data.value === '0') {
                 this.showTabsTitle = '0';
             }
@@ -3025,8 +2835,7 @@ export default {
                         this.visibleDetail = false;
                         closeAllVideoFun();
                     });
-                }
-                else {
+                } else {
                     fileEdit({
                         id: this.id,
                         status: editStatus,

+ 5 - 0
src/views/modules/headline-view/headline-view-server.js

@@ -1,3 +1,8 @@
+/**
+ * @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'; // 子安

+ 6 - 6
src/views/modules/headline-view/headline-view.vue

@@ -51,9 +51,9 @@
                     <div class="top">                       
                         <div class="item" v-for="item in throwColumns" :key="item.dataIndex">
                             <div class="todyCost">
-                                <span v-if="item.type === 'double'">{{ item.today | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'string'">{{ item.today + '%' }}</span>
-                                <span v-else-if="item.type === 'int'">{{ item.today | formatCurrency }}</span>
+                                <span v-if="item.type === 'double'">{{ item.today }}</span>
+                                <span v-else-if="item.type === 'string'">{{ item.today }}</span>
+                                <span v-else-if="item.type === 'int'">{{ item.today }}</span>
                                 <span 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" />
@@ -69,9 +69,9 @@
                                     </template>
                                     <a-icon type="question-circle" />
                                 </a-tooltip>:
-                                <span v-if="item.type === 'double'">{{ item.yesterday | decimalsHandle }}</span>
-                                <span v-else-if="item.type === 'string'">{{ item.yesterday +'%' }}</span>
-                                <span v-else-if="item.type === 'int'">{{ item.yesterday | formatCurrency }}</span>
+                                <span v-if="item.type === 'double'">{{ item.yesterday }}</span>
+                                <span v-else-if="item.type === 'string'">{{ item.yesterday }}</span>
+                                <span v-else-if="item.type === 'int'">{{ item.yesterday }}</span>
                             </div>
                             <span
                                 class="IndexName"