前置管理 新增重置功能

前置交互日志 新增详情查询功能
This commit is contained in:
guanj
2025-09-03 20:57:28 +08:00
parent 0067b63536
commit f251ad3fe6
20 changed files with 3425 additions and 3062 deletions

BIN
public/favicon2.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -1,42 +1,50 @@
import createAxios from '@/utils/request' import createAxios from '@/utils/request'
//删除列表 //删除列表
export function deleteByIds(data: any) { export function deleteByIds(data: any) {
return createAxios({ return createAxios({
url: '/advance-boot/responsibility/deleteByIds', url: '/advance-boot/responsibility/deleteByIds',
method: 'post', method: 'post',
data data
}) })
} }
//上传用采数据 //上传用采数据
export function uploadUserData(data: any) { export function uploadUserData(data: any) {
return createAxios({ return createAxios({
url: '/advance-boot/responsibility/uploadUserData', url: '/advance-boot/responsibility/uploadUserData',
method: 'post', method: 'post',
data data
}) })
} }
//负荷数据 //删除用采数据
export function userDataList(data: any) { export function deleteUserDataByIds(data: any) {
return createAxios({ return createAxios({
url: '/advance-boot/responsibility/userDataList', url: '/advance-boot/responsibility/deleteUserDataByIds',
method: 'post', method: 'post',
data data
}) })
} }
//执行 //负荷数据
export function getHistoryHarmData(data: any) { export function userDataList(data: any) {
return createAxios({ return createAxios({
url: '/harmonic-boot/harmonic/getHistoryHarmData', url: '/advance-boot/responsibility/userDataList',
method: 'post', method: 'post',
data data
}) })
} }
//责任详情 //执行
export function displayHistoryData(data: any) { export function getHistoryHarmData(data: any) {
return createAxios({ return createAxios({
url: '/advance-boot/responsibility/displayHistoryData', url: '/harmonic-boot/harmonic/getHistoryHarmData',
method: 'GET', method: 'post',
params: data data
}) })
} }
//责任详情
export function displayHistoryData(data: any) {
return createAxios({
url: '/advance-boot/responsibility/displayHistoryData',
method: 'GET',
params: data
})
}

View File

@@ -1,184 +1,192 @@
import createAxios from '@/utils/request' import createAxios from '@/utils/request'
// 新增菜单接口 // 新增菜单接口
export function addNode(data: any) { export function addNode(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/node/addNode', url: '/device-boot/node/addNode',
method: 'post', method: 'post',
data: data data: data
}) })
} }
//修改前置机 //修改前置机
export function updateNode(data: any) { export function updateNode(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/node/updateNode', url: '/device-boot/node/updateNode',
method: 'put', method: 'put',
data: data data: data
}) })
} }
//删除前置机 //删除前置机
export function delNode(data: any) { export function delNode(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/node/delNode', url: '/device-boot/node/delNode',
method: 'post', method: 'post',
params: { id: data } params: { id: data }
}) })
} }
//终端台账树 //终端台账树
export function getTerminalTree() { export function getTerminalTree() {
return createAxios({ return createAxios({
url: '/device-boot/terminalTree/getTerminalTree', url: '/device-boot/terminalTree/getTerminalTree',
method: 'get' method: 'get'
}) })
} }
//请求前置重启进程
/** export function askRestartProcess(data: any) {
* 总计出3层提供给表单选择具体的终端、母线、监测点 return createAxios({
* 终端台账树 url: '/device-boot/device/askRestartProcess',
* 等级0-项目名称1- 用户名称2-单位3-部门4-终端5-母线6-监测点 method: 'post',
*/ data
export function getTerminalSelectTree(level: number) { })
return createAxios({ }
url: '/device-boot/terminalTree/getTerminalSelectTree?level=' + level,
method: 'get' /**
}) * 总计出3层提供给表单选择具体的终端、母线、监测点
} * 终端台账树
* 等级0-项目名称1- 用户名称2-单位3-部门4-终端5-母线6-监测点
//查询节点内容 */
export function queryTerminal(data: any) { export function getTerminalSelectTree(level: number) {
return createAxios({ return createAxios({
url: `/device-boot/device/queryTerminal`, url: '/device-boot/terminalTree/getTerminalSelectTree?level=' + level,
method: 'get', method: 'get'
params: data })
}) }
}
//查询节点内容
//删除终端 export function queryTerminal(data: any) {
export function delTerminal(data: any) { return createAxios({
return createAxios({ url: `/device-boot/device/queryTerminal`,
url: `/device-boot/device/delTerminal`, method: 'get',
method: 'delete', params: data
params: data })
}) }
}
//删除终端
//获取前置机 export function delTerminal(data: any) {
export function nodeAllList() { return createAxios({
return createAxios({ url: `/device-boot/device/delTerminal`,
url: '/device-boot/node/nodeAllList', method: 'delete',
method: 'get' params: data
}) })
} }
//修改数据 //获取前置机
export function updateTerminal(query: any) { export function nodeAllList() {
return createAxios({ return createAxios({
url: `/device-boot/device/updateTerminal`, url: '/device-boot/node/nodeAllList',
method: 'put', method: 'get'
data: { })
...query }
}
}) //修改数据
} export function updateTerminal(query: any) {
return createAxios({
//提交数据 url: `/device-boot/device/updateTerminal`,
export function addTerminal(query: any) { method: 'put',
return createAxios({ data: {
url: '/device-boot/device/addTerminal', ...query
method: 'post', }
data: { })
...query }
}
}) //提交数据
} export function addTerminal(query: any) {
return createAxios({
//查询终端程序版本升级日志 url: '/device-boot/device/addTerminal',
export function getTerminalUpLog(data: any) { method: 'post',
return createAxios({ data: {
url: '/device-boot/version/getTerminalUpLog', ...query
method: 'post', }
params: data })
}) }
}
//查询新能源场站 //查询终端程序版本升级日志
export function selectDown() { export function getTerminalUpLog(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/newStation/selectDown', url: '/device-boot/version/getTerminalUpLog',
method: 'get' method: 'post',
}) params: data
} })
//获取用户大类小类 }
export function queryAllByType(params: any) { //查询新能源场站
return createAxios({ export function selectDown() {
url: '/system-boot/dictTree/queryAllByType', return createAxios({
method: 'get', url: '/device-boot/newStation/selectDown',
params method: 'get'
}) })
} }
//获取用户 //获取用户大类小类
export function selectUserList(data: any) { export function queryAllByType(params: any) {
return createAxios({ return createAxios({
url: '/supervision-boot/userReport/selectUserList', url: '/system-boot/dictTree/queryAllByType',
method: 'post', method: 'get',
data params
}) })
} }
//查询列表 //获取用户
export function getStatusManageList(data: any) { export function selectUserList(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/maintain/getStatusManageList', url: '/supervision-boot/userReport/selectUserList',
method: 'post', method: 'post',
data data
}) })
} }
//设置终端状态 //查询列表
export function updateRunFlagManage(data: any) { export function getStatusManageList(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/maintain/updateRunFlagManage', url: '/device-boot/maintain/getStatusManageList',
method: 'post', method: 'post',
data data
}) })
} }
//设置终端日志 //设置终端状态
export function getList(data: any) { export function updateRunFlagManage(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/pqsTerminalLogs/getList', url: '/device-boot/maintain/updateRunFlagManage',
method: 'post', method: 'post',
data data
}) })
} }
//查询前置-进程-设备-设备树 //设置终端日志
export function nodeDeviceTree(data: any) { export function getList(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/nodeDevice/nodeDeviceTree', url: '/device-boot/pqsTerminalLogs/getList',
method: 'post', method: 'post',
params: data data
}) })
} }
//更新设备进程号 //查询前置-进程-设备-设备树
export function updateDeviceProcess(data: any) { export function nodeDeviceTree(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/nodeDevice/updateDeviceProcess', url: '/device-boot/nodeDevice/nodeDeviceTree',
method: 'post', method: 'post',
data params: data
}) })
} }
//导出台账模板 //更新设备进程号
export function downTerminalTemplate() { export function updateDeviceProcess(data: any) {
return createAxios({ return createAxios({
url: '/device-boot/device/downTerminalTemplate', url: '/device-boot/nodeDevice/updateDeviceProcess',
method: 'get', method: 'post',
responseType: 'blob' data
}) })
} }
//导出台账信息 //导出台账模板
export function exportTerminalBase() { export function downTerminalTemplate() {
return createAxios({ return createAxios({
url: '/device-boot/device/exportTerminalBase', url: '/device-boot/device/downTerminalTemplate',
method: 'get', method: 'get',
responseType: 'blob' responseType: 'blob'
}) })
} }
//导出台账信息
export function exportTerminalBase() {
return createAxios({
url: '/device-boot/device/exportTerminalBase',
method: 'get',
responseType: 'blob'
})
}

View File

@@ -1,197 +1,199 @@
<template> <template>
<div :style="{ height: tableStore.table.height }"> <div :style="{ height:props.height?props.height: tableStore.table.height }">
<vxe-table <vxe-table
ref="tableRef" ref="tableRef"
height="auto" height="auto"
:key="key" :key="key"
:data="tableStore.table.data" :data="tableStore.table.data"
v-loading="tableStore.table.loading" v-loading="tableStore.table.loading"
v-bind="Object.assign({}, defaultAttribute, $attrs)" v-bind="Object.assign({}, defaultAttribute, $attrs)"
@checkbox-all="selectChangeEvent" @checkbox-all="selectChangeEvent"
@checkbox-change="selectChangeEvent" @checkbox-change="selectChangeEvent"
:showOverflow="showOverflow" :showOverflow="showOverflow"
@sort-change="handleSortChange" @sort-change="handleSortChange"
> >
<!-- Column 组件内部是 el-table-column --> <!-- Column 组件内部是 el-table-column -->
<template v-if="isGroup"> <template v-if="isGroup">
<GroupColumn :column="tableStore.table.column" /> <GroupColumn :column="tableStore.table.column" />
</template> </template>
<template v-else> <template v-else>
<Column <Column
:attr="item" :attr="item"
:key="key + '-column'" :key="key + '-column'"
v-for="(item, key) in tableStore.table.column" v-for="(item, key) in tableStore.table.column"
:tree-node="item.treeNode" :tree-node="item.treeNode"
> >
<!-- tableStore 预设的列 render 方案 --> <!-- tableStore 预设的列 render 方案 -->
<template v-if="item.render" #default="scope"> <template v-if="item.render" #default="scope">
<FieldRender <FieldRender
:field="item" :field="item"
:row="scope.row" :row="scope.row"
:column="scope.column" :column="scope.column"
:index="scope.rowIndex" :index="scope.rowIndex"
:key=" :key="
key + key +
'-' + '-' +
item.render + item.render +
'-' + '-' +
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '') (item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
" "
/> />
</template> </template>
</Column> </Column>
</template> </template>
<slot name="columns"></slot> <slot name="columns"></slot>
</vxe-table> </vxe-table>
</div> </div>
<div v-if="tableStore.showPage" class="table-pagination"> <div v-if="tableStore.showPage" class="table-pagination">
<el-pagination <el-pagination
:currentPage="tableStore.table.params!.pageNum" :currentPage="tableStore.table.params!.pageNum"
:page-size="tableStore.table.params!.pageSize" :page-size="tableStore.table.params!.pageSize"
:page-sizes="pageSizes" :page-sizes="pageSizes"
background background
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'" :layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
:total="tableStore.table.total" :total="tableStore.table.total"
@size-change="onTableSizeChange" @size-change="onTableSizeChange"
@current-change="onTableCurrentChange" @current-change="onTableCurrentChange"
></el-pagination> ></el-pagination>
</div> </div>
<slot name="footer"></slot> <slot name="footer"></slot>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, nextTick, inject, computed, onMounted, watch } from 'vue' import { ref, nextTick, inject, computed, onMounted, watch } from 'vue'
import type { ElTable } from 'element-plus' import type { ElTable } from 'element-plus'
import { VxeTableEvents, VxeTableInstance } from 'vxe-table' import { VxeTableEvents, VxeTableInstance } from 'vxe-table'
import FieldRender from '@/components/table/fieldRender/index.vue' import FieldRender from '@/components/table/fieldRender/index.vue'
import Column from '@/components/table/column/index.vue' import Column from '@/components/table/column/index.vue'
import GroupColumn from '@/components/table/column/groupColumn.vue' import GroupColumn from '@/components/table/column/groupColumn.vue'
import { useConfig } from '@/stores/config' import { useConfig } from '@/stores/config'
import type TableStoreClass from '@/utils/tableStore' import type TableStoreClass from '@/utils/tableStore'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { defaultAttribute } from '@/components/table/defaultAttribute' import { defaultAttribute } from '@/components/table/defaultAttribute'
const config = useConfig() const config = useConfig()
const tableRef = ref<VxeTableInstance>() const tableRef = ref<VxeTableInstance>()
const tableStore = inject('tableStore') as TableStoreClass const tableStore = inject('tableStore') as TableStoreClass
const router = useRouter() const router = useRouter()
const key = ref(0) const key = ref(0)
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> { interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
isGroup?: boolean isGroup?: boolean
showOverflow?: boolean showOverflow?: boolean
} height?: string | boolean
}
const props = withDefaults(defineProps<Props>(), {
isGroup: false, const props = withDefaults(defineProps<Props>(), {
showOverflow: true isGroup: false,
}) showOverflow: true,
onMounted(() => { height: false
tableStore.table.ref = tableRef.value as VxeTableInstance })
}) onMounted(() => {
// console.log(props) tableStore.table.ref = tableRef.value as VxeTableInstance
const onTableSizeChange = (val: number) => { })
tableStore.onTableAction('page-size-change', { size: val }) // console.log(props)
} const onTableSizeChange = (val: number) => {
tableStore.onTableAction('page-size-change', { size: val })
const onTableCurrentChange = (val: number) => { }
tableStore.onTableAction('current-page-change', { page: val })
} const onTableCurrentChange = (val: number) => {
tableStore.onTableAction('current-page-change', { page: val })
const pageSizes = computed(() => { }
let defaultSizes = [10, 20, 50, 100, 200]
if (tableStore.table.params!.pageSize) { const pageSizes = computed(() => {
if (!defaultSizes.includes(tableStore.table.params!.pageSize)) { let defaultSizes = [10, 20, 50, 100, 200]
defaultSizes.push(tableStore.table.params!.pageSize) if (tableStore.table.params!.pageSize) {
} if (!defaultSizes.includes(tableStore.table.params!.pageSize)) {
} defaultSizes.push(tableStore.table.params!.pageSize)
return defaultSizes }
}) }
return defaultSizes
/* })
* 记录选择的项
*/ /*
const selectChangeEvent: VxeTableEvents.CheckboxChange<any> = ({ checked }) => { * 记录选择的项
const records = (tableRef.value as VxeTableInstance).getCheckboxRecords() */
tableStore.onTableAction('selection-change', records) const selectChangeEvent: VxeTableEvents.CheckboxChange<any> = ({ checked }) => {
} const records = (tableRef.value as VxeTableInstance).getCheckboxRecords()
tableStore.onTableAction('selection-change', records)
const getRef = () => { }
return tableRef.value
} const getRef = () => {
// 排序 return tableRef.value
const handleSortChange = ({ column, order }: { column: TableColumn; order: 'asc' | 'desc' | null }) => { }
// console.log('排序列:', column?.property); // 排序
// console.log('排序顺序:', order); const handleSortChange = ({ column, order }: { column: TableColumn; order: 'asc' | 'desc' | null }) => {
// tableStore.onTableAction('sortable', { column, order }) // console.log('排序列:', column?.property);
tableStore.table.params.sortBy = column?.property // console.log('排序顺序:', order);
tableStore.table.params.orderBy = order // tableStore.onTableAction('sortable', { column, order })
tableStore.table.params.pageNum = 1 tableStore.table.params.sortBy = column?.property
tableStore.table.params.orderBy = order
tableStore.index() tableStore.table.params.pageNum = 1
key.value += 1
// // 在这里可以根据 column 和 order 进行相应的数据排序操作 tableStore.index()
// if (order === 'asc') { key.value += 1
// } else if (order === 'desc') { // // 在这里可以根据 column 和 order 进行相应的数据排序操作
// } // if (order === 'asc') {
} // } else if (order === 'desc') {
watch( // }
() => tableStore.table.allFlag, }
newVal => { watch(
if (tableStore.table.allFlag) { () => tableStore.table.allFlag,
tableRef.value?.exportData({ newVal => {
filename: if (tableStore.table.allFlag) {
tableStore.table.filename || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字 tableRef.value?.exportData({
sheetName: 'Sheet1', filename:
type: 'xlsx', //导出文件类型 xlsx 和 csv tableStore.table.filename || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
useStyle: true, sheetName: 'Sheet1',
data: tableStore.table.allData, // 数据源 // 过滤那个字段导出 type: 'xlsx', //导出文件类型 xlsx 和 csv
columnFilterMethod: function (column: any) { useStyle: true,
return !( data: tableStore.table.allData, // 数据源 // 过滤那个字段导出
column.column.title === undefined || columnFilterMethod: function (column: any) {
column.column.title === '序号' || return !(
column.column.title === '操作' column.column.title === undefined ||
) column.column.title === '序号' ||
} column.column.title === '操作'
}) )
tableStore.table.allFlag = false }
} })
} tableStore.table.allFlag = false
) }
watch( }
() => tableStore.table.data, )
newVal => { watch(
tableStore.onTableAction('selection-change', []) () => tableStore.table.data,
} newVal => {
) tableStore.onTableAction('selection-change', [])
}
defineExpose({ )
getRef
}) defineExpose({
</script> getRef
})
<style scoped lang="scss"> </script>
.ba-data-table :deep(.el-button + .el-button) {
margin-left: 6px; <style scoped lang="scss">
} .ba-data-table :deep(.el-button + .el-button) {
margin-left: 6px;
.ba-data-table :deep(.table-header-cell) .cell { }
color: var(--el-text-color-primary);
overflow: hidden; .ba-data-table :deep(.table-header-cell) .cell {
text-overflow: ellipsis; color: var(--el-text-color-primary);
white-space: nowrap; overflow: hidden;
} text-overflow: ellipsis;
white-space: nowrap;
.table-pagination { }
height: 58px;
box-sizing: border-box; .table-pagination {
width: 100%; height: 58px;
max-width: 100%; box-sizing: border-box;
background-color: var(--ba-bg-color-overlay); width: 100%;
padding: 13px 15px; max-width: 100%;
border-left: 1px solid #e4e7e9; background-color: var(--ba-bg-color-overlay);
border-right: 1px solid #e4e7e9; padding: 13px 15px;
border-bottom: 1px solid #e4e7e9; border-left: 1px solid #e4e7e9;
} border-right: 1px solid #e4e7e9;
</style> border-bottom: 1px solid #e4e7e9;
<!-- @/components/table/column/GroupColumn.vue@/components/table/column/GroupColumn.vue --> }
</style>
<!-- @/components/table/column/GroupColumn.vue@/components/table/column/GroupColumn.vue -->

View File

