修改稳态报表展示处理

This commit is contained in:
zhujiyan
2024-08-12 11:35:56 +08:00
parent 8d69b36290
commit 390252bf16
4 changed files with 62 additions and 31 deletions

View File

@@ -21164,7 +21164,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "110kV排面岭光伏电站_110kV I母_110kV排营线", "v": "110kV排面岭光伏电站_204母线_204监测点",
"qp": 1, "qp": 1,
"m": "&lineName&", "m": "&lineName&",
"mc": { "mc": {
@@ -22291,7 +22291,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "2024-07-01 00:00:00_2024-07-15 23:59:59", "v": "2024-08-01 00:00:00_2024-08-08 23:59:59",
"qp": 1, "qp": 1,
"m": "&statis_time&", "m": "&statis_time&",
"mc": { "mc": {
@@ -23313,7 +23313,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "2023-06-01", "v": "2024-05-23",
"qp": 1, "qp": 1,
"m": "&This_Time_Check&", "m": "&This_Time_Check&",
"mc": { "mc": {
@@ -24360,7 +24360,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "110kV排面岭光伏电站_110kV I母_110kV排营线", "v": "110kV排面岭光伏电站_204母线_204监测点",
"qp": 1, "qp": 1,
"m": "&lineName&", "m": "&lineName&",
"mc": { "mc": {
@@ -24582,7 +24582,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "110kV", "v": "10kV",
"qp": 1, "qp": 1,
"m": "&voltageLevel&", "m": "&voltageLevel&",
"mc": { "mc": {
@@ -25461,7 +25461,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "110000:100", "v": "100:1",
"qp": 1, "qp": 1,
"m": "&pt&", "m": "&pt&",
"mc": { "mc": {
@@ -25557,7 +25557,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "300:5", "v": "5:5",
"qp": 1, "qp": 1,
"m": "&ct&", "m": "&ct&",
"mc": { "mc": {
@@ -25653,7 +25653,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "750.0", "v": "10.0",
"qp": 1, "qp": 1,
"m": "&Standard_Capacity&", "m": "&Standard_Capacity&",
"mc": { "mc": {
@@ -26532,7 +26532,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "750.0", "v": "10.0",
"qp": 1, "qp": 1,
"m": "&Short_Capacity&", "m": "&Short_Capacity&",
"mc": { "mc": {
@@ -26628,7 +26628,7 @@
"ht": 0, "ht": 0,
"vt": 0, "vt": 0,
"tb": 2, "tb": 2,
"v": "50.0", "v": "10.0",
"qp": 1, "qp": 1,
"m": "&Deal_Capacity&", "m": "&Deal_Capacity&",
"mc": { "mc": {
@@ -176188,5 +176188,4 @@
"rh_height": 2066, "rh_height": 2066,
"luckysheet_selection_range": [] "luckysheet_selection_range": []
} }
] ]

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="default-main" :style="height"> <div class="default-main" :style="height">
<splitpanes style="height: 100%; background: #fff" class="default-theme" id="navigation-splitpanes"> <splitpanes style="height: 100%" class="default-theme" id="navigation-splitpanes">
<pane :size="size"> <pane :size="size">
<PointTree <PointTree
:default-expand-all="false" :default-expand-all="false"
@@ -53,13 +53,13 @@ import { onMounted, ref, provide } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import PointTree from '@/components/tree/govern/pointTree.vue' import PointTree from '@/components/tree/govern/pointTree.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel' import { getTemplateByDept } from '@/api/harmonic-boot/luckyexcel'
import { exportExcel } from '@/views/system/reportForms/export.js' import { exportExcel } from '@/views/system/reportForms/export.js'
import 'splitpanes/dist/splitpanes.css' import 'splitpanes/dist/splitpanes.css'
import { Splitpanes, Pane } from 'splitpanes' import { Splitpanes, Pane } from 'splitpanes'
import data from './123.json' import data from './123.json'
import { useDictData } from '@/stores/dictData'
defineOptions({ defineOptions({
name: 'reportCore/statistics' name: 'reportCore/statistics'
}) })
@@ -95,21 +95,25 @@ const tableStore = new TableStore({
tableStore.table.params.lineId = dotList.value.id tableStore.table.params.lineId = dotList.value.id
}, },
loadCallback: () => { loadCallback: () => {
console.log(tableStore.table.data)
tableStore.table.data.forEach((item: any) => { tableStore.table.data.forEach((item: any) => {
item.data1 ? (item.data = JSON.parse(item.data1)) : ''
item.celldata.forEach((k: any) => { item.celldata.forEach((k: any) => {
item.data[k.r][k.c].v = k.v item.data[k.r][k.c].v ? (item.data[k.r][k.c].v = k.v) : ''
}) })
}) })
luckysheet.create({ console.log(tableStore.table.data)
container: 'luckysheet', setTimeout(() => {
title: '', // 表 头名 luckysheet.create({
lang: 'zh', // 中文 container: 'luckysheet',
showtoolbar: false, // 是否显示工具栏 title: '', // 表 头名
showinfobar: false, // 是否显示顶部信息栏 lang: 'zh', // 中文
showsheetbar: true, // 是否显示底部sheet按钮 showtoolbar: false, // 是否显示工具栏
data: tableStore.table.data showinfobar: false, // 是否显示顶部信息栏
}) showsheetbar: true, // 是否显示底部sheet按钮
data:data
// tableStore.table.data
})
}, 10)
} }
}) })
provide('tableStore', tableStore) provide('tableStore', tableStore)
@@ -141,7 +145,7 @@ const exportEvent = () => {
exportExcel(luckysheet.getAllSheets(), '统计报表下载') exportExcel(luckysheet.getAllSheets(), '统计报表下载')
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss">
.splitpanes.default-theme .splitpanes__pane { .splitpanes.default-theme .splitpanes__pane {
background: #fff; background: #fff;
} }

View File

@@ -85,6 +85,15 @@ const beforeUpload = (file: any) => {
} }
luckysheet.destroy() luckysheet.destroy()
options.value.title = exportJson.info.name options.value.title = exportJson.info.name
console.log('🚀 ~ exportJson.sheets:', exportJson.sheets)
exportJson.sheets.forEach((item: any) => {
// item.celldata = []
// item.data = []
item.celldata.forEach((k: any) => {
k.v.ct.s ? (k.v.v = k.v.ct.s[0].v) : ''
k.v.ct.s ? (k.v.m = k.v.ct.s[0].v) : ''
})
})
options.value.data = exportJson.sheets options.value.data = exportJson.sheets
luckysheet.create(options.value) luckysheet.create(options.value)
}) })
@@ -95,9 +104,14 @@ const preservation = () => {
} }
// 新增 // 新增
const submitForm = (formdata: any, text: string) => { const submitForm = (formdata: any, text: string) => {
console.log('🚀 ~ submitForm ~ text:', text) // let userStr = JSON.stringify(luckysheet.getAllSheets())
let userStr = JSON.stringify(luckysheet.getAllSheets()) let userStr = luckysheet.getAllSheets()
let blob = new Blob([userStr], { console.log('🚀 ~ submitForm ~ userStr:', userStr)
userStr.forEach((item: any) => {
item.data1 = JSON.stringify(item.data)
})
let blob = new Blob([JSON.stringify(userStr)], {
type: 'application/json;charset=UTF-8' type: 'application/json;charset=UTF-8'
}) })
let files = new window.File([blob], 'content.json', { let files = new window.File([blob], 'content.json', {

View File

@@ -85,6 +85,15 @@ const beforeUpload = (file: any) => {
} }
luckysheet.destroy() luckysheet.destroy()
options.value.title = exportJson.info.name options.value.title = exportJson.info.name
console.log('🚀 ~ exportJson.sheets:', exportJson.sheets)
exportJson.sheets.forEach((item: any) => {
// item.celldata = []
// item.data = []
item.celldata.forEach((k: any) => {
k.v.ct.s ? (k.v.v = k.v.ct.s[0].v) : ''
k.v.ct.s ? (k.v.m = k.v.ct.s[0].v) : ''
})
})
options.value.data = exportJson.sheets options.value.data = exportJson.sheets
luckysheet.create(options.value) luckysheet.create(options.value)
}) })
@@ -95,9 +104,14 @@ const preservation = () => {
} }
// 新增 // 新增
const submitForm = (formdata: any, text: string) => { const submitForm = (formdata: any, text: string) => {
console.log('🚀 ~ submitForm ~ text:', text) // let userStr = JSON.stringify(luckysheet.getAllSheets())
let userStr = JSON.stringify(luckysheet.getAllSheets()) let userStr = luckysheet.getAllSheets()
let blob = new Blob([userStr], { console.log('🚀 ~ submitForm ~ userStr:', userStr)
userStr.forEach((item: any) => {
item.data1 = JSON.stringify(item.data)
})
let blob = new Blob([JSON.stringify(userStr)], {
type: 'application/json;charset=UTF-8' type: 'application/json;charset=UTF-8'
}) })
let files = new window.File([blob], 'content.json', { let files = new window.File([blob], 'content.json', {