云平台自测问题修改
This commit is contained in:
@@ -72,7 +72,7 @@ const initListByIds = () => {
|
||||
|
||||
const templateListData = () => {
|
||||
getTemplateList({}).then(res => {
|
||||
templateList.value = res.data.filter(item => item.name === '稳态治理报表')
|
||||
templateList.value = res.data.filter(item => item.reportForm == 4)
|
||||
if (!tableStore.table.params.tempId && templateList.value?.length > 0) {
|
||||
tableStore.table.params.tempId = templateList.value[0].id
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ const initLineList = async () => {
|
||||
cslineList({}).then(res => {
|
||||
lineList.value = res.data
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
initCode()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -434,7 +435,6 @@ watch(
|
||||
|
||||
onMounted(async () => {
|
||||
await initLineList()
|
||||
await initCode()
|
||||
})
|
||||
|
||||
watch(
|
||||
|
||||
@@ -1,294 +1,303 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class="analyze-dvr" v-show="!isWaveCharts" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||
<DeviceTree @node-click="nodeClick" @init="nodeClick" @deviceTypeChange="deviceTypeChange"></DeviceTree>
|
||||
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
|
||||
<TableHeader datePicker showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="事件类型">
|
||||
<el-select
|
||||
v-model.trim="tableStore.table.params.eventType"
|
||||
clearable
|
||||
placeholder="请选择事件类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in eventList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="位置">
|
||||
<el-select
|
||||
v-model.trim="tableStore.table.params.location"
|
||||
clearable
|
||||
placeholder="请选择位置"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in locationList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table v-if="view" ref="tableRef"></Table>
|
||||
</div>
|
||||
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
|
||||
</div>
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
v-if="isWaveCharts"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false"
|
||||
:wp="wp"
|
||||
style="padding: 10px"
|
||||
/>
|
||||
<!-- <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div v-if="view2" style="display: flex">
|
||||
<el-radio-group v-model.trim="value" @change="changeView">
|
||||
<el-radio-button label="一次值" :value="1" />
|
||||
<el-radio-button label="二次值" :value="2" />
|
||||
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button v-if="view2" @click="backbxlb" class="el-icon-refresh-right" icon="el-icon-Back"
|
||||
style="float: right">
|
||||
返回
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-tabs v-if="view2" class="default-main" v-model.trim="bxactiveName" @tab-click="bxhandleClick">
|
||||
<el-tab-pane label="瞬时波形" name="ssbx" class="boxbx pt10 pb10"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<shushiboxi v-if="bxactiveName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList" :wp="wp">
|
||||
</shushiboxi>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="RMS波形" class="boxbx pt10 pb10" name="rmsbx"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<rmsboxi v-if="bxactiveName == 'rmsbx' && showBoxi" :value="value" :boxoList="boxoList" :wp="wp">
|
||||
</rmsboxi>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick, provide, onMounted } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
import { ElMessage } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'govern/analyze/DVR/index'
|
||||
})
|
||||
const pageHeight = mainHeight(20)
|
||||
const loading = ref(false)
|
||||
const view = ref(true)
|
||||
const view2 = ref(false)
|
||||
const showBoxi = ref(true)
|
||||
const isWaveCharts = ref(false)
|
||||
const bxactiveName = ref('ssbx')
|
||||
const boxoList: any = ref({})
|
||||
const wp = ref({})
|
||||
const eventList = ref([
|
||||
{
|
||||
value: 'Evt_Sys_DipStr',
|
||||
label: '电压暂降'
|
||||
},
|
||||
{
|
||||
value: 'Evt_Sys_SwlStr',
|
||||
label: '电压暂升'
|
||||
},
|
||||
{
|
||||
value: 'Evt_Sys_IntrStr',
|
||||
label: '电压中断'
|
||||
}
|
||||
])
|
||||
const locationList = ref([
|
||||
{
|
||||
value: 'grid',
|
||||
label: '电网侧'
|
||||
},
|
||||
{
|
||||
value: 'load',
|
||||
label: '负载侧'
|
||||
}
|
||||
])
|
||||
const waveFormAnalysisRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '事件描述', field: 'showName' },
|
||||
{ title: '发生位置', field: 'evtParamPosition' },
|
||||
{ title: '持续时间(s)', field: 'evtParamTm', sortable: true },
|
||||
{
|
||||
title: '暂降(聚升)幅值(%)',
|
||||
field: 'evtParamVVaDepth',
|
||||
formatter: (row: any) => {
|
||||
let a = row.cellValue.split('%')[0] - 0
|
||||
console.log('🚀 ~ a:', a)
|
||||
return a ? a.toFixed(2) : '/'
|
||||
}, sortable: true
|
||||
},
|
||||
{ title: '发生时刻', field: 'startTime', sortable: true },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
text: '波形分析',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !row.wavePath && row.evtParamTm < 20
|
||||
},
|
||||
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
loading.value = true
|
||||
isWaveCharts.value = true
|
||||
await analyseWave(row.id)
|
||||
.then(res => {
|
||||
row.loading1 = false
|
||||
if (res != undefined) {
|
||||
boxoList.value = row
|
||||
boxoList.value.featureAmplitude =
|
||||
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||
// boxoList.value.systemType = 'WX'
|
||||
wp.value = res.data
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
row.loading1 = false
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
nextTick(() => {
|
||||
waveFormAnalysisRef.value &&
|
||||
waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
|
||||
waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(false, 150)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
text: '暂无波形',
|
||||
type: 'info',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !(!row.wavePath && row.evtParamTm < 20)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形下载',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Check',
|
||||
loading: 'loading2',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
// && row.evtParamTm < 20
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
item.loading = false
|
||||
item.evtParamTm = item.evtParamTm.split('s')[0]
|
||||
})
|
||||
}
|
||||
})
|
||||
const flag = ref(false)
|
||||
tableStore.table.params.type = 0
|
||||
tableStore.table.params.eventType = ''
|
||||
tableStore.table.params.location = ''
|
||||
provide('tableStore', tableStore)
|
||||
const deviceTypeChange = (val: any, obj: any) => {
|
||||
flag.value = true
|
||||
nodeClick(obj)
|
||||
}
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
// console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
if (e.level == 2&& flag.value) {
|
||||
loading.value = false
|
||||
tableStore.table.params.deviceId = e.id
|
||||
nextTick(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const changeView = () => {
|
||||
showBoxi.value = false
|
||||
setTimeout(() => {
|
||||
showBoxi.value = true
|
||||
}, 0)
|
||||
}
|
||||
const bxhandleClick = (tab: any) => {
|
||||
if (tab.name == 'ssbx') {
|
||||
bxactiveName.value = 'ssbx'
|
||||
} else if (tab.name == 'rmsbx') {
|
||||
bxactiveName.value = 'rmsbx'
|
||||
}
|
||||
// console.log(tab, event);
|
||||
}
|
||||
const backbxlb = () => {
|
||||
view.value = true
|
||||
view2.value = false
|
||||
}
|
||||
const bxecharts = mainHeight(95).height as any
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.analyze-dvr {
|
||||
display: flex;
|
||||
|
||||
&-right {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
padding: 10px 10px 10px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<div class="analyze-dvr" v-show="!isWaveCharts" :style="{ height: pageHeight.height }" v-loading="loading">
|
||||
<DeviceTree @node-click="nodeClick" @init="nodeClick" @deviceTypeChange="deviceTypeChange"></DeviceTree>
|
||||
<div class="analyze-dvr-right" v-if="tableStore.table.params.deviceId">
|
||||
<TableHeader datePicker showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="事件类型">
|
||||
<el-select
|
||||
v-model.trim="tableStore.table.params.eventType"
|
||||
clearable
|
||||
placeholder="请选择事件类型"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in eventList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="位置">
|
||||
<el-select
|
||||
v-model.trim="tableStore.table.params.location"
|
||||
clearable
|
||||
placeholder="请选择位置"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in locationList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table v-if="view" ref="tableRef"></Table>
|
||||
</div>
|
||||
<el-empty v-else description="请选择设备" class="analyze-dvr-right" />
|
||||
</div>
|
||||
<waveFormAnalysis
|
||||
v-loading="loading"
|
||||
v-if="isWaveCharts"
|
||||
ref="waveFormAnalysisRef"
|
||||
@handleHideCharts="isWaveCharts = false"
|
||||
:wp="wp"
|
||||
style="padding: 10px"
|
||||
/>
|
||||
<!-- <div :style="{ height: pageHeight.height }" style="padding: 10px; overflow: hidden" v-if="!view">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div v-if="view2" style="display: flex">
|
||||
<el-radio-group v-model.trim="value" @change="changeView">
|
||||
<el-radio-button label="一次值" :value="1" />
|
||||
<el-radio-button label="二次值" :value="2" />
|
||||
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button v-if="view2" @click="backbxlb" class="el-icon-refresh-right" icon="el-icon-Back"
|
||||
style="float: right">
|
||||
返回
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-tabs v-if="view2" class="default-main" v-model.trim="bxactiveName" @tab-click="bxhandleClick">
|
||||
<el-tab-pane label="瞬时波形" name="ssbx" class="boxbx pt10 pb10"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<shushiboxi v-if="bxactiveName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList" :wp="wp">
|
||||
</shushiboxi>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="RMS波形" class="boxbx pt10 pb10" name="rmsbx"
|
||||
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
|
||||
<rmsboxi v-if="bxactiveName == 'rmsbx' && showBoxi" :value="value" :boxoList="boxoList" :wp="wp">
|
||||
</rmsboxi>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, nextTick, provide, onMounted } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
|
||||
import { analyseWave } from '@/api/common'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
|
||||
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
|
||||
import { ElMessage } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'govern/analyze/DVR/index'
|
||||
})
|
||||
const pageHeight = mainHeight(20)
|
||||
const loading = ref(false)
|
||||
const view = ref(true)
|
||||
const view2 = ref(false)
|
||||
const showBoxi = ref(true)
|
||||
const isWaveCharts = ref(false)
|
||||
const bxactiveName = ref('ssbx')
|
||||
const boxoList: any = ref({})
|
||||
const wp = ref({})
|
||||
const eventList = ref([
|
||||
{
|
||||
value: 'Evt_Sys_DipStr',
|
||||
label: '电压暂降'
|
||||
},
|
||||
{
|
||||
value: 'Evt_Sys_SwlStr',
|
||||
label: '电压暂升'
|
||||
},
|
||||
{
|
||||
value: 'Evt_Sys_IntrStr',
|
||||
label: '电压中断'
|
||||
}
|
||||
])
|
||||
const locationList = ref([
|
||||
{
|
||||
value: 'grid',
|
||||
label: '电网侧'
|
||||
},
|
||||
{
|
||||
value: 'load',
|
||||
label: '负载侧'
|
||||
}
|
||||
])
|
||||
const waveFormAnalysisRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '事件描述', field: 'showName', minWidth: 150 },
|
||||
{ title: '发生位置', field: 'evtParamPosition', minWidth: 150 },
|
||||
{
|
||||
title: '持续时间(s)',
|
||||
field: 'evtParamTm',
|
||||
sortable: true,
|
||||
minWidth: 110,
|
||||
formatter: (row: any) => {
|
||||
return Math.floor(row.cellValue * 10000) / 100
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '暂降(聚升)幅值(%)',
|
||||
field: 'evtParamVVaDepth',
|
||||
minWidth: 150,
|
||||
formatter: (row: any) => {
|
||||
let a = row.cellValue.split('%')[0] - 0
|
||||
return a ? a.toFixed(2) : '/'
|
||||
},
|
||||
sortable: true
|
||||
},
|
||||
{ title: '发生时刻', field: 'startTime', sortable: true, minWidth: 180 },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
text: '波形分析',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !row.wavePath && row.evtParamTm < 20
|
||||
},
|
||||
|
||||
click: async row => {
|
||||
row.loading1 = true
|
||||
loading.value = true
|
||||
isWaveCharts.value = true
|
||||
await analyseWave(row.id)
|
||||
.then(res => {
|
||||
row.loading1 = false
|
||||
if (res != undefined) {
|
||||
boxoList.value = row
|
||||
boxoList.value.featureAmplitude =
|
||||
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
|
||||
// boxoList.value.systemType = 'WX'
|
||||
wp.value = res.data
|
||||
}
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
row.loading1 = false
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
nextTick(() => {
|
||||
waveFormAnalysisRef.value &&
|
||||
waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
|
||||
waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(false, 150)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
text: '暂无波形',
|
||||
type: 'info',
|
||||
icon: 'el-icon-DataLine',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !(!row.wavePath && row.evtParamTm < 20)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '波形下载',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Check',
|
||||
loading: 'loading2',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
// && row.evtParamTm < 20
|
||||
return !row.wavePath
|
||||
},
|
||||
click: row => {
|
||||
getFileZip({ eventId: row.id }).then(res => {
|
||||
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link) //释放标签
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
item.loading = false
|
||||
item.evtParamTm = item.evtParamTm.split('s')[0]
|
||||
})
|
||||
}
|
||||
})
|
||||
const flag = ref(false)
|
||||
tableStore.table.params.type = 0
|
||||
tableStore.table.params.eventType = ''
|
||||
tableStore.table.params.location = ''
|
||||
provide('tableStore', tableStore)
|
||||
const deviceTypeChange = (val: any, obj: any) => {
|
||||
flag.value = true
|
||||
nodeClick(obj)
|
||||
}
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
// console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
if (e.level == 2 && flag.value) {
|
||||
loading.value = false
|
||||
tableStore.table.params.deviceId = e.id
|
||||
nextTick(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const changeView = () => {
|
||||
showBoxi.value = false
|
||||
setTimeout(() => {
|
||||
showBoxi.value = true
|
||||
}, 0)
|
||||
}
|
||||
const bxhandleClick = (tab: any) => {
|
||||
if (tab.name == 'ssbx') {
|
||||
bxactiveName.value = 'ssbx'
|
||||
} else if (tab.name == 'rmsbx') {
|
||||
bxactiveName.value = 'rmsbx'
|
||||
}
|
||||
// console.log(tab, event);
|
||||
}
|
||||
const backbxlb = () => {
|
||||
view.value = true
|
||||
view2.value = false
|
||||
}
|
||||
const bxecharts = mainHeight(95).height as any
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.analyze-dvr {
|
||||
display: flex;
|
||||
|
||||
&-right {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
padding: 10px 10px 10px 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,176 +1,176 @@
|
||||
<!-- 补召日志 -->
|
||||
<template>
|
||||
<el-dialog modal-class="analysisList" v-model.trim="dialogVisible" title="补召日志" width="70%" draggable
|
||||
@closed="close">
|
||||
<TableHeader date-picker :showReset="false">
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-Connection" @click="handleImport">
|
||||
离线补召
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-Monitor" @click="handleaddDevice">
|
||||
在线补召
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</el-dialog>
|
||||
<popup ref="detailRef"></popup>
|
||||
<!-- 离线数据导入组件 -->
|
||||
<!-- <offLineDataImport ref="offLineDataImportRef"></offLineDataImport> -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, provide, onBeforeUnmount } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import offLineDataImport from '../offLineDataImport/index.vue'
|
||||
import popup from './popup.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
defineOptions({
|
||||
name: 'offLineDataImport'
|
||||
})
|
||||
const emit = defineEmits(['back'])
|
||||
const dialogVisible = ref(false)
|
||||
const height = ref(0)
|
||||
height.value = window.innerHeight < 1080 ? 230 : 450
|
||||
const detailRef: any = ref()
|
||||
const lineId = ref('')
|
||||
const deviceId = ref('')
|
||||
const deviceData = ref({})
|
||||
const { push, options, currentRoute } = useRouter()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
|
||||
publicHeight: 420,
|
||||
method: 'POST',
|
||||
column: [
|
||||
// { width: '60', type: 'checkbox', fixed: 'left' },
|
||||
{
|
||||
title: '序号', width: 80, formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'projectName',
|
||||
title: '工程名称',
|
||||
minWidth: 170,
|
||||
formatter: row => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'successCount', title: '成功解析数', minWidth: 150 },
|
||||
{ field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true },
|
||||
{ field: 'endTime', title: '导入结束时间', minWidth: 170 , sortable: true},
|
||||
{
|
||||
title: '解析状态',
|
||||
field: 'status',
|
||||
width: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'success',
|
||||
2: 'danger',
|
||||
3: 'primary'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未解析',
|
||||
1: '解析成功',
|
||||
2: '解析失败',
|
||||
3: '文件不存在'
|
||||
}
|
||||
// formatter: row => {
|
||||
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '100',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
// console.log(row.portableOfflLogList)
|
||||
detailRef.value.open(row.portableOfflLogList)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
// tableStore.table.params.devId = tableParams.value.devId
|
||||
// tableStore.table.params.lineId = tableParams.value.lineId
|
||||
// tableStore.table.params.list = tableParams.value.list
|
||||
// tableStore.table.params.type = 3
|
||||
},
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data=[]
|
||||
tableStore.table.height = 400
|
||||
// console.log(tableStore.table.publicHeight, 'tableStore.table.data')
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
//返回
|
||||
const handleBack = () => {
|
||||
emit('back')
|
||||
}
|
||||
const open = (row: any) => {
|
||||
lineId.value = row.lineId
|
||||
deviceData.value = row.deviceData
|
||||
deviceId.value = row.deviceId
|
||||
dialogVisible.value = true
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 10)
|
||||
}
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const updateViewportHeight = async () => {
|
||||
// height.value = window.innerHeight;
|
||||
height.value = window.innerHeight < 1080 ? 230 : 450
|
||||
// tableStore.table.publicHeight = height.value
|
||||
// await tableStore.index()
|
||||
}
|
||||
//设备补召
|
||||
const handleaddDevice = () => {
|
||||
push({
|
||||
path: '/supplementaryRecruitment',
|
||||
query: {
|
||||
activeName: '0',
|
||||
id: lineId.value,
|
||||
ndid: deviceData.value?.ndid,
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const offLineDataImportRef = ref()
|
||||
const handleImport = () => {
|
||||
//设备devId&监测点lineId带入组件
|
||||
// offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
|
||||
push({
|
||||
path: '/supplementaryRecruitment',
|
||||
query: {
|
||||
activeName: '1',
|
||||
lineId: lineId.value,
|
||||
deviceId: deviceId.value,
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
updateViewportHeight() // 初始化视口高度
|
||||
window.addEventListener('resize', updateViewportHeight) // 监听窗口大小变化
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', updateViewportHeight) // 移除监听
|
||||
})
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
<!-- 补召日志 -->
|
||||
<template>
|
||||
<el-dialog modal-class="analysisList" v-model.trim="dialogVisible" title="补召日志" width="70%" draggable
|
||||
@closed="close">
|
||||
<TableHeader date-picker :showReset="false">
|
||||
<template #operation>
|
||||
<el-button type="primary" icon="el-icon-Connection" @click="handleImport">
|
||||
离线补召
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-Monitor" @click="handleaddDevice">
|
||||
在线补召
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" :height="`calc(45vh - 50px)`"/>
|
||||
</el-dialog>
|
||||
<popup ref="detailRef"></popup>
|
||||
<!-- 离线数据导入组件 -->
|
||||
<!-- <offLineDataImport ref="offLineDataImportRef"></offLineDataImport> -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, provide, onBeforeUnmount } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import offLineDataImport from '../offLineDataImport/index.vue'
|
||||
import popup from './popup.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
defineOptions({
|
||||
name: 'offLineDataImport'
|
||||
})
|
||||
const emit = defineEmits(['back'])
|
||||
const dialogVisible = ref(false)
|
||||
const height = ref(0)
|
||||
height.value = window.innerHeight < 1080 ? 230 : 450
|
||||
const detailRef: any = ref()
|
||||
const lineId = ref('')
|
||||
const deviceId = ref('')
|
||||
const deviceData = ref({})
|
||||
const { push, options, currentRoute } = useRouter()
|
||||
const tableStore: any = new TableStore({
|
||||
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
|
||||
publicHeight: 420,
|
||||
method: 'POST',
|
||||
column: [
|
||||
// { width: '60', type: 'checkbox', fixed: 'left' },
|
||||
{
|
||||
title: '序号', width: 80, formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'projectName',
|
||||
title: '工程名称',
|
||||
minWidth: 170,
|
||||
formatter: row => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
},
|
||||
{ field: 'successCount', title: '成功解析数', minWidth: 150 },
|
||||
{ field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true },
|
||||
{ field: 'endTime', title: '导入结束时间', minWidth: 170 , sortable: true},
|
||||
{
|
||||
title: '解析状态',
|
||||
field: 'status',
|
||||
width: 100,
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'success',
|
||||
2: 'danger',
|
||||
3: 'primary'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '未解析',
|
||||
1: '解析成功',
|
||||
2: '解析失败',
|
||||
3: '文件不存在'
|
||||
}
|
||||
// formatter: row => {
|
||||
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
|
||||
// },
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '100',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
// console.log(row.portableOfflLogList)
|
||||
detailRef.value.open(row.portableOfflLogList)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
// tableStore.table.params.devId = tableParams.value.devId
|
||||
// tableStore.table.params.lineId = tableParams.value.lineId
|
||||
// tableStore.table.params.list = tableParams.value.list
|
||||
// tableStore.table.params.type = 3
|
||||
},
|
||||
loadCallback: () => {
|
||||
// tableStore.table.data=[]
|
||||
tableStore.table.height = 400
|
||||
// console.log(tableStore.table.publicHeight, 'tableStore.table.data')
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
//返回
|
||||
const handleBack = () => {
|
||||
emit('back')
|
||||
}
|
||||
const open = (row: any) => {
|
||||
lineId.value = row.lineId
|
||||
deviceData.value = row.deviceData
|
||||
deviceId.value = row.deviceId
|
||||
dialogVisible.value = true
|
||||
setTimeout(() => {
|
||||
tableStore.index()
|
||||
}, 10)
|
||||
}
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
const updateViewportHeight = async () => {
|
||||
// height.value = window.innerHeight;
|
||||
height.value = window.innerHeight < 1080 ? 230 : 450
|
||||
// tableStore.table.publicHeight = height.value
|
||||
// await tableStore.index()
|
||||
}
|
||||
//设备补召
|
||||
const handleaddDevice = () => {
|
||||
push({
|
||||
path: '/supplementaryRecruitment',
|
||||
query: {
|
||||
activeName: '0',
|
||||
id: lineId.value,
|
||||
ndid: deviceData.value?.ndid,
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
const offLineDataImportRef = ref()
|
||||
const handleImport = () => {
|
||||
//设备devId&监测点lineId带入组件
|
||||
// offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
|
||||
push({
|
||||
path: '/supplementaryRecruitment',
|
||||
query: {
|
||||
activeName: '1',
|
||||
lineId: lineId.value,
|
||||
deviceId: deviceId.value,
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
updateViewportHeight() // 初始化视口高度
|
||||
window.addEventListener('resize', updateViewportHeight) // 监听窗口大小变化
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', updateViewportHeight) // 移除监听
|
||||
})
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -498,9 +498,9 @@ const range = (start: any, end: any, step: any) => {
|
||||
const colors = ['#DAA520', '#2E8B57', '#A52a2a']
|
||||
const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
||||
|
||||
const titleList: any = ref('')
|
||||
const titleList: any = ref('(未绑定数据)')
|
||||
const init = (flag: boolean) => {
|
||||
titleList.value = ''
|
||||
titleList.value = '(未绑定数据)'
|
||||
let list: any = []
|
||||
|
||||
//颜色数组
|
||||
@@ -574,6 +574,8 @@ const init = (flag: boolean) => {
|
||||
}).then(res => {
|
||||
if (res.data.length == 0) {
|
||||
titleList.value = '(未绑定数据)'
|
||||
}else{
|
||||
titleList.value = ''
|
||||
}
|
||||
chartTitle.value = chartTitle.value + titleList.value
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ const tableStore = new TableStore({
|
||||
{ title: '用户名称', field: 'userName', align: 'center', minWidth: '130' },
|
||||
{ title: '更新时间', field: 'updateTime', align: 'center', sortable: true, minWidth: '150' },
|
||||
{ title: '失败原因', field: 'failReason', align: 'center', minWidth: '200' },
|
||||
{ title: '状态', field: 'result', align: 'center', minWidth: '120' },
|
||||
{ title: '状态', field: 'result', align: 'center', minWidth: '100' },
|
||||
{ title: '登录名', field: 'loginName', align: 'center', minWidth: '120' }
|
||||
],
|
||||
|
||||
|
||||
@@ -1,107 +1,149 @@
|
||||
<template>
|
||||
<div class="default-main" v-loading="loading">
|
||||
<TableHeader ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="模版名称">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.name" clearable
|
||||
placeholder="请输入名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装置型号">
|
||||
<el-select v-model.trim="tableStore.table.params.devType" placeholder="请选择" clearable>
|
||||
<el-option v-for="item in DevTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload action="" class="upload-demo" :show-file-list="false" :auto-upload="false"
|
||||
:on-change="chooseFile">
|
||||
<el-button :icon="Plus" type="primary" class="ml10">新增模版</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { addDevModel } from '@/api/access-boot/analyzeModel'
|
||||
import { AuditDevModel } from '@/api/cs-device-boot/devmodel'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/manage/basic/template'
|
||||
})
|
||||
const DevTypeOptions = ref()
|
||||
const tableHeaderRef = ref()
|
||||
queryByCode('Direct_Connected_Device').then(res => {
|
||||
queryByid(res.data.id).then(res => {
|
||||
DevTypeOptions.value = res.data
|
||||
})
|
||||
})
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-device-boot/devmodel/queryDevModelPage',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '装置型号', field: 'devTypeName' },
|
||||
{ title: '模板名称', field: 'name' },
|
||||
{ title: '版本号', field: 'versionNo' },
|
||||
{ title: '版本时间', field: 'versionDate', sortable: true },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
AuditDevModel({
|
||||
id: row.id,
|
||||
status: 0
|
||||
}).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
tableStore.table.params.devType = ''
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const loading = ref(false)
|
||||
const chooseFile = (e: any) => {
|
||||
console.warn(e)
|
||||
loading.value = true
|
||||
addDevModel(e.raw).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
loading.value = false
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
}).catch((e) => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="default-main" v-loading="loading">
|
||||
<TableHeader ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="模版名称">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="tableStore.table.params.name"
|
||||
clearable
|
||||
placeholder="请输入名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装置型号">
|
||||
<el-select v-model.trim="tableStore.table.params.devType" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in DevTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload
|
||||
action=""
|
||||
class="upload-demo"
|
||||
:accept="'.json'"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:on-change="chooseFile"
|
||||
>
|
||||
<el-button :icon="Plus" type="primary" class="ml10">新增模版</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { addDevModel } from '@/api/access-boot/analyzeModel'
|
||||
import { AuditDevModel } from '@/api/cs-device-boot/devmodel'
|
||||
import { getFileUrl, downLoadFile } from '@/api/cs-system-boot/manage'
|
||||
defineOptions({
|
||||
name: 'govern/manage/basic/template'
|
||||
})
|
||||
const DevTypeOptions = ref()
|
||||
const tableHeaderRef = ref()
|
||||
queryByCode('Direct_Connected_Device').then(res => {
|
||||
queryByid(res.data.id).then(res => {
|
||||
DevTypeOptions.value = res.data
|
||||
})
|
||||
})
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-device-boot/devmodel/queryDevModelPage',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '装置型号', field: 'devTypeName' },
|
||||
{ title: '模板名称', field: 'name' },
|
||||
{ title: '版本号', field: 'versionNo' },
|
||||
{ title: '版本时间', field: 'versionDate', sortable: true },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '下载模版',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
downloadTheReport(row.filePath,row.devTypeName)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
AuditDevModel({
|
||||
id: row.id,
|
||||
status: 0
|
||||
}).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
tableStore.table.params.devType = ''
|
||||
tableStore.table.params.name = ''
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
const loading = ref(false)
|
||||
const chooseFile = (e: any) => {
|
||||
console.warn(e)
|
||||
loading.value = true
|
||||
addDevModel(e.raw)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
loading.value = false
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
// 下载报告
|
||||
const downloadTheReport = (filePath: string,name:string) => {
|
||||
downLoadFile(filePath).then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: ' application/json'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = name+'.json' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -128,7 +128,7 @@ defineOptions({
|
||||
const adminInfo = useAdminInfo()
|
||||
|
||||
const hasAdmin =
|
||||
adminInfo.userType.some(item => item.includes('operation_manager') || item.includes('root')) ||
|
||||
adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root')) ||
|
||||
adminInfo.userType == 1
|
||||
const tableRef = ref()
|
||||
const popupRef = ref()
|
||||
|
||||
@@ -112,7 +112,7 @@ const choose = (files: any) => {
|
||||
const isJPEG = files.raw.type === 'image/jpeg'
|
||||
const isPNG = files.raw.type === 'image/png'
|
||||
if (!isJPG && !isPNG && !isJPEG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
ElMessage.warning('上传文件只能是 jpg/png 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ onMounted(() => {
|
||||
// })
|
||||
|
||||
const stencil = (val: any) => {
|
||||
templatePolicy.value = val.filter((item: any) => item.name != '稳态治理报表')
|
||||
templatePolicy.value = val.filter((item: any) => item.reportForm != '4')
|
||||
Template.value = templatePolicy.value[0]
|
||||
reportForm.value = templatePolicy.value[0]?.reportForm
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ const initListByIds = () => {
|
||||
}
|
||||
const stencil = (val: any) => {
|
||||
console.log('🚀 ~ stencil ~ val:', val)
|
||||
templatePolicy.value = val.filter((item: any) => item.name == '稳态治理报表')
|
||||
templatePolicy.value = val.filter((item: any) => item.reportForm == '4')
|
||||
Template.value = templatePolicy.value[0]
|
||||
reportForm.value = templatePolicy.value[0]?.reportForm
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog draggable :title="title" v-model.trim="formVisible" width="30%" :before-close="closeDialog">
|
||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm">
|
||||
<el-dialog draggable :title="title" v-model.trim="formVisible" width="500px" :before-close="closeDialog">
|
||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm" class="form-one">
|
||||
<el-form-item label="模板名称:" prop="name">
|
||||
<el-input maxlength="32" show-word-limit placeholder="模板名称" v-model.trim="formdata.name"
|
||||
style="width: 100%"></el-input>
|
||||
@@ -56,11 +56,15 @@ const reportFormList = [
|
||||
{
|
||||
value: '2',
|
||||
label: '统计报表'
|
||||
}, {
|
||||
value: '4',
|
||||
label: '治理前后对比报表'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '自定义报表'
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
|
||||
|
||||
@@ -41,7 +41,7 @@ const tableStore: any = new TableStore({
|
||||
column: [
|
||||
{ field: 'name', title: '模板名称' },
|
||||
{ field: 'reportForm', title: '模板类型',formatter: (row) => {
|
||||
return row.cellValue == 1 ? '电能质量报表类型' : row.cellValue == 2 ? '用能报表类型' : ''
|
||||
return row.cellValue == 1 ? '分析报表' : row.cellValue == 2 ? '统计报表' : row.cellValue == 3 ? '自定义报表' : '治理前后对比报表'
|
||||
} },
|
||||
{ field: 'updateBy', title: '更新用户' },
|
||||
{ field: 'createTime', title: '创建时间' , sortable: true},
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增</el-button>
|
||||
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table
|
||||
@@ -71,7 +70,7 @@
|
||||
</span>
|
||||
<div>
|
||||
<template v-if="data.id">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-tooltip content="编辑" placement="left">
|
||||
<el-button
|
||||
style="margin-left: 4px"
|
||||
icon="el-icon-Edit"
|
||||
@@ -82,23 +81,22 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-popconfirm title="确定重启吗?" placement="bottom" @confirm="restart(data)">
|
||||
<el-popconfirm title="确定重启吗?" placement="left" @confirm="restart(data)">
|
||||
<template #reference>
|
||||
<el-tooltip content="重启" placement="top">
|
||||
<el-button
|
||||
style="margin-left: 4px"
|
||||
icon="el-icon-Refresh"
|
||||
type="warning"
|
||||
link
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
style="margin-left: 4px"
|
||||
icon="el-icon-Refresh"
|
||||
type="warning"
|
||||
link
|
||||
@click.stop
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ confirm, cancel }">
|
||||
<el-button size="small" @click="cancel">取消</el-button>
|
||||
<el-button type="warning" size="small" @click="confirm">确认</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -179,12 +177,17 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 绑定进程号 -->
|
||||
<el-dialog draggable title="绑定进程号" v-model="popUps" :close-on-click-modal="false" width="400px">
|
||||
<el-form :model="bindProcessForm" ref="bindProcessFormRef" label-width="80px" :rules="rules2" >
|
||||
<el-dialog draggable title="绑定进程号" v-model="popUps" :close-on-click-modal="false" width="400px">
|
||||
<el-form :model="bindProcessForm" ref="bindProcessFormRef" label-width="80px" :rules="rules2">
|
||||
<el-form-item label="前置机" prop="nodeId">
|
||||
<el-select v-model="bindProcessForm.nodeId" placeholder="请选择前置机" style="width: 100%" clearable @change="handleNodeChange">
|
||||
<el-select
|
||||
v-model="bindProcessForm.nodeId"
|
||||
placeholder="请选择前置机"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
@change="handleNodeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableStore.table.data"
|
||||
:key="item.id"
|
||||
@@ -193,9 +196,14 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="进程号" prop="processNo">
|
||||
<el-select v-model="bindProcessForm.processNo" placeholder="请选择进程号" style="width: 100%" clearable>
|
||||
<el-select
|
||||
v-model="bindProcessForm.processNo"
|
||||
placeholder="请选择进程号"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in processOptions"
|
||||
:key="item.name"
|
||||
@@ -211,7 +219,6 @@
|
||||
<el-button type="primary" @click="bindTheProcess">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -222,7 +229,14 @@ import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElButton } from 'element-plus'
|
||||
import {addNode,updateNode,delNode,nodeDeviceTree,restartProcess,updateProcess} from '@/api/cs-device-boot/frontManagement'
|
||||
import {
|
||||
addNode,
|
||||
updateNode,
|
||||
delNode,
|
||||
nodeDeviceTree,
|
||||
restartProcess,
|
||||
updateProcess
|
||||
} from '@/api/cs-device-boot/frontManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/setting/frontManagement'
|
||||
@@ -427,7 +441,6 @@ const currentChangeEvent = () => {
|
||||
|
||||
// 重启进程
|
||||
const restart = (data: any) => {
|
||||
|
||||
restartProcess({
|
||||
nodeId: nodeId.value,
|
||||
processNo: data.processNo
|
||||
@@ -442,11 +455,10 @@ const change = (val: any) => {
|
||||
treeRef.value!.filter(filterText.value)
|
||||
}
|
||||
|
||||
|
||||
// 修改 edit 方法
|
||||
const edit = (data: any) => {
|
||||
bindProcessForm.value.processNo = data.nodeProcess
|
||||
bindProcessForm.value.nodeId = nodeId.value // 默认选中当前节点
|
||||
bindProcessForm.value.nodeId = nodeId.value // 默认选中当前节点
|
||||
processId.value = data.id
|
||||
popUps.value = true
|
||||
|
||||
@@ -466,7 +478,6 @@ const loadProcessOptionsForNode = (nodeId: string) => {
|
||||
} else {
|
||||
processOptions.value = []
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -477,13 +488,12 @@ const handleNodeChange = (nodeId: any) => {
|
||||
bindProcessForm.value.processNo = ''
|
||||
return
|
||||
}
|
||||
// 清除之前选中的进程号
|
||||
// 清除之前选中的进程号
|
||||
bindProcessForm.value.processNo = ''
|
||||
// 加载新选中前置机的进程号选项
|
||||
loadProcessOptionsForNode(nodeId)
|
||||
}
|
||||
|
||||
|
||||
// 更新进程号
|
||||
const bindTheProcess = () => {
|
||||
bindProcessFormRef.value.validate((valid: any) => {
|
||||
@@ -499,8 +509,6 @@ const bindTheProcess = () => {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
const filterNode = (value: string, data: any, node: any) => {
|
||||
if (!value) return true
|
||||
@@ -537,7 +545,6 @@ const chooseNode = (value: string, data: any, node: any) => {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
tableStore.table.params.orderBy = 'desc'
|
||||
tableStore.table.params.nodeGrade = ''
|
||||
tableStore.table.params.searchState = ''
|
||||
@@ -591,8 +598,6 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
}, 100)
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -623,7 +628,6 @@ onMounted(() => {
|
||||
}
|
||||
:deep(.default) {
|
||||
display: flex;
|
||||
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
|
||||
@@ -1,107 +1,107 @@
|
||||
<template>
|
||||
<el-dialog draggable :title="title" v-model.trim="formVisible" width="30%" :before-close="closeDialog">
|
||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm">
|
||||
<el-form-item label="模板名称:" prop="name">
|
||||
<el-input maxlength="32" show-word-limit placeholder="模板名称" v-model.trim="formdata.name"
|
||||
style="width: 100%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门:" prop="deptId">
|
||||
<Area v-model.trim="formdata.deptId" style="width: 100%" collapse-tags
|
||||
:props="{ multiple: true, label: 'name', value: 'id', emitPath: false }" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模板类型:" prop="reportType">
|
||||
<el-select style="width: 100%" v-model.trim="formdata.reportType" placeholder="请选择模板类型">
|
||||
<el-option v-for="item in classificationData" :key="item.id" :label="item.label"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报表类型:" prop="reportForm">
|
||||
<el-select style="width: 100%" v-model.trim="formdata.reportForm" placeholder="请选择报表类型">
|
||||
<el-option v-for="item in reportFormList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="closeDialog">取 消</el-button>
|
||||
<el-button type="primary" @click="preservation">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
import { getCustomReportTemplateById } from '@/api/harmonic-boot/luckyexcel'
|
||||
import { ref, reactive } from 'vue'
|
||||
const emit = defineEmits(['submitForm'])
|
||||
const title = ref('')
|
||||
const list = ref({})
|
||||
const ruleForm = ref()
|
||||
const formVisible = ref(false)
|
||||
const classificationData = [
|
||||
{
|
||||
label: '电能质量报表类型',
|
||||
id: '1'
|
||||
},
|
||||
{
|
||||
label: '用能报表类型',
|
||||
id: '2'
|
||||
}
|
||||
]
|
||||
const reportFormList = [
|
||||
{
|
||||
value: '1',
|
||||
label: '分析报表'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '统计报表'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '自定义报表'
|
||||
}
|
||||
]
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
|
||||
deptId: [{ required: true, message: '请选择部门', trigger: 'change' }],
|
||||
reportType: [{ required: true, message: '请选择模板类型', trigger: 'change' }],
|
||||
reportForm: [{ required: true, message: '请选择报表类型', trigger: 'change' }]
|
||||
}
|
||||
const formdata = ref({
|
||||
name: '',
|
||||
deptId: [],
|
||||
reportType: '',
|
||||
reportForm: ''
|
||||
})
|
||||
// 确定
|
||||
const preservation = () => {
|
||||
ruleForm.value.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
emit('submitForm', formdata.value, title.value)
|
||||
formVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 关闭
|
||||
const closeDialog = () => {
|
||||
formVisible.value = false
|
||||
}
|
||||
const open = (text: string, row?: any) => {
|
||||
title.value = text
|
||||
if (row.id) {
|
||||
getCustomReportTemplateById({ id: row.id }).then(res => {
|
||||
formdata.value = res.data
|
||||
formdata.value.deptId = res.data.valueTitle.split(',')
|
||||
})
|
||||
}
|
||||
|
||||
formVisible.value = true
|
||||
}
|
||||
const shutDown = () => {
|
||||
formVisible.value = false
|
||||
}
|
||||
defineExpose({ open,shutDown})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
<template>
|
||||
<el-dialog draggable :title="title" v-model.trim="formVisible" width="30%" :before-close="closeDialog">
|
||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm">
|
||||
<el-form-item label="模板名称:" prop="name">
|
||||
<el-input maxlength="32" show-word-limit placeholder="模板名称" v-model.trim="formdata.name"
|
||||
style="width: 100%"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="部门:" prop="deptId">
|
||||
<Area v-model.trim="formdata.deptId" style="width: 100%" collapse-tags
|
||||
:props="{ multiple: true, label: 'name', value: 'id', emitPath: false }" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模板类型:" prop="reportType">
|
||||
<el-select style="width: 100%" v-model.trim="formdata.reportType" placeholder="请选择模板类型">
|
||||
<el-option v-for="item in classificationData" :key="item.id" :label="item.label"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报表类型:" prop="reportForm">
|
||||
<el-select style="width: 100%" v-model.trim="formdata.reportForm" placeholder="请选择报表类型">
|
||||
<el-option v-for="item in reportFormList" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="closeDialog">取 消</el-button>
|
||||
<el-button type="primary" @click="preservation">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import Area from '@/components/form/area/index.vue'
|
||||
import { getCustomReportTemplateById } from '@/api/harmonic-boot/luckyexcel'
|
||||
import { ref, reactive } from 'vue'
|
||||
const emit = defineEmits(['submitForm'])
|
||||
const title = ref('')
|
||||
const list = ref({})
|
||||
const ruleForm = ref()
|
||||
const formVisible = ref(false)
|
||||
const classificationData = [
|
||||
{
|
||||
label: '电能质量报表类型',
|
||||
id: '1'
|
||||
},
|
||||
{
|
||||
label: '用能报表类型',
|
||||
id: '2'
|
||||
}
|
||||
]
|
||||
const reportFormList = [
|
||||
{
|
||||
value: '1',
|
||||
label: '分析报表'
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '统计报表'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '自定义报表'
|
||||
}
|
||||
]
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
|
||||
deptId: [{ required: true, message: '请选择部门', trigger: 'change' }],
|
||||
reportType: [{ required: true, message: '请选择模板类型', trigger: 'change' }],
|
||||
reportForm: [{ required: true, message: '请选择报表类型', trigger: 'change' }]
|
||||
}
|
||||
const formdata = ref({
|
||||
name: '',
|
||||
deptId: [],
|
||||
reportType: '',
|
||||
reportForm: ''
|
||||
})
|
||||
// 确定
|
||||
const preservation = () => {
|
||||
ruleForm.value.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
emit('submitForm', formdata.value, title.value)
|
||||
formVisible.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 关闭
|
||||
const closeDialog = () => {
|
||||
formVisible.value = false
|
||||
}
|
||||
const open = (text: string, row?: any) => {
|
||||
title.value = text
|
||||
if (row.id) {
|
||||
getCustomReportTemplateById({ id: row.id }).then(res => {
|
||||
formdata.value = res.data
|
||||
formdata.value.deptId = res.data.valueTitle.split(',')
|
||||
})
|
||||
}
|
||||
|
||||
formVisible.value = true
|
||||
}
|
||||
const shutDown = () => {
|
||||
formVisible.value = false
|
||||
}
|
||||
defineExpose({ open,shutDown})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user