@@ -1,120 +1,118 @@
<template> <template>
<div class="nav-bar"> <div class="nav-bar">
<div v-if="config.layout.shrink && config.layout.menuCollapse" class="unfold"> <div v-if="config.layout.shrink && config.layout.menuCollapse" class="unfold">
<Icon <Icon
@click="onMenuCollapse" @click="onMenuCollapse"
name="fa fa-indent" name="fa fa-indent"
:color="config.getColorVal('menuActiveColor')" :color="config.getColorVal('menuActiveColor')"
size="18" size="18"
/> />
</div> </div>
<span class="nav-bar-title"> <span class="nav-bar-title">
{{ getTheme.name }} {{ getTheme.name }}
<span style="font-size: 14px"> <span style="font-size: 14px">({{ Version || 'v1.0.0' }})</span>
({{ Version||'v1.0.0' }}) <!-- <span style="font-size: 14px;" v-if="Version?.versionName">
</span> ({{ Version?.versionName }})
<!-- <span style="font-size: 14px;" v-if="Version?.versionName"> </span> -->
({{ Version?.versionName }}) </span>
</span> --> <NavMenus />
</span> </div>
<NavMenus /> </template>
</div>
</template> <script setup lang="ts">
import { useConfig } from '@/stores/config'
<script setup lang="ts"> import NavTabs from '@/layouts/admin/components/navBar/tabs.vue'
import { useConfig } from '@/stores/config' import NavMenus from '../navMenus.vue'
import NavTabs from '@/layouts/admin/components/navBar/tabs.vue' import { showShade } from '@/utils/pageShade'
import NavMenus from '../navMenus.vue' import { getLastData } from '@/api/systerm'
import { showShade } from '@/utils/pageShade'
import { getLastData } from '@/api/systerm' const Version: any = ref(null)
const config = useConfig()
const Version: any = ref('') const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
const config = useConfig()
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string) const onMenuCollapse = () => {
showShade('ba-aside-menu-shade', () => {
const onMenuCollapse = () => { config.setLayout('menuCollapse', true)
showShade('ba-aside-menu-shade', () => { })
config.setLayout('menuCollapse', true) config.setLayout('menuCollapse', false)
}) }
config.setLayout('menuCollapse', false) onMounted(() => {
} getLastData({ versionType: 'WEB' }).then(res => {
onMounted(() => { Version.value = res.data.versionName
getLastData({ versionType: 'WEB' }).then(res => { })
Version.value = res.data.versionName document.title = getTheme.name
}) })
document.title = getTheme.name </script>
})
</script> <style scoped lang="scss">
.nav-bar {
<style scoped lang="scss"> display: flex;
.nav-bar { align-items: center;
display: flex; height: 60px;
align-items: center; width: 100%;
height: 60px; background-color: v-bind('config.getColorVal("headerBarBackground")');
width: 100%;
background-color: v-bind('config.getColorVal("headerBarBackground")'); .nav-bar-title {
color: v-bind('config.getColorVal("headerBarTabColor")');
.nav-bar-title { font-size: 24px;
color: v-bind('config.getColorVal("headerBarTabColor")'); margin-left: 10px;
font-size: 24px; font-weight: 700;
margin-left: 10px; }
font-weight: 700;
} :deep(.nav-tabs) {
display: flex;
:deep(.nav-tabs) { height: 100%;
display: flex; position: relative;
height: 100%;
position: relative; .ba-nav-tab {
display: flex;
.ba-nav-tab { align-items: center;
display: flex; justify-content: center;
align-items: center; padding: 0 20px;
justify-content: center; cursor: pointer;
padding: 0 20px; z-index: 1;
cursor: pointer; height: 100%;
z-index: 1; user-select: none;
height: 100%; color: v-bind('config.getColorVal("headerBarTabColor")');
user-select: none; transition: all 0.2s;
color: v-bind('config.getColorVal("headerBarTabColor")'); -webkit-transition: all 0.2s;
transition: all 0.2s;
-webkit-transition: all 0.2s; .close-icon {
padding: 2px;
.close-icon { margin: 2px 0 0 4px;
padding: 2px; color: v-bind('config.getColorVal("headerBarTabColor")') !important;
margin: 2px 0 0 4px; }
color: v-bind('config.getColorVal("headerBarTabColor")') !important;
} &.active {
color: v-bind('config.getColorVal("headerBarTabActiveColor")');
&.active {
color: v-bind('config.getColorVal("headerBarTabActiveColor")'); .close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;
.close-icon { }
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important; }
}
} &:hover {
color: v-bind('config.getColorVal("headerBarTabActiveColor")');
&:hover { background-color: v-bind('config.getColorVal("headerBarHoverBackground")');
color: v-bind('config.getColorVal("headerBarTabActiveColor")');
background-color: v-bind('config.getColorVal("headerBarHoverBackground")'); .close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;
.close-icon { }
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important; }
} }
}
} .nav-tabs-active-box {
position: absolute;
.nav-tabs-active-box { height: 50px;
position: absolute; background-color: v-bind('config.getColorVal("headerBarTabActiveBackground")');
height: 50px; transition: all 0.2s;
background-color: v-bind('config.getColorVal("headerBarTabActiveBackground")'); -webkit-transition: all 0.2s;
transition: all 0.2s; }
-webkit-transition: all 0.2s; }
} }
}
} .unfold {
align-self: center;
.unfold { padding-left: var(--ba-main-space);
align-self: center; }
padding-left: var(--ba-main-space); </style>
}
</style>

View File

@@ -1,344 +1,344 @@
import type { RouteRecordRaw } from 'vue-router' import type { RouteRecordRaw } from 'vue-router'
const pageTitle = (name: string): string => { const pageTitle = (name: string): string => {
return `pagesTitle.${name}` return `pagesTitle.${name}`
} }
/** /**
* 后台基础路由路径 * 后台基础路由路径
*/ */
export const adminBaseRoutePath = '/admin' export const adminBaseRoutePath = '/admin'
export const adminBaseRoute = { export const adminBaseRoute = {
path: adminBaseRoutePath, path: adminBaseRoutePath,
name: 'admin', name: 'admin',
component: () => import('@/layouts/admin/index.vue'), component: () => import('@/layouts/admin/index.vue'),
// 直接重定向到 loading 路由 // 直接重定向到 loading 路由
redirect: adminBaseRoutePath + '/loading', redirect: adminBaseRoutePath + '/loading',
meta: { meta: {
title: `pagesTitle.admin` title: `pagesTitle.admin`
}, },
children: [ children: [
{ {
path: 'loading/:to?', path: 'loading/:to?',
name: 'adminMainLoading', name: 'adminMainLoading',
component: () => import('@/layouts/common/components/loading.vue'), component: () => import('@/layouts/common/components/loading.vue'),
meta: { meta: {
title: `pagesTitle.loading` title: `pagesTitle.loading`
} }
}, },
{ {
path: 'businessUserRouter', path: 'businessUserRouter',
name: '业务管理员页面', name: '业务管理员页面',
meta: { meta: {
title: pageTitle('businessUser'), title: pageTitle('businessUser'),
icon: 'ep:management', icon: 'ep:management',
alwaysShow: true alwaysShow: true
}, },
children: [ children: [
{ {
path: 'eventView', path: 'eventView',
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue'), component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/event/eventView.vue'),
name: '暂降事件查看页面', name: '暂降事件查看页面',
meta: { meta: {
title: pageTitle('router.eventView') title: pageTitle('router.eventView')
} }
}, },
{ {
path: 'productLine', path: 'productLine',
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/productLine/index.vue'), component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/productLine/index.vue'),
name: '生产线查看页面', name: '生产线查看页面',
meta: { meta: {
title: pageTitle('router.eventView') title: pageTitle('router.eventView')
} }
}, },
{ {
path: 'machine', path: 'machine',
component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/machine/index.vue'), component: () => import('@/views/pqs/voltageSags/sagGovern/businessUser/machine/index.vue'),
name: '终端查看页面', name: '终端查看页面',
meta: { meta: {
title: pageTitle('router.eventView') title: pageTitle('router.eventView')
} }
} }
] ]
}, },
{ {
path: 'sagGovernScheme', path: 'sagGovernScheme',
name: '暂降治理评估方案', name: '暂降治理评估方案',
meta: { meta: {
title: pageTitle('sagGovernScheme'), title: pageTitle('sagGovernScheme'),
icon: 'ep:management', icon: 'ep:management',
alwaysShow: true alwaysShow: true
}, },
children: [ children: [
{ {
path: 'schemeCalc', path: 'schemeCalc',
component: () => import('@/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue'), component: () => import('@/views/pqs/voltageSags/sagGovern/scheme/schemeCalc/index.vue'),
name: '治理评估页面', name: '治理评估页面',
meta: { meta: {
title: pageTitle('router.schemeCalc') title: pageTitle('router.schemeCalc')
} }
}, },
{ {
path: 'schemeHistory', path: 'schemeHistory',
component: () => import('@/views/pqs/voltageSags/sagGovern/scheme/history/index.vue'), component: () => import('@/views/pqs/voltageSags/sagGovern/scheme/history/index.vue'),
name: '治理方案结果详情', name: '治理方案结果详情',
meta: { meta: {
title: pageTitle('router.schemeHistory') title: pageTitle('router.schemeHistory')
} }
} }
] ]
}, },
{ {
path: '/bpm', path: '/bpm',
name: 'bpm', name: 'bpm',
meta: { meta: {
hidden: true hidden: true
}, },
children: [ children: [
{ {
path: 'formEdit', path: 'formEdit',
component: () => import('@/views/system/bpm/form/editor/index.vue'), component: () => import('@/views/system/bpm/form/editor/index.vue'),
name: 'BpmFormEditor', name: 'BpmFormEditor',
meta: { meta: {
title: pageTitle('router.formEdit') title: pageTitle('router.formEdit')
} }
}, },
{ {
path: 'modelEdit', path: 'modelEdit',
component: () => import('@/views/system/bpm/model/editor/index.vue'), component: () => import('@/views/system/bpm/model/editor/index.vue'),
name: 'BpmModelEditor', name: 'BpmModelEditor',
meta: { meta: {
title: pageTitle('router.modelEdit') title: pageTitle('router.modelEdit')
} }
}, },
{ {
path: 'instanceDetail', path: 'instanceDetail',
component: () => import('@/views/system/bpm/processInstance/detail/index.vue'), component: () => import('@/views/system/bpm/processInstance/detail/index.vue'),
name: 'BpmProcessInstanceDetail', name: 'BpmProcessInstanceDetail',
meta: { meta: {
title: pageTitle('router.instanceDetail') title: pageTitle('router.instanceDetail')
} }
}, },
{ {
path: 'ProgramReviewInter', path: 'ProgramReviewInter',
component: () => component: () =>
import('@/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue'), import('@/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue'),
name: 'ProgramReview', name: 'ProgramReview',
meta: { meta: {
title: pageTitle('router.programReview') title: pageTitle('router.programReview')
} }
}, },
{ {
path: 'effectProblem', path: 'effectProblem',
component: () => import('@/views/pqs/supervise/plan/components/effectProblem/index.vue'), component: () => import('@/views/pqs/supervise/plan/components/effectProblem/index.vue'),
name: 'PlanEffectProblem', name: 'PlanEffectProblem',
meta: { meta: {
title: pageTitle('router.effectProblem') title: pageTitle('router.effectProblem')
} }
} }
// { // {
// path: 'manager/model/edit', // path: 'manager/model/edit',
// component: () => import('@/views/bpm/model/editor/index.vue'), // component: () => import('@/views/bpm/model/editor/index.vue'),
// name: 'BpmModelEditor', // name: 'BpmModelEditor',
// meta: { // meta: {
// noCache: true, // noCache: true,
// hidden: true, // hidden: true,
// canTo: true, // canTo: true,
// title: '设计流程', // title: '设计流程',
// activeMenu: '/bpm/manager/model' // activeMenu: '/bpm/manager/model'
// } // }
// }, // },
// { // {
// path: 'manager/definition', // path: 'manager/definition',
// component: () => import('@/views/bpm/definition/index.vue'), // component: () => import('@/views/bpm/definition/index.vue'),
// name: 'BpmProcessDefinition', // name: 'BpmProcessDefinition',
// meta: { // meta: {
// noCache: true, // noCache: true,
// hidden: true, // hidden: true,
// canTo: true, // canTo: true,
// title: '流程定义', // title: '流程定义',
// activeMenu: '/bpm/manager/model' // activeMenu: '/bpm/manager/model'
// } // }
// }, // },
] ]
}, },
{ {
path: 'division', path: 'division',
name: '谐波责任划分页面', name: '谐波责任划分页面',
meta: { meta: {
title: pageTitle('division'), title: pageTitle('division'),
icon: 'ep:management', icon: 'ep:management',
alwaysShow: true alwaysShow: true
}, },
children: [ children: [
{ {
path: 'aListOfLoadData', path: 'aListOfLoadData',
component: () => component: () =>
import('@/views/pqs/harmonicMonitoring/detailed/division/components/aListOfLoadData.vue'), import('@/views/pqs/harmonicMonitoring/detailed/division/components/aListOfLoadData.vue'),
name: '负荷数据列表页面', name: '用采数据列表页面',
meta: { meta: {
title: pageTitle('router.aListOfLoadData') title: pageTitle('router.aListOfLoadData')
} }
}, },
{ {
path: 'compute', path: 'compute',
component: () => import('@/views/pqs/harmonicMonitoring/detailed/division/components/compute.vue'), component: () => import('@/views/pqs/harmonicMonitoring/detailed/division/components/compute.vue'),
name: '贡献度计算页面', name: '贡献度计算页面',
meta: { meta: {
title: pageTitle('router.compute') title: pageTitle('router.compute')
} }
}, },
{ {
path: 'detail', path: 'detail',
component: () => import('@/views/pqs/harmonicMonitoring/detailed/division/components/detail.vue'), component: () => import('@/views/pqs/harmonicMonitoring/detailed/division/components/detail.vue'),
name: 'detail', name: 'detail',
meta: { meta: {
title: pageTitle('router.detail') title: pageTitle('router.detail')
} }
} }
] ]
}, },
{ {
path: 'runManage', path: 'runManage',
name: '谐波责任划分页面', name: '二级评估',
meta: { meta: {
title: pageTitle('runManage'), title: pageTitle('runManage'),
icon: 'ep:management', icon: 'ep:management',
alwaysShow: true alwaysShow: true
}, },
children: [ children: [
{ {
path: 'addUser', path: 'addUser',
component: () => import('@/views/pqs/runManage/assessment/components/uese/form.vue'), component: () => import('@/views/pqs/runManage/assessment/components/uese/form.vue'),
name: '新增评估用户', name: '新增评估用户',
meta: { meta: {
title: pageTitle('router.addUser') title: pageTitle('router.addUser')
} }
} }
] ]
}, },
{ {
path: 'cockpit', path: 'cockpit',
name: '项目管理', name: '项目管理',
meta: { meta: {
title: pageTitle('runManage'), title: pageTitle('runManage'),
icon: 'ep:management', icon: 'ep:management',
alwaysShow: true alwaysShow: true
}, },
children: [ children: [
{ {
path: 'popup', path: 'popup',
component: () => import('@/views/pqs/cockpit/setUp/components/popup.vue'), component: () => import('@/views/pqs/cockpit/setUp/components/popup.vue'),
name: '新增项目', name: '新增项目',
meta: { meta: {
title: pageTitle('router.popup') title: pageTitle('router.popup')
} }
}, },
{ {
path: 'view', path: 'view',
component: () => import('@/views/pqs/cockpit/setUp/components/view.vue'), component: () => import('@/views/pqs/cockpit/setUp/components/view.vue'),
name: '预览项目', name: '预览项目',
meta: { meta: {
title: pageTitle('router.view') title: pageTitle('router.view')
} }
} }
] ]
}, },
{ {
path: '/boX', path: '/boX',
name: 'boX', name: 'boX',
component: () => import('@/components/echarts/boX.vue'), component: () => import('@/components/echarts/boX.vue'),
meta: { meta: {
title: pageTitle('boX') title: pageTitle('boX')
} }
} }
/*{ /*{
path: '/bpm', path: '/bpm',
name: 'bpm', name: 'bpm',
meta: { meta: {
hidden: true hidden: true
}, },
children: [ children: [
{ {
path: 'programReview', path: 'programReview',
component: () => import('@/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue'), component: () => import('@/views/pqs/supervise/interfere/components/normalizationManager/programReview.vue'),
name: 'programReview', name: 'programReview',
meta: { meta: {
title: pageTitle('router.programReview') title: pageTitle('router.programReview')
} }
},{ },{
path: 'projectTreat', path: 'projectTreat',
component: () => import('@/views/pqs/supervise/interfere/components/normalizationManager/projectTreat.vue'), component: () => import('@/views/pqs/supervise/interfere/components/normalizationManager/projectTreat.vue'),
name: 'projectTreat', name: 'projectTreat',
meta: { meta: {
title: pageTitle('router.projectTreat') title: pageTitle('router.projectTreat')
} }
}, },
] ]
},*/ },*/
] ]
} }
/* /*
* 静态路由 * 静态路由
* 自动加载 ./static 目录的所有文件,并 push 到以下数组 * 自动加载 ./static 目录的所有文件,并 push 到以下数组
*/ */
const staticRoutes: Array<RouteRecordRaw> = [ const staticRoutes: Array<RouteRecordRaw> = [
adminBaseRoute, adminBaseRoute,
{ {
path: '/', path: '/',
redirect: to => { redirect: to => {
return { return {
name: 'adminMainLoading' name: 'adminMainLoading'
} }
} }
}, },
{ {
// 管理员登录页 - 不放在 adminBaseRoute.children 因为登录页不需要使用后台的布局 // 管理员登录页 - 不放在 adminBaseRoute.children 因为登录页不需要使用后台的布局
path: '/login', path: '/login',
name: 'login', name: 'login',
component: () => import('@/views/user/login.vue'), component: () => import('@/views/user/login.vue'),
meta: { meta: {
title: pageTitle('login') title: pageTitle('login')
} }
}, },
{ {
path: '/:path(.*)*', path: '/:path(.*)*',
redirect: '/404' redirect: '/404'
}, },
{ {
path: '/404', path: '/404',
name: 'notFound', name: 'notFound',
component: () => import('@/views/common/error/404.vue'), component: () => import('@/views/common/error/404.vue'),
meta: { meta: {
title: pageTitle('notFound') // 页面不存在 title: pageTitle('notFound') // 页面不存在
} }
}, },
{ {
path: '/previewFile', path: '/previewFile',
name: 'previewFile', name: 'previewFile',
component: () => import('@/components/PreviewFile/index.vue'), component: () => import('@/components/PreviewFile/index.vue'),
meta: { meta: {
title: pageTitle('previewFile') title: pageTitle('previewFile')
} }
}, },
{ {
// 后台找不到页面了-可能是路由未加载上 // 后台找不到页面了-可能是路由未加载上
path: adminBaseRoutePath + ':path(.*)*', path: adminBaseRoutePath + ':path(.*)*',
redirect: to => { redirect: to => {
return { return {
name: 'adminMainLoading', name: 'adminMainLoading',
params: { params: {
to: JSON.stringify({ to: JSON.stringify({
path: to.path, path: to.path,
query: to.query query: to.query
}) })
} }
} }
} }
} }
] ]
export default staticRoutes export default staticRoutes

View File

