|
@@ -6,6 +6,7 @@
|
|
|
:labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
:wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
<a-select
|
|
|
+ v-model="campaignId"
|
|
|
showSearch
|
|
|
placeholder="选择广告主模板"
|
|
|
optionFilterProp="children"
|
|
@@ -33,6 +34,7 @@
|
|
|
:labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
:wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
<a-select
|
|
|
+ v-model="userorentationId"
|
|
|
showSearch
|
|
|
placeholder="选择用户定向模板"
|
|
|
optionFilterProp="children"
|
|
@@ -42,7 +44,7 @@
|
|
|
@change="handleChange"
|
|
|
:filterOption="filterOption"
|
|
|
>
|
|
|
- <a-select-option v-for="campaign in campaignList" :key="campaign.id" :value="campaign.id">{{campaign.campaignName}}</a-select-option>
|
|
|
+ <a-select-option v-for="userorentation in userorentationList" :key="userorentation.id" :value="userorentation.id">{{userorentation.name}}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
|
|
@@ -51,6 +53,7 @@
|
|
|
:labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
:wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
<a-select
|
|
|
+ v-model="budgetId"
|
|
|
showSearch
|
|
|
placeholder="选择预算与出价模板"
|
|
|
optionFilterProp="children"
|
|
@@ -60,7 +63,7 @@
|
|
|
@change="handleChange"
|
|
|
:filterOption="filterOption"
|
|
|
>
|
|
|
- <a-select-option v-for="campaign in budgetList" :key="campaign.id" :value="campaign.id">{{campaign.name}}</a-select-option>
|
|
|
+ <a-select-option v-for="budget in budgetList" :key="budget.id" :value="budget.id">{{budget.name}}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
|
|
@@ -69,6 +72,7 @@
|
|
|
:labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
:wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
<a-select
|
|
|
+ v-model="deliverytargetId"
|
|
|
showSearch
|
|
|
placeholder="选择投放目标模板"
|
|
|
optionFilterProp="children"
|
|
@@ -78,7 +82,7 @@
|
|
|
@change="handleChange"
|
|
|
:filterOption="filterOption"
|
|
|
>
|
|
|
- <a-select-option v-for="campaign in deliverytargetList" :key="campaign.id" :value="campaign.id">{{campaign.name}}</a-select-option>
|
|
|
+ <a-select-option v-for="deliverytarget in deliverytargetList" :key="deliverytarget.id" :value="deliverytarget.id">{{deliverytarget.name}}</a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
|
|
@@ -93,6 +97,55 @@
|
|
|
</a-radio-group>
|
|
|
</a-form-item>
|
|
|
<a-form-item
|
|
|
+ label="上传视频"
|
|
|
+ :labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
+ :wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
+ <a-upload
|
|
|
+ name="multipartFile"
|
|
|
+ :multiple="true"
|
|
|
+ action="/jeecg-boot/upload/video?type=bytedance"
|
|
|
+ :headers="headers"
|
|
|
+ @change="videoChange">
|
|
|
+ <a-button><a-icon type="upload" /> 点击上传</a-button>
|
|
|
+ </a-upload>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item
|
|
|
+ label="上传封面"
|
|
|
+ :labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
+ :wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
+ <a-upload
|
|
|
+ name="multipartFile"
|
|
|
+ listType="picture-card"
|
|
|
+ class="avatar-uploader"
|
|
|
+ :showUploadList="false"
|
|
|
+ action="/jeecg-boot/upload/image?type=bytedance"
|
|
|
+ :beforeUpload="beforeUpload"
|
|
|
+ @change="imageChange"
|
|
|
+ >
|
|
|
+ <img v-if="imageUrl" :src="imageUrl" alt="上传封面" />
|
|
|
+ <div v-else>
|
|
|
+ <a-icon :type="loading ? 'loading' : 'plus'" />
|
|
|
+ <div class="上传封面">Upload</div>
|
|
|
+ </div>
|
|
|
+ </a-upload>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item
|
|
|
+ label="创意分类"
|
|
|
+ :labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
+ :wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
+ <a-input v-model="creativeText"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item
|
|
|
+ label="创意标签"
|
|
|
+ :labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
+ :wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
|
+ <a-input v-model="creativeText"></a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item
|
|
|
label="创意文案"
|
|
|
:labelCol="{lg: {span: 7}, sm: {span: 7}}"
|
|
|
:wrapperCol="{lg: {span: 15}, sm: {span: 17} }">
|
|
@@ -122,29 +175,87 @@
|
|
|
import {deleteAction, postAction, getAction} from '@/api/manage'
|
|
|
import $ from 'jquery'
|
|
|
import moment from 'moment';
|
|
|
+ function getBase64 (img, callback) {
|
|
|
+ const reader = new FileReader()
|
|
|
+ reader.addEventListener('load', () => callback(reader.result))
|
|
|
+ reader.readAsDataURL(img)
|
|
|
+ }
|
|
|
|
|
|
export default {
|
|
|
name: 'BaseForm',
|
|
|
data() {
|
|
|
return {
|
|
|
+ headers: {
|
|
|
+ authorization: 'authorization-text',
|
|
|
+ },
|
|
|
+ videoId:0,
|
|
|
+ imageId:0,
|
|
|
+ loading: false,
|
|
|
+ imageUrl: '',
|
|
|
iteratorNum:1,
|
|
|
campaignList: {},
|
|
|
deliverytargetList:{},
|
|
|
+ userorentationList:{},
|
|
|
budgetList:{},
|
|
|
creativeType:'customize',
|
|
|
creativeText:'',
|
|
|
deliveryRange:'default',
|
|
|
+ campaignId:null,
|
|
|
+ deliverytargetId:null,
|
|
|
+ budgetId:null,
|
|
|
+ userorentationId:null,
|
|
|
form: this.$form.createForm(this),
|
|
|
url: {
|
|
|
dictListUrl: 'toutiao/dictitem/list',
|
|
|
campaignTemplateListUrl:'/template/campaign/list',
|
|
|
budgetTemplateListUrl:'/template/budget/list',
|
|
|
- deliverytargetTemplateListUrl:'/template/deliverytarget/list'
|
|
|
+ deliverytargetTemplateListUrl:'/template/deliverytarget/list',
|
|
|
+ userorentationTemplateListUrl:'/template/userorentation/list',
|
|
|
+ insertUrl:'/template/advertiserplan/insert'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
moment,
|
|
|
+ videoChange(info) {
|
|
|
+ if (info.file.status !== 'uploading') {
|
|
|
+ console.log(info.file, info.fileList);
|
|
|
+ }
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ let response = info.file.response;
|
|
|
+ this.$message.success(`${info.file.name} 文件上传成功`);
|
|
|
+ videoId = response.fileInfo.id;
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ this.$message.error(`${info.file.name} file upload failed.`);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ imageChange (info) {
|
|
|
+ if (info.file.status === 'uploading') {
|
|
|
+ this.loading = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ console.log(info);
|
|
|
+ let response = info.file.response;
|
|
|
+ if(response.success){
|
|
|
+ this.$message.success(`${info.file.name} 文件上传成功`);
|
|
|
+ this.imageUrl = response.fileInfo.fileUrl;
|
|
|
+ videoId = response.fileInfo.id;
|
|
|
+ }
|
|
|
+ // Get this url from response in real world.
|
|
|
+ // getBase64(info.file.originFileObj, (imageUrl) => {
|
|
|
+ // this.imageUrl = imageUrl
|
|
|
+ // this.loading = false
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeUpload (file) {
|
|
|
+ const isJPG = file.type === 'image/jpeg'
|
|
|
+ if (!isJPG) {
|
|
|
+ this.$message.error('请上传图片文件!')
|
|
|
+ }
|
|
|
+ return isJPG;
|
|
|
+ },
|
|
|
handleChange (value) {
|
|
|
console.log(`selected ${value}`);
|
|
|
},
|
|
@@ -164,19 +275,16 @@
|
|
|
console.log('Received values of form: ', values);
|
|
|
|
|
|
let params = {};
|
|
|
- this.dateQuantumRange = $("#table_time_selected1_time_num").val();
|
|
|
- params.bidType = this.bidType;
|
|
|
- params.flowControlMode = this.flowControlMode;
|
|
|
- params.budgetPrice = this.budgetPrice;
|
|
|
- params.budgetPriceMode = this.budgetPriceMode;
|
|
|
- params.flowDateType = this.flowDateType;
|
|
|
- params.startDate = this.startDate;
|
|
|
- params.endDate = this.endDate;
|
|
|
- params.dateQuantum = this.dateQuantum;
|
|
|
- params.priceType = this.priceType;
|
|
|
- params.convertPrice = this.convertPrice;
|
|
|
- params.filterType = this.filterType;
|
|
|
- params.dateQuantumRange = this.dateQuantumRange;
|
|
|
+ params.campaignTemplateId = this.campaignId;
|
|
|
+ params.deliveryRange = this.deliveryRange;
|
|
|
+ params.userOrentationTemplateId = this.userorentationId;
|
|
|
+ params.budgetTemplateId = this.budgetId;
|
|
|
+ params.deliveryTargetTemplateId = this.deliverytargetId;
|
|
|
+ params.videoId = this.videoId;
|
|
|
+ params.imageId = this.imageId;
|
|
|
+ params.creativeText = this.creativeText;
|
|
|
+ params.iteratorNum = this.iteratorNum;
|
|
|
+
|
|
|
console.log(params)
|
|
|
postAction(this.url.insertUrl,params).then((res)=>{
|
|
|
console.log(res)
|
|
@@ -216,6 +324,14 @@
|
|
|
this.deliverytargetList = res.result.records
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ params = {};
|
|
|
+ params.pageSize = '1000';
|
|
|
+ postAction(this.url.userorentationTemplateListUrl, params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.userorentationList = res.result.records
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
</script>
|