Commit 47d535b7 by caoyanzhi

update: 关联渠道标签

parent 6fd77b26
...@@ -653,8 +653,7 @@ ...@@ -653,8 +653,7 @@
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间" end-placeholder="结束时间"
format="yyyy-MM-dd" format="yyyy-MM-dd"
:default-time="['00:00:00', '23:59:59']" value-format="yyyy-MM-dd">
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker> </el-date-picker>
</div> </div>
<!-- 相对时段 --> <!-- 相对时段 -->
...@@ -2234,9 +2233,35 @@ export default { ...@@ -2234,9 +2233,35 @@ export default {
break; break;
case 'tag050': case 'tag050':
for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'tag050') {
let templateDate = tagParams.template[0];
// 判断是那个时间段
// 固定时段
this.templateData[i].radio = templateDate.radio; // 时段
if (this.templateData[i].radio == 1) {
if (templateDate.dateRangeValue && templateDate.dateRangeValue.length) {
this.templateData[i].dateRangeValue = templateDate.dateRangeValue;
} else {
this.templateData[i].dateRangeValue = tagValue.val[0].data.value.split(',');
}
} else {
// 相对时段
this.templateData[i].timeRadio = templateDate.timeRadio; // 天 月 年
this.templateData[i].timeAfterChecked = templateDate.timeAfterChecked;
this.templateData[i].timeChecked = templateDate.timeChecked;
this.templateData[i].dateRangeValue = [];
}
// 如果有最近选项必有 timeInput
if (this.templateData[i].timeAfterChecked) {
this.templateData[i].timeInput = tagValue.time[0].value;
}
}
}
break;
case 'tag020': case 'tag020':
for (let i = 0; i < this.templateData.length; i++) { for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'tag020' || this.templateData[i].templateCode === 'tag050') { if (this.templateData[i].templateCode === 'tag020') {
let templateDate = tagParams.template[0]; let templateDate = tagParams.template[0];
// 判断是那个时间段 // 判断是那个时间段
// 固定时段 // 固定时段
......
...@@ -564,16 +564,128 @@ export default { ...@@ -564,16 +564,128 @@ export default {
} }
} }
} }
if (code == 'tag050' && that.templateData.length > 0 && that.templateData[0].radio == 0) { if (code == 'tag050' && that.templateData.length > 0) {
if (that.currentComputeType == 2) { switch(Number(that.templateData[0].radio)) {
tagValue.val[0].data.compute = 'between'; case 0:
} else { tagValue.time[0].compute = 'all';
tagValue.val[0].data.compute = that.templateData[0].postCompute; tagValue.time[0].value = '';
that.postTemplateData.selectedVal.push('所有时间');
break;
case 1:
tagValue.time[0].compute = 'between';
tagValue.time[0].value = that.templateData[0].dateRangeValue.join(',')
that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]);
break;
case 2:
// tagValue.time[0].compute = 'lastday';
// tagValue.time[0].value = that.templateData[0].dateRangeValue
// 天
// timeAfterChecked 最近/之后
// timeChecked 当天/年/月
if (that.templateData[0].timeRadio == 1) {
/** 同时选择
* lastdayHasToday 最近几天包含今天
* afterdayHasToday 之后几天包含今天
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastdayHasToday';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput}天包含当天`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//天 当天
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'today'
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当天');
that.templateData[0].timeInput = '';
}
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastday';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 天`);
}
}
}
// 月
if (that.templateData[0].timeRadio == 2) {
/**
* lastmonthHasCurrentMonth 最近几月包含当月
* aftermonthHasCurrentMonth 之后几月包含当月
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastmonthHasCurrentMonth';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 月包含当月`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//月 当月
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'currentMonth';
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当月');
that.templateData[0].timeInput = '';
}
// 最近/之后
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastmonth';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 月`);
}
}
}
// 年
if (that.templateData[0].timeRadio == 3) {
/**
* lastyearHasCurrentYear 最近几年包含当年
* afteryearHasCurrentYear 之后几年包含当年
*/
if (that.templateData[0].timeChecked && that.templateData[0].timeAfterChecked) {
if (that.templateData[0].timeSelect == 1) {
tagValue.time[0].compute = 'lastyearHasCurrentYear';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 年包含当年`);
that.templateData[0].timeInput = '';
}
that.postTemplateData.template = that.templateData;
tagParams = that.postTemplateData;
}
//年 当年
if (that.templateData[0].timeChecked && !that.templateData[0].timeAfterChecked) {
tagValue.time[0].compute = 'currentYear';
tagValue.time[0].value = '1';
that.postTemplateData.selectedVal.push('当年');
that.templateData[0].timeInput = '';
}
// 最近/之后
if (that.templateData[0].timeAfterChecked && !that.templateData[0].timeChecked) {
if (that.templateData[0].timeSelect == 1) {
// 最近
tagValue.time[0].compute = 'lastyear';
tagValue.time[0].value = String(that.templateData[0].timeInput);
that.postTemplateData.selectedVal.push(`最近 ${that.templateData[0].timeInput} 年`);
}
}
}
break;
} }
tagValue.val[0].data.value = that.templateData[0].radio;
that.postTemplateData.selectedVal.push('所有时间');
} }
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015' || code == 'tag050') && that.templateData.length > 0 && that.templateData[0].radio == 1) { if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length > 0 && that.templateData[0].radio == 1) {
if (that.currentComputeType == 2) { if (that.currentComputeType == 2) {
tagValue.val[0].data.compute = 'between'; tagValue.val[0].data.compute = 'between';
} else { } else {
...@@ -581,7 +693,7 @@ export default { ...@@ -581,7 +693,7 @@ export default {
} }
tagValue.val[0].data.value = that.templateData[0].dateRangeValue.join(','); tagValue.val[0].data.value = that.templateData[0].dateRangeValue.join(',');
that.templateData[0].timeInput = ''; that.templateData[0].timeInput = '';
if (code === 'tag019' || code === 'tag020' || code === 'tag015' || code == 'tag050') { if (code === 'tag019' || code === 'tag020' || code === 'tag015') {
// 兼容后端,先使用硬编码 // 兼容后端,先使用硬编码
if (that.tagData.tagId == 'f75b8053fe744b2a9a366886bc40612a') { if (that.tagData.tagId == 'f75b8053fe744b2a9a366886bc40612a') {
tagValue.val[0].data.value = that.templateData[0].dateRangeValue.map(el => { tagValue.val[0].data.value = that.templateData[0].dateRangeValue.map(el => {
...@@ -599,7 +711,7 @@ export default { ...@@ -599,7 +711,7 @@ export default {
that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]); that.postTemplateData.selectedVal.push(that.templateData[0].dateRangeValue[0].split(' ')[0] + '至' + that.templateData[0].dateRangeValue[1].split(' ')[0]);
} }
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015' || code == 'tag050') && that.templateData.length > 0 && that.templateData[0].radio == 2) { if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015') && that.templateData.length > 0 && that.templateData[0].radio == 2) {
// 天 // 天
// timeAfterChecked 最近/之后 // timeAfterChecked 最近/之后
// timeChecked 当天/年/月 // timeChecked 当天/年/月
......
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