|
@ -1,65 +1,122 @@ |
|
|
<template> |
|
|
<template> |
|
|
<Dialog v-model="modelVisible" :title="propData.id ? '修改' : '新增'" width="1400px"> |
|
|
<Dialog |
|
|
|
|
|
v-model="modelVisible" |
|
|
|
|
|
:title="propData.id ? '修改' : '新增'" |
|
|
|
|
|
width="1400px" |
|
|
|
|
|
> |
|
|
<div class="AddNEditDialog"> |
|
|
<div class="AddNEditDialog"> |
|
|
<!-- <Form :value="propData" class="form" ref="basicInfoForm" :formList="formList" column="1" labelWidth="80px" /> --> |
|
|
<!-- <Form :value="propData" class="form" ref="basicInfoForm" :formList="formList" column="1" labelWidth="80px" /> --> |
|
|
<el-form ref="basicInfoForm" :model="editData" label-width="80px" :rules="groupBasicRules"> |
|
|
<el-form |
|
|
|
|
|
ref="basicInfoForm" |
|
|
|
|
|
:model="editData" |
|
|
|
|
|
label-width="80px" |
|
|
|
|
|
:rules="groupBasicRules" |
|
|
|
|
|
> |
|
|
<el-form-item label="名称" prop="groupName"> |
|
|
<el-form-item label="名称" prop="groupName"> |
|
|
<el-input v-model="editData.groupName" placeholder="任务组名称"></el-input> |
|
|
<el-input |
|
|
|
|
|
v-model="editData.groupName" |
|
|
|
|
|
placeholder="任务组名称" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="描述" prop="remark"> |
|
|
<el-form-item label="描述" prop="remark"> |
|
|
<el-input v-model="editData.remark" placeholder="任务组描述"></el-input> |
|
|
<el-input |
|
|
|
|
|
v-model="editData.remark" |
|
|
|
|
|
placeholder="任务组描述" |
|
|
|
|
|
></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- <el-form-item label="状态" prop="status"> |
|
|
<!-- <el-form-item label="状态" prop="status"> |
|
|
<el-switch v-model="editData.status" active-value="1" inactive-value="0"></el-switch> |
|
|
<el-switch v-model="editData.status" active-value="1" inactive-value="0"></el-switch> |
|
|
</el-form-item> --> |
|
|
</el-form-item> --> |
|
|
<div style="display: flex; justify-content: flex-end;"> |
|
|
<div style="display: flex; justify-content: flex-end"> |
|
|
<el-button @click="(modelVisible = false), (submitting = false)" type="info" size="lg"> |
|
|
<el-button |
|
|
|
|
|
@click="(modelVisible = false), (submitting = false)" |
|
|
|
|
|
type="info" |
|
|
|
|
|
size="lg" |
|
|
|
|
|
> |
|
|
取消 |
|
|
取消 |
|
|
</el-button> |
|
|
</el-button> |
|
|
<el-button type="primary" @click="onSaveTaskGroup('basicInfoForm')" :loading="submitting" size="lg"> 提交 |
|
|
<el-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
@click="onSaveTaskGroup('basicInfoForm')" |
|
|
|
|
|
:loading="submitting" |
|
|
|
|
|
size="lg" |
|
|
|
|
|
> |
|
|
|
|
|
提交 |
|
|
</el-button> |
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<template v-if="editData.id"> |
|
|
<template v-if="editData.id"> |
|
|
<!-- 如果是新增的、还没有保存的任务组,不能添加任务 --> |
|
|
<!-- 如果是新增的、还没有保存的任务组,不能添加任务 --> |
|
|
<div class="fl-around task_op"> |
|
|
<div class="fl-around task_op"> |
|
|
<el-button size="mini" type="primary" @click="onAddTaskGroup">新增任务组</el-button> |
|
|
<el-button size="mini" type="primary" @click="onAddTaskGroup" |
|
|
|
|
|
>新增任务组</el-button |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
<div class="all_groups"> |
|
|
<div class="all_groups"> |
|
|
|
|
|
<div |
|
|
<div class="task_group" v-for="taskGroup,index in taskGroupsEditing"> |
|
|
class="task_group" |
|
|
|
|
|
v-for="(taskGroup, index) in taskGroupsEditing" |
|
|
|
|
|
> |
|
|
<div class="fl-around task_info"> |
|
|
<div class="fl-around task_info"> |
|
|
<div class="time_show"> |
|
|
<div class="time_show"> |
|
|
<el-input placeholder="请输入内容" v-model="taskGroup.time" style="width: 180px;" disabled> |
|
|
<el-input |
|
|
|
|
|
placeholder="请输入内容" |
|
|
|
|
|
v-model="taskGroup.time" |
|
|
|
|
|
style="width: 180px" |
|
|
|
|
|
disabled |
|
|
|
|
|
> |
|
|
</el-input> |
|
|
</el-input> |
|
|
<i class="icon el-icon-edit-outline" @click='onModifyTime(taskGroup)'></i> |
|
|
<i |
|
|
|
|
|
class="icon el-icon-edit-outline" |
|
|
|
|
|
@click="onModifyTime(taskGroup)" |
|
|
|
|
|
></i> |
|
|
</div> |
|
|
</div> |
|
|
<div class="fl-around task_op"> |
|
|
<div class="fl-around task_op"> |
|
|
<el-button size="mini" type="primary" @click="onAddTaskItem(taskGroup)">新增子任务</el-button> |
|
|
<el-button |
|
|
<el-button size="mini" type="danger" @click="onDeleteTaskGroup(taskGroup)">删除任务组</el-button> |
|
|
size="mini" |
|
|
|
|
|
type="primary" |
|
|
|
|
|
@click="onAddTaskItem(taskGroup)" |
|
|
|
|
|
>新增子任务</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
size="mini" |
|
|
|
|
|
type="danger" |
|
|
|
|
|
@click="onDeleteTaskGroup(taskGroup)" |
|
|
|
|
|
>删除任务组</el-button |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
<div> |
|
|
<!-- <p v-for="item, index1 in taskGroup.tasksEdit">{{ item }}</p> --> |
|
|
<!-- <p v-for="item, index1 in taskGroup.tasksEdit">{{ item }}</p> --> |
|
|
<TaskItem v-for="item, index1 in taskGroup.tasksEdit" :propData="item" :groupId="propData.id" |
|
|
<TaskItem |
|
|
:time="taskGroup.time" @onSubmit="onSubmitTaskItem"> |
|
|
v-for="(item, index1) in taskGroup.tasksEdit" |
|
|
|
|
|
:propData="item" |
|
|
|
|
|
:groupId="propData.id" |
|
|
|
|
|
:time="taskGroup.time" |
|
|
|
|
|
@onSubmit="onSubmitTaskItem" |
|
|
|
|
|
> |
|
|
</TaskItem> |
|
|
</TaskItem> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<template #footer> |
|
|
<template #footer> </template> |
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<taskEditDialog v-model="isEditing" :groupId="editData.id" :time="selectedTaskGroup.time" :propData="{}" |
|
|
|
|
|
@onSubmit="onSubmitTaskItem" /> |
|
|
|
|
|
|
|
|
|
|
|
<timeEditDialog v-model="isShowTimeEdit" :propData="editingTime" @onSubmit="onSubmitTime" /> |
|
|
<taskEditDialog |
|
|
|
|
|
v-model="isEditing" |
|
|
|
|
|
:groupId="editData.id" |
|
|
|
|
|
:time="selectedTaskGroup.time" |
|
|
|
|
|
:propData="{}" |
|
|
|
|
|
@onSubmit="onSubmitTaskItem" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<timeEditDialog |
|
|
|
|
|
v-model="isShowTimeEdit" |
|
|
|
|
|
:propData="editingTime" |
|
|
|
|
|
@onSubmit="onSubmitTime" |
|
|
|
|
|
/> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -84,7 +141,7 @@ export default { |
|
|
Form, |
|
|
Form, |
|
|
TaskItem, |
|
|
TaskItem, |
|
|
taskEditDialog, |
|
|
taskEditDialog, |
|
|
timeEditDialog |
|
|
timeEditDialog, |
|
|
}, |
|
|
}, |
|
|
model: { |
|
|
model: { |
|
|
prop: "visible", |
|
|
prop: "visible", |
|
@ -94,12 +151,12 @@ export default { |
|
|
visible: Boolean, |
|
|
visible: Boolean, |
|
|
propData: { |
|
|
propData: { |
|
|
type: Object, |
|
|
type: Object, |
|
|
default: ()=>{} |
|
|
default: () => {}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
let gNameValidator = (rule, value, callback) => { |
|
|
let gNameValidator = (rule, value, callback) => { |
|
|
return callback(new Error('请输入任务组名称')); |
|
|
return callback(new Error("请输入任务组名称")); |
|
|
// if (value.trim().length<=0){ |
|
|
// if (value.trim().length<=0){ |
|
|
// return callback(new Error('请输入任务组名称')); |
|
|
// return callback(new Error('请输入任务组名称')); |
|
|
// } |
|
|
// } |
|
@ -118,9 +175,9 @@ export default { |
|
|
groupBasicRules: { |
|
|
groupBasicRules: { |
|
|
groupName: [ |
|
|
groupName: [ |
|
|
// { validator: gNameValidator, trigger: 'blur' } |
|
|
// { validator: gNameValidator, trigger: 'blur' } |
|
|
{ required: true, message: '请输入活动名称', trigger: 'blur' }, |
|
|
{ required: true, message: "请输入活动名称", trigger: "blur" }, |
|
|
], |
|
|
], |
|
|
} |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
@ -152,7 +209,6 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
|
|
|
// "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".split('').forEach(item => { |
|
|
// "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".split('').forEach(item => { |
|
|
// request({ |
|
|
// request({ |
|
|
// url: `/business/dcInfoBoardVocabulary`, |
|
|
// url: `/business/dcInfoBoardVocabulary`, |
|
@ -170,15 +226,15 @@ export default { |
|
|
console.log("onSubmitTaskItemonSubmitTaskItemonSubmitTaskItem"); |
|
|
console.log("onSubmitTaskItemonSubmitTaskItemonSubmitTaskItem"); |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/dcBatchFunctionsJobGroup/${this.editData.id}`, |
|
|
url: `/business/dcBatchFunctionsJobGroup/${this.editData.id}`, |
|
|
method: "GET" |
|
|
method: "GET", |
|
|
}).then(res=>{ |
|
|
}).then((res) => { |
|
|
this.editData = { |
|
|
this.editData = { |
|
|
id: res.data.id, |
|
|
id: res.data.id, |
|
|
groupName: res.data.groupName, |
|
|
groupName: res.data.groupName, |
|
|
// status: res.data.status, |
|
|
// status: res.data.status, |
|
|
remark: res.data.remark, |
|
|
remark: res.data.remark, |
|
|
detailedConfiguration: res.data.detailedConfiguration |
|
|
detailedConfiguration: res.data.detailedConfiguration, |
|
|
} |
|
|
}; |
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@ -195,27 +251,26 @@ export default { |
|
|
confirmButtonText: "确定", |
|
|
confirmButtonText: "确定", |
|
|
cancelButtonText: "取消", |
|
|
cancelButtonText: "取消", |
|
|
type: "warning", |
|
|
type: "warning", |
|
|
}).then(() => { |
|
|
}) |
|
|
|
|
|
.then(() => { |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/dcBatchFunctionsJob/time/${this.editData.id}/${taskG.time}`, |
|
|
url: `/business/dcBatchFunctionsJob/time/${this.editData.id}/${taskG.time}`, |
|
|
method: "DELETE" |
|
|
method: "DELETE", |
|
|
}).then(res => { |
|
|
}).then((res) => { |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/dcBatchFunctionsJobGroup/${this.editData.id}`, |
|
|
url: `/business/dcBatchFunctionsJobGroup/${this.editData.id}`, |
|
|
method: "GET" |
|
|
method: "GET", |
|
|
}).then(res => { |
|
|
}).then((res) => { |
|
|
this.editData = { |
|
|
this.editData = { |
|
|
id: res.data.id, |
|
|
id: res.data.id, |
|
|
groupName: res.data.groupName, |
|
|
groupName: res.data.groupName, |
|
|
// status: res.data.status, |
|
|
// status: res.data.status, |
|
|
remark: res.data.remark, |
|
|
remark: res.data.remark, |
|
|
detailedConfiguration: res.data.detailedConfiguration |
|
|
detailedConfiguration: res.data.detailedConfiguration, |
|
|
} |
|
|
}; |
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
this.$message.warn("取消删除。"); |
|
|
this.$message.warn("取消删除。"); |
|
@ -231,21 +286,23 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let detailedConfiguration = []; |
|
|
let detailedConfiguration = []; |
|
|
this.taskGroupsEditing.forEach(item=>{ |
|
|
this.taskGroupsEditing.forEach((item) => { |
|
|
detailedConfiguration.push({time:item.time, tasks:_.map(item.tasksEdit, "jobId")}); |
|
|
detailedConfiguration.push({ |
|
|
|
|
|
time: item.time, |
|
|
|
|
|
tasks: _.map(item.tasksEdit, "jobId"), |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/dcBatchFunctionsJobGroup`, |
|
|
url: `/business/dcBatchFunctionsJobGroup`, |
|
|
method: "PUT", |
|
|
method: "PUT", |
|
|
data: { |
|
|
data: { |
|
|
id: this.editData.id, |
|
|
id: this.editData.id, |
|
|
detailedConfiguration: JSON.stringify(detailedConfiguration) |
|
|
detailedConfiguration: JSON.stringify(detailedConfiguration), |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}).then((result) => { |
|
|
.then((result) => { |
|
|
|
|
|
if (result.code != 200) return; |
|
|
if (result.code != 200) return; |
|
|
Message.success(`提交成功!`); |
|
|
Message.success(`提交成功!`); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
onAddTaskItem(taskG) { |
|
|
onAddTaskItem(taskG) { |
|
|
this.selectedTaskGroup = taskG; |
|
|
this.selectedTaskGroup = taskG; |
|
@ -253,24 +310,23 @@ export default { |
|
|
}, |
|
|
}, |
|
|
initEditingData() { |
|
|
initEditingData() { |
|
|
if (this.propData?.id) { |
|
|
if (this.propData?.id) { |
|
|
this.mode = "edit" |
|
|
this.mode = "edit"; |
|
|
this.editData = { |
|
|
this.editData = { |
|
|
id: this.propData.id, |
|
|
id: this.propData.id, |
|
|
groupName: this.propData.groupName, |
|
|
groupName: this.propData.groupName, |
|
|
// status: this.propData.status, |
|
|
// status: this.propData.status, |
|
|
remark: this.propData.remark, |
|
|
remark: this.propData.remark, |
|
|
detailedConfiguration: this.propData.detailedConfiguration |
|
|
detailedConfiguration: this.propData.detailedConfiguration, |
|
|
} |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
this.mode = "add" |
|
|
this.mode = "add"; |
|
|
this.editData = { |
|
|
this.editData = { |
|
|
groupName: "", |
|
|
groupName: "", |
|
|
// status: "1", |
|
|
// status: "1", |
|
|
remark: "", |
|
|
remark: "", |
|
|
detailedConfiguration: "" |
|
|
detailedConfiguration: "", |
|
|
} |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
getTaskList() { |
|
|
getTaskList() { |
|
|
this.taskGroupsEditing = JSON.parse(this.editData.detailedConfiguration); |
|
|
this.taskGroupsEditing = JSON.parse(this.editData.detailedConfiguration); |
|
@ -295,10 +351,9 @@ export default { |
|
|
url: `/business/dcBatchFunctionsJob/query`, |
|
|
url: `/business/dcBatchFunctionsJob/query`, |
|
|
method: "GET", |
|
|
method: "GET", |
|
|
params: { |
|
|
params: { |
|
|
jobGroup: this.propData.id |
|
|
jobGroup: this.propData.id, |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}).then((result) => { |
|
|
.then((result) => { |
|
|
|
|
|
if (result.code != 200) return; |
|
|
if (result.code != 200) return; |
|
|
console.log("当前任务组下的任务", result.data); |
|
|
console.log("当前任务组下的任务", result.data); |
|
|
// result.data = [ |
|
|
// result.data = [ |
|
@ -308,15 +363,17 @@ export default { |
|
|
// jobGroup:1 |
|
|
// jobGroup:1 |
|
|
// } |
|
|
// } |
|
|
// ] |
|
|
// ] |
|
|
this.taskGroupsEditing.forEach(item=>{ |
|
|
this.taskGroupsEditing.forEach((item) => { |
|
|
let arr = _.filter(result.data, itm => { return item.tasks.includes(itm.jobId)}); |
|
|
let arr = _.filter(result.data, (itm) => { |
|
|
|
|
|
return item.tasks.includes(itm.jobId); |
|
|
|
|
|
}); |
|
|
this.$set(item, "tasksEdit", arr); |
|
|
this.$set(item, "tasksEdit", arr); |
|
|
// item.tasksEdit = arr; |
|
|
// item.tasksEdit = arr; |
|
|
}); |
|
|
}); |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
onSaveTaskGroup(formName) { |
|
|
onSaveTaskGroup(formName) { |
|
|
this.$refs[formName].validate(valid => { |
|
|
this.$refs[formName].validate((valid) => { |
|
|
if (!valid) { |
|
|
if (!valid) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -342,8 +399,7 @@ export default { |
|
|
Message.success(`提交成功!`); |
|
|
Message.success(`提交成功!`); |
|
|
this.$emit("onSuccess"); |
|
|
this.$emit("onSuccess"); |
|
|
this.editData = { ...result.data }; |
|
|
this.editData = { ...result.data }; |
|
|
this.mode = "edit" |
|
|
this.mode = "edit"; |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
console.log( |
|
|
console.log( |
|
@ -374,15 +430,16 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.all_groups { |
|
|
.all_groups { |
|
|
border: 1px solid #09B; |
|
|
border: 1px solid #09b; |
|
|
max-height: 500px; |
|
|
max-height: 500px; |
|
|
overflow-y: scroll; |
|
|
overflow-y: scroll; |
|
|
} |
|
|
} |
|
|
.task_group { |
|
|
.task_group { |
|
|
.task_info { |
|
|
.task_info { |
|
|
padding:10px; background: #004050; |
|
|
padding: 10px; |
|
|
|
|
|
background: #004050; |
|
|
.time_show { |
|
|
.time_show { |
|
|
color: #0AC; |
|
|
color: #0ac; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.task_op { |
|
|
.task_op { |
|
|