驾驶舱页面绘制

绘制2、稳态电能质量分析、稳态治理效果分析、暂态电能质量分析页面
This commit is contained in:
guanj
2025-10-20 13:25:30 +08:00
parent 177e50de75
commit 676bb37bbe
52 changed files with 12265 additions and 3807 deletions

View File

@@ -1,5 +1,6 @@
<template>
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" width="930px" :title="title" @close="cancel">
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" width="1000px" :title="title"
@close="cancel">
<div style="display: flex">
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef" style="flex: 1">
<el-form-item class="top" label="组件名称" prop="name">
@@ -31,10 +32,10 @@
<el-input v-model="form.sort" placeholder="请输入组件排序"></el-input>
</el-form-item>
</el-form>
<div style="width: 550px; height: 370px; overflow: hidden">
<div style="width: 600px; height: 360px; overflow: hidden">
<div class="ml10" style="font-weight: 600">组件展示</div>
<component :is="registerComponent(form.path)" v-if="registerComponent(form.path)"
class="pd10 GridLayout" :key="form.path" :height="'350px'" :width="'533px'"
class="pd10 GridLayout" :key="form.path" :height="'350px'" :width="'580px'"
:timeKey="form.timeKey" />
<!-- <div class="pd10">组件加载失败...</div> -->
<el-empty v-else description="未查询到组件" style="height: 350px; width: 533px" />
@@ -57,6 +58,7 @@ import TableStore from '@/utils/tableStore' // 若不是列表页面弹框可删
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
import IconSelector from '@/components/baInput/components/iconSelector.vue'
import html2canvas from 'html2canvas'
const dictData = useDictData()
const dialogVisible = ref(false)
const title = ref('')
@@ -104,11 +106,12 @@ const submit = () => {
formRef.value.validate(async (valid: boolean) => {
if (valid) {
let url = ''
await html2canvas(document.querySelector('.GridLayout'), {
scale: 2
}).then(canvas => {
url = canvas.toDataURL('image/png')
console.log('🚀 ~ html2canvas ~ url:', url)
})
if (title.value == '新增组件') {
await componentAdd({
@@ -150,7 +153,7 @@ const registerComponent = (path: string): Component | string | null => {
try {
// 动态导入组件
const modules = import.meta.glob('@/views/**/*.vue')
const modules = import.meta.glob('@/**/*.vue')
if (!modules[path]) {
console.error(`组件加载失败: ${path}`)
return null