diff --git a/src/views/bpm/form/form.data.ts b/src/views/bpm/form/form.data.ts index d367da13..43c93dd7 100644 --- a/src/views/bpm/form/form.data.ts +++ b/src/views/bpm/form/form.data.ts @@ -10,7 +10,7 @@ export const rules = reactive({ // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '表单编号', action: true, columns: [ diff --git a/src/views/infra/apiAccessLog/apiAccessLog.data.ts b/src/views/infra/apiAccessLog/apiAccessLog.data.ts index 927e2330..b2d9786d 100644 --- a/src/views/infra/apiAccessLog/apiAccessLog.data.ts +++ b/src/views/infra/apiAccessLog/apiAccessLog.data.ts @@ -3,7 +3,7 @@ import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '日志编号', action: true, actionWidth: '80px', diff --git a/src/views/infra/apiErrorLog/apiErrorLog.data.ts b/src/views/infra/apiErrorLog/apiErrorLog.data.ts index 6471f64d..a539c167 100644 --- a/src/views/infra/apiErrorLog/apiErrorLog.data.ts +++ b/src/views/infra/apiErrorLog/apiErrorLog.data.ts @@ -3,7 +3,7 @@ import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '日志编号', action: true, actionWidth: '300', diff --git a/src/views/infra/fileConfig/fileConfig.data.ts b/src/views/infra/fileConfig/fileConfig.data.ts index d0f64869..ae351cfa 100644 --- a/src/views/infra/fileConfig/fileConfig.data.ts +++ b/src/views/infra/fileConfig/fileConfig.data.ts @@ -23,7 +23,7 @@ export const rules = reactive({ // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '配置编号', action: true, actionWidth: '400px', diff --git a/src/views/infra/job/JobLog.vue b/src/views/infra/job/JobLog.vue index 7f860cec..1bf9d745 100644 --- a/src/views/infra/job/JobLog.vue +++ b/src/views/infra/job/JobLog.vue @@ -70,7 +70,7 @@ const detailData = ref() // 详情 Ref // 详情操作 const handleDetail = async (row: JobLogApi.JobLogVO) => { // 设置数据 - const res = JobLogApi.getJobLogApi(row.id) + const res = await JobLogApi.getJobLogApi(row.id) detailData.value = res dialogTitle.value = t('action.detail') dialogVisible.value = true diff --git a/src/views/infra/job/job.data.ts b/src/views/infra/job/job.data.ts index a0fc3bec..38761cd7 100644 --- a/src/views/infra/job/job.data.ts +++ b/src/views/infra/job/job.data.ts @@ -11,7 +11,7 @@ export const rules = reactive({ // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '任务编号', action: true, actionWidth: '280px', diff --git a/src/views/infra/job/jobLog.data.ts b/src/views/infra/job/jobLog.data.ts index ac6e39f2..ccca3d08 100644 --- a/src/views/infra/job/jobLog.data.ts +++ b/src/views/infra/job/jobLog.data.ts @@ -4,7 +4,7 @@ const { t } = useI18n() // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '日志编号', action: true, columns: [ diff --git a/src/views/system/sms/smsChannel/sms.channel.data.ts b/src/views/system/sms/smsChannel/sms.channel.data.ts index d3a807ed..71b096e5 100644 --- a/src/views/system/sms/smsChannel/sms.channel.data.ts +++ b/src/views/system/sms/smsChannel/sms.channel.data.ts @@ -1,6 +1,10 @@ import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' + const { t } = useI18n() // 国际化 +const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE) + // 表单校验 export const rules = reactive({ signature: [required], @@ -24,8 +28,17 @@ const crudSchemas = reactive({ { title: '渠道编码', field: 'code', - dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, - isSearch: true + // dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, + // dictClass: 'string', + isSearch: true, + form: { + component: 'Select', + componentProps: { + options: authorizedGrantOptions, + multiple: false, + filterable: true + } + } }, { title: t('common.status'), diff --git a/src/views/system/sms/smsLog/index.vue b/src/views/system/sms/smsLog/index.vue index 93d1315f..334da2ad 100644 --- a/src/views/system/sms/smsLog/index.vue +++ b/src/views/system/sms/smsLog/index.vue @@ -44,12 +44,13 @@ const [registerTable, { exportList }] = useXTable({ // 弹窗相关的变量 const dialogVisible = ref(false) // 是否显示弹出层 -const dialogTitle = ref('edit') // 弹出层标题 +const dialogTitle = ref(t('action.detail')) // 弹出层标题 const actionType = ref('') // 操作按钮的类型 // ========== 详情相关 ========== const detailData = ref() // 详情 Ref const handleDetail = (row: SmsLoglApi.SmsLogVO) => { // 设置数据 + actionType.value = 'detail' detailData.value = row dialogVisible.value = true } diff --git a/src/views/system/sms/smsLog/sms.log.data.ts b/src/views/system/sms/smsLog/sms.log.data.ts index 4610ee62..c975bb0f 100644 --- a/src/views/system/sms/smsLog/sms.log.data.ts +++ b/src/views/system/sms/smsLog/sms.log.data.ts @@ -1,6 +1,9 @@ import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' +import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' + const { t } = useI18n() // 国际化 +const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE) // CrudSchema const crudSchemas = reactive({ primaryKey: 'id', @@ -25,9 +28,17 @@ const crudSchemas = reactive({ { title: '短信渠道', field: 'channelId', - dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, - dictClass: 'number', - isSearch: true + // dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, + // dictClass: 'number', + isSearch: true, + // table: { + // component: 'Select', + componentProps: { + options: authorizedGrantOptions + // multiple: false, + // filterable: true + } + // } }, { title: '发送状态', diff --git a/src/views/system/tenant/tenant.data.ts b/src/views/system/tenant/tenant.data.ts index 2aab1b90..adda1807 100644 --- a/src/views/system/tenant/tenant.data.ts +++ b/src/views/system/tenant/tenant.data.ts @@ -19,12 +19,44 @@ const getTenantPackageOptions = async () => { } getTenantPackageOptions() +const validateName = (rule: any, value: any, callback: any) => { + const reg = /^[a-zA-Z0-9]{4,30}$/ + if (value === '') { + callback(new Error('请输入用户名称')) + } else { + console.log(reg.test(rule), 'reg.test(rule)') + if (!reg.test(value)) { + callback(new Error('用户名称由 数字、字母 组成')) + } else { + callback() + } + } +} +const validateMobile = (rule: any, value: any, callback: any) => { + const reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/ + if (value === '') { + callback(new Error('请输入联系手机')) + } else { + if (!reg.test(value)) { + callback(new Error('请输入正确的手机号')) + } else { + callback() + } + } +} + // 表单校验 export const rules = reactive({ name: [required], packageId: [required], contactName: [required], - contactMobile: [required], + contactMobile: [ + required, + { + validator: validateMobile, + trigger: 'blur' + } + ], accountCount: [required], expireTime: [required], username: [ @@ -34,7 +66,8 @@ export const rules = reactive({ max: 30, trigger: 'blur', message: '用户名称长度为 4-30 个字符' - } + }, + { validator: validateName, trigger: 'blur' } ], password: [ required, @@ -90,7 +123,8 @@ const crudSchemas = reactive({ title: '用户名称', field: 'username', isTable: false, - isDetail: false + isDetail: false, + isForm: false }, { title: '用户密码', @@ -99,7 +133,8 @@ const crudSchemas = reactive({ isDetail: false, form: { component: 'InputPassword' - } + }, + isForm: false }, { title: '账号额度', diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue index 9222365b..c8f5756a 100644 --- a/src/views/system/tenantPackage/index.vue +++ b/src/views/system/tenantPackage/index.vue @@ -15,54 +15,54 @@ - - - -
- -
- - -
+ :schema="allSchemas.formSchema" + :rules="rules" + ref="formRef" + > + + + + + +