Commit b6508529 authored by LiXuyang's avatar LiXuyang

落标检查-任务运维页面

parent 69eb6d55
<template>
<BasicModal
width="40%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicForm @register="registerForm">
<template #cycle="{ field, model }">
<div class="flex">
<Select style="flex: 2" v-model:value="model[field]" :options="cycleOptions" />
<Input style="flex: 1" v-model:value="model.cycleDes" />
</div>
</template>
</BasicForm>
</BasicModal>
</template>
<script lang="ts" setup>
import { Select, Input } from 'ant-design-vue';
import BasicModal from '@/components/Modal/src/BasicModal.vue';
import { useModalInner } from '@/components/Modal';
import { ref, unref } from 'vue';
import { useForm } from '@/components/Form';
import { copyModalFormSchema } from '@/views/dataStandards/labelDropInspection/label.data';
import BasicForm from '@/components/Form/src/BasicForm.vue';
import { editModalFormSchema } from '@/views/dataStandards/labelDropInspection/labelOperation/operation.data';
// 初始化
// 数据
const getTitle = '编辑';
const isUpdate = ref();
const isMove = ref();
const rowId = ref();
const cycleOptions = [
{
label: 'Cron表达式',
value: 'Cron表达式',
},
{
label: '无周期',
value: '无周期',
},
];
/**
* 方法
*/
function handleSubmit() {
closeModal();
}
/**
* 弹窗
*/
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
console.log('data', data);
await resetFields();
setModalProps({ confirmLoading: false });
isUpdate.value = !!data?.isUpdate;
isMove.value = !!data?.isMove;
if (unref(isUpdate)) {
// 获取行数据的id
rowId.value = data.record.businessId;
// 塞值
await setFieldsValue({
...data.record,
});
}
});
/**
* form
*/
const [registerForm, { setFieldsValue, resetFields }] = useForm({
labelWidth: 100,
baseColProps: { lg: 24, md: 24 },
schemas: editModalFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
</script>
<style scoped></style>
......@@ -78,49 +78,29 @@
<Icon class="icon" icon="ion:paper-plane-outline" />
</a-button>
<!--上线-->
<a-button
type="link"
:disabled="getDisabled()"
@click="handleUpload()"
class="button"
>
<Icon class="icon" icon="ion:cloud-upload-outline" @click="handleUp()" />
<a-button type="link" :disabled="getDisabled()" @click="handleUp()" class="button">
<Icon class="icon" icon="ion:cloud-upload-outline" />
</a-button>
<!--下线-->
<a-button
type="link"
:disabled="getDisabled()"
@click="handleUpload()"
class="button"
>
<Icon class="icon" icon="ion:cloud-download-outline" @click="handleDown()" />
<a-button type="link" :disabled="getDisabled()" @click="handleDown()" class="button">
<Icon class="icon" icon="ion:cloud-download-outline" />
</a-button>
<!--运行/计时-->
<a-button
type="link"
:disabled="getDisabled()"
@click="handleUpload()"
class="button"
>
<Icon class="icon" icon="ion:play-circle-outline" @click="handleDebug()" />
<a-button type="link" :disabled="getDisabled()" @click="handleDebug()" class="button">
<Icon class="icon" icon="ion:play-circle-outline" />
</a-button>
<!--禁用/删除-->
<a-button
type="link"
:disabled="getDisabled()"
@click="handleUpload()"
@click="handleDelete()"
class="button"
>
<Icon class="icon" icon="ion:ban-outline" @click="handleDelete()" />
<Icon class="icon" icon="ion:ban-outline" />
</a-button>
<!--运行-->
<a-button
type="link"
:disabled="getDisabled()"
@click="handleUpload()"
class="button"
>
<Icon class="icon" icon="ion:caret-forward-outline" @click="handleRun()" />
<a-button type="link" :disabled="getDisabled()" @click="handleRun()" class="button">
<Icon class="icon" icon="ion:caret-forward-outline" />
</a-button>
</div>
</div>
......@@ -159,8 +139,8 @@
</div>
</div>
<div class="h-bt-group">
<CaretRightOutlined class="icon" />
<EditOutlined class="icon" />
<CaretRightOutlined @click="handleRun()" class="icon" />
<EditOutlined @click="handleEdit()" class="icon" />
</div>
</div>
<div class="data">
......@@ -194,9 +174,24 @@
<div class="run-table">
<BasicTable @register="runTable">
<template #toolbar>
<a-button :disabled="getRunSelectRows().length <= 0" type="link">重跑</a-button>
<a-button :disabled="getRunSelectRows().length <= 0" type="link">错误恢复</a-button>
<a-button :disabled="getRunSelectRows().length <= 0" type="link">取消执行</a-button>
<a-button
:disabled="getRunSelectRows().length <= 0"
type="link"
@click="handleReRun()"
>重跑</a-button
>
<a-button
:disabled="getRunSelectRows().length <= 0"
type="link"
@click="handleErrRestore()"
>错误恢复</a-button
>
<a-button
:disabled="getRunSelectRows().length <= 0"
type="link"
@click="handleCancelRun()"
>取消执行</a-button
>
</template>
<template #runStatus="{ text, record }">
<div class="icon-column">
......@@ -221,9 +216,11 @@
},
{
label: '重跑',
onClick: handleReRun.bind(null),
},
{
label: '取消执行',
onClick: handleCancelRun.bind(null),
},
]"
/>
......@@ -234,6 +231,7 @@
</div>
</div>
</template>
<EditModal @register="editModal" />
</PageWrapper>
</template>
......@@ -266,9 +264,12 @@
import TableAction from '@/components/Table/src/components/TableAction.vue';
import { useMessage } from '@/hooks/web/useMessage';
import * as echarts from 'echarts';
import EditModal from '@/views/dataStandards/labelDropInspection/labelOperation/editModal.vue';
import { useModal } from '@/components/Modal';
// 初始化
const { createMessage, createConfirm } = useMessage();
const [editModal, { openModal: openEditModal }] = useModal();
const queryParams = ref({
searchArea: ['个人工作区', '共享工作区'],
timeType: '调度时间',
......@@ -401,6 +402,52 @@
});
}
// 重跑
function handleReRun() {
createConfirm({
iconType: 'warning',
title: '确认重跑',
content: '确认重跑吗?',
onOk() {
createMessage.success('重跑成功!');
reload();
},
});
}
// 错误恢复
function handleErrRestore() {
createConfirm({
iconType: 'warning',
title: '确认错误恢复',
content: '确认错误恢复吗?',
onOk() {
createMessage.success('错误恢复成功!');
reload();
},
});
}
// 取消执行
function handleCancelRun() {
createConfirm({
iconType: 'warning',
title: '确认取消执行',
content: '确认取消执行吗?',
onOk() {
createMessage.success('取消执行成功!');
reload();
},
});
}
// 编辑
function handleEdit() {
openEditModal(true, {
...data.value,
});
}
// 查看是否禁用
function getDisabled() {
let flag = true;
......
import { BasicColumn } from '@/components/Table';
import { BasicColumn, FormSchema } from '@/components/Table';
export const runTableColumn: BasicColumn[] = [
{
......@@ -32,3 +32,10 @@ export const runTableColumn: BasicColumn[] = [
slots: { customRender: 'checkResult' },
},
];
export const editModalFormSchema: FormSchema[] = [
{
field: 'cycle',
label: '调度周期',
slot: 'cycle',
},
];
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