|
@ -1,6 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<Dialog v-model="modelVisible" :title="propData ? '修改' : '新增'" width="1400px"> |
|
|
<Dialog v-model="modelVisible" :title="propData ? '修改' : '新增'" width="1400px"> |
|
|
{{ editData }} |
|
|
|
|
|
<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"> |
|
@ -25,22 +24,27 @@ |
|
|
<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="task" v-for="taskGroup,index in taskGroupsEditing"> |
|
|
<div class="all_groups"> |
|
|
<div class="fl-around task_info"> |
|
|
|
|
|
<el-input v-model="taskGroup.time" style="width: 180px;"></el-input> |
|
|
<div class="task_group" v-for="taskGroup,index in taskGroupsEditing"> |
|
|
<div class="fl-around task_op"> |
|
|
<div class="fl-around task_info"> |
|
|
<el-button size="mini" type="primary" @click="onAddTaskItem(taskGroup)">新增子任务</el-button> |
|
|
<div class="time_show"> |
|
|
<el-button size="mini" type="primary">删除</el-button> |
|
|
<el-input placeholder="请输入内容" v-model="taskGroup.time" style="width: 180px;" disabled> |
|
|
|
|
|
</el-input> |
|
|
|
|
|
<i class="icon el-icon-edit-outline" @click='onModifyTime(taskGroup)'></i> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="fl-around task_op"> |
|
|
|
|
|
<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> |
|
|
|
|
|
<TaskItem v-for="item, index1 in taskGroup.tasksEdit" :propData="item" :groupId="propData.id" |
|
|
|
|
|
:time="taskGroup.time" @onSubmit="onSubmitTaskItem"> |
|
|
|
|
|
</TaskItem> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div> |
|
|
|
|
|
<!-- |
|
|
|
|
|
<p v-for="item, index1 in taskGroup.tasksEdit"> |
|
|
|
|
|
{{ item.jobId }}</p> --> |
|
|
|
|
|
<TaskItem v-for="item, index1 in taskGroup.tasksEdit" :propData="item" :groupId="propData.id" |
|
|
|
|
|
:time="taskGroup.time" @onModify="newV=>onModifyItem(newV, item)"> |
|
|
|
|
|
</TaskItem> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</div> |
|
|
</div> |
|
@ -52,7 +56,7 @@ |
|
|
<taskEditDialog v-model="isEditing" :groupId="propData.id" :time="selectedTaskGroup.time" :propData="{}" |
|
|
<taskEditDialog v-model="isEditing" :groupId="propData.id" :time="selectedTaskGroup.time" :propData="{}" |
|
|
@onSubmit="onSubmitTaskItem" /> |
|
|
@onSubmit="onSubmitTaskItem" /> |
|
|
|
|
|
|
|
|
<timeEditDialog v-model="isShowTimeEdit" @onSubmit="onSubmitTime" /> |
|
|
<timeEditDialog v-model="isShowTimeEdit" :propData="editingTime" @onSubmit="onSubmitTime" /> |
|
|
|
|
|
|
|
|
</Dialog> |
|
|
</Dialog> |
|
|
</template> |
|
|
</template> |
|
@ -99,6 +103,7 @@ export default { |
|
|
// } |
|
|
// } |
|
|
}; |
|
|
}; |
|
|
return { |
|
|
return { |
|
|
|
|
|
editingTime:"", |
|
|
editData:{}, |
|
|
editData:{}, |
|
|
mode:"", |
|
|
mode:"", |
|
|
isEditing:false, |
|
|
isEditing:false, |
|
@ -156,18 +161,61 @@ export default { |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
onSubmitTaskItem(){ |
|
|
onSubmitTaskItem(){ |
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
this.isEditing = false; |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/business/dcBatchFunctionsJobGroup/${this.propData.id}`, |
|
|
|
|
|
method: "GET" |
|
|
|
|
|
}).then(res=>{ |
|
|
|
|
|
this.editData = { |
|
|
|
|
|
id: res.data.id, |
|
|
|
|
|
groupName: res.data.groupName, |
|
|
|
|
|
status: res.data.status, |
|
|
|
|
|
remark: res.data.remark, |
|
|
|
|
|
detailedConfiguration: res.data.detailedConfiguration |
|
|
|
|
|
} |
|
|
|
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
onAddTaskGroup(){ |
|
|
onAddTaskGroup(){ |
|
|
this.isShowTimeEdit = true; |
|
|
this.isShowTimeEdit = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
onModifyTime(taskG){ |
|
|
|
|
|
this.editingTime = taskG.time; |
|
|
|
|
|
this.selectedTaskGroup = taskG; |
|
|
|
|
|
this.isShowTimeEdit = true; |
|
|
|
|
|
}, |
|
|
|
|
|
onDeleteTaskGroup(taskG){ |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/business/dcBatchFunctionsJob/time/${this.propData.id}/${taskG.time}`, |
|
|
|
|
|
method: "DELETE" |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
request({ |
|
|
|
|
|
url: `/business/dcBatchFunctionsJobGroup/${this.propData.id}`, |
|
|
|
|
|
method: "GET" |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
this.editData = { |
|
|
|
|
|
id: res.data.id, |
|
|
|
|
|
groupName: res.data.groupName, |
|
|
|
|
|
status: res.data.status, |
|
|
|
|
|
remark: res.data.remark, |
|
|
|
|
|
detailedConfiguration: res.data.detailedConfiguration |
|
|
|
|
|
} |
|
|
|
|
|
this.getTaskList(); //新增task后自动刷新任务列表 |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
onSubmitTime(time){ |
|
|
onSubmitTime(time){ |
|
|
this.isShowTimeEdit = false; |
|
|
this.isShowTimeEdit = false; |
|
|
this.taskGroupsEditing.push({ time, tasks: [] }); |
|
|
|
|
|
|
|
|
if (this.selectedTaskGroup){ |
|
|
|
|
|
this.selectedTaskGroup.time = time; |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.taskGroupsEditing.push({ time, tasks: [] }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let detailedConfiguration =[]; |
|
|
let detailedConfiguration =[]; |
|
|
this.taskGroupsEditing.forEach(item=>{ |
|
|
this.taskGroupsEditing.forEach(item=>{ |
|
|
detailedConfiguration.push({time:item.time, tasks:_.map(item.tasksEdit, "id")}); |
|
|
detailedConfiguration.push({time:item.time, tasks:_.map(item.tasksEdit, "jobId")}); |
|
|
}); |
|
|
}); |
|
|
request({ |
|
|
request({ |
|
|
url: `/business/dcBatchFunctionsJobGroup`, |
|
|
url: `/business/dcBatchFunctionsJobGroup`, |
|
@ -179,6 +227,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.then((result) => { |
|
|
.then((result) => { |
|
|
if (result.code != 200) return; |
|
|
if (result.code != 200) return; |
|
|
|
|
|
|
|
|
Message.success(`提交成功!`); |
|
|
Message.success(`提交成功!`); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
@ -186,10 +235,6 @@ export default { |
|
|
this.selectedTaskGroup = taskG; |
|
|
this.selectedTaskGroup = taskG; |
|
|
this.isEditing = true; |
|
|
this.isEditing = true; |
|
|
}, |
|
|
}, |
|
|
onModifyItem(newV , oldV){ |
|
|
|
|
|
console.log(newV, oldV , "修改条目》》》") |
|
|
|
|
|
// oldV.devices |
|
|
|
|
|
}, |
|
|
|
|
|
initEditingData(){ |
|
|
initEditingData(){ |
|
|
if(this.propData?.id){ |
|
|
if(this.propData?.id){ |
|
|
this.mode = "edit" |
|
|
this.mode = "edit" |
|
@ -212,7 +257,7 @@ export default { |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
getTaskList(){ |
|
|
getTaskList(){ |
|
|
this.taskGroupsEditing = JSON.parse(this.propData.detailedConfiguration); |
|
|
this.taskGroupsEditing = JSON.parse(this.editData.detailedConfiguration); |
|
|
// this.taskGroupsEditing = [{time:"08:00:00",tasks:[1],tasksEdit:[]}]; |
|
|
// this.taskGroupsEditing = [{time:"08:00:00",tasks:[1],tasksEdit:[]}]; |
|
|
|
|
|
|
|
|
// 测试代码开始 |
|
|
// 测试代码开始 |
|
@ -312,9 +357,16 @@ export default { |
|
|
font-size: 12px; |
|
|
font-size: 12px; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
.task{ |
|
|
.all_groups{ |
|
|
|
|
|
max-height:500px; |
|
|
|
|
|
overflow-y: scroll; |
|
|
|
|
|
} |
|
|
|
|
|
.task_group{ |
|
|
border: 1px solid #FFF; |
|
|
border: 1px solid #FFF; |
|
|
.task_info{ |
|
|
.task_info{ |
|
|
|
|
|
.time_show{ |
|
|
|
|
|
color: #0AC; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
.task_op{ |
|
|
.task_op{ |
|
|
} |
|
|
} |
|
|