@@ -1,225 +1,225 @@
import { reactive } from 'vue' import { reactive } from 'vue'
import createAxios from '@/utils/request' import createAxios from '@/utils/request'
import { requestPayload } from '@/utils/request' import { requestPayload } from '@/utils/request'
import { Method } from 'axios' import { Method } from 'axios'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { filtration } from './tableMethod' import { filtration } from './tableMethod'
interface TableStoreParams { interface TableStoreParams {
url: string // 请求地址 url: string // 请求地址
pk?: string pk?: string
filename?: any // 导出文件名 filename?: any // 导出文件名
column: TableColumn[] column: TableColumn[]
params?: anyObj params?: anyObj
method?: Method // 请求方式 method?: Method // 请求方式
isWebPaging?: boolean // 是否前端分页 isWebPaging?: boolean // 是否前端分页
showPage?: boolean //是否需要分页 showPage?: boolean //是否需要分页
timeAll?: boolean //是否需要时间全部显示 timeAll?: boolean //是否需要时间全部显示
paramsPOST?: boolean // post请求 params传参 paramsPOST?: boolean // post请求 params传参
publicHeight?: number //计算高度 publicHeight?: number //计算高度
resetCallback?: () => void // 重置 resetCallback?: () => void // 重置
loadCallback?: () => void // 接口调用后的回调 loadCallback?: () => void // 接口调用后的回调
exportProcessingData?:() => void //导出处理数据 exportProcessingData?:() => void //导出处理数据
beforeSearchFun?: () => void // 接口调用前的回调 beforeSearchFun?: () => void // 接口调用前的回调
} }
export default class TableStore { export default class TableStore {
public url public url
public pk public pk
public filename: any = null public filename: any = null
public method: Method public method: Method
public initData: any = null public initData: any = null
public isWebPaging = false public isWebPaging = false
public paramsPOST = true public paramsPOST = true
public showPage = true public showPage = true
public timeAll = true public timeAll = true
public table: CnTable = reactive({ public table: CnTable = reactive({
ref: null, ref: null,
selection: [], selection: [],
data: [], data: [],
allData: [], allData: [],
allFlag: false, allFlag: false,
webPagingData: [], webPagingData: [],
total: 0, total: 0,
params: { params: {
pageNum: 1, pageNum: 1,
pageSize: 20 pageSize: 20
}, },
filename:null, filename:null,
loading: true, loading: true,
column: [], column: [],
loadCallback: null, loadCallback: null,
exportProcessingData: null, exportProcessingData: null,
resetCallback: null, resetCallback: null,
beforeSearchFun: null, beforeSearchFun: null,
height: '', height: '',
publicHeight: 0 publicHeight: 0
}) })
constructor(public options: TableStoreParams) { constructor(public options: TableStoreParams) {
this.url = options.url this.url = options.url
this.pk = options.pk || 'id' this.pk = options.pk || 'id'
this.paramsPOST = options.paramsPOST || false this.paramsPOST = options.paramsPOST || false
this.isWebPaging = options.isWebPaging || false this.isWebPaging = options.isWebPaging || false
this.method = options.method || 'GET' this.method = options.method || 'GET'
this.table.filename = options.filename || null this.table.filename = options.filename || null
this.table.column = options.column this.table.column = options.column
this.showPage = options.showPage !== false this.showPage = options.showPage !== false
this.table.publicHeight = options.publicHeight || 0 this.table.publicHeight = options.publicHeight || 0
this.table.resetCallback = options.resetCallback || null this.table.resetCallback = options.resetCallback || null
this.table.loadCallback = options.loadCallback || null this.table.loadCallback = options.loadCallback || null
this.table.exportProcessingData = options.exportProcessingData || null this.table.exportProcessingData = options.exportProcessingData || null
this.table.beforeSearchFun = options.beforeSearchFun || null this.table.beforeSearchFun = options.beforeSearchFun || null
Object.assign(this.table.params, options.params) Object.assign(this.table.params, options.params)
this.table.height = mainHeight(20 + (this.showPage ? 58 : 0) + this.table.publicHeight).height as string this.table.height = mainHeight(20 + (this.showPage ? 58 : 0) + this.table.publicHeight).height as string
} }
index() { index() {
this.table.beforeSearchFun && this.table.beforeSearchFun() this.table.beforeSearchFun && this.table.beforeSearchFun()
this.table.data = [] this.table.data = []
this.table.loading = true this.table.loading = true
// 重置用的数据数据 // 重置用的数据数据
if (!this.initData) { if (!this.initData) {
this.initData = JSON.parse(JSON.stringify(this.table.params)) this.initData = JSON.parse(JSON.stringify(this.table.params))
} }
if (!this.timeAll) { if (!this.timeAll) {
delete this.table.params.startTime; delete this.table.params.startTime;
delete this.table.params.endTime; delete this.table.params.endTime;
delete this.table.params.searchBeginTime; delete this.table.params.searchBeginTime;
delete this.table.params.searchEndTime; delete this.table.params.searchEndTime;
delete this.table.params.timeFlag; delete this.table.params.timeFlag;
} }
createAxios( createAxios(
Object.assign( Object.assign(
{ {
url: this.url, url: this.url,
method: this.method method: this.method
}, },
requestPayload(this.method, this.table.params, this.paramsPOST) requestPayload(this.method, this.table.params, this.paramsPOST)
) )
) )
.then((res: any) => { .then((res: any) => {
if (res.data) { if (res.data) {
this.table.data = res.data.records || res.data this.table.data = res.data.records || res.data
this.table.total = res.data?.total || res.data.length || 0 this.table.total = res.data?.total || res.data.length || 0
} else { } else {
this.table.data = [] this.table.data = []
this.table.total = 0 this.table.total = 0
} }
if (Array.isArray(res)) { if (Array.isArray(res)) {
this.table.data = res this.table.data = res
} }
if (this.isWebPaging) { if (this.isWebPaging) {
this.table.webPagingData = window.XEUtils.chunk(this.table.data, this.table.params.pageSize) this.table.webPagingData = window.XEUtils.chunk(this.table.data, this.table.params.pageSize)
this.table.data = this.table.webPagingData[this.table.params.pageNum - 1] this.table.data = this.table.webPagingData[this.table.params.pageNum - 1]
} }
this.table.loadCallback && this.table.loadCallback() this.table.loadCallback && this.table.loadCallback()
this.table.loading = false this.table.loading = false
}) })
.catch(() => { .catch(() => {
this.table.loading = false this.table.loading = false
}) })
} }
/** /**
* 表格内的事件统一响应 * 表格内的事件统一响应
* @param event 事件:selection-change=选中项改变,page-size-change=每页数量改变,current-page-change=翻页 * @param event 事件:selection-change=选中项改变,page-size-change=每页数量改变,current-page-change=翻页
* @param data 携带数据 * @param data 携带数据
*/ */
onTableAction = (event: string, data: anyObj) => { onTableAction = (event: string, data: anyObj) => {
const actionFun = new Map([ const actionFun = new Map([
[ [
'search', 'search',
() => { () => {
this.table.params.pageNum = 1 this.table.params.pageNum = 1
this.index() this.index()
} }
], ],
[ [
'reset', 'reset',
() => { () => {
delete this.initData.pageSize delete this.initData.pageSize
// console.log(this.table.params) // console.log(this.table.params)
// console.log(this.initData) // console.log(this.initData)
Object.assign(this.table.params, this.initData) Object.assign(this.table.params, this.initData)
this.table.resetCallback && this.table.resetCallback() this.table.resetCallback && this.table.resetCallback()
this.index() this.index()
} }
], ],
[ [
'selection-change', 'selection-change',
() => { () => {
this.table.selection = data as TableRow[] this.table.selection = data as TableRow[]
} }
], ],
[ [
'page-size-change', 'page-size-change',
() => { () => {
this.table.params.pageSize = data.size this.table.params.pageSize = data.size
this.table.params.pageNum = 1 this.table.params.pageNum = 1
if (this.isWebPaging) { if (this.isWebPaging) {
this.table.webPagingData = window.XEUtils.chunk( this.table.webPagingData = window.XEUtils.chunk(
window.XEUtils.flatten(this.table.webPagingData), window.XEUtils.flatten(this.table.webPagingData),
this.table.params.pageSize this.table.params.pageSize
) )
this.table.data = this.table.webPagingData[this.table.params.pageNum - 1] this.table.data = this.table.webPagingData[this.table.params.pageNum - 1]
} else { } else {
this.index() this.index()
} }
} }
], ],
[ [
'current-page-change', 'current-page-change',
() => { () => {
this.table.params.pageNum = data.page this.table.params.pageNum = data.page
if (this.isWebPaging) { if (this.isWebPaging) {
this.table.data = [] this.table.data = []
requestAnimationFrame(() => { requestAnimationFrame(() => {
this.table.data = this.table.webPagingData[data.page - 1] this.table.data = this.table.webPagingData[data.page - 1]
}) })
} else { } else {
this.index() this.index()
} }
} }
], ],
[ [
'field-change', 'field-change',
() => { () => {
console.warn('field-change') console.warn('field-change')
} }
], ],
[ [
'default', 'default',
() => { () => {
console.warn('No action defined') console.warn('No action defined')
} }
], ],
[ [
'export', 'export',
() => { () => {
// this.index() // this.index()
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total } let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
createAxios( createAxios(
Object.assign( Object.assign(
{ {
url: this.url, url: this.url,
method: this.method method: this.method
}, },
requestPayload(this.method, params, this.paramsPOST) requestPayload(this.method, params, this.paramsPOST)
) )
).then(res => { ).then(res => {
this.table.allData = filtration(res.data.records || res.data) this.table.allData = filtration(res.data.records || res.data)
this.table.exportProcessingData && this.table.exportProcessingData() this.table.exportProcessingData && this.table.exportProcessingData()
this.table.allFlag = data.showAllFlag || true this.table.allFlag = data.showAllFlag || true
}) })
} }
] ]
]) ])
const action = actionFun.get(event) || actionFun.get('default') const action = actionFun.get(event) || actionFun.get('default')
action!.call(this) action!.call(this)
} }
} }

View File

@@ -0,0 +1,82 @@
<template>
<!-- 新增 -->
<el-dialog draggable title="详情" v-model="dialogVisible" width="1200px">
<TableHeader datePicker showExport :showReset="false">
<template v-slot:select>
<el-form-item label="筛选数据">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
</el-form-item>
</template>
</TableHeader>
<div :key="key">
<Table ref="tableRef" :height="'49vh'"></Table>
</div>
</el-dialog>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, reactive, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
defineOptions({
name: 'frontLog'
})
const key = ref(0)
const dialogVisible = ref(false)
const tableStore = new TableStore({
url: '/system-boot/frontLog/queryLogCHild',
method: 'POST',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
title: '发生时间',
field: 'updateTime',
width: '150',
sortable: true
},
{
title: '日志等级',
field: 'grade',
width: '100'
},
{
title: '日志详情',
field: 'log',
formatter: (row: any) => {
return row.cellValue || '/'
}
}
]
})
tableStore.table.params.type = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
const open = (row: any) => {
dialogVisible.value = true
tableStore.table.params.mainId = row.id
setTimeout(() => {
tableStore.index()
}, 0)
}
defineExpose({ open })
</script>
<style lang="scss" scoped></style>

View File

@@ -1,88 +1,111 @@
<template> <template>
<div class="default-main"> <div class="default-main">
<TableHeader datePicker showExport> <TableHeader datePicker showExport>
<template v-slot:select> <template v-slot:select>
<el-form-item label="筛选数据"> <el-form-item label="筛选数据">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable /> <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
</el-form-item> </el-form-item>
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef"></Table> <Table ref="tableRef"></Table>
</div> <!-- 详情 -->
</template> <Detail ref="detailRef"/>
<script setup lang="ts"> </div>
import { ref, onMounted, provide, reactive, nextTick } from 'vue' </template>
<script setup lang="ts">
import TableStore from '@/utils/tableStore' import { ref, onMounted, provide, reactive, nextTick } from 'vue'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableStore from '@/utils/tableStore'
import { useDictData } from '@/stores/dictData' import Table from '@/components/table/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus' import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
defineOptions({ import Detail from './detail.vue'
name: 'frontLog' import { ElMessage, ElMessageBox } from 'element-plus'
})
const pushDisplayRef = ref() defineOptions({
const dictData = useDictData() name: 'frontLog'
const fontdveoption = dictData.getBasicData('Dev_Ops') })
const detailRef = ref()
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/system-boot/frontLog/query', url: '/system-boot/frontLog/query',
method: 'POST', method: 'POST',
column: [ column: [
{ {
field: 'index', field: 'index',
title: '序号', title: '序号',
width: '80', width: '80',
formatter: (row: any) => { formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} }
}, },
// { title: '名称', field: 'name', width: '200' }, // { title: '名称', field: 'name', width: '200' },
{ {
title: '进程号', title: '进程号',
field: 'processNo', field: 'processNo',
width: '80' width: '80'
}, },
{ {
title: '业务名称', title: '业务名称',
field: 'businessName', field: 'businessName',
width: '250' minWidth: '250'
}, },
{ {
title: '日志层级', title: '日志层级',
field: 'level', field: 'level',
width: '100' minWidth: '100'
}, },
{ {
title: '前置业务类型', title: '前置业务类型',
field: 'frontType', field: 'frontType',
width: '120' minWidth: '120'
}, },
{ {
title: '更改时间', title: '更改时间',
field: 'updateTime', field: 'updateTime',
width: '180', minWidth: '180',
sortable: true sortable: true
}, },
{ title: '日志详情', field: 'log' } {
], title: '日志错误码',
beforeSearchFun: () => {} field: 'codeName',
}) minWidth: '180',
formatter: (row: any) => {
const tableRef = ref() return row.cellValue || '/'
provide('tableRef', tableRef) }
tableStore.table.params.type = '' },
tableStore.table.params.searchValue = '' {
provide('tableStore', tableStore) title: '操作',
width: '180',
onMounted(() => { render: 'buttons',
tableStore.index() buttons: [
}) {
name: 'edit',
const addMenu = () => {} title: '详情',
</script> type: 'primary',
<style lang="scss" scoped></style> icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
detailRef.value.open(row)
}
}
]
}
],
beforeSearchFun: () => {}
})
tableStore.table.params.type = ''
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const addMenu = () => {}
</script>
<style lang="scss" scoped></style>

View File

@@ -78,6 +78,30 @@
@click="edit(data)" @click="edit(data)"
link link
></el-button> ></el-button>
<el-popconfirm
v-else
class="box-item"
title="确定重启吗?"
placement="bottom"
@confirm="restart(data)"
>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="warning" size="small" @click="confirm">确认</el-button>
</template>
<template #reference>
<el-button
style="margin-left: 4px"
icon="el-icon-Refresh"
type="warning"
link
@click.stop
></el-button>
<!-- @click.stop="restart(data)" -->
</template>
</el-popconfirm>
</div> </div>
</div> </div>
</template> </template>
@@ -94,7 +118,13 @@
> >
<el-form :model="formData" label-width="120px" :rules="rules" ref="ruleFormRef"> <el-form :model="formData" label-width="120px" :rules="rules" ref="ruleFormRef">
<el-form-item label="名称:" prop="name"> <el-form-item label="名称:" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" maxlength="32" show-word-limit @input="handleInput"></el-input> <el-input
v-model="formData.name"
placeholder="请输入名称"
maxlength="32"
show-word-limit
@input="handleInput"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="IP:" prop="ip" class="top"> <el-form-item label="IP:" prop="ip" class="top">
<el-input v-model="formData.ip" placeholder="请输入Ip"></el-input> <el-input v-model="formData.ip" placeholder="请输入Ip"></el-input>
@@ -173,7 +203,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, provide, reactive, nextTick } from 'vue' import { ref, onMounted, provide, reactive, nextTick } from 'vue'
import { addNode, delNode, updateNode, nodeDeviceTree, updateDeviceProcess } from '@/api/device-boot/Business' import {
addNode,
delNode,
updateNode,
nodeDeviceTree,
updateDeviceProcess,
askRestartProcess
} from '@/api/device-boot/Business'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
@@ -295,6 +332,29 @@ const tableStore = new TableStore({
formData.value = JSON.parse(JSON.stringify(row)) formData.value = JSON.parse(JSON.stringify(row))
} }
}, },
{
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', name: 'del',
@@ -330,35 +390,52 @@ const tableStore = new TableStore({
currentChangeEvent() currentChangeEvent()
} }
}) })
const nodeId = ref('')
// 点击行 // 点击行
const currentChangeEvent = () => { const currentChangeEvent = () => {
// 确保 tableRef 和当前记录存在 // 确保 tableRef 和当前记录存在
if (!tableRef.value || !tableRef.value.getRef().getCurrentRecord()) { if (!tableRef.value || !tableRef.value.getRef().getCurrentRecord()) {
loading.value = false; loading.value = false
dataSource.value = []; dataSource.value = []
return; return
} }
loading.value = true loading.value = true
dataSource.value = [] dataSource.value = []
nodeDeviceTree({ nodeDeviceTree({
nodeId: tableRef.value.getRef().getCurrentRecord().id nodeId: tableRef.value.getRef().getCurrentRecord().id
}).then(res => {
// 检查返回的数据是否存在且不为空
if (res.data && res.data.processDeviceList) {
dataSource.value = res.data.processDeviceList.filter(item => (item.name = item.processNo + ''))
} else {
dataSource.value = []
}
loading.value = false
}).catch(() => {
// 添加错误处理,确保 loading 状态也能关闭
dataSource.value = []
loading.value = false
}) })
.then(res => {
nodeId.value = tableRef.value.getRef().getCurrentRecord().id
// 检查返回的数据是否存在且不为空
if (res.data && res.data.processDeviceList) {
dataSource.value = res.data.processDeviceList.filter(item => (item.name = item.processNo + ''))
} else {
dataSource.value = []
}
loading.value = false
})
.catch(() => {
// 添加错误处理,确保 loading 状态也能关闭
dataSource.value = []
loading.value = false
})
// const row = tableRef.value.getRef().getCurrentRecord() // const row = tableRef.value.getRef().getCurrentRecord()
} }
// 重启进程
const restart = (data: any) => {
console.log('🚀 ~ restart ~ data:', data)
askRestartProcess({
deviceRebootType: data.processNo,
nodeId: nodeId.value,
processNo: 2
}).then(res => {
ElMessage.success('重启成功')
currentChangeEvent()
})
}
const treeRef = ref() const treeRef = ref()
// 树过滤 // 树过滤
const change = val => { const change = val => {

View File

@@ -1,234 +1,234 @@
<template> <template>
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="500px"> <el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" :title="title" width="500px">
<el-scrollbar> <el-scrollbar>
<el-form :inline="false" :model="form" label-width="auto" class="form-one" :rules="rules" ref="formRef"> <el-form :inline="false" :model="form" label-width="auto" class="form-one" :rules="rules" ref="formRef">
<el-form-item label="上级名称" v-if="title == '新增'"> <el-form-item label="上级名称" v-if="title == '新增'">
<el-select v-model="form.pid" placeholder="请选择上级名称" clearable> <el-select v-model="form.pid" placeholder="请选择上级名称" clearable>
<el-option v-for="item in dataTree" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in dataTree" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="选择修改" v-if="title == '修改'"> <el-form-item label="选择修改" v-if="title == '修改'">
<el-cascader v-model="cascaderId" :options="dataTree" placeholder="请选择需要修改的内容" filterable <el-cascader v-model="cascaderId" :options="dataTree" placeholder="请选择需要修改的内容" filterable
checkStrictly :props="cascaderProps" @change="change" /> checkStrictly :props="cascaderProps" @change="change" />
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="名称" maxlength="20" show-word-limit @input="handleInput"/> <el-input v-model="form.name" placeholder="名称" maxlength="40" show-word-limit @input="handleInput"/>
</el-form-item> </el-form-item>
<el-form-item label="标准" v-if="title == '新增' && form.pid?.length > 0"> <el-form-item label="标准" v-if="title == '新增' && form.pid?.length > 0">
<el-upload v-model:file-list="urlList" ref="upload" action="" :limit="1" :auto-upload="false" <el-upload v-model:file-list="urlList" ref="upload" action="" :limit="1" :auto-upload="false"
:on-exceed="handleExceed"> :on-exceed="handleExceed">
<el-button type="primary">上传</el-button> <el-button type="primary">上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="标准" v-if="title == '修改' && cascaderId.length > 1"> <el-form-item label="标准" v-if="title == '修改' && cascaderId.length > 1">
<el-upload v-model:file-list="urlList" ref="upload" action="" :limit="1" :auto-upload="false" <el-upload v-model:file-list="urlList" ref="upload" action="" :limit="1" :auto-upload="false"
:on-exceed="handleExceed"> :on-exceed="handleExceed">
<el-button type="primary">上传</el-button> <el-button type="primary">上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit" :loading="loading">确认</el-button> <el-button type="primary" @click="submit" :loading="loading">确认</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, inject } from 'vue' import { ref, inject } from 'vue'
import { reactive } from 'vue' import { reactive } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { queryAll, libstandardAdd, updateStandardLibrary } from '@/api/supervision-boot/database/index' import { queryAll, libstandardAdd, updateStandardLibrary } from '@/api/supervision-boot/database/index'
import { uploadFile, getFileNameAndFilePath } from '@/api/system-boot/file' import { uploadFile, getFileNameAndFilePath } from '@/api/system-boot/file'
import { genFileId } from 'element-plus' import { genFileId } from 'element-plus'
import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus' import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
const upload = ref<UploadInstance>() const upload = ref<UploadInstance>()
const dialogVisible = ref(false) const dialogVisible = ref(false)
const title = ref('') const title = ref('')
const emit = defineEmits(['getTree', 'onSubmit']) const emit = defineEmits(['getTree', 'onSubmit'])
const formRef = ref() const formRef = ref()
// 注意不要和表单ref的命名冲突 // 注意不要和表单ref的命名冲突
const form: any = reactive<anyObj>({ const form: any = reactive<anyObj>({
name: '', name: '',
pid: '', pid: '',
url: '' url: ''
}) })
const cascaderId = ref([]) const cascaderId = ref([])
const urlList: any = ref([]) const urlList: any = ref([])
const loading = ref(false) const loading = ref(false)
const cascaderProps = { const cascaderProps = {
children: 'children', children: 'children',
label: 'name', label: 'name',
value: 'id', value: 'id',
checkStrictly: true, checkStrictly: true,
} }
const rules = { const rules = {
name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }] name: [{ required: true, message: '角色名称不能为空', trigger: 'blur' }]
} }
const dataTree: any = ref([]) const dataTree: any = ref([])
const open = (text: string, data?: anyObj) => { const open = (text: string, data?: anyObj) => {
getTheTree() getTheTree()
cascaderId.value = [] cascaderId.value = []
title.value = text title.value = text
urlList.value = [] urlList.value = []
dialogVisible.value = true dialogVisible.value = true
// if (data) { // if (data) {
// // 表单赋值 // // 表单赋值
// for (let key in form) { // for (let key in form) {
// form[key] = data[key] // form[key] = data[key]
// } // }
// form.id = data.id // form.id = data.id
// if (form.pid == 0) { // if (form.pid == 0) {
// form.pid = '' // form.pid = ''
// } // }
// if (data.url?.length > 0) { // if (data.url?.length > 0) {
// getFileNameAndFilePath({ filePath: data.url }).then(res => { // getFileNameAndFilePath({ filePath: data.url }).then(res => {
// urlList.value.push({ // urlList.value.push({
// name: res.data.fileName, // name: res.data.fileName,
// url: res.data.name // url: res.data.name
// }) // })
// }) // })
// } // }
// } else { // } else {
// 在此处恢复默认表单 // 在此处恢复默认表单
for (let key in form) { for (let key in form) {
form[key] = '' form[key] = ''
} }
// } // }
} }
const handleExceed: UploadProps['onExceed'] = (files) => { const handleExceed: UploadProps['onExceed'] = (files) => {
upload.value!.clearFiles() upload.value!.clearFiles()
const file = files[0] as UploadRawFile const file = files[0] as UploadRawFile
file.uid = genFileId() file.uid = genFileId()
upload.value!.handleStart(file) upload.value!.handleStart(file)
} }
const getTheTree = () => { const getTheTree = () => {
queryAll().then(res => { queryAll().then(res => {
dataTree.value = res.data dataTree.value = res.data
}) })
} }
const change = (val: any) => { const change = (val: any) => {
const selectedNode = findNodeById(dataTree.value, val[val.length - 1]); const selectedNode = findNodeById(dataTree.value, val[val.length - 1]);
urlList.value = [] urlList.value = []
if (val.length > 0) { if (val.length > 0) {
form.name = selectedNode.name form.name = selectedNode.name
form.id = selectedNode.id form.id = selectedNode.id
form.pid = selectedNode.pid form.pid = selectedNode.pid
if (selectedNode.url?.length > 0) { if (selectedNode.url?.length > 0) {
getFileNameAndFilePath({ filePath: selectedNode.url }).then(res => { getFileNameAndFilePath({ filePath: selectedNode.url }).then(res => {
urlList.value.push({ urlList.value.push({
name: res.data.fileName, name: res.data.fileName,
url: res.data.name url: res.data.name
}) })
}) })
} }
} else { } else {
form.name = '' form.name = ''
form.id = '' form.id = ''
form.pid = '' form.pid = ''
form.url = '' form.url = ''
} }
} }
const findNodeById = (tree: any[], id: any) => { const findNodeById = (tree: any[], id: any) => {
for (const node of tree) { for (const node of tree) {
if (node.id === id) { if (node.id === id) {
return node; return node;
} }
if (node.children) { if (node.children) {
const found: any = findNodeById(node.children, id); const found: any = findNodeById(node.children, id);
if (found) { if (found) {
return found; return found;
} }
} }
} }
return null; return null;
}; };
const submit = async () => { const submit = async () => {
loading.value = true loading.value = true
formRef.value.validate(async (valid: boolean) => { formRef.value.validate(async (valid: boolean) => {
if (valid) { if (valid) {
if (urlList.value.length > 0 && form.pid != '') { if (urlList.value.length > 0 && form.pid != '') {
const promises = urlList.value.map(async (item: any) => { const promises = urlList.value.map(async (item: any) => {
if (urlList.value[0].raw) { if (urlList.value[0].raw) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uploadFile(item.raw, '/supervision/') uploadFile(item.raw, '/supervision/')
.then((res: any) => { .then((res: any) => {
resolve(res.data.name) resolve(res.data.name)
}) })
.catch(reject) .catch(reject)
}) })
} else { } else {
return item.url return item.url
} }
}) })
try { try {
const fileNames = await Promise.all(promises) const fileNames = await Promise.all(promises)
form.url = fileNames.join(',') + '' form.url = fileNames.join(',') + ''
} catch (error) { } catch (error) {
console.error('上传文件出错', error) console.error('上传文件出错', error)
return return
} }
} else { } else {
form.url = '' form.url = ''
} }
setTimeout(() => { setTimeout(() => {
if (title.value == '新增') { if (title.value == '新增') {
libstandardAdd({ libstandardAdd({
pid: form.pid == '' ? null : form.pid, pid: form.pid == '' ? null : form.pid,
name: form.name, name: form.name,
url: form.url url: form.url
}).then(res => { }).then(res => {
ElMessage.success('新增成功') ElMessage.success('新增成功')
handleClose() handleClose()
dialogVisible.value = false dialogVisible.value = false
}) })
} else { } else {
updateStandardLibrary({ updateStandardLibrary({
pid: form.pid == '' ? null : form.pid, pid: form.pid == '' ? null : form.pid,
name: form.name, name: form.name,
url: form.url, url: form.url,
id: form.id id: form.id
}).then(res => { }).then(res => {
ElMessage.success('修改成功') ElMessage.success('修改成功')
handleClose() handleClose()
dialogVisible.value = false dialogVisible.value = false
}) })
} }
}, 100) }, 100)
} }
}) })
setTimeout(() => { setTimeout(() => {
loading.value = false loading.value = false
}, 1000); }, 1000);
} }
const handleClose = () => { const handleClose = () => {
urlList.value = [] urlList.value = []
emit('onSubmit') emit('onSubmit')
dialogVisible.value = false dialogVisible.value = false
} }
const handleInput = (value: string) => { const handleInput = (value: string) => {
// 过滤空格 // 过滤空格
const filteredValue = value.replace(/\s/g, '') const filteredValue = value.replace(/\s/g, '')
if (filteredValue !== value) { if (filteredValue !== value) {
form.name = filteredValue form.name = filteredValue
} }
} }
defineExpose({ open }) defineExpose({ open })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-upload-list__item) { :deep(.el-upload-list__item) {
width: 400px; width: 400px;
} }
</style> </style>

View File

@@ -1,164 +1,169 @@
<!-- 负荷数据列表 --> <!-- 用采数据列表 -->
<template> <template>
<div class="default-main" :style="height"> <div class="default-main" :style="height">
<div class="title"> <div class="title">
负荷数据列表 用采数据列表
<back-component /> <back-component />
</div>
</div> <TableHeader :showReset="false" ref="TableHeaderRef">
<TableHeader :showReset="false" ref="TableHeaderRef"> <template #select>
<template #select> <el-form-item label="关键字">
<el-form-item label="关键字"> <el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" />
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" /> </el-form-item>
</el-form-item> </template>
</template> <template #operation>
<template #operation> <el-button type="primary" icon="el-icon-Plus" @click="dialogVisible = true">新增</el-button>
<el-button type="primary" icon="el-icon-Plus" @click="dialogVisible = true">新增</el-button> </template>
</TableHeader>
</template> <Table ref="tableRef"></Table>
</TableHeader> <!-- 详情 -->
<Table ref="tableRef"></Table> <completenessDetails ref="completenessDetailsRef" />
<!-- 详情 -->
<completenessDetails ref="completenessDetailsRef" /> <el-dialog v-model="dialogVisible" draggable title="上传数据" width="500" :before-close="handleClose">
<el-upload
<el-dialog v-model="dialogVisible" title="上传数据" width="500" :before-close="handleClose"> ref="upload"
<el-upload ref="upload" action="" v-model:file-list="fileList" accept=".xlsx,.xls" :auto-upload="false" action=""
:on-change="choose" :limit="2"> v-model:file-list="fileList"
<el-button type="primary" class="ml10" icon="el-icon-Upload">上传文件</el-button> accept=".xlsx,.xls"
</el-upload> :auto-upload="false"
<template #footer> :on-change="choose"
:limit="2"
<el-button @click="handleClose">取消</el-button> >
<el-button type="primary" @click="submitupload"> <el-button type="primary" class="ml10" icon="el-icon-Upload">上传文件</el-button>
确认 </el-upload>
</el-button> <template #footer>
<el-button @click="handleClose">取消</el-button>
</template> <el-button type="primary" @click="submitupload" :loading="loading">确认</el-button>
</el-dialog> </template>
</div> </el-dialog>
</div>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import { ref, reactive, onMounted, onUnmounted } from 'vue' import { ref, reactive, onMounted, onUnmounted } from 'vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import BackComponent from '@/components/icon/back/index.vue' import BackComponent from '@/components/icon/back/index.vue'
import completenessDetails from './completenessDetails.vue' import completenessDetails from './completenessDetails.vue'
import { genFileId, ElMessage } from 'element-plus' import { genFileId, ElMessage } from 'element-plus'
import { uploadUserData } from '@/api/advance-boot/division' import { uploadUserData ,deleteUserDataByIds} from '@/api/advance-boot/division'
import type { UploadInstance, UploadProps, UploadRawFile, } from 'element-plus' import type { UploadInstance, UploadProps, UploadRawFile } from 'element-plus'
const height = mainHeight(20) defineOptions({
const completenessDetailsRef = ref() name: 'division/aListOfLoadData'
const dialogVisible = ref(false) })
const upload = ref<UploadInstance>() const loading = ref(false)
const fileList = ref([]) const height = mainHeight(20)
const tableStore = new TableStore({ const completenessDetailsRef = ref()
url: '/advance-boot/responsibility/userDataList', const dialogVisible = ref(false)
method: 'POST', const upload = ref<UploadInstance>()
publicHeight: 52, const fileList = ref([])
column: [ const tableStore = new TableStore({
{ title: '表名', field: 'name' }, url: '/advance-boot/responsibility/userDataList',
{ title: '起始时间', field: 'startTime' }, method: 'POST',
{ title: '截止时间', field: 'endTime' }, publicHeight: 52,
{ title: '更新时间', field: 'updateTime' }, column: [
{ title: '表名', field: 'name' },
{ title: '起始时间', field: 'startTime' },
{ { title: '截止时间', field: 'endTime' },
title: '操作', { title: '更新时间', field: 'updateTime' },
width: '180',
render: 'buttons', {
buttons: [ title: '操作',
width: '180',
{ render: 'buttons',
name: 'edit', buttons: [
title: '完整性详情', {
type: 'primary', name: 'edit',
icon: 'el-icon-Plus', title: '完整性详情',
render: 'basicButton', type: 'primary',
click: row => { icon: 'el-icon-Plus',
completenessDetailsRef.value.open(row.id) render: 'basicButton',
} click: row => {
}, completenessDetailsRef.value.open(row.id)
{ }
title: '删除', },
type: 'danger', {
icon: 'el-icon-Delete', title: '删除',
render: 'confirmButton', type: 'danger',
icon: 'el-icon-Delete',
popconfirm: { render: 'confirmButton',
confirmButtonText: '确认',
cancelButtonText: '取消', popconfirm: {
confirmButtonType: 'danger', confirmButtonText: '确认',
title: '确定删除吗?' cancelButtonText: '取消',
}, confirmButtonType: 'danger',
click: row => { title: '确定删除吗?'
// deleteByIds([row.id]).then(() => { },
// ElMessage.success('删除成功') click: row => {
// tableStore.index() deleteUserDataByIds([row.id]).then(() => {
// }) ElMessage.success('删除成功')
} tableStore.index()
} })
] }
} }
], ]
loadCallback: () => { } }
}) ],
const handleClose = () => { loadCallback: () => {}
fileList.value = [] })
dialogVisible.value = false const handleClose = () => {
} fileList.value = []
// 上传 dialogVisible.value = false
const choose = (e: any) => { }
upload.value!.clearFiles() // 上传
setTimeout(() => { const choose = (e: any) => {
if (e.name.includes('.xls')) { upload.value!.clearFiles()
fileList.value = [e] setTimeout(() => {
} else { if (e.name.includes('.xls')) {
ElMessage.warning('请上传Excel文件') fileList.value = [e]
} } else {
}, 0) ElMessage.warning('请上传Excel文件')
}
} }, 0)
}
// 上传
const submitupload = () => { // 上传
if (fileList.value.length == 0) { const submitupload = () => {
ElMessage.warning('请上传文件!') if (fileList.value.length == 0) {
return ElMessage.warning('请上传文件!')
} return
const formData = new FormData() }
formData.append('file', fileList.value[0].raw) ElMessage.info('上传中,请稍等...')
uploadUserData(formData).then(res => { const formData = new FormData()
ElMessage.success('上传成功') formData.append('file', fileList.value[0].raw)
handleClose() loading.value = true
tableStore.index() uploadUserData(formData)
.then(res => {
}) ElMessage.success('上传成功')
loading.value = false
handleClose()
} tableStore.index()
provide('tableStore', tableStore) })
tableStore.table.params.searchValue = '' .catch(err => {
onMounted(() => { loading.value = false
tableStore.index() })
}) }
</script> provide('tableStore', tableStore)
<style lang="scss" scoped> tableStore.table.params.searchValue = ''
.title { onMounted(() => {
display: flex; tableStore.index()
justify-content: space-between; })
padding: 10px; </script>
font-size: 16px; <style lang="scss" scoped>
font-weight: 550; .title {
} display: flex;
justify-content: space-between;
:deep(.upload-demo) { padding: 10px;
display: flex; font-size: 16px;
font-weight: 550;
.el-upload-list__item-info { }
width: 300px;
} :deep(.upload-demo) {
} display: flex;
</style>
.el-upload-list__item-info {
width: 300px;
}
}
</style>

View File

@@ -1,65 +1,65 @@
<template> <template>
<el-dialog v-model="dialogVisible" title="完整性不足详情" width="1000"> <el-dialog v-model="dialogVisible" draggable title="完整性不足详情" width="1000">
<TableHeader :showReset="false" ref="TableHeaderRef"> <TableHeader :showReset="false" ref="TableHeaderRef">
<template #select> <template #select>
<el-form-item label="关键字"> <el-form-item label="关键字">
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" /> <el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" />
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>
<!-- <el-button type="primary" icon="el-icon-Plus">新增</el-button> --> <!-- <el-button type="primary" icon="el-icon-Plus">新增</el-button> -->
<!-- <back-component /> --> <!-- <back-component /> -->
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef"></Table> <Table ref="tableRef"></Table>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { ref, reactive } from 'vue' import { ref, reactive } from 'vue'
const num = ref(0) const num = ref(0)
const dialogVisible = ref(false) const dialogVisible = ref(false)
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/advance-boot/responsibility/userDataIntegrityList', url: '/advance-boot/responsibility/userDataIntegrityList',
method: 'POST', method: 'POST',
publicHeight: 547, publicHeight: 547,
column: [ column: [
{ title: '数据名', field: 'name' }, { title: '数据名', field: 'name' },
{ title: '用户名', field: 'userName' }, { title: '用户名', field: 'userName' },
{ title: '测量点局号', field: 'lineNo' }, { title: '测量点局号', field: 'lineNo' },
{ title: '日期', field: 'upDataTime' }, { title: '日期', field: 'upDataTime' },
{ title: '完整性', field: 'integrity' }, { title: '完整性', field: 'integrity' },
], ],
loadCallback: () => { loadCallback: () => {
setTimeout(() => { setTimeout(() => {
tableStore.table.height = mainHeight(0,2).height as any tableStore.table.height = mainHeight(0,2).height as any
// console.log("🚀 ~ setTimeout ~ tableStore.table.height:", tableStore.table.height) // console.log("🚀 ~ setTimeout ~ tableStore.table.height:", tableStore.table.height)
}, 0) }, 0)
// setTimeout(() => { tableStore.table.height = 'calc((100vh) / 2)'}, 1000) // setTimeout(() => { tableStore.table.height = 'calc((100vh) / 2)'}, 1000)
} }
}) })
provide('tableStore', tableStore) provide('tableStore', tableStore)
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''
const open = (id: string) => { const open = (id: string) => {
tableStore.table.params.userDataId = id tableStore.table.params.userDataId = id
dialogVisible.value = true dialogVisible.value = true
tableStore.index() tableStore.index()
} }
defineExpose({ open }) defineExpose({ open })
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@@ -1,198 +1,232 @@
<!-- 贡献度计算 --> <!-- 贡献度计算 -->
<template> <template>
<div class="default-main" :style="height"> <div class="default-main" :style="height">
<div class="title"> <div class="title">
贡献度计算 贡献度计算
<div style="font-size: 14px;font-weight: 500;"> <div style="font-size: 14px; font-weight: 500">
{{ dotList.alias || '' }} {{ dotList.alias || '' }}
<back-component /> <back-component />
</div> </div>
</div> </div>
<splitpanes :style='heightB' class='default-theme' id='navigation-splitpanes'> <splitpanes :style="heightB" class="default-theme" id="navigation-splitpanes">
<pane :size='size'> <pane :size="size">
<PointTree :showSelect="false" :default-expand-all='false' @node-click='handleNodeClick' <PointTree
@init='handleNodeClick'> :showSelect="false"
</PointTree> :default-expand-all="false"
</pane> @node-click="handleNodeClick"
<pane style='background: #fff' :style='heightB' :size="100 - size"> @init="handleNodeClick"
<el-form :model="form" inline label-width="auto"> ></PointTree>
<el-form-item label="谐波类型:"> </pane>
<el-radio-group v-model="form.type"> <pane style="background: #fff" :style="heightB" :size="100 - size">
<el-radio-button label="谐波电压" value="1" /> <el-form :model="form" inline label-width="auto">
<el-radio-button label="谐波电流" value="0" /> <el-form-item label="谐波类型:">
</el-radio-group> <el-radio-group v-model="form.type">
</el-form-item> <el-radio-button label="谐波电压" value="1" />
<el-form-item label="谐波次数:"> <el-radio-button label="谐波电流" value="0" />
<el-select v-model="form.index" filterable multiple :multiple-limit="5" collapse-tags </el-radio-group>
collapse-tags-tooltip clearable placeholder="请选择次数"> </el-form-item>
<el-option v-for="item in harmonic" :key="item.value" :label="item.label" <el-form-item label="谐波次数:">
:value="item.value"> </el-option> <el-select
</el-select> v-model="form.index"
</el-form-item> filterable
<el-form-item label="负荷数据:"> multiple
<el-select v-model="form.loadData" clearable filterable placeholder="请选择负荷数据"> :multiple-limit="5"
<el-option v-for="item in loadDataOptions" :key="item.id" :label="item.name" collapse-tags
:value="item.id"></el-option> collapse-tags-tooltip
</el-select> clearable
</el-form-item> placeholder="请选择次数"
<el-form-item> >
<el-button type="primary" icon="el-icon-Plus" <el-option
@click="push('/admin/division/aListOfLoadData')">新增</el-button> v-for="item in harmonic"
<el-button type="primary" icon="el-icon-Select" @click="submit">确定</el-button> :key="item.value"
</el-form-item> :label="item.label"
</el-form> :value="item.value"
<el-tabs v-model="activeName" type="card" class="demo-tabs" v-if="showTabs"> ></el-option>
<el-tab-pane v-for="(item, index) in tabList" :key="item" :label="item.label" :name="index"> </el-select>
<div class="pd10"> </el-form-item>
<div> <el-form-item label="负荷数据:">
<span style="color: var(--el-text-color-regular);">时间范围:</span> <el-select v-model="form.loadData" clearable filterable placeholder="请选择负荷数据">
<el-date-picker v-model="item.time" class="mr10 ml10" type="daterange" <el-option
start-placeholder="起始时间" end-placeholder="结束时间" format="YYYY-MM-DD" v-for="item in loadDataOptions"
date-format="YYYY-MM-DD" time-format="YYYY-MM-DD" /> :key="item.id"
<el-button type="primary" icon="el-icon-CaretRight" @click="execute(item,index)">执行</el-button> :label="item.name"
</div> :value="item.id"
<div v-if="item.showExecute"> ></el-option>
<el-form :inline="true" v-model="item.form" class="mt10"> </el-select>
<el-form-item label="限值:"> </el-form-item>
<el-input v-model="item.form.limit" placeholder="请输入限值" /> <el-form-item>
</el-form-item> <el-button type="primary" icon="el-icon-Plus" @click="push('/admin/division/aListOfLoadData')">
<el-form-item label="时间点一:"> <el-input v-model="item.form.time1" 新增
placeholder="请输入时间点一" /></el-form-item> </el-button>
<el-form-item label="时间点二:"> <el-input v-model="item.form.time2" <el-button type="primary" icon="el-icon-Select" @click="submit">确定</el-button>
placeholder="请输入时间点二" /></el-form-item> </el-form-item>
<el-form-item> </el-form>
<el-button type="primary" icon="el-icon-Document"> <el-tabs v-model="activeName" type="card" class="demo-tabs" v-if="showTabs">
生成动态谐波责任数据 <el-tab-pane v-for="(item, index) in tabList" :key="item" :label="item.label" :name="index">
</el-button> <div class="pd10">
<el-button type="primary" icon="el-icon-Document"> <div>
生成谐波责任指标 <span style="color: var(--el-text-color-regular)">时间范围:</span>
</el-button> <el-date-picker
</el-form-item> v-model="item.time"
</el-form> class="mr10 ml10"
</div> type="daterange"
start-placeholder="起始时间"
</div> end-placeholder="结束时间"
format="YYYY-MM-DD"
date-format="YYYY-MM-DD"
</el-tab-pane> time-format="YYYY-MM-DD"
:disabled-date="handleDisabledDate"
</el-tabs> />
</pane> <el-button type="primary" icon="el-icon-CaretRight" @click="execute(item, index)">
</splitpanes> 执行
</el-button>
</div>
<div v-if="item.showExecute">
</div> <el-form :inline="true" v-model="item.form" class="mt10">
<el-form-item label="限值:">
</template> <el-input v-model="item.form.limit" placeholder="请输入限值" />
<script setup lang='ts'> </el-form-item>
import { ref, reactive, onMounted, onUnmounted } from 'vue' <el-form-item label="时间点一:">
import { mainHeight } from '@/utils/layout' <el-input v-model="item.form.time1" placeholder="请输入时间点一" />
import 'splitpanes/dist/splitpanes.css' </el-form-item>
import { Splitpanes, Pane } from 'splitpanes' <el-form-item label="时间点二:">
import PointTree from '@/components/tree/pqs/pointTree.vue' <el-input v-model="item.form.time2" placeholder="请输入时间点二" />
import BackComponent from '@/components/icon/back/index.vue' </el-form-item>
import { harmonicOptions, } from '@/utils/dictionary' <el-form-item>
import { userDataList } from '@/api/advance-boot/division' <el-button type="primary" icon="el-icon-Document">
import { useRouter } from 'vue-router' 生成动态谐波责任数据
import { ElMessage } from 'element-plus' </el-button>
import { formatDate } from '@/utils/formatTime' <el-button type="primary" icon="el-icon-Document">生成谐波责任指标</el-button>
import {getHistoryHarmData} from '@/api/advance-boot/division'; </el-form-item>
</el-form>
const { push } = useRouter() </div>
const dotList: any = ref({}) </div>
const height = mainHeight(20) </el-tab-pane>
const heightB = mainHeight(70) </el-tabs>
const harmonic = harmonicOptions.slice(1) </pane>
const size = ref(0) </splitpanes>
const showTabs = ref(false) </div>
const loadDataOptions: any = ref([]) </template>
const form: any = reactive({ <script setup lang="ts">
type: '0', import { ref, reactive, onMounted, onUnmounted } from 'vue'
index: [], import { mainHeight } from '@/utils/layout'
loadData: '' import 'splitpanes/dist/splitpanes.css'
}) import { Splitpanes, Pane } from 'splitpanes'
const tabList: any = ref([]) import PointTree from '@/components/tree/pqs/pointTree.vue'
const activeName = ref(0) import BackComponent from '@/components/icon/back/index.vue'
const handleNodeClick = (data: any, node: any) => { import { harmonicOptions } from '@/utils/dictionary'
if (data.level == 6) { import { userDataList } from '@/api/advance-boot/division'
dotList.value = data import { useRouter } from 'vue-router'
} import { ElMessage } from 'element-plus'
} import { formatDate } from '@/utils/formatTime'
// 确定 import { getHistoryHarmData } from '@/api/advance-boot/division'
const submit = () => { defineOptions({
if (form.loadData == '') { name: 'division/compute'
return ElMessage.warning('请选择负荷数据') })
} const { push } = useRouter()
const dotList: any = ref({})
if (form.index.length == 0) { const height = mainHeight(20)
showTabs.value = false const heightB = mainHeight(70)
} else { const harmonic = harmonicOptions.slice(1)
let timeList = loadDataOptions.value.filter((item: any) => item.id == form.loadData)[0] const size = ref(0)
showTabs.value = true const showTabs = ref(false)
let list = JSON.parse(JSON.stringify(form.index)).sort((a, b) => a - b) const loadDataOptions: any = ref([])
tabList.value = [] const form: any = reactive({
list.forEach((item: any) => { type: '0',
tabList.value.push({ index: [],
label: item + '次谐波', loadData: ''
key: item, })
time: [timeList.startTime, timeList.endTime], const tabList: any = ref([])
showExecute: false, const activeName = ref(0)
form: { const handleNodeClick = (data: any, node: any) => {
limit: '', if (data.level == 6) {
time1: '', dotList.value = data
time2: '' }
} }
}) // 设置时间
}) // 处理日期禁用逻辑
// tabList.value = const handleDisabledDate = date => {
activeName.value = 0 // 定义时间边界
} const startLimit = new Date(tabList.value[0].time[0]).getTime()
const endLimit = new Date(tabList.value[0].time[1]).setHours(23, 59, 59, 999)
}
// 执行 // 如果日期不存在(选择今天时可能出现),不禁用
const execute = (item: any, index: number) => { if (!date) return false
getHistoryHarmData({
searchBeginTime:item.time[0], // 禁用 2025-08-01 之前和 2025-08-31 之后的日期
searchEndTime:item.time[1], return date.getTime() < startLimit || date.getTime() > endLimit
type:form.type, }
time:item.key, // 确定
// userDataId:form.loadData, const submit = () => {
lineId:dotList.value.id if (form.loadData == '') {
}).then((res: any) => { return ElMessage.warning('请选择负荷数据')
}
})
tabList.value[index].showExecute = true if (form.index.length == 0) {
} showTabs.value = false
} else {
onMounted(() => { let timeList = loadDataOptions.value.filter((item: any) => item.id == form.loadData)[0]
const dom = document.getElementById('navigation-splitpanes') showTabs.value = true
if (dom) { let list = JSON.parse(JSON.stringify(form.index)).sort((a, b) => a - b)
size.value = Math.round((180 / dom.offsetHeight) * 100) tabList.value = []
} list.forEach((item: any) => {
userDataList({ tabList.value.push({
pageNum: 1, label: item + '次谐波',
pageSize: 10000, key: item,
searchValue: "" time: [timeList.startTime, timeList.endTime],
}).then((res: any) => { showExecute: false,
loadDataOptions.value = res.data.records form: {
}) limit: '',
}) time1: '',
</script> time2: ''
<style lang="scss" scoped> }
.title { })
display: flex; })
justify-content: space-between; // tabList.value =
padding: 10px; activeName.value = 0
font-size: 16px; }
font-weight: 550; }
} // 执行
const execute = (item: any, index: number) => {
:deep(.upload-demo) { getHistoryHarmData({
display: flex; searchBeginTime: item.time[0],
searchEndTime: item.time[1],
.el-upload-list__item-info { type: form.type,
width: 300px; time: item.key,
} // userDataId:form.loadData,
} lineId: dotList.value.id
</style> }).then((res: any) => {})
tabList.value[index].showExecute = true
}
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
size.value = Math.round((180 / dom.offsetHeight) * 100)
}
userDataList({
pageNum: 1,
pageSize: 10000,
searchValue: ''
}).then((res: any) => {
loadDataOptions.value = res.data.records
})
})
</script>
<style lang="scss" scoped>
.title {
display: flex;
justify-content: space-between;
padding: 10px;
font-size: 16px;
font-weight: 550;
}
:deep(.upload-demo) {
display: flex;
.el-upload-list__item-info {
width: 300px;
}
}
</style>

View File

@@ -1,115 +1,115 @@
<template> <template>
<div class="default-main"> <div class="default-main">
<!-- 模版 --> <!-- 模版 -->
<TableHeader datePicker showExport :showReset="false" ref="TableHeaderRef"> <TableHeader datePicker showExport :showReset="false" ref="TableHeaderRef">
<template #select> <template #select>
<el-form-item label="关键字"> <el-form-item label="关键字">
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" /> <el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" />
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>
<el-button type="primary" icon="el-icon-CreditCard" <el-button type="primary" icon="el-icon-CreditCard"
@click="push('/admin/division/compute')">谐波贡献度计算</el-button> @click="push('/admin/division/compute')">谐波贡献度计算</el-button>
<el-button type="primary" icon="el-icon-Tickets" <el-button type="primary" icon="el-icon-Tickets"
@click="push('/admin/division/aListOfLoadData')">负荷数据列表</el-button> @click="push('/admin/division/aListOfLoadData')">用采数据列表</el-button>
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef"></Table> <Table ref="tableRef"></Table>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref, provide } from 'vue' import { onMounted, ref, provide } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
import { deleteByIds } from '@/api/advance-boot/division' import { deleteByIds } from '@/api/advance-boot/division'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const { push } = useRouter() const { push } = useRouter()
defineOptions({ defineOptions({
name: 'liabiiyty' name: 'harmonic-boot/detailedAnalysis/responsibility'
}) })
const TableHeaderRef = ref() const TableHeaderRef = ref()
const tableStore = new TableStore({ const tableStore = new TableStore({
url: '/advance-boot/responsibility/responsibilityList', url: '/advance-boot/responsibility/responsibilityList',
method: 'POST', method: 'POST',
column: [ column: [
{ title: '供电公司', field: 'gdName' }, { title: '供电公司', field: 'gdName' },
{ title: '变电站', field: 'subName' }, { title: '变电站', field: 'subName' },
{ title: '终端名称', field: 'devName' }, { title: '终端名称', field: 'devName' },
{ title: 'IP', field: 'ip' }, { title: 'IP', field: 'ip' },
{ title: '监测点名称', field: 'lineName' }, { title: '监测点名称', field: 'lineName' },
{ title: '类型', field: 'dataType' }, { title: '类型', field: 'dataType' },
{ title: '谐波次数', field: 'dataTimes' }, { title: '谐波次数', field: 'dataTimes' },
{ title: '用采数据', field: 'userDataName' }, { title: '用采数据', field: 'userDataName' },
{ title: '计算时间', field: 'updateTime' }, { title: '计算时间', field: 'updateTime' },
{ title: '计算窗口', field: 'timeWindow' }, { title: '计算窗口', field: 'timeWindow' },
{ {
title: '操作', title: '操作',
width: '180', width: '180',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
{ {
name: 'edit', name: 'edit',
title: '查看详情 ', title: '查看详情 ',
type: 'primary', type: 'primary',
icon: 'el-icon-Plus', icon: 'el-icon-Plus',
render: 'basicButton', render: 'basicButton',
click: row => { click: row => {
console.log("🚀 ~ row:", row) console.log("🚀 ~ row:", row)
// push('/admin/division/detail') // push('/admin/division/detail')
push({ push({
path: "/admin/division/detail", path: "/admin/division/detail",
query: { query: {
id: row.id, id: row.id,
time: row.dataTimes, time: row.dataTimes,
name: `${row.gdName}>${row.subName}>${row.devName}>${row.lineName}` name: `${row.gdName}>${row.subName}>${row.devName}>${row.lineName}`
} }
}) })
} }
}, },
{ {
title: '删除', title: '删除',
type: 'danger', type: 'danger',
icon: 'el-icon-Delete', icon: 'el-icon-Delete',
render: 'confirmButton', render: 'confirmButton',
popconfirm: { popconfirm: {
confirmButtonText: '确认', confirmButtonText: '确认',
cancelButtonText: '取消', cancelButtonText: '取消',
confirmButtonType: 'danger', confirmButtonType: 'danger',
title: '确定删除吗?' title: '确定删除吗?'
}, },
click: row => { click: row => {
deleteByIds([row.id]).then(() => { deleteByIds([row.id]).then(() => {
ElMessage.success('删除成功') ElMessage.success('删除成功')
tableStore.index() tableStore.index()
}) })
} }
} }
] ]
} }
], ],
loadCallback: () => { } loadCallback: () => { }
}) })
tableStore.table.params.searchValue = '' tableStore.table.params.searchValue = ''
// 弹框 // 弹框
provide('tableStore', tableStore) provide('tableStore', tableStore)
onMounted(() => { onMounted(() => {
tableStore.index() tableStore.index()
}) })
</script> </script>
<style lang="scss"></style> <style lang="scss"></style>

View File

