优化
This commit is contained in:
parent
85768dae2f
commit
c4661aedae
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<PageWrapper>
|
<PageWrapper>
|
||||||
<n-card>
|
<n-card>
|
||||||
<n-tabs v-model="activeName" @update:value="handleClick">
|
<n-tabs v-model="activeName" @update:value="handleClick" type="line">
|
||||||
<n-tab-pane
|
<n-tab-pane
|
||||||
:name="item.value"
|
:name="item.value"
|
||||||
:tab="item.configName"
|
:tab="item.configName"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import { NTag } from 'naive-ui';
|
import { NTag, NSwitch, useMessage } from 'naive-ui';
|
||||||
|
import { setJobStatus } from '@/api/monitor/job';
|
||||||
export const columns = [
|
export const columns = [
|
||||||
{
|
{
|
||||||
type: 'selection',
|
type: 'selection',
|
||||||
@ -82,6 +82,17 @@ export const columns = [
|
|||||||
title: '状态',
|
title: '状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
render(record) {
|
||||||
|
const message = useMessage();
|
||||||
|
return h(NSwitch, {
|
||||||
|
value: record.realStatus,
|
||||||
|
onUpdateValue: async (val) => {
|
||||||
|
record.realStatus = val;
|
||||||
|
await setJobStatus({ id: record.id, status: record.realStatus ? 1 : 0 });
|
||||||
|
message.success('设置成功');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
|
|||||||
@ -178,6 +178,13 @@
|
|||||||
const loadDataTable = async (res) => {
|
const loadDataTable = async (res) => {
|
||||||
rowKeys.value = [];
|
rowKeys.value = [];
|
||||||
const result = await getJobList({ ...formParams, ...res });
|
const result = await getJobList({ ...formParams, ...res });
|
||||||
|
result.records.map((item) => {
|
||||||
|
if (item.status == 0) {
|
||||||
|
item.realStatus = false;
|
||||||
|
} else {
|
||||||
|
item.realStatus = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -282,7 +289,7 @@
|
|||||||
negativeText: '取消',
|
negativeText: '取消',
|
||||||
onPositiveClick: async () => {
|
onPositiveClick: async () => {
|
||||||
await getJobRunOnce(record.id);
|
await getJobRunOnce(record.id);
|
||||||
message('执行成功');
|
message.success('执行成功');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-drawer v-model:show="props.visible" @after-leave="handleClose" :width="size">
|
<n-drawer v-model:show="props.visible" :width="size" @update:show="handleUpdate">
|
||||||
<n-drawer-content title="调度日志">
|
<n-drawer-content title="调度日志" closable>
|
||||||
<template #default>
|
<template #default>
|
||||||
<n-card :bordered="false" class="pt-3 mb-3 proCard">
|
<n-card :bordered="false" class="pt-3 mb-3 proCard">
|
||||||
<BasicForm @register="register" @submit="handleSubmit" @reset="handleReset">
|
<BasicForm @register="register" @submit="handleSubmit" @reset="handleReset">
|
||||||
@ -194,6 +194,15 @@
|
|||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
emit('update:visible', false);
|
emit('update:visible', false);
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 执行更新
|
||||||
|
* @param show 参数
|
||||||
|
*/
|
||||||
|
const handleUpdate = (show) => {
|
||||||
|
if (!show) {
|
||||||
|
handleClose();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行查看详情
|
* 执行查看详情
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user