联调过程监督 电能质量管理
This commit is contained in:
129
src/views/pqs/harmonicMonitoring/reportForms/passing/index.vue
Normal file
129
src/views/pqs/harmonicMonitoring/reportForms/passing/index.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<!--业务用户管理界面-->
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker area>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="筛选数据" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" @click="exportEvent" class="ml10" icon="el-icon-Download">导出</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<!--表格-->
|
||||
<Table ref="tableRef"></Table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { onMounted, provide, ref } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { pageTable } from '@/api/harmonic-boot/luckyexcel.ts'
|
||||
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/reate/word'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
//区域联级选择
|
||||
const industry = dictData.getBasicData('Interference_Source')
|
||||
//用户信息弹出框
|
||||
const tableRef = ref()
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/qualifiedReport/pageTable',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 60,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '变电站', field: 'subName', width: 200 },
|
||||
{ title: '监测点名称', field: 'lineName', width: 200 },
|
||||
{
|
||||
title: '行业类型',
|
||||
field: 'businessType',
|
||||
formatter: (row: any) => {
|
||||
return industry.find((item: any) => item.id == row.cellValue)?.name || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '分类等级',
|
||||
field: 'calssificationGrade',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
},
|
||||
{ title: '电压等级', field: 'voltageScale' },
|
||||
{
|
||||
title: '上级变电站',
|
||||
field: 'superiorsSubstation',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '挂接线路',
|
||||
field: 'hangLine',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'PT变比',
|
||||
field: 'pt',
|
||||
formatter: (row: any) => {
|
||||
return row.row.pt1 + '/' + row.row.pt2
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'CT变比',
|
||||
field: 'ct',
|
||||
formatter: (row: any) => {
|
||||
return row.row.ct1 + '/' + row.row.ct2
|
||||
}
|
||||
},
|
||||
{ title: '短路容量(MVA)', field: 'shortCapacity' },
|
||||
{ title: '设备容量(MVA)', field: 'deviceCapacity' },
|
||||
{ title: '协议容量(MVA)', field: 'dealCapacity' },
|
||||
{ title: '谐波情况', field: 'harmDes' },
|
||||
{ title: '电能质量情况', field: 'powerDes' }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.beginTime = tableStore.table.params.startTime
|
||||
tableStore.table.params.deptId = tableStore.table.params.deptIndex
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
provide('tableStore', tableStore)
|
||||
// 导出
|
||||
const exportEvent = () => {
|
||||
let form = JSON.parse(JSON.stringify(tableStore.table.params))
|
||||
form.pageNum = 1
|
||||
form.pageSize = tableStore.table.total
|
||||
pageTable(form).then(res => {
|
||||
tableRef.value.getRef().exportData({
|
||||
filename: '合格率报告', // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
data: res.data.records, // 数据源 // 过滤那个字段导出
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(column.$columnIndex === 0)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
@@ -23,7 +23,7 @@
|
||||
:show-file-list="false"
|
||||
ref="uploadRef"
|
||||
action=""
|
||||
:limit="1"
|
||||
accept=".png,.jpg"
|
||||
:on-change="choose"
|
||||
:auto-upload="false"
|
||||
>
|
||||
@@ -47,6 +47,7 @@
|
||||
</splitpanes>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
@@ -59,7 +60,7 @@ import { mainHeight } from '@/utils/layout'
|
||||
import { exportModel } from '@/api/process-boot/reportForms'
|
||||
import { genFileId, ElMessage } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/xieboReport'
|
||||
name: 'harmonic-boot/report/word'
|
||||
})
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
@@ -90,7 +91,8 @@ const handleNodeClick = (data: any, node: any) => {
|
||||
}
|
||||
// 上传
|
||||
const choose = (files: any) => {
|
||||
uploadList.value - files
|
||||
uploadList.value = files
|
||||
ElMessage.success('上传成功')
|
||||
}
|
||||
// 生成
|
||||
const exportEvent = () => {
|
||||
@@ -106,13 +108,14 @@ const exportEvent = () => {
|
||||
form.append('type', '0')
|
||||
form.append('startTime', tableStore.table.params.startTime)
|
||||
form.append('endTime', tableStore.table.params.endTime)
|
||||
dotList.value.forEach(item => {
|
||||
form.append('file', item)
|
||||
})
|
||||
|
||||
// uploadList.value.forEach(item => {
|
||||
// form.append('file', uploadList.value?.raw)
|
||||
// })
|
||||
|
||||
exportModel(form).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8",
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
|
||||
Reference in New Issue
Block a user