代码提交
This commit is contained in:
26
src/api/admin/user.js
Normal file
26
src/api/admin/user.js
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import createAxios from '@/utils/request'
|
||||||
|
|
||||||
|
// 密码规则修改
|
||||||
|
export function ruleUpdate(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/password/ruleUpdate',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取密码规则
|
||||||
|
export function getRule(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/password/getRule',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 解锁超级管理员
|
||||||
|
export function unlockRoot(data) {
|
||||||
|
return createAxios({
|
||||||
|
url: '/user-boot/password/unlockRoot',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
63
src/api/auditManage/auditList.ts
Normal file
63
src/api/auditManage/auditList.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import createAxios from '@/utils/request'
|
||||||
|
|
||||||
|
//筛选下拉列表参数
|
||||||
|
export function getAllUserList() {
|
||||||
|
return createAxios({
|
||||||
|
url: "/user-boot/user/getAllUserSimpleList",
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//审计日志列表
|
||||||
|
export function getAuditLog(data:any) {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/audit/getAuditLog",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//审计日志统计
|
||||||
|
export function censusAuditLog(data:any) {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/audit/censusAuditLog",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//日志文件备份
|
||||||
|
export function logFileWriter(data:any) {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/audit/logFileWriter",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//日志文件恢复
|
||||||
|
export function recoverLogFile(data:any) {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/audit/recoverLogFile",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取在线用户
|
||||||
|
export function getOnlineUsers(data:any) {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/audit/getOnlineUsers",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//获取表空间大小
|
||||||
|
export function getMemoInfo(data:any) {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/audit/getMemoInfo",
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
export function getSysConfig() {
|
||||||
|
return createAxios({
|
||||||
|
url: "/system-boot/config/getSysConfig",
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
99
src/api/device-boot/transformerStrategy.ts
Normal file
99
src/api/device-boot/transformerStrategy.ts
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 变压器台账分页查询
|
||||||
|
export function transformerPage(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/transformerPage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页查询变压器策略
|
||||||
|
export function flgployPage(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTflgploy/flgployPage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//变压器台账新增
|
||||||
|
export function insertTransformer(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/insertTransformer',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//新增变压器策略
|
||||||
|
export function insertFlgPloy(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTflgploy/insertFlgPloy',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//变压器台账修改
|
||||||
|
export function updateTransformer(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/updateTransformer',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//变压器策略详情
|
||||||
|
export function getFlgPloyInfo(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTflgploy/getFlgPloyInfo',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//修改变压器策略
|
||||||
|
export function updateFlgPloy(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTflgploy/updateFlgPloy',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//变压器台账删除
|
||||||
|
export function delTransformer(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/delTransformer',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//删除变压器策略
|
||||||
|
export function delFlgPloy(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTflgploy/delFlgPloy',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取变压器台账 树
|
||||||
|
export function getTransformerTree() {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/getTransformerTree',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//获取上下节点信息
|
||||||
|
export function getGeneratrix(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/getGeneratrix',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//变电站节点维护
|
||||||
|
export function nodeMaintenance(data: any) {
|
||||||
|
return request({
|
||||||
|
url: '/device-boot/pqsTransformer/nodeMaintenance',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
43
src/components/tree/pqs/deviceTree.vue
Normal file
43
src/components/tree/pqs/deviceTree.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<div class="point-tree">
|
||||||
|
<div style="flex: 1; overflow: hidden">
|
||||||
|
<Tree ref="treeRef" :data="tree" style="width: 100%; height: 100%" :canExpand="false" v-bind="$attrs" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||||
|
import Tree from '../index.vue'
|
||||||
|
import { getTransformerTree } from '@/api/device-boot/transformerStrategy'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'pms/deviceTree'
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['init'])
|
||||||
|
const attrs = useAttrs()
|
||||||
|
|
||||||
|
const tree = ref()
|
||||||
|
const treeRef = ref()
|
||||||
|
|
||||||
|
const loadData = () => {
|
||||||
|
getTransformerTree().then(res => {
|
||||||
|
tree.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
loadData()
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
loadData
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.point-tree {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid var(--el-border-color);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -243,6 +243,26 @@ export const adminBaseRoute = {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'BusinessAdministrator/TerminalManagement',
|
||||||
|
name: '变压器策略',
|
||||||
|
meta: {
|
||||||
|
title: pageTitle('runManage'),
|
||||||
|
icon: 'ep:management',
|
||||||
|
alwaysShow: true
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'addLedger',
|
||||||
|
component: () =>
|
||||||
|
import('@/views/pqs/business/terminal/transformerStrategy/components/addLedger.vue'),
|
||||||
|
name: '变压器台账配置',
|
||||||
|
meta: {
|
||||||
|
title: pageTitle('router.addLedger')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/boX',
|
path: '/boX',
|
||||||
name: 'boX',
|
name: 'boX',
|
||||||
@@ -337,6 +357,7 @@ const staticRoutes: Array<RouteRecordRaw> = [
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
55
src/views/pqs/auditManage/onlineUsers/index.vue
Normal file
55
src/views/pqs/auditManage/onlineUsers/index.vue
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader select :showReset="false" ref="TableHeaderRef"></TableHeader>
|
||||||
|
<Table ref="tableRef" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
defineOptions({
|
||||||
|
name: 'BusinessAdministrator/Audit/Operations/onlineUsers'
|
||||||
|
})
|
||||||
|
|
||||||
|
const formTabRef = ref()
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const show = ref(false)
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/system-boot/audit/getOnlineUsers',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
// {
|
||||||
|
// field: 'index',
|
||||||
|
// title: '序号',
|
||||||
|
// width: '80',
|
||||||
|
// formatter: (row: any) => {
|
||||||
|
// return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{ field: 'name', title: '昵称' },
|
||||||
|
{ field: 'loginName', title: '登录名' },
|
||||||
|
{
|
||||||
|
field: 'phone',
|
||||||
|
title: '手机号',
|
||||||
|
formatter(row: any) {
|
||||||
|
return row.phone ? row.phone : '/'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ field: 'time', title: '登录过期时间' },
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: '状态',
|
||||||
|
formatter(row: any) {
|
||||||
|
return row.status ? row.status : '在线'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
43
src/views/pqs/auditManage/userInfo/index.vue
Normal file
43
src/views/pqs/auditManage/userInfo/index.vue
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader datePicker :showReset="false" ref="TableHeaderRef">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label="筛选数据">
|
||||||
|
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table ref="tableRef" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
defineOptions({
|
||||||
|
name: 'BusinessAdministrator/Audit/Operations/userLoginInformation'
|
||||||
|
})
|
||||||
|
|
||||||
|
const formTabRef = ref()
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/system-boot/audit/getAuditLog',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
{ field: 'userName', title: '登录用户' },
|
||||||
|
{ field: 'ip', title: '登录ip' },
|
||||||
|
{ field: 'time', title: '登录时间' }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
tableStore.table.params.loginName = ''
|
||||||
|
tableStore.table.params.operateType = '认证'
|
||||||
|
tableStore.table.params.searchBeginTime = ''
|
||||||
|
tableStore.table.params.searchEndTime = ''
|
||||||
|
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,691 @@
|
|||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<div class="title">
|
||||||
|
变压器台账配置
|
||||||
|
<back-component />
|
||||||
|
</div>
|
||||||
|
<!-- 主要内容 -->
|
||||||
|
<div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="5">
|
||||||
|
<div style="margin: 10px; border-right: 1px solid">
|
||||||
|
<div style="overflow-y: auto" class="xiaoshou" :style="height1">
|
||||||
|
<!-- <el-tree
|
||||||
|
class="filter-tree xiaoshou"
|
||||||
|
v-loading="loading"
|
||||||
|
element-loading-text="数据加载中"
|
||||||
|
:style="'height:' + vh2 + 'px'"
|
||||||
|
:data="treeMenuData"
|
||||||
|
:props="{ children: 'children', label: 'name' }"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:highlight-current="true"
|
||||||
|
default-expand-all
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
@node-click="handleNodeClick1"
|
||||||
|
ref="menuTree"
|
||||||
|
node-key="id"
|
||||||
|
>
|
||||||
|
<span class="span-ellipsis" slot-scope="{ node, data }">
|
||||||
|
<i :class="data.icon"></i>
|
||||||
|
<span class="title" :title="node.label">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</el-tree> -->
|
||||||
|
<DeviceTree
|
||||||
|
:default-expand-all="true"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
@init="handleNodeClick"
|
||||||
|
ref="menuTree"
|
||||||
|
></DeviceTree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="19">
|
||||||
|
<div class="mt10">
|
||||||
|
<TableHeader showExport :showSearch="false" ref="TableHeaderRef">
|
||||||
|
<template v-slot:select>
|
||||||
|
<span style="font-size: 14px; line-height: 40px; color: red;">
|
||||||
|
所选变电站:
|
||||||
|
<span style="color: black">{{ subName }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #operation>
|
||||||
|
<el-button type="primary" class="ml10" @click="transformerAdd" :icon="Plus">
|
||||||
|
新增变压器信息
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<div>
|
||||||
|
<!-- 为分页留出空间 -->
|
||||||
|
<Table ref="tableRef" height="calc(100vh - 308px)" :row-config="{ isCurrent: true, isHover: true }"></Table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<!-- 变压器信息新增/修改 -->
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
:title="transformerTitle"
|
||||||
|
v-model="transformerInformation"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
width="700px"
|
||||||
|
v-if="transformerInformation"
|
||||||
|
:before-close="resetForm"
|
||||||
|
>
|
||||||
|
<el-form :model="ruleForm" :rules="rules" ref="ruleFormRef" label-width="100px">
|
||||||
|
<el-form-item label="变压器名:" prop="tfName">
|
||||||
|
<el-input v-model="ruleForm.tfName" placeholder="请输入" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接线方式:" prop="wiring" class="top">
|
||||||
|
<el-select style="width: 100%" v-model="ruleForm.wiring" clearable placeholder="请选择接线方式">
|
||||||
|
<el-option
|
||||||
|
v-for="item in connectionType"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述:" class="top">
|
||||||
|
<el-input
|
||||||
|
v-model="ruleForm.tfDescribe"
|
||||||
|
placeholder="请输入"
|
||||||
|
clearable
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="mt20 ml20">
|
||||||
|
<el-button @click="transformerInformation = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 节点维护 -->
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:title="maintenanceTitle"
|
||||||
|
v-model="nodemaintenanceInformation"
|
||||||
|
width="65%"
|
||||||
|
v-if="nodemaintenanceInformation"
|
||||||
|
>
|
||||||
|
<el-row :gutter="20" v-loading="isLoading3" element-loading-text="数据加载中">
|
||||||
|
<el-col :span="8">
|
||||||
|
<div style="border-right: 1px solid; height: 100%" class="xiaoshou">
|
||||||
|
<div style="overflow-y: auto; height: 100%; overflow-x: auto;max-height: 350px;" class="tree mr10 xiaoshou">
|
||||||
|
<el-input placeholder="输入关键字检索" v-model="filterText1" clearable></el-input>
|
||||||
|
<el-tree
|
||||||
|
style="cursor: pointer;display: inline-block;"
|
||||||
|
:data="treeMenuLeftData"
|
||||||
|
v-loading="loading"
|
||||||
|
element-loading-text="数据加载中"
|
||||||
|
show-checkbox
|
||||||
|
node-key="id"
|
||||||
|
ref="menuTreeLeft"
|
||||||
|
highlight-current
|
||||||
|
:check-strictly="true"
|
||||||
|
:expand-on-click-node="true"
|
||||||
|
default-expand-all
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
:props="{ children: 'children', label: 'name' }"
|
||||||
|
@check="checkLeft"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="span-ellipsis">
|
||||||
|
<i :class="data.icon"></i>
|
||||||
|
<span class="title_1" :title="node.label">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form :model="messageInfo" label-width="90px">
|
||||||
|
<el-form-item label="变压器名称:">
|
||||||
|
<el-input disabled v-model="messageInfo.tfName" placeholder="变压器名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="变电站:" class="top">
|
||||||
|
<el-input disabled v-model="messageInfo.subIndexName" placeholder="变电站"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接线方式:" class="top">
|
||||||
|
<el-input disabled v-model="messageInfo.wiring" placeholder="接线方式"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新人:" class="top">
|
||||||
|
<el-input disabled v-model="messageInfo.updateBy" placeholder="更新人"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新时间:" class="top">
|
||||||
|
<el-input disabled v-model="messageInfo.updateTime" placeholder="更新时间"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div style="border-left: 1px solid; height: 100%" class="xiaoshou">
|
||||||
|
<div style="overflow-y: auto; height: 100%;overflow-x: auto;max-height: 350px;" class="ml10 tree xiaoshou">
|
||||||
|
<el-input placeholder="输入关键字检索" v-model="filterText2" clearable></el-input>
|
||||||
|
<el-tree
|
||||||
|
style="cursor: pointer"
|
||||||
|
:data="treeMenuRightData"
|
||||||
|
v-loading="loading"
|
||||||
|
element-loading-text="数据加载中"
|
||||||
|
show-checkbox
|
||||||
|
node-key="id"
|
||||||
|
ref="menuTreeRight"
|
||||||
|
:check-strictly="true"
|
||||||
|
highlight-current
|
||||||
|
:expand-on-click-node="true"
|
||||||
|
default-expand-all
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
:props="{ children: 'children', label: 'name' }"
|
||||||
|
@check="checkRight"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="span-ellipsis">
|
||||||
|
<i :class="data.icon"></i>
|
||||||
|
<span class="title_1" :title="node.label">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div style="border-top: #dddfe5 solid 1px; margin-top: 10px; margin-bottom: 5px"></div>
|
||||||
|
<span slot="footer" class="dialog-footer" style="display: flex; justify-content: flex-end">
|
||||||
|
<el-button @click="nodemaintenanceInformation = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="maintenanceOnsubmit">提交</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive, watch } from 'vue'
|
||||||
|
import BackComponent from '@/components/icon/back/index.vue'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import DeviceTree from '@/components/tree/pqs/deviceTree.vue'
|
||||||
|
import { Plus, Setting } from '@element-plus/icons-vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import {
|
||||||
|
insertTransformer,
|
||||||
|
updateTransformer,
|
||||||
|
delTransformer,
|
||||||
|
nodeMaintenance,
|
||||||
|
getGeneratrix
|
||||||
|
} from '@/api/device-boot/transformerStrategy'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { calc } from '@/api/advance-boot/sgGroven/sgScheme'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'BusinessAdministrator/TerminalManagement/addLedger'
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableRef = ref()
|
||||||
|
const dictData = useDictData()
|
||||||
|
|
||||||
|
const connectionType = dictData.getBasicData('Dev_Connect')
|
||||||
|
|
||||||
|
// 新增、修改
|
||||||
|
const transformerTitle = ref('新增变压器信息')
|
||||||
|
|
||||||
|
const transformerInformation = ref(false)
|
||||||
|
|
||||||
|
const ruleFormRef = ref()
|
||||||
|
|
||||||
|
const menuTree = ref()
|
||||||
|
|
||||||
|
const ruleForm = reactive({
|
||||||
|
tfName: '',
|
||||||
|
wiring: '',
|
||||||
|
subIndex: '',
|
||||||
|
tfDescribe: ''
|
||||||
|
})
|
||||||
|
// 树选择
|
||||||
|
const subName = ref('')
|
||||||
|
|
||||||
|
const parentId = ref('')
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
tfName: [{ required: true, message: '请输入变压器名', trigger: 'blur' }],
|
||||||
|
wiring: [{ required: true, message: '请选择接线方式', trigger: 'change' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 变压器节点维护
|
||||||
|
interface TreeNode {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
icon?: string
|
||||||
|
level?: number
|
||||||
|
disabled?: boolean
|
||||||
|
children?: TreeNode[]
|
||||||
|
}
|
||||||
|
const maintenanceTitle = ref('变压器节点维护')
|
||||||
|
const nodemaintenanceInformation = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
const isLoading3 = ref(false)
|
||||||
|
const filterText1 = ref('')
|
||||||
|
const filterText2 = ref('')
|
||||||
|
const menuTreeLeft = ref()
|
||||||
|
const menuTreeRight = ref()
|
||||||
|
const treeMenuLeftData = ref<TreeNode[]>([])
|
||||||
|
const treeMenuRightData = ref<TreeNode[]>([])
|
||||||
|
const messageInfo = reactive({
|
||||||
|
tfName: '',
|
||||||
|
subIndexName: '',
|
||||||
|
wiring: '',
|
||||||
|
updateBy: '',
|
||||||
|
updateTime: ''
|
||||||
|
})
|
||||||
|
const bind = ref<any[]>([])
|
||||||
|
const bindLevel = ref<number>(0)
|
||||||
|
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/device-boot/pqsTransformer/transformerPage',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
{ title: '变压器名称', field: 'tfName' },
|
||||||
|
{ title: '变电站', field: 'subIndexName' },
|
||||||
|
{
|
||||||
|
title: '接线方式',
|
||||||
|
field: 'wiring',
|
||||||
|
formatter: (row: any) => {
|
||||||
|
if (row.column.property == 'wiring') {
|
||||||
|
let title = ''
|
||||||
|
connectionType.forEach(item => {
|
||||||
|
if (item.id == row.row.wiring) {
|
||||||
|
title = item.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return title
|
||||||
|
} else {
|
||||||
|
return row.row[row.column.property]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ title: '更新人', field: 'updateBy' },
|
||||||
|
{ title: '更新时间', field: 'updateTime' },
|
||||||
|
// {
|
||||||
|
// title: '等级',
|
||||||
|
// field: 'nodeGrade',
|
||||||
|
// render: 'tag',
|
||||||
|
// custom: {
|
||||||
|
// 0: 'success',
|
||||||
|
// 1: 'warning',
|
||||||
|
// 2: 'info'
|
||||||
|
// },
|
||||||
|
// replaceValue: {
|
||||||
|
// 0: '极重要',
|
||||||
|
// 1: '普通',
|
||||||
|
// 2: '备用'
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '描述',
|
||||||
|
field: 'tfDescribe'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: '180',
|
||||||
|
render: 'buttons',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'maintenance',
|
||||||
|
title: '节点维护',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-Share',
|
||||||
|
render: 'basicButton',
|
||||||
|
click: async row => {
|
||||||
|
nodemaintenanceInformation.value = true
|
||||||
|
maintenance(JSON.parse(JSON.stringify(row)))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '编辑',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-EditPen',
|
||||||
|
render: 'basicButton',
|
||||||
|
click: row => {
|
||||||
|
transformerInformation.value = true
|
||||||
|
transformerTitle.value = '修改变压器信息'
|
||||||
|
Object.assign(ruleForm, JSON.parse(JSON.stringify(row)))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'del',
|
||||||
|
title: '删除',
|
||||||
|
type: 'danger',
|
||||||
|
icon: 'el-icon-Delete',
|
||||||
|
render: 'confirmButton',
|
||||||
|
popconfirm: {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonType: 'danger',
|
||||||
|
title: '确定删除吗?'
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
delTransformer([row.tfIndex]).then(res => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// beforeSearchFun: () => {
|
||||||
|
// for (let key in tableStore.table.params) {
|
||||||
|
// if (tableStore.table.params[key] === '' && key !== 'nodeGrade' && key !== 'searchState') {
|
||||||
|
// delete tableStore.table.params[key]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
loadCallback: () => {}
|
||||||
|
})
|
||||||
|
|
||||||
|
tableStore.table.params.searchValue = ''
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
tableStore.index()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
|
||||||
|
const height = mainHeight(20)
|
||||||
|
const height1 = mainHeight(85)
|
||||||
|
const height2 = mainHeight(300)
|
||||||
|
|
||||||
|
//变压器新增
|
||||||
|
const transformerAdd = () => {
|
||||||
|
ruleForm.tfName = ''
|
||||||
|
ruleForm.wiring = ''
|
||||||
|
ruleForm.tfDescribe = ''
|
||||||
|
if (subName.value == '') {
|
||||||
|
ElMessage({
|
||||||
|
type: 'warning',
|
||||||
|
message: '请选择变电站'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
transformerTitle.value = '新增变压器信息'
|
||||||
|
transformerInformation.value = true
|
||||||
|
nextTick(() => {
|
||||||
|
ruleFormRef.value.clearValidate()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 树选择
|
||||||
|
const handleNodeClick = (data: any, node: any) => {
|
||||||
|
if (node.level == 4) {
|
||||||
|
subName.value =
|
||||||
|
node.parent.parent.parent.data.name +
|
||||||
|
`>` +
|
||||||
|
node.parent.parent.data.name +
|
||||||
|
`>` +
|
||||||
|
node.parent.data.name +
|
||||||
|
`>` +
|
||||||
|
node.data.name
|
||||||
|
ruleForm.subIndex = node.data.id
|
||||||
|
tableStore.table.params.searchValue = node.data.id
|
||||||
|
parentId.value = node.data.id
|
||||||
|
} else if (node.level == 5) {
|
||||||
|
subName.value =
|
||||||
|
node.parent.parent.parent.parent.data.name +
|
||||||
|
`>` +
|
||||||
|
node.parent.parent.parent.data.name +
|
||||||
|
`>` +
|
||||||
|
node.parent.parent.data.name +
|
||||||
|
`>` +
|
||||||
|
node.parent.data.name
|
||||||
|
ruleForm.subIndex = node.parent.data.id
|
||||||
|
tableStore.table.params.searchValue = node.data.id
|
||||||
|
parentId.value = node.parent.data.id
|
||||||
|
} else {
|
||||||
|
tableStore.table.params.searchValue = ''
|
||||||
|
}
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
transformerInformation.value = false
|
||||||
|
Object.assign(ruleForm, {
|
||||||
|
tfName: '',
|
||||||
|
wiring: '',
|
||||||
|
subIndex: '',
|
||||||
|
tfDescribe: ''
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 确认
|
||||||
|
const onSubmit = () => {
|
||||||
|
ruleFormRef.value.validate((valid: any) => {
|
||||||
|
if (valid) {
|
||||||
|
if (transformerTitle.value == '新增变压器信息') {
|
||||||
|
insertTransformer(ruleForm).then(res => {
|
||||||
|
ElMessage.success('新增变压器信息成功')
|
||||||
|
resetForm()
|
||||||
|
menuTree.value.loadData()
|
||||||
|
tableStore.onTableAction('search', {})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ElMessageBox.confirm('是否确认修改?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
updateTransformer(ruleForm).then(res => {
|
||||||
|
ElMessage.success('修改成功')
|
||||||
|
resetForm()
|
||||||
|
menuTree.value.loadData()
|
||||||
|
tableStore.onTableAction('search', {})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 变压器维护
|
||||||
|
const maintenance = (val: any) => {
|
||||||
|
maintenanceTitle.value = '变压器节点维护'
|
||||||
|
maintenanceData.upNode = ''
|
||||||
|
maintenanceData.downNode = ''
|
||||||
|
maintenanceData.tfIndex = val.tfIndex
|
||||||
|
isLoading3.value = true
|
||||||
|
getGeneratrix({
|
||||||
|
id: val.tfIndex,
|
||||||
|
subId: val.subIndex
|
||||||
|
}).then(res => {
|
||||||
|
bind.value = res.data.bind
|
||||||
|
treeMenuLeftData.value = res.data.upNode
|
||||||
|
treeMenuRightData.value = res.data.downNode
|
||||||
|
setDisabled(treeMenuRightData.value)
|
||||||
|
setDisabled(treeMenuLeftData.value)
|
||||||
|
isLoading3.value = false
|
||||||
|
if (treeMenuLeftData.value && treeMenuLeftData.value.length > 0) {
|
||||||
|
treeMenuLeftData.value[0].children?.forEach(item => {
|
||||||
|
item.children?.forEach(item1 => {
|
||||||
|
item1.children?.forEach(item2 => {
|
||||||
|
item2.children?.forEach(item3 => {
|
||||||
|
if (item3.level != null) {
|
||||||
|
menuTreeLeft.value?.setCheckedKeys([item3.id])
|
||||||
|
maintenanceData.upNode = item3.id
|
||||||
|
bindLevel.value = item3.level
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (treeMenuRightData.value && treeMenuRightData.value.length > 0) {
|
||||||
|
treeMenuRightData.value[0].children?.forEach(item => {
|
||||||
|
item.children?.forEach(item1 => {
|
||||||
|
item1.children?.forEach(item2 => {
|
||||||
|
item2.children?.forEach(item3 => {
|
||||||
|
if (item3.level != null) {
|
||||||
|
menuTreeRight.value?.setCheckedKeys([item3.id])
|
||||||
|
maintenanceData.downNode = item3.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
nodemaintenanceInformation.value = true
|
||||||
|
})
|
||||||
|
Object.assign(messageInfo, JSON.parse(JSON.stringify(val)))
|
||||||
|
connectionType.forEach(item => {
|
||||||
|
if (messageInfo.wiring == item.id) {
|
||||||
|
messageInfo.wiring = item.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置禁选
|
||||||
|
const setDisabled = (treeData: any[]) => {
|
||||||
|
treeData.forEach((item) => {
|
||||||
|
item.disabled = true;
|
||||||
|
item.children.forEach((item1:any) => {
|
||||||
|
item1.disabled = true;
|
||||||
|
item1.children.forEach((item2:any) => {
|
||||||
|
item2.disabled = true;
|
||||||
|
item2.children.forEach((item3:any) => {
|
||||||
|
item3.disabled = true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => [filterText1.value, filterText2.value],
|
||||||
|
([newVal1, newVal2]) => {
|
||||||
|
menuTreeLeft.value.filter(newVal1)
|
||||||
|
menuTreeRight.value.filter(newVal2)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
/**筛选节点 */
|
||||||
|
const filterNode = (value: any, data: any, node: any) => {
|
||||||
|
if (!value) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
let _array: boolean[] = [] // 显式声明类型为 boolean[]
|
||||||
|
getReturnNode(node, _array, value)
|
||||||
|
let result = false
|
||||||
|
_array.forEach(item => {
|
||||||
|
result = result || item
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
const getReturnNode = (node: any, _array: boolean[], value: string) => {
|
||||||
|
let isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1
|
||||||
|
isPass ? _array.push(isPass) : ''
|
||||||
|
if (!isPass && node.level !== 1 && node.parent) {
|
||||||
|
getReturnNode(node.parent, _array, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const maintenanceData = reactive({
|
||||||
|
upNode: '',
|
||||||
|
downNode: '',
|
||||||
|
tfIndex: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
//上节点选择
|
||||||
|
const checkLeft = (checkedNodes: any, checkedKeys: any) => {
|
||||||
|
maintenanceData.upNode = checkedNodes.id
|
||||||
|
if (maintenanceData.upNode === maintenanceData.downNode) {
|
||||||
|
menuTreeRight.value?.setCheckedKeys([])
|
||||||
|
maintenanceData.downNode = ''
|
||||||
|
}
|
||||||
|
if (checkedKeys.checkedKeys.length > 1) {
|
||||||
|
menuTreeLeft.value?.setCheckedKeys([checkedNodes.id])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//下节点选择
|
||||||
|
const checkRight = (checkedNodes: any, checkedKeys: any) => {
|
||||||
|
maintenanceData.downNode = checkedNodes.id
|
||||||
|
if (maintenanceData.downNode === maintenanceData.upNode) {
|
||||||
|
menuTreeLeft.value?.setCheckedKeys([])
|
||||||
|
maintenanceData.upNode = ''
|
||||||
|
}
|
||||||
|
if (checkedKeys.checkedKeys.length > 1) {
|
||||||
|
menuTreeRight.value?.setCheckedKeys([checkedNodes.id])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//节点维护提交
|
||||||
|
const maintenanceOnsubmit = () => {
|
||||||
|
for (let i = 0; i < bind.value.length; i++) {
|
||||||
|
if (bind.value[i][0] == maintenanceData.upNode) {
|
||||||
|
for (let j = 0; j < bind.value.length; j++) {
|
||||||
|
if (bind.value[j][1] == maintenanceData.downNode) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'warning',
|
||||||
|
message: '上下节点无法选择相同母线!!!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bindLevel.value != 5) {
|
||||||
|
for (let i = 0; i < bind.value.length; i++) {
|
||||||
|
if (maintenanceData.upNode == bind.value[i][1] && maintenanceData.downNode == bind.value[i][0]) {
|
||||||
|
ElMessage({
|
||||||
|
type: 'warning',
|
||||||
|
message: '上下节点无法选择相同母线!!!'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nodeMaintenance(maintenanceData).then((res: any) => {
|
||||||
|
if (res.code == 'A0000') {
|
||||||
|
ElMessage({
|
||||||
|
type: 'success',
|
||||||
|
message: '维护成功'
|
||||||
|
})
|
||||||
|
nodemaintenanceInformation.value = false
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 550;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xiaoshou {
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span-ellipsis {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-tree {
|
||||||
|
font-size: 13px !important;
|
||||||
|
font-weight: 540 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
337
src/views/pqs/business/terminal/transformerStrategy/index.vue
Normal file
337
src/views/pqs/business/terminal/transformerStrategy/index.vue
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
<!-- 变压器策略 -->
|
||||||
|
<template>
|
||||||
|
<div class="default-main">
|
||||||
|
<TableHeader showExport :showSearch="false" ref="TableHeaderRef">
|
||||||
|
<template v-slot:select></template>
|
||||||
|
<template #operation>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
class="ml10"
|
||||||
|
@click="push('/admin/BusinessAdministrator/TerminalManagement/addLedger')"
|
||||||
|
:icon="Setting"
|
||||||
|
>
|
||||||
|
变压器台账配置
|
||||||
|
</el-button>
|
||||||
|
<el-button type="primary" class="ml10" @click="add" :icon="Plus">新增策略</el-button>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table ref="tableRef" :row-config="{ isCurrent: true, isHover: true }"></Table>
|
||||||
|
<el-dialog
|
||||||
|
draggable
|
||||||
|
:title="dialogTitle"
|
||||||
|
v-model="dialogFormVisible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
width="700px"
|
||||||
|
:before-close="resetForm"
|
||||||
|
v-if="dialogFormVisible"
|
||||||
|
>
|
||||||
|
<el-row :gutter="20" v-loading="isLoading1" element-loading-text="数据加载中">
|
||||||
|
<el-col :span="10">
|
||||||
|
<div style="margin: 10px; overflow-y: auto; border-right: 1px solid" class="xiaoshou">
|
||||||
|
<el-tree
|
||||||
|
style="cursor: pointer; height: 380px"
|
||||||
|
:data="treeMenuData"
|
||||||
|
v-loading="loading"
|
||||||
|
element-loading-text="数据加载中"
|
||||||
|
show-checkbox
|
||||||
|
node-key="id"
|
||||||
|
ref="menuTree"
|
||||||
|
highlight-current
|
||||||
|
:expand-on-click-node="true"
|
||||||
|
default-expand-all
|
||||||
|
:props="{ children: 'children', label: 'name' }"
|
||||||
|
@check="check"
|
||||||
|
>
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span class="span-ellipsis">
|
||||||
|
<i :class="data.icon"></i>
|
||||||
|
<span class="title" :title="node.label">{{ node.label }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="14">
|
||||||
|
<div class="box">
|
||||||
|
<el-form :model="form" label-width="100px" ref="ruleFormRef">
|
||||||
|
<el-form-item label="名称:">
|
||||||
|
<el-input v-model="form.tpName" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述:" class="mt20">
|
||||||
|
<el-input v-model="form.tfDescribe" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item class="mt20 ml20">
|
||||||
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit">确 定</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
||||||
|
import { Plus, Setting } from '@element-plus/icons-vue'
|
||||||
|
import {
|
||||||
|
getFlgPloyInfo,
|
||||||
|
insertFlgPloy,
|
||||||
|
updateFlgPloy,
|
||||||
|
delFlgPloy,
|
||||||
|
getTransformerTree
|
||||||
|
} from '@/api/device-boot/transformerStrategy'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/index.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
|
import { ElButton } from 'element-plus'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
defineOptions({
|
||||||
|
name: '/BusinessAdministrator/TerminalManagement/transformerStrategy'
|
||||||
|
})
|
||||||
|
const { push } = useRouter()
|
||||||
|
const fontdveoption: any = ref([
|
||||||
|
{ id: 0, name: '极重要' },
|
||||||
|
{ id: 1, name: '普通' },
|
||||||
|
{ id: 2, name: '备用' }
|
||||||
|
])
|
||||||
|
const statusoption: any = ref([
|
||||||
|
{ id: 0, name: '未启用' },
|
||||||
|
{ id: 1, name: '启用' }
|
||||||
|
])
|
||||||
|
const height = mainHeight(70)
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
const tableRef = ref()
|
||||||
|
|
||||||
|
const ruleFormRef = ref()
|
||||||
|
|
||||||
|
const form: any = ref({
|
||||||
|
tpName: '',
|
||||||
|
tfDescribe: '',
|
||||||
|
tpIndex: '',
|
||||||
|
tfIndexs: []
|
||||||
|
})
|
||||||
|
|
||||||
|
const isLoading1 = ref(false)
|
||||||
|
const treeMenuData = ref([])
|
||||||
|
const menuTree = ref()
|
||||||
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
|
const rules = reactive({
|
||||||
|
name: [{ required: true, message: '名称不可为空', trigger: 'blur' }],
|
||||||
|
ip: [{ required: true, message: 'ip不可为空', trigger: 'blur' }],
|
||||||
|
nodeGrade: [{ required: true, message: '等级不可为空', trigger: 'blur' }],
|
||||||
|
nodeDevNum: [{ required: true, message: '最大终端数不可为空', trigger: 'blur' }],
|
||||||
|
maxProcessNum: [{ required: true, message: '最大进程数不可为空', trigger: 'blur' }],
|
||||||
|
sort: [{ required: true, message: '排序不可为空', trigger: 'blur' }],
|
||||||
|
remark: [{ required: true, message: '描述不可为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
const dialogFormVisible = ref(false)
|
||||||
|
|
||||||
|
const dialogTitle = ref('新增前置机')
|
||||||
|
const processId = ref('')
|
||||||
|
const tableStore = new TableStore({
|
||||||
|
url: '/device-boot/pqsTflgploy/flgployPage',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
{ title: '变压器策略名称', field: 'tpName' },
|
||||||
|
{ title: '更新时间', field: 'updateTime' },
|
||||||
|
// {
|
||||||
|
// title: '等级',
|
||||||
|
// field: 'nodeGrade',
|
||||||
|
// render: 'tag',
|
||||||
|
// custom: {
|
||||||
|
// 0: 'success',
|
||||||
|
// 1: 'warning',
|
||||||
|
// 2: 'info'
|
||||||
|
// },
|
||||||
|
// replaceValue: {
|
||||||
|
// 0: '极重要',
|
||||||
|
// 1: '普通',
|
||||||
|
// 2: '备用'
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '变压器策略描述',
|
||||||
|
field: 'tfDescribe'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
width: '180',
|
||||||
|
render: 'buttons',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
title: '编辑',
|
||||||
|
type: 'primary',
|
||||||
|
icon: 'el-icon-EditPen',
|
||||||
|
render: 'basicButton',
|
||||||
|
|
||||||
|
click: async row => {
|
||||||
|
dialogFormVisible.value = true
|
||||||
|
dialogTitle.value = '修改策略信息'
|
||||||
|
form.value = JSON.parse(JSON.stringify(row))
|
||||||
|
getFlgPloyInfo({ id: row.tpIndex }).then(res => {
|
||||||
|
menuTree.value.setCheckedKeys(res.data.tfIndexs)
|
||||||
|
form.value.tfIndexs = res.data.tfIndexs
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// name: 'edit',
|
||||||
|
// title: '重启',
|
||||||
|
// type: 'warning',
|
||||||
|
// icon: 'el-icon-Delete',
|
||||||
|
// render: 'confirmButton',
|
||||||
|
// popconfirm: {
|
||||||
|
// confirmButtonText: '确认',
|
||||||
|
// cancelButtonText: '取消',
|
||||||
|
// confirmButtonType: 'warning',
|
||||||
|
// title: '确定重启吗?'
|
||||||
|
// },
|
||||||
|
// click: row => {
|
||||||
|
// askRestartProcess({
|
||||||
|
// deviceRebootType: null,
|
||||||
|
// nodeId: row.id,
|
||||||
|
// processNo: 1
|
||||||
|
// }).then(res => {
|
||||||
|
// ElMessage.success('重启成功')
|
||||||
|
// tableStore.index()
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
|
||||||
|
{
|
||||||
|
name: 'del',
|
||||||
|
title: '删除',
|
||||||
|
type: 'danger',
|
||||||
|
icon: 'el-icon-Delete',
|
||||||
|
render: 'confirmButton',
|
||||||
|
popconfirm: {
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
confirmButtonType: 'danger',
|
||||||
|
title: '确定删除吗?'
|
||||||
|
},
|
||||||
|
click: row => {
|
||||||
|
delFlgPloy({ ids: row.tpIndex }).then(res => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// beforeSearchFun: () => {
|
||||||
|
// for (let key in tableStore.table.params) {
|
||||||
|
// if (tableStore.table.params[key] === '' && key !== 'nodeGrade' && key !== 'searchState') {
|
||||||
|
// delete tableStore.table.params[key]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
loadCallback: () => {}
|
||||||
|
})
|
||||||
|
const nodeId = ref('')
|
||||||
|
|
||||||
|
const treeRef = ref()
|
||||||
|
|
||||||
|
// tableStore.table.params.orderBy = 'desc'
|
||||||
|
// tableStore.table.params.nodeGrade = ''
|
||||||
|
// tableStore.table.params.searchState = ''
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
// 变压器台账配置
|
||||||
|
const set = () => {
|
||||||
|
push({
|
||||||
|
path: 'addLedger',
|
||||||
|
query: {}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
dialogFormVisible.value = true
|
||||||
|
dialogTitle.value = '新增策略信息'
|
||||||
|
form.value = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
dialogFormVisible.value = false
|
||||||
|
form.value = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getTree = () => {
|
||||||
|
isLoading1.value = true
|
||||||
|
getTransformerTree().then(res => {
|
||||||
|
treeMenuData.value = res.data
|
||||||
|
isLoading1.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认
|
||||||
|
const onSubmit = () => {
|
||||||
|
ruleFormRef.value.validate((valid: any) => {
|
||||||
|
if (valid) {
|
||||||
|
if (dialogTitle.value == '新增策略信息') {
|
||||||
|
insertFlgPloy(form.value).then(res => {
|
||||||
|
ElMessage.success('新增策略信息成功')
|
||||||
|
resetForm()
|
||||||
|
tableStore.onTableAction('search', {})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ElMessageBox.confirm('是否确认修改?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
updateFlgPloy(form.value).then(res => {
|
||||||
|
ElMessage.success('修改成功')
|
||||||
|
resetForm()
|
||||||
|
tableStore.onTableAction('search', {})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//树多选
|
||||||
|
const check = (currentNode: any, checkedInfo: any) => {
|
||||||
|
form.value.tfIndexs = checkedInfo.checkedNodes
|
||||||
|
.filter((item: any) => !item.children || item.children.length === 0)
|
||||||
|
.map((item: any) => item.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getTree()
|
||||||
|
setTimeout(() => {
|
||||||
|
tableStore.index()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.box {
|
||||||
|
position: absolute;
|
||||||
|
top: 100px;
|
||||||
|
right: 60px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 300px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xiaoshou {
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ::-webkit-scrollbar {
|
||||||
|
// width: 8px !important;
|
||||||
|
// height: 14px;
|
||||||
|
// }
|
||||||
|
</style>
|
||||||
146
src/views/system/strategyManage/index.vue
Normal file
146
src/views/system/strategyManage/index.vue
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<div class="strategy-manage pd10" :style="height">
|
||||||
|
<el-form :inline="true" class="demo-form-inline">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="AddClick()" type="primary" :icon="Plus">保存</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div style="width: 500px">
|
||||||
|
<el-form ref="formRef" :model="form" label-width="auto" :rules="rules">
|
||||||
|
<el-divider content-position="left">系统策略</el-divider>
|
||||||
|
<el-form-item label="最大并发数:" prop="maxUseUser">
|
||||||
|
<el-input-number
|
||||||
|
v-model.number="form.maxUseUser"
|
||||||
|
:min="10"
|
||||||
|
:max="99"
|
||||||
|
style="width: 100%"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-divider content-position="left">账号锁定策略</el-divider>
|
||||||
|
<el-form-item label="密码输入错误次数:" prop="errorsCount">
|
||||||
|
<el-input-number
|
||||||
|
v-model.number="form.errorsCount"
|
||||||
|
:min="3"
|
||||||
|
:max="20"
|
||||||
|
style="width: 100%"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="自动解锁(分钟):" prop="releaseTime">
|
||||||
|
<el-input-number
|
||||||
|
v-model.number="form.releaseTime"
|
||||||
|
:min="5"
|
||||||
|
:max="60"
|
||||||
|
style="width: 100%"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="会话超时时间(秒):" prop="sessionTime">
|
||||||
|
<el-input-number v-model.number="form.sessionTime" :min="10" style="width: 100%"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="token刷新时间(秒):" prop="sessionRefreshTime">
|
||||||
|
<el-input-number
|
||||||
|
v-model.number="form.sessionRefreshTime"
|
||||||
|
:min="10"
|
||||||
|
style="width: 100%"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-divider content-position="left">账号密码复杂度校验</el-divider>
|
||||||
|
<el-form-item label="密码有效期(月):" prop="passwordExpirationMonth">
|
||||||
|
<el-input-number
|
||||||
|
v-model.number="form.passwordExpirationMonth"
|
||||||
|
:min="1"
|
||||||
|
:max="6"
|
||||||
|
style="width: 100%"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="账号长时间未登录休眠期(天):" prop="sleepDay">
|
||||||
|
<el-input-number
|
||||||
|
v-model.number="form.sleepDay"
|
||||||
|
:min="1"
|
||||||
|
:max="180"
|
||||||
|
style="width: 100%"
|
||||||
|
></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, reactive, onMounted } from 'vue'
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { ruleUpdate, getRule, unlockRoot } from '@/api/admin/user.js'
|
||||||
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
import { mainHeight } from '@/utils/layout'
|
||||||
|
|
||||||
|
// 页面缓存
|
||||||
|
defineOptions({
|
||||||
|
name: 'system-boot/sysConfig/timer'
|
||||||
|
})
|
||||||
|
|
||||||
|
const height = mainHeight(20)
|
||||||
|
|
||||||
|
// 定义表单引用
|
||||||
|
const formRef = ref()
|
||||||
|
|
||||||
|
// 定义表单数据
|
||||||
|
const form = reactive({
|
||||||
|
maxUseUser: 50,
|
||||||
|
errorsCount: 0,
|
||||||
|
passwordExpirationMonth: 0,
|
||||||
|
sleepDay: 90,
|
||||||
|
releaseTime: 0,
|
||||||
|
sessionTime: 0,
|
||||||
|
sessionRefreshTime: 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// 定义表单验证规则
|
||||||
|
const rules = {
|
||||||
|
maxUseUser: [{ required: true, message: '请填写最大并发数', trigger: 'blur' }],
|
||||||
|
errorsCount: [{ required: true, message: '请填写密码输入错误次数', trigger: 'blur' }],
|
||||||
|
releaseTime: [{ required: true, message: '请填写自动解锁(分钟)', trigger: 'blur' }],
|
||||||
|
sessionTime: [{ required: true, message: '请填写会话超时时间', trigger: 'blur' }],
|
||||||
|
sessionRefreshTime: [{ required: true, message: '请填写会话刷新时间', trigger: 'blur' }],
|
||||||
|
passwordExpirationMonth: [{ required: true, message: '请填写密码有效期', trigger: 'blur' }],
|
||||||
|
sleepDay: [{ required: true, message: '请填写休眠期', trigger: 'blur' }]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取策略信息
|
||||||
|
const info = () => {
|
||||||
|
getRule().then(res => {
|
||||||
|
Object.assign(form, res.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存策略
|
||||||
|
const AddClick = () => {
|
||||||
|
formRef.value.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
ruleUpdate(form).then(res => {
|
||||||
|
Object.assign(form, res.data)
|
||||||
|
ElMessage({
|
||||||
|
message: '保存成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
info()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组件挂载时获取数据
|
||||||
|
onMounted(() => {
|
||||||
|
info()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.strategy-manage {
|
||||||
|
background-color: #fff;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item__label ){
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user