From 8084ca7b0b1de9cc67964ca9662a36e4aa0185ad Mon Sep 17 00:00:00 2001 From: sheng <15292050171@163.com> Date: Tue, 1 Aug 2023 18:29:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E9=83=A8=E9=97=A8=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=20=E9=83=A8=E9=97=A8=E4=BF=A1=E6=81=AF=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dept/components/DeptUserCom/crud.tsx | 30 +++- .../dept/components/DeptUserCom/index.vue | 137 +++++++++++++++--- web/src/views/system/dept/index.vue | 8 +- .../menu/components/MenuFormCom/index.vue | 18 ++- 4 files changed, 149 insertions(+), 44 deletions(-) diff --git a/web/src/views/system/dept/components/DeptUserCom/crud.tsx b/web/src/views/system/dept/components/DeptUserCom/crud.tsx index 7895f6f..5b853fc 100644 --- a/web/src/views/system/dept/components/DeptUserCom/crud.tsx +++ b/web/src/views/system/dept/components/DeptUserCom/crud.tsx @@ -113,11 +113,31 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp columnSetDisabled: true, //禁止在列设置中选择 }, }, - username: { - title: '账号', + search: { + title: '关键词', + column: { + show: false, + }, search: { show: true, + component: { + props: { + clearable: true, + }, + placeholder: '请输入关键词', + }, }, + form: { + show: false, + component: { + props: { + clearable: true, + }, + }, + }, + }, + username: { + title: '账号', type: 'input', column: { minWidth: 100, //最小列宽 @@ -167,9 +187,6 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp }, name: { title: '姓名', - search: { - show: true, - }, type: 'input', column: { minWidth: 100, //最小列宽 @@ -273,9 +290,6 @@ export const createCrudOptions = function ({ crudExpose }: CreateCrudOptionsProp }, mobile: { title: '手机号码', - search: { - show: true, - }, type: 'input', column: { minWidth: 120, //最小列宽 diff --git a/web/src/views/system/dept/components/DeptUserCom/index.vue b/web/src/views/system/dept/components/DeptUserCom/index.vue index 7cec118..80f5616 100644 --- a/web/src/views/system/dept/components/DeptUserCom/index.vue +++ b/web/src/views/system/dept/components/DeptUserCom/index.vue @@ -1,16 +1,43 @@ diff --git a/web/src/views/system/dept/index.vue b/web/src/views/system/dept/index.vue index 78487ba..a6fe2a8 100644 --- a/web/src/views/system/dept/index.vue +++ b/web/src/views/system/dept/index.vue @@ -128,18 +128,18 @@ onMounted(() => { .dept-box { height: 100%; - padding: 10px; - background-color: #fff; + position: relative; box-sizing: border-box; } .dept-left { - position: relative; + background-color: #fff; border-radius: 0 8px 8px 0; + padding: 10px; } .dept-table { - border-radius: 8px 0 0 8px; margin-left: 10px; + padding-bottom: 10px; } diff --git a/web/src/views/system/menu/components/MenuFormCom/index.vue b/web/src/views/system/menu/components/MenuFormCom/index.vue index cad68e0..79929b3 100644 --- a/web/src/views/system/menu/components/MenuFormCom/index.vue +++ b/web/src/views/system/menu/components/MenuFormCom/index.vue @@ -80,13 +80,13 @@ - - - - + + + + @@ -128,10 +128,12 @@ const defaultTreeProps: any = { }; const validateWebPath = (rule: any, value: string, callback: Function) => { let pattern = /^\/.*?/; - if (!pattern.test(value)) { - callback(new Error('请输入正确的地址')); - } else { + let patternUrl = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/; + const reg = menuFormData.is_link ? patternUrl.test(value) : pattern.test(value); + if (reg) { callback(); + } else { + callback(new Error('请输入正确的地址')); } }; @@ -145,7 +147,7 @@ const emit = defineEmits(['drawerClose']); const formRef = ref>(); const rules = reactive({ - web_path: [{ required: true, message: '路由地址请以/开头', validator: validateWebPath, trigger: 'blur' }], + web_path: [{ required: true, message: '请输入正确的地址', validator: validateWebPath, trigger: 'blur' }], name: [{ required: true, message: '菜单名称必填', trigger: 'blur' }], component: [{ required: true, message: '请输入组件地址', trigger: 'blur' }], component_name: [{ required: true, message: '请输入组件名称', trigger: 'blur' }],