@@ -3,8 +3,12 @@
<DatePicker ref="datePickerRef" theCurrentTime style="display: none" /> <DatePicker ref="datePickerRef" theCurrentTime style="display: none" />
<!-- 搜索框 --> <!-- 搜索框 -->
<div class="query-box-wrap"> <div class="query-box-wrap">
<el-input v-model.trim="inputQuery" style="height: 46px; width: 334px" @keyup.enter="DeviceQ" <el-input
placeholder="请输入终端名称"> v-model.trim="inputQuery"
style="height: 46px; width: 334px"
@keyup.enter="DeviceQ"
placeholder="请输入终端名称"
>
<template #prefix> <template #prefix>
<div class="Icon"></div> <div class="Icon"></div>
</template> </template>
@@ -26,9 +30,12 @@
<span class="ml10" style="color: #0d867f">{{ item.count }}</span> <span class="ml10" style="color: #0d867f">{{ item.count }}</span>
</template> </template>
<div class="collapseBox"> <div class="collapseBox">
<div class="group-list__item" <div
class="group-list__item"
:style="colorKey == k.coordinate ? 'background-color: #009ea81a;' : ''" :style="colorKey == k.coordinate ? 'background-color: #009ea81a;' : ''"
v-for="k in item.psrList" @click="flyTo(k)"> v-for="k in item.psrList"
@click="flyTo(k)"
>
<p>{{ k.psrName }}</p> <p>{{ k.psrName }}</p>
<p>{{ k.vlevelName }}|{{ k.maintOrgName }}</p> <p>{{ k.vlevelName }}|{{ k.maintOrgName }}</p>
</div> </div>
@@ -36,112 +43,167 @@
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<div v-if="QueryList.length > 0 && !showCollapse" class="collapse_none" style="color: #009ea8" <div
@click="showCollapse = true"> v-if="QueryList.length > 0 && !showCollapse"
class="collapse_none"
style="color: #009ea8"
@click="showCollapse = true"
>
展开搜索结果 展开搜索结果
</div> </div>
<div class="collapse_none" style="color: red;cursor: pointer" @click="showWrap = false">关闭</div> <div class="collapse_none" style="color: red; cursor: pointer" @click="showWrap = false">关闭</div>
</div> </div>
<baidu-map class="map" :style="height" @ready="initMap" @zoomend='syncCenterAndZoom' :center="center" <baidu-map
:zoom="zoomMap" :scroll-wheel-zoom='true' > class="map"
:style="height"
@ready="initMap"
@zoomend="syncCenterAndZoom"
:center="center"
:zoom="zoomMap"
:scroll-wheel-zoom="true"
>
<!-- 线--> <!-- 线-->
<div v-if='zoom > 13'> <div v-if="zoom > 13">
<bm-polyline :path='path' v-for='(path, index) in polyline' :key='index'></bm-polyline> <bm-polyline :path="path" v-for="(path, index) in polyline" :key="index"></bm-polyline>
</div> </div>
<!-- 变电站--> <!-- 变电站-->
<template v-if='zoom > 13'> <template v-if="zoom > 13">
<bm-marker :position='path' v-for='path in siteList' :key='path.subId' :icon='path.icon' <bm-marker
@click='markerClick(path)'></bm-marker> :position="path"
v-for="path in siteList"
:key="path.subId"
:icon="path.icon"
@click="markerClick(path)"
></bm-marker>
</template> </template>
<!-- --> <!-- -->
<div :maxZoom='12' v-if='zoom > 9'> <div :maxZoom="12" v-if="zoom > 9">
<bm-marker :position='path' v-for='path in areaLineInfo' :key='path.lineId' :icon='path.icon' <bm-marker
@click='markerClick(path)' :zIndex="1"> :position="path"
v-for="path in areaLineInfo"
<bm-label v-if='zoom > 14' :content="path.lineName" :key="path.lineId"
:labelStyle="{ color: '#fff', border: '0px solid #fff', backgroundColor: 'rgba(0, 0, 0, 0.5)', borderRadius: '10px', padding: '2px 5px', fontSize: '12px', lineHeight: '15px', transform: 'translateX(-30%)' }" :icon="path.icon"
:offset="{ height: 33 }" /> @click="markerClick(path)"
:zIndex="1"
>
<bm-label
v-if="zoom > 14"
:content="path.lineName"
:labelStyle="{
color: '#fff',
border: '0px solid #fff',
backgroundColor: 'rgba(0, 0, 0, 0.5)',
borderRadius: '10px',
padding: '2px 5px',
fontSize: '12px',
lineHeight: '15px',
transform: 'translateX(-30%)'
}"
:offset="{ height: 33 }"
/>
</bm-marker> </bm-marker>
</div> </div>
<!-- 详情 --> <!-- 详情 -->
<bm-marker :position='infoWindowPoint' :icon="{ url: '1', size: { width: 0, height: 0 } }"> <bm-marker :position="infoWindowPoint" :icon="{ url: '1', size: { width: 0, height: 0 } }">
<bm-info-window :show='infoWindowPoint.show' @close='infoWindowPoint.show = false'> <bm-info-window :show="infoWindowPoint.show" @close="infoWindowPoint.show = false">
<el-descriptions :title='infoWindowPoint.lineName' :column='1' v-if='infoWindowPoint.lineId'> <el-descriptions :title="infoWindowPoint.lineName" :column="1" v-if="infoWindowPoint.lineId">
<el-descriptions-item label='供电公司'>{{ infoWindowPoint.gdName }}</el-descriptions-item> <el-descriptions-item label="供电公司">{{ infoWindowPoint.gdName }}</el-descriptions-item>
<el-descriptions-item label='变电站'>{{ infoWindowPoint.subName }}</el-descriptions-item> <el-descriptions-item label="变电站(场站)">{{ infoWindowPoint.subName }}</el-descriptions-item>
<el-descriptions-item label='母线'>{{ infoWindowPoint.voltageName }}</el-descriptions-item> <el-descriptions-item label="母线">{{ infoWindowPoint.voltageName }}</el-descriptions-item>
<el-descriptions-item label='网络参数'> <el-descriptions-item label="网络参数">
{{ infoWindowPoint.ip }} {{ infoWindowPoint.ip }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label='PT变化'>{{ infoWindowPoint.pt2 }}</el-descriptions-item> <el-descriptions-item label="PT变化">{{ infoWindowPoint.pt2 }}</el-descriptions-item>
<el-descriptions-item label='CT变化'>{{ infoWindowPoint.ct2 }}</el-descriptions-item> <el-descriptions-item label="CT变化">{{ infoWindowPoint.ct2 }}</el-descriptions-item>
<el-descriptions-item label='生产厂家'> <el-descriptions-item label="生产厂家">
{{ infoWindowPoint.manufacturer }} {{ infoWindowPoint.manufacturer }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label='终端状态'> <el-descriptions-item label="终端状态">
{{ {{ infoWindowPoint.runFlag == 0 ? '投运' : infoWindowPoint.runFlag == 1 ? '检修' : '停运' }}
infoWindowPoint.runFlag == 0 ? '投运' : infoWindowPoint.runFlag == 1 ? '热备用' : '停运'
}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label='通讯状态'> <el-descriptions-item label="通讯状态">
{{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }} {{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<el-button type='primary' size='small' @click='lookPoint(infoWindowPoint)'>查看详情</el-button> <el-button type="primary" size="small" @click="lookPoint(infoWindowPoint)">
查看详情
</el-button>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions :title='infoWindowPoint.subName' :column='1' v-else-if='infoWindowPoint.subId' <el-descriptions
style='padding-top: 10px'></el-descriptions> :title="infoWindowPoint.subName"
:column="1"
v-else-if="infoWindowPoint.subId"
style="padding-top: 10px"
></el-descriptions>
</bm-info-window> </bm-info-window>
</bm-marker> </bm-marker>
<!-- 行政区划 --> <!-- 行政区划 -->
<div v-if='zoom <= 11'> <div v-if="zoom <= 11">
<div v-for="item in AreaData"> <div v-for="item in AreaData">
<bm-polygon v-for="timeK in item.boundary" :path="timeK" :strokeWeight="2" strokeColor="#fff" <bm-polygon
:strokeOpacity="1" :fillColor="item.background || ''" :fillOpacity="0.5"></bm-polygon> v-for="timeK in item.boundary"
:path="timeK"
:strokeWeight="2"
strokeColor="#0e8780"
:strokeOpacity="1"
:fillColor="item.background || ''"
:fillOpacity="0.5"
></bm-polygon>
</div> </div>
</div> </div>
<!-- 信息弹框 --> <!-- 信息弹框 -->
<div v-if='zoom <= 9'> <div v-if="zoom <= 9">
<bm-overlay v-for="item in AreaData" pane="labelPane" :class="{ sample: true, }" <bm-overlay
@draw="draw($event, item.LngLat)"> v-for="item in AreaData"
pane="labelPane"
:class="{ sample: true }"
@draw="draw($event, item.LngLat)"
>
<div class="my-radiusPop" :style="{ background: item.background }"> <div class="my-radiusPop" :style="{ background: item.background }">
<img :src="PopKey == 2 ? imgUrl2 : PopKey == 1 ? imgUrl1 : PopKey == 0 ? imgUrl0 : ''" /> <img :src="PopKey == 2 ? imgUrl2 : PopKey == 1 ? imgUrl1 : PopKey == 0 ? imgUrl0 : ''" />
<div class="infoBox"> <div class="infoBox">
<div> <div>
总数<br />{{ PopKey == 2 ? item.lineNum : PopKey == 1 ? item.deviceNum : PopKey == 0 ? 总数
item.subNum : <br />
'/' }} {{
PopKey == 2
? item.lineNum
: PopKey == 1
? item.deviceNum
: PopKey == 0
? item.subNum
: '/'
}}
</div> </div>
<div> <div>
{{ PopKey == 2 ? '在线' : PopKey == 1 ? '在运' : '告警' }}<br />{{ PopKey == 2 ? {{ PopKey == 2 ? '在线' : PopKey == 1 ? '在运' : '告警' }}
item.onlineNum : <br />
PopKey {{
== 1 PopKey == 2
? ? item.onlineNum
item.alarmSubNum : PopKey == 0 ? : PopKey == 1
item.onDevice : '/' }} ? item.alarmSubNum
: PopKey == 0
? item.onDevice
: '/'
}}
</div> </div>
<div v-if="PopKey == 2"> <div v-if="PopKey == 2">
告警<br />{{ PopKey == 2 ? item.alarm : PopKey == 1 ? item.xx : PopKey == 0 ? item.xx : 告警
'/' }} <br />
{{ PopKey == 2 ? item.alarm : PopKey == 1 ? item.xx : PopKey == 0 ? item.xx : '/' }}
</div> </div>
</div> </div>
</div> </div>
</bm-overlay> </bm-overlay>
</div> </div>
</baidu-map> </baidu-map>
</div> </div>
</template> </template>
<script setup lang='ts'> <script setup lang="ts">
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { getAreaLineInfo } from '@/api/event-boot/areaInfo' import { getAreaLineInfo } from '@/api/event-boot/areaInfo'
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
@@ -152,7 +214,7 @@ import { BaiduMap, BmOverlay } from 'vue-baidu-map-3x'
import { getAssessOverview } from '@/api/device-boot/panorama' import { getAssessOverview } from '@/api/device-boot/panorama'
import { getGridDiagramAreaData } from '@/api/device-boot/panorama' import { getGridDiagramAreaData } from '@/api/device-boot/panorama'
const emit = defineEmits(['changeValue', 'drop', 'show']) const emit = defineEmits(['changeValue', 'drop', 'show'])
import mapJson from './boundary'; import mapJson from './boundary'
const datePickerRef = ref() const datePickerRef = ref()
const height = mainHeight(20) const height = mainHeight(20)
// 页面中直接引入就可以 // 页面中直接引入就可以
@@ -161,7 +223,7 @@ const inputQuery: any = ref('')
const QueryList: any = ref([]) const QueryList: any = ref([])
const activeName: any = ref(0) const activeName: any = ref(0)
const zoomMap = ref(8.8) const zoomMap = ref(8.9)
const colorKey = ref('') const colorKey = ref('')
const showCollapse: any = ref(true) const showCollapse: any = ref(true)
const showWrap: any = ref(false) const showWrap: any = ref(false)
@@ -173,30 +235,100 @@ const imgUrl0 = new URL('@/assets/img/BDZ-ZS.png', import.meta.url).href
const imgUrl1 = new URL('@/assets/img/ZD-ZS.png', import.meta.url).href const imgUrl1 = new URL('@/assets/img/ZD-ZS.png', import.meta.url).href
const imgUrl2 = new URL('@/assets/img/JCD-ZS.png', import.meta.url).href const imgUrl2 = new URL('@/assets/img/JCD-ZS.png', import.meta.url).href
const boundaryList: any = ref([ const boundaryList: any = ref([
// {
// orgName: '唐山',
// LngLat: [118.335849137, 39.7513593355],
// boundary: mapJson.tsJSON
// },
// {
// orgName: '张家口',
// LngLat: [115.032504679, 40.8951549951],
// boundary: mapJson.zjkJSON
// },
// {
// orgName: '秦皇岛',
// LngLat: [119.185113833, 40.1179119754],
// boundary: mapJson.qhdJSON
// },
// {
// orgName: '承德',
// LngLat: [117.548498365, 41.3775890632],
// boundary: mapJson.cdJSON
// },
// {
// orgName: '廊坊',
// LngLat: [116.628004129, 39.0589378611],
// boundary: mapJson.lfJSON
// }
{ {
orgName: '唐山', orgName: '大连',
LngLat: [118.335849137, 39.7513593355], LngLat: [122.060077, 39.635794],
boundary: mapJson.tsJSON boundary: mapJson['大连']
}, },
{ {
orgName: '张家口', orgName: '抚顺',
LngLat: [115.032504679, 40.8951549951], LngLat: [124.354599, 41.88962],
boundary: mapJson.zjkJSON boundary: mapJson['抚顺']
}, },
{ {
orgName: '秦皇岛', orgName: '沈阳',
LngLat: [119.185113833, 40.1179119754], LngLat: [123.0389, 41.992993],
boundary: mapJson.qhdJSON boundary: mapJson['沈阳']
}, },
{ {
orgName: '承德', orgName: '丹东',
LngLat: [117.548498365, 41.3775890632], LngLat: [124.585661, 40.645967],
boundary: mapJson.cdJSON boundary: mapJson['丹东']
}, },
{ {
orgName: '廊坊', orgName: '营口',
LngLat: [116.628004129, 39.0589378611], LngLat: [122.225226, 40.433551],
boundary: mapJson.lfJSON boundary: mapJson['营口']
},
{
orgName: '盘锦',
LngLat: [121.875362, 41.075416],
boundary: mapJson['盘锦']
},
{
orgName: '铁岭',
LngLat: [124.229492, 42.731873],
boundary: mapJson['铁岭']
},
{
orgName: '朝阳',
LngLat: [119.640944, 41.39657],
boundary: mapJson['朝阳']
},
{
orgName: '葫芦岛',
LngLat: [119.850873, 40.728517],
boundary: mapJson['葫芦岛']
},
{
orgName: '锦州',
LngLat: [121.42, 41.58],
boundary: mapJson['锦州']
},
{
orgName: '阜新',
LngLat: [121.658585, 42.350951],
boundary: mapJson['阜新']
},
{
orgName: '本溪',
LngLat: [124.390785, 41.197021],
boundary: mapJson['本溪']
},
{
orgName: '辽阳',
LngLat: [123.090785, 41.297021],
boundary: mapJson['辽阳']
},
{
orgName: '鞍山',
LngLat: [122.808845, 40.840049],
boundary: mapJson['鞍山']
} }
]) ])
@@ -206,7 +338,8 @@ const siteList = ref<any>([])
const polyline = ref<any>([]) const polyline = ref<any>([])
const lineId = ref('') const lineId = ref('')
const center = ref({ const center = ref({
lng: 116.84428600000001, lat: 40.57707185292256 lng: 122.42588,
lat: 40.810977
}) })
const infoWindowPoint = ref<anyObj>({ const infoWindowPoint = ref<anyObj>({
lng: 0, lng: 0,
@@ -214,11 +347,9 @@ const infoWindowPoint = ref<anyObj>({
show: false show: false
}) })
// 地图实例 // 地图实例
const initMap = async ({ BMap, map }: any) => { const initMap = async ({ BMap, map }: any) => {}
}
// 加载点 // 加载点
const addMarkers = async (row?: any, key?: any, num?: any) => { const addMarkers = async (row?: any, key?: any, num?: any) => {
let params = { let params = {
deptIndex: deptIndex.value, deptIndex: deptIndex.value,
monitorFlag: 2, monitorFlag: 2,
@@ -309,15 +440,12 @@ const addMarkers = async (row?: any, key?: any, num?: any) => {
siteList.value = list siteList.value = list
// center.value.lng = areaLineInfo.value[0].lng // center.value.lng = areaLineInfo.value[0].lng
// center.value.lat = areaLineInfo.value[0].lat // center.value.lat = areaLineInfo.value[0].lat
} }
// 获取zoom // 获取zoom
const syncCenterAndZoom = (e: any) => { const syncCenterAndZoom = (e: any) => {
zoom.value = e.target.getZoom() zoom.value = e.target.getZoom()
} }
const locatePositions = (e: any) => { const locatePositions = (e: any) => {
deptIndex.value = e.data.id deptIndex.value = e.data.id
// 加载点 // 加载点
addMarkers() addMarkers()
@@ -338,20 +466,18 @@ const markerClick = (e: any) => {
const lookPoint = (e: any) => { const lookPoint = (e: any) => {
emit('drop', e.lineId) emit('drop', e.lineId)
emit('show', true) emit('show', true)
} }
// 搜索 // 搜索
const DeviceQ = () => { const DeviceQ = () => {
showCollapse.value = true showCollapse.value = true
if (inputQuery.value.length == 0) return if (inputQuery.value.length == 0) return
let list = [] let list = []
let regex = new RegExp(inputQuery.value, 'i') let regex = new RegExp(inputQuery.value, 'i')
let data = areaLineInfo.value.filter((item: any) => regex.test(item.lineName)) let data = areaLineInfo.value
.filter((item: any) => regex.test(item.lineName))
.map((item: any) => { .map((item: any) => {
return { return {
psrName: item.lineName, psrName: item.lineName,
vlevelName: item.voltageScale, vlevelName: item.voltageScale,
maintOrgName: item.gdName, maintOrgName: item.gdName,
@@ -360,7 +486,6 @@ const DeviceQ = () => {
}) })
// data.replace(//s/g,',') // data.replace(//s/g,',')
if (data.length > 0) { if (data.length > 0) {
list.push({ list.push({
count: data.length, count: data.length,
@@ -374,21 +499,18 @@ const DeviceQ = () => {
// 定位 // 定位
const flyTo = (e: any, zoom?: number) => { const flyTo = (e: any, zoom?: number) => {
let regex = new RegExp(e.psrName, 'i') let regex = new RegExp(e.psrName, 'i')
center.value.lng = e.coordinate[0] center.value.lng = e.coordinate[0]
center.value.lat = e.coordinate[1] center.value.lat = e.coordinate[1]
if (zoom) { zoomMap.value = zoom } if (zoom) {
else { zoomMap.value = zoom
} else {
zoomMap.value = 15 zoomMap.value = 15
let data = areaLineInfo.value.filter((item: any) => regex.test(item.lineName))[0] let data = areaLineInfo.value.filter((item: any) => regex.test(item.lineName))[0]
if (data) { if (data) {
markerClick(data) markerClick(data)
} }
} }
} }
// 市级统计数据 // 市级统计数据
const grids = (row: any) => { const grids = (row: any) => {
@@ -402,8 +524,8 @@ const grids = (row: any) => {
isUpToGrid: row.isUpToGrid, isUpToGrid: row.isUpToGrid,
monitorFlag: row.isUpToGrid == 0 ? null : row.isUpToGrid monitorFlag: row.isUpToGrid == 0 ? null : row.isUpToGrid
} }
AreaData.value=[] AreaData.value = []
assessList.value=[] assessList.value = []
// 综合评估 // 综合评估
getAssessOverview(form).then(res => { getAssessOverview(form).then(res => {
assessList.value = res.data?.children assessList.value = res.data?.children
@@ -416,29 +538,28 @@ const grids = (row: any) => {
}) })
} }
const radiusPop = (k: any) => { const radiusPop = (k: any) => {
console.log("🚀 ~ radiusPop ~ k:", k) console.log('🚀 ~ radiusPop ~ k:', k)
if (k != undefined) PopKey.value = k if (k != undefined) PopKey.value = k
} }
const GridDiagramArea = () => { const GridDiagramArea = () => {
boundaryList.value.forEach((item: any) => { boundaryList.value.forEach((item: any) => {
assessList.value.forEach((y: any) => { assessList.value &&
if (item.orgName == y.name) { assessList.value.forEach((y: any) => {
if (item.orgName == y.name) {
if (y.score == 3.14159) { if (y.score == 3.14159) {
} else if (y.score > 4.5) { } else if (y.score > 4.5) {
item.background = '#33996699' item.background = '#33996699'
} else if (y.score > 4) { } else if (y.score > 4) {
item.background = '#3399ff99' item.background = '#3399ff99'
} else if (y.score > 3) { } else if (y.score > 3) {
item.background = '#ffcc3399' item.background = '#ffcc3399'
} else if (y.score > 2) { } else if (y.score > 2) {
item.background = '#db088799' item.background = '#db088799'
} else if (y.score > 0) { } else if (y.score > 0) {
item.background = '#ff000099' item.background = '#ff000099'
}
} }
} })
})
AreaData.value.forEach((k: any, i: any) => { AreaData.value.forEach((k: any, i: any) => {
if (item.orgName == k.orgName) { if (item.orgName == k.orgName) {
for (let kk in item) { for (let kk in item) {
@@ -453,7 +574,7 @@ const GridDiagramArea = () => {
}, 0) }, 0)
} }
// 市级统计 // 市级统计
const draw = ({ el, BMap, map }, val) => { const draw = ({ el, BMap, map }, val = [0, 0]) => {
const pixel = map.pointToOverlayPixel(new BMap.Point(val[0], val[1])) const pixel = map.pointToOverlayPixel(new BMap.Point(val[0], val[1]))
el.style.left = pixel.x - 60 + 'px' el.style.left = pixel.x - 60 + 'px'
el.style.top = pixel.y - 20 + 'px' el.style.top = pixel.y - 20 + 'px'
@@ -463,8 +584,7 @@ const reset = () => {
inputQuery.value = '' inputQuery.value = ''
showWrap.value = false showWrap.value = false
} }
onMounted(() => { onMounted(() => {})
})
defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo }) defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -472,7 +592,6 @@ defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo })
.map { .map {
width: 100%; width: 100%;
} }
.query-box-wrap { .query-box-wrap {
@@ -514,7 +633,8 @@ defineExpose({ addMarkers, locatePositions, reset, grids, radiusPop, flyTo })
} }
} }
} }
}
:deep(.el-descriptions__cell) {
white-space: nowrap;
} }
</style> </style>
./cds.js./boundary

View File

@@ -1,329 +1,329 @@
<template> <template>
<div style="position: relative; height: 100%" v-loading="loading"> <div style="position: relative; height: 100%" v-loading="loading">
<div class="iconBox"> <div class="iconBox">
<div class="div"> <div class="div">
<img src="@/assets/jcd.png" alt="" /> <img src="@/assets/jcd.png" alt="" />
<span>变电站(场站)</span> <span>变电站(场站)</span>
</div> </div>
<div class="div"> <div class="div">
<img src="@/assets/rby.png" alt="" /> <img src="@/assets/rby.png" alt="" />
<span>检修</span> <span>检修</span>
</div> </div>
<div class="div"> <div class="div">
<img src="@/assets/ty.png" alt="" /> <img src="@/assets/ty.png" alt="" />
<span>停运</span> <span>停运</span>
</div> </div>
<div class="div">投运</div> <div class="div">投运</div>
<div class="div" style="padding-left: 10px"> <div class="div" style="padding-left: 10px">
<span>通讯正常</span> <span>通讯正常</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txzcyzj.gif" alt="" /> <img src="@/assets/txzcyzj.gif" alt="" />
<span>有暂降</span> <span>有暂降</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txzcwzj.png" alt="" /> <img src="@/assets/txzcwzj.png" alt="" />
<span>无暂降</span> <span>无暂降</span>
</div> </div>
<div class="div" style="padding-left: 10px"> <div class="div" style="padding-left: 10px">
<span>通讯异常</span> <span>通讯异常</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txycyzj.gif" alt="" /> <img src="@/assets/txycyzj.gif" alt="" />
<span>有暂降</span> <span>有暂降</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txzdwzj.png" alt="" /> <img src="@/assets/txzdwzj.png" alt="" />
<span>无暂降</span> <span>无暂降</span>
</div> </div>
</div> </div>
<!-- v-if="hackReset" --> <!-- v-if="hackReset" -->
<baidu-map <baidu-map
class="bm-view" class="bm-view"
v-if="hackReset"
:zoom="zoom" :zoom="zoom"
:map-click="false" :map-click="false"
:scroll-wheel-zoom="true" :scroll-wheel-zoom="true"
:center="center" :center="center"
@ready="handler" @ready="handler"
@zoomend="syncCenterAndZoom" @zoomend="syncCenterAndZoom"
:dragging="true" :dragging="true"
> >
<!-- <bm-map-type <!-- <bm-map-type
:map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']" :map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
anchor="BMAP_ANCHOR_TOP_RIGHT" anchor="BMAP_ANCHOR_TOP_RIGHT"
></bm-map-type> --> ></bm-map-type> -->
<!-- 线--> <!-- 线-->
<div v-if="zoom > 13"> <div v-if="zoom > 13">
<bm-polyline :path="path" v-for="(path, index) in polyline" :key="index"></bm-polyline> <bm-polyline :path="path" v-for="(path, index) in polyline" :key="index"></bm-polyline>
</div> </div>
<!-- 变电站--> <!-- 变电站-->
<template v-if="zoom > 13"> <template v-if="zoom > 13">
<bm-marker <bm-marker
:position="path" :position="path"
v-for="path in siteList" v-for="path in siteList"
:key="path.subId" :key="path.subId"
:icon="path.icon" :icon="path.icon"
@click="markerClick(path)" @click="markerClick(path)"
></bm-marker> ></bm-marker>
</template> </template>
<!-- --> <!-- -->
<BmlMarkerClusterer maxZoom="12"> <BmlMarkerClusterer maxZoom="12">
<bm-marker <bm-marker
:position="path" :position="path"
v-for="path in areaLineInfo" v-for="path in areaLineInfo"
:key="path.lineId" :key="path.lineId"
:icon="path.icon" :icon="path.icon"
@click="markerClick(path)" @click="markerClick(path)"
></bm-marker> ></bm-marker>
</BmlMarkerClusterer> </BmlMarkerClusterer>
<bm-marker :position="infoWindowPoint" :icon="{ url: '1', size: { width: 0, height: 0 } }"> <bm-marker :position="infoWindowPoint" :icon="{ url: '1', size: { width: 0, height: 0 } }">
<bm-info-window :show="infoWindowPoint.show" @close="infoWindowPoint.show = false"> <bm-info-window :show="infoWindowPoint.show" @close="infoWindowPoint.show = false">
<el-descriptions <el-descriptions
:title="infoWindowPoint.lineName" :title="infoWindowPoint.lineName"
style="min-width: 240px" style="min-width: 240px"
:column="1" :column="1"
v-if="infoWindowPoint.lineId" v-if="infoWindowPoint.lineId"
> >
<el-descriptions-item label="供电公司">{{ infoWindowPoint.gdName }}</el-descriptions-item> <el-descriptions-item label="供电公司">{{ infoWindowPoint.gdName }}</el-descriptions-item>
<el-descriptions-item label="变电站(场站)">{{ infoWindowPoint.subName }}</el-descriptions-item> <el-descriptions-item label="变电站(场站)">{{ infoWindowPoint.subName }}</el-descriptions-item>
<el-descriptions-item label="母线">{{ infoWindowPoint.voltageName }}</el-descriptions-item> <el-descriptions-item label="母线">{{ infoWindowPoint.voltageName }}</el-descriptions-item>
<el-descriptions-item label="网络参数"> <el-descriptions-item label="网络参数">
{{ infoWindowPoint.ip }} {{ infoWindowPoint.ip }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="PT变比"> <el-descriptions-item label="PT变比">
{{ infoWindowPoint.pt1 }}/{{ infoWindowPoint.pt2 }} {{ infoWindowPoint.pt1 }}/{{ infoWindowPoint.pt2 }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="CT变比"> <el-descriptions-item label="CT变比">
{{ infoWindowPoint.ct1 }}/{{ infoWindowPoint.ct2 }} {{ infoWindowPoint.ct1 }}/{{ infoWindowPoint.ct2 }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="生产厂家"> <el-descriptions-item label="生产厂家">
{{ infoWindowPoint.manufacturer }} {{ infoWindowPoint.manufacturer }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="终端状态"> <el-descriptions-item label="终端状态">
{{ infoWindowPoint.runFlag == 0 ? '投运' : infoWindowPoint.runFlag == 1 ? '检修' : '停运' }} {{ infoWindowPoint.runFlag == 0 ? '投运' : infoWindowPoint.runFlag == 1 ? '检修' : '停运' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="通讯状态"> <el-descriptions-item label="通讯状态">
{{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }} {{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="props.showBut"> <el-descriptions-item v-if="props.showBut">
<el-button type="primary" size="small" @click="changeTab('2')">事件统计</el-button> <el-button type="primary" size="small" @click="changeTab('2')">事件统计</el-button>
<el-button type="primary" size="small" @click="changeTab('3')">事件分析</el-button> <el-button type="primary" size="small" @click="changeTab('3')">事件分析</el-button>
<el-button type="primary" size="small" @click="changeTab('4')">运行情况</el-button> <el-button type="primary" size="small" @click="changeTab('4')">运行情况</el-button>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions <el-descriptions
:title="infoWindowPoint.subName" :title="infoWindowPoint.subName"
:column="1" :column="1"
v-else-if="infoWindowPoint.subId" v-else-if="infoWindowPoint.subId"
style="padding-top: 10px" style="padding-top: 10px"
></el-descriptions> ></el-descriptions>
</bm-info-window> </bm-info-window>
</bm-marker> </bm-marker>
</baidu-map> </baidu-map>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { BmlMarkerClusterer } from 'vue-baidu-map-3x' import { BmlMarkerClusterer } from 'vue-baidu-map-3x'
import { onMounted, ref, watch } from 'vue' import { onMounted, ref, watch } from 'vue'
import { getAreaLineInfo } from '@/api/event-boot/areaInfo' import { getAreaLineInfo } from '@/api/event-boot/areaInfo'
import DatePicker from '@/components/form/datePicker/index.vue' import DatePicker from '@/components/form/datePicker/index.vue'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
import { useMonitoringPoint } from '@/stores/monitoringPoint' import { useMonitoringPoint } from '@/stores/monitoringPoint'
const emit = defineEmits(['changeTab']) const emit = defineEmits(['changeTab'])
interface Props { interface Props {
showBut?: boolean showBut?: boolean
mapList?: any mapList?: any
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
showBut: true, showBut: true,
mapList: [] mapList: []
}) })
const monitoringPoint = useMonitoringPoint() const monitoringPoint = useMonitoringPoint()
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const datePickerRef = ref() const datePickerRef = ref()
const zoom = ref(11) const zoom = ref(11)
const loading = ref(true) const loading = ref(true)
const hackReset = ref(true) const hackReset = ref(true)
const center = ref({ const center = ref({
lng: 0, lng: 0,
lat: 0 lat: 0
}) })
const infoWindowPoint = ref<anyObj>({ const infoWindowPoint = ref<anyObj>({
lng: 0, lng: 0,
lat: 0, lat: 0,
show: false show: false
}) })
const areaLineInfo = ref<any>([]) const areaLineInfo = ref<any>([])
const siteList = ref<any>([]) const siteList = ref<any>([])
const polyline = ref<any>([]) const polyline = ref<any>([])
const lineId = ref('') const lineId = ref('')
const handler = async ({ BMap, map }: any) => { const handler = async ({ BMap, map }: any) => {
let data = props.mapList let data = props.mapList
let r = 0.0035 let r = 0.0035
let list = data.filter((item: any) => item.lng != 0) let list = data.filter((item: any) => item.lng != 0)
list.forEach((item: any) => { list.forEach((item: any) => {
// 变电站图标 // 变电站图标
item.icon = { item.icon = {
url: new URL('@/assets/jcd.png', import.meta.url).href, url: new URL('@/assets/jcd.png', import.meta.url).href,
size: { size: {
width: 40, width: 40,
height: 40 height: 40
} }
} }
if (item.children.length > 10 && item.children.length < 100) { if (item.children.length > 10 && item.children.length < 100) {
r = 0.0055 r = 0.0055
} else if (item.children.length >= 100) { } else if (item.children.length >= 100) {
r = 0.01055 r = 0.01055
} }
item.children.forEach((val: any, i: number) => { item.children.forEach((val: any, i: number) => {
val.lng = item.lng + r * Math.cos((2 * Math.PI * i) / item.children.length) val.lng = item.lng + r * Math.cos((2 * Math.PI * i) / item.children.length)
val.lat = item.lat + r * Math.sin((2 * Math.PI * i) / item.children.length) val.lat = item.lat + r * Math.sin((2 * Math.PI * i) / item.children.length)
// 监测点图标 // 监测点图标
val.icon = { val.icon = {
url: '', url: '',
size: { size: {
width: 40, width: 40,
height: 40 height: 40
} }
} }
switch (val.runFlag) { switch (val.runFlag) {
case 0: case 0:
// 投运 // 投运
if (val.comFlag == 0) { if (val.comFlag == 0) {
// 异常 // 异常
if (val.noDealCount > 0) { if (val.noDealCount > 0) {
// 异常有暂降 // 异常有暂降
val.icon.url = new URL('@/assets/txycyzj.gif', import.meta.url).href val.icon.url = new URL('@/assets/txycyzj.gif', import.meta.url).href
} else if (val.noDealCount == 0) { } else if (val.noDealCount == 0) {
// 异常无暂降 // 异常无暂降
val.icon.url = new URL('@/assets/txzdwzj.png', import.meta.url).href val.icon.url = new URL('@/assets/txzdwzj.png', import.meta.url).href
} }
} else if (val.comFlag == 1) { } else if (val.comFlag == 1) {
// 正常 // 正常
if (val.noDealCount > 0) { if (val.noDealCount > 0) {
// 正常有暂降 // 正常有暂降
val.icon.url = new URL('@/assets/txzcyzj.gif', import.meta.url).href val.icon.url = new URL('@/assets/txzcyzj.gif', import.meta.url).href
} else if (val.noDealCount == 0) { } else if (val.noDealCount == 0) {
// 正常无暂降 // 正常无暂降
val.icon.url = new URL('@/assets/txzcwzj.png', import.meta.url).href val.icon.url = new URL('@/assets/txzcwzj.png', import.meta.url).href
} }
} }
break break
case 1: case 1:
val.icon.url = new URL('@/assets/rby.png', import.meta.url).href val.icon.url = new URL('@/assets/rby.png', import.meta.url).href
break break
case 2: case 2:
val.icon.url = new URL('@/assets/ty.png', import.meta.url).href val.icon.url = new URL('@/assets/ty.png', import.meta.url).href
break break
default: default:
break break
} }
polyline.value.push([ polyline.value.push([
{ {
lng: item.lng, lng: item.lng,
lat: item.lat lat: item.lat
}, },
{ {
lng: val.lng, lng: val.lng,
lat: val.lat lat: val.lat
} }
]) ])
}) })
areaLineInfo.value.push(...item.children) areaLineInfo.value.push(...item.children)
}) })
siteList.value = list siteList.value = list
center.value.lng = list[0]?.lng || 0 center.value.lng = list[0]?.lng || 0
center.value.lat = list[0]?.lat + 0.01 || 0 center.value.lat = list[0]?.lat + 0.01 || 0
watch( watch(
() => monitoringPoint.state.lineId, () => monitoringPoint.state.lineId,
(newLineId, oldLineId) => { (newLineId, oldLineId) => {
let value = areaLineInfo.value.find((item: any) => item.lineId == newLineId) let value = areaLineInfo.value.find((item: any) => item.lineId == newLineId)
if (value == undefined) return if (value == undefined) return
center.value.lng = value.lng center.value.lng = value.lng
center.value.lat = value.lat + 0.01 center.value.lat = value.lat + 0.01
infoWindowPoint.value = value infoWindowPoint.value = value
infoWindowPoint.value.show = true infoWindowPoint.value.show = true
monitoringPoint.setValue( monitoringPoint.setValue(
'lineName', 'lineName',
value.manufacturer + '>' + value.gdName + '>' + value.subName + '>' + value.lineName value.manufacturer + '>' + value.gdName + '>' + value.subName + '>' + value.lineName
) )
}, },
{ immediate: true } { immediate: true }
) )
zoom.value = 15 zoom.value = 15
setTimeout(() => { setTimeout(() => {
loading.value = false loading.value = false
}, 0) }, 0)
} }
const syncCenterAndZoom = (e: any) => { const syncCenterAndZoom = (e: any) => {
zoom.value = e.target.getZoom() zoom.value = e.target.getZoom()
} }
const markerClick = (e: any) => { const markerClick = (e: any) => {
infoWindowPoint.value = e infoWindowPoint.value = e
infoWindowPoint.value.show = true infoWindowPoint.value.show = true
} }
const changeTab = (e: string) => { const changeTab = (e: string) => {
emit('changeTab', e) emit('changeTab', e)
} }
onMounted(() => { onMounted(() => {
if (siteList.value.length == 0) { if (siteList.value.length == 0) {
setTimeout(() => { setTimeout(() => {
hackReset.value = false hackReset.value = false
}, 500) }, 100)
setTimeout(() => { setTimeout(() => {
hackReset.value = true hackReset.value = true
}, 1000) }, 1000)
} }
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bm-view { .bm-view {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.selectBox { .selectBox {
position: absolute; position: absolute;
top: 16px; top: 16px;
left: 165px; left: 165px;
z-index: 2000; z-index: 2000;
width: 240px; width: 240px;
} }
.iconBox { .iconBox {
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;
right: 10px; right: 10px;
z-index: 2000; z-index: 2000;
width: 150px; width: 150px;
height: 260px; height: 260px;
padding: 10px; padding: 10px;
background: rgba(255, 255, 255, 0.75) !important; background: rgba(255, 255, 255, 0.75) !important;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
font-size: 12px; font-size: 12px;
.div { .div {
display: flex; display: flex;
margin-bottom: 5px; margin-bottom: 5px;
img { img {
height: 20px; height: 20px;
margin-right: 5px; margin-right: 5px;
} }
} }
} }
:deep(.el-descriptions__cell) { :deep(.el-descriptions__cell) {
white-space: nowrap; white-space: nowrap;
} }
</style> </style>

View File

@@ -1,382 +1,382 @@
<template> <template>
<div style="padding: 10px; display: flex; height: 100%" v-loading="loading"> <div style="padding: 10px; display: flex; height: 100%" v-loading="loading">
<div style="position: relative; flex: 1"> <div style="position: relative; flex: 1">
<div style="display: none"> <div style="display: none">
<DatePicker ref="datePickerRef"></DatePicker> <DatePicker ref="datePickerRef"></DatePicker>
</div> </div>
<div class="iconBox"> <div class="iconBox">
<div class="div"> <div class="div">
<img src="@/assets/jcd.png" alt="" /> <img src="@/assets/jcd.png" alt="" />
<span>变电站(场站)</span> <span>变电站(场站)</span>
</div> </div>
<div class="div"> <div class="div">
<img src="@/assets/rby.png" alt="" /> <img src="@/assets/rby.png" alt="" />
<span>检修</span> <span>检修</span>
</div> </div>
<div class="div"> <div class="div">
<img src="@/assets/ty.png" alt="" /> <img src="@/assets/ty.png" alt="" />
<span>停运</span> <span>停运</span>
</div> </div>
<div class="div">投运</div> <div class="div">投运</div>
<div class="div" style="padding-left: 10px"> <div class="div" style="padding-left: 10px">
<span>通讯正常</span> <span>通讯正常</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txzcyzj.gif" alt="" /> <img src="@/assets/txzcyzj.gif" alt="" />
<span>有暂降</span> <span>有暂降</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txzcwzj.png" alt="" /> <img src="@/assets/txzcwzj.png" alt="" />
<span>无暂降</span> <span>无暂降</span>
</div> </div>
<div class="div" style="padding-left: 10px"> <div class="div" style="padding-left: 10px">
<span>通讯异常</span> <span>通讯异常</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txycyzj.gif" alt="" /> <img src="@/assets/txycyzj.gif" alt="" />
<span>有暂降</span> <span>有暂降</span>
</div> </div>
<div class="div" style="padding-left: 20px"> <div class="div" style="padding-left: 20px">
<img src="@/assets/txzdwzj.png" alt="" /> <img src="@/assets/txzdwzj.png" alt="" />
<span>无暂降</span> <span>无暂降</span>
</div> </div>
</div> </div>
<div class="selectBox"> <div class="selectBox">
<el-select @change="pointChange" filterable clearable v-model="lineId" placeholder="输入监测点名称查询"> <el-select @change="pointChange" filterable clearable v-model="lineId" placeholder="输入监测点名称查询">
<el-option <el-option
v-for="item in areaLineInfo" v-for="item in areaLineInfo"
:key="item.lineId" :key="item.lineId"
:label="item.lineName" :label="item.lineName"
:value="item.lineId" :value="item.lineId"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
<!-- v-if="hackReset" --> <!-- v-if="hackReset" -->
<baidu-map <baidu-map
class="bm-view" class="bm-view"
v-if="hackReset"
:zoom="zoom" :zoom="zoom"
:map-click="false" :map-click="false"
:scroll-wheel-zoom="true" :scroll-wheel-zoom="true"
:center="center" :center="center"
@ready="handler" @ready="handler"
:dragging="true" :dragging="true"
@zoomend="syncCenterAndZoom" @zoomend="syncCenterAndZoom"
> >
<!-- <bm-map-type <!-- <bm-map-type
:map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']" :map-types="['BMAP_NORMAL_MAP', 'BMAP_HYBRID_MAP']"
anchor="BMAP_ANCHOR_TOP_RIGHT" anchor="BMAP_ANCHOR_TOP_RIGHT"
></bm-map-type> --> ></bm-map-type> -->
<!-- 线--> <!-- 线-->
<div v-if="zoom > 13"> <div v-if="zoom > 13">
<bm-polyline :path="path" v-for="(path, index) in polyline" :key="index"></bm-polyline> <bm-polyline :path="path" v-for="(path, index) in polyline" :key="index"></bm-polyline>
</div> </div>
<!-- 变电站--> <!-- 变电站-->
<template v-if="zoom > 13"> <template v-if="zoom > 13">
<bm-marker <bm-marker
:position="path" :position="path"
v-for="path in siteList" v-for="path in siteList"
:key="path.subId" :key="path.subId"
:icon="path.icon" :icon="path.icon"
@click="markerClick(path)" @click="markerClick(path)"
></bm-marker> ></bm-marker>
</template> </template>
<!-- --> <!-- -->
<BmlMarkerClusterer maxZoom="12"> <BmlMarkerClusterer maxZoom="12">
<bm-marker <bm-marker
:position="path" :position="path"
v-for="path in areaLineInfo" v-for="path in areaLineInfo"
:key="path.lineId" :key="path.lineId"
:icon="path.icon" :icon="path.icon"
@click="markerClick(path)" @click="markerClick(path)"
></bm-marker> ></bm-marker>
</BmlMarkerClusterer> </BmlMarkerClusterer>
<bm-marker :position="infoWindowPoint" :icon="{ url: '1', size: { width: 0, height: 0 } }"> <bm-marker :position="infoWindowPoint" :icon="{ url: '1', size: { width: 0, height: 0 } }">
<bm-info-window :show="infoWindowPoint.show" @close="infoWindowPoint.show = false"> <bm-info-window :show="infoWindowPoint.show" @close="infoWindowPoint.show = false">
<el-descriptions :title="infoWindowPoint.lineName" :column="1" v-if="infoWindowPoint.lineId"> <el-descriptions :title="infoWindowPoint.lineName" :column="1" v-if="infoWindowPoint.lineId">
<el-descriptions-item label="供电公司">{{ infoWindowPoint.gdName }}</el-descriptions-item> <el-descriptions-item label="供电公司">{{ infoWindowPoint.gdName }}</el-descriptions-item>
<el-descriptions-item label="变电站(场站)"> <el-descriptions-item label="变电站(场站)">
{{ infoWindowPoint.subName }} {{ infoWindowPoint.subName }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="母线">{{ infoWindowPoint.voltageName }}</el-descriptions-item> <el-descriptions-item label="母线">{{ infoWindowPoint.voltageName }}</el-descriptions-item>
<el-descriptions-item label="网络参数"> <el-descriptions-item label="网络参数">
{{ infoWindowPoint.ip }} {{ infoWindowPoint.ip }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="PT变比"> <el-descriptions-item label="PT变比">
{{ infoWindowPoint.pt1 }}/{{ infoWindowPoint.pt2 }} {{ infoWindowPoint.pt1 }}/{{ infoWindowPoint.pt2 }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="CT变比"> <el-descriptions-item label="CT变比">
{{ infoWindowPoint.ct1 }}/{{ infoWindowPoint.ct2 }} {{ infoWindowPoint.ct1 }}/{{ infoWindowPoint.ct2 }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="生产厂家"> <el-descriptions-item label="生产厂家">
{{ infoWindowPoint.manufacturer }} {{ infoWindowPoint.manufacturer }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="终端状态"> <el-descriptions-item label="终端状态">
{{ {{
infoWindowPoint.runFlag == 0 infoWindowPoint.runFlag == 0
? '投运' ? '投运'
: infoWindowPoint.runFlag == 1 : infoWindowPoint.runFlag == 1
? '检修' ? '检修'
: '停运' : '停运'
}} }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="通讯状态"> <el-descriptions-item label="通讯状态">
{{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }} {{ infoWindowPoint.comFlag == 0 ? '中断' : '正常' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<!-- <el-button type="primary" size="small" @click="lookPoint">查看监测点</el-button> --> <!-- <el-button type="primary" size="small" @click="lookPoint">查看监测点</el-button> -->
<el-button type="primary" size="small" @click="lookEvent"> <el-button type="primary" size="small" @click="lookEvent">
暂态事件({{ infoWindowPoint.noDealCount }}) 暂态事件({{ infoWindowPoint.noDealCount }})
</el-button> </el-button>
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions <el-descriptions
:title="infoWindowPoint.subName" :title="infoWindowPoint.subName"
:column="1" :column="1"
v-else-if="infoWindowPoint.subId" v-else-if="infoWindowPoint.subId"
style="padding-top: 10px" style="padding-top: 10px"
></el-descriptions> ></el-descriptions>
</bm-info-window> </bm-info-window>
</bm-marker> </bm-marker>
</baidu-map> </baidu-map>
</div> </div>
<div style="width: 600px; height: 100%"> <div style="width: 600px; height: 100%">
<Right :params="params" v-if="params.deptIndex"></Right> <Right :params="params" v-if="params.deptIndex"></Right>
</div> </div>
<PopupEvent ref="popupEvent"></PopupEvent> <PopupEvent ref="popupEvent"></PopupEvent>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { BmlMarkerClusterer } from 'vue-baidu-map-3x' import { BmlMarkerClusterer } from 'vue-baidu-map-3x'
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { getAreaLineInfo } from '@/api/event-boot/areaInfo' import { getAreaLineInfo } from '@/api/event-boot/areaInfo'
import DatePicker from '@/components/form/datePicker/index.vue' import DatePicker from '@/components/form/datePicker/index.vue'
import { useAdminInfo } from '@/stores/adminInfo' import { useAdminInfo } from '@/stores/adminInfo'
import Right from './right.vue' import Right from './right.vue'
import PopupEvent from './popupEvent.vue' import PopupEvent from './popupEvent.vue'
import router from '@/router' import router from '@/router'
defineOptions({ defineOptions({
name: 'Descentsystem/overview' name: 'Descentsystem/overview'
}) // 添加响应式变量 }) // 添加响应式变量
const height = mainHeight(20) const height = mainHeight(20)
const adminInfo = useAdminInfo() const adminInfo = useAdminInfo()
const datePickerRef = ref() const datePickerRef = ref()
const hackReset = ref(true) const hackReset = ref(true)
const zoom = ref(13) const zoom = ref(13)
const loading = ref(true) const loading = ref(true)
const popupEvent = ref() const popupEvent = ref()
const params = ref({ const params = ref({
deptIndex: '', deptIndex: '',
monitorFlag: 2, monitorFlag: 2,
powerFlag: 2, powerFlag: 2,
searchBeginTime: '', searchBeginTime: '',
searchEndTime: '', searchEndTime: '',
serverName: 'event-boot', serverName: 'event-boot',
statisticalType: {} statisticalType: {}
}) })
const center = ref({ const center = ref({
lng: 0, lng: 0,
lat: 0 lat: 0
}) })
const infoWindowPoint = ref<anyObj>({ const infoWindowPoint = ref<anyObj>({
lng: 0, lng: 0,
lat: 0, lat: 0,
show: false show: false
}) })
const areaLineInfo = ref<any>([]) const areaLineInfo = ref<any>([])
const siteList = ref<any>([]) const siteList = ref<any>([])
const polyline = ref<any>([]) const polyline = ref<any>([])
const lineId = ref('') const lineId = ref('')
const handler = async ({ BMap, map }: any) => { const handler = async ({ BMap, map }: any) => {
params.value.deptIndex = adminInfo.$state.deptId params.value.deptIndex = adminInfo.$state.deptId
params.value.searchBeginTime = datePickerRef.value.timeValue[0] params.value.searchBeginTime = datePickerRef.value.timeValue[0]
params.value.searchEndTime = datePickerRef.value.timeValue[1] params.value.searchEndTime = datePickerRef.value.timeValue[1]
let { data } = await getAreaLineInfo(params.value) let { data } = await getAreaLineInfo(params.value)
let r = 0.0035 let r = 0.0035
let list = data.filter((item: any) => item.lng != 0) let list = data.filter((item: any) => item.lng != 0)
list.forEach((item: any) => { list.forEach((item: any) => {
// 变电站图标 // 变电站图标
item.icon = { item.icon = {
url: new URL('@/assets/jcd.png', import.meta.url).href, url: new URL('@/assets/jcd.png', import.meta.url).href,
size: { size: {
width: 40, width: 40,
height: 40 height: 40
} }
} }
if (item.children.length > 10 && item.children.length < 100) { if (item.children.length > 10 && item.children.length < 100) {
r = 0.0055 r = 0.0055
} else if (item.children.length >= 100) { } else if (item.children.length >= 100) {
r = 0.01055 r = 0.01055
} }
item.children.forEach((val: any, i: number) => { item.children.forEach((val: any, i: number) => {
val.lng = item.lng + r * Math.cos((2 * Math.PI * i) / item.children.length) val.lng = item.lng + r * Math.cos((2 * Math.PI * i) / item.children.length)
val.lat = item.lat + r * Math.sin((2 * Math.PI * i) / item.children.length) val.lat = item.lat + r * Math.sin((2 * Math.PI * i) / item.children.length)
// 监测点图标 // 监测点图标
val.icon = { val.icon = {
url: '', url: '',
size: { size: {
width: 40, width: 40,
height: 40 height: 40
} }
} }
switch (val.runFlag) { switch (val.runFlag) {
case 0: case 0:
// 投运 // 投运
if (val.comFlag == 0) { if (val.comFlag == 0) {
// 异常 // 异常
if (val.noDealCount > 0) { if (val.noDealCount > 0) {
// 异常有暂降 // 异常有暂降
val.icon.url = new URL('@/assets/txycyzj.gif', import.meta.url).href val.icon.url = new URL('@/assets/txycyzj.gif', import.meta.url).href
} else if (val.noDealCount == 0) { } else if (val.noDealCount == 0) {
// 异常无暂降 // 异常无暂降
val.icon.url = new URL('@/assets/txzdwzj.png', import.meta.url).href val.icon.url = new URL('@/assets/txzdwzj.png', import.meta.url).href
} }
} else if (val.comFlag == 1) { } else if (val.comFlag == 1) {
// 正常 // 正常
if (val.noDealCount > 0) { if (val.noDealCount > 0) {
// 正常有暂降 // 正常有暂降
val.icon.url = new URL('@/assets/txzcyzj.gif', import.meta.url).href val.icon.url = new URL('@/assets/txzcyzj.gif', import.meta.url).href
} else if (val.noDealCount == 0) { } else if (val.noDealCount == 0) {
// 正常无暂降 // 正常无暂降
val.icon.url = new URL('@/assets/txzcwzj.png', import.meta.url).href val.icon.url = new URL('@/assets/txzcwzj.png', import.meta.url).href
} }
} }
break break
case 1: case 1:
val.icon.url = new URL('@/assets/rby.png', import.meta.url).href val.icon.url = new URL('@/assets/rby.png', import.meta.url).href
break break
case 2: case 2:
val.icon.url = new URL('@/assets/ty.png', import.meta.url).href val.icon.url = new URL('@/assets/ty.png', import.meta.url).href
break break
default: default:
break break
} }
polyline.value.push([ polyline.value.push([
{ {
lng: item.lng, lng: item.lng,
lat: item.lat lat: item.lat
}, },
{ {
lng: val.lng, lng: val.lng,
lat: val.lat lat: val.lat
} }
]) ])
}) })
areaLineInfo.value.push(...item.children) areaLineInfo.value.push(...item.children)
}) })
setTimeout(() => { setTimeout(() => {
loading.value = false loading.value = false
}, 0) }, 0)
siteList.value = list siteList.value = list
center.value.lng = areaLineInfo.value[0]?.lng || 0 center.value.lng = areaLineInfo.value[0]?.lng || 0
center.value.lat = areaLineInfo.value[0]?.lat + 0.04 || 0 center.value.lat = areaLineInfo.value[0]?.lat + 0.04 || 0
infoWindowPoint.value = areaLineInfo.value[0] || {} infoWindowPoint.value = areaLineInfo.value[0] || {}
infoWindowPoint.value.show = true infoWindowPoint.value.show = true
zoom.value = 13 zoom.value = 13
setTimeout(() => { setTimeout(() => {
loading.value = false loading.value = false
}, 1500) }, 1500)
} }
const syncCenterAndZoom = (e: any) => { const syncCenterAndZoom = (e: any) => {
zoom.value = e.target.getZoom() zoom.value = e.target.getZoom()
} }
const pointChange = (val: string) => { const pointChange = (val: string) => {
if (!val) return if (!val) return
let data = areaLineInfo.value.find((item: any) => item.lineId == val) let data = areaLineInfo.value.find((item: any) => item.lineId == val)
center.value.lng = data.lng center.value.lng = data.lng
center.value.lat = data.lat + 0.04 center.value.lat = data.lat + 0.04
infoWindowPoint.value = data infoWindowPoint.value = data
infoWindowPoint.value.show = true infoWindowPoint.value.show = true
zoom.value = 13 zoom.value = 13
} }
const markerClick = (e: any) => { const markerClick = (e: any) => {
infoWindowPoint.value = e infoWindowPoint.value = e
infoWindowPoint.value.show = true infoWindowPoint.value.show = true
} }
const lookEvent = (e: any) => { const lookEvent = (e: any) => {
popupEvent.value.open({ popupEvent.value.open({
id: infoWindowPoint.value.lineId, id: infoWindowPoint.value.lineId,
searchBeginTime: datePickerRef.value.timeValue[0], searchBeginTime: datePickerRef.value.timeValue[0],
searchEndTime: datePickerRef.value.timeValue[1] searchEndTime: datePickerRef.value.timeValue[1]
}) })
} }
const lookPoint = () => { const lookPoint = () => {
console.log(infoWindowPoint.value) console.log(infoWindowPoint.value)
router.replace({ router.replace({
name: 'Descentsystem/monitoringpoint', name: 'Descentsystem/monitoringpoint',
query: { query: {
lineId: infoWindowPoint.value.lineId, lineId: infoWindowPoint.value.lineId,
lineName: lineName:
infoWindowPoint.value.manufacturer + infoWindowPoint.value.manufacturer +
'>' + '>' +
infoWindowPoint.value.gdName + infoWindowPoint.value.gdName +
'>' + '>' +
infoWindowPoint.value.subName + infoWindowPoint.value.subName +
'>' + '>' +
infoWindowPoint.value.lineName infoWindowPoint.value.lineName
} }
}) })
} }
onMounted(() => { onMounted(() => {
if (siteList.value.length == 0) { if (siteList.value.length == 0) {
setTimeout(() => { setTimeout(() => {
if (window.localStorage.getItem('BMAP_SECKEY') == null) { if (window.localStorage.getItem('BMAP_SECKEY') == null) {
hackReset.value = false hackReset.value = false
} }
}, 500) }, 100)
setTimeout(() => { setTimeout(() => {
hackReset.value = true hackReset.value = true
}, 1000) }, 1000)
} }
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bm-view { .bm-view {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.selectBox { .selectBox {
position: absolute; position: absolute;
top: 16px; top: 16px;
left: 165px; left: 165px;
z-index: 2000; z-index: 2000;
width: 240px; width: 240px;
} }
.iconBox { .iconBox {
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 10px; left: 10px;
z-index: 2000; z-index: 2000;
width: 150px; width: 150px;
height: 260px; height: 260px;
padding: 10px; padding: 10px;
background: rgba(255, 255, 255, 0.75) !important; background: rgba(255, 255, 255, 0.75) !important;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
font-size: 12px; font-size: 12px;
.div { .div {
display: flex; display: flex;
margin-bottom: 5px; margin-bottom: 5px;
img { img {
height: 20px; height: 20px;
margin-right: 5px; margin-right: 5px;
} }
} }
} }
:deep(.el-descriptions__cell) { :deep(.el-descriptions__cell) {
white-space: nowrap; white-space: nowrap;
} }
</style> </style>

View File

@@ -1,97 +1,97 @@
<template> <template>
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" title="修改密码"> <el-dialog draggable width="500px" v-model="dialogVisible" title="修改密码">
<el-scrollbar> <el-scrollbar>
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef"> <el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
<el-form-item label="新密码" prop="newPwd"> <el-form-item label="新密码" prop="newPwd">
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password /> <el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
</el-form-item> </el-form-item>
<el-form-item label="确认密码" prop="confirmPwd"> <el-form-item label="确认密码" prop="confirmPwd">
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password /> <el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-scrollbar> </el-scrollbar>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button> <el-button type="primary" @click="submit">确认</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, inject } from 'vue' import { ref, inject } from 'vue'
import { reactive } from 'vue' import { reactive } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { validatePwd } from '@/utils/common' import { validatePwd } from '@/utils/common'
import { passwordConfirm, updatePassword } from '@/api/user-boot/user' import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
import { debug } from 'console' import { debug } from 'console'
const formRef = ref() const formRef = ref()
const tableStore = inject('tableStore') as TableStore const tableStore = inject('tableStore') as TableStore
const form = reactive({ const form = reactive({
id: '', id: '',
newPwd: '', newPwd: '',
confirmPwd: '', confirmPwd: '',
loginName: '' loginName: ''
}) })
const rules = { const rules = {
newPwd: [ newPwd: [
{ required: true, message: '请输入密码', trigger: 'blur' }, { required: true, message: '请输入密码', trigger: 'blur' },
{ {
min: 6, min: 6,
max: 12, max: 12,
message: '长度在 6 到 12 个字符', message: '长度在 6 到 12 个字符',
trigger: 'blur' trigger: 'blur'
}, },
{ validator: validatePwd, trigger: 'blur' } { validator: validatePwd, trigger: 'blur' }
], ],
confirmPwd: [ confirmPwd: [
{ required: true, message: '请确认密码', trigger: 'blur' }, { required: true, message: '请确认密码', trigger: 'blur' },
{ {
min: 6, min: 6,
max: 12, max: 12,
message: '长度在 6 到 12 个字符', message: '长度在 6 到 12 个字符',
trigger: 'blur' trigger: 'blur'
}, },
{ {
validator: (rule: any, value: string, callback: any) => { validator: (rule: any, value: string, callback: any) => {
if (value === '') { if (value === '') {
callback(new Error('请再次输入密码')) callback(new Error('请再次输入密码'))
} else if (value !== form.newPwd) { } else if (value !== form.newPwd) {
callback(new Error('两次输入密码不一致!')) callback(new Error('两次输入密码不一致!'))
} else { } else {
callback() callback()
} }
}, },
trigger: 'blur', trigger: 'blur',
required: true required: true
} }
] ]
} }
const dialogVisible = ref(false) const dialogVisible = ref(false)
const title = ref('新增菜单') const title = ref('新增菜单')
const open = (id: string, loginName: string) => { const open = (id: string, loginName: string) => {
form.id = id form.id = id
form.loginName = loginName form.loginName = loginName
form.newPwd = '' form.newPwd = ''
form.confirmPwd = '' form.confirmPwd = ''
dialogVisible.value = true dialogVisible.value = true
} }
const submit = async () => { const submit = async () => {
formRef.value.validate((valid: boolean) => { formRef.value.validate((valid: boolean) => {
if (valid) { if (valid) {
updatePassword({ updatePassword({
id: form.id, id: form.id,
newPassword: form.newPwd newPassword: form.newPwd
}).then((res: any) => { }).then((res: any) => {
ElMessage.success('密码修改成功') ElMessage.success('密码修改成功')
dialogVisible.value = false dialogVisible.value = false
}) })
} }
}) })
} }
defineExpose({ open }) defineExpose({ open })
</script> </script>

View File

@@ -1,133 +1,139 @@
<template> <template>
<div class="default-main"> <div class="default-main">
<div v-show="show && lookShow"> <div v-show="show && lookShow">
<TableHeader ref="TableHeaderRef"> <TableHeader ref="TableHeaderRef">
<template #operation> <template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button> <el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef" /> <Table ref="tableRef" />
</div> </div>
<luckysheet ref="luckysheetRef" v-if="!show" @shutDown="shutDown" /> <luckysheet ref="luckysheetRef" v-if="!show" @shutDown="shutDown" />
<!-- 查看 --> <!-- 查看 -->
<look ref="lookRef" v-if="!lookShow" @shutDown="shutDown" /> <look ref="lookRef" v-if="!lookShow" @shutDown="shutDown" />
<!-- 绑定 --> <!-- 绑定 -->
<department ref="departmentRef" /> <department ref="departmentRef" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue' import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { delTemplate } from '@/api/harmonic-boot/luckyexcel' import { delTemplate } from '@/api/harmonic-boot/luckyexcel'
import { useDictData } from '@/stores/dictData' import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import luckysheet from './luckysheet.vue' import luckysheet from './luckysheet.vue'
import look from './look.vue' import look from './look.vue'
import department from './department.vue' import department from './department.vue'
defineOptions({ defineOptions({
name: 'Distributedphotovoltaic/templateConfiguration' name: 'Distributedphotovoltaic/templateConfiguration'
}) })
const luckysheetRef = ref() const luckysheetRef = ref()
const lookRef = ref() const lookRef = ref()
const departmentRef = ref() const departmentRef = ref()
const show = ref(true) const show = ref(true)
const lookShow = ref(true) const lookShow = ref(true)
const tableStore: any = new TableStore({ const tableStore: any = new TableStore({
url: '/harmonic-boot/customReport/getTemplateList', url: '/harmonic-boot/customReport/getTemplateList',
method: 'POST', method: 'POST',
isWebPaging: true, isWebPaging: true,
column: [ column: [
{ field: 'name', title: '报表模板名称' }, { field: 'name', title: '报表模板名称' },
{ field: 'updateBy', title: '操作用户' }, { field: 'updateBy', title: '操作用户' },
{ field: 'createTime', title: '创建时间' }, { field: 'createTime', title: '创建时间' },
{ field: 'updateTime', title: '更新时间' }, { field: 'updateTime', title: '更新时间' },
{ field: 'activation', title: '状态' }, {
{ field: 'activation',
title: '操作', title: '状态',
width: '220', formatter(row) {
render: 'buttons', return row.cellValue == 1 ? '激活' : '未激活'
buttons: [ }
{ },
name: 'edit', {
title: '查看 ', title: '操作',
type: 'primary', width: '220',
icon: 'el-icon-Plus', render: 'buttons',
render: 'basicButton', buttons: [
click: row => { {
lookShow.value = false name: 'edit',
setTimeout(() => { title: '查看 ',
lookRef.value.open(row) type: 'primary',
}, 10) icon: 'el-icon-Plus',
} render: 'basicButton',
}, click: row => {
{ lookShow.value = false
name: 'edit', setTimeout(() => {
title: '编辑', lookRef.value.open(row)
type: 'primary', }, 10)
icon: 'el-icon-Plus', }
render: 'basicButton', },
click: row => { {
show.value = false name: 'edit',
setTimeout(() => { title: '编辑',
luckysheetRef.value.open('编辑报表模板', row) type: 'primary',
}, 10) icon: 'el-icon-Plus',
} render: 'basicButton',
}, click: row => {
// { show.value = false
// name: 'edit', setTimeout(() => {
// title: '绑定', luckysheetRef.value.open('编辑报表模板', row)
// type: 'primary', }, 10)
// icon: 'el-icon-Plus', }
// render: 'basicButton', },
// click: row => { // {
// departmentRef.value.open(row) // name: 'edit',
// } // title: '绑定',
// }, // type: 'primary',
{ // icon: 'el-icon-Plus',
name: 'del', // render: 'basicButton',
text: '删除', // click: row => {
type: 'danger', // departmentRef.value.open(row)
icon: 'el-icon-Delete', // }
render: 'confirmButton', // },
popconfirm: { {
confirmButtonText: '确认', name: 'del',
cancelButtonText: '取消', text: '删除',
confirmButtonType: 'danger', type: 'danger',
title: '确定删除?' icon: 'el-icon-Delete',
}, render: 'confirmButton',
click: row => { popconfirm: {
delTemplate({ tempId: row.id, deptId: row.deptId }).then(res => { confirmButtonText: '确认',
ElMessage.success('删除成功') cancelButtonText: '取消',
tableStore.index() confirmButtonType: 'danger',
}) title: '确定删除?'
} },
} click: row => {
] delTemplate({ tempId: row.id, deptId: row.deptId }).then(res => {
} ElMessage.success('删除成功')
], tableStore.index()
})
loadCallback: () => {} }
}) }
tableStore.table.params = {} ]
tableStore.table.params.pageSize = 20 }
tableStore.table.params.pageNum = 1 ],
provide('tableStore', tableStore) loadCallback: () => {}
// 关闭 })
const shutDown = () => { tableStore.table.params = {}
show.value = true tableStore.table.params.pageSize = 20
lookShow.value = true tableStore.table.params.pageNum = 1
tableStore.index()
} provide('tableStore', tableStore)
const add = () => { // 关闭
show.value = false const shutDown = () => {
setTimeout(() => { show.value = true
luckysheetRef.value.open('新增报表模板') lookShow.value = true
}, 10) tableStore.index()
} }
onMounted(() => { const add = () => {
tableStore.index() show.value = false
}) setTimeout(() => {
</script> luckysheetRef.value.open('新增报表模板')
}, 10)
}
onMounted(() => {
tableStore.index()
})
</script>