jiayufei 4 rokov pred
rodič
commit
4c8dbbf9c6

+ 33 - 1
src/views/modules/account-config/account-config.less

@@ -31,6 +31,38 @@
         overflow-y: auto;
     }
     .config-form-modal {
+        .dp-link-start {
+            display: inline-block;
+            .ant-form-item-label {
+                width: 100px;
+                margin-left: 43px;
+            }
+            .ant-form-item-control-wrapper {
+                width: 163px;
+            }
+        }
+        .dp-link-end {
+            display: inline-block;
+        }
+        .campaign-cnt-class {
+            display: inline-block;
+            .ant-form-item-label {
+                width: 160px;
+                margin-left: 73px;
+            }
+            .ant-form-item-control-wrapper {
+                width: 110px;
+            }
+        }
+        .campaign-ad-class {
+            display: inline-block;
+            .ant-form-item-label {
+                width: 110px;
+            }
+            .ant-form-item-control-wrapper {
+                width: 120px;
+            }
+        }
         .avatar-uploader > .ant-upload {
             width: 128px;
             height: 128px;
@@ -99,7 +131,7 @@
         .form-itrm-icon {
             position: absolute;
             top: 3px;
-            left: -95px;
+            left: -175px;
         }
         .advers-title-class {
             margin-left: 10px;

+ 152 - 36
src/views/modules/account-config/account-config.vue

@@ -13,7 +13,7 @@
                         label="账户"
                         :colon="false"
                     >
-                        <acount-search class="acount-search-class" :appId.sync="acountId" :multiple="false"></acount-search>
+                        <acount-search class="acount-search-class" :appId.sync="acountId" :multiple="false" request="1,3"></acount-search>
                     </a-form-item>
                     <a-form-item class="form-handle-btn">
                         <a-button type="default" class="reset-class">重置</a-button>
@@ -42,20 +42,27 @@
                     </a-tooltip>
                 </span>
                 <span slot="acountRelax" slot-scope="text, record">
-                    <a-switch :checked="text" @change="handleSwitchChang"/>
+                    <a-switch :checked="text === 0" @change="handleSwitchChang($event, record)"/>
                 </span>
-                 <span slot="action" slot-scope="text, record">
+                <span slot="action" slot-scope="text, record">
                     <a @click="handleEdit(record)">编辑</a>
                     <a-divider type="vertical" />
-                    <a @click="handleDelete(record)">删除</a>
+                    <a @click="handleListDelete(record)">删除</a>
                     <a-divider type="vertical" />
                     <a-popover v-model="isModVisible" title="" trigger="click">
                         <template slot="content">
                             <p>
-                                <a-input placeholder="请输入" style="width: 140px;"/>
+                                <a-input v-model="modContent" placeholder="请输入" style="width: 140px;"/>
                             </p>
                             <p>
-                                <a-button size="small" type="primary" style="margin-left: 15px;margin-right: 15px;">确定</a-button>
+                                <a-button
+                                    size="small"
+                                    type="primary"
+                                    style="margin-left: 15px;margin-right: 15px;"
+                                    @click="handlePopoverSure(record, 'mod')"
+                                >
+                                    确定
+                                </a-button>
                                 <a-button size="small" @click="handleModPopover">取消</a-button>
                             </p>
                         </template>
@@ -65,10 +72,17 @@
                     <a-popover v-model="isBudgetVisible" title="" trigger="click">
                         <template slot="content">
                             <p>
-                                <a-input placeholder="请输入" style="width: 140px;"/>
+                                <a-input v-model="budgetContent" placeholder="请输入" style="width: 140px;"/>
                             </p>
                             <p>
-                                <a-button size="small" type="primary" style="margin-left: 15px;margin-right: 15px;">确定</a-button>
+                                <a-button
+                                    size="small"
+                                    type="primary"
+                                    style="margin-left: 15px;margin-right: 15px;"
+                                    @click="handlePopoverSure(record, 'budget')"
+                                >
+                                    确定
+                                </a-button>
                                 <a-button size="small" @click="handleBudgetPopover">取消</a-button>
                             </p>
                         </template>
@@ -100,6 +114,10 @@
 <script>
 import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
 import ConfigurationModal from './components/configuration-modal.vue';
+
+import {getAction, putAction, deleteAction} from '@/api/manage';
+import {mapGetters} from 'vuex';
+
 export default {
     name: 'account-config',
     components: {
@@ -108,12 +126,18 @@ export default {
     },
     data() {
         return {
+            modContent: '',
+            budgetContent: '',
             isBudgetVisible: false,
             isModVisible: false,
             relaxVisible: false,
             accountModalTitle: 'add',
             acountId: undefined, // 搜索的账户ID
             totalAll: 0,
+            tablePag: {
+                page: 1,
+                size: 10
+            },
             dataSource: [
                 {
                     orientationName: false,
@@ -130,44 +154,44 @@ export default {
                 {
                     title: '开关',
                     align: 'center',
-                    dataIndex: 'orientationName',
+                    dataIndex: 'status',
                     scopedSlots: {customRender: 'acountRelax'}
                 },
                 {
                     title: '广告账户名称',
                     align: 'center',
-                    dataIndex: 'accountName'
+                    dataIndex: 'accountId_dictText'
                 },
                 {
                     title: '账户ID',
                     align: 'center',
-                    dataIndex: 'typeStr'
+                    dataIndex: 'accountId'
                 },
                 {
                     title: '创建时间',
-                    dataIndex: 'statDate',
-                    align: 'center'
-                },
-                {
-                    title: '账户余额',
-                    dataIndex: 'coverNum',
+                    dataIndex: 'createTime',
                     align: 'center'
                 },
+                // {
+                //     title: '账户余额',
+                //     dataIndex: 'adCpaBid',
+                //     align: 'center'
+                // },
                 {
                     title: '账户日预算量(元)',
-                    dataIndex: 'statusStr',
+                    dataIndex: 'adBudget',
                     align: 'center'
                 },
                 {
                     title: '出价(元)',
-                    dataIndex: 'chujia',
+                    dataIndex: 'adCpaBid',
                     align: 'center'
                 },
-                {
-                    align: 'center',
-                    dataIndex: 'populationType',
-                    slots: {title: 'customTitle'},
-                },
+                // {
+                //     align: 'center',
+                //     dataIndex: 'adCpaBid',
+                //     slots: {title: 'customTitle'}
+                // },
                 {
                     title: '操作',
                     dataIndex: 'action',
@@ -181,9 +205,88 @@ export default {
         this.form = this.$form.createForm(this);
     },
     mounted() {
-
+        this.handleInitTable();
     },
     methods: {
+        ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handlePopoverSure(data, type) {
+            const defaultList = {
+                accountId: data.accountId,
+                bid: this.modContent,
+                budget: this.budgetContent,
+                adId: data.adId ? data.adId : '',
+                id: data.id
+            };
+            let paramsData = new FormData();
+            if (type === 'mod') {
+                paramsData.append('accountId', defaultList.accountId);
+                paramsData.append('adId', defaultList.adId);
+                paramsData.append('type', 1);
+                paramsData.append('bId', defaultList.bid);
+                paramsData.append('id', defaultList.id);
+            }
+            else if (type === 'budget') {
+                paramsData.append('accountId', defaultList.accountId);
+                paramsData.append('adId', data.adId);
+                paramsData.append('type', 2);
+                paramsData.append('budget', defaultList.budget);
+                paramsData.append('id', defaultList.id);
+            }
+            this.handlePopoverChange(paramsData);
+        },
+        handlePopoverChange(data) {
+            putAction('/ctop/aiBytedanceAdvertiserStrategy/updStaOrCpaOrBudgetById', data).then(result => {
+                if (result.code === 0) {
+                    this.isModVisible = false;
+                    this.isBudgetVisible = false;
+                    this.$message.success(result.message);
+                    this.handleInitTable();
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
+        handleInitTable() {
+            const paramsData = {
+                accountId: this.acountId,
+                logingUserId: this.userInfo().id,
+                pageNo: this.tablePag.page,
+                pageSize: this.tablePag.size
+            };
+            getAction('/advertiser/aiBytedanceAdvertiserStrategy/list', paramsData).then(result => {
+                if (result.code === 0) {
+                    this.dataSource = result.result.records;
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
+        handleListDelete(data) {
+            let that = this;
+            this.$confirm({
+                title: '删除提示',
+                content: '确定要删除这一条吗?',
+                onOk() {
+                    deleteAction('/ctop/aiBytedanceAdvertiserStrategy/delete', {id: data.id}).then(result => {
+                        if (result.code === 0) {
+                            that.handleInitTable();
+                            that.$message.success('删除成功');
+                        }
+                        else {
+                            that.$message.error(result.message);
+                        }
+                    }).catch(error => {
+                        console.log(error, 'eeee');
+                    });
+                }
+            });
+        },
         handleBudgetPopover() {
             this.isBudgetVisible = false;
         },
@@ -198,37 +301,50 @@ export default {
         },
         handleQueryList(event) {
             event.preventDefault();
-            const paramsData = this.form.getFieldsValue();
+            this.handleInitTable();
         },
         onShowSizeChange(current, pageSize) {
-            const paramsData = this.form.getFieldsValue();
             this.tablePag = {
                 page: current,
                 size: pageSize
             };
-            // this.handleGetTableList(paramsData);
+            this.handleInitTable();
         },
-        handleSwitchChang(checked) {
-            console.log(checked, 'switch-checked');
+        handleSwitchChang(checked, data) {
+            const paramsData = {
+                id: data.id,
+                state: checked ? 0 : 1
+            };
+            const forDate = new FormData();
+            forDate.append('id', paramsData.id);
+            forDate.append('state', paramsData.state);
+            putAction('/ctop/aiBytedanceAdvertiserStrategy/updStaById', forDate).then(result => {
+                if (result.code === 200) {
+                    this.$message.success(result.message);
+                    this.handleInitTable();
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
         },
         handleEdit(data) {
             console.log(data, 'data-edit');
-        },
-        handleDelete(data) {
-            console.log(data, 'data-delete');
+            this.accountModalTitle = 'edit';
+            this.relaxVisible = true;
         },
         handleAddAccountConfig() {
             this.accountModalTitle = 'add';
             this.relaxVisible = true;
         },
         handleRelaxSure(data) {
-            console.log(data, 'data--确认弹窗');
             this.relaxVisible = false;
         },
         handleRelaxCancel() {
-            console.log('data--取消弹窗');
             this.relaxVisible = false;
-        },
+        }
     }
 };
 </script>

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

@@ -17,12 +17,14 @@
                 :wrapper-col="wrapperCol"
             >
                 <a-form-model-item label="广告账户">
-                    <acount-search class="acount-search-class" :appId.sync="configForm.acountId" :multiple="false"></acount-search>
+                    <acount-search :disabled="title === 'edit'" class="acount-search-class" :appId.sync="configForm.acountId" :multiple="false" request="1,3"></acount-search>
                 </a-form-model-item>
-                <a-form-model-item label="dp链接范围">
-                    <a-input class="common-input" v-model="configForm.dpLinkStartIndex" placeholder="请输入"/>
+                <a-form-model-item label="dp链接范围" class="dp-link-start" prop="dpLinkStartIndex">
+                    <a-input class="common-input" :disabled="title === 'edit'" v-model="configForm.dpLinkStartIndex" placeholder="请输入"/>
                     <span>~</span>
-                    <a-input class="common-input" v-model="configForm.dpLinkEndIndex" placeholder="请输入"/>
+                </a-form-model-item>
+                <a-form-model-item label="" class="dp-link-end" prop="dpLinkEndIndex">
+                    <a-input class="common-input" :disabled="title === 'edit'" v-model="configForm.dpLinkEndIndex" placeholder="请输入"/>
                 </a-form-model-item>
                 <a-form-model-item label="预算方式">
                     <a-radio-group v-model="configForm.accountBudgetMode" button-style="solid">
@@ -30,20 +32,20 @@
                         <a-radio-button value="2">指定预算</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item v-if="configForm.budget === 'designated'" label="账户日预算">
+                <a-form-model-item v-if="configForm.accountBudgetMode === '2'" label="账户日预算" prop="accountBudget">
                     <a-input-number v-model="configForm.accountBudget" :min="1000" :max="9999999.99" :step="0.01"/> 元
                 </a-form-model-item>
                 <p class="form-line"></p>
                 <p class="rock-title">广告组信息</p>
                 <a-form-model-item label="推广目标">
-                    <a-radio-group v-model="configForm.campaignLandingType" button-style="solid">
+                    <a-radio-group :disabled="title === 'edit'" v-model="configForm.campaignLandingType" button-style="solid">
                         <a-radio-button value="APP">应用</a-radio-button>
                         <a-radio-button value="LINK" disabled>销售线索收集</a-radio-button>
                         <a-radio-button value="SHOP" disabled>电商店铺推广</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
                 <a-form-model-item label="广告类型">
-                    <a-radio-group v-model="configForm.advertisingType" button-style="solid">
+                    <a-radio-group :disabled="title === 'edit'" v-model="configForm.advertisingType" button-style="solid">
                         <a-radio-button value="1">信息流广告</a-radio-button>
                         <a-radio-button value="2">搜索广告</a-radio-button>
                     </a-radio-group>
@@ -54,13 +56,13 @@
                     <a-input class="common-input-long" v-model="configForm.campaignName" placeholder="请输入广告组名称"/>
                 </a-form-model-item>
                 <a-form-model-item label="广告计划名称" prop="adName">
-                    <a-input class="common-input-long" v-model="configForm.adName" placeholder="请输入广告计划名称"/>
+                    <a-input class="common-input-long" id="groupName" v-model="configForm.adName" placeholder="请输入广告计划名称"/>
+                    <div>
+                        <a-tag v-for="item in adNameTags" :key="item" color="#1890ff" @click="handleGetChangeAll(item, 'groupName')">+ {{ item }}</a-tag>
+                    </div>
                 </a-form-model-item>
-                <a-form-model-item label="创建数量">
-                    <span class="advers-title-class">广告组数量</span>
-                    <a-input-number v-model="configForm.campaignCnt" :min="1" :max="10"/>
-                    <span class="advers-title-class">广告计划数量</span>
-                    <a-input-number v-model="configForm.campaignAdCnt" :min="1" :max="10"/>
+                <a-form-model-item label="创建数量: 广告组数量" class="campaign-cnt-class" prop="campaignCnt">
+                    <a-input-number v-model="configForm.campaignCnt" :min="1"/>
                     <a-tooltip placement="top">
                         <template slot="title">
                             <span>输入的数量为每天所创建的广告组数量</span>
@@ -69,37 +71,40 @@
                         <a-icon class="form-itrm-icon" type="smile-o"/>
                     </a-tooltip>
                 </a-form-model-item>
+                <a-form-model-item label="广告计划数量" class="campaign-ad-class" prop="campaignAdCnt">
+                    <a-input-number v-model="configForm.campaignAdCnt" :min="1" :max="10"/>
+                </a-form-model-item>
                 <p class="form-line"></p>
                 <p class="rock-title">投放内容</p>
                 <a-form-model-item label="投放目标">
-                    <a-radio-group v-model="configForm.launchTarget" button-style="solid">
+                    <a-radio-group :disabled="title === 'edit'" v-model="configForm.launchTarget" button-style="solid">
                         <a-radio-button value="OCPM">转量化</a-radio-button>
                         <a-radio-button value="CPC" disabled>点击量</a-radio-button>
                         <a-radio-button value="CPM" disabled>展示量</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item label="下载方式">
+                <a-form-model-item :disabled="title === 'edit'" label="下载方式">
                     <a-radio-group v-model="configForm.adDownloadType" button-style="solid">
                         <a-radio-button value="DOWNLOAD_URL">下载链接</a-radio-button>
                         <a-radio-button value="EXTERNAL_URL">落地页</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
                 <a-form-model-item v-if="configForm.adDownloadType === 'EXTERNAL_URL'" label="落地页链接">
-                    <a-input class="common-input-long" v-model="configForm.adExternalUrl" placeholder="请输入落地页链接"/>
+                    <a-input class="common-input-long" :disabled="title === 'edit'" v-model="configForm.adExternalUrl" placeholder="请输入落地页链接"/>
                 </a-form-model-item>
                 <a-form-model-item v-if="configForm.adDownloadType === 'EXTERNAL_URL'" label="直达链接内容">
                     <a-input class="common-input-long" v-model="configForm.adOpenUrl" placeholder="请输入直达链接内容"/>
                 </a-form-model-item>
                 <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="下载链接">
-                    <a-input class="common-input-long" v-model="configForm.adDownloadUrl" placeholder="请输入下载链接" @change="handleDownloadLink"/>
+                    <a-input class="common-input-long" :disabled="title === 'edit'" v-model="configForm.adDownloadUrl" placeholder="请输入下载链接" @change="handleDownloadLink"/>
                 </a-form-model-item>
                 <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用包名">
-                    <a-input class="common-input-long" v-model="configForm.adPackage" placeholder="请输入应用包名"/>
+                    <a-input class="common-input-long" :disabled="title === 'edit'" v-model="configForm.adPackage" placeholder="请输入应用包名"/>
                 </a-form-model-item>
                 <p class="form-line"></p>
                 <p class="rock-title">优化目标</p>
                 <a-form-model-item label="转化跟踪方式">
-                    <a-select class="common-input-long" v-model="configForm.adConvertType" placeholder="请选择">
+                    <a-select class="common-input-long" :disabled="title === 'edit'" v-model="configForm.adConvertType" placeholder="请选择">
                         <a-select-option value="AD_CONVERT_SOURCE_TYPE_APP_DOWNLOAD">应用下载API</a-select-option>
                         <a-select-option value="AD_CONVERT_SOURCE_TYPE_SDK">应用下载SDK</a-select-option>
                         <a-select-option value="AD_CONVERT_SOURCE_TYPE_OPEN_URL">应用直达API(应用直达链接)</a-select-option>
@@ -107,7 +112,7 @@
                     </a-select>
                 </a-form-model-item>
                 <a-form-model-item label="优化目标">
-                    <a-select class="common-input-long" v-model="configForm.adConvertId" placeholder="请选择">
+                    <a-select class="common-input-long" :disabled="title === 'edit'" v-model="configForm.adConvertId" placeholder="请选择">
                         <a-select-option value="shanghai">Zone one</a-select-option>
                         <a-select-option value="beijing">Zone two</a-select-option>
                     </a-select>
@@ -115,7 +120,7 @@
                 <p class="form-line"></p>
                 <p class="rock-title">设置投放位置</p>
                 <a-form-model-item label="广告位置">
-                    <a-radio-group v-model="configForm.adverPosition" button-style="solid">
+                    <a-radio-group :disabled="title === 'edit'" v-model="configForm.adverPosition" button-style="solid">
                         <a-radio-button value="a">系统优选广告位</a-radio-button>
                         <a-radio-button value="b">按媒体指定位置</a-radio-button>
                         <a-radio-button value="c">按场景指定位置</a-radio-button>
@@ -243,13 +248,13 @@
                 <p class="rock-title">预算与出价</p>
                 <a-form-model-item label="投放场景">
                     <a-radio-group v-model="configForm.adSmartBidType" button-style="solid">
-                        <a-radio-button value="SMART_BID_CUSTOM">常规投放</a-radio-button>
+                        <a-radio-button value="SMART_BID_CUSTOM" :disabled="title === 'edit'">常规投放</a-radio-button>
                         <a-radio-button value="SMART_BID_CONSERVATIVE" disabled>放量投放</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
                 <a-form-model-item label="预算">
                     <a-input-group compact>
-                        <a-select v-model="configForm.adBudgetMode" @change="handleBudgetMode">
+                        <a-select :disabled="title === 'edit'" v-model="configForm.adBudgetMode" @change="handleBudgetMode">
                             <a-select-option value="BUDGET_MODE_DAY">日预算</a-select-option>
                             <a-select-option value="BUDGET_MODE_TOTAL">总预算</a-select-option>
                         </a-select>
@@ -284,11 +289,11 @@
                 </div>
                 <a-form-model-item label="付费方式">
                     <a-radio-group v-model="configForm.adPricing" button-style="solid">
-                        <a-radio-button value="PRICING_OCPM">按展示付费(oCPM)</a-radio-button>
+                        <a-radio-button value="PRICING_OCPM" :disabled="title === 'edit'">按展示付费(oCPM)</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
                 <a-form-model-item label="目标转化出价">
-                    <a-input class="common-input" placeholder="请输入" v-model="configForm.adCpaBid"/> 元
+                    <a-input-number class="common-input" v-model="configForm.adCpaBid" :min="0.1" :max="10000" :step="0.01"/> 元
                 </a-form-model-item>
                 <p class="form-line"></p>
                 <p class="rock-title">第三方检测链接</p>
@@ -299,8 +304,8 @@
                 <p class="rock-title">创意信息</p>
                 <a-form-model-item label="创意方式">
                     <a-radio-group v-model="configForm.creativeMaterialMode" button-style="solid">
-                        <a-radio-button value="STATIC_ASSEMBLE">程序化创意</a-radio-button>
-                        <a-radio-button value="NONE">自定义创意</a-radio-button>
+                        <a-radio-button value="STATIC_ASSEMBLE" :disabled="title === 'edit'">程序化创意</a-radio-button>
+                        <a-radio-button value="NONE" :disabled="title === 'edit'">自定义创意</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
                 <a-form-model-item label="创意内容">
@@ -416,7 +421,9 @@
 <script>
 import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
 import SelectCheckAll from '../../BatchCreate/toutiaoTime';
+
 import moment from 'moment';
+import BMF from 'browser-md5-file';
 
 import {getAction} from '@/api/manage';
 
@@ -447,7 +454,10 @@ export default {
     },
     data() {
         return {
+            md5Result: '',
+            urlResult: '',
             createOptions: [],
+            adNameTags: ['出价方式', '素材名称', '日期', 'dp链接标识', '创意方式'],
             fieldNames: {
                 label: 'category_name',
                 value: 'category_id',
@@ -466,17 +476,28 @@ export default {
             labelCol: {span: 4},
             wrapperCol: {span: 14},
             rules: {
-                name: [
-                    {required: true, message: '请输入', trigger: 'blur'},
-                    {min: 1, max: 10, message: '长度位1-10字符', trigger: 'blur'}
+                campaignCnt: [
+                    {required: true, message: '请输入', trigger: 'blur'}
+                ],
+                campaignAdCnt: [
+                    {required: true, message: '请输入', trigger: 'blur'}
+                ],
+                dpLinkStartIndex: [
+                    {required: true, message: '请输入', trigger: 'blur'}
+                ],
+                dpLinkEndIndex: [
+                    {required: true, message: '请输入', trigger: 'blur'}
+                ],
+                accountBudget: [
+                    {required: true, message: '请输入', trigger: 'blur'}
                 ],
                 campaignName: [
                     {required: true, message: '请输入广告组名称', trigger: 'blur'},
                     {min: 1, max: 5, message: '长度位1-100字符', trigger: 'blur'}
                 ],
                 adName: [
-                    {required: true, message: '请输入广告计划名称', trigger: 'blur'},
-                    {min: 1, max: 100, message: '长度位1-100字符', trigger: 'blur'}
+                    {required: true, message: '请输入广告计划名称'},
+                    {min: 1, max: 100, message: '长度位1-100字符'}
                 ],
                 creativeProductDescription: [
                     {required: true, message: '请输入', trigger: 'blur'},
@@ -543,24 +564,33 @@ export default {
         };
     },
     monted() {
-        this.handleInitTable();
+        if (this.title === 'edit') {
+            // this.handleInitTable();
+        }
     },
     methods: {
         moment,
-        handleInitTable() {
-            const paramsData = {
-                accountId: this.configForm.acountId
-            };
-            getAction('/ctop/aiBytedanceAdvertiserStrategy/list', paramsData).then(result => {
-                if (result.code === 200) {
-                   console.log(result, 'result--result');
-                }
-                else {
-                    this.$message.error(result.message);
-                }
-            }).catch(error => {
-                console.log(error, 'eeee');
-            });
+        // 列表数据获取
+        // handleInitTable() {
+        //     const paramsData = {
+        //         accountId: this.configForm.acountId
+        //     };
+        //     getAction('/ctop/aiBytedanceAdvertiserStrategy/list', paramsData).then(result => {
+        //         if (result.code === 200) {
+        //            console.log(result, 'result--result');
+        //         }
+        //         else {
+        //             this.$message.error(result.message);
+        //         }
+        //     }).catch(error => {
+        //         console.log(error, 'eeee');
+        //     });
+        // },
+        handleGetChangeAll(item, field) {
+            let node = document.getElementById(field);
+            this.configForm.adName += '-{{' + item + '}}-';
+            node.focus();
+            node.blur();
         },
         handleLaunchData(date, dateString) {
             this.configForm.launchDateRange = dateString;
@@ -607,7 +637,7 @@ export default {
             reader.readAsDataURL(img);
         },
         beforeUpload(info) {
-            this.cosUpload(info);
+            this.handleMd5(info);
         },
         handleChange(info) {
             this.getBase64(info.file.originFileObj, imageUrl => {
@@ -658,38 +688,33 @@ export default {
                         status: 'done',
                         url: '//' + data.Location
                     });
+                    that.urlResult = '//' + data.Location;
                     console.log(that.fileList, 'fileListfileList--fileList');
-                    // that.handleMd5(file);
                 }
             );
         },
-        // handleMd5(file) {
-        //     let bmf = new BMF();
-        //     let that = this;
-        //     return new Promise(function (resolve, reject) {
-        //         bmf.md5(file, (err, md5) => {
-        //             console.log();
-        //             // getAction('/kuaishouCrowdPack/checkCrowdPackage', {signature: md5}).then(result => {
-        //             //     if (result.code === 200) {
-        //             //         that.personNameDisabled = false;
-        //             //         that.personResourceDisabled = false;
-        //             //         resolve();
-        //             //     }
-        //             //     else if (result.code === 201) {
-        //             //         that.$message.error(result.message);
-        //             //         that.personForm.name = result.result.orientationName;
-        //             //         that.personForm.resource = result.result.type;
-        //             //         that.personNameDisabled = true;
-        //             //         that.personResourceDisabled = true;
-        //             //         reject();
-        //             //     }
-        //             // }).catch(error => {
-        //             //     console.log(error, 'eeee');
-        //             //     reject();
-        //             // });
-        //         });
-        //     });
-        // },
+        handleMd5(file) {
+            let bmf = new BMF();
+            let that = this;
+            return new Promise(function (resolve, reject) {
+                bmf.md5(file, (err, md5) => {
+                    that.md5Result = md5;
+                    getAction('/file/imageCheck', {code: md5}).then(result => {
+                        if (result.code === -206) {
+                            that.cosUpload(file);
+                            resolve();
+                        }
+                        else {
+                            that.urlResult = result.url;
+                            // reject();
+                        }
+                    }).catch(error => {
+                        console.log(error, 'eeee');
+                        reject();
+                    });
+                });
+            });
+        },
         handleRelaxSure() {
             let paramsFormData = this.configForm;
             console.log(this.configForm.defaultFormList, 'defaultFormList-defaultFormList-defaultFormList');
@@ -722,20 +747,21 @@ export default {
             else if (paramsFormData.launchTimeInterval === 'a') {
                 paramsFormData.adScheduleTime = paramsFormData.scheduleTimeData;
             }
-            paramsFormData.creativeProductImageId = '图片ID';
             paramsFormData.creativeProductSellingPoints = this.configForm.defaultFormList;
+            paramsFormData.creativeProductImageCode = this.md5Result;
+            paramsFormData.imageUrl = this.urlResult;
             console.log(paramsFormData, 'paramsFormData-paramsFormData');
             console.log(paramsFormData.launchDateRange, 'paramsFormData.launchDateRange');
             this.$refs.ruleForm.validate(valid => {
                 if (valid) {
                     alert('submit!Object.assign(this.$data, this.$options.data());');
+                    // this.$emit('relaxSure', paramsData);
                 }
                 else {
                     console.log('error submit!!');
                     return false;
                 }
             });
-            // this.$emit('relaxSure', paramsData);
         },
         handleRelaxCancel() {
             this.$emit('relaxCancel');

+ 1 - 1
src/views/modules/crowd-control/crowd-control.vue

@@ -389,7 +389,7 @@ export default {
             });
         },
         handleDelete(data) {
-            let that = this
+            let that = this;
             this.$confirm({
                 title: '删除提示',
                 content: '确定要删除这一条吗?',

+ 9 - 0
vue.config.js

@@ -67,6 +67,14 @@ module.exports = {
     port: 3000,
     open : true,
     proxy: {
+      '/jeecg-boot/ctop': {
+        target: 'http://192.168.1.43:8080', // 子安
+        ws: false,
+      },
+      '/jeecg-boot/file/': {
+        target: 'http://192.168.1.43:8080/', // 子安
+        ws: false,
+      },
       '/jeecg-boot': {
           // target: 'http://192.168.1.8:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
           // target: 'http://192.168.1.3:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
@@ -86,6 +94,7 @@ module.exports = {
         //  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://139.186.165.84:8806', //测试
 
         ws: false,