From 7a5a08d9a2dfbafc58c7b373974db2abcbf41d69 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Sat, 4 Mar 2023 10:37:07 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=A1=E9=AA=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/tenant/tenant.data.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/views/system/tenant/tenant.data.ts b/src/views/system/tenant/tenant.data.ts index 7e81138c..110bfbb3 100644 --- a/src/views/system/tenant/tenant.data.ts +++ b/src/views/system/tenant/tenant.data.ts @@ -27,6 +27,24 @@ export const rules = reactive({ contactMobile: [required], accountCount: [required], expireTime: [required], + username: [ + required, + { + min: 4, + max: 30, + trigger: 'blur', + message: '用户名称长度为 4-30 个字符' + } + ], + password: [ + required, + { + min: 4, + max: 16, + trigger: 'blur', + message: '密码长度为 4-16 位' + } + ], domain: [required], status: [required] }) From cea7b41ae83353de1baf6bd91b4130432caaf290 Mon Sep 17 00:00:00 2001 From: gexinzhineng/gxzn27 <1348660141@qq.com> Date: Sat, 4 Mar 2023 13:19:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=92=8C=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=AE=A1=E7=90=86=E7=9A=84=E8=8F=9C=E5=8D=95=E6=9D=83?= =?UTF-8?q?=E9=99=90=E4=B8=8D=E8=83=BD=E6=BB=9A=E5=8A=A8=20=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E6=96=B0=E5=A2=9E=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=B8=8D=E9=80=9A=E8=BF=87=20=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=AE=A1=E7=90=86=E8=AF=A6=E6=83=85=E9=A1=B5=E4=B8=8D?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=AF=B9=E5=BA=94=E7=9A=84=E9=83=A8=E9=97=A8?= =?UTF-8?q?=20XTable=E4=B8=AD=E4=B8=BB=E9=A2=98=E9=A2=9C=E8=89=B2=E4=B8=8D?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E9=A1=B9=E7=9B=AE=E4=B8=BB=E4=BD=93=E4=B8=80?= =?UTF-8?q?=E8=B5=B7=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/XTable/src/XTable.vue | 31 ++++++++++++++++--- .../tenantPackage/tenantPackage.data.ts | 7 ++++- src/views/system/user/index.vue | 24 +++++++++++++- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/src/components/XTable/src/XTable.vue b/src/components/XTable/src/XTable.vue index 34f91ce0..e5c503ec 100644 --- a/src/components/XTable/src/XTable.vue +++ b/src/components/XTable/src/XTable.vue @@ -12,7 +12,7 @@ import { useAppStore } from '@/store/modules/app' import { useDesign } from '@/hooks/web/useDesign' import { XTableProps } from './type' import { isBoolean, isFunction } from '@/utils/is' - +import styleCss from './style/dark.scss' import download from '@/utils/download' const { t } = useI18n() @@ -25,15 +25,38 @@ const prefixCls = getPrefixCls('x-vxe-table') const attrs = useAttrs() const emit = defineEmits(['register']) - +const removeStyles = () => { + var filename = 'cssTheme' + //移除引入的文件名 + var targetelement = 'style' + var targetattr = 'id' + var allsuspects = document.getElementsByTagName(targetelement) + for (var i = allsuspects.length; i >= 0; i--) { + if ( + allsuspects[i] && + allsuspects[i].getAttribute(targetattr) != null && + allsuspects[i].getAttribute(targetattr)?.indexOf(filename) != -1 + ) { + console.log(allsuspects[i], 'node') + allsuspects[i].parentNode?.removeChild(allsuspects[i]) + } + } +} +const reImport = () => { + var head = document.getElementsByTagName('head')[0] + var style = document.createElement('style') + style.innerText = styleCss + style.id = 'cssTheme' + head.appendChild(style) +} watch( () => appStore.getIsDark, () => { if (appStore.getIsDark == true) { - import('./style/dark.scss') + reImport() } if (appStore.getIsDark == false) { - import('./style/light.scss') + removeStyles() } }, { immediate: true } diff --git a/src/views/system/tenantPackage/tenantPackage.data.ts b/src/views/system/tenantPackage/tenantPackage.data.ts index e28ea842..de06c2cb 100644 --- a/src/views/system/tenantPackage/tenantPackage.data.ts +++ b/src/views/system/tenantPackage/tenantPackage.data.ts @@ -33,7 +33,12 @@ const crudSchemas = reactive({ { title: '菜单权限', field: 'menuIds', - isTable: false + isTable: false, + form: { + colProps: { + span: 24 + } + } }, { title: t('form.remark'), diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index bccab852..5568ca2a 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -159,7 +159,7 @@ :data="detailData" >