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" >