feat: 参数库权限

This commit is contained in:
JiangSheng
2026-04-15 10:40:19 +08:00
parent a766439d58
commit 86ffd59d0b
2 changed files with 37 additions and 9 deletions

View File

@@ -115,8 +115,9 @@ const currentTreeNodeInfo = ref<any>({});
const dirType = ref(DIR_TYPE.KNOWLEDGE);
const dirTypeList = computed(() => [
{ label: t('菜单.仿真标准库'), value: DIR_TYPE.KNOWLEDGE },
{ label: t('项目列表.项目数据'), value: DIR_TYPE.PROJECT_NODE },
{ label: t('菜单.仿真标准库'), value: DIR_TYPE.KNOWLEDGE },
{ label: t('菜单.仿真参数库'), value: DIR_TYPE.SIMULATION_PARAM },
{ label: t('菜单.仿真动画库'), value: DIR_TYPE.ANIMATION },
{ label: t('菜单.机器人库'), value: DIR_TYPE.ROBOT },
{ label: t('菜单.工业设计库'), value: DIR_TYPE.INDUSTRIAL_DESIGN },

View File

@@ -26,12 +26,20 @@
<!-- 审批中的节点 不允许修改删除 0-审核完成1-文件上传审核中2-文件修改审核中 3-文件删除审核中-->
<div v-if="!pageType">
<div class="options" v-if="!data.approveType">
<div class="edit" @click.stop="openEditFun(data)">
<div
v-if="parsePermission(data.permissionValue || 0).write"
class="edit"
@click.stop="openEditFun(data)"
>
<el-icon>
<EditPen />
</el-icon>
</div>
<div class="del" @click.stop="deleteParamFun(dataType[data.type], data)">
<div
v-if="parsePermission(data.permissionValue || 0).delete"
class="del"
@click.stop="deleteParamFun(dataType[data.type], data)"
>
<el-icon>
<Delete />
</el-icon>
@@ -66,34 +74,47 @@
<template #leftOptions v-if="!pageType">
<div class="options">
<el-button
type="primary"
v-if="currentNode?.type === 1 || !currentNode?.type"
type="primary"
@click="openCreateFun('lib')"
>
新增参数库
</el-button>
<el-button
v-if="
currentNode?.type === 1 &&
parsePermission(currentNode?.permissionValue || 0).write
"
type="primary"
v-if="currentNode?.type === 1"
@click="openCreateFun('type')"
>
新增分类
</el-button>
<el-button
v-if="currentNode?.type === 2"
v-if="
currentNode?.type === 2 &&
parsePermission(currentNode?.permissionValue || 0).write
"
type="primary"
@click="openCreateFun('param')"
>
新增参数对象
</el-button>
<template v-if="currentNode?.type === 3">
<el-button v-if="!currentNode.approveType" type="primary" @click="openParamFun"
<el-button
v-if="
!currentNode.approveType &&
parsePermission(currentNode?.permissionValue || 0).write
"
type="primary"
@click="openParamFun"
>新增参数</el-button
>
<el-button
v-if="
objFormatFun(newParamTableData) !== objFormatFun(paramTableData) &&
!currentNode.approveType
!currentNode.approveType &&
parsePermission(currentNode?.permissionValue || 0).write
"
type="primary"
@click="updateParamFun"
@@ -101,7 +122,10 @@
保存
</el-button>
<el-button
v-if="paramObjInfo.fileName"
v-if="
paramObjInfo.fileName &&
parsePermission(currentNode?.permissionValue || 0).export
"
@click="downloadFun(paramObjInfo.fileId)"
>
下载JSON文件
@@ -222,6 +246,7 @@ import ParamDetail from './components/addParam.vue';
import { downloadFileById } from '@/utils/file';
import { cloneDeep } from 'lodash-es';
import FileIcon from '@/components/common/fileIcon/index.vue';
import { parsePermission } from '@/utils/permission';
const currentNodeKey = ref<any>('');
const currentNode = ref<any>({});
@@ -269,6 +294,7 @@ const actionList = ref([
{
title: '编辑',
type: 'primary',
hide: () => !parsePermission(currentNode.value?.permissionValue || 0).write,
click: (row: any, index: number) => {
paramEditIndex.value = index;
paramData.value = row;
@@ -280,6 +306,7 @@ const actionList = ref([
type: 'danger',
needConfirm: true,
confirmTip: '确认删除参数吗?',
hide: () => !parsePermission(currentNode.value?.permissionValue || 0).delete,
click: (row: any, index: number) => {
newParamTableData.value.splice(index, 1);
paramTableRef.value.setDataFun(newParamTableData.value);