diff --git a/src/views/monitor/job/columns.ts b/src/views/monitor/job/columns.ts index 7b8bdc0..0a8b0d9 100644 --- a/src/views/monitor/job/columns.ts +++ b/src/views/monitor/job/columns.ts @@ -16,7 +16,7 @@ export const columns = [ { title: '任务名称', key: 'jobName', - width: 150, + width: 200, }, { title: '任务分组', diff --git a/src/views/monitor/job/edit.vue b/src/views/monitor/job/edit.vue index 1220198..328bf8d 100644 --- a/src/views/monitor/job/edit.vue +++ b/src/views/monitor/job/edit.vue @@ -132,20 +132,20 @@ const emit = defineEmits(['success', 'update:visible']); const formRef = ref(); + const message = useMessage(); /** * 定义表单参数 */ - const message = useMessage(); const formData = reactive({ id: '', jobName: '', jobAlias: '', - jobGroup: undefined, + jobGroup: '', jobTrigger: '', - status: undefined, + status: '', cronExpression: '', - executePolicy: undefined, + executePolicy: '', isSync: 0, url: '', note: '', @@ -166,11 +166,10 @@ default: 0, }, }); - const [modalRegister, { openModal, setSubLoading }] = useModal({ - title: props.jobId ? '编辑任务' : '添加任务', - subBtuText: '确定', - width: 600, - }); + + /** + * 定义数据源 + */ const jobGroupList = [{ label: 'DEFAULT', value: 'DEFAULT' }]; const statusList = [ { label: '未发布', value: 0 }, @@ -183,6 +182,16 @@ { label: '执行一次', value: 2 }, { label: '放弃执行', value: 3 }, ]; + + /** + * 定义模态 + */ + const [modalRegister, { openModal, setSubLoading }] = useModal({ + title: props.jobId ? '编辑任务' : '添加任务', + subBtuText: '确定', + width: 600, + }); + /** * 执行提交 */ @@ -229,7 +238,10 @@ setFormData(); } }); - //导出方法 + + /** + * 定义函数 + */ defineExpose({ openModal, }); diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 814b361..c7eda5d 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -27,7 +27,6 @@ 新建 - { rowKeys.value = []; const result = await getJobList({ ...formParams, ...res }); return result; }; + /** + * 数据行选中事件 + * @param keys 参数 + */ function onCheckedRow(keys) { rowKeys.value = keys; } + /** + * 刷新数据列表 + * @param noRefresh 参数 + */ function reloadTable(noRefresh = '') { basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); } + /** + * 执行提交表单 + * @param values 参数 + */ function handleSubmit(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -194,6 +210,10 @@ reloadTable(); } + /** + * 执行重置 + * @param values 参数 + */ function handleReset(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -204,6 +224,9 @@ reloadTable(); } + /** + * 执行注册 + */ const [register, {}] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, labelWidth: 110, @@ -219,6 +242,7 @@ await nextTick(); createModalRef.value.openModal(); }; + /** * 执行编辑 */ @@ -228,6 +252,7 @@ await nextTick(); createModalRef.value.openModal(); } + /** * 执行变更状态 * @param record 参数 @@ -244,6 +269,7 @@ }, }); }; + /** * 执行一次 */ @@ -259,6 +285,7 @@ }, }); }; + /** * 执行查看日志 * @param record 参数 @@ -269,6 +296,7 @@ editLogVisible.value = true; jobId.value = record.id; }; + /** * 执行删除 * @param id 参数 diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue index 6a581e7..fb1f671 100644 --- a/src/views/monitor/online/index.vue +++ b/src/views/monitor/online/index.vue @@ -13,8 +13,7 @@ :style="{ minHeight: fwbHeight + 'px' }" :paginate-single-page="false" :data="onlineTableData.slice((pager.page - 1) * pager.size, pager.page * pager.size)" - > - + /> { rowKeys.value = []; const result = await getTableList({ ...formParams, ...res }); return result; }; + /** + * 数据行选中事件 + * @param keys 参数 + */ function onCheckedRow(keys) { rowKeys.value = keys; } + /** + * 刷新数据列表 + * @param noRefresh 参数 + */ function reloadTable(noRefresh = '') { basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 }); } + /** + * 执行提交表单 + * @param values 参数 + */ function handleSubmit(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -106,6 +127,10 @@ reloadTable(); } + /** + * 执行重置 + * @param values 参数 + */ function handleReset(values: Recordable) { for (const key in formParams) { formParams[key] = ''; @@ -116,6 +141,9 @@ reloadTable(); } + /** + * 执行注册 + */ const [register, {}] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' }, labelWidth: 100,