zant-admin 1.0.4 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +414 -25
- package/README.md +460 -285
- package/bin/cli.js +3 -3
- package/bin/generator.js +502 -502
- package/bin/prompts.js +158 -158
- package/bin/utils.js +133 -133
- package/package.json +2 -2
- package/public/logo.png +0 -0
- package/src/App.vue +16 -16
- package/src/api/methods/department.js +36 -0
- package/src/api/methods/employee.js +22 -0
- package/src/api/methods/logError.js +8 -8
- package/src/api/methods/logOperation.js +8 -8
- package/src/api/methods/login.js +6 -6
- package/src/api/methods/position.js +26 -0
- package/src/api/methods/quartz.js +36 -36
- package/src/api/methods/region.js +16 -16
- package/src/api/methods/sysAccount.js +29 -29
- package/src/api/methods/sysDict.js +29 -29
- package/src/api/methods/sysDictItem.js +26 -26
- package/src/api/methods/sysMenu.js +42 -42
- package/src/api/methods/sysRole.js +35 -35
- package/src/api/methods/sysUser.js +25 -25
- package/src/api/methods/system.js +15 -15
- package/src/api/request.js +225 -225
- package/src/assets/css/style.css +2 -2
- package/src/assets/css/zcui.css +1023 -1023
- package/src/assets/imgs/logo.png +0 -0
- package/src/assets/imgs/md/console.png +0 -0
- package/src/assets/imgs/md/login.png +0 -0
- package/src/assets/imgs/md/menu.png +0 -0
- package/src/assets/imgs/md/serviceMonitoring.png +0 -0
- package/src/assets/imgs/md/statistics.png +0 -0
- package/src/components/FormTable.vue +5 -19
- package/src/components/IconPicker.vue +351 -351
- package/src/components/MainPage.vue +838 -838
- package/src/components/details/logErrorDetails.vue +58 -58
- package/src/components/details/logOperationDetails.vue +76 -76
- package/src/components/edit/QuartzEdit.vue +221 -221
- package/src/components/edit/SysAccountEdit.vue +185 -185
- package/src/components/edit/SysDictEdit.vue +116 -116
- package/src/components/edit/SysDictItemEdit.vue +136 -136
- package/src/components/edit/SysRoleEdit.vue +111 -111
- package/src/components/edit/organizationalStructure/DepartmentEdit.vue +162 -0
- package/src/components/edit/organizationalStructure/EmployeeEdit.vue +295 -0
- package/src/components/edit/organizationalStructure/PositionEdit.vue +166 -0
- package/src/components/edit/sysMenuEdit.vue +2 -1
- package/src/config/index.js +74 -74
- package/src/directives/permission.js +49 -49
- package/src/main.js +37 -37
- package/src/router/index.js +4 -6
- package/src/stores/config.js +43 -43
- package/src/stores/dict.js +33 -33
- package/src/stores/menu.js +81 -81
- package/src/stores/user.js +21 -21
- package/src/utils/baseEcharts.js +661 -661
- package/src/utils/dictTemplate.js +26 -26
- package/src/utils/regionUtils.js +173 -173
- package/src/utils/useFormCRUD.js +59 -59
- package/src/views/baiscstatis/center.vue +474 -474
- package/src/views/baiscstatis/iframePage.vue +29 -29
- package/src/views/baiscstatis/notFound.vue +192 -192
- package/src/views/console.vue +821 -821
- package/src/views/demo/button.vue +269 -269
- package/src/views/demo/importexport.vue +119 -119
- package/src/views/demo/region.vue +322 -322
- package/src/views/demo/statistics.vue +214 -214
- package/src/views/home.vue +6 -6
- package/src/views/login.vue +264 -149
- package/src/views/operations/log/logError.vue +78 -78
- package/src/views/operations/log/logLogin.vue +66 -66
- package/src/views/operations/log/logOperation.vue +103 -103
- package/src/views/operations/log/logQuartz.vue +56 -56
- package/src/views/operations/quartz.vue +179 -179
- package/src/views/operations/serviceMonitoring.vue +134 -134
- package/src/views/organizationalStructure/department.vue +194 -0
- package/src/views/organizationalStructure/employee.vue +234 -0
- package/src/views/organizationalStructure/position.vue +196 -0
- package/src/views/system/sysAccount.vue +128 -128
- package/src/views/system/sysDict.vue +159 -159
- package/src/views/system/sysDictItem.vue +118 -118
- package/src/views/system/sysMenu.vue +225 -225
- package/src/views/system/sysRole.vue +207 -207
- package/src/assets/imgs/md/1.png +0 -0
- package/src/assets/imgs/md/10.png +0 -0
- package/src/assets/imgs/md/11.png +0 -0
- package/src/assets/imgs/md/2.png +0 -0
- package/src/assets/imgs/md/3.png +0 -0
- package/src/assets/imgs/md/4.png +0 -0
- package/src/assets/imgs/md/5.png +0 -0
- package/src/assets/imgs/md/6.png +0 -0
- package/src/assets/imgs/md/7.png +0 -0
- package/src/assets/imgs/md/8.png +0 -0
- package/src/assets/imgs/md/9.png +0 -0
|
@@ -1,221 +1,221 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-drawer
|
|
3
|
-
:title="editTitle"
|
|
4
|
-
:width="540"
|
|
5
|
-
:open="open"
|
|
6
|
-
:body-style="{ paddingBottom: '80px' }"
|
|
7
|
-
:footer-style="{ textAlign: 'right' }"
|
|
8
|
-
@close="onClose"
|
|
9
|
-
:destroyOnClose="true"
|
|
10
|
-
>
|
|
11
|
-
<a-form :model="formInfo" ref="formRef" layout="vertical" :rules="rules">
|
|
12
|
-
<a-row :gutter="16">
|
|
13
|
-
<a-col :span="12">
|
|
14
|
-
<a-form-item
|
|
15
|
-
label="任务名称"
|
|
16
|
-
name="name"
|
|
17
|
-
:rules="[{ required: true, message: '任务名称不能为空' }]"
|
|
18
|
-
>
|
|
19
|
-
<a-input v-model:value="formInfo.name" placeholder="请输入" />
|
|
20
|
-
</a-form-item>
|
|
21
|
-
<a-form-item
|
|
22
|
-
label="触发器名称"
|
|
23
|
-
name="triggerName"
|
|
24
|
-
:rules="[{ required: true, message: '触发器名称不能为空' }]"
|
|
25
|
-
>
|
|
26
|
-
<a-input
|
|
27
|
-
v-model:value="formInfo.triggerName"
|
|
28
|
-
placeholder="请输入"
|
|
29
|
-
/>
|
|
30
|
-
</a-form-item>
|
|
31
|
-
|
|
32
|
-
<a-form-item label="任务类型" name="taskType">
|
|
33
|
-
<a-select v-model:value="formInfo.taskType" placeholder="请选择">
|
|
34
|
-
<a-select-option value="0">DLL</a-select-option>
|
|
35
|
-
<a-select-option value="1">API</a-select-option>
|
|
36
|
-
</a-select>
|
|
37
|
-
</a-form-item>
|
|
38
|
-
</a-col>
|
|
39
|
-
<a-col :span="12">
|
|
40
|
-
<a-form-item
|
|
41
|
-
label="任务分组"
|
|
42
|
-
name="jobGroup"
|
|
43
|
-
:rules="[{ required: true, message: '任务分组不能为空' }]"
|
|
44
|
-
>
|
|
45
|
-
<a-input v-model:value="formInfo.jobGroup" placeholder="请输入" />
|
|
46
|
-
</a-form-item>
|
|
47
|
-
<a-form-item
|
|
48
|
-
label="运行时间表达式Cron"
|
|
49
|
-
name="cron"
|
|
50
|
-
:rules="[{ required: true, message: 'cron不能为空' }]"
|
|
51
|
-
>
|
|
52
|
-
<a-input v-model:value="formInfo.cron" placeholder="请输入" />
|
|
53
|
-
</a-form-item>
|
|
54
|
-
<a target="_blank" href="https://cron.ciding.cc/">在线表达式Cron</a>
|
|
55
|
-
</a-col>
|
|
56
|
-
</a-row>
|
|
57
|
-
<a-form-item
|
|
58
|
-
v-if="formInfo.taskType == 0"
|
|
59
|
-
label="程序集名称"
|
|
60
|
-
name="assemblyName"
|
|
61
|
-
>
|
|
62
|
-
<a-input
|
|
63
|
-
v-model:value="formInfo.assemblyName"
|
|
64
|
-
disabled="true"
|
|
65
|
-
placeholder="请输入"
|
|
66
|
-
/>
|
|
67
|
-
</a-form-item>
|
|
68
|
-
<a-form-item
|
|
69
|
-
v-if="formInfo.taskType == 0"
|
|
70
|
-
label="任务类名"
|
|
71
|
-
name="className"
|
|
72
|
-
>
|
|
73
|
-
<a-select
|
|
74
|
-
v-model:value="formInfo.className"
|
|
75
|
-
placeholder="请选择"
|
|
76
|
-
:options="classNameList"
|
|
77
|
-
>
|
|
78
|
-
</a-select>
|
|
79
|
-
</a-form-item>
|
|
80
|
-
<a-form-item v-if="formInfo.taskType == 1" label="apiUrl" name="apiUrl">
|
|
81
|
-
<a-input v-model:value="formInfo.apiUrl" placeholder="请输入" />
|
|
82
|
-
</a-form-item>
|
|
83
|
-
<a-form-item
|
|
84
|
-
v-if="formInfo.taskType == 1"
|
|
85
|
-
label="APi访问类型"
|
|
86
|
-
name="apiRequestType"
|
|
87
|
-
>
|
|
88
|
-
<a-select v-model:value="formInfo.apiRequestType" placeholder="请选择">
|
|
89
|
-
<a-select-option value="POST">POST</a-select-option>
|
|
90
|
-
<a-select-option value="GET">GET</a-select-option>
|
|
91
|
-
</a-select>
|
|
92
|
-
</a-form-item>
|
|
93
|
-
<a-form-item label="参数" name="apiParameter">
|
|
94
|
-
<a-input v-model:value="formInfo.apiParameter" placeholder="请输入" />
|
|
95
|
-
</a-form-item>
|
|
96
|
-
<a-form-item label="是否开启日志" name="isLog">
|
|
97
|
-
<a-switch v-model:checked="formInfo.isLog" />
|
|
98
|
-
</a-form-item>
|
|
99
|
-
<a-form-item label="备注" name="remark">
|
|
100
|
-
<a-textarea v-model:value="formInfo.remark" />
|
|
101
|
-
</a-form-item>
|
|
102
|
-
</a-form>
|
|
103
|
-
<template #extra>
|
|
104
|
-
<a-space>
|
|
105
|
-
<a-button type="primary" @click="onSave" :loading="loading"
|
|
106
|
-
>保存</a-button
|
|
107
|
-
>
|
|
108
|
-
<a-button @click="resetForm">重置</a-button>
|
|
109
|
-
</a-space>
|
|
110
|
-
</template>
|
|
111
|
-
</a-drawer>
|
|
112
|
-
</template>
|
|
113
|
-
<script setup>
|
|
114
|
-
import { defineProps, defineEmits, ref, reactive, onMounted } from 'vue'
|
|
115
|
-
import { message } from 'ant-design-vue'
|
|
116
|
-
import quartz from '@/api/methods/quartz'
|
|
117
|
-
import useFormCRUD from '@/utils/useFormCRUD'
|
|
118
|
-
const props = defineProps({
|
|
119
|
-
open: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
required: true,
|
|
122
|
-
},
|
|
123
|
-
})
|
|
124
|
-
// 表单字段的默认值
|
|
125
|
-
const defaultformInfo = {
|
|
126
|
-
id: null,
|
|
127
|
-
name: '',
|
|
128
|
-
triggerName: '',
|
|
129
|
-
jobGroup: '',
|
|
130
|
-
cron: '',
|
|
131
|
-
taskType: '0',
|
|
132
|
-
assemblyName: '',
|
|
133
|
-
className: null,
|
|
134
|
-
apiUrl: '',
|
|
135
|
-
apiRequestType: 'POST',
|
|
136
|
-
apiParameter: '',
|
|
137
|
-
isLog: true,
|
|
138
|
-
remark: '',
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// 响应式数据
|
|
142
|
-
const formInfo = reactive({ ...defaultformInfo })
|
|
143
|
-
const editTitle = ref('新增')
|
|
144
|
-
const formRef = ref(null)
|
|
145
|
-
const classNameList = ref([])
|
|
146
|
-
|
|
147
|
-
// 定义 emits,用于触发关闭事件
|
|
148
|
-
const emit = defineEmits(['close', 'updateData'])
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* 重置表单到默认值
|
|
152
|
-
*/
|
|
153
|
-
const resetForm = () => {
|
|
154
|
-
Object.assign(formInfo, defaultformInfo)
|
|
155
|
-
formRef.value?.resetFields()
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const { loading, save } = useFormCRUD(quartz)
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* 初始化任务编辑表单
|
|
162
|
-
* @param {string} id - 任务ID,如果为空或默认UUID则表示新增任务
|
|
163
|
-
*/
|
|
164
|
-
const init = async id => {
|
|
165
|
-
const isEdit = !!id
|
|
166
|
-
editTitle.value = isEdit ? '修改' : '新增'
|
|
167
|
-
|
|
168
|
-
let assemblyData = null
|
|
169
|
-
try {
|
|
170
|
-
// 获取程序集信息
|
|
171
|
-
const res = await quartz.getAssembly()
|
|
172
|
-
assemblyData = res.data
|
|
173
|
-
classNameList.value = assemblyData.classJobs.map(x => ({
|
|
174
|
-
label: x,
|
|
175
|
-
value: x,
|
|
176
|
-
}))
|
|
177
|
-
} catch (error) {
|
|
178
|
-
message.error('获取程序集信息失败,请重试')
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (isEdit) {
|
|
182
|
-
try {
|
|
183
|
-
const res = await quartz.get({ id })
|
|
184
|
-
Object.assign(formInfo, res.data)
|
|
185
|
-
} catch (error) {
|
|
186
|
-
message.error('获取任务信息失败,请重试')
|
|
187
|
-
}
|
|
188
|
-
} else {
|
|
189
|
-
resetForm()
|
|
190
|
-
// 在新增模式下,设置程序集名称
|
|
191
|
-
if (assemblyData) {
|
|
192
|
-
formInfo.assemblyName = assemblyData.assemblyName
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* 保存任务信息
|
|
199
|
-
* 处理表单验证和任务新增/修改操作
|
|
200
|
-
*/
|
|
201
|
-
const onSave = async () => {
|
|
202
|
-
await save(formRef.value, formInfo, {
|
|
203
|
-
onSuccess: () => {
|
|
204
|
-
emit('updateData')
|
|
205
|
-
onClose()
|
|
206
|
-
},
|
|
207
|
-
})
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* 关闭抽屉组件
|
|
212
|
-
* 触发关闭事件并通知父组件
|
|
213
|
-
*/
|
|
214
|
-
const onClose = () => {
|
|
215
|
-
resetForm()
|
|
216
|
-
emit('close')
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// 使用 defineExpose 暴露方法
|
|
220
|
-
defineExpose({ init })
|
|
221
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<a-drawer
|
|
3
|
+
:title="editTitle"
|
|
4
|
+
:width="540"
|
|
5
|
+
:open="open"
|
|
6
|
+
:body-style="{ paddingBottom: '80px' }"
|
|
7
|
+
:footer-style="{ textAlign: 'right' }"
|
|
8
|
+
@close="onClose"
|
|
9
|
+
:destroyOnClose="true"
|
|
10
|
+
>
|
|
11
|
+
<a-form :model="formInfo" ref="formRef" layout="vertical" :rules="rules">
|
|
12
|
+
<a-row :gutter="16">
|
|
13
|
+
<a-col :span="12">
|
|
14
|
+
<a-form-item
|
|
15
|
+
label="任务名称"
|
|
16
|
+
name="name"
|
|
17
|
+
:rules="[{ required: true, message: '任务名称不能为空' }]"
|
|
18
|
+
>
|
|
19
|
+
<a-input v-model:value="formInfo.name" placeholder="请输入" />
|
|
20
|
+
</a-form-item>
|
|
21
|
+
<a-form-item
|
|
22
|
+
label="触发器名称"
|
|
23
|
+
name="triggerName"
|
|
24
|
+
:rules="[{ required: true, message: '触发器名称不能为空' }]"
|
|
25
|
+
>
|
|
26
|
+
<a-input
|
|
27
|
+
v-model:value="formInfo.triggerName"
|
|
28
|
+
placeholder="请输入"
|
|
29
|
+
/>
|
|
30
|
+
</a-form-item>
|
|
31
|
+
|
|
32
|
+
<a-form-item label="任务类型" name="taskType">
|
|
33
|
+
<a-select v-model:value="formInfo.taskType" placeholder="请选择">
|
|
34
|
+
<a-select-option value="0">DLL</a-select-option>
|
|
35
|
+
<a-select-option value="1">API</a-select-option>
|
|
36
|
+
</a-select>
|
|
37
|
+
</a-form-item>
|
|
38
|
+
</a-col>
|
|
39
|
+
<a-col :span="12">
|
|
40
|
+
<a-form-item
|
|
41
|
+
label="任务分组"
|
|
42
|
+
name="jobGroup"
|
|
43
|
+
:rules="[{ required: true, message: '任务分组不能为空' }]"
|
|
44
|
+
>
|
|
45
|
+
<a-input v-model:value="formInfo.jobGroup" placeholder="请输入" />
|
|
46
|
+
</a-form-item>
|
|
47
|
+
<a-form-item
|
|
48
|
+
label="运行时间表达式Cron"
|
|
49
|
+
name="cron"
|
|
50
|
+
:rules="[{ required: true, message: 'cron不能为空' }]"
|
|
51
|
+
>
|
|
52
|
+
<a-input v-model:value="formInfo.cron" placeholder="请输入" />
|
|
53
|
+
</a-form-item>
|
|
54
|
+
<a target="_blank" href="https://cron.ciding.cc/">在线表达式Cron</a>
|
|
55
|
+
</a-col>
|
|
56
|
+
</a-row>
|
|
57
|
+
<a-form-item
|
|
58
|
+
v-if="formInfo.taskType == 0"
|
|
59
|
+
label="程序集名称"
|
|
60
|
+
name="assemblyName"
|
|
61
|
+
>
|
|
62
|
+
<a-input
|
|
63
|
+
v-model:value="formInfo.assemblyName"
|
|
64
|
+
disabled="true"
|
|
65
|
+
placeholder="请输入"
|
|
66
|
+
/>
|
|
67
|
+
</a-form-item>
|
|
68
|
+
<a-form-item
|
|
69
|
+
v-if="formInfo.taskType == 0"
|
|
70
|
+
label="任务类名"
|
|
71
|
+
name="className"
|
|
72
|
+
>
|
|
73
|
+
<a-select
|
|
74
|
+
v-model:value="formInfo.className"
|
|
75
|
+
placeholder="请选择"
|
|
76
|
+
:options="classNameList"
|
|
77
|
+
>
|
|
78
|
+
</a-select>
|
|
79
|
+
</a-form-item>
|
|
80
|
+
<a-form-item v-if="formInfo.taskType == 1" label="apiUrl" name="apiUrl">
|
|
81
|
+
<a-input v-model:value="formInfo.apiUrl" placeholder="请输入" />
|
|
82
|
+
</a-form-item>
|
|
83
|
+
<a-form-item
|
|
84
|
+
v-if="formInfo.taskType == 1"
|
|
85
|
+
label="APi访问类型"
|
|
86
|
+
name="apiRequestType"
|
|
87
|
+
>
|
|
88
|
+
<a-select v-model:value="formInfo.apiRequestType" placeholder="请选择">
|
|
89
|
+
<a-select-option value="POST">POST</a-select-option>
|
|
90
|
+
<a-select-option value="GET">GET</a-select-option>
|
|
91
|
+
</a-select>
|
|
92
|
+
</a-form-item>
|
|
93
|
+
<a-form-item label="参数" name="apiParameter">
|
|
94
|
+
<a-input v-model:value="formInfo.apiParameter" placeholder="请输入" />
|
|
95
|
+
</a-form-item>
|
|
96
|
+
<a-form-item label="是否开启日志" name="isLog">
|
|
97
|
+
<a-switch v-model:checked="formInfo.isLog" />
|
|
98
|
+
</a-form-item>
|
|
99
|
+
<a-form-item label="备注" name="remark">
|
|
100
|
+
<a-textarea v-model:value="formInfo.remark" />
|
|
101
|
+
</a-form-item>
|
|
102
|
+
</a-form>
|
|
103
|
+
<template #extra>
|
|
104
|
+
<a-space>
|
|
105
|
+
<a-button type="primary" @click="onSave" :loading="loading"
|
|
106
|
+
>保存</a-button
|
|
107
|
+
>
|
|
108
|
+
<a-button @click="resetForm">重置</a-button>
|
|
109
|
+
</a-space>
|
|
110
|
+
</template>
|
|
111
|
+
</a-drawer>
|
|
112
|
+
</template>
|
|
113
|
+
<script setup>
|
|
114
|
+
import { defineProps, defineEmits, ref, reactive, onMounted } from 'vue'
|
|
115
|
+
import { message } from 'ant-design-vue'
|
|
116
|
+
import quartz from '@/api/methods/quartz'
|
|
117
|
+
import useFormCRUD from '@/utils/useFormCRUD'
|
|
118
|
+
const props = defineProps({
|
|
119
|
+
open: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
required: true,
|
|
122
|
+
},
|
|
123
|
+
})
|
|
124
|
+
// 表单字段的默认值
|
|
125
|
+
const defaultformInfo = {
|
|
126
|
+
id: null,
|
|
127
|
+
name: '',
|
|
128
|
+
triggerName: '',
|
|
129
|
+
jobGroup: '',
|
|
130
|
+
cron: '',
|
|
131
|
+
taskType: '0',
|
|
132
|
+
assemblyName: '',
|
|
133
|
+
className: null,
|
|
134
|
+
apiUrl: '',
|
|
135
|
+
apiRequestType: 'POST',
|
|
136
|
+
apiParameter: '',
|
|
137
|
+
isLog: true,
|
|
138
|
+
remark: '',
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// 响应式数据
|
|
142
|
+
const formInfo = reactive({ ...defaultformInfo })
|
|
143
|
+
const editTitle = ref('新增')
|
|
144
|
+
const formRef = ref(null)
|
|
145
|
+
const classNameList = ref([])
|
|
146
|
+
|
|
147
|
+
// 定义 emits,用于触发关闭事件
|
|
148
|
+
const emit = defineEmits(['close', 'updateData'])
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 重置表单到默认值
|
|
152
|
+
*/
|
|
153
|
+
const resetForm = () => {
|
|
154
|
+
Object.assign(formInfo, defaultformInfo)
|
|
155
|
+
formRef.value?.resetFields()
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const { loading, save } = useFormCRUD(quartz)
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* 初始化任务编辑表单
|
|
162
|
+
* @param {string} id - 任务ID,如果为空或默认UUID则表示新增任务
|
|
163
|
+
*/
|
|
164
|
+
const init = async id => {
|
|
165
|
+
const isEdit = !!id
|
|
166
|
+
editTitle.value = isEdit ? '修改' : '新增'
|
|
167
|
+
|
|
168
|
+
let assemblyData = null
|
|
169
|
+
try {
|
|
170
|
+
// 获取程序集信息
|
|
171
|
+
const res = await quartz.getAssembly()
|
|
172
|
+
assemblyData = res.data
|
|
173
|
+
classNameList.value = assemblyData.classJobs.map(x => ({
|
|
174
|
+
label: x,
|
|
175
|
+
value: x,
|
|
176
|
+
}))
|
|
177
|
+
} catch (error) {
|
|
178
|
+
message.error('获取程序集信息失败,请重试')
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (isEdit) {
|
|
182
|
+
try {
|
|
183
|
+
const res = await quartz.get({ id })
|
|
184
|
+
Object.assign(formInfo, res.data)
|
|
185
|
+
} catch (error) {
|
|
186
|
+
message.error('获取任务信息失败,请重试')
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
resetForm()
|
|
190
|
+
// 在新增模式下,设置程序集名称
|
|
191
|
+
if (assemblyData) {
|
|
192
|
+
formInfo.assemblyName = assemblyData.assemblyName
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* 保存任务信息
|
|
199
|
+
* 处理表单验证和任务新增/修改操作
|
|
200
|
+
*/
|
|
201
|
+
const onSave = async () => {
|
|
202
|
+
await save(formRef.value, formInfo, {
|
|
203
|
+
onSuccess: () => {
|
|
204
|
+
emit('updateData')
|
|
205
|
+
onClose()
|
|
206
|
+
},
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* 关闭抽屉组件
|
|
212
|
+
* 触发关闭事件并通知父组件
|
|
213
|
+
*/
|
|
214
|
+
const onClose = () => {
|
|
215
|
+
resetForm()
|
|
216
|
+
emit('close')
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// 使用 defineExpose 暴露方法
|
|
220
|
+
defineExpose({ init })
|
|
221
|
+
</script>
|