Commit 8b89ec8b by chenxin

fix: m

parent bf2fb15e
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(t,a,c){for(var f,i,d,u=0,s=[];u<t.length;u++)i=t[u],n[i]&&s.push(n[i][0]),n[i]=0;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(e[f]=a[f]);for(r&&r(t,a,c);s.length;)s.shift()();if(c)for(u=0;u<c.length;u++)d=o(o.s=c[u]);return d};var t={},n={14:0};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var r=n[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var t=new Promise(function(t,o){r=n[e]=[t,o]});r[2]=t;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"message",4:"ewash",5:"ecm",6:"evaluation",7:"activity",8:"cdKey",9:"recharge",10:"msg",11:"calllog"}[e]||e)+"."+{0:"0ddc3d68685e848dd774",1:"a6f795143dcb35b5cb4c",2:"21a2ae8bde8fd576d6c1",3:"108440167bb83f4091b2",4:"391130c8f773cb8775d6",5:"7e7a76a9ddc9096921cf",6:"faf17b909ac1f2528782",7:"8cde246f205e5d60d01a",8:"1b4d07f3689020998359",9:"d0c7fdeaae259a8befad",10:"0d4820f42ef1fa47e4cc",11:"07f9326e2a68fd201646"}[e]+".js";var f=setTimeout(i,12e4);function i(){c.onerror=c.onload=null,clearTimeout(f);var r=n[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return c.onerror=c.onload=i,a.appendChild(c),t},o.m=e,o.c=t,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var r=window.webpackJsonp;window.webpackJsonp=function(t,a,c){for(var f,i,u,d=0,s=[];d<t.length;d++)i=t[d],n[i]&&s.push(n[i][0]),n[i]=0;for(f in a)Object.prototype.hasOwnProperty.call(a,f)&&(e[f]=a[f]);for(r&&r(t,a,c);s.length;)s.shift()();if(c)for(d=0;d<c.length;d++)u=o(o.s=c[d]);return u};var t={},n={14:0};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.e=function(e){var r=n[e];if(0===r)return new Promise(function(e){e()});if(r)return r[2];var t=new Promise(function(t,o){r=n[e]=[t,o]});r[2]=t;var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript",c.charset="utf-8",c.async=!0,c.timeout=12e4,o.nc&&c.setAttribute("nonce",o.nc),c.src=o.p+"static/js/"+({0:"card",1:"game",2:"wechat",3:"message",4:"ewash",5:"ecm",6:"evaluation",7:"activity",8:"cdKey",9:"recharge",10:"msg",11:"calllog"}[e]||e)+"."+{0:"46d21bc0dc775c037233",1:"82b6563092b3c562b01d",2:"21a2ae8bde8fd576d6c1",3:"108440167bb83f4091b2",4:"391130c8f773cb8775d6",5:"4250880241ba99afbdbe",6:"fe87f8c54744c96fa200",7:"12bb935152321d4645b5",8:"078735466efde17f1d65",9:"d0c7fdeaae259a8befad",10:"0d4820f42ef1fa47e4cc",11:"07f9326e2a68fd201646"}[e]+".js";var f=setTimeout(i,12e4);function i(){c.onerror=c.onload=null,clearTimeout(f);var r=n[e];0!==r&&(r&&r[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return c.onerror=c.onload=i,a.appendChild(c),t},o.m=e,o.c=t,o.d=function(e,r,t){o.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,"a",r),r},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.p="/marketing/",o.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
<template>
<div class="dm-wrap" v-loading="loading">
<el-form ref="form" :model="ruleForm" label-width="140px" :rules="rules">
<el-form-item prop="name" label="数据对话名称">
<dm-input v-model="ruleForm.name" class="w300" placeholder="请输入数据对话名称" :byteType="1" :maxlength="10"></dm-input>
</el-form-item>
<el-form-item prop="dateTime" label="数据对话时间">
<el-date-picker :disabled="disabled" :picker-options="pickerOptions" v-model="ruleForm.beginDate" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="开始日期"></el-date-picker>
<span style="color:#909299;margin-left:5px;margin-right:5px;">~</span>
<el-date-picker :disabled="disabled" :picker-options="pickerOptions" v-model="ruleForm.endDate" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-tooltip slot="label" open-delay="200" placement="top">
<!-- <div slot="content">可选内容,详细使用内容详见<a target="_blank" style="color:#1890ff" href="https://demogic.udesk.cn/hc/articles/226671">《数据对话运营复盘流程》</a></div> -->
<div slot="content">可选内容,详细使用内容详见《数据对话运营复盘流程》</div>
<span class="tooltip-icon">会员分组</span>
</el-tooltip>
<div style="width:600px">
<vue-gic-member-group :readonly="disabled" onlyFixedType v-if="initMemberGroup" :defaltSelected="defaltSelected" :height="500" projectName="marketing" @handleDataTransferred="handleDataTransferred" @handleDataLeft="handleDataLeft"></vue-gic-member-group>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submit">确认{{ isAdd ? '新建' : '保存' }}</el-button>
</el-form-item>
</el-form>
<ul style="padding-bottom:400px;margin-left:140px;color:#909399;font-size:14px;line-height:22px;">
<li>* 应用中新建计划时可以使用数据对话:微信营销、短信营销、卡券营销、智能营销、游戏营销</li>
<li>* 营销数据统计分析维度为:营销人次、活动覆盖人数、活动相关订单、活动销售额</li>
</ul>
</div>
</template>
<script>
import { _debounce } from '@/utils/index';
import { formatDateTimeByType } from '@/utils/index.js';
import { saveActivity, getActivityInfo } from '@/service/api/activityApi';
export default {
name: 'activity-form',
data() {
const validateDateLessYear = (rule, value, callback) => {
if (this.isEdit) {
callback();
}
const date1 = this.ruleForm.beginDate;
const date2 = this.ruleForm.endDate;
if (!date1 || !date2) {
callback(new Error('活动时间不能为空'));
}
if (new Date(date2).getTime() < new Date()) {
callback(new Error('结束时间不能小于当前时间'));
}
if (new Date(date2).getTime() - new Date(date1).getTime() > 60 * 60 * 24 * 365 * 1000) {
callback(new Error(rule.message || '时间跨度不能超过一年'));
}
callback();
};
return {
loading: false,
marketingActivityId: this.$route.params.id,
ruleForm: {
name: '',
beginDate: '',
endDate: '',
memberGroup: ''
},
rules: {
name: [{ required: true, message: '请输入活动名称', trigger: 'change' }],
dateTime: [{ required: true, validator: validateDateLessYear, trigger: 'change' }]
},
pickerOptions: {
disabledDate(val) {
return Date.now() >= val.getTime() + 24 * 60 * 60 * 1000;
}
},
// 会员分组
defaltSelected: [],
initMemberGroup: false,
isAdd: this.$route.meta.type === 'add',
isEdit: this.$route.meta.type === 'edit'
};
},
computed: {
disabled() {
return this.isEdit && new Date() > new Date(this.ruleForm.beginDate);
}
},
methods: {
submit: _debounce(function() {
this.$refs.form.validate(valid => {
if (!valid) {
return;
}
let params = { ...this.ruleForm };
if (this.isEdit) {
params.marketingActivityId = this.marketingActivityId;
}
if (this.disabled) {
// 不能改的时候不传活动时间
delete params.beginDate;
delete params.endDate;
}
this.loading = true;
saveActivity(params)
.then(res => {
this.loading = false;
this.$tips({ type: 'success', message: '操作成功' });
this.$router.push('/activity/list');
})
.catch(() => {
this.loading = false;
});
});
}),
getInfo() {
this.loading = true;
getActivityInfo({ marketingActivityId: this.marketingActivityId })
.then(res => {
const result = res.result || {};
const { activityInfo, tagGroupList } = result;
const { name, beginDate, endDate, memberGroup } = activityInfo;
this.ruleForm.name = name;
this.ruleForm.beginDate = formatDateTimeByType(beginDate, 'yyyy-MM-dd-HH-mm-ss');
this.ruleForm.endDate = formatDateTimeByType(endDate, 'yyyy-MM-dd-HH-mm-ss');
this.ruleForm.memberGroup = memberGroup;
this.defaltSelected = tagGroupList;
this.ruleForm.name = name;
this.loading = false;
this.$nextTick(() => {
this.initMemberGroup = true;
});
})
.catch(() => {
this.loading = false;
});
},
// *********会员分组**********
handleDataTransferred(data) {
// 会员分组 情况下 memberSearchDTO 传数组字符串
this.ruleForm.memberGroup = data
.map(v => v.memberTagGroupId)
.filter(v => v)
.join(',');
},
handleDataLeft(selectedData, selectionToRemove) {
// 不可编辑
if (!this.disabled) {
this.ruleForm.memberGroup = selectedData
.map(v => v.memberTagGroupId)
.filter(v => v)
.join(',');
} else {
this.$message.warning('数据对话已生效,分组数据编辑无效');
}
}
},
mounted() {
if (this.isAdd) {
this.initMemberGroup = true;
}
if (this.isEdit) {
this.getInfo();
}
},
created() {
// 设置面包屑
let breadcrumbName = '数据对话编辑';
if (this.isAdd) {
breadcrumbName = '数据对话新增';
}
this.$store.commit('aside_handler', false);
this.$store.commit('mutations_breadcrumb', [{ name: '数据对话厅', path: '/activity/list' }, { name: breadcrumbName, path: '' }]); // eslint-disable-line
}
};
</script>
<style lang="scss" scoped>
/deep/ .group-set-transfer {
margin: 0;
padding: 0;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment