Skip to content

Commit cea7b41

Browse files
committed
租户和角色管理的菜单权限不能滚动
租户新增菜单权限校验不通过 角色管理详情页不展示对应的部门 XTable中主题颜色不跟随项目主体一起切换
1 parent 7a5a08d commit cea7b41

File tree

3 files changed

+56
-6
lines changed

3 files changed

+56
-6
lines changed

src/components/XTable/src/XTable.vue

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useAppStore } from '@/store/modules/app'
1212
import { useDesign } from '@/hooks/web/useDesign'
1313
import { XTableProps } from './type'
1414
import { isBoolean, isFunction } from '@/utils/is'
15-
15+
import styleCss from './style/dark.scss'
1616
import download from '@/utils/download'
1717
1818
const { t } = useI18n()
@@ -25,15 +25,38 @@ const prefixCls = getPrefixCls('x-vxe-table')
2525
2626
const attrs = useAttrs()
2727
const emit = defineEmits(['register'])
28-
28+
const removeStyles = () => {
29+
var filename = 'cssTheme'
30+
//移除引入的文件名
31+
var targetelement = 'style'
32+
var targetattr = 'id'
33+
var allsuspects = document.getElementsByTagName(targetelement)
34+
for (var i = allsuspects.length; i >= 0; i--) {
35+
if (
36+
allsuspects[i] &&
37+
allsuspects[i].getAttribute(targetattr) != null &&
38+
allsuspects[i].getAttribute(targetattr)?.indexOf(filename) != -1
39+
) {
40+
console.log(allsuspects[i], 'node')
41+
allsuspects[i].parentNode?.removeChild(allsuspects[i])
42+
}
43+
}
44+
}
45+
const reImport = () => {
46+
var head = document.getElementsByTagName('head')[0]
47+
var style = document.createElement('style')
48+
style.innerText = styleCss
49+
style.id = 'cssTheme'
50+
head.appendChild(style)
51+
}
2952
watch(
3053
() => appStore.getIsDark,
3154
() => {
3255
if (appStore.getIsDark == true) {
33-
import('./style/dark.scss')
56+
reImport()
3457
}
3558
if (appStore.getIsDark == false) {
36-
import('./style/light.scss')
59+
removeStyles()
3760
}
3861
},
3962
{ immediate: true }

src/views/system/tenantPackage/tenantPackage.data.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ const crudSchemas = reactive<VxeCrudSchema>({
3333
{
3434
title: '菜单权限',
3535
field: 'menuIds',
36-
isTable: false
36+
isTable: false,
37+
form: {
38+
colProps: {
39+
span: 24
40+
}
41+
}
3742
},
3843
{
3944
title: t('form.remark'),

src/views/system/user/index.vue

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
:data="detailData"
160160
>
161161
<template #deptId="{ row }">
162-
<span>{{ row.dept?.name }}</span>
162+
<el-tag>{{ dataFormater(row.deptId) }}</el-tag>
163163
</template>
164164
<template #postIds="{ row }">
165165
<template v-if="row.postIds !== ''">
@@ -332,6 +332,28 @@ const getPostOptions = async () => {
332332
const res = await listSimplePostsApi()
333333
postOptions.value.push(...res)
334334
}
335+
const dataFormater = (val) => {
336+
return deptFormater(deptOptions.value, val)
337+
}
338+
//部门回显
339+
const deptFormater = (ary, val: any) => {
340+
var o = ''
341+
if (ary && val) {
342+
for (const v of ary) {
343+
if (v.id == val) {
344+
o = v.name
345+
if (o) return o
346+
} else if (v.children?.length) {
347+
o = deptFormater(v.children, val)
348+
if (o) return o
349+
}
350+
}
351+
return o
352+
} else {
353+
return val
354+
}
355+
}
356+
335357
// 设置标题
336358
const setDialogTile = async (type: string) => {
337359
dialogTitle.value = t('action.' + type)

0 commit comments

Comments
 (0)