修改测试bug

This commit is contained in:
GGJ
2024-12-09 16:30:40 +08:00
parent 2ed728ee71
commit 22d85dfca1
30 changed files with 499 additions and 221 deletions

View File

@@ -27,7 +27,7 @@ export const adminBaseRoute = {
},
{
// 设备补召
// 在线补召
path: '/supplementaryRecruitment',
name: 'supplementaryRecruitment',
component: () => import('@/views/govern/device/control/supplementaryRecruitment.vue'),

View File

@@ -29,7 +29,7 @@
<el-row>
<el-col :span="12">
<div v-if="view2" style="display: flex">
<span style="font-size: 14px; line-height: 30px">值类型选择:</span>
<span style="font-size: 14px; line-height: 30px">值类型选择</span>
<el-select @change="changeView" style="width: 240px" v-model="value" placeholder="请选择值类型">
<el-option
v-for="item in options"

View File

@@ -15,7 +15,7 @@
</el-dialog>
<popup ref="detailRef"></popup>
<!-- 离线数据导入组件 -->
<offLineDataImport ref="offLineDataImportRef"></offLineDataImport>
<!-- <offLineDataImport ref="offLineDataImportRef"></offLineDataImport> -->
</template>
<script lang="ts" setup>
import { ref, onMounted, provide, onBeforeUnmount } from 'vue'
@@ -25,6 +25,9 @@ import TableHeader from '@/components/table/header/index.vue'
import offLineDataImport from '../offLineDataImport/index.vue'
import popup from './popup.vue'
import { useRouter } from 'vue-router'
defineOptions({
name: 'offLineDataImport'
})
const emit = defineEmits(['back'])
const dialogVisible = ref(false)
const height = ref(0)
@@ -40,7 +43,11 @@ const tableStore: any = new TableStore({
method: 'POST',
column: [
// { width: '60', type: 'checkbox', fixed: 'left' },
{ title: '序号', type: 'seq', width: 80 },
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'projectName',
title: '工程名称',
@@ -133,15 +140,26 @@ const handleaddDevice = () => {
push({
path: '/supplementaryRecruitment',
query: {
activeName: '0',
id: lineId.value,
ndid: deviceData.value?.ndid
ndid: deviceData.value?.ndid,
}
})
}
const offLineDataImportRef = ref()
const handleImport = () => {
//设备devId&监测点lineId带入组件
offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
// offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
push({
path: '/supplementaryRecruitment',
query: {
activeName: '1',
lineId: lineId.value,
deviceId: deviceId.value,
}
})
}
onMounted(() => {

View File

@@ -36,7 +36,9 @@ const tableStore: any = new TableStore({
showPage: false,
column: [
{ width: '60', type: 'checkbox', fixed: 'left' },
{ title: '序号', type: 'seq', width: 80 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'name', title: '文件名称', minWidth: 170 },
{ field: 'createTime', title: '导入时间', minWidth: 170 },
{ field: 'allCount', title: '数据总数(条)', minWidth: 170 },

View File

@@ -12,7 +12,7 @@
</el-select>
</el-form-item>
<el-form-item label="数据类型" label-width="80px">
<el-select v-model="form.statMethod" placeholder="请选择类型">
<el-select v-model="form.statMethod" placeholder="请选择数据类型">
<el-option v-for="item in typeOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>

View File

@@ -4,7 +4,7 @@
<!-- @init="nodeClick" -->
<PointTree @node-click="nodeClick" @pointTypeChange="pointTypeChange"></PointTree>
<div class="device-control-right" v-if="deviceData">
<el-descriptions title="设备基本信息" class="mb10" :column="3" border>
<el-descriptions title="监测点信息" class="mb10" :column="3" border>
<template #extra>
<!-- <el-button v-if="deviceType == '1'" type="primary" @click="handleDownLoadTemplate">
模版下载
@@ -90,26 +90,34 @@
</el-select>
</el-form-item>
<el-form-item label="值类型" v-if="!dataSet.includes('_items')">
<el-select style="min-width: 120px !important" v-model="formInline.dataLevel"
<el-form-item v-if="!dataSet.includes('_items')">
<!-- <el-select style="min-width: 120px !important" v-model="formInline.dataLevel"
:disabled="dataLevel == 'Primary' && deviceType == '0'">
<el-option value="Primary" label="一次值"></el-option>
<el-option value="Secondary" label="二次值"></el-option>
</el-select>
</el-form-item>
<el-form-item label="筛选" v-if="!dataSet.includes('_')">
<el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable
@input="handleSearch" placeholder="请输入关键词"></el-input>
</el-select> -->
<el-radio-group v-model="formInline.dataLevel" @change="handleClick">
<el-radio-button label="一次值" value="Primary" />
<el-radio-button label="二次值" value="Secondary" />
</el-radio-group>
</el-form-item>
<el-form-item label="谐波次数" v-show="oddAndEvenFlag && !dataSet.includes('_')">
<el-select v-model="oddAndEven" style="min-width: 120px !important">
<el-option v-for="item in oddAndEvenList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="关键字" v-if="!dataSet.includes('_')">
<el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable
@input="handleSearch" placeholder="请输入关键词"></el-input>
</el-form-item>
</template>
<template #operation>
<el-button type="primary" icon="el-icon-Search" @click="handleClick">查询</el-button>
<el-button type="primary"
:icon="dataSet.indexOf('_realtimedata') != -1 ? 'el-icon-Refresh' : 'el-icon-Search'"
@click="handleClick">{{ dataSet.indexOf('_realtimedata') != -1 ? '刷新' : '查询' }}</el-button>
<el-button type="primary" :disabled="tableLoading" v-if="realTimeFlag" :icon="DataLine"
@click="handleTrend">
谐波频谱
@@ -146,17 +154,19 @@
></div> -->
<!-- v-loading="tableLoading" -->
<div :style="{ height: tableHeight }" v-loading="tableLoading" v-if="!dataSet.includes('_')">
<div style="overflow: auto" :style="{ height: tableHeight }" v-loading="tableLoading" v-if="
<div style="overflow: auto" :style="{ height: tableHeight }" 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">
<div class="mb5 mt5" v-if="dataSet.indexOf('_history') == -1"
style="font-weight: 800;font-size: 16px;text-align: center">
统计时间:{{ tableData[0]?.time || '' }}
</div>
<nearRealTimeData ref="nearRealTimeDataRef" v-if="dataSet.indexOf('_history') == -1" />
<nearRealTimeData ref="nearRealTimeDataRef" v-if="dataSet.indexOf('_history') == -1"
:style="{ height: tableHeightBox, overflow: 'auto' }" />
<!-- 循环渲染的card 最新数据/历史数据显示 -->
@@ -346,7 +356,7 @@
<el-empty v-else description="请选择设备" class="device-control-right" />
<Detail ref="detailRef" :detail="detail" @close="detail = null" :dataLevel="dataLevel" v-if="detail"></Detail>
<!-- 离线数据导入组件 -->
<offLineDataImport ref="offLineDataImportRef"></offLineDataImport>
<!-- <offLineDataImport ref="offLineDataImportRef"></offLineDataImport> -->
<!-- 补召日志 -->
<analysisList ref="analysisListRef"></analysisList>
</div>
@@ -399,7 +409,7 @@ const devTypeOptions = ref([])
const devModelOptions = ref([])
const tableData = ref<any[]>([])
const tableHeight = mainHeight(290).height
const tableHeightBox = mainHeight(310).height
const tableHeightBox = mainHeight(330).height
const searchValue = ref('')
const TrendList = ref({})
const oddAndEven = ref('1')
@@ -631,7 +641,8 @@ const deviceId: any = ref('')
const lineId: any = ref('')
const dataLevel: any = ref('')
const nodeClick = async (e: anyObj) => {
console.log("🚀 ~ nodeClick ~ e:", e)
// console.log("🚀 ~ nodeClick ~ e:", e)
if (e.level == 2) return
searchValue.value = ''
await queryDictType({
lineId: e?.id,
@@ -642,7 +653,7 @@ const nodeClick = async (e: anyObj) => {
formInline.targetType = res.data[0].id
})
if (e.level == 2) return
deviceId.value = e?.pid
lineId.value = e?.id
TrendList.value = e
@@ -915,6 +926,10 @@ const getRealDataMqttMsg = async () => {
ElMessage.success('装置应答失败')
tableLoading.value = false
}
}).catch(e => {
setTimeout(() => {
tableLoading.value = false
}, 0)
})
}
//tab点击事件
@@ -1040,7 +1055,7 @@ const handleClick = async (tab?: any) => {
tableLoading.value = false
}, 1500)
})
},100)
}, 100)
}

