From 93a97cd52635423db6dde8bfa908f851962d5d50 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 2 Aug 2022 10:19:02 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=92=8C=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin-vue3/src/utils/tree.ts | 4 ++-- .../infra/apiAccessLog/apiAccessLog.data.ts | 11 ++++++++++- .../views/infra/apiErrorLog/apiErrorLog.data.ts | 11 ++++++++++- .../src/views/infra/codegen/codegen.data.ts | 9 +++++++++ .../src/views/infra/config/config.data.ts | 9 +++++++++ .../dataSourceConfig/dataSourceConfig.data.ts | 9 +++++++++ .../views/infra/fileConfig/fileConfig.data.ts | 9 +++++++++ .../src/views/infra/fileList/fileList.data.ts | 9 +++++++++ .../src/views/pay/app/app.data.ts | 16 +++++++++++++--- .../src/views/pay/merchant/merchant.data.ts | 13 +++++++++++-- .../src/views/pay/order/order.data.ts | 16 ++++++++++++++++ .../src/views/pay/refund/refund.data.ts | 9 +++++++++ .../src/views/system/dept/dept.data.ts | 14 ++++++++++++++ .../src/views/system/dept/index.vue | 4 ++-- .../src/views/system/dict/dict.data.ts | 4 ++-- .../src/views/system/menu/index.vue | 17 +++++++++-------- .../src/views/system/notice/notice.data.ts | 3 +-- .../src/views/system/post/post.data.ts | 3 +-- .../system/sms/smsTemplate/sms.template.data.ts | 7 +++---- .../src/views/system/user/index.vue | 2 +- .../src/views/system/user/user.data.ts | 12 +++++++++++- yudao-ui-admin/src/views/system/dept/index.vue | 2 +- .../src/views/system/tenant/index.vue | 2 -- 23 files changed, 161 insertions(+), 34 deletions(-) diff --git a/yudao-ui-admin-vue3/src/utils/tree.ts b/yudao-ui-admin-vue3/src/utils/tree.ts index a82fb1c27..76ec0a2e1 100644 --- a/yudao-ui-admin-vue3/src/utils/tree.ts +++ b/yudao-ui-admin-vue3/src/utils/tree.ts @@ -213,7 +213,7 @@ export const eachTree = (treeDatas: any[], callBack: Fn, parentNode = {}) => { * @param {*} parentId 父节点字段 默认 'parentId' * @param {*} children 孩子节点字段 默认 'children' */ -export const handleTree = (data, id?: string, parentId?: string, children?: string) => { +export const handleTree = (data: any[], id?: string, parentId?: string, children?: string) => { const config = { id: id || 'id', parentId: parentId || 'parentId', @@ -222,7 +222,7 @@ export const handleTree = (data, id?: string, parentId?: string, children?: stri const childrenListMap = {} const nodeIds = {} - const tree = [] + const tree: any[] = [] for (const d of data) { const parentId = d[config.parentId] diff --git a/yudao-ui-admin-vue3/src/views/infra/apiAccessLog/apiAccessLog.data.ts b/yudao-ui-admin-vue3/src/views/infra/apiAccessLog/apiAccessLog.data.ts index 97fae4357..69423dd9d 100644 --- a/yudao-ui-admin-vue3/src/views/infra/apiAccessLog/apiAccessLog.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/apiAccessLog/apiAccessLog.data.ts @@ -50,7 +50,16 @@ const crudSchemas = reactive([ }, { label: '请求时间', - field: 'beginTime' + field: 'beginTime', + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } + } }, { label: '执行时长', diff --git a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/apiErrorLog.data.ts b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/apiErrorLog.data.ts index 8ded13e8e..404262be5 100644 --- a/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/apiErrorLog.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/apiErrorLog/apiErrorLog.data.ts @@ -50,7 +50,16 @@ const crudSchemas = reactive([ }, { label: '异常发生时间', - field: 'exceptionTime' + field: 'exceptionTime', + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } + } }, { label: '异常名', diff --git a/yudao-ui-admin-vue3/src/views/infra/codegen/codegen.data.ts b/yudao-ui-admin-vue3/src/views/infra/codegen/codegen.data.ts index 5253c9636..27e49ff31 100644 --- a/yudao-ui-admin-vue3/src/views/infra/codegen/codegen.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/codegen/codegen.data.ts @@ -50,6 +50,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/infra/config/config.data.ts b/yudao-ui-admin-vue3/src/views/infra/config/config.data.ts index c040d4fe3..425918d15 100644 --- a/yudao-ui-admin-vue3/src/views/infra/config/config.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/config/config.data.ts @@ -91,6 +91,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/dataSourceConfig.data.ts b/yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/dataSourceConfig.data.ts index 2d5869f2a..4431c0c45 100644 --- a/yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/dataSourceConfig.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/dataSourceConfig/dataSourceConfig.data.ts @@ -58,6 +58,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/infra/fileConfig/fileConfig.data.ts b/yudao-ui-admin-vue3/src/views/infra/fileConfig/fileConfig.data.ts index 6dd5e5e4a..b2383346f 100644 --- a/yudao-ui-admin-vue3/src/views/infra/fileConfig/fileConfig.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/fileConfig/fileConfig.data.ts @@ -76,6 +76,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/infra/fileList/fileList.data.ts b/yudao-ui-admin-vue3/src/views/infra/fileList/fileList.data.ts index 6984e693e..e203fd4cf 100644 --- a/yudao-ui-admin-vue3/src/views/infra/fileList/fileList.data.ts +++ b/yudao-ui-admin-vue3/src/views/infra/fileList/fileList.data.ts @@ -36,6 +36,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/pay/app/app.data.ts b/yudao-ui-admin-vue3/src/views/pay/app/app.data.ts index 652da6359..544428cba 100644 --- a/yudao-ui-admin-vue3/src/views/pay/app/app.data.ts +++ b/yudao-ui-admin-vue3/src/views/pay/app/app.data.ts @@ -8,9 +8,10 @@ const { t } = useI18n() // 国际化 // 表单校验 export const rules = reactive({ name: [required], - code: [required], - sort: [required], - status: [required] + status: [required], + payNotifyUrl: [required], + refundNotifyUrl: [required], + merchantId: [required] }) // CrudSchema @@ -53,6 +54,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/pay/merchant/merchant.data.ts b/yudao-ui-admin-vue3/src/views/pay/merchant/merchant.data.ts index 7db448ea9..53a2dc581 100644 --- a/yudao-ui-admin-vue3/src/views/pay/merchant/merchant.data.ts +++ b/yudao-ui-admin-vue3/src/views/pay/merchant/merchant.data.ts @@ -7,9 +7,9 @@ const { t } = useI18n() // 国际化 // 表单校验 export const rules = reactive({ + no: [required], name: [required], - code: [required], - sort: [required], + shortName: [required], status: [required] }) @@ -77,6 +77,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/pay/order/order.data.ts b/yudao-ui-admin-vue3/src/views/pay/order/order.data.ts index e16b9979f..8cdf1c9b0 100644 --- a/yudao-ui-admin-vue3/src/views/pay/order/order.data.ts +++ b/yudao-ui-admin-vue3/src/views/pay/order/order.data.ts @@ -157,6 +157,22 @@ const crudSchemas = reactive([ label: '渠道订单号', field: 'channelOrderNo' }, + { + label: t('common.createTime'), + field: 'createTime', + form: { + show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } + } + }, { label: t('table.action'), field: 'action', diff --git a/yudao-ui-admin-vue3/src/views/pay/refund/refund.data.ts b/yudao-ui-admin-vue3/src/views/pay/refund/refund.data.ts index 19c8e8ec9..6d1fef177 100644 --- a/yudao-ui-admin-vue3/src/views/pay/refund/refund.data.ts +++ b/yudao-ui-admin-vue3/src/views/pay/refund/refund.data.ts @@ -84,6 +84,15 @@ const crudSchemas = reactive([ field: 'createTime', form: { show: false + }, + search: { + show: true, + component: 'DatePicker', + componentProps: { + type: 'datetimerange', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)] + } } }, { diff --git a/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts b/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts index 0116a6463..ad6458699 100644 --- a/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts +++ b/yudao-ui-admin-vue3/src/views/system/dept/dept.data.ts @@ -1,5 +1,19 @@ import { required } from '@/utils/formRules' import { reactive } from 'vue' +// 表单校验 +export const rules = reactive({ + name: [required], + sort: [required], + email: [required], + phone: [ + { + pattern: + /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/, + trigger: 'blur', + message: '请输入正确的手机号码' + } + ] +}) export const modelSchema = reactive([ { diff --git a/yudao-ui-admin-vue3/src/views/system/dept/index.vue b/yudao-ui-admin-vue3/src/views/system/dept/index.vue index 020e38d89..5dcbd10b5 100644 --- a/yudao-ui-admin-vue3/src/views/system/dept/index.vue +++ b/yudao-ui-admin-vue3/src/views/system/dept/index.vue @@ -5,7 +5,7 @@ import { handleTree } from '@/utils/tree' import { onMounted, ref, unref, watch } from 'vue' import * as DeptApi from '@/api/system/dept' import { Form, FormExpose } from '@/components/Form' -import { modelSchema } from './dept.data' +import { modelSchema, rules } from './dept.data' import { DeptVO } from '@/api/system/dept/types' import { useMessage } from '@/hooks/web/useMessage' import { getListSimpleUsersApi } from '@/api/system/user' @@ -159,7 +159,7 @@ onMounted(async () => {
-
+