|
@@ -95,12 +95,9 @@
|
|
|
<el-table-column label="任务类型" align="center" prop="taskType" :formatter="taskTypeFormatter" />
|
|
<el-table-column label="任务类型" align="center" prop="taskType" :formatter="taskTypeFormatter" />
|
|
|
<el-table-column label="触发类型" align="center" prop="triggerType" :formatter="triggerTypeFormatter" />
|
|
<el-table-column label="触发类型" align="center" prop="triggerType" :formatter="triggerTypeFormatter" />
|
|
|
<el-table-column label="触发时间" align="center" prop="triggerValue" :formatter="triggerValueFormatter" />
|
|
<el-table-column label="触发时间" align="center" prop="triggerValue" :formatter="triggerValueFormatter" />
|
|
|
|
|
+ <el-table-column label="产品名称" align="center" prop="productName" :formatter="productNameFormatter" />
|
|
|
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormatter" />
|
|
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormatter" />
|
|
|
- <el-table-column label="创建时间" align="center" prop="createdTime" width="180">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
|
|
+ <el-table-column label="完成状态" align="center" prop="finishStatus" :formatter="finishStatusFormatter" />
|
|
|
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180">
|
|
<el-table-column label="更新时间" align="center" prop="updatedTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
|
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
|
@@ -144,7 +141,7 @@
|
|
|
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
|
<el-input v-model="form.taskName" placeholder="请输入任务名称" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="任务类型" prop="taskType">
|
|
<el-form-item label="任务类型" prop="taskType">
|
|
|
- <el-select v-model="form.taskType" placeholder="请选择任务类型" @change="updateTaskType()">
|
|
|
|
|
|
|
+ <el-select v-model="form.taskType" placeholder="请选择任务类型" @change="updateTaskType()" >
|
|
|
<el-option v-for="i in taskTypeOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="i in taskTypeOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -165,10 +162,12 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="触发时间" prop="content">
|
|
<el-form-item label="触发时间" prop="content">
|
|
|
<el-time-picker
|
|
<el-time-picker
|
|
|
|
|
+ default-value="2025-01-01 00:00:00"
|
|
|
v-model="form.triggerValue"
|
|
v-model="form.triggerValue"
|
|
|
:picker-options="{
|
|
:picker-options="{
|
|
|
selectableRange: '00:00:00 - 23:59:59'
|
|
selectableRange: '00:00:00 - 23:59:59'
|
|
|
}"
|
|
}"
|
|
|
|
|
+
|
|
|
placeholder="任意时间点">
|
|
placeholder="任意时间点">
|
|
|
</el-time-picker>
|
|
</el-time-picker>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -208,7 +207,7 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
taskTypeOptions:[
|
|
taskTypeOptions:[
|
|
|
{
|
|
{
|
|
|
- value: "1",
|
|
|
|
|
|
|
+ value: 1,
|
|
|
label: "定时卡片推荐商品"
|
|
label: "定时卡片推荐商品"
|
|
|
},
|
|
},
|
|
|
// {
|
|
// {
|
|
@@ -331,7 +330,6 @@ export default {
|
|
|
this.socket = this.$store.state.liveWs[this.liveId]
|
|
this.socket = this.$store.state.liveWs[this.liveId]
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
statusFormatter(row, column, value){
|
|
statusFormatter(row, column, value){
|
|
|
if (!value) return '--'; // 空值处理
|
|
if (!value) return '--'; // 空值处理
|
|
|
switch ( value){
|
|
switch ( value){
|
|
@@ -343,6 +341,17 @@ export default {
|
|
|
return "--";
|
|
return "--";
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ finishStatusFormatter(row, column, value){
|
|
|
|
|
+ if (!value) return '--'; // 空值处理
|
|
|
|
|
+ switch ( value){
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ return "未执行";
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ return "已执行";
|
|
|
|
|
+ default:
|
|
|
|
|
+ return "--";
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
taskTypeFormatter(row, column, value){
|
|
taskTypeFormatter(row, column, value){
|
|
|
if (!value) return '--'; // 空值处理
|
|
if (!value) return '--'; // 空值处理
|
|
|
switch (value) {
|
|
switch (value) {
|
|
@@ -365,6 +374,13 @@ export default {
|
|
|
return "--";
|
|
return "--";
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ productNameFormatter(row, column, value){
|
|
|
|
|
+ let content = JSON.parse(row.content)
|
|
|
|
|
+ if(content.productName) {
|
|
|
|
|
+ return content.productName
|
|
|
|
|
+ }
|
|
|
|
|
+ return "--";
|
|
|
|
|
+ },
|
|
|
triggerValueFormatter(row, column, value) {
|
|
triggerValueFormatter(row, column, value) {
|
|
|
if (!value) return '--'; // 空值处理
|
|
if (!value) return '--'; // 空值处理
|
|
|
|
|
|
|
@@ -492,13 +508,18 @@ export default {
|
|
|
this.title = "添加直播间自动化任务配置";
|
|
this.title = "添加直播间自动化任务配置";
|
|
|
},
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
|
|
|
|
+ async handleUpdate(row) {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
|
|
+ if(row.taskType == 1){
|
|
|
|
|
+ await this.addGoodsList();
|
|
|
|
|
+ }
|
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
|
getTask(id).then(response => {
|
|
getTask(id).then(response => {
|
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
- this.form.content = null;
|
|
|
|
|
- this.form.taskType = null;
|
|
|
|
|
|
|
+ if (this.form.taskType == 1) {
|
|
|
|
|
+ let content = JSON.parse( response.data.content)
|
|
|
|
|
+ this.form.content = content.goodsId;
|
|
|
|
|
+ }
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
this.title = "修改直播间自动化任务配置";
|
|
this.title = "修改直播间自动化任务配置";
|
|
|
});
|
|
});
|