View File

@@ -1,18 +1,21 @@
<template>
<div>
<vxe-table auto-resize :data="dataList" v-bind="defaultAttribute" :key="key" :mergeCells="mergeCells" v-if="flag">
<vxe-table auto-resize :data="dataList" v-bind="defaultAttribute" :key="key" :mergeCells="mergeCells"
v-if="flag">
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
:width="item.width"></vxe-column>
</vxe-table>
<vxe-table v-if="flag1" auto-resize :data="dataList1"
v-bind="defaultAttribute" :key="key" :mergeCells="mergeCells">
<vxe-column field="otherName" title="名称" width="350"></vxe-column>
<vxe-column field="valueM" title="数据"></vxe-column>
<vxe-table v-if="flag1" auto-resize :data="dataList1" v-bind="defaultAttribute" :key="key"
:mergeCells="mergeCells">
<vxe-column field="otherName" title="名称"></vxe-column>
<vxe-column field="valueM" title="数据" :formatter="formatter"></vxe-column>
<vxe-column field="otherName1" title="名称"></vxe-column>
<vxe-column field="valueM1" title="数据" :formatter="formatter"></vxe-column>
</vxe-table>
<el-empty :style="height" description="暂无数据"v-if="!flag && !flag1" ></el-empty>
<el-empty :style="height" description="暂无数据" v-if="!flag && !flag1"></el-empty>
</div>
</template>
@@ -28,8 +31,8 @@ const key: any = ref(0)
const column: any = ref([])
const dataList1: any = ref([])
const targetName: any = ref('')
const flag=ref(true)
const flag1=ref(true)
const flag = ref(true)
const flag1 = ref(true)
const mergeCells: any = ref<VxeTablePropTypes.MergeCells>([
// { row: 0, col: 1, rowspan: 1, colspan: 3 },
@@ -37,30 +40,41 @@ const mergeCells: any = ref<VxeTablePropTypes.MergeCells>([
])
const setData = (data: any, targetType: any) => {
let list = JSON.parse(JSON.stringify(data))
dataList1.value = []
// dataList1.value = []
let list1: any = []
dataList.value = []
flag.value=true
flag1.value=true
flag.value = true
flag1.value = true
targetName.value = targetType[0].name
if (targetType[0].name == '基本数据') {
flag.value=false
flag1.value=false
flag.value = false
flag1.value = false
list.forEach((item: any, index: number) => {
if (item.valueA == null && item.valueB == null && item.valueC == null) {
// item.valueA = item.valueM
// mergeCells.value.push({ row: index, col: 1, rowspan: 1, colspan: 3 })
dataList1.value.push(item)
flag1.value=true
list1.push(item)
flag1.value = true
} else {
dataList.value.push(item)
flag.value=true
flag.value = true
}
})
if (list1.length > 0) {
list1.forEach((item: any, index: number) => {
if (index % 2 == 0) {
dataList1.value.push(item)
} else {
dataList1.value[dataList1.value.length - 1].otherName1 = item.otherName
dataList1.value[dataList1.value.length - 1].valueM1 = item.valueM
}
})
}
column.value = [
{ field: 'otherName', title: '名称', width: 350 },
{ field: 'otherName', title: '名称', },
{ field: 'valueA', title: 'A相', },
{ field: 'valueB', title: 'B相', },
{ field: 'valueC', title: 'C相', },
@@ -68,9 +82,9 @@ const setData = (data: any, targetType: any) => {
]
} else {
dataList.value = list
flag.value=true
flag.value = true
flag1.value=false
flag1.value = false
column.value = [
{ field: 'otherName', title: '谐波次数', },
{ field: 'valueA', title: 'A相', },
@@ -81,7 +95,19 @@ const setData = (data: any, targetType: any) => {
key.value += 1
}
const formatter = (row: any) => {
return row.cellValue == null ? '/' : row.cellValue
if (row.column.property == 'valueM1') {
if (row.row.otherName1 == null) {
row.cellValue == ''
} else {
return row.cellValue == null ? '/' : row.cellValue == 3.14159 ? '/' : row.cellValue
}
} else {
return row.cellValue == null ? '/' : row.cellValue == 3.14159 ? '/' : row.cellValue
}
}
defineExpose({ setData })

View File

@@ -1,9 +1,9 @@
<!-- 离线数据导入 -->
<template>
<el-dialog v-model="dialogVisible" title="文件列表" width="70%" :destroy-on-close="true" draggable @closed="close">
<!-- <el-dialog v-model="dialogVisible" title="文件列表" width="70%" :destroy-on-close="true" draggable @closed="close"> -->
<!-- 上传文件列表 -->
<div class="offline_data">
<div class="offline_data_btn">
<div class=" ">
<!-- <div class="offline_data_btn">
<el-button :loading="loading" style="margin-left: 10px" type="primary" @click="submitUpload">
上传离线数据
</el-button>
@@ -12,13 +12,36 @@
:disabled="offLineFileList.length == 0">
重置上传文件
</el-button>
</div>
<el-button type="primary" @click="handleUpload" :loading="loading"
:disabled="offLineFileList.length == 0 || disableHandleUpload">
开始上传
</el-button>
</div> -->
<TableHeader ref="refheader" :showSearch="false">
<template #operation>
<el-button :loading="loading" style="margin-left: 10px" type="primary" @click="submitUpload">
上传离线数据
</el-button>
<el-button type="primary" @click="removeAllFile" :loading="loading"
:disabled="offLineFileList.length == 0">
重置上传文件
</el-button>
<el-button type="primary" @click="handleUpload" :loading="loading"
:disabled="offLineFileList.length == 0 || disableHandleUpload">
开始上传
</el-button>
<el-button :icon="Back" @click="go(-1)">返回</el-button>
</template>
</TableHeader>
<div :style="tableHeight">
<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">
<vxe-column field="status" align="center" title="状态" width="300">
<template v-slot:default="scoped">
<el-progress v-if="scoped.row.status == 0" :percentage="0">
<el-button text>等待上传</el-button>
@@ -39,28 +62,32 @@
</vxe-table>
</div>
</div>
<template #footer>
<!-- <template #footer>
<div class="dialog-footer">
<!-- <el-button @click="close">取消</el-button> -->
<!-- <el-button type="primary" @click="close">确定</el-button> -->
<el-button type="primary" @click="handleUpload" :loading="loading"
:disabled="offLineFileList.length == 0 || disableHandleUpload">
开始上传
</el-button>
</div>
</template>
</el-dialog>
</template> -->
<!-- </el-dialog> -->
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import TableHeader from '@/components/table/header/index.vue'
import { uploadOffLineDataFile } from '@/api/cs-device-boot/EquipmentDelivery.ts'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import {Back} from '@element-plus/icons-vue'
import { mainHeight } from '@/utils/layout'
import { useRouter, useRoute } from 'vue-router'
const { go } = useRouter() // 路由
const routes = useRoute()
const dialogVisible = ref(false)
const loading = ref(false)
const offLineFileList: any = ref([])
const disableHandleUpload = ref(true)
const tableHeight = mainHeight(550)
const tableHeight = mainHeight(85)
//上传离线数据
const submitUpload = (e: any) => {
const input = document.createElement('input')
@@ -102,8 +129,8 @@ const updateKey = ref(0)
const handleUpload = () => {
loading.value = true
const subForm = new FormData()
subForm.append('devId', deviceId.value)
subForm.append('lineId', lineId.value)
subForm.append('devId', routes.query.deviceId)
subForm.append('lineId', routes.query.lineId)
let webkitRelativePathList: any = []
offLineFileList.value.map((item: any, index: any) => {
subForm.append(`files[${index}]`, item)
@@ -126,7 +153,7 @@ const handleUpload = () => {
loading.value = false
disableHandleUpload.value = true
}
}).catch(()=>{
}).catch(() => {
loading.value = false
disableHandleUpload.value = false
offLineFileList.value.map((item: any) => {
@@ -135,13 +162,13 @@ const handleUpload = () => {
updateKey.value += 1
})
}
const deviceId: any = ref()
const lineId: any = ref()
const open = (devId: any, lineIds: any) => {
deviceId.value = devId
lineId.value = lineIds
dialogVisible.value = true
}
// const deviceId: any = ref()
// const lineId: any = ref()
// const open = (devId: any, lineIds: any) => {
// deviceId.value = devId
// lineId.value = lineIds
// dialogVisible.value = true
// }
const close = () => {
offLineFileList.value = []
dialogVisible.value = false
@@ -160,4 +187,7 @@ defineExpose({ open })
justify-content: flex-end;
}
}
</style>
// .device {
// height: calc(100vh - 130px);
// }</style>

View File

@@ -1,23 +1,29 @@
<template>
<div class="default-main device">
<currentDevice ref="currentDeviceRef" />
<currentDevice ref="currentDeviceRef" v-if="activeName == '0'" />
<offLineDataImport ref="currentDeviceRef" v-else-if="activeName == '1'" />
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, watch, nextTick } from 'vue'
import currentDevice from './supplementaryRecruitment/currentDevice.vue'
import offLineDataImport from '@/views/govern/device/control/offLineDataImport/index.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const activeName = ref('0')
const activeName = ref('')
const currentDeviceRef = ref()
watch(
() => activeName.value,
(val, oldVal) => {
if (val == '0') {
// if (val == '0') {
// nextTick(() => {
// currentDeviceRef.value && currentDeviceRef.value.getMakeUpDataList(route.query)
// })
// } else if (val == '1') {
nextTick(() => {
currentDeviceRef.value && currentDeviceRef.value.getMakeUpDataList(route.query)
})
}
// }
},
{
immediate: true,
@@ -25,8 +31,9 @@ watch(
}
)
onMounted(() => {
console.log()
currentDeviceRef.value && currentDeviceRef.value.getMakeUpDataList(route.query)
activeName.value = route.query.activeName
// currentDeviceRef.value && currentDeviceRef.value.getMakeUpDataList(route.query)
})
</script>
<style lang="scss" scoped>

View File

@@ -19,7 +19,7 @@
</TableHeader>
<!-- 设备补召 -->
<div class="default-main current_device" v-loading="loading">
<div class=" current_device" v-loading="loading">
<div class="current_body" ref="tbodyRef">
<vxe-table border ref="tableRef" :data="dirList" align="center" height="auto"
@@ -95,7 +95,7 @@ const getMakeUpDataList = (row: any) => {
// 进入文件夹
const dirCheckedList: any = ref([])
const tbodyRef = ref()
const tableHeight = mainHeight(105).height
const tableHeight = mainHeight(85).height
const routes = useRoute()
const tableRef = ref()
const selectRowCopy: any = ref(null)

View File

@@ -216,7 +216,9 @@ const tableStore = new TableStore({
url: '/cs-device-boot/EquipmentDelivery/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq',width:60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '设备名称', field: 'name' },
{
title: '设备类型',

View File

@@ -3,7 +3,7 @@
<div class="realtrend" v-loading="loading">
<div class="select" v-if="!loading">
<div class="mr10">谐波次数 </div>
<el-select v-model="selectValue" style="width: 100px">
<el-select v-model="selectValue" style="width: 100px" @change="selectChange">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
@@ -29,16 +29,17 @@
</div> -->
<div class="realtrend_table" v-if="Object.keys(tableData).length != 0">
<div class="thead_left">
<p>次数</p>
<p style=" font-weight: 700; background-color: #F3F6F9;">次数()</p>
<p>{{ item.groupName }}{{ item.unit ? '(' + item.unit + ')' : '' }}</p>
<p>国标限值{{ item.unit ? '(' + item.unit + ')' : '' }}</p>
</div>
<div class="thead_right">
<div class="right_cell" v-for="(value, key, index) in tableData" :key="index">
<p v-if="item.groupName.includes('间谐波')">
{{ Number(String(key).replace('data', ' ')) - 0.5 }}
<p v-if="item.groupName.includes('间谐波')" style="background-color: #F3F6F9;">
{{ Number(String(key).replace('data', ' ')) - 0.5 }}
</p>
<p v-else>
<span>{{ String(key).replace('data', ' ') }}</span>
<p v-else style="background-color: #F3F6F9;">
<span>{{ String(key).replace('data', ' ') }}</span>
</p>
<p>
<span v-if="
@@ -49,8 +50,20 @@
{{ value }}
</span>
</p>
<p>
<span v-if="
String(key).includes('data') &&
String(key) != 'dataLevel' &&
String(key) != 'dataTime'
">
{{ gbData[index]?.value || '/' }}
</span>
</p>
</div>
</div>
</div>
</div>
<div class="tab_info" v-if="Object.keys(tableData).length != 0">
@@ -157,7 +170,7 @@ const chartsYxiasData: any = ref([])
const echartsData: any = ref()
const barCharts = ref()
const gbData = ref([])
//加载echarts
const init = () => {
let trendData: any = []
@@ -168,17 +181,17 @@ const init = () => {
count: String(key).replace('data', '')
})
}
let gbData: any = []
gbData.value = []
for (let key in limitData.value) {
gbData.push({
gbData.value.push({
name: key,
value: limitData.value[key]
})
}
if (selectValue.value == '1') {
gbData = gbData.filter((_, index: number) => index % 2 !== 0)
gbData.value = gbData.value.filter((_, index: number) => index % 2 !== 0)
} else if (selectValue.value == '2') {
gbData = gbData.filter((_, index: number) => index % 2 == 0)
gbData.value = gbData.value.filter((_, index: number) => index % 2 == 0)
}
let xAxisList: any = []
chartsData.value.map((item: any, index: any) => {
@@ -207,14 +220,15 @@ const init = () => {
series: []
}
let list: any = [
gbData.map((item: any) => {
return item.value
}),
trendData.map((item: any) => {
return item.value
})
}),
gbData.value.map((item: any) => {
return item.value
}),
]
let legendList = ['国标限值', tabsList.value[activeName.value]?.groupName]
let legendList = [tabsList.value[activeName.value]?.groupName, '国标限值',]
// echartsData.value.legend.data = legendList
list.map((item: any, index: any) => {
echartsData.value.series.push({
@@ -298,6 +312,12 @@ const setRealTrendData = (val: any) => {
emit('changeTrendType', activeName.value)
}
}
const selectChange=(val:any)=>{
loading.value=true
// setTimeout(() => {
// loading.value=false
// },3000)
}
//获取国标限值
const limitData: any = ref()
const setOverLimitData = (val: any) => {
@@ -397,7 +417,7 @@ defineExpose({ open, setRealTrendData, setOverLimitData })
display: flex;
border: 2px solid #eee;
cursor: pointer;
font-size: 13px;
.thead_left {
width: 150px;
height: 100%;
@@ -406,7 +426,7 @@ defineExpose({ open, setRealTrendData, setOverLimitData })
justify-content: space-between;
align-items: center;
line-height: 50px;
font-weight: 800;
padding-bottom: 5px;
p {
@@ -414,7 +434,7 @@ defineExpose({ open, setRealTrendData, setOverLimitData })
height: 100%;
text-align: center;
border: 1px solid #eee;
line-height: 50px;
line-height: 38px;
margin: 0 !important;
}
}
@@ -438,7 +458,7 @@ defineExpose({ open, setRealTrendData, setOverLimitData })
height: 100%;
text-align: center;
border: 1px solid #eee;
line-height: 50px;
line-height: 38px;
margin: 0 !important;
}

View File

@@ -37,7 +37,9 @@ const tableStore: any = new TableStore({
method: 'POST',
column: [
// { width: '60', type: 'checkbox', fixed: 'left' },
{ title: '序号', type: 'seq', width: 80 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ field: 'startTime', title: '发生时刻', minWidth: 170 },
{ field: 'showName', title: '事件描述', minWidth: 170 },
{

View File

@@ -1,7 +1,7 @@
<template>
<div class="view" v-loading="loading">
<el-collapse v-model="activeNames">
<el-collapse-item title="仪表盘" name="1">
<el-collapse-item title="基础数据" name="1">
<div class="view_top">
<!-- 左侧仪表盘 -->
<div class="view_top_left">

View File

@@ -14,11 +14,16 @@
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="值类型">
<el-select style="min-width: 120px !important" v-model="searchForm.dataLevel">
<el-form-item >
<!-- <el-select style="min-width: 120px !important" v-model="searchForm.dataLevel">
<el-option value="Primary" label="一次值"></el-option>
<el-option value="Secondary" label="二次值"></el-option>
</el-select>
</el-select> -->
<el-radio-group v-model="searchForm.dataLevel" @change="init()">
<el-radio-button label="一次值" value="Primary" />
<el-radio-button label="二次值" value="Secondary" />
</el-radio-group>
</el-form-item>
<el-form-item label="统计类型">
<el-select style="min-width: 120px !important" placeholder="请选择" v-model="searchForm.valueType">
@@ -81,7 +86,7 @@ const num = ref(0)
//值类型
const pageHeight = ref(mainHeight(290))
const loading = ref(true)
const searchForm = ref({})
const searchForm:any = ref({})
const tableHeaderRef = ref()
const typeOptions = [
{
@@ -251,7 +256,7 @@ const init = async () => {
// orient: 'vertical', // 垂直排列
top: 5,
right: 70,
width: 550,
// width: 550,
// height: 50
},
grid: {

View File

@@ -14,9 +14,9 @@
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<el-button :icon="Refresh" @click="handleRestartDevice" type="primary" :loading="deviceRestartLoading">
<!-- <el-button :icon="Refresh" @click="handleRestartDevice" type="primary" :loading="deviceRestartLoading">
装置重启
</el-button>
</el-button> -->
</div>
<div class="filter" v-if="activePathList.length != 0">

View File

@@ -3,7 +3,7 @@
<div class="default-main device-manage" :style="{ height: pageHeight.height }" v-loading="loading">
<DeviceTree @node-click="nodeClick" @init="nodeClick" @deviceTypeChange="deviceTypeChange"></DeviceTree>
<div class="device-manage-right" v-if="deviceData">
<el-descriptions title="设备基本信息" class="mb10" :column="3" border>
<el-descriptions title="基础信息" class="mb10" :column="3" border>
<template #extra>
<!-- <el-button
type="primary"
@@ -13,6 +13,10 @@
>
模版数据分组
</el-button> -->
<el-button icon="el-icon-Refresh" @click="handleRestartDevice" type="primary"
:loading="deviceRestartLoading">
装置重启
</el-button>
</template>
<el-descriptions-item label="名称">
{{ deviceData.name }}
@@ -44,13 +48,8 @@
</el-descriptions-item>
</el-descriptions>
<el-tabs v-model="dataSet" type="border-card" class="device-manage-box-card" @tab-click="handleClick">
<el-tab-pane
lazy
:label="item.name"
:name="item.id"
v-for="(item, index) in deviceData.dataSetList"
:key="index"
></el-tab-pane>
<el-tab-pane lazy :label="item.name" :name="item.id" v-for="(item, index) in deviceData.dataSetList"
:key="index"></el-tab-pane>
<div :style="{ height: tableHeight }" v-loading="tableLoading">
<vxe-table v-bind="defaultAttribute" :data="tableData" height="auto" style="width: 100%">
<vxe-column type="seq" title="序号" width="80"></vxe-column>
@@ -73,6 +72,7 @@
defineOptions({
name: 'govern/device/manage'
})
import MangePopup from './popup.vue'
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
import { mainHeight } from '@/utils/layout'
@@ -81,10 +81,18 @@ import { getDeviceData } from '@/api/cs-device-boot/EquipmentDelivery'
import { getTargetById } from '@/api/cs-device-boot/csDataArray'
import { getGroup } from '@/api/cs-device-boot/csGroup'
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { passwordConfirm } from '@/api/user-boot/user'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
reStartDevice,
} from '@/api/cs-device-boot/fileService'
import { defaultAttribute } from '@/components/table/defaultAttribute'
const pageHeight = mainHeight(20)
const loading = ref(true)
const nDid = ref<string>('')
const tableLoading = ref(false)
const getGroupLoading = ref(false)
const deviceData = ref<any>(null)
@@ -97,9 +105,10 @@ const mangePopup = ref()
const activeName = ref(0)
//治理设备和便携式设备切换判断
const deviceType = ref('0')
const deviceTypeChange=(val: any, obj: any)=>{
const deviceTypeChange = (val: any, obj: any) => {
deviceType.value = val
nodeClick(obj)
}
// 树节点点击
const nodeClick = (e: anyObj) => {
@@ -108,8 +117,9 @@ const nodeClick = (e: anyObj) => {
return
}
if (e.level == 2) {
nDid.value = e.ndid
loading.value = true
getDeviceData(e.id, 'rt','').then((res: any) => {
getDeviceData(e.id, 'rt', '').then((res: any) => {
deviceData.value = res.data
loading.value = false
if (!res.data.dataSetList) {
@@ -186,18 +196,60 @@ const openGroup = () => {
})
})
}
//装置重启
const deviceRestartLoading = ref<boolean>(false)
const handleRestartDevice = () => {
deviceRestartLoading.value = true
ElMessageBox.prompt('二次校验密码确认', '装置重启', {
confirmButtonText: '确认',
cancelButtonText: '取消',
customClass: 'customInput',
inputType: 'text'
})
.then(({ value }) => {
if (!value) {
ElMessage.warning('请输入密码')
deviceRestartLoading.value = false
} else {
passwordConfirm(value)
.then((resp: any) => {
if (resp.code == 'A0000') {
reStartDevice({ nDid: nDid.value }).then((res: any) => {
deviceRestartLoading.value = false
ElMessage({ message: res.message, type: 'success', duration: 3000 })
}).catch(e => {
deviceRestartLoading.value = false
})
}
})
.catch(e => {
deviceRestartLoading.value = false
})
}
})
.catch(() => {
deviceRestartLoading.value = false
})
}
</script>
<style lang="scss">
.device-manage {
display: flex;
&-left {
width: 280px;
}
&-right {
overflow: hidden;
flex: 1;
padding: 10px 10px 10px 0;
.el-descriptions__header {
height: 36px;
margin-bottom: 7px;
@@ -206,4 +258,10 @@ const openGroup = () => {
}
}
}
.customInput {
.el-input__inner {
-webkit-text-security: disc !important;
}
}
</style>

View File

@@ -345,8 +345,9 @@ const unBindList = ref([])
const bindList = ref([])
//0 新增方案 1 修改方案 2 新增测试项 3 修改测试项 4 设备信息
const open = async (val: any, id: any, name?: any) => {
console.log("🚀 ~ open ~ val:", val)
popupType.value = val
title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : ('修改测试项' + '_' + name)
title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : val == 3 ? '修改测试项' : ('绑定测试项' + '_' + name)
dialogVisible.value = true
planId.value = id
//新增方案或者测试项数据
@@ -477,7 +478,7 @@ const submit = () => {
})
}
//修改测试项
if (popupType.value == 3) {
if (popupType.value == 3 || popupType.value == 4) {
let subForm = JSON.parse(JSON.stringify(form1.value))
subForm.list = checkedIdList.value
updateRecord(subForm).then((res: any) => {

View File

@@ -12,8 +12,16 @@
<Icon name="el-icon-Search" style="font-size: 16px" />
</template>
</el-input>
<Icon name="el-icon-Plus" size="18"
class="fold ml10 menu-collapse" style="cursor: pointer" @click="onAdd"/>
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>新增方案</span>
</template>
<Icon name="el-icon-Plus" size="18" class="fold ml10 menu-collapse" style="cursor: pointer"
@click="onAdd" />
</el-tooltip>
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
style="cursor: pointer" />
@@ -29,24 +37,52 @@
<span>{{ node.label }}</span>
</div>
<div class="right">
<a :style="{ marginRight: '0.5rem' }" v-if="data?.children">
<el-icon :style="{ color: '#0000FF' }">
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>新增测试项</span>
</template>
<Plus @click.stop="add(node, data)" />
</el-tooltip>
</el-icon>
</a>
<a :style="{ marginRight: '0.5rem' }" v-else>
<el-icon :style="{ color: '#0000FF' }">
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>绑定测试项</span>
</template>
<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)" />
</el-tooltip>
</el-icon>
</a>
<a :style="{ marginRight: '0.5rem' }">
<el-icon :style="{ color: '#0000FF' }">
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>修改测试项</span>
</template>
<Edit @click.stop="edit(node, data)" />
</el-tooltip>
</el-icon>
</a>
<a :style="{ marginRight: '0.5rem' }">
<el-icon :style="{ color: '#DA3434' }">
<Delete @click.stop="del(node, data)" />
</el-icon>
</a>
</div>
@@ -65,7 +101,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 ,SetUp} 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'
@@ -76,7 +112,10 @@ interface Props {
width?: string
canExpand?: boolean
}
const visible1 = ref(false)
const visible2 = ref(false)
const visible3 = ref(false)
const visible4 = ref(false)
const { proxy } = useCurrentInstance()
const menuCollapse = ref(false)
const filterText = ref('')
@@ -126,8 +165,8 @@ const onAdd = () => {
}
// 绑定数据
const bind = (node: any, data: any) => {
console.log("🚀 ~ bind ~ data:", data)
emit('bind',data)
emit('bind', data)
}
/** 树形结构数据 */
@@ -147,7 +186,7 @@ const props = withDefaults(
}
)
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart','onAdd','bind'])
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart', 'onAdd', 'bind'])
const config = useConfig()
const tree = ref()
const treRef = ref()

View File

@@ -100,8 +100,9 @@
</el-collapse>
<div v-if="JSON.stringify(echartsData) != '{}' && deviceData?.records?.length != 0">
<h3 class="mt10 mb10">历史趋势</h3>
<div class="history_trend">
<!-- <h3 class="mt10 mb10">历史趋势</h3> -->
<el-tabs type="border-card" class="mt10">
<el-tab-pane label="历史趋势"> <div class="history_trend" v-if="titleList != '(未绑定数据)'">
<div class="history_header" ref="headerRef">
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
<TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange">
@@ -154,6 +155,11 @@
<MyEchart ref="historyChart" v-if="echartsData" :isExport="true" :options="echartsData" />
</div>
</div>
<el-empty :style="EcharHeight" v-else description="未绑定数据" /></el-tab-pane>
<el-tab-pane label="暂态数据">Config</el-tab-pane>
</el-tabs>
</div>
</div>
<el-empty v-else description="请选择设备" class="device-manage-right" />
@@ -191,7 +197,7 @@ const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
const volConTypeList = dictData.getBasicData('Dev_Connect')
//值类型
const pageHeight = mainHeight(20)
const EcharHeight = ref(mainHeight(448))
const EcharHeight = ref(mainHeight(483))
const loading = ref(false)
const searchForm: any = ref({})
const typeOptions = [
@@ -314,7 +320,7 @@ const onAdd = () => {
handleOpen(0)
}
const bind = (data: any) => {
handleOpen(3, data)
handleOpen(4, data)
}
const handleOpen = (val: any, data?: any) => {
if (!deviceData.value) {
@@ -333,6 +339,10 @@ const handleOpen = (val: any, data?: any) => {
let name: any = ''
//数据绑定
if (val == 3) {
ids = data?.id
// name = data?.name
dialogRef.value.detailsType('table')
} else if (val == 4) {
ids = data?.id
name = data?.name
dialogRef.value.detailsType('table')
@@ -477,15 +487,15 @@ const init = (flag: boolean) => {
echartsData.value = {
title: {
text: chartTitle.value,
left: '0',
// title: {
// text: chartTitle.value,
// left: '0',
textStyle: {
color: '#000',
fontSize: '16'
},
},
// textStyle: {
// color: '#000',
// fontSize: '16'
// },
// },
toolbox: {
featureProps: {
myTool1: {
@@ -505,7 +515,7 @@ const init = (flag: boolean) => {
itemStyle: { opacity: 0 },//去圆点
type: 'scroll', // 开启滚动分页
right: 70,
width: 550,
// width: 550,
// height: 50
},
@@ -846,15 +856,15 @@ const selectChange = (e: boolean) => {
if (activeColName.value == '0') {
if (flag.value) {
EcharHeight.value = mainHeight(492)
EcharHeight.value = mainHeight(527)
} else {
EcharHeight.value = mainHeight(448)
EcharHeight.value = mainHeight(483)
}
} else {
if (flag.value) {
EcharHeight.value = mainHeight(322)
EcharHeight.value = mainHeight(357)
} else {
EcharHeight.value = mainHeight(280)
EcharHeight.value = mainHeight(315)
}
}
}
@@ -862,15 +872,15 @@ const selectChange = (e: boolean) => {
const handleChange = () => {
if (activeColName.value == '0') {
if (flag.value) {
EcharHeight.value = mainHeight(492)
EcharHeight.value = mainHeight(527)
} else {
EcharHeight.value = mainHeight(448)
EcharHeight.value = mainHeight(483)
}
} else {
if (flag.value) {
EcharHeight.value = mainHeight(322)
EcharHeight.value = mainHeight(357)
} else {
EcharHeight.value = mainHeight(280)
EcharHeight.value = mainHeight(315)
}
}
}

View File

@@ -52,7 +52,9 @@ const tableStore = new TableStore({
url: '/system-boot/csDictData/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '数据分类', field: 'dataTypeName', minWidth: 170 },
{ title: '数据名称', field: 'name', minWidth: 220 },
{ title: '别名', field: 'otherName', minWidth: 220 },

View File

@@ -187,7 +187,9 @@ const tableStore = new TableStore({
url: '/cs-device-boot/EquipmentDelivery/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '设备名称', field: 'name' },
{
title: '设备类型',

View File

@@ -37,7 +37,9 @@ const tableStore = new TableStore({
url: '/cs-device-boot/topologyTemplate/queryImage',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '拓扑图模版名称', field: 'name', align: 'center' },
{ title: '监测点数量', field: 'pointNum', align: 'center' },
{ title: '拓扑图', field: 'filePath', align: 'center', render: 'image' },

View File

@@ -8,12 +8,19 @@
<el-form-item label="编码">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="类型">
<el-select v-model="form.type" placeholder="请选择类型">
<el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="form.sort" :min="0" />
</el-form-item>
</el-form>
<template #footer>
@@ -42,10 +49,18 @@ const form = reactive({
name: '',
code: '',
remark: '',
type: 2,
sort: 100,
pid: '',
id: ''
})
const options = ref([
{ name: '通用指标', value: 2 },
{ name: 'APF模块', value: 3 },
{ name: '星型接线', value: 4 },
{ name: '角型接线', value: 5 },
{ name: 'v型接线', value: 6 },
])
const dialogVisible = ref(false)
const title = ref('新增菜单')

View File

@@ -1,6 +1,6 @@
<template>
<el-dialog class="cn-operate-dialog statistical-type-binding" v-model="dialogVisible" title="绑定指标"
style="width: 1200px" @closed="close">
style="width: 1040px" @closed="close">
<el-scrollbar style="padding-right: 0">
<div class="box">
<div class="box-left">

View File

@@ -27,14 +27,30 @@ defineOptions({
const tableRef = ref()
const bindingRef = ref()
const addRef = ref()
const options = ref([
{ name: '通用指标', value: 2 },
{ name: 'APF模块', value: 3 },
{ name: '星型接线', value: 4 },
{ name: '角型接线', value: 5 },
{ name: 'v型接线', value: 6 },
])
const tableStore = new TableStore({
showPage: false,
url: '/system-boot/dictTree/query',
method: 'POST',
paramsPOST:true,
paramsPOST: true,
column: [
{ title: '序号', type: 'seq', width: 60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '统计类型', field: 'name' },
{
title: '类型', field: 'type',
width: 150,
formatter: row => {
return options.value.filter((item: any) => item.value == row.cellValue)[0]?.name
},
},
{
title: '操作',
align: 'center',

View File

@@ -24,7 +24,9 @@ const tableStore = new TableStore({
method: 'POST',
url: '/user-boot/referralCode/findReferralCode',
column: [
{ title: '序号', type: 'seq', width: 60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '角色名称', field: 'roleName' },
{ title: '推荐码', field: 'roleReferralCode' }
]

View File

@@ -1,7 +1,7 @@
<template>
<div>
<span style="font-size: 14px; font-weight: bold">
统计区域: 中国 &ensp; 统计时间: 2023-12-01-2023-12-27 &ensp; 统计次数: {{ frequency + '次' }}
<!-- 统计区域: 中国 &ensp; 统计时间: 2023-12-01-2023-12-27 &ensp; 统计次数: {{ frequency + '次' }} -->
</span>
<el-tabs tab-position="left" class="demo-tabs" style="margin-top: 10px">
<el-tab-pane label="区域">

View File

@@ -70,7 +70,9 @@ const tableStore = new TableStore({
url: '/device-boot/runManage/getRuntimeData',
method: 'POST',
column: [
{ title: '序号', type: 'seq', align: 'center', width: 60 },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '区域', field: 'areaName', align: 'center', width: 120 },
{ title: '供电公司', field: 'gdName', align: 'center', width: 120 },
{ title: '变电站', field: 'bdName', align: 'center', showOverflow: true, minWidth: 100 },

View File

@@ -40,7 +40,9 @@ const tableStore = new TableStore({
url: '/system-boot/dictType/list',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: '60' },
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '名称', field: 'name' },
{ title: '编码', field: 'code' },
{ title: '开启等级', field: 'openLevelName' },