|
@@ -7,23 +7,29 @@
|
|
|
:form="form"
|
|
|
hide-required-mark
|
|
|
>
|
|
|
- <a-row class="grid-form-options">
|
|
|
+ <a-row>
|
|
|
<a-form-item
|
|
|
v-if="controlTypeModel === '1'"
|
|
|
class="grid-form-item"
|
|
|
label="账户:"
|
|
|
:colon="false"
|
|
|
>
|
|
|
- <acount-search class="acount-search-class" :appId.sync="configForm.acountId" :multiple="false" request="1,3"></acount-search>
|
|
|
+ <acount-search
|
|
|
+ class="acount-search-class"
|
|
|
+ :appId.sync="configForm.acountId"
|
|
|
+ :multiple="false"
|
|
|
+ request="1,3"
|
|
|
+ >
|
|
|
+ </acount-search>
|
|
|
</a-form-item>
|
|
|
<a-form-model-item v-if="controlTypeModel === '2'" label="项目:">
|
|
|
<a-select
|
|
|
class="common-input-long"
|
|
|
show-search
|
|
|
v-model="configForm.adConvertId"
|
|
|
- placeholder="请选择"
|
|
|
:filter-option="filterOption"
|
|
|
allowClear
|
|
|
+ placeholder="请选择项目"
|
|
|
>
|
|
|
<a-select-option
|
|
|
v-for="(item, index) in optimizationOption"
|
|
@@ -34,6 +40,8 @@
|
|
|
</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
+ </a-row>
|
|
|
+ <a-row class="grid-form-options">
|
|
|
<a-form-item
|
|
|
class="grid-form-item"
|
|
|
label="关键词:"
|
|
@@ -49,18 +57,26 @@
|
|
|
<a-range-picker
|
|
|
v-model="configForm.launchDateRange"
|
|
|
format="YYYY-MM-DD"
|
|
|
+ :disabled-date="disabledDate"
|
|
|
@change="handleLaunchData"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
+ <a-form-item v-show="configForm.acountId || configForm.adConvertId" label="状态">
|
|
|
+ <a-select v-model="configForm.searchStatus" style="width: 100px">
|
|
|
+ <a-select-option :value="2">不限</a-select-option>
|
|
|
+ <a-select-option :value="0">已删除</a-select-option>
|
|
|
+ <a-select-option :value="1">可投放</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
<a-form-item class="form-handle-btn">
|
|
|
<a-button type="default" class="reset-class" @click="handleResetList">重置</a-button>
|
|
|
<a-button type="primary" @click="handleQueryList">查询</a-button>
|
|
|
</a-form-item>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
- <a-button type="primary" class="upload-person" @click="handleAddAccountConfig">新增文案</a-button>
|
|
|
</div>
|
|
|
<div class="control-con-table">
|
|
|
+ <a-button type="primary" class="upload-person" @click="handleAddAccountConfig">新增文案</a-button>
|
|
|
<a-tabs v-model="controlTypeModel" @change="handleTabsChange">
|
|
|
<a-tab-pane key="1" tab="通用">
|
|
|
<a-table
|
|
@@ -72,6 +88,11 @@
|
|
|
:pagination="false"
|
|
|
:scroll="{x: 1500}"
|
|
|
>
|
|
|
+ <span slot="currencyAction" slot-scope="text, record">
|
|
|
+ <a :disabled="record.status === '已删除'" @click="handleCurrencyEdit(record)">编辑</a>
|
|
|
+ <a-divider type="vertical"/>
|
|
|
+ <a :disabled="record.status === '已删除'" @click="handleCurrencyDelete(record)">删除</a>
|
|
|
+ </span>
|
|
|
</a-table>
|
|
|
<a-pagination
|
|
|
class="pagin-table-class"
|
|
@@ -96,6 +117,11 @@
|
|
|
:pagination="false"
|
|
|
:scroll="{x: 1500}"
|
|
|
>
|
|
|
+ <span slot="appointAction" slot-scope="text, record">
|
|
|
+ <a :disabled="record.status === '已删除'" @click="handleCurrencyEdit(record)">编辑</a>
|
|
|
+ <a-divider type="vertical"/>
|
|
|
+ <a :disabled="record.status === '已删除'" @click="handleAppointDelete(record)">删除</a>
|
|
|
+ </span>
|
|
|
</a-table>
|
|
|
<a-pagination
|
|
|
class="pagin-table-class"
|
|
@@ -114,7 +140,7 @@
|
|
|
</div>
|
|
|
<a-modal
|
|
|
v-if="causeVisible"
|
|
|
- title="新建文案"
|
|
|
+ :title="copywritingType === 'add' ? '新建文案' : '编辑文案'"
|
|
|
dialog-class="copywrit-modal"
|
|
|
:visible="causeVisible"
|
|
|
@ok="handleCauseSure"
|
|
@@ -126,12 +152,8 @@
|
|
|
<div class="acount-title-right">
|
|
|
<div class="only-title-mater">
|
|
|
<a-radio-group v-model="copywrittypeName" button-style="solid" @change="handleFormLayoutChange">
|
|
|
- <a-radio-button value="horizontal">
|
|
|
- 通用
|
|
|
- </a-radio-button>
|
|
|
- <a-radio-button value="vertical">
|
|
|
- 指定素材
|
|
|
- </a-radio-button>
|
|
|
+ <a-radio-button value="horizontal" :disabled="copywritingEditList.controlTypeModel === '2'">通用</a-radio-button>
|
|
|
+ <a-radio-button value="vertical" :disabled="copywritingEditList.controlTypeModel === '1'">指定素材</a-radio-button>
|
|
|
</a-radio-group>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -140,19 +162,19 @@
|
|
|
<div class="acount-title-left">广告账户</div>
|
|
|
<div class="acount-title-right">
|
|
|
<div class="only-title-mater">
|
|
|
- <acount-search :appId.sync="advertisingAccount" request="1,3"></acount-search>
|
|
|
+ <acount-search :appId.sync="advertisingAccount" request="1,3" :disabled="copywritingType === 'edit'"></acount-search>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="copywrittypeName === 'horizontal'" class="acount-title">
|
|
|
+ <div v-if="copywrittypeName === 'horizontal' && copywritingType === 'add'" class="acount-title">
|
|
|
<div class="acount-title-left">文件上传</div>
|
|
|
<div class="acount-title-right">
|
|
|
<div class="only-title-mater">
|
|
|
<a-upload
|
|
|
name="file"
|
|
|
- action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
|
|
:file-list="fileList"
|
|
|
- @change="handleChange"
|
|
|
+ :customRequest="handleCustomRequest"
|
|
|
+ :remove="handleRemoveUpload"
|
|
|
>
|
|
|
<a-button><a-icon type="upload"/>文件上传</a-button>
|
|
|
</a-upload>
|
|
@@ -163,7 +185,7 @@
|
|
|
<div class="acount-title-left">选择素材</div>
|
|
|
<div class="acount-title-right">
|
|
|
<div class="only-title-mater">
|
|
|
- <div><a @click="handleSelectMaterial">选择素材</a></div>
|
|
|
+ <div v-if="copywritingType === 'add'"><a @click="handleSelectMaterial">选择素材</a></div>
|
|
|
<div class="title-mater-list">
|
|
|
<p
|
|
|
class="mater-list-name"
|
|
@@ -171,20 +193,21 @@
|
|
|
:key="item.id"
|
|
|
>
|
|
|
<span class="mater-list-show">{{ item.materialName }}</span>
|
|
|
- <span class="mater-list-icon" @click="handleDelAlone(item)"><a-icon type="close"/></span>
|
|
|
+ <span class="mater-list-show">123</span>
|
|
|
+ <span v-if="copywritingType === 'add'" class="mater-list-icon" @click="handleDelAlone(item)"><a-icon type="close"/></span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="copywrittypeName === 'vertical'" class="acount-title push-plate">
|
|
|
+ <div v-if="copywrittypeName === 'vertical' && copywritingType === 'add'" class="acount-title push-plate">
|
|
|
<div class="acount-title-left">创意标题</div>
|
|
|
<div class="acount-title-right">
|
|
|
<a-button type="primary" @click="handleAddOrigin"><a-icon type="plus" />创意标题</a-button>
|
|
|
<span style="margin-left: 20px;">已填:{{ titleFiledResult.length || 0 }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="copywrittypeName === 'vertical'" class="acount-title">
|
|
|
+ <div v-if="copywrittypeName === 'vertical' && copywritingType === 'add'" class="acount-title">
|
|
|
<div class="acount-title-left"></div>
|
|
|
<div class="acount-title-right">
|
|
|
<a-form :form="examinForm">
|
|
@@ -231,8 +254,69 @@
|
|
|
+ {{ 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 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>
|
|
|
+ </div>
|
|
|
+ <div v-if="copywritingType === 'edit'" class="acount-title push-plate">
|
|
|
+ <div class="acount-title-left">创意标题</div>
|
|
|
+ <div class="acount-title-right">
|
|
|
+ <a-form :form="examinForm">
|
|
|
+ <a-form-item
|
|
|
+ v-for="item in defaultFormList"
|
|
|
+ :key="item.id"
|
|
|
+ class="examin-form-model"
|
|
|
+ :label-col="labelCol"
|
|
|
+ :wrapper-col="wrapperCol"
|
|
|
+ label=""
|
|
|
+ >
|
|
|
+ <a-input
|
|
|
+ v-decorator="[
|
|
|
+ item.name,
|
|
|
+ {rules: [
|
|
|
+ {validator: validatePass, trigger: 'blur'}
|
|
|
+ ]}
|
|
|
+ ]"
|
|
|
+ class="examin-form-input"
|
|
|
+ :id="item.name"
|
|
|
+ placeholder="请输入"
|
|
|
+ @change="handleFormInputChang($event, item.name, item.id)"
|
|
|
+ />
|
|
|
+ <span class="examin-form-num">{{ item.lenSize }}/30</span>
|
|
|
+ <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>
|
|
@@ -301,7 +385,6 @@
|
|
|
</a-checkbox>
|
|
|
<img :src="item.coverUrl"/>
|
|
|
<div class="checkbox-select-time">时间:{{ item.createTime }}</div>
|
|
|
- <!-- <div class="checkbox-select-show"><a>查看视频</a></div> -->
|
|
|
</li>
|
|
|
</a-checkbox-group>
|
|
|
<a-pagination
|
|
@@ -324,17 +407,11 @@
|
|
|
<script>
|
|
|
import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
|
|
|
|
|
|
-import {getAction, postFileAction, postAction} from '@/api/manage';
|
|
|
-import {fileCheck, fileEdit, fileEditAll, fileInsertV2, fileEditUpdate, fileEditUpdateBatch} from '@/api/actor';
|
|
|
+import moment from 'moment';
|
|
|
+import {getAction, postFileAction, postAction, deleteAction} from '@/api/manage';
|
|
|
import {mapGetters} from 'vuex';
|
|
|
import {urlAcount} from './copy-library-server.js';
|
|
|
|
|
|
-let COS = require('cos-js-sdk-v5');
|
|
|
-let cos = new COS({
|
|
|
- SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
|
|
|
- SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9'
|
|
|
-});
|
|
|
-
|
|
|
export default {
|
|
|
name: 'copy-library',
|
|
|
components: {
|
|
@@ -342,6 +419,9 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ moment,
|
|
|
+ copywritingEditList: {},
|
|
|
+ copywritingType: 'add',
|
|
|
projectModelValue: '',
|
|
|
optimizationOption: [], // 账户option
|
|
|
controlTypeModel: '1',
|
|
@@ -349,43 +429,7 @@ export default {
|
|
|
modalSelectMaterial: [],
|
|
|
materTotalAll: 0,
|
|
|
viedoCheckValue: [],
|
|
|
- viedoDefaultList: [
|
|
|
- {
|
|
|
- name: '北京市',
|
|
|
- id: 1,
|
|
|
- statDate: '2019-08-08'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '上海市',
|
|
|
- id: 2,
|
|
|
- statDate: '2019-08-08'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '天津市',
|
|
|
- id: 3,
|
|
|
- statDate: '2019-08-08'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '武汉市',
|
|
|
- id: 4,
|
|
|
- statDate: '2019-08-08'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '贵州市',
|
|
|
- id: 5,
|
|
|
- statDate: '2019-08-08'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '太原市',
|
|
|
- id: 6,
|
|
|
- statDate: '2019-08-08'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '大同市',
|
|
|
- id: 7,
|
|
|
- statDate: '2019-08-08'
|
|
|
- }
|
|
|
- ],
|
|
|
+ viedoDefaultList: [],
|
|
|
visibleMatemal: false,
|
|
|
advertisingAccount: [],
|
|
|
copywrittypeName: 'horizontal',
|
|
@@ -408,8 +452,9 @@ export default {
|
|
|
configForm: {
|
|
|
acountId: '',
|
|
|
num: '',
|
|
|
- adConvertId: '',
|
|
|
- launchDateRange: []
|
|
|
+ adConvertId: undefined,
|
|
|
+ launchDateRange: [],
|
|
|
+ searchStatus: 2
|
|
|
},
|
|
|
currencyPag: {
|
|
|
page: 1,
|
|
@@ -424,6 +469,12 @@ export default {
|
|
|
width: 200,
|
|
|
dataIndex: 'textCopywriter'
|
|
|
},
|
|
|
+ // {
|
|
|
+ // title: '状态',
|
|
|
+ // align: 'center',
|
|
|
+ // width: 150,
|
|
|
+ // dataIndex: 'status'
|
|
|
+ // },
|
|
|
{
|
|
|
title: '相关创意',
|
|
|
align: 'center',
|
|
@@ -501,6 +552,12 @@ export default {
|
|
|
width: 200,
|
|
|
dataIndex: 'slogan'
|
|
|
},
|
|
|
+ // {
|
|
|
+ // title: '状态',
|
|
|
+ // align: 'center',
|
|
|
+ // width: 150,
|
|
|
+ // dataIndex: 'status'
|
|
|
+ // },
|
|
|
{
|
|
|
title: '相关创意',
|
|
|
align: 'center',
|
|
@@ -580,10 +637,11 @@ export default {
|
|
|
masterPag: {
|
|
|
page: 1,
|
|
|
size: 10
|
|
|
- },
|
|
|
+ },
|
|
|
defaultFormList: [],
|
|
|
titleFiledResult: 0,
|
|
|
examinForm: this.$form.createForm(this),
|
|
|
+ changeShowmasterData: [],
|
|
|
masterTimes: [] // 选择素材的时间选择
|
|
|
};
|
|
|
},
|
|
@@ -615,6 +673,135 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
+ handleGetEditProjectList(data) {
|
|
|
+ const paramsData = {
|
|
|
+ slogan: data.slogan,
|
|
|
+ projectId: data.projectId
|
|
|
+ };
|
|
|
+ getAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/queryBySlogenAndProjectId', paramsData).then(result => {
|
|
|
+ if (result.code === 0) {
|
|
|
+ const defaultData = result.result.materialNameArray;
|
|
|
+ const updateData = [];
|
|
|
+ defaultData.forEach((item, index) => {
|
|
|
+ updateData.push({
|
|
|
+ id: index + 1,
|
|
|
+ materialName: item
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.modalSelectMaterial = [...updateData];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ that.$message.error(result.message);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error, 'eeee');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCurrencyEdit(data) {
|
|
|
+ const defaultData = data;
|
|
|
+ defaultData.controlTypeModel = this.controlTypeModel;
|
|
|
+ if (this.controlTypeModel === '1') {
|
|
|
+ this.advertisingAccount[0] = defaultData.accountId;
|
|
|
+ }
|
|
|
+ if (this.controlTypeModel === '2') {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.handleGetEditProjectList(defaultData);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.causeVisible = true;
|
|
|
+ this.copywritingType = 'edit';
|
|
|
+ this.copywrittypeName = this.controlTypeModel === '1' ? 'horizontal' : 'vertical';
|
|
|
+ this.copywritingEditList = defaultData;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let changeValue = this.controlTypeModel === '1' ? data.textCopywriter : data.slogan;
|
|
|
+ let finallyLenList = this.handleJudgeExec(changeValue);
|
|
|
+ let newOptionList = [];
|
|
|
+ finallyLenList.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ newOptionList.push(val);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let resultSelectSize = 0;
|
|
|
+ if (newOptionList.length) {
|
|
|
+ const inputDefaultLen = this.handleExportRules(changeValue);
|
|
|
+ let tagsLen = newOptionList.length * 2;
|
|
|
+ let tagsSureLen = 0;
|
|
|
+ newOptionList.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item.name === val.name) {
|
|
|
+ tagsSureLen += val.maxWordLen;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ finallyLenList.forEach(item => {
|
|
|
+ tagsLen += item.length;
|
|
|
+ });
|
|
|
+ resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + newOptionList.length;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ resultSelectSize = this.handleExportRules(changeValue);
|
|
|
+ }
|
|
|
+ const defaultList = this.adNameTags;
|
|
|
+ const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
|
|
|
+ this.defaultFormList.push({
|
|
|
+ id: randomNum,
|
|
|
+ name: 'username' + randomNum,
|
|
|
+ value: changeValue,
|
|
|
+ lenSize: resultSelectSize,
|
|
|
+ tabStatus: 'alone',
|
|
|
+ defaultTagsList: defaultList,
|
|
|
+ updateTagsList: defaultList.slice(0, 4)
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCurrencyDelete(data) {
|
|
|
+ let that = this;
|
|
|
+ this.$confirm({
|
|
|
+ content: '确定是否删除该条文案',
|
|
|
+ iconType: 'exclamation-circle',
|
|
|
+ onOk() {
|
|
|
+ deleteAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/delete', {id: data.id}).then(result => {
|
|
|
+ if (result.code === 0) {
|
|
|
+ that.handleGetCurrencyList();
|
|
|
+ that.$message.success('删除成功');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ that.$message.error(result.message);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error, 'eeee');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleAppointDelete(data) {
|
|
|
+ let that = this;
|
|
|
+ this.$confirm({
|
|
|
+ content: '确定是否删除该条文案',
|
|
|
+ iconType: 'exclamation-circle',
|
|
|
+ onOk() {
|
|
|
+ deleteAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/deleteBySlogenAndProjectId', {
|
|
|
+ slogan: data.slogan,
|
|
|
+ projectId: data.projectId
|
|
|
+ }).then(result => {
|
|
|
+ if (result.code === 0) {
|
|
|
+ that.handleGetAppointList();
|
|
|
+ that.$message.success('删除成功');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ that.$message.error(result.message);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error, 'eeee');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ disabledDate(current) {
|
|
|
+ return current > moment().subtract(1, 'day');
|
|
|
+ },
|
|
|
handleRefreshMaster() {
|
|
|
this.projectModelValue = '';
|
|
|
this.masterTimes = [];
|
|
@@ -646,6 +833,7 @@ export default {
|
|
|
projectId: this.projectModelValue,
|
|
|
startDate: this.masterTimes[0],
|
|
|
endDate: this.masterTimes[1],
|
|
|
+ offlineFlag: 0,
|
|
|
pageNo: this.masterPag.page,
|
|
|
pageSize: this.masterPag.size
|
|
|
};
|
|
@@ -671,9 +859,18 @@ export default {
|
|
|
this.configForm = {
|
|
|
acountId: '',
|
|
|
num: '',
|
|
|
- adConvertId: '',
|
|
|
- launchDateRange: []
|
|
|
+ adConvertId: undefined,
|
|
|
+ launchDateRange: [],
|
|
|
+ searchStatus: 2
|
|
|
};
|
|
|
+ if (this.currencyColumns[this.currencyColumns.length - 1].title === '操作') {
|
|
|
+ this.currencyColumns.pop();
|
|
|
+ this.currencyColumns.splice(1, 1);
|
|
|
+ }
|
|
|
+ if (this.appointColumns[this.appointColumns.length - 1].title === '操作') {
|
|
|
+ this.appointColumns.pop();
|
|
|
+ this.appointColumns.splice(1, 1);
|
|
|
+ }
|
|
|
if (e === '1') {
|
|
|
this.handleGetCurrencyList();
|
|
|
}
|
|
@@ -688,13 +885,17 @@ export default {
|
|
|
userId: this.userInfo().id,
|
|
|
startTime: this.configForm.launchDateRange[0],
|
|
|
endTime: this.configForm.launchDateRange[0],
|
|
|
+ status: this.configForm.searchStatus === 2 ? '' : this.configForm.searchStatus,
|
|
|
pageNo: this.currencyPag.page,
|
|
|
pageSize: this.currencyPag.size
|
|
|
};
|
|
|
getAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/queryPageListByText', paramsData).then(result => {
|
|
|
if (result.code === 0) {
|
|
|
- this.currencyData = result.result.list;
|
|
|
- this.currencyTotalAll = result.result.total;
|
|
|
+ this.currencyData = result.result.list ? result.result.list.map(item => {
|
|
|
+ item.status = item.status === 0 ? '已删除' : '可投放';
|
|
|
+ return item;
|
|
|
+ }) : [];
|
|
|
+ this.currencyTotalAll = result.result.total || 0;
|
|
|
}
|
|
|
else {
|
|
|
this.currencyData = [];
|
|
@@ -712,30 +913,43 @@ export default {
|
|
|
keyWord: this.configForm.num,
|
|
|
startTime: this.configForm.launchDateRange[0],
|
|
|
endTime: this.configForm.launchDateRange[0],
|
|
|
+ status: this.configForm.searchStatus === 2 ? '' : this.configForm.searchStatus,
|
|
|
pageNo: this.appointPag.page,
|
|
|
pageSize: this.appointPag.size
|
|
|
};
|
|
|
getAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/queryPageListByText', paramsData).then(result => {
|
|
|
if (result.code === 0) {
|
|
|
- this.appointData = result.result.list;
|
|
|
- this.appointTotalAll = result.result.total;
|
|
|
+ this.appointData = result.result.list ? result.result.list.map(item => {
|
|
|
+ item.status = item.status === 0 ? '已删除' : '可投放';
|
|
|
+ return item;
|
|
|
+ }) : [];
|
|
|
+ this.appointTotalAll = result.result.total || 0;
|
|
|
}
|
|
|
else {
|
|
|
this.appointData = [];
|
|
|
- this.appointTotalAll = [];
|
|
|
+ this.appointTotalAll = 0;
|
|
|
this.$message.error(result.message);
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
console.log(error, 'eeee');
|
|
|
});
|
|
|
},
|
|
|
- handleChange(info) {
|
|
|
+ handleCustomRequest(info) {
|
|
|
const isZip = info.file.name.indexOf('xlsx') !== -1 || info.file.name.indexOf('xls') !== -1;
|
|
|
if (!isZip) {
|
|
|
this.$message.error('上传模板只能是 xls、xlsx格式!');
|
|
|
return;
|
|
|
}
|
|
|
- this.fileList = info.fileList;
|
|
|
+ this.fileList = [];
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.fileList.push(info.file);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleRemoveUpload(data) {
|
|
|
+ let index = this.fileList.indexOf(data);
|
|
|
+ let newUploadFile = this.fileList;
|
|
|
+ newUploadFile.splice(index, 1);
|
|
|
+ this.fileList = newUploadFile;
|
|
|
},
|
|
|
handleSearchMaster() {
|
|
|
this.hendleMaterialInfo();
|
|
@@ -754,7 +968,11 @@ export default {
|
|
|
this.hendleMaterialInfo();
|
|
|
},
|
|
|
handleSelectMaterial() {
|
|
|
- this.hendleMaterialInfo();
|
|
|
+ this.masterPag = {
|
|
|
+ page: 1,
|
|
|
+ size: 10
|
|
|
+ };
|
|
|
+ this.handleRefreshMaster();
|
|
|
this.visibleMatemal = true;
|
|
|
},
|
|
|
// 选择素材的取消按钮
|
|
@@ -768,18 +986,35 @@ export default {
|
|
|
handleOkShow() {
|
|
|
const defaultList = this.viedoDefaultList;
|
|
|
const defaultCheckValue = this.viedoCheckValue;
|
|
|
- let finallyIds = new Set();
|
|
|
let changeSelectMaterData = defaultList.filter(item => {
|
|
|
if (defaultCheckValue.includes(item.id)) {
|
|
|
return item;
|
|
|
}
|
|
|
});
|
|
|
- finallyIds = this.modalSelectMaterial.concat(changeSelectMaterData).map(item => item.id);
|
|
|
- this.modalSelectMaterial = defaultList.filter(item => {
|
|
|
- if (finallyIds.includes(item.id)) {
|
|
|
- return item;
|
|
|
+ if (this.modalSelectMaterial.length) {
|
|
|
+ this.changeShowmasterData = [...this.modalSelectMaterial];
|
|
|
+ this.changeShowmasterData = this.changeShowmasterData.concat(changeSelectMaterData);
|
|
|
+ let temp = {}; // 用于id判断
|
|
|
+ let result = []; // 最后的新数组
|
|
|
+ this.changeShowmasterData.map(item => {
|
|
|
+ if (!temp[item.id]) {
|
|
|
+ result.push(item);
|
|
|
+ temp[item.id] = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (result.length > 10) {
|
|
|
+ this.$message.error('最多上传10个素材');
|
|
|
+ return;
|
|
|
}
|
|
|
- });
|
|
|
+ this.modalSelectMaterial = [...result];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (changeSelectMaterData.length > 10) {
|
|
|
+ this.$message.error('最多上传10个素材');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.modalSelectMaterial = [...changeSelectMaterData];
|
|
|
+ }
|
|
|
this.handleCancelAll();
|
|
|
},
|
|
|
handleFormLayoutChange(e) {
|
|
@@ -836,16 +1071,24 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
const dynamicWordPackIds = [];
|
|
|
let finallyLenList = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
|
|
|
- let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
|
|
|
+ let newOptionList = [];
|
|
|
+ finallyLenList.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ newOptionList.push(val);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let updateFinallyResult = newOptionList.map(val => val.name);
|
|
|
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 => {
|
|
|
- updateFinallyResult.forEach(val => {
|
|
|
- if (item.name === val) {
|
|
|
- tagsSureLen += item.maxWordLen;
|
|
|
- dynamicWordPackIds.push(item.creativeWordId);
|
|
|
+ updateFinallyResult.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ tagsSureLen += val.maxWordLen;
|
|
|
+ dynamicWordPackIds.push(val.creativeWordId);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -879,7 +1122,15 @@ export default {
|
|
|
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);
|
|
|
+ let arr = [];
|
|
|
+ finallyLenList.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ arr.push(val);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let updateFinallyResult = arr.map(val => val.name);
|
|
|
if (updateFinallyResult.length >= 2) {
|
|
|
this.$message.error('最多选择两个词包');
|
|
|
return;
|
|
@@ -899,16 +1150,24 @@ export default {
|
|
|
this.$nextTick(() => {
|
|
|
const dynamicWordPackIds = [];
|
|
|
let changeData = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
|
|
|
- let updateChangeData = this.adNameTags.filter(item => changeData.includes(item.name)).map(val => val.name);
|
|
|
+ let newOptionList = [];
|
|
|
+ changeData.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ newOptionList.push(val);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let updateChangeData = newOptionList.map(val => val.name);
|
|
|
const inputDefaultLen = this.handleExportRules(this.examinForm.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 => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ tagsSureLen += val.maxWordLen;
|
|
|
+ dynamicWordPackIds.push(val.creativeWordId);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -928,16 +1187,24 @@ export default {
|
|
|
validatePass(rule, value, callback) {
|
|
|
this.$nextTick(() => {
|
|
|
let finallyLenList = this.handleJudgeExec(value);
|
|
|
- let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
|
|
|
+ let newOptionList = [];
|
|
|
+ finallyLenList.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ newOptionList.push(val);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let updateFinallyResult = newOptionList.map(val => val.name);
|
|
|
let resultSelectSize = 0;
|
|
|
if (updateFinallyResult.length) {
|
|
|
- const inputDefaultLen = this.handleExportRules(value.length);
|
|
|
+ const inputDefaultLen = this.handleExportRules(value);
|
|
|
let tagsLen = updateFinallyResult.length * 2;
|
|
|
let tagsSureLen = 0;
|
|
|
- this.adNameTags.forEach(item => {
|
|
|
- updateFinallyResult.forEach(val => {
|
|
|
- if (item.name === val) {
|
|
|
- tagsSureLen += item.maxWordLen;
|
|
|
+ updateFinallyResult.forEach(item => {
|
|
|
+ this.adNameTags.forEach(val => {
|
|
|
+ if (item === val.name) {
|
|
|
+ tagsSureLen += val.maxWordLen;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -947,7 +1214,7 @@ export default {
|
|
|
resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen + updateFinallyResult.length;
|
|
|
}
|
|
|
else {
|
|
|
- resultSelectSize = this.handleExportRules(value.length);
|
|
|
+ resultSelectSize = this.handleExportRules(value);
|
|
|
}
|
|
|
if (resultSelectSize === 0) {
|
|
|
callback(new Error('请输入'));
|
|
@@ -979,7 +1246,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- handleUploadWxecl() {
|
|
|
+ handleUploadWxeclAdd() {
|
|
|
if (!this.advertisingAccount.length) {
|
|
|
this.$message.error('请选择账户');
|
|
|
return;
|
|
@@ -988,9 +1255,9 @@ export default {
|
|
|
this.$message.error('请上传文件');
|
|
|
return;
|
|
|
}
|
|
|
- let paramsData = new FormData()
|
|
|
+ let paramsData = new FormData();
|
|
|
paramsData.append('accountId', this.advertisingAccount);
|
|
|
- paramsData.append('excelFile', this.fileList[0].originFileObj);
|
|
|
+ paramsData.append('excelFile', this.fileList[0]);
|
|
|
postFileAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/loadExcel', paramsData, {
|
|
|
headers: {
|
|
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1033,9 +1300,10 @@ export default {
|
|
|
postAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/addList', paramsData).then(result => {
|
|
|
if (result.code === 0) {
|
|
|
this.$message.success(result.message);
|
|
|
- this.controlTypeModel = '1';
|
|
|
+ this.controlTypeModel = '2';
|
|
|
+ this.modalSelectMaterial = [];
|
|
|
this.handleCauseCancel();
|
|
|
- this.handleGetCurrencyList();
|
|
|
+ this.handleGetAppointList();
|
|
|
}
|
|
|
else {
|
|
|
this.$message.error(result.message);
|
|
@@ -1046,12 +1314,71 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ handleUploadWxeclEdit() {
|
|
|
+ if (!this.defaultFormList[0].value) {
|
|
|
+ this.$message.error('文案标题不能为空');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const paramsData = {
|
|
|
+ id: this.copywritingEditList.id,
|
|
|
+ textCopywriter: this.defaultFormList[0].value
|
|
|
+ };
|
|
|
+ postAction(urlAcount + '/bytedance-api/advertiser/bytedanceGeneralCopywriter/edit', paramsData).then(result => {
|
|
|
+ if (result.code === 0) {
|
|
|
+ this.$message.success(result.message);
|
|
|
+ this.causeVisible = false;
|
|
|
+ this.controlTypeModel = '1';
|
|
|
+ this.handleCauseCancel();
|
|
|
+ this.handleGetCurrencyList();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.$message.success(result.message);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error, 'eeee');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleVerticalEdit() {
|
|
|
+ if (!this.defaultFormList[0].value) {
|
|
|
+ this.$message.error('文案标题不能为空');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const paramsData = {
|
|
|
+ slogan: this.copywritingEditList.slogan,
|
|
|
+ projectId: this.copywritingEditList.projectId,
|
|
|
+ newSlogan: this.defaultFormList[0].value
|
|
|
+ };
|
|
|
+ postAction(urlAcount + '/bytedance-api/ctop/bytedanceVideoSlogenInfo/edit', paramsData).then(result => {
|
|
|
+ if (result.code === 0) {
|
|
|
+ this.$message.success(result.message);
|
|
|
+ this.causeVisible = false;
|
|
|
+ this.controlTypeModel = '2';
|
|
|
+ this.handleCauseCancel();
|
|
|
+ this.handleGetAppointList();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.$message.success(result.message);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error, 'eeee');
|
|
|
+ });
|
|
|
+ },
|
|
|
handleCauseSure() {
|
|
|
- if (this.copywrittypeName === 'horizontal') {
|
|
|
- this.handleUploadWxecl();
|
|
|
+ if (this.copywritingType === 'add') {
|
|
|
+ if (this.copywrittypeName === 'horizontal') {
|
|
|
+ this.handleUploadWxeclAdd();
|
|
|
+ }
|
|
|
+ else if (this.copywrittypeName === 'vertical') {
|
|
|
+ this.handleVerticalAdd();
|
|
|
+ }
|
|
|
}
|
|
|
- else if (this.copywrittypeName === 'vertical') {
|
|
|
- this.handleVerticalAdd();
|
|
|
+ else if (this.copywritingType === 'edit') {
|
|
|
+ if (this.copywrittypeName === 'horizontal') {
|
|
|
+ this.handleUploadWxeclEdit();
|
|
|
+ }
|
|
|
+ else if (this.copywrittypeName === 'vertical') {
|
|
|
+ this.handleVerticalEdit();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
handleCauseCancel() {
|
|
@@ -1061,6 +1388,7 @@ export default {
|
|
|
this.causeVisible = false;
|
|
|
this.defaultFormList = [];
|
|
|
this.modalSelectMaterial = [];
|
|
|
+ this.copywritingType = '';
|
|
|
},
|
|
|
handleGetCreativeWord() {
|
|
|
getAction('/ctop/ByteDanceCreativeWordPackage/list').then(result => {
|
|
@@ -1092,6 +1420,8 @@ export default {
|
|
|
},
|
|
|
handleAddAccountConfig() {
|
|
|
this.causeVisible = true;
|
|
|
+ this.copywritingType = 'add';
|
|
|
+ this.copywritingEditList = {};
|
|
|
},
|
|
|
handleLaunchData(date, dateString) {
|
|
|
this.configForm.launchDateRange = dateString;
|
|
@@ -1103,6 +1433,42 @@ export default {
|
|
|
};
|
|
|
this.currencyPag = page;
|
|
|
this.appointPag = page;
|
|
|
+ if (this.configForm.acountId) {
|
|
|
+ if (this.currencyColumns[this.currencyColumns.length - 1].title !== '操作') {
|
|
|
+ this.currencyColumns.splice(1, 0, {
|
|
|
+ title: '状态',
|
|
|
+ align: 'center',
|
|
|
+ width: 150,
|
|
|
+ dataIndex: 'status'
|
|
|
+ });
|
|
|
+ this.currencyColumns.push({
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'currencyAction',
|
|
|
+ align: 'center',
|
|
|
+ width: 150,
|
|
|
+ fixed: 'right',
|
|
|
+ scopedSlots: {customRender: 'currencyAction'}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.configForm.adConvertId) {
|
|
|
+ if (this.appointColumns[this.appointColumns.length - 1].title !== '操作') {
|
|
|
+ this.appointColumns.splice(1, 0, {
|
|
|
+ title: '状态',
|
|
|
+ align: 'center',
|
|
|
+ width: 150,
|
|
|
+ dataIndex: 'status'
|
|
|
+ });
|
|
|
+ this.appointColumns.push({
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'appointAction',
|
|
|
+ align: 'center',
|
|
|
+ width: 150,
|
|
|
+ fixed: 'right',
|
|
|
+ scopedSlots: {customRender: 'appointAction'}
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.controlTypeModel === '1') {
|
|
|
this.handleGetCurrencyList();
|
|
|
}
|
|
@@ -1114,8 +1480,9 @@ export default {
|
|
|
this.configForm = {
|
|
|
acountId: '',
|
|
|
num: '',
|
|
|
- adConvertId: '',
|
|
|
- launchDateRange: []
|
|
|
+ adConvertId: undefined,
|
|
|
+ launchDateRange: [],
|
|
|
+ searchStatus: 2
|
|
|
};
|
|
|
const page = {
|
|
|
page: 1,
|
|
@@ -1123,6 +1490,14 @@ export default {
|
|
|
};
|
|
|
this.currencyPag = page;
|
|
|
this.appointPag = page;
|
|
|
+ if (this.currencyColumns[this.currencyColumns.length - 1].title === '操作') {
|
|
|
+ this.currencyColumns.pop();
|
|
|
+ this.currencyColumns.splice(1, 1);
|
|
|
+ }
|
|
|
+ if (this.appointColumns[this.appointColumns.length - 1].title === '操作') {
|
|
|
+ this.appointColumns.pop();
|
|
|
+ this.appointColumns.splice(1, 1);
|
|
|
+ }
|
|
|
if (this.controlTypeModel === '1') {
|
|
|
this.handleGetCurrencyList();
|
|
|
}
|