1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import { reactive } from 'vue'
- import { DICT_TYPE } from '@/utils/dict'
- import { required } from '@/utils/formRules'
- import { useI18n } from '@/hooks/web/useI18n'
- import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
- const { t } = useI18n() // 国际化
- // 表单校验
- export const rules = reactive({
- name: [required],
- handlerName: [required],
- cronExpression: [required],
- retryCount: [required],
- retryInterval: [required]
- })
- // CrudSchema
- const crudSchemas = reactive<VxeCrudSchema>({
- primaryKey: 'id',
- primaryType: 'seq',
- primaryTitle: '任务编号',
- action: true,
- actionWidth: '500px',
- columns: [
- {
- title: '任务名称',
- field: 'name',
- search: {
- show: true
- }
- },
- {
- title: t('common.status'),
- field: 'status',
- dictType: DICT_TYPE.INFRA_JOB_STATUS,
- dictClass: 'number',
- isForm: false
- },
- {
- title: '处理器的名字',
- field: 'handlerName',
- isSearch: true
- },
- {
- title: '处理器的参数',
- field: 'handlerParam',
- isTable: false
- },
- {
- title: 'CRON 表达式',
- field: 'cronExpression'
- },
- {
- title: '后续执行时间',
- field: 'nextTimes',
- isTable: false,
- isForm: false
- },
- {
- title: '重试次数',
- field: 'retryCount',
- isTable: false
- },
- {
- title: '重试间隔',
- field: 'retryInterval',
- isTable: false
- },
- {
- title: '监控超时时间',
- field: 'monitorTimeout',
- isTable: false
- }
- ]
- })
- export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|