完成 监测点报告 迁移
This commit is contained in:
@@ -32,3 +32,11 @@ export function selectReleation(data) {
|
||||
params:data
|
||||
});
|
||||
}
|
||||
export function getLineExport(data) {
|
||||
return createAxios({
|
||||
url: "/event-boot/report/getLineExport",
|
||||
method: "post",
|
||||
data: data,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
@@ -23,4 +23,10 @@ export function delMenu(id: string) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function getTheme() {
|
||||
return createAxios({
|
||||
url: '/system-boot/theme/getTheme',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ const setDatePicker = (list: any) => {
|
||||
datePickerRef.value.setTimeOptions(list)
|
||||
}
|
||||
|
||||
defineExpose({ onComSearch, areaRef, setDatePicker })
|
||||
defineExpose({ onComSearch, areaRef, setDatePicker ,datePickerRef})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</pane>
|
||||
<pane style="background: #fff" :style="height">
|
||||
<!-- <div :style="height"></div> -->
|
||||
<TableHeader date-picker :show-search="false">
|
||||
<TableHeader ref="TableHeaderRef" date-picker :show-search="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label=" 模板策略">
|
||||
<el-select v-model="value" placeholder="请选择" @change="changeFn" clearable>
|
||||
@@ -29,38 +29,262 @@
|
||||
<el-button icon="el-icon-Download" type="primary" @click="exportEvent">生成报告</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<div class="box" :style="`height: calc(${tableStore.table.height} + 45px)`">
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">监测点详情</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.xq">监测点详情</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降事件列表</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.lb">表格</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降密度</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.mdbg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.mdtx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降事件点</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.sjdITIC">ITIC</el-checkbox>
|
||||
<el-checkbox v-model="formd.sjdF47">F47</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">概率分布</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.glfbfz">暂降幅值</el-checkbox>
|
||||
<el-checkbox v-model="formd.glfbsj">持续时间</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">月份统计</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.tjbg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.tjtx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降原因</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.yybg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.yytx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12" class="mTop">
|
||||
<div class="grid-content">
|
||||
<div class="divBox">暂降类型</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mTop">
|
||||
<el-checkbox v-model="formd.lxbg">表格</el-checkbox>
|
||||
<el-checkbox v-model="formd.lxtx">图形</el-checkbox>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import 'splitpanes/dist/splitpanes.css'
|
||||
import { Splitpanes, Pane } from 'splitpanes'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import PointTree from '@/components/tree/pms/pointTree.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { getLineExport, getList, selectReleation } from '@/api/event-boot/report.ts'
|
||||
import { useMonitoringPoint } from '@/stores/monitoringPoint'
|
||||
|
||||
import { ElMessage } from 'element-plus'
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const size = ref(0)
|
||||
const templatePolicy = ref([])
|
||||
const value = ref('')
|
||||
const TableHeaderRef = ref()
|
||||
const dotList: any = ref({
|
||||
name:monitoringPoint.state.lineName.split('>')[3],
|
||||
id:monitoringPoint.state.lineId,
|
||||
level:6
|
||||
})
|
||||
|
||||
|
||||
const formd: any = ref({
|
||||
xq: false,
|
||||
lb: false,
|
||||
mdbg: false,
|
||||
mdtx: false,
|
||||
sjdITIC: false,
|
||||
sjdF47: false,
|
||||
glfbfz: false,
|
||||
glfbsj: false,
|
||||
tjbg: false,
|
||||
tjtx: false,
|
||||
yybg: false,
|
||||
yytx: false,
|
||||
lxbg: false,
|
||||
lxtx: false,
|
||||
type: 0
|
||||
})
|
||||
|
||||
|
||||
const templatePolicy: any = ref([])
|
||||
const tableStore = new TableStore({
|
||||
url: '',
|
||||
method: '',
|
||||
column: []
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
const dom = document.getElementById('navigation-splitpanes')
|
||||
if (dom) {
|
||||
size.value = Math.round((280 / dom.offsetHeight) * 100)
|
||||
}
|
||||
})
|
||||
getList({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
type: 0
|
||||
}).then(res => {
|
||||
templatePolicy.value = res.data.records
|
||||
})
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
if (data.level === 6) {
|
||||
monitoringPoint.setValue('lineId', data.id)
|
||||
}
|
||||
dotList.value = data
|
||||
}
|
||||
const changeFn = val => {
|
||||
formd.value = {
|
||||
xq: false,
|
||||
lb: false,
|
||||
mdbg: false,
|
||||
mdtx: false,
|
||||
sjdITIC: false,
|
||||
sjdF47: false,
|
||||
glfbfz: false,
|
||||
glfbsj: false,
|
||||
tjbg: false,
|
||||
tjtx: false,
|
||||
yybg: false,
|
||||
yytx: false,
|
||||
lxbg: false,
|
||||
lxtx: false,
|
||||
type: 0
|
||||
}
|
||||
let data = {
|
||||
id: val
|
||||
}
|
||||
|
||||
selectReleation(data).then(res => {
|
||||
res.data.forEach(item => {
|
||||
for (let k in formd.value) {
|
||||
if (item.name == k) {
|
||||
formd.value[k] = true
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
const exportEvent = () => {
|
||||
if (dotList.value.level != 6) {
|
||||
return ElMessage({
|
||||
message: '请选择监测点进行报告生成!',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
let a = ''
|
||||
|
||||
formd.value.lineId = dotList.value.id
|
||||
formd.value.lineName = dotList.value.name
|
||||
formd.value.searchBeginTime = tableStore.table.params.searchBeginTime
|
||||
formd.value.searchEndTime = tableStore.table.params.searchEndTime
|
||||
formd.value.flag = TableHeaderRef.value.datePickerRef.interval
|
||||
ElMessage('生成报告中,请稍等!')
|
||||
getLineExport(formd.value).then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
// createObjectURL(blob); //创建下载的链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = '监测点报告' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
}
|
||||
const exportEvent = () => {}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.splitpanes.default-theme .splitpanes__pane {
|
||||
background: #eaeef1;
|
||||
}
|
||||
.grid-content {
|
||||
text-align: center;
|
||||
}
|
||||
.divBox {
|
||||
width: 250px;
|
||||
height: 31px;
|
||||
margin: auto;
|
||||
line-height: 32px;
|
||||
border: 1px solid #c9c9c9;
|
||||
&:hover {
|
||||
border: 1px solid #002255;
|
||||
}
|
||||
}
|
||||
.box {
|
||||
padding: 10px;
|
||||
// margin-top: 10px;
|
||||
overflow-y: auto;
|
||||
font-size: 15px;
|
||||
}
|
||||
.el-divider--horizontal {
|
||||
margin: 10px 0;
|
||||
}
|
||||
.mTop {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="login-container-form">
|
||||
<div class="title-container">
|
||||
<div class="title">
|
||||
<span style="font-size: 28px">电能质量数据监测云平台</span>
|
||||
<span style="font-size: 28px">{{ getThemeList.name || '电能质量监测系统' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-form :rules="rules" ref="formRef" size="large" class="login-form" :model="form">
|
||||
@@ -72,6 +72,7 @@ import type { FormInstance, InputInstance, FormRules } from 'element-plus'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ADMIN_INFO } from '@/stores/constant/cacheKey'
|
||||
import { Local } from '@/utils/storage'
|
||||
import { getTheme } from '@/api/systerm.ts'
|
||||
import PopupUpdatePwd from './popupUpdatePwd.vue'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -84,7 +85,7 @@ const passwordRef = ref<InputInstance>()
|
||||
const userInfo = useAdminInfo()
|
||||
Local.remove(ADMIN_INFO)
|
||||
userInfo.removeToken()
|
||||
|
||||
const getThemeList: any = ref([])
|
||||
interface RuleForm {
|
||||
username: string
|
||||
password: string
|
||||
@@ -122,7 +123,9 @@ onBeforeUnmount(() => {
|
||||
clearTimeout(timer)
|
||||
pageBubble.removeListeners()
|
||||
})
|
||||
|
||||
getTheme().then(res => {
|
||||
getThemeList.value = res.data
|
||||
})
|
||||
const onSubmit = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
|
||||
Reference in New Issue
Block a user