修改测试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', path: '/supplementaryRecruitment',
name: 'supplementaryRecruitment', name: 'supplementaryRecruitment',
component: () => import('@/views/govern/device/control/supplementaryRecruitment.vue'), component: () => import('@/views/govern/device/control/supplementaryRecruitment.vue'),

View File

@@ -29,7 +29,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<div v-if="view2" style="display: flex"> <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-select @change="changeView" style="width: 240px" v-model="value" placeholder="请选择值类型">
<el-option <el-option
v-for="item in options" v-for="item in options"

View File

@@ -14,8 +14,8 @@
<Table ref="tableRef" /> <Table ref="tableRef" />
</el-dialog> </el-dialog>
<popup ref="detailRef"></popup> <popup ref="detailRef"></popup>
<!-- 离线数据导入组件 --> <!-- 离线数据导入组件 -->
<offLineDataImport ref="offLineDataImportRef"></offLineDataImport> <!-- <offLineDataImport ref="offLineDataImportRef"></offLineDataImport> -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, onMounted, provide, onBeforeUnmount } from 'vue' 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 offLineDataImport from '../offLineDataImport/index.vue'
import popup from './popup.vue' import popup from './popup.vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
defineOptions({
name: 'offLineDataImport'
})
const emit = defineEmits(['back']) const emit = defineEmits(['back'])
const dialogVisible = ref(false) const dialogVisible = ref(false)
const height = ref(0) const height = ref(0)
@@ -40,7 +43,11 @@ const tableStore: any = new TableStore({
method: 'POST', method: 'POST',
column: [ column: [
// { width: '60', type: 'checkbox', fixed: 'left' }, // { 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', field: 'projectName',
title: '工程名称', title: '工程名称',
@@ -133,15 +140,26 @@ const handleaddDevice = () => {
push({ push({
path: '/supplementaryRecruitment', path: '/supplementaryRecruitment',
query: { query: {
activeName: '0',
id: lineId.value, id: lineId.value,
ndid: deviceData.value?.ndid ndid: deviceData.value?.ndid,
} }
}) })
} }
const offLineDataImportRef = ref() const offLineDataImportRef = ref()
const handleImport = () => { const handleImport = () => {
//设备devId&监测点lineId带入组件 //设备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(() => { onMounted(() => {

View File

@@ -36,7 +36,9 @@ const tableStore: any = new TableStore({
showPage: false, showPage: false,
column: [ column: [
{ width: '60', type: 'checkbox', fixed: 'left' }, { 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: 'name', title: '文件名称', minWidth: 170 },
{ field: 'createTime', title: '导入时间', minWidth: 170 }, { field: 'createTime', title: '导入时间', minWidth: 170 },
{ field: 'allCount', title: '数据总数(条)', minWidth: 170 }, { field: 'allCount', title: '数据总数(条)', minWidth: 170 },

View File

@@ -12,7 +12,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据类型" label-width="80px"> <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" <el-option v-for="item in typeOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>

View File

@@ -4,7 +4,7 @@
<!-- @init="nodeClick" --> <!-- @init="nodeClick" -->
<PointTree @node-click="nodeClick" @pointTypeChange="pointTypeChange"></PointTree> <PointTree @node-click="nodeClick" @pointTypeChange="pointTypeChange"></PointTree>
<div class="device-control-right" v-if="deviceData"> <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> <template #extra>
<!-- <el-button v-if="deviceType == '1'" type="primary" @click="handleDownLoadTemplate"> <!-- <el-button v-if="deviceType == '1'" type="primary" @click="handleDownLoadTemplate">
模版下载 模版下载
@@ -90,26 +90,34 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="值类型" v-if="!dataSet.includes('_items')"> <el-form-item v-if="!dataSet.includes('_items')">
<el-select style="min-width: 120px !important" v-model="formInline.dataLevel" <!-- <el-select style="min-width: 120px !important" v-model="formInline.dataLevel"
:disabled="dataLevel == 'Primary' && deviceType == '0'"> :disabled="dataLevel == 'Primary' && deviceType == '0'">
<el-option value="Primary" label="一次值"></el-option> <el-option value="Primary" label="一次值"></el-option>
<el-option value="Secondary" label="二次值"></el-option> <el-option value="Secondary" label="二次值"></el-option>
</el-select> </el-select> -->
</el-form-item> <el-radio-group v-model="formInline.dataLevel" @change="handleClick">
<el-form-item label="筛选" v-if="!dataSet.includes('_')"> <el-radio-button label="一次值" value="Primary" />
<el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable <el-radio-button label="二次值" value="Secondary" />
@input="handleSearch" placeholder="请输入关键词"></el-input>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="谐波次数" v-show="oddAndEvenFlag && !dataSet.includes('_')"> <el-form-item label="谐波次数" v-show="oddAndEvenFlag && !dataSet.includes('_')">
<el-select v-model="oddAndEven" style="min-width: 120px !important"> <el-select v-model="oddAndEven" style="min-width: 120px !important">
<el-option v-for="item in oddAndEvenList" :key="item.value" :label="item.label" <el-option v-for="item in oddAndEvenList" :key="item.value" :label="item.label"
:value="item.value" /> :value="item.value" />
</el-select> </el-select>
</el-form-item> </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>
<template #operation> <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" <el-button type="primary" :disabled="tableLoading" v-if="realTimeFlag" :icon="DataLine"
@click="handleTrend"> @click="handleTrend">
谐波频谱 谐波频谱
@@ -146,17 +154,19 @@
></div> --> ></div> -->
<!-- v-loading="tableLoading" --> <!-- v-loading="tableLoading" -->
<div :style="{ height: tableHeight }" v-loading="tableLoading" v-if="!dataSet.includes('_')"> <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('_trenddata') == -1 &&
dataSet.indexOf('_realtimedata') == -1 && dataSet.indexOf('_realtimedata') == -1 &&
dataSet.indexOf('_event') == -1 && dataSet.indexOf('_event') == -1 &&
tableData.length != 0 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 || '' }} 统计时间:{{ tableData[0]?.time || '' }}
</div> </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 最新数据/历史数据显示 --> <!-- 循环渲染的card 最新数据/历史数据显示 -->
@@ -346,7 +356,7 @@
<el-empty v-else description="请选择设备" class="device-control-right" /> <el-empty v-else description="请选择设备" class="device-control-right" />
<Detail ref="detailRef" :detail="detail" @close="detail = null" :dataLevel="dataLevel" v-if="detail"></Detail> <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> <analysisList ref="analysisListRef"></analysisList>
</div> </div>
@@ -399,7 +409,7 @@ const devTypeOptions = ref([])
const devModelOptions = ref([]) const devModelOptions = ref([])
const tableData = ref<any[]>([]) const tableData = ref<any[]>([])
const tableHeight = mainHeight(290).height const tableHeight = mainHeight(290).height
const tableHeightBox = mainHeight(310).height const tableHeightBox = mainHeight(330).height
const searchValue = ref('') const searchValue = ref('')
const TrendList = ref({}) const TrendList = ref({})
const oddAndEven = ref('1') const oddAndEven = ref('1')
@@ -631,7 +641,8 @@ const deviceId: any = ref('')
const lineId: any = ref('') const lineId: any = ref('')
const dataLevel: any = ref('') const dataLevel: any = ref('')
const nodeClick = async (e: anyObj) => { const nodeClick = async (e: anyObj) => {
console.log("🚀 ~ nodeClick ~ e:", e) // console.log("🚀 ~ nodeClick ~ e:", e)
if (e.level == 2) return
searchValue.value = '' searchValue.value = ''
await queryDictType({ await queryDictType({
lineId: e?.id, lineId: e?.id,
@@ -642,7 +653,7 @@ const nodeClick = async (e: anyObj) => {
formInline.targetType = res.data[0].id formInline.targetType = res.data[0].id
}) })
if (e.level == 2) return
deviceId.value = e?.pid deviceId.value = e?.pid
lineId.value = e?.id lineId.value = e?.id
TrendList.value = e TrendList.value = e
@@ -915,6 +926,10 @@ const getRealDataMqttMsg = async () => {
ElMessage.success('装置应答失败') ElMessage.success('装置应答失败')
tableLoading.value = false tableLoading.value = false
} }
}).catch(e => {
setTimeout(() => {
tableLoading.value = false
}, 0)
}) })
} }
//tab点击事件 //tab点击事件
@@ -1018,29 +1033,29 @@ const handleClick = async (tab?: any) => {
} }
//测试项记录 //测试项记录
if (dataSet.value.includes('_items')) { if (dataSet.value.includes('_items')) {
setTimeout(() => { setTimeout(() => {
formInline.startTime = datePickerRef.value && datePickerRef.value?.timeValue[0] formInline.startTime = datePickerRef.value && datePickerRef.value?.timeValue[0]
formInline.endTime = datePickerRef.value && datePickerRef.value?.timeValue[1] formInline.endTime = datePickerRef.value && datePickerRef.value?.timeValue[1]
formInline.id = dataSet.value formInline.id = dataSet.value
getTestData(formInline) getTestData(formInline)
.then((res: any) => { .then((res: any) => {
tableData.value = res.data tableData.value = res.data
formInline.total = res.data.total formInline.total = res.data.total
tableLoading.value = false
setTimeout(() => { //targetType
testItemRecordsRef.value?.setData(res.data,)
}, 500)
setTimeout(() => {
loading.value = false
}, 1500)
})
.catch(e => {
setTimeout(() => {
tableLoading.value = false tableLoading.value = false
}, 1500) setTimeout(() => { //targetType
}) testItemRecordsRef.value?.setData(res.data,)
},100) }, 500)
setTimeout(() => {
loading.value = false
}, 1500)
})
.catch(e => {
setTimeout(() => {
tableLoading.value = false
}, 1500)
})
}, 100)
} }

View File

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

View File

@@ -1,66 +1,93 @@
<!-- 离线数据导入 --> <!-- 离线数据导入 -->
<template> <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=" ">
<div class="offline_data_btn"> <!-- <div class="offline_data_btn">
<el-button :loading="loading" style="margin-left: 10px" type="primary" @click="submitUpload"> <el-button :loading="loading" style="margin-left: 10px" type="primary" @click="submitUpload">
上传离线数据 上传离线数据
</el-button> </el-button>
<el-button type="primary" @click="removeAllFile" :loading="loading" <el-button type="primary" @click="removeAllFile" :loading="loading"
:disabled="offLineFileList.length == 0"> :disabled="offLineFileList.length == 0">
重置上传文件 重置上传文件
</el-button> </el-button>
</div> <el-button type="primary" @click="handleUpload" :loading="loading"
<div :style="tableHeight"> :disabled="offLineFileList.length == 0 || disableHandleUpload">
<vxe-table border auto-resize height="auto" :data="offLineFileList" v-bind="defaultAttribute" 开始上传
:key="updateKey"> </el-button>
<vxe-column field="name" align="center" title="文件名"></vxe-column> </div> -->
<vxe-column field="webkitRelativePath" align="center" title="文件地址"></vxe-column> <TableHeader ref="refheader" :showSearch="false">
<vxe-column field="status" align="center" title="状态" width="250">
<template v-slot:default="scoped"> <template #operation>
<el-progress v-if="scoped.row.status == 0" :percentage="0"> <el-button :loading="loading" style="margin-left: 10px" type="primary" @click="submitUpload">
<el-button text>等待上传</el-button> 上传离线数据
</el-progress> </el-button>
<el-progress v-if="scoped.row.status == -1" :percentage="30" :indeterminate="true">
<el-button text>上传中...</el-button> <el-button type="primary" @click="removeAllFile" :loading="loading"
</el-progress> :disabled="offLineFileList.length == 0">
<el-progress v-if="scoped.row.status == 1" status="success" :percentage="100"> 重置上传文件
<el-button text>上传成功</el-button> </el-button>
</el-progress> <el-button type="primary" @click="handleUpload" :loading="loading"
</template> :disabled="offLineFileList.length == 0 || disableHandleUpload">
</vxe-column> 开始上传
<vxe-column title="操作" width="200px"> </el-button>
<template v-slot:default="scoped"> <el-button :icon="Back" @click="go(-1)">返回</el-button>
<el-button link type="danger" @click="removeFile(scoped.row)">移除</el-button> </template>
</template>
</vxe-column> </TableHeader>
</vxe-table> <div :style="tableHeight">
</div> <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="300">
<template v-slot:default="scoped">
<el-progress v-if="scoped.row.status == 0" :percentage="0">
<el-button text>等待上传</el-button>
</el-progress>
<el-progress v-if="scoped.row.status == -1" :percentage="30" :indeterminate="true">
<el-button text>上传中...</el-button>
</el-progress>
<el-progress v-if="scoped.row.status == 1" status="success" :percentage="100">
<el-button text>上传成功</el-button>
</el-progress>
</template>
</vxe-column>
<vxe-column title="操作" width="200px">
<template v-slot:default="scoped">
<el-button link type="danger" @click="removeFile(scoped.row)">移除</el-button>
</template>
</vxe-column>
</vxe-table>
</div> </div>
<template #footer> </div>
<!-- <template #footer>
<div class="dialog-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" <el-button type="primary" @click="handleUpload" :loading="loading"
:disabled="offLineFileList.length == 0 || disableHandleUpload"> :disabled="offLineFileList.length == 0 || disableHandleUpload">
开始上传 开始上传
</el-button> </el-button>
</div> </div>
</template> </template> -->
</el-dialog> <!-- </el-dialog> -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import TableHeader from '@/components/table/header/index.vue'
import { uploadOffLineDataFile } from '@/api/cs-device-boot/EquipmentDelivery.ts' import { uploadOffLineDataFile } from '@/api/cs-device-boot/EquipmentDelivery.ts'
import { defaultAttribute } from '@/components/table/defaultAttribute' import { defaultAttribute } from '@/components/table/defaultAttribute'
import {Back} from '@element-plus/icons-vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { useRouter, useRoute } from 'vue-router'
const { go } = useRouter() // 路由
const routes = useRoute()
const dialogVisible = ref(false) const dialogVisible = ref(false)
const loading = ref(false) const loading = ref(false)
const offLineFileList: any = ref([]) const offLineFileList: any = ref([])
const disableHandleUpload = ref(true) const disableHandleUpload = ref(true)
const tableHeight = mainHeight(550) const tableHeight = mainHeight(85)
//上传离线数据 //上传离线数据
const submitUpload = (e: any) => { const submitUpload = (e: any) => {
const input = document.createElement('input') const input = document.createElement('input')
@@ -102,8 +129,8 @@ const updateKey = ref(0)
const handleUpload = () => { const handleUpload = () => {
loading.value = true loading.value = true
const subForm = new FormData() const subForm = new FormData()
subForm.append('devId', deviceId.value) subForm.append('devId', routes.query.deviceId)
subForm.append('lineId', lineId.value) subForm.append('lineId', routes.query.lineId)
let webkitRelativePathList: any = [] let webkitRelativePathList: any = []
offLineFileList.value.map((item: any, index: any) => { offLineFileList.value.map((item: any, index: any) => {
subForm.append(`files[${index}]`, item) subForm.append(`files[${index}]`, item)
@@ -126,22 +153,22 @@ const handleUpload = () => {
loading.value = false loading.value = false
disableHandleUpload.value = true disableHandleUpload.value = true
} }
}).catch(()=>{ }).catch(() => {
loading.value = false loading.value = false
disableHandleUpload.value = false disableHandleUpload.value = false
offLineFileList.value.map((item: any) => { offLineFileList.value.map((item: any) => {
item.status = 0 item.status = 0
}) })
updateKey.value += 1 updateKey.value += 1
}) })
} }
const deviceId: any = ref() // const deviceId: any = ref()
const lineId: any = ref() // const lineId: any = ref()
const open = (devId: any, lineIds: any) => { // const open = (devId: any, lineIds: any) => {
deviceId.value = devId // deviceId.value = devId
lineId.value = lineIds // lineId.value = lineIds
dialogVisible.value = true // dialogVisible.value = true
} // }
const close = () => { const close = () => {
offLineFileList.value = [] offLineFileList.value = []
dialogVisible.value = false dialogVisible.value = false
@@ -160,4 +187,7 @@ defineExpose({ open })
justify-content: flex-end; justify-content: flex-end;
} }
} }
</style>
// .device {
// height: calc(100vh - 130px);
// }</style>

View File

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

View File

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

View File

@@ -216,7 +216,9 @@ const tableStore = new TableStore({
url: '/cs-device-boot/EquipmentDelivery/list', url: '/cs-device-boot/EquipmentDelivery/list',
method: 'POST', method: 'POST',
column: [ 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: 'name' },
{ {
title: '设备类型', title: '设备类型',

View File

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

View File

@@ -37,7 +37,9 @@ const tableStore: any = new TableStore({
method: 'POST', method: 'POST',
column: [ column: [
// { width: '60', type: 'checkbox', fixed: 'left' }, // { 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: 'startTime', title: '发生时刻', minWidth: 170 },
{ field: 'showName', title: '事件描述', minWidth: 170 }, { field: 'showName', title: '事件描述', minWidth: 170 },
{ {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="view" v-loading="loading"> <div class="view" v-loading="loading">
<el-collapse v-model="activeNames"> <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">
<!-- 左侧仪表盘 --> <!-- 左侧仪表盘 -->
<div class="view_top_left"> <div class="view_top_left">

View File

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

View File

@@ -14,9 +14,9 @@
</el-breadcrumb-item> </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </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>
<div class="filter" v-if="activePathList.length != 0"> <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"> <div class="default-main device-manage" :style="{ height: pageHeight.height }" v-loading="loading">
<DeviceTree @node-click="nodeClick" @init="nodeClick" @deviceTypeChange="deviceTypeChange"></DeviceTree> <DeviceTree @node-click="nodeClick" @init="nodeClick" @deviceTypeChange="deviceTypeChange"></DeviceTree>
<div class="device-manage-right" v-if="deviceData"> <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> <template #extra>
<!-- <el-button <!-- <el-button
type="primary" type="primary"
@@ -13,6 +13,10 @@
> >
模版数据分组 模版数据分组
</el-button> --> </el-button> -->
<el-button icon="el-icon-Refresh" @click="handleRestartDevice" type="primary"
:loading="deviceRestartLoading">
装置重启
</el-button>
</template> </template>
<el-descriptions-item label="名称"> <el-descriptions-item label="名称">
{{ deviceData.name }} {{ deviceData.name }}
@@ -44,13 +48,8 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-tabs v-model="dataSet" type="border-card" class="device-manage-box-card" @tab-click="handleClick"> <el-tabs v-model="dataSet" type="border-card" class="device-manage-box-card" @tab-click="handleClick">
<el-tab-pane <el-tab-pane lazy :label="item.name" :name="item.id" v-for="(item, index) in deviceData.dataSetList"
lazy :key="index"></el-tab-pane>
: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"> <div :style="{ height: tableHeight }" v-loading="tableLoading">
<vxe-table v-bind="defaultAttribute" :data="tableData" height="auto" style="width: 100%"> <vxe-table v-bind="defaultAttribute" :data="tableData" height="auto" style="width: 100%">
<vxe-column type="seq" title="序号" width="80"></vxe-column> <vxe-column type="seq" title="序号" width="80"></vxe-column>
@@ -73,6 +72,7 @@
defineOptions({ defineOptions({
name: 'govern/device/manage' name: 'govern/device/manage'
}) })
import MangePopup from './popup.vue' import MangePopup from './popup.vue'
import DeviceTree from '@/components/tree/govern/deviceTree.vue' import DeviceTree from '@/components/tree/govern/deviceTree.vue'
import { mainHeight } from '@/utils/layout' 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 { getTargetById } from '@/api/cs-device-boot/csDataArray'
import { getGroup } from '@/api/cs-device-boot/csGroup' import { getGroup } from '@/api/cs-device-boot/csGroup'
import { ref } from 'vue' 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' import { defaultAttribute } from '@/components/table/defaultAttribute'
const pageHeight = mainHeight(20) const pageHeight = mainHeight(20)
const loading = ref(true) const loading = ref(true)
const nDid = ref<string>('')
const tableLoading = ref(false) const tableLoading = ref(false)
const getGroupLoading = ref(false) const getGroupLoading = ref(false)
const deviceData = ref<any>(null) const deviceData = ref<any>(null)
@@ -97,9 +105,10 @@ const mangePopup = ref()
const activeName = ref(0) const activeName = ref(0)
//治理设备和便携式设备切换判断 //治理设备和便携式设备切换判断
const deviceType = ref('0') const deviceType = ref('0')
const deviceTypeChange=(val: any, obj: any)=>{ const deviceTypeChange = (val: any, obj: any) => {
deviceType.value = val deviceType.value = val
nodeClick(obj) nodeClick(obj)
} }
// 树节点点击 // 树节点点击
const nodeClick = (e: anyObj) => { const nodeClick = (e: anyObj) => {
@@ -108,8 +117,9 @@ const nodeClick = (e: anyObj) => {
return return
} }
if (e.level == 2) { if (e.level == 2) {
nDid.value = e.ndid
loading.value = true loading.value = true
getDeviceData(e.id, 'rt','').then((res: any) => { getDeviceData(e.id, 'rt', '').then((res: any) => {
deviceData.value = res.data deviceData.value = res.data
loading.value = false loading.value = false
if (!res.data.dataSetList) { 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> </script>
<style lang="scss"> <style lang="scss">
.device-manage { .device-manage {
display: flex; display: flex;
&-left { &-left {
width: 280px; width: 280px;
} }
&-right { &-right {
overflow: hidden; overflow: hidden;
flex: 1; flex: 1;
padding: 10px 10px 10px 0; padding: 10px 10px 10px 0;
.el-descriptions__header { .el-descriptions__header {
height: 36px; height: 36px;
margin-bottom: 7px; margin-bottom: 7px;
@@ -206,4 +258,10 @@ const openGroup = () => {
} }
} }
} }
.customInput {
.el-input__inner {
-webkit-text-security: disc !important;
}
}
</style> </style>

View File

@@ -345,8 +345,9 @@ const unBindList = ref([])
const bindList = ref([]) const bindList = ref([])
//0 新增方案 1 修改方案 2 新增测试项 3 修改测试项 4 设备信息 //0 新增方案 1 修改方案 2 新增测试项 3 修改测试项 4 设备信息
const open = async (val: any, id: any, name?: any) => { const open = async (val: any, id: any, name?: any) => {
console.log("🚀 ~ open ~ val:", val)
popupType.value = 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 dialogVisible.value = true
planId.value = id 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)) let subForm = JSON.parse(JSON.stringify(form1.value))
subForm.list = checkedIdList.value subForm.list = checkedIdList.value
updateRecord(subForm).then((res: any) => { updateRecord(subForm).then((res: any) => {

View File

@@ -12,8 +12,16 @@
<Icon name="el-icon-Search" style="font-size: 16px" /> <Icon name="el-icon-Search" style="font-size: 16px" />
</template> </template>
</el-input> </el-input>
<Icon name="el-icon-Plus" size="18" <el-tooltip placement="bottom" :hide-after="0">
class="fold ml10 menu-collapse" style="cursor: pointer" @click="onAdd"/> <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'" <Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse" :class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
style="cursor: pointer" /> style="cursor: pointer" />
@@ -29,24 +37,52 @@
<span>{{ node.label }}</span> <span>{{ node.label }}</span>
</div> </div>
<div class="right"> <div class="right">
<a :style="{ marginRight: '0.5rem' }" v-if="data?.children"> <a :style="{ marginRight: '0.5rem' }" v-if="data?.children">
<el-icon :style="{ color: '#0000FF' }"> <el-icon :style="{ color: '#0000FF' }">
<Plus @click.stop="add(node, data)" />
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>新增测试项</span>
</template>
<Plus @click.stop="add(node, data)" />
</el-tooltip>
</el-icon> </el-icon>
</a> </a>
<a :style="{ marginRight: '0.5rem' }" v-else> <a :style="{ marginRight: '0.5rem' }" v-else>
<el-icon :style="{ color: '#0000FF' }"> <el-icon :style="{ color: '#0000FF' }">
<SetUp @click.stop="bind(node, data)" /> <el-tooltip placement="bottom" :hide-after="0">
</el-icon> <template #content>
</a> <span>绑定测试项</span>
<a :style="{ marginRight: '0.5rem' }"> </template>
<el-icon :style="{ color: '#DA3434' }"> <SetUp @click.stop="bind(node, data)" />
<Delete @click.stop="del(node, data)" /> </el-tooltip>
</el-icon> </el-icon>
</a> </a>
<a :style="{ marginRight: '0.5rem' }"> <a :style="{ marginRight: '0.5rem' }">
<el-icon :style="{ color: '#0000FF' }"> <el-icon :style="{ color: '#0000FF' }">
<Edit @click.stop="edit(node, data)" /> <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> </el-icon>
</a> </a>
</div> </div>
@@ -65,7 +101,7 @@ import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
import { useConfig } from '@/stores/config' import { useConfig } from '@/stores/config'
import useCurrentInstance from '@/utils/useCurrentInstance' import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree } from 'element-plus' 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 { delRecord } from '@/api/cs-device-boot/planData'
import popup from './popup.vue' import popup from './popup.vue'
import { ElMessage, ElMessageBox } from 'element-plus' import { ElMessage, ElMessageBox } from 'element-plus'
@@ -76,7 +112,10 @@ interface Props {
width?: string width?: string
canExpand?: boolean canExpand?: boolean
} }
const visible1 = ref(false)
const visible2 = ref(false)
const visible3 = ref(false)
const visible4 = ref(false)
const { proxy } = useCurrentInstance() const { proxy } = useCurrentInstance()
const menuCollapse = ref(false) const menuCollapse = ref(false)
const filterText = ref('') const filterText = ref('')
@@ -126,9 +165,9 @@ const onAdd = () => {
} }
// 绑定数据 // 绑定数据
const bind = (node: any, data: any) => { const bind = (node: any, data: any) => {
console.log("🚀 ~ bind ~ data:", data)
emit('bind',data) emit('bind', data)
} }
/** 树形结构数据 */ /** 树形结构数据 */
const defaultProps = { const defaultProps = {
@@ -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 config = useConfig()
const tree = ref() const tree = ref()
const treRef = ref() const treRef = ref()

View File

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

View File

@@ -52,7 +52,9 @@ const tableStore = new TableStore({
url: '/system-boot/csDictData/list', url: '/system-boot/csDictData/list',
method: 'POST', method: 'POST',
column: [ 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: 'dataTypeName', minWidth: 170 },
{ title: '数据名称', field: 'name', minWidth: 220 }, { title: '数据名称', field: 'name', minWidth: 220 },
{ title: '别名', field: 'otherName', minWidth: 220 }, { title: '别名', field: 'otherName', minWidth: 220 },

View File

@@ -187,7 +187,9 @@ const tableStore = new TableStore({
url: '/cs-device-boot/EquipmentDelivery/list', url: '/cs-device-boot/EquipmentDelivery/list',
method: 'POST', method: 'POST',
column: [ 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: 'name' },
{ {
title: '设备类型', title: '设备类型',

View File

@@ -37,7 +37,9 @@ const tableStore = new TableStore({
url: '/cs-device-boot/topologyTemplate/queryImage', url: '/cs-device-boot/topologyTemplate/queryImage',
method: 'POST', method: 'POST',
column: [ 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: 'name', align: 'center' },
{ title: '监测点数量', field: 'pointNum', align: 'center' }, { title: '监测点数量', field: 'pointNum', align: 'center' },
{ title: '拓扑图', field: 'filePath', align: 'center', render: 'image' }, { title: '拓扑图', field: 'filePath', align: 'center', render: 'image' },

View File

@@ -8,12 +8,19 @@
<el-form-item label="编码"> <el-form-item label="编码">
<el-input v-model="form.code" placeholder="请输入编码" /> <el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item> </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-form-item label="备注">
<el-input v-model="form.remark" placeholder="请输入备注" /> <el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="排序">
<el-input-number v-model="form.sort" :min="0" /> <el-input-number v-model="form.sort" :min="0" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@@ -42,10 +49,18 @@ const form = reactive({
name: '', name: '',
code: '', code: '',
remark: '', remark: '',
type: 2,
sort: 100, sort: 100,
pid: '', pid: '',
id: '' 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 dialogVisible = ref(false)
const title = ref('新增菜单') const title = ref('新增菜单')
@@ -56,7 +71,7 @@ const open = (text: string, data?: anyObj) => {
if (key == 'sort') { if (key == 'sort') {
form[key] = data?.sort ? data[key] : 100 form[key] = data?.sort ? data[key] : 100
console.log("🚀 ~ open ~ form[key]:", form[key]) console.log("🚀 ~ open ~ form[key]:", form[key])
} }
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog class="cn-operate-dialog statistical-type-binding" v-model="dialogVisible" title="绑定指标" <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"> <el-scrollbar style="padding-right: 0">
<div class="box"> <div class="box">
<div class="box-left"> <div class="box-left">

View File

@@ -27,14 +27,30 @@ defineOptions({
const tableRef = ref() const tableRef = ref()
const bindingRef = ref() const bindingRef = ref()
const addRef = 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({ const tableStore = new TableStore({
showPage: false, showPage: false,
url: '/system-boot/dictTree/query', url: '/system-boot/dictTree/query',
method: 'POST', method: 'POST',
paramsPOST:true, paramsPOST: true,
column: [ 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: 'name' },
{
title: '类型', field: 'type',
width: 150,
formatter: row => {
return options.value.filter((item: any) => item.value == row.cellValue)[0]?.name
},
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',

View File

@@ -24,7 +24,9 @@ const tableStore = new TableStore({
method: 'POST', method: 'POST',
url: '/user-boot/referralCode/findReferralCode', url: '/user-boot/referralCode/findReferralCode',
column: [ 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: 'roleName' },
{ title: '推荐码', field: 'roleReferralCode' } { title: '推荐码', field: 'roleReferralCode' }
] ]

View File

@@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<span style="font-size: 14px; font-weight: bold"> <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> </span>
<el-tabs tab-position="left" class="demo-tabs" style="margin-top: 10px"> <el-tabs tab-position="left" class="demo-tabs" style="margin-top: 10px">
<el-tab-pane label="区域"> <el-tab-pane label="区域">

View File

@@ -70,7 +70,9 @@ const tableStore = new TableStore({
url: '/device-boot/runManage/getRuntimeData', url: '/device-boot/runManage/getRuntimeData',
method: 'POST', method: 'POST',
column: [ 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: 'areaName', align: 'center', width: 120 },
{ title: '供电公司', field: 'gdName', align: 'center', width: 120 }, { title: '供电公司', field: 'gdName', align: 'center', width: 120 },
{ title: '变电站', field: 'bdName', align: 'center', showOverflow: true, minWidth: 100 }, { title: '变电站', field: 'bdName', align: 'center', showOverflow: true, minWidth: 100 },

View File

@@ -40,7 +40,9 @@ const tableStore = new TableStore({
url: '/system-boot/dictType/list', url: '/system-boot/dictType/list',
method: 'POST', method: 'POST',
column: [ 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: 'name' },
{ title: '编码', field: 'code' }, { title: '编码', field: 'code' },
{ title: '开启等级', field: 'openLevelName' }, { title: '开启等级', field: 'openLevelName' },