fks-yangshouda 4 months ago
parent
commit
c628c10f25
  1. 13
      hx-ai-intelligent/src/router/equipmentManage.ts
  2. 28
      hx-ai-intelligent/src/view/equipmentManage/group/config.ts
  3. 17
      hx-ai-intelligent/src/view/equipmentManage/group/index.vue
  4. 2
      hx-ai-intelligent/src/view/equipmentManage/ledger/config.ts

13
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' },
],
},
},
],

28
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,

17
hx-ai-intelligent/src/view/equipmentManage/group/index.vue

@ -27,9 +27,11 @@
<template #overlay>
<a-menu>
<template v-for="(item, index) in filterAction(actionList, data)" :key="index">
<!-- <div v-auth.all="item.name"> -->
<a-menu-item @click="item.func(data)">
<span>{{ item.title }}</span>
</a-menu-item>
<!-- </div> -->
</template>
</a-menu>
</template>
@ -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) => {
//

2
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: '设备名称',

Loading…
Cancel
Save