fix: resolve global permission code collision with material_list prefix
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -71,7 +71,7 @@
|
||||
<el-icon style="margin-right: 5px"><Download /></el-icon>导出库存统计
|
||||
</el-button>
|
||||
|
||||
<el-button v-if="userStore.hasPermission('material:base:write')" type="primary" @click="handleAdd" style="margin-right: 10px">
|
||||
<el-button v-if="userStore.hasPermission('material_list:operation')" type="primary" @click="handleAdd" style="margin-right: 10px">
|
||||
<el-icon style="margin-right: 5px"><Plus /></el-icon>新增
|
||||
</el-button>
|
||||
|
||||
@ -210,15 +210,15 @@
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
:loading="scope.row.statusLoading"
|
||||
:disabled="!userStore.hasPermission('material:base:write')"
|
||||
:disabled="!userStore.hasPermission('material_list:operation')"
|
||||
@change="handleStatusChange(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="userStore.hasPermission('material:base:write') || userStore.hasPermission('material:base:delete')" label="操作" min-width="150" fixed="right" align="center">
|
||||
<el-table-column v-if="userStore.hasPermission('material_list:operation')" label="操作" min-width="150" fixed="right" align="center">
|
||||
<template #default="scope">
|
||||
<el-button v-if="userStore.hasPermission('material:base:write')" link type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button v-if="userStore.hasPermission('material:base:delete')" link type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button v-if="userStore.hasPermission('material_list:operation')" link type="primary" size="small" @click="handleEdit(scope.row)">编辑</el-button>
|
||||
<el-button v-if="userStore.hasPermission('material_list:operation')" link type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -507,18 +507,18 @@ const columns = reactive({
|
||||
|
||||
// 列与权限Code的映射关系(数据库中的code)
|
||||
const permissionMap: Record<string, string> = {
|
||||
id: 'id',
|
||||
companyName: 'companyName',
|
||||
name: 'name',
|
||||
commonName: 'commonName',
|
||||
category: 'category',
|
||||
type: 'type',
|
||||
spec: 'spec',
|
||||
unit: 'unit',
|
||||
inventory: 'inventoryCount', // 前端变量是 inventory,数据库Code是 inventoryCount
|
||||
available: 'availableCount', // 前端变量是 available,数据库Code是 availableCount
|
||||
files: 'files',
|
||||
isEnabled: 'isEnabled'
|
||||
id: 'material_list:id',
|
||||
companyName: 'material_list:companyName',
|
||||
name: 'material_list:name',
|
||||
commonName: 'material_list:commonName',
|
||||
category: 'material_list:category',
|
||||
type: 'material_list:type',
|
||||
spec: 'material_list:spec',
|
||||
unit: 'material_list:unit',
|
||||
inventory: 'material_list:inventoryCount', // 前端变量是 inventory,数据库Code是 inventoryCount
|
||||
available: 'material_list:availableCount', // 前端变量是 available,数据库Code是 availableCount
|
||||
files: 'material_list:files',
|
||||
isEnabled: 'material_list:isEnabled'
|
||||
};
|
||||
|
||||
// 根据用户权限初始化列显示状态
|
||||
|
||||
Reference in New Issue
Block a user