表单开发按钮权限 key字段跟后台保持一致

This commit is contained in:
shih
2026-03-28 10:35:28 +08:00
parent a4a03fb756
commit 213811c84d
3 changed files with 22 additions and 14 deletions

View File

@@ -99,7 +99,7 @@
></InputTimeRange> ></InputTimeRange>
</template> </template>
<template #header v-if="Object.keys(dimensionFields)?.length"> <template #header v-if="Object.keys(dimensionFields)?.length">
<div style="display:flex;align-items:center;border-top:1px solid #eee;margin-bottom:10px;padding-top:10px;"> <div style="display:flex;padding-top:10px;margin-bottom:10px;border-top:1px solid #eee;align-items:center;">
<span style="margin-right:10px;">维度:</span> <span style="margin-right:10px;">维度:</span>
<el-checkbox-group <el-checkbox-group
@change="searchDimension" v-model="tableSearch['Group by']" @change="searchDimension" v-model="tableSearch['Group by']"
@@ -190,7 +190,7 @@ const hideCols=ref<any>([])
const dictFieldList=ref<any>([]) const dictFieldList=ref<any>([])
const textAlignFiels=ref<any>({}) const textAlignFiels=ref<any>({})
const permissions = const permissions =
wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[route.meta.menuDataId as string] || false wsCache.get(CACHE_KEY.USER).lideeYunJipermissions?.[route.meta.menuDataId as string] || false
const selectIds = computed(() => { const selectIds = computed(() => {
return tableSelect.value.map((item) => item['id']) return tableSelect.value.map((item) => item['id'])
}) })
@@ -905,12 +905,15 @@ defineExpose({
:deep(.el-form-item--default){ :deep(.el-form-item--default){
margin-bottom: 10px; margin-bottom: 10px;
} }
:deep(.avue-crud__pagination){ :deep(.avue-crud__pagination){
padding-bottom: 0; padding-bottom: 0;
} }
:deep(.avue-crud__tip){ :deep(.avue-crud__tip){
display: none; display: none;
} }
.amountBox{ .amountBox{
&::after{ &::after{
content:'、' content:'、'
@@ -922,30 +925,35 @@ defineExpose({
} }
:deep(.el-table){ :deep(.el-table){
--el-table-border-color: #000;
.is-group th.el-table__cell,th.el-table__cell{ .is-group th.el-table__cell,th.el-table__cell{
background-color: #C6EFFE; background-color: #C6EFFE;
} }
.el-table__body tr.hover-row>td.el-table__cell{ .el-table__body tr.hover-row>td.el-table__cell{
background-color: #FFFFD2; background-color: #FFFFD2;
} }
&.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{ &.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
background-color: #FFFFD2; background-color: #FFFFD2;
} }
td.el-table__cell,th.el-table__cell{ td.el-table__cell,th.el-table__cell{
border-bottom: 1px solid #000 !important;
border-right: 1px solid #000 !important; border-right: 1px solid #000 !important;
border-bottom: 1px solid #000 !important;
} }
td.textAlignCell .cell{ td.textAlignCell .cell{
span{ span{
text-align: left;
width: 100%;
display: inline-block; display: inline-block;
width: 100%;
text-align: left;
} }
} }
--el-table-border-color: #000;
tfoot .el-table__cell{ tfoot .el-table__cell{
border-top: 1px solid #000 !important; border-top: 1px solid #000 !important;
} }

View File

@@ -552,7 +552,7 @@ const initButton = (data, context) => {
const { wsCache } = useCache() const { wsCache } = useCache()
const currentRoute = router.currentRoute.value const currentRoute = router.currentRoute.value
const currPath = currentRoute.meta?.menuDataId as string const currPath = currentRoute.meta?.menuDataId as string
const permissions = wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[currPath] || false const permissions = wsCache.get(CACHE_KEY.USER).lideeYunJipermissions?.[currPath] || false
const { model, defaultTip, tableId, getPermiKey, webConfigRoleButtonVoList, isSub } = context const { model, defaultTip, tableId, getPermiKey, webConfigRoleButtonVoList, isSub } = context
const defPermiObj = { const defPermiObj = {
addBtn: 'create', addChild: 'create', addBtn: 'create', addChild: 'create',

View File

@@ -33,7 +33,7 @@ interface DeptVO {
interface UserInfoVO { interface UserInfoVO {
permissions: object permissions: object
lideeYunjipermissions: object lideeYunJipermissions: object
roles: string[] roles: string[]
isSetUser: boolean isSetUser: boolean
user: UserVO user: UserVO
@@ -43,7 +43,7 @@ interface UserInfoVO {
export const useUserStore = defineStore('admin-user', { export const useUserStore = defineStore('admin-user', {
state: (): UserInfoVO => ({ state: (): UserInfoVO => ({
permissions: {}, permissions: {},
lideeYunjipermissions: {}, lideeYunJipermissions: {},
roles: [], roles: [],
isSetUser: false, isSetUser: false,
user: { user: {
@@ -58,8 +58,8 @@ export const useUserStore = defineStore('admin-user', {
getPermissions(): object { getPermissions(): object {
return this.permissions return this.permissions
}, },
getLideeYunjipermissions(): object { getLideeYunJipermissions(): object {
return this.lideeYunjipermissions return this.lideeYunJipermissions
}, },
getRoles(): string[] { getRoles(): string[] {
return this.roles return this.roles
@@ -82,7 +82,7 @@ export const useUserStore = defineStore('admin-user', {
userInfo = await getInfo() userInfo = await getInfo()
} }
this.permissions = userInfo.permissions this.permissions = userInfo.permissions
this.lideeYunjipermissions = userInfo.lideeYunjipermissions this.lideeYunJipermissions = userInfo.lideeYunJipermissions
this.roles = userInfo.roles this.roles = userInfo.roles
this.user = userInfo.user this.user = userInfo.user
this.deptInfo = userInfo.deptInfoList this.deptInfo = userInfo.deptInfoList
@@ -112,7 +112,7 @@ export const useUserStore = defineStore('admin-user', {
}, },
resetState() { resetState() {
this.permissions = {} this.permissions = {}
this.lideeYunjipermissions = {} this.lideeYunJipermissions = {}
this.roles = [] this.roles = []
this.isSetUser = false this.isSetUser = false
this.user = { this.user = {