修改测试bug

This commit is contained in:
GGJ
2024-11-19 10:39:46 +08:00
parent 2101d03126
commit 64fb9141fd
14 changed files with 682 additions and 330 deletions

View File

@@ -19,8 +19,8 @@
<Icon size="14" name="el-icon-ArrowDown" style="color: #fff" v-else />
</el-button>
<el-button @click="onComSearch" v-if="showSearch" type="primary" :icon="Search">查询</el-button>
<el-button @click="onResetForm" v-if="showSearch" :icon="RefreshLeft">重置</el-button>
</template>
<el-button @click="onResetForm" v-if="showSearch && showReset" :icon="RefreshLeft">重置</el-button>
</template>
<slot name="operation"></slot>
</div>
<el-form :style="showSelect && showUnfoldButton ? headerFormSecondStyleOpen : headerFormSecondStyleClose"
@@ -54,6 +54,7 @@ interface Props {
showSearch?: boolean
nextFlag?: boolean //控制时间是否可以往后推
theCurrentTime?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //控制时间前3天展示上个月时间
}
const props = withDefaults(defineProps<Props>(), {
@@ -61,7 +62,8 @@ const props = withDefaults(defineProps<Props>(), {
area: false,
showSearch: true,
nextFlag: false,
theCurrentTime: true
theCurrentTime: true,
showReset: true
})
// 动态计算table高度
let resizeObserver = new ResizeObserver(entries => {
@@ -110,7 +112,7 @@ const handlerHeight = () => {
}
// 刷新页面handler高度出下拉
const computedSearchRow = () => {
if (!headerForm.value.$el) return

View File

@@ -0,0 +1,179 @@
<template>
<div>
<div style="transition: all 0.3s; overflow: hidden; height: 100%">
<div class="cn-tree">
<div style="display: flex; align-items: center" class="mb10">
<el-input v-model="filterText" placeholder="请输入内容" clearable>
<template #prefix>
<Icon name="el-icon-Search" style="font-size: 16px" />
</template>
</el-input>
</div>
<el-tree style="flex: 1; overflow: auto" :props="defaultProps" highlight-current
:filter-node-method="filterNode" node-key="id" v-bind="$attrs" default-expand-all :data="tree"
ref="treRef" @node-click="clickNode" :expand-on-click-node="false">
<template #default="{ node, data }">
<span class="custom-tree-node">
<div class="left">
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
v-if="data.icon" />
<span>{{ node.label }}</span>
</div>
</span>
</template>
</el-tree>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, nextTick, watch, defineProps, defineEmits } from 'vue'
import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
import { useConfig } from '@/stores/config'
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree } from 'element-plus'
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
import { useDictData } from '@/stores/dictData'
defineOptions({
name: 'govern/schemeTree'
})
interface Props {
template?: boolean
}
const dictData = useDictData()
const props = withDefaults(defineProps<Props>(), {
template: false,
})
const filterText = ref('')
watch(filterText, val => {
treRef.value!.filter(val)
})
const filterNode = (value: string, data: any, node: any) => {
if (!value) return true
// return data.name.includes(value)
if (data.name) {
return chooseNode(value, data, node)
}
}
const chooseNode = (value: string, data: any, node: any) => {
if (data.name.indexOf(value) !== -1) {
return true
}
const level = node.level
// 如果传入的节点本身就是一级节点就不用校验了
if (level === 1) {
return false
}
// 先取当前节点的父节点
let parentData = node.parent
// 遍历当前节点的父节点
let index = 0
while (index < level - 1) {
// 如果匹配到直接返回此处name值是中文字符enName是英文字符。判断匹配中英文过滤
if (parentData.data.name.indexOf(value) !== -1) {
return true
}
// 否则的话再往上一层做匹配
parentData = parentData.parent
index++
}
// 没匹配到返回false
return false
}
/** 树形结构数据 */
const defaultProps = {
children: 'children',
label: 'name',
value: 'id'
}
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart','Policy'])
const config = useConfig()
const tree = ref()
const treRef = ref()
const id: any = ref(null)
const treeData = ref({})
//获取方案树形数据
const getTreeList = () => {
getSchemeTree().then(res => {
let arr: any[] = []
res.data.forEach((item: any) => {
item.icon = 'el-icon-Menu'
item.color = config.getColorVal('elementUiPrimary')
item?.children.forEach((item2: any) => {
item2.icon = 'el-icon-Document'
item2.color = config.getColorVal('elementUiPrimary')
arr.push(item2)
})
})
tree.value = res.data
nextTick(() => {
if (arr.length) {
treRef.value.setCurrentKey(id.value || arr[0].id)
let list = id.value ? arr.find((item: any) => item.id == id.value) : arr[0]
// 注册父组件事件
emit('init', {
level: 2,
...list
})
} else {
emit('init')
}
})
})
}
//方案id
const planId: any = ref('')
const clickNode = (e: anyObj) => {
e?.children ? (planId.value = e.id) : (planId.value = e.pid)
id.value = e.id
emit('nodeChange', e)
}
if (props.template) {
getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
emit('Policy', res.data)
getTreeList()
}).catch(err => {
getTreeList() })
} else {
getTreeList()}
</script>
<style lang="scss" scoped>
.cn-tree {
flex-shrink: 0;
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: 10px;
height: 100%;
width: 100%;
height: calc(100vh - 125px);
overflow-y: auto;
:deep(.el-tree) {
border: 1px solid var(--el-border-color);
}
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
background-color: var(--el-color-primary-light-7);
}
.menu-collapse {
color: var(--el-color-primary);
}
}
</style>

View File

@@ -1,6 +1,6 @@
import type { AxiosRequestConfig, Method } from 'axios'
import axios from 'axios'
import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus'
import { ElLoading,ElMessage, ElNotification, type LoadingOptions } from 'element-plus'
import { refreshToken } from '@/api/user-boot/user'
import router from '@/router/index'
import { useAdminInfo } from '@/stores/adminInfo'
@@ -150,10 +150,11 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
return Promise.reject(response.data)
} else {
if (options.showCodeMessage) {
ElNotification({
type: 'error',
message: response.data.message || '未知错误'
})
// ElNotification({
// type: 'error',
// message: response.data.message || '未知错误'
// })
ElMessage.error(response.data.message || '未知错误')
}
return Promise.reject(response.data)
}
@@ -241,7 +242,7 @@ export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean
}
// 适配器, 用于适配不同的请求方式
export function baseRequest(url, value = {}, method = 'post', options = {}) {
url = sysConfig.API_URL + url
url = sysConfig?.API_URL + url
if (method === 'post') {
return service.post(url, value, options)
} else if (method === 'get') {

View File

@@ -1,29 +1,39 @@
<!-- 补召日志 -->
<template>
<el-dialog
modal-class="analysisList"
v-model="dialogVisible"
title="补召日志"
width="70%"
draggable
@closed="close"
>
<TableHeader date-picker></TableHeader>
<el-dialog modal-class="analysisList" v-model="dialogVisible" title="补召日志" width="70%" draggable @closed="close">
<TableHeader date-picker :showReset="false">
<template #operation>
<el-button type="primary" icon="el-icon-Connection" @click="handleImport">
离线补召
</el-button>
<el-button type="primary" icon="el-icon-Monitor" @click="handleaddDevice">
在线补召
</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</el-dialog>
<popup ref="detailRef"></popup>
<!-- 离线数据导入组件 -->
<offLineDataImport ref="offLineDataImportRef"></offLineDataImport>
</template>
<script lang="ts" setup>
import { ref, onMounted, provide, onBeforeUnmount } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import offLineDataImport from '../offLineDataImport/index.vue'
import popup from './popup.vue'
import { useRouter } from 'vue-router'
const emit = defineEmits(['back'])
const dialogVisible = ref(false)
const height = ref(0)
height.value = window.innerHeight < 1080 ? 230 : 450
const detailRef: any = ref()
const lineId = ref('')
const deviceId = ref('')
const deviceData = ref({})
const { push, options, currentRoute } = useRouter()
const tableStore: any = new TableStore({
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
publicHeight: 400,
@@ -39,7 +49,7 @@ const tableStore: any = new TableStore({
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'successCount', title: '成功解析数', minWidth: 170 },
{ field: 'successCount', title: '成功解析数', minWidth: 150 },
{ field: 'startTime', title: '导入开始时间', minWidth: 170 },
{ field: 'endTime', title: '导入结束时间', minWidth: 170 },
{
@@ -65,7 +75,7 @@ const tableStore: any = new TableStore({
},
{
title: '操作',
width: '180',
width: '100',
render: 'buttons',
buttons: [
{
@@ -100,7 +110,10 @@ provide('tableStore', tableStore)
const handleBack = () => {
emit('back')
}
const open = () => {
const open = (row: any) => {
lineId.value = row.lineId
deviceData.value = row.deviceData
deviceId.value = row.deviceId
dialogVisible.value = true
setTimeout(() => {
tableStore.index()
@@ -115,6 +128,21 @@ const updateViewportHeight = async () => {
// tableStore.table.publicHeight = height.value
// await tableStore.index()
}
//设备补召
const handleaddDevice = () => {
push({
path: '/supplementaryRecruitment',
query: {
id: lineId.value,
ndid: deviceData.value?.ndid
}
})
}
const offLineDataImportRef = ref()
const handleImport = () => {
//设备devId&监测点lineId带入组件
offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
}
onMounted(() => {
updateViewportHeight() // 初始化视口高度
@@ -126,9 +154,4 @@ onBeforeUnmount(() => {
})
defineExpose({ open })
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__body {
overflow-y: hidden !important;
height: 70vh !important;
}
</style>
<style lang="scss" scoped></style>

View File

@@ -9,15 +9,15 @@
<!-- <el-button v-if="deviceType == '1'" type="primary" @click="handleDownLoadTemplate">
模版下载
</el-button> -->
<el-button v-if="deviceType == '1'" type="primary" icon="el-icon-Connection" @click="handleImport">
<!-- <el-button v-if="deviceType == '1'" type="primary" icon="el-icon-Connection" @click="handleImport">
离线补召
</el-button>
<el-button v-if="deviceType == '1'" type="primary" icon="el-icon-Monitor" @click="handleaddDevice">
在线补召
</el-button>
</el-button> -->
<el-button v-if="deviceType == '1'" type="primary" icon="el-icon-Tickets"
@click="handleAnalysisList">
补召日志
补召
</el-button>
</template>
<el-descriptions-item label="名称">
@@ -131,15 +131,22 @@
"
></div> -->
<!-- v-loading="tableLoading" -->
<div style="overflow: auto" :style="{ height: tableHeight }" v-loading="tableLoading" v-if="
dataSet.indexOf('_trenddata') == -1 &&
dataSet.indexOf('_realtimedata') == -1 &&
dataSet.indexOf('_event') == -1 &&
tableData.length != 0
">
<div class="mb5 mt5" v-if="dataSet.indexOf('_history') == -1">
统计时间:{{ tableData[0].children.length ? tableData[0].children[0].time : '' }}
</div>
<!-- 循环渲染的card 最新数据/历史数据显示 -->
<div class="content" v-if="tableData.length != 0 && !tableLoading">
<el-card class="box-card" v-for="(item, index) in tableData" :key="index">
<div class="content" v-if="tableData.length != 0 && !tableLoading"
:style="{ height: tableHeightBox }">
<el-card class="box-card" :class="dataSet.indexOf('_history') == -1 ? 'box-card-new' : ''"
v-for="(item, index) in tableData" :key="index">
<template #header>
<div class="clearfix">
<span style="flex: 1">{{ item.name }}</span>
@@ -149,15 +156,17 @@
</template>
<!-- 模块数据 -->
<div class="box-card-content" v-if="dataSet.indexOf('_history') == -1">
<div v-for="(child, childIndex) in item.children" :key="childIndex">
{{ child.anotherName }}:
{{ child.dataValue === 3.1415926 ? '暂无数据' : child.dataValue }}
</div>
<div class="mt10">
统计时间:{{ item.children.length ? item.children[0].time : '' }}
<div class="box-card-div">
<div v-for="(child, childIndex) in item.children" :key="childIndex">
{{ child.anotherName }}:
{{ child.dataValue === 3.1415926 ? '暂无数据' : child.dataValue }}
</div>
</div>
</div>
<div v-else-if="item.children.length">
<div v-else-if="item.children.length" class="box-card-div">
<div style="display: flex; align-items: center">
<el-tag effect="dark" type="danger" style="width: 40px; text-align: center"
class="mr10">
@@ -170,7 +179,7 @@
: item.children[0].maxValue
}}
</div>
<div style="display: flex; align-items: center" class="mt10">
<div style="display: flex; align-items: center">
<el-tag effect="dark" type="success" style="width: 40px; text-align: center"
class="mr10">
AVG
@@ -182,7 +191,7 @@
: item.children[0].avgValue
}}
</div>
<div style="display: flex; align-items: center" class="mt10">
<div style="display: flex; align-items: center">
<el-tag effect="dark" type="warning" style="width: 40px; text-align: center"
class="mr10">
MIN
@@ -214,8 +223,8 @@
<Trend ref="trendRef"></Trend>
</div>
<!-- 实时数据 -->
<div style="height: calc(100vh - 340px)" v-if="dataSet.indexOf('_realtimedata') != -1"
v-loading="tableLoading">
<div :style="`height: calc(100vh - (${sonTab == 1 ? '378px' : sonTab == 2 ? '340px' : '425px'}))`"
v-if="dataSet.indexOf('_realtimedata') != -1" v-loading="tableLoading">
<!-- <div class="view_top_btn" v-if="realTimeFlag">
<el-button type="primary" :icon="Platform" @click="handleRecordWaves">
实时录波
@@ -295,6 +304,7 @@ const devTypeOptions = ref([])
const devModelOptions = ref([])
const tableData = ref<any[]>([])
const tableHeight = mainHeight(330).height
const tableHeightBox = mainHeight(365).height
const mangePopup = ref()
const datePickerRef = ref()
const formInline = reactive({
@@ -871,7 +881,11 @@ const handleDownLoadTemplate = () => { }
const analysisListRef = ref()
//打开补召日志
const handleAnalysisList = () => {
analysisListRef.value && analysisListRef.value.open()
analysisListRef.value && analysisListRef.value.open({
lineId: lineId.value,
deviceData: deviceData.value,
deviceId: deviceId.value,
})
}
//离线数据导入
const offLineDataImportRef = ref()
@@ -935,8 +949,7 @@ onBeforeUnmount(() => {
box-sizing: border-box;
overflow: auto;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
grid-template-rows: max-content;
grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
grid-gap: 10px;
justify-content: center;
@@ -945,7 +958,7 @@ onBeforeUnmount(() => {
flex-direction: column;
justify-content: space-between;
color: var(--el-color-white);
min-height: 150px;
min-height: 80px;
font-size: 13px;
.el-card__header {
@@ -969,6 +982,8 @@ onBeforeUnmount(() => {
background-image: linear-gradient(var(--el-color-primary), var(--el-color-primary-light-3));
.box-card-content {
height: 100%;
display: flex;
flex-direction: column;
@@ -976,8 +991,27 @@ onBeforeUnmount(() => {
}
}
}
}
}
.box-card-div {
display: grid;
// grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
}
}
.box-card-new {
min-height: 110px !important;
.el-card__body {
overflow-y: auto;
}
}
.view_top_btn {

View File

@@ -7,25 +7,18 @@
<el-button :loading="loading" style="margin-left: 10px" type="primary" @click="submitUpload">
上传离线数据
</el-button>
<el-button
type="primary"
@click="handleUpload"
:loading="loading"
:disabled="offLineFileList.length == 0 || disableHandleUpload"
>
<el-button type="primary" @click="handleUpload" :loading="loading"
:disabled="offLineFileList.length == 0 || disableHandleUpload">
开始上传
</el-button>
<el-button
type="primary"
@click="removeAllFile"
:loading="loading"
:disabled="offLineFileList.length == 0"
>
清空文件
<el-button type="primary" @click="removeAllFile" :loading="loading"
:disabled="offLineFileList.length == 0">
重置上传文件
</el-button>
</div>
<div :style="tableHeight">
<vxe-table border auto-resize height="auto" :data="offLineFileList" v-bind="defaultAttribute" :key="updateKey">
<vxe-table border auto-resize height="auto" :data="offLineFileList" v-bind="defaultAttribute"
:key="updateKey">
<vxe-column field="name" align="center" title="文件名"></vxe-column>
<vxe-column field="webkitRelativePath" align="center" title="文件地址"></vxe-column>
<vxe-column field="status" align="center" title="状态" width="250">
@@ -132,6 +125,13 @@ const handleUpload = () => {
loading.value = false
disableHandleUpload.value = true
}
}).catch(()=>{
loading.value = false
disableHandleUpload.value = false
offLineFileList.value.map((item: any) => {
item.status = 0
})
updateKey.value += 1
})
}
const deviceId: any = ref()
@@ -150,6 +150,7 @@ defineExpose({ open })
<style lang="scss" scoped>
.offline_data {
width: 100%;
.offline_data_btn {
width: 100%;
height: 60px;

View File

@@ -33,8 +33,13 @@
<vxe-column field="name" title="名称"></vxe-column>
<vxe-column field="status" title="补召进度">
<template #default="{ row }">
<el-progress v-model="row.status" :class="row.status == 100 ? 'progress' : ''" :format="format"
:stroke-width="10" striped :percentage="row.status" :duration="30" striped-flow />
<div class="finish" v-if="row.status == 100">
<SuccessFilled style="width: 16px;" /><span class="ml5">补召完成</span>
</div>
<el-progress v-model="row.status" v-else :class="row.status == 100 ? 'progress' : ''"
:format="format" :stroke-width="10" striped :percentage="row.status" :duration="30"
striped-flow />
</template>
</vxe-column>
@@ -52,6 +57,7 @@ import TableHeader from '@/components/table/header/index.vue'
import { useRouter, useRoute } from 'vue-router'
import { mainHeight } from '@/utils/layout'
import { VxeUI, VxeTableInstance, VxeTableEvents } from 'vxe-table'
import { SuccessFilled } from '@element-plus/icons-vue'
import {
Back,
Setting, Search
@@ -116,7 +122,7 @@ const handleUpDevice = () => {
offlineDataUploadMakeUp(form)
.then((res: any) => {
if (res.code == 'A0000') {
ElMessage.success(res.data)
// ElMessage.success(res.data)
dirList.value.map((item: any) => {
// checkedList.map((vv: any) => {
if (item.name == selectRowCopy.value?.name) {
@@ -257,4 +263,11 @@ defineExpose({ getMakeUpDataList })
}
}
.finish {
display: flex;
justify-content: center;
font-weight: 550;
color: #009688
}
</style>

View File

@@ -1,45 +1,50 @@
<template>
<div class="view" v-loading="loading">
<div class="view_top">
<!-- 左侧仪表盘 -->
<div class="view_top_left">
<div class="left_charts_title">电压有效值(kV)</div>
<div class="left_charts">
<MyEchart :pieInterVal="true" ref="pieChart1" :options="echartsDataV1"></MyEchart>
<el-collapse v-model="activeNames">
<el-collapse-item title="仪表盘" name="1">
<div class="view_top">
<!-- 左侧仪表盘 -->
<div class="view_top_left">
<div class="left_charts_title">电压有效值(kV)</div>
<div class="left_charts">
<MyEchart :pieInterVal="true" ref="pieChart1" :options="echartsDataV1"></MyEchart>
</div>
<div class="left_charts">
<MyEchart :pieInterVal="true" ref="pieChart2" :options="echartsDataV2"></MyEchart>
</div>
<div class="left_charts">
<MyEchart :pieInterVal="true" ref="pieChart3" :options="echartsDataV3"></MyEchart>
</div>
</div>
<div class="view_top_mid">
<div class="mid_charts_title">基波电压/电流幅值(相位)</div>
<div class="mid_charts">
<MyEchart :pieInterVal="true" :options="echartsData1"></MyEchart>
</div>
</div>
<!-- 右侧仪表盘 -->
<div class="view_top_right">
<div class="right_charts_title">电流有效值(A)</div>
<div class="right_charts">
<MyEchart :pieInterVal="true" ref="pieChart4" :options="echartsDataA1"></MyEchart>
</div>
<div class="right_charts">
<MyEchart :pieInterVal="true" ref="pieChart5" :options="echartsDataA2"></MyEchart>
</div>
<div class="right_charts">
<MyEchart :pieInterVal="true" ref="pieChart6" :options="echartsDataA3"></MyEchart>
</div>
</div>
</div>
<div class="left_charts">
<MyEchart :pieInterVal="true" ref="pieChart2" :options="echartsDataV2"></MyEchart>
</div>
<div class="left_charts">
<MyEchart :pieInterVal="true" ref="pieChart3" :options="echartsDataV3"></MyEchart>
</div>
</div>
<div class="view_top_mid">
<div class="mid_charts_title">基波电压/电流幅值(相位)</div>
<div class="mid_charts"><MyEchart :pieInterVal="true" :options="echartsData1"></MyEchart></div>
</div>
<!-- 右侧仪表盘 -->
<div class="view_top_right">
<div class="right_charts_title">电流有效值(A)</div>
<div class="right_charts">
<MyEchart :pieInterVal="true" ref="pieChart4" :options="echartsDataA1"></MyEchart>
</div>
<div class="right_charts">
<MyEchart :pieInterVal="true" ref="pieChart5" :options="echartsDataA2"></MyEchart>
</div>
<div class="right_charts">
<MyEchart :pieInterVal="true" ref="pieChart6" :options="echartsDataA3"></MyEchart>
</div>
</div>
</div>
</el-collapse-item>
</el-collapse>
<div class="view_bot">
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-colgroup align="center" title="电压有效值(kV)">
<vxe-column align="center" field="vRmsA" title="A相"></vxe-column>
<vxe-column align="center" field="vRmsB" title="B相"></vxe-column>
@@ -62,13 +67,8 @@
</vxe-colgroup>
</vxe-table>
<br />
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-column align="center" field="freq" width="140" title="频率(Hz)"></vxe-column>
<vxe-column align="center" field="freqDev" width="120" title="频率偏差(Hz)"></vxe-column>
<vxe-column align="center" width="180" field="vUnbalance" title="电压不平衡度(%)"></vxe-column>
@@ -85,13 +85,8 @@
</vxe-colgroup>
</vxe-table>
<br />
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-colgroup align="center" title="电压偏差(%)">
<vxe-column align="center" field="vDevA" title="A相"></vxe-column>
<vxe-column align="center" field="vDevB" title="B相"></vxe-column>
@@ -115,13 +110,8 @@
</vxe-colgroup>
</vxe-table>
<br />
<vxe-table
border
height=""
:data="realList"
:column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }"
>
<vxe-table border height="" :data="realList" :column-config="{ resizable: true, tooltip: true }"
:tooltip-config="{ enterable: true }">
<vxe-colgroup align="center" title="无功功率(kVar)">
<vxe-column align="center" field="qA" title="A相"></vxe-column>
<vxe-column align="center" field="qB" title="B相"></vxe-column>
@@ -152,6 +142,10 @@
</vxe-colgroup>
</vxe-table>
</div>
</div>
</template>
<script lang="ts" setup>
@@ -159,6 +153,7 @@ import { ref, onMounted } from 'vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { getRealTimeTableList } from '@/api/cs-device-boot/EquipmentDelivery'
const pieChartRef: any = ref()
const activeNames = ref(['1'])
const pieChart1: any = ref()
const pieChart2: any = ref()
const pieChart3: any = ref()
@@ -189,8 +184,8 @@ const initRadioCharts = () => {
tooltip: {
formatter: '{a} <br/>{b} {c}°'
},
toolbox:{
show:false
toolbox: {
show: false
},
legend: {
show: false
@@ -439,8 +434,8 @@ const init = () => {
echartsData.value = {
options: {
tooltip: {},
toolbox:{
show:false
toolbox: {
show: false
},
series: [
{
@@ -552,6 +547,8 @@ const setRealData = (val: any) => {
realList.value = [val]
initRadioCharts()
//新的
echartsDataV1.value.options.series[0].max = realData.value.vRmsA == 0 ? 1 : Math.ceil(realData.value.vRmsA * 1.2)
console.log("🚀 ~ setRealData ~ realData.value.vRmsA:", realData.value.vRmsA)
echartsDataV1.value.options.series[0].data = [
{
name: 'A相',
@@ -559,6 +556,7 @@ const setRealData = (val: any) => {
}
]
pieChart1.value.initChart()
echartsDataV2.value.options.series[0].max = realData.value.vRmsB == 0 ? 1 : Math.ceil(realData.value.vRmsB * 1.2)
echartsDataV2.value.options.series[0].data = [
{
name: 'B相',
@@ -566,6 +564,7 @@ const setRealData = (val: any) => {
}
]
pieChart2.value.initChart()
echartsDataV3.value.options.series[0].max = realData.value.vRmsC == 0 ? 1 : Math.ceil(realData.value.vRmsC * 1.2)
echartsDataV3.value.options.series[0].data = [
{
name: 'C相',
@@ -574,6 +573,7 @@ const setRealData = (val: any) => {
]
pieChart3.value.initChart()
//新的电流有效值
echartsDataA1.value.options.series[0].max = realData.value.iRmsA == 0 ? 1 : Math.ceil(realData.value.iRmsA * 1.2)
echartsDataA1.value.options.series[0].data = [
{
name: 'A相',
@@ -581,6 +581,7 @@ const setRealData = (val: any) => {
}
]
pieChart4.value.initChart()
echartsDataA2.value.options.series[0].max = realData.value.iRmsB == 0 ? 1 : Math.ceil(realData.value.iRmsB * 1.2)
echartsDataA2.value.options.series[0].data = [
{
name: 'B相',
@@ -588,6 +589,7 @@ const setRealData = (val: any) => {
}
]
pieChart5.value.initChart()
echartsDataA3.value.options.series[0].max = realData.value.iRmsC == 0 ? 1 : Math.ceil(realData.value.iRmsC * 1.2)
echartsDataA3.value.options.series[0].data = [
{
name: 'C相',
@@ -609,6 +611,7 @@ onMounted(() => {
box-sizing: border-box;
display: flex;
flex-direction: column;
.view_top {
width: 100%;
height: 340px !important;
@@ -617,6 +620,7 @@ onMounted(() => {
//border: 1px solid #eee;
// padding: 10px;
margin-top: 10px;
.view_top_left,
.view_top_right {
// width: 300px;
@@ -627,6 +631,7 @@ onMounted(() => {
flex-direction: column;
align-items: center;
border: 1px solid #eee;
.left_charts,
.right_charts {
flex: none;
@@ -637,6 +642,7 @@ onMounted(() => {
margin-bottom: 8px;
}
}
.view_top_mid {
// flex: 1;
width: 40%;
@@ -644,6 +650,7 @@ onMounted(() => {
margin: 0 10px;
// padding: 10px;
position: relative;
.mid_charts {
width: 100%;
height: 280px;
@@ -667,13 +674,15 @@ onMounted(() => {
box-sizing: border-box;
}
}
.view_bot {
min-height: 300px;
// min-height: 300px;
margin: 10px 0 0 0;
overflow: auto !important;
flex: 1 !important;
padding-bottom: 200px !important;
// padding-bottom: 200px !important;
box-sizing: border-box !important;
.view_bot_tables {
margin-bottom: 10px;
height: auto;
@@ -681,17 +690,21 @@ onMounted(() => {
}
}
}
.view::-webkit-scrollbar {
display: none;
}
.table_container {
width: 100%;
height: auto;
display: flex;
align-items: center;
justify-content: center;
.table {
flex: 1;
.table_info {
width: 100%;
height: 120px;
@@ -701,6 +714,7 @@ onMounted(() => {
display: flex;
flex-direction: column;
}
.thead {
width: 100%;
height: auto;
@@ -708,6 +722,7 @@ onMounted(() => {
text-align: center;
display: flex;
flex-direction: column;
.thead_top {
width: 100%;
height: 40px;
@@ -717,6 +732,7 @@ onMounted(() => {
font-size: 14px;
font-weight: 800;
}
.thead_bot {
width: 100%;
height: 40px;
@@ -725,16 +741,19 @@ onMounted(() => {
color: #111;
font-size: 14px;
font-weight: 800;
.thead_bot_cell {
flex: 1;
border: 1px solid #eee;
}
}
}
.tbody {
flex: 1;
display: flex;
text-align: center;
.tbody_cell {
flex: 1;
text-align: center;
@@ -743,11 +762,13 @@ onMounted(() => {
border-bottom: 0;
}
}
.tbody:hover {
background: #f4f6f9;
}
}
}
.table_container:hover {
.table {
.tbody {
@@ -755,4 +776,20 @@ onMounted(() => {
}
}
}
:deep(.view_bot) {
.vxe-table--render-default .vxe-body--column:not(.col--ellipsis),
.vxe-table--render-default .vxe-footer--column:not(.col--ellipsis),
.vxe-table--render-default .vxe-header--column:not(.col--ellipsis) {
padding: 5px !important;
}
.vxe-table--body-wrapper{
min-height: 32px !important;
}
}
::v-deep .el-collapse-item__header {
font-size: 16px !important;
font-weight: 800 !important;
}
</style>

View File

@@ -2,8 +2,8 @@
<div>
<!-- 历史趋势数据 -->
<div>
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange" >
<template v-slot:select >
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
<template v-slot:select>
<el-form-item>
<DatePicker ref="datePickerRef"></DatePicker>
</el-form-item>
@@ -206,7 +206,7 @@ const init = async () => {
if (item.phase == null) {
key = item.unit
} else {
key = item.anotherName
key = item.unit
}
if (!acc[key]) {
@@ -216,6 +216,7 @@ const init = async () => {
return acc
}, {})
let result = Object.values(groupedData)
console.log("🚀 ~ .then ~ result:", result)
// console.log("🚀 ~ .then ~ result:", result)
if (chartsList.length > 0) {
unitList = result.map((item: any) => {
@@ -233,7 +234,7 @@ const init = async () => {
top: 5,
right: 70,
width: 400,
width: 550,
height: 50
},
grid: {
@@ -312,13 +313,13 @@ const init = async () => {
series: []
}
}
// console.log("🚀 ~ unitList.forEach ~ unitList:", unitList)
console.log("🚀 ~ unitList.forEach ~ unitList:", unitList)
if (chartsList.length > 0) {
echartsData.value.yAxis = []
let setList = [...new Set(unitList)];
unitList.forEach((item: any, index: any) => {
setList.forEach((item: any, index: any) => {
if (index > 2) {
echartsData.value.grid.right = (index - 1) * 80
}
@@ -603,7 +604,7 @@ const flag = ref(true)
const onIndexChange = (val: any) => {
num.value += 1
flag.value = true
// if (val.length == 0) {
// searchForm.value.index = [indexOptions.value[0].id]

View File

@@ -1,167 +1,86 @@
<template>
<el-dialog
v-model="dialogVisible"
:title="title"
draggable
:style="{ width: popupType == 0 || popupType == 1 ? '500px' : '1100px' }"
>
<el-dialog v-model="dialogVisible" :title="title" draggable
:style="{ width: popupType == 0 || popupType == 1 ? '500px' : '1100px' }">
<!-- 新增方案数据 -->
<el-form
:model="form"
scroll-to-error
label-width="140px"
:rules="rules1"
ref="ruleFormRef1"
class="form-one"
v-if="popupType == 0 || popupType == 1"
>
<el-form :model="form" scroll-to-error label-width="140px" :rules="rules1" ref="ruleFormRef1" class="form-one"
v-if="popupType == 0 || popupType == 1">
<el-form-item label="方案名称:" prop="itemName">
<el-input v-model="form.itemName" placeholder="请输入方案名称" />
<el-input v-model="form.itemName" placeholder="请输入方案名称" />
</el-form-item>
<el-form-item label="方案描述:" prop="describe">
<el-input type="textarea" v-model="form.describe" placeholder="请输入方案描述" />
<el-input type="textarea" v-model="form.describe" placeholder="请输入方案描述" />
</el-form-item>
</el-form>
<!-- 测试项信息&数据绑定页面 -->
<el-tabs type="border-card" v-model="activeName" v-if="popupType != 0 && popupType != 1">
<el-tab-pane label="测试项信息" :name="0" v-if="openType == 'tree'">
<el-form
:model="form1"
ref="ruleFormRef2"
scroll-to-error
class="form-two"
label-width="140px"
:rules="rules2"
>
<el-form :model="form1" ref="ruleFormRef2" scroll-to-error class="form-two" label-width="140px"
:rules="rules2">
<el-form-item label="测试项名称:" prop="itemName">
<el-input v-model="form1.itemName" placeholder="请输入测试项名称" />
</el-form-item>
<el-form-item label="测量间隔:" prop="statisticalInterval">
<el-select
v-model="form1.statisticalInterval"
placeholder="请选择测量间隔"
clearable
style="width: 100%"
>
<el-option
v-for="(item, index) in statisticalIntervalList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
<el-select v-model="form1.statisticalInterval" placeholder="请选择测量间隔" clearable
style="width: 100%">
<el-option v-for="(item, index) in statisticalIntervalList" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="电压等级:" prop="voltageLevel">
<el-select
v-model="form1.voltageLevel"
placeholder="请选择电压等级"
clearable
style="width: 100%"
@change="changeVoltageLevel"
>
<el-option
v-for="(item, index) in voltageLevelList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
<el-select v-model="form1.voltageLevel" placeholder="请选择电压等级" clearable style="width: 100%"
@change="changeVoltageLevel">
<el-option v-for="(item, index) in voltageLevelList" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="接线方式:" prop="volConType">
<el-select
v-model="form1.volConType"
placeholder="请选择接线方式"
clearable
style="width: 100%"
>
<el-option
v-for="(item, index) in volConTypeList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
<el-select v-model="form1.volConType" placeholder="请选择接线方式" clearable style="width: 100%">
<el-option v-for="(item, index) in volConTypeList" :key="index" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="最小短路容量:" prop="capacitySscmin">
<el-input
v-model="form1.capacitySscmin"
oninput="value=value.replace(/[^\-?\d.]/g,'')
<el-input v-model="form1.capacitySscmin" oninput="value=value.replace(/[^\-?\d.]/g,'')
.replace(/^\./g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')"
autocomplete="off"
placeholder="请选择最小短路容量"
>
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')" autocomplete="off" placeholder="请选择最小短路容量">
<template #append>MVA</template>
</el-input>
</el-form-item>
<el-form-item label="用户协议容量:" prop="capacitySi">
<el-input
v-model="form1.capacitySi"
autocomplete="off"
oninput="value=value.replace(/[^\-?\d.]/g,'')
<el-input v-model="form1.capacitySi" autocomplete="off" oninput="value=value.replace(/[^\-?\d.]/g,'')
.replace(/^\./g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')"
placeholder="请输入用户协议容量"
>
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')" placeholder="请输入用户协议容量">
<template #append>MVA</template>
</el-input>
</el-form-item>
<el-form-item label="基准短路容量:" prop="capacitySscb">
<el-input
v-model="form1.capacitySscb"
oninput="value=value.replace(/[^\-?\d.]/g,'')
<el-input v-model="form1.capacitySscb" oninput="value=value.replace(/[^\-?\d.]/g,'')
.replace(/^\./g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')"
placeholder="请输入基准短路容量"
>
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')" placeholder="请输入基准短路容量">
<template #append>MVA</template>
</el-input>
</el-form-item>
<el-form-item label="供电设备容量:" prop="capacitySt">
<el-input
v-model="form1.capacitySt"
oninput="value=value.replace(/[^\-?\d.]/g,'')
<el-input v-model="form1.capacitySt" oninput="value=value.replace(/[^\-?\d.]/g,'')
.replace(/^\./g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')"
placeholder="请输入供电设备容量"
>
.replace('-','$#$').replace(/\-/g,'').replace('$#$','-')" placeholder="请输入供电设备容量">
<template #append>MVA</template>
</el-input>
</el-form-item>
<el-form-item label="PT变比" prop="pt">
<el-input
style="width: 48%"
v-model="form1.pt"
autocomplete="off"
placeholder="请输入PT变比"
oninput="value=value.replace(/[^0-9.]/g,'')"
/>
<el-input
style="width: 48%"
v-model="form1.pt1"
autocomplete="off"
placeholder="请输入PT变比"
oninput="value=value.replace(/[^0-9.]/g,'')"
/>
<el-input style="width: 48%" v-model="form1.pt" autocomplete="off" placeholder="请输入PT变比"
oninput="value=value.replace(/[^0-9.]/g,'')" />
<el-input style="width: 48%" v-model="form1.pt1" autocomplete="off" placeholder="请输入PT变比"
oninput="value=value.replace(/[^0-9.]/g,'')" />
</el-form-item>
<el-form-item label="CT变比" prop="ct">
<el-input
v-model="form1.ct"
style="width: 48%"
autocomplete="off"
oninput="value=value.replace(/[^0-9.]/g,'')"
placeholder="请输入CT变比"
/>
<el-input
v-model="form1.ct1"
style="width: 48%"
autocomplete="off"
oninput="value=value.replace(/[^0-9.]/g,'')"
placeholder="请输入CT变比"
/>
<el-input v-model="form1.ct" style="width: 48%" autocomplete="off"
oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入CT变比" />
<el-input v-model="form1.ct1" style="width: 48%" autocomplete="off"
oninput="value=value.replace(/[^0-9.]/g,'')" placeholder="请输入CT变比" />
</el-form-item>
<el-form-item label="监测位置:" prop="location" style="width: 100%">
<el-input type="textarea" v-model="form1.location" placeholder="请输入监测位置" />
@@ -425,9 +344,9 @@ const unBindList = ref([])
//已绑定数据tree
const bindList = ref([])
//0 新增方案 1 修改方案 2 新增测试项 3 修改测试项 4 设备信息
const open = async (val: any, id: any) => {
const open = async (val: any, id: any, name?: any) => {
popupType.value = val
title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : '修改测试项'
title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : ('修改测试项' + '_' + name)
dialogVisible.value = true
planId.value = id
//新增方案或者测试项数据
@@ -578,11 +497,13 @@ defineExpose({ open, details, detailsType })
display: flex !important;
justify-content: space-between !important;
}
::v-deep .form-two {
.el-select {
width: 100% !important;
}
}
.button_info {
width: 100%;
display: flex;
@@ -599,6 +520,7 @@ defineExpose({ open, details, detailsType })
width: 410px;
border: 1px solid #eee;
padding-right: 10px;
p {
margin: 10px 10px 0 10px;
font-weight: 800;

View File

@@ -1,56 +1,31 @@
<template>
<div>
<div
:style="{ width: menuCollapse ? '40px' : '280px' }"
style="transition: all 0.3s; overflow: hidden; height: 100%"
>
<Icon
v-show="menuCollapse"
@click="onMenuCollapse"
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''"
size="18"
class="fold ml10 mt20 menu-collapse"
style="cursor: pointer"
/>
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
<div :style="{ width: menuCollapse ? '40px' : '280px' }"
style="transition: all 0.3s; overflow: hidden; height: 100%">
<Icon v-show="menuCollapse" @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 mt20 menu-collapse"
style="cursor: pointer" />
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1, display: menuCollapse ? 'none' : '' }">
<div style="display: flex; align-items: center" class="mb10">
<el-input v-model="filterText" placeholder="请输入内容" clearable>
<template #prefix>
<Icon name="el-icon-Search" style="font-size: 16px" />
</template>
</el-input>
<Icon
@click="onMenuCollapse"
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''"
size="18"
class="fold ml10 menu-collapse"
style="cursor: pointer"
/>
<Icon name="el-icon-Plus" size="18"
class="fold ml10 menu-collapse" style="cursor: pointer" @click="onAdd"/>
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
style="cursor: pointer" />
</div>
<el-tree
style="flex: 1; overflow: auto"
:props="defaultProps"
highlight-current
:filter-node-method="filterNode"
node-key="id"
v-bind="$attrs"
default-expand-all
:data="tree"
ref="treRef"
@node-click="clickNode"
:expand-on-click-node="false"
>
<el-tree style="flex: 1; overflow: auto" :props="defaultProps" highlight-current
:filter-node-method="filterNode" node-key="id" v-bind="$attrs" default-expand-all :data="tree"
ref="treRef" @node-click="clickNode" :expand-on-click-node="false">
<template #default="{ node, data }">
<span class="custom-tree-node">
<div class="left">
<Icon
:name="data.icon"
style="font-size: 16px"
:style="{ color: data.color }"
v-if="data.icon"
/>
<Icon :name="data.icon" style="font-size: 16px" :style="{ color: data.color }"
v-if="data.icon" />
<span>{{ node.label }}</span>
</div>
<div class="right">
@@ -59,6 +34,11 @@
<Plus @click.stop="add(node, data)" />
</el-icon>
</a>
<a :style="{ marginRight: '0.5rem' }" v-else>
<el-icon :style="{ color: '#0000FF' }">
<SetUp @click.stop="bind(node, data)" />
</el-icon>
</a>
<a :style="{ marginRight: '0.5rem' }">
<el-icon :style="{ color: '#DA3434' }">
<Delete @click.stop="del(node, data)" />
@@ -85,7 +65,7 @@ import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
import { useConfig } from '@/stores/config'
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree } from 'element-plus'
import { Plus, Edit, Delete } from '@element-plus/icons-vue'
import { Plus, Edit, Delete ,SetUp} from '@element-plus/icons-vue'
import { delRecord } from '@/api/cs-device-boot/planData'
import popup from './popup.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
@@ -140,6 +120,16 @@ const chooseNode = (value: string, data: any, node: any) => {
// 没匹配到返回false
return false
}
// 新增方案
const onAdd = () => {
emit('onAdd')
}
// 绑定数据
const bind = (node: any, data: any) => {
console.log("🚀 ~ bind ~ data:", data)
emit('bind',data)
}
/** 树形结构数据 */
const defaultProps = {
children: 'children',
@@ -157,7 +147,7 @@ const props = withDefaults(
}
)
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart'])
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart','onAdd','bind'])
const config = useConfig()
const tree = ref()
const treRef = ref()
@@ -237,7 +227,7 @@ const edit = async (node: Node, data: any) => {
handleOpen(3, planId.value)
}
})
.catch(e => {})
.catch(e => { })
}
/** 删除树节点 */
const del = (node: Node, data: any) => {
@@ -252,7 +242,7 @@ const del = (node: Node, data: any) => {
delRecord({ id: data.id }).then((res: any) => {
if (res.code == 'A0000') {
ElMessage.success('删除成功')
id.value=null
id.value = null
getTreeList()
}
})
@@ -265,7 +255,7 @@ const del = (node: Node, data: any) => {
})
}
//取消删除
const cancelDel = () => {}
const cancelDel = () => { }
const clickNode = (e: anyObj) => {
e?.children ? (planId.value = e.id) : (planId.value = e.pid)
id.value = e.id

View File

@@ -1,12 +1,13 @@
<template>
<div class="default-main device-manage" :style="{ height: pageHeight.height }">
<!-- @node-change="nodeClick" -->
<schemeTree @node-change="nodeClick" @node-click="nodeClick" @init="nodeClick" ref="schemeTreeRef"></schemeTree>
<schemeTree @node-change="nodeClick" @node-click="nodeClick" @init="nodeClick" @onAdd="onAdd" @bind="bind"
ref="schemeTreeRef"></schemeTree>
<div class="device-manage-right" v-if="deviceData">
<el-descriptions title="方案信息" :column="2" border>
<template #extra>
<!-- <template #extra>
<el-button type="primary" icon="el-icon-Plus" @click="handleOpen(0)">新增方案</el-button>
</template>
</template> -->
<el-descriptions-item label="方案名称" width="60">
{{ deviceData.itemName }}
</el-descriptions-item>
@@ -83,11 +84,11 @@
<el-descriptions-item label="监测位置" width="160">
{{ item.location }}
</el-descriptions-item>
<el-descriptions-item label="操作" width="160">
<!-- <el-descriptions-item label="操作" width="160">
<el-button type="primary" icon="el-icon-Tools" @click="handleOpen(3)">
数据绑定
</el-button>
</el-descriptions-item>
</el-descriptions-item> -->
</el-descriptions>
</el-tab-pane>
</el-tabs>
@@ -128,7 +129,7 @@
<el-form-item for="-" v-for="(item, index) in countData" :key="index"
:label="item.name.includes('次数') ? item.name : item.name.includes('幅值') ? item.name.slice(0, -2) + '次数' : item.name + '谐波次数'"
v-show="item.countOptions.length != 0">
<el-select v-model="item.count" collapse-tags collapse-tags-tooltip
placeholder="请选择谐波次数" style="width: 120px">
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv"
@@ -171,7 +172,7 @@ import MyEchart from '@/components/echarts/MyEchart.vue'
import { getTestRecordInfo, getHistoryTrend } from '@/api/cs-device-boot/planData'
import { useDictData } from '@/stores/dictData'
import { queryStatistical } from '@/api/system-boot/csstatisticalset'
import { TrendCharts, Plus, Platform } from '@element-plus/icons-vue'
import { TrendCharts, Plus, Platform, } from '@element-plus/icons-vue'
import { yMethod } from '@/utils/echartMethod'
import { color, gradeColor3 } from '@/components/echarts/color'
import TableHeader from '@/components/table/header/index.vue'
@@ -190,7 +191,7 @@ const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
const volConTypeList = dictData.getBasicData('Dev_Connect')
//值类型
const pageHeight = mainHeight(20)
const EcharHeight = ref(mainHeight(468))
const EcharHeight = ref(mainHeight(448))
const loading = ref(false)
const searchForm: any = ref({})
const typeOptions = [
@@ -309,7 +310,13 @@ const onIndexChange = (val: any) => {
}
const dialogRef = ref()
const dailogForm = ref()
const handleOpen = (val: any) => {
const onAdd = () => {
handleOpen(0)
}
const bind = (data: any) => {
handleOpen(3, data)
}
const handleOpen = (val: any, data?: any) => {
if (!deviceData.value) {
dialogRef.value.open(val, '')
return
@@ -321,18 +328,21 @@ const handleOpen = (val: any) => {
})
dialogRef.value.details(dailogForm.value)
// deviceData.value.records[0].id
let ids = ''
let ids: any = ''
let name: any = ''
//数据绑定
if (val == 3) {
ids = deviceData.value.records.find((item: any) => {
return item.id == activeName.value
})?.id
ids = data?.id
name = data?.name
dialogRef.value.detailsType('table')
} else {
ids = ''
name = ''
dialogRef.value.detailsType('')
}
dialogRef.value.open(val, ids)
dialogRef.value.open(val, ids, name)
}
const echartsData = ref<any>(null)
//加载echarts图表
@@ -446,7 +456,7 @@ const init = (flag: boolean) => {
if (item.phase == null) {
key = item.unit
} else {
key = item.anotherName
key = item.unit
}
if (!acc[key]) {
acc[key] = []
@@ -494,7 +504,7 @@ const init = (flag: boolean) => {
// orient: 'vertical', // 垂直排列
top: 5,
right: 70,
width: 400,
width: 550,
height: 50
},
grid: {
@@ -547,7 +557,8 @@ const init = (flag: boolean) => {
}
if (chartsList.length > 0) {
echartsData.value.yAxis = []
unitList.forEach((item: any, index: any) => {
let setList = [...new Set(unitList)];
setList.forEach((item: any, index: any) => {
if (index > 2) {
echartsData.value.grid.right = (index - 1) * 80
}
@@ -808,35 +819,35 @@ const formatCountOptions = (list: any) => {
const flag = ref(false)
const selectChange = (e: boolean) => {
flag.value = e
console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
if (activeColName.value == '0') {
if (flag.value) {
EcharHeight.value = mainHeight(512)
EcharHeight.value = mainHeight(492)
} else {
EcharHeight.value = mainHeight(468)
EcharHeight.value = mainHeight(448)
}
} else {
if (flag.value) {
EcharHeight.value = mainHeight(342)
EcharHeight.value = mainHeight(322)
} else {
EcharHeight.value = mainHeight(290)
EcharHeight.value = mainHeight(280)
}
}
}
const handleChange = () => {
console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
if (activeColName.value == '0') {
if (flag.value) {
EcharHeight.value = mainHeight(512)
EcharHeight.value = mainHeight(492)
} else {
EcharHeight.value = mainHeight(468)
EcharHeight.value = mainHeight(448)
}
} else {
if (flag.value) {
EcharHeight.value = mainHeight(342)
EcharHeight.value = mainHeight(322)
} else {
EcharHeight.value = mainHeight(290)
EcharHeight.value = mainHeight(280)
}
}
}

View File

@@ -114,9 +114,9 @@
</el-select>
</el-form-item>
<el-form-item label="合同号:" prop="cntractNo" class="top">
<!-- <el-form-item label="合同号:" prop="cntractNo" class="top">
<el-input v-model="form.cntractNo" autocomplete="off" placeholder="请输入"></el-input>
</el-form-item>
</el-form-item> -->
</el-form>
<template #footer>
<el-button @click="resetForm"> </el-button>

View File

@@ -0,0 +1,138 @@
<template>
<div class="default-main" :style="height">
<splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
<pane :size="size">
<pointTreeWx :default-expand-all="false" template @node-click="handleNodeClick" @init="handleNodeClick"
@Policy="stencil">
</pointTreeWx>
</pane>
<pane style="background: #fff" :style="height">
<TableHeader ref="TableHeaderRef" >
<template v-slot:select>
<el-form-item label="模板1策略">
<el-select v-model="Template" @change="changetype" placeholder="请选择模版" value-key="id">
<el-option v-for="item in templatePolicy" :key="item.id" :label="item.name"
:value="item"></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">导出excel</el-button>
</template>
</TableHeader>
<div class="box">
<div id="luckysheet" v-loading="tableStore.table.loading"
:style="`height: calc(${tableStore.table.height} + 45px)`"></div>
</div>
</pane>
</splitpanes>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import pointTreeWx from '@/components/tree/govern/pointTreeWx.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout'
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
import { exportExcel } from '@/views/system/reportForms/export.js'
import 'splitpanes/dist/splitpanes.css'
import { Splitpanes, Pane } from 'splitpanes'
// import data from './123.json'
defineOptions({
name: 'govern/reportCore/statisticsWx/index'
})
const height = mainHeight(20)
const size = ref(0)
const dictData = useDictData()
const TableHeaderRef = ref()
const dotList: any = ref({})
const Template: any = ref({})
const reportForm: any = ref('')
const templatePolicy: any = ref([])
const tableStore = new TableStore({
url: '/harmonic-boot/customReport/getCustomReport',
method: 'POST',
column: [],
beforeSearchFun: () => {
tableStore.table.params.tempId = Template.value.id
tableStore.table.params.lineId = dotList.value.id
},
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.data1 ? (item.data = JSON.parse(item.data1)) : ''
item.celldata.forEach((k: any) => {
item.data[k.r][k.c].v ? (item.data[k.r][k.c] = k.v ) : ''
})
})
console.log(tableStore.table.data)
setTimeout(() => {
luckysheet.create({
container: 'luckysheet',
title: '', // 表 头名
lang: 'zh', // 中文
showtoolbar: false, // 是否显示工具栏
showinfobar: false, // 是否显示顶部信息栏
showsheetbar: true, // 是否显示底部sheet按钮
data: tableStore.table.data
// tableStore.table.data
})
}, 10)
}
})
provide('tableStore', tableStore)
tableStore.table.params.resourceType = 1
tableStore.table.params.customType = 1
const flag = ref(true)
onMounted(() => {
const dom = document.getElementById('navigation-splitpanes')
if (dom) {
size.value = Math.round((180 / dom.offsetHeight) * 100)
}
})
// getTemplateByDept({ id: dictData.state.area[0].id }).then((res: any) => {
// templatePolicy.value = res.data
// })
const stencil = (val: any) => {
console.log("🚀 ~ Policy ~ val:", val)
templatePolicy.value = val
Template.value = val[0]
reportForm.value = val[0]?.reportForm
}
const changetype = (val: any) => {
reportForm.value = val.reportForm
}
const handleNodeClick = (data: any, node: any) => {
console.log("🚀 ~ handleNodeClick ~ data:", data)
if (data?.pid ) {
dotList.value = data
setTimeout(() => {
tableStore.index()
}, 500)
}
}
const exportEvent = () => {
exportExcel(luckysheet.getAllSheets(), '统计报表下载')
}
</script>
<style lang="scss">
.splitpanes.default-theme .splitpanes__pane {
background: #fff;
}
.box {
padding: 10px;
}
</style>