|
@@ -154,6 +154,31 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <el-dialog v-model="restartPopUpWindowVisable" title="重启任务" width="500">
|
|
|
+ <div class="mt-8">
|
|
|
+ <el-form :model="restartFrom">
|
|
|
+ <el-form-item label="重启时间" label-width="7em" prop="showStartDelayData">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="restartFrom.timesList"
|
|
|
+ type="daterange"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ style="width: 300px"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <div class="text-[#ff4e4e] ml-8">重启任务的时间不能在今天之前</div>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="restartPopUpWindowVisable = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="restartTaksTime">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
<TaskModal :visible="taskModalVisible" :title="isEdit ? '编辑任务' : '新建任务'" :save-loading="taskLoading"
|
|
|
:edit-form="taskForm" :show-log="isEdit" @close="closeTaskModal" @submit="submitForm" />
|
|
|
<ImportModal :visible="importVisible" :save-loading="importLoading" @close="closeImportModal"
|
|
@@ -188,6 +213,9 @@ const len = computed(() => {
|
|
|
return tableRef.value?.getSelectionRows().length
|
|
|
})
|
|
|
const taskLoading = ref<saveLoadingType>("1");
|
|
|
+const restartPopUpWindowVisable = ref(false);
|
|
|
+const restartFrom = ref<any>({});
|
|
|
+
|
|
|
function closeTaskModal() {
|
|
|
taskModalVisible.value = false;
|
|
|
taskForm.value = null;
|
|
@@ -388,17 +416,36 @@ function finishRow(item: any) {
|
|
|
globalPopup?.showError(err.msg)
|
|
|
})
|
|
|
}
|
|
|
-function restart(item: any) {
|
|
|
+
|
|
|
+function restartTaksTime() {
|
|
|
+ const { id, timesList } = restartFrom.value
|
|
|
+ const date = dayjs().format("YYYY-MM-DD")
|
|
|
+ if(timesList[0] < date) {
|
|
|
+ globalPopup?.showInfo("开始时间不能在今天之前")
|
|
|
+ return
|
|
|
+ }
|
|
|
post(UPDATE_TASK_STATUS, {
|
|
|
- id: item.id,
|
|
|
- status: 0
|
|
|
+ id, status: 0,
|
|
|
+ startDate: timesList[0],
|
|
|
+ endDate: timesList[1]
|
|
|
}).then(() => {
|
|
|
search()
|
|
|
globalPopup?.showSuccess("操作成功")
|
|
|
+ restartPopUpWindowVisable.value = false
|
|
|
}).catch(err => {
|
|
|
globalPopup?.showError(err.msg)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+function restart(item: any) {
|
|
|
+ const starDate = item.startDate ? item.startDate : dayjs().format("YYYY-MM-DD")
|
|
|
+ const endDate = item.endDate ? item.endDate : dayjs().format("YYYY-MM-DD")
|
|
|
+ restartFrom.value = {
|
|
|
+ ...item,
|
|
|
+ timesList: [starDate, endDate]
|
|
|
+ }
|
|
|
+ restartPopUpWindowVisable.value = true
|
|
|
+}
|
|
|
function deleteRow(item: any) {
|
|
|
confirmAction("确定删除吗?").then(() => {
|
|
|
post(DELETE_TASKS, {
|