From a2bfe148d35f113dfd731ed40ba73dd1bb8dbc91 Mon Sep 17 00:00:00 2001 From: xuziqiang <1344691446@qq.com> Date: Tue, 23 Jul 2024 14:39:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9D=83=E9=99=90=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/router/equipmentManage.ts | 13 +++++++++- .../src/view/equipmentManage/group/config.ts | 28 +++++++++++----------- .../src/view/equipmentManage/group/index.vue | 17 ++++++++----- .../src/view/equipmentManage/ledger/config.ts | 2 +- 4 files changed, 38 insertions(+), 22 deletions(-) diff --git a/hx-ai-intelligent/src/router/equipmentManage.ts b/hx-ai-intelligent/src/router/equipmentManage.ts index 5cb2769..26cf030 100644 --- a/hx-ai-intelligent/src/router/equipmentManage.ts +++ b/hx-ai-intelligent/src/router/equipmentManage.ts @@ -39,7 +39,18 @@ const equipment = { meta: { title: '分组管理', keepAlive: false, - // backApi: [], + operates: [ + { title: '新增分组', code: 'GroupAdd' }, + { title: '删除分组', code: 'GroupDelete' }, + { title: '编辑分组', code: 'GroupEdit' }, + { title: '删除点位', code: 'GroupPointDelete' }, + { title: '编辑点位', code: 'GroupPointEdit' }, + { title: '导入点位', code: 'GroupPointImport' }, + { title: '导出点位', code: 'GroupPointExports' }, + { title: '模版下载', code: 'GroupTempDownload' }, + { title: '批量分组', code: 'GroupBatchGroup' }, + { title: '公式编辑', code: 'GroupFormulaEdit' }, + ], }, }, ], diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts index be69c2c..9cfd69c 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/group/config.ts @@ -225,7 +225,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { headerActions: [ { label: '编辑', - name: 'groupEdit', + name: 'GroupEdit', type: 'primary', dynamicDisabled: () => !defaultParams.value?.id, handle: (a, b) => { @@ -234,7 +234,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { }, { label: '批量删除', - name: 'groupBatDelete', + name: 'GroupDelete', type: 'primary', dynamicDisabled: (data: any) => { return data.list.length === 0; @@ -247,7 +247,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { }, { label: '批量导出', - name: 'groupExports', + name: 'GroupPointExports', type: 'primary', dynamicDisabled: (data: any) => { return data.list.length === 0; @@ -259,7 +259,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { }, { label: '批量导入', - name: 'groupImport', + name: 'GroupPointImport', type: 'primary', extra: { // api: props.postImportApi, // 导入接口名 @@ -277,7 +277,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { { label: '模板下载', - name: 'groupTemDownload', + name: 'GroupTempDownload', type: 'primary', handle: () => { // http.get('/asset/file/whiteListUser.xlsx'); @@ -291,7 +291,7 @@ export const tableConfig = (el, elGroup, elFormula, defaultParams) => { actions: [ { label: '删除', - name: 'groupDelete', + name: 'GroupDelete', dynamicParams: { linkIds: 'linkId[]' }, confirm: true, isClearCheck: true, @@ -346,7 +346,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { headerActions: [ { label: '编辑', - name: 'groupEdit', + name: 'GroupPointEdit', type: 'primary', handle: (a, b) => { el.value.toggle(); @@ -354,7 +354,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { }, { label: '批量删除', - name: 'groupTemDownload', + name: 'GroupPointDelete', type: 'primary', dynamicDisabled: (data: any) => { return data.list.length === 0; @@ -367,7 +367,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { }, { label: '批量导出', - name: 'groupExports', + name: 'GroupPointExports', type: 'primary', dynamicDisabled: (data: any) => { return data.list.length === 0; @@ -379,7 +379,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { }, { label: '批量导入', - name: 'groupImport', + name: 'GroupPointImport', type: 'primary', extra: { // api: props.postImportApi, // 导入接口名 @@ -397,7 +397,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { { label: '模板下载', - name: 'groupTemDownload', + name: 'GroupTempDownload', type: 'primary', handle: () => { // http.get('/asset/file/whiteListUser.xlsx'); @@ -407,7 +407,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { { label: '批量分组', - name: 'groupBatGroup', + name: 'GroupBatchGroup', type: 'primary', dynamicDisabled: (data: any) => { return data.list.length === 0; @@ -421,7 +421,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { }, { label: '公式编辑', - name: 'groupFormulaEdit', + name: 'GroupFormulaEdit', type: 'primary', handle: () => { elFormula.value.toggle(); @@ -435,7 +435,7 @@ export const tableConfigCal = (el, elGroup, elFormula, defaultParams) => { actions: [ { label: '删除', - name: 'groupDelete', + name: 'GroupPointDelete', dynamicParams: { ids: 'id[]' }, confirm: true, isReload: true, diff --git a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue index f093213..5cc1b0e 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/group/index.vue +++ b/hx-ai-intelligent/src/view/equipmentManage/group/index.vue @@ -27,9 +27,11 @@ @@ -54,6 +56,8 @@ import NsModalFrom from '/@/components/ns-modal-form.vue'; import { group } from '/@/api/deviceManage'; import { http } from '/nerv-lib/util/http'; + import { authorizationService } from '/nerv-lib/saas/store/modules/authorization-service'; + const { checkAllPermission } = authorizationService(); type opType = 'up' | 'down'; const { getParams } = useParams(); @@ -156,14 +160,15 @@ if (data.id === 'all') { list = ['addNodeSon']; } - return actions.filter(({ key }) => list.includes(key)); + const res = actions.filter(({ key, name }) => list.includes(key) && checkAllPermission(name)); + return res; }; const actionList = [ - { title: '新增子节点', key: 'addNodeSon', func: (data) => addNodeSon(data) }, - { title: '编辑', key: 'editNode', func: (data) => editNode(data) }, - { title: '上移', key: 'moveUp', func: (data) => moveNode(data, 'up') }, - { title: '下移', key: 'moveDown', func: (data) => moveNode(data, 'down') }, - { title: '删除', key: 'deleteNode', func: (data) => deleteNode(data) }, + { title: '新增子节点', name: 'GroupAdd', key: 'addNodeSon', func: (data) => addNodeSon(data) }, + { title: '编辑', name: 'GroupEdit', key: 'editNode', func: (data) => editNode(data) }, + { title: '上移', name: 'Group', key: 'moveUp', func: (data) => moveNode(data, 'up') }, + { title: '下移', name: 'Group', key: 'moveDown', func: (data) => moveNode(data, 'down') }, + { title: '删除', name: 'GroupDelete', key: 'deleteNode', func: (data) => deleteNode(data) }, ]; const handleSelect = (key, record) => { //清除选中行数据 diff --git a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts index 1c2cfc4..3420345 100644 --- a/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts +++ b/hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts @@ -34,7 +34,7 @@ export const tableConfig = (orgId) => { }, }, rowSelection: null, - scroll: { x: 2000 }, + // scroll: { x: 2000 }, columns: [ { title: '设备名称',