Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59489aaafa | ||
|
|
5d0421dd40 | ||
|
|
6d7ef7cf5d | ||
|
|
8d9ccf97a7 | ||
|
|
7188e3e681 | ||
|
|
a9fc77eb8b | ||
|
|
87af11288d | ||
|
|
0763187744 | ||
|
|
ae641604ba | ||
|
|
564e6ef4ab | ||
|
|
c84c5dae3b | ||
|
|
c902dabb73 | ||
|
|
8d1497032f | ||
|
|
6aeac753ef | ||
|
|
56d65a6c17 | ||
|
|
8b356c87a3 | ||
|
|
c0feeaee7b | ||
|
|
6a112c8ae2 | ||
|
|
a19952b771 | ||
|
|
0b76347853 | ||
|
|
379951699d | ||
|
|
003737cf52 | ||
|
|
20e6d3719a | ||
|
|
77617412dd | ||
|
|
68ea43c42b | ||
|
|
e65df4daad | ||
|
|
136248eec2 | ||
|
|
bfafb6dc5b | ||
|
|
0b91027da4 | ||
|
|
22aeb0bf4c | ||
|
|
87bc9d9017 | ||
|
|
43d4d37cd0 | ||
|
|
ad1528e53b | ||
|
|
c1e36440e7 | ||
|
|
16f5213d7a | ||
|
|
ab891e6125 | ||
|
|
36c8ab87a2 | ||
|
|
6c3037f19b | ||
|
|
54517c0d5f | ||
|
|
715cdb892f | ||
|
|
953b96fe05 | ||
|
|
cb19fef4c6 | ||
|
|
98c887b79d |
6
.env.qujing
Normal file
6
.env.qujing
Normal file
@@ -0,0 +1,6 @@
|
||||
# 云南曲靖
|
||||
NODE_ENV = qujing
|
||||
VITE_NAME="qujing"
|
||||
# 电网一张图 地图图层
|
||||
VITE_NARIMAP=null
|
||||
VITE_NRGISCOMMON=null
|
||||
@@ -7,10 +7,12 @@
|
||||
"dev": "vite --mode dev",
|
||||
"dev:jibei": "vite --mode jibei",
|
||||
"dev:hainan": "vite --mode hainan",
|
||||
"dev:qujing": "vite --mode qujing",
|
||||
"dev:removeMode": "vite --mode removeMode",
|
||||
"build": "vite build --mode dev",
|
||||
"build:jibei": "vite build --mode jibei",
|
||||
"build:hainan": "vite build --mode hainan",
|
||||
"build:qujing": "vite build --mode qujing",
|
||||
"build:removeMode": "vite build --mode removeMode",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
|
||||
@@ -206,3 +206,11 @@ export function exportTerminalBase() {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
//一键分配终端
|
||||
export function allotTerminal(data: any) {
|
||||
return createAxios({
|
||||
url: '/device-boot/nodeDevice/oneKeyDistribution',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,72 +1,115 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
//事件报告
|
||||
export function getEventReport(data) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getEventReport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 生成报告
|
||||
export function getAreaReport(data) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getAreaReport',
|
||||
method: 'post',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
//查询所有模板
|
||||
export function getList(data) {
|
||||
return createAxios({
|
||||
url: '/system-boot/EventTemplate/getList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function selectReleation(data) {
|
||||
return createAxios({
|
||||
url: '/system-boot/EventTemplate/selectReleation',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
export function getLineExport(data) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getLineExport',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
export function getVoltage(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getVoltage',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getGeneralSituation(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getGeneralSituation',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getTransientValue(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/transient/getTransientValue',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 周报导出
|
||||
export function getExport(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getExport',
|
||||
method: 'post',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
import createAxios from '@/utils/request'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
|
||||
//事件报告
|
||||
export function getEventReport(data) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getEventReport',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 生成报告
|
||||
export function getAreaReport(data) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getAreaReport',
|
||||
method: 'post',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
}).then(async res => {
|
||||
let load: any = await readJsonBlob(res)
|
||||
if (load.code) {
|
||||
if (load.data.code == 'A0011') {
|
||||
ElMessage.warning('下载失败!')
|
||||
} else {
|
||||
ElMessage.warning(load.data.message)
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}
|
||||
async function readJsonBlob(blob) {
|
||||
try {
|
||||
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||
const jsonStr = await blob.text()
|
||||
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||
const jsonData = JSON.parse(jsonStr)
|
||||
// 3. 拿到数据,后续随便用
|
||||
return {
|
||||
code: true,
|
||||
data: jsonData
|
||||
}
|
||||
} catch (err) {
|
||||
return {
|
||||
code: false,
|
||||
data: {}
|
||||
}
|
||||
// console.error('解析Blob的JSON数据失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
//查询所有模板
|
||||
export function getList(data) {
|
||||
return createAxios({
|
||||
url: '/system-boot/EventTemplate/getList',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function selectReleation(data) {
|
||||
return createAxios({
|
||||
url: '/system-boot/EventTemplate/selectReleation',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
export function getLineExport(data) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getLineExport',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
}).then(async res => {
|
||||
let load: any = await readJsonBlob(res)
|
||||
if (load.code) {
|
||||
if (load.data.code == 'A0011') {
|
||||
ElMessage.warning('下载失败!')
|
||||
} else {
|
||||
ElMessage.warning(load.data.message)
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}
|
||||
export function getVoltage(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getVoltage',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getGeneralSituation(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getGeneralSituation',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getTransientValue(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/transient/getTransientValue',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 周报导出
|
||||
export function getExport(data: any) {
|
||||
return createAxios({
|
||||
url: '/event-boot/report/getExport',
|
||||
method: 'post',
|
||||
data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,18 +1,48 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getHistoryResult(data: any) {
|
||||
return request({
|
||||
url: '/harmonic-boot/harmonic/getHistoryResult',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// word报告
|
||||
export function exportModelJB(data: any) {
|
||||
return request({
|
||||
url: '/harmonic-boot/exportmodel/exportModelJB',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
import request from '@/utils/request'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
export function getHistoryResult(data: any) {
|
||||
return request({
|
||||
url: '/harmonic-boot/harmonic/getHistoryResult',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// word报告
|
||||
export function exportModelJB(data: any) {
|
||||
return request({
|
||||
url: '/harmonic-boot/exportmodel/exportModelJB',
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
data: data
|
||||
}).then(async res => {
|
||||
let load: any = await readJsonBlob(res)
|
||||
if (load.code) {
|
||||
if (load.data.code == 'A0011') {
|
||||
ElMessage.warning('下载失败!')
|
||||
} else {
|
||||
ElMessage.warning(load.data.message)
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}
|
||||
async function readJsonBlob(blob) {
|
||||
try {
|
||||
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||
const jsonStr = await blob.text()
|
||||
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||
const jsonData = JSON.parse(jsonStr)
|
||||
// 3. 拿到数据,后续随便用
|
||||
return {
|
||||
code: true,
|
||||
data: jsonData
|
||||
}
|
||||
} catch (err) {
|
||||
return {
|
||||
code: false,
|
||||
data: {}
|
||||
}
|
||||
// console.error('解析Blob的JSON数据失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,60 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
export function exportModel(data: any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/exportmodel/exportModel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
import createAxios from '@/utils/request'
|
||||
import { genFileId, ElMessage, ElNotification } from 'element-plus'
|
||||
|
||||
export function exportModel(data: any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/exportmodel/exportModel',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
}).then(async res => {
|
||||
let load: any = await readJsonBlob(res)
|
||||
if (load.code) {
|
||||
if (load.data.code == 'A0011') {
|
||||
ElMessage.warning('下载失败!')
|
||||
} else {
|
||||
ElMessage.warning(load.data.message)
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}
|
||||
export function areaHarmonicReport(data: any) {
|
||||
return createAxios({
|
||||
url: '/harmonic-boot/areaHarmonicReport/areaHarmonicReport',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob'
|
||||
}).then(async res => {
|
||||
let load: any = await readJsonBlob(res)
|
||||
if (load.code) {
|
||||
if (load.data.code == 'A0011') {
|
||||
ElMessage.warning('下载失败!')
|
||||
} else {
|
||||
ElMessage.warning(load.data.message)
|
||||
}
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
})
|
||||
}
|
||||
async function readJsonBlob(blob) {
|
||||
try {
|
||||
// 1. Blob.text() 读取二进制 → 直接转为 字符串(自动处理编码)
|
||||
const jsonStr = await blob.text()
|
||||
// 2. JSON.parse 解析字符串 → 得到可用的 JS 对象/数组
|
||||
const jsonData = JSON.parse(jsonStr)
|
||||
// 3. 拿到数据,后续随便用
|
||||
return {
|
||||
code: true,
|
||||
data: jsonData
|
||||
}
|
||||
} catch (err) {
|
||||
return {
|
||||
code: false,
|
||||
data: {}
|
||||
}
|
||||
// console.error('解析Blob的JSON数据失败:', err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const uploadFile = (file: any, path: string) => {
|
||||
data: form
|
||||
}).then(res => {
|
||||
if (res.code == `A0000`) {
|
||||
ElMessage.success('上传成功!')
|
||||
ElMessage.success('文件上传成功!')
|
||||
return res
|
||||
}
|
||||
})
|
||||
|
||||
BIN
src/assets/img/region.png
Normal file
BIN
src/assets/img/region.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 243 KiB |
BIN
src/assets/logo/海南.png
Normal file
BIN
src/assets/logo/海南.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
BIN
src/assets/logo/灿能.png
Normal file
BIN
src/assets/logo/灿能.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/logo/电网.png
Normal file
BIN
src/assets/logo/电网.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 249 KiB |
BIN
src/assets/logo/电网1.png
Normal file
BIN
src/assets/logo/电网1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -23,7 +23,7 @@ export function upper(str) {
|
||||
}
|
||||
|
||||
export function makeOptionsRule(t, to, userOptions) {
|
||||
console.log(userOptions[0])
|
||||
//console.log(userOptions[0])
|
||||
const options = [
|
||||
{ label: t('props.optionsType.struct'), value: 0 },
|
||||
{ label: t('props.optionsType.json'), value: 1 },
|
||||
|
||||
@@ -43,7 +43,6 @@ if (VITE_FLAG) {
|
||||
})
|
||||
} else {
|
||||
setTimeout(async () => {
|
||||
|
||||
const previewUrl = await previewFile(currentRoute.value?.href?.split('?')[1])
|
||||
url.value = previewUrl
|
||||
excelOptions.value = ref({
|
||||
|
||||
@@ -707,7 +707,7 @@ const processSave = async () => {
|
||||
// return result.value || ' '
|
||||
// }
|
||||
onBeforeMount(() => {
|
||||
console.log(props, 'propspropspropsprops')
|
||||
//console.log(props, 'propspropspropsprops')
|
||||
})
|
||||
onMounted(() => {
|
||||
initBpmnModeler()
|
||||
|
||||
@@ -15,7 +15,7 @@ const addTask = (event, options: any = {}) => {
|
||||
const ElementFactory = bpmnInstances().elementFactory
|
||||
const create = bpmnInstances().modeler.get('create')
|
||||
|
||||
console.log(ElementFactory, create)
|
||||
//console.log(ElementFactory, create)
|
||||
|
||||
const shape = ElementFactory.createShape(assign({ type: 'bpmn:UserTask' }, options))
|
||||
|
||||
@@ -23,8 +23,8 @@ const addTask = (event, options: any = {}) => {
|
||||
shape.businessObject.di.isExpanded = options.isExpanded
|
||||
}
|
||||
|
||||
console.log(event, 'event')
|
||||
console.log(shape, 'shape')
|
||||
//console.log(event, 'event')
|
||||
//console.log(shape, 'shape')
|
||||
create.start(event, shape)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -172,7 +172,7 @@ const unwatchBpmn = watch(
|
||||
return
|
||||
}
|
||||
|
||||
console.log('props.bpmnModeler 有值了!!!')
|
||||
//console.log('props.bpmnModeler 有值了!!!')
|
||||
const w = window as any
|
||||
w.bpmnInstances = {
|
||||
modeler: props.bpmnModeler,
|
||||
|
||||
@@ -179,7 +179,7 @@ onBeforeUnmount(() => {
|
||||
watch(
|
||||
() => props.businessObject,
|
||||
(val) => {
|
||||
console.log(val, 'val')
|
||||
//console.log(val, 'val')
|
||||
nextTick(() => {
|
||||
resetFlowCondition()
|
||||
})
|
||||
|
||||
@@ -376,7 +376,7 @@ const openListenerForm = (listener, index?) => {
|
||||
}
|
||||
// 移除监听器
|
||||
const removeListener = (listener, index?) => {
|
||||
console.log(listener, 'listener')
|
||||
//console.log(listener, 'listener')
|
||||
ElMessageBox.confirm('确认移除该监听器吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消'
|
||||
|
||||
@@ -20,7 +20,7 @@ export function initListenerForm(listener) {
|
||||
self.eventDefinitionType = key.replace('time', '').toLowerCase()
|
||||
}
|
||||
}
|
||||
console.log(k)
|
||||
//console.log(k)
|
||||
self.eventTimeDefinitions = listener.eventDefinitions[0][k].body
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ const modelConfig = computed(() => {
|
||||
const bpmnInstances = () => (window as any)?.bpmnInstances
|
||||
|
||||
const initDataList = () => {
|
||||
console.log(window, 'window')
|
||||
//console.log(window, 'window')
|
||||
rootElements.value = bpmnInstances().modeler.getDefinitions().rootElements
|
||||
messageIdMap.value = {}
|
||||
signalIdMap.value = {}
|
||||
|
||||
@@ -39,7 +39,7 @@ function xml2json(xml) {
|
||||
|
||||
function xmlObj2json(xml) {
|
||||
const xmlObj = xmlStr2XmlObj(xml)
|
||||
console.log(xmlObj)
|
||||
// console.log(xmlObj)
|
||||
let jsonObj = {}
|
||||
if (xmlObj.childNodes.length > 0) {
|
||||
jsonObj = xml2json(xmlObj)
|
||||
|
||||
@@ -223,7 +223,7 @@ const echart = () => {
|
||||
|
||||
series: [
|
||||
{
|
||||
name: '异常总数',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barWidth: 12,
|
||||
data: [100],
|
||||
@@ -240,7 +240,7 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
color: '#FF9100' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
@@ -249,7 +249,7 @@ const echart = () => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '异常占比',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barWidth: 13,
|
||||
data: [
|
||||
@@ -270,11 +270,11 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#FF9100' // 0% 处的颜色
|
||||
color: '#57bc6e ' // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FF9100' // 100% 处的颜色
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
|
||||
@@ -222,7 +222,7 @@ const echart = () => {
|
||||
|
||||
series: [
|
||||
{
|
||||
name: '异常总数',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barWidth: 12,
|
||||
data: [100],
|
||||
@@ -239,7 +239,7 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
color: '#FF9100' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
@@ -248,7 +248,7 @@ const echart = () => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '异常占比',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barWidth: 13,
|
||||
data: [
|
||||
@@ -269,11 +269,11 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#FF9100' // 0% 处的颜色
|
||||
color: '#57bc6e' // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FF9100' // 100% 处的颜色
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
|
||||
@@ -17,6 +17,7 @@ const config = useConfig()
|
||||
// import { nextTick } from 'process'
|
||||
const emit = defineEmits(['triggerPoint', 'group', 'echartClick'])
|
||||
color[0] = config.layout.elementUiPrimary[0]
|
||||
|
||||
const chartRef = ref<HTMLDivElement>()
|
||||
|
||||
const props = defineProps(['options', 'isInterVal', 'pieInterVal'])
|
||||
@@ -70,6 +71,8 @@ const initChart = () => {
|
||||
const value =
|
||||
item.value === 3.14159 || item.value === 0.14159
|
||||
? '暂无数据'
|
||||
: item.value === 0.14158
|
||||
? 0
|
||||
: Math.round(item.value * 100) / 100 // 处理特殊值
|
||||
tips += `<div style=" display: flex;justify-content: space-between;">
|
||||
<span>${item.marker}
|
||||
@@ -154,7 +157,6 @@ const initChart = () => {
|
||||
if (params.seriesName == '暂态触发点') {
|
||||
emit('triggerPoint', params.data)
|
||||
} else {
|
||||
|
||||
emit('echartClick', params)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, ref, watch, onMounted, defineEmits } from 'vue'
|
||||
import { onBeforeUnmount, ref, watch, onMounted, } from 'vue'
|
||||
import * as echarts from 'echarts'
|
||||
import 'echarts-gl'
|
||||
import 'echarts-liquidfill'
|
||||
@@ -19,14 +19,21 @@ const myCharts = ref()
|
||||
const showCircle = ref(false)
|
||||
|
||||
const fetchConfig = async (name: string) => {
|
||||
const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
|
||||
return res.default
|
||||
try {
|
||||
// 处理城市名称(去掉末尾的"市")并尝试导入对应文件
|
||||
const res = await import(`../../assets/map/${name.replace(/市$/, '')}.json`)
|
||||
return res.default
|
||||
} catch (error) {
|
||||
const chinaRes = await import(`../../assets/map/中国.json`) // 请确认中国文件的实际命名
|
||||
return chinaRes.default
|
||||
}
|
||||
// const res = await import(`../../assets/map/${name.replace(/市$/, "")}.json`)
|
||||
// return res.default
|
||||
// GetEchar(res.default)
|
||||
}
|
||||
// fetchConfig()
|
||||
|
||||
const emit = defineEmits(['getRegionByRegion', 'eliminate', 'clickMap'])
|
||||
onMounted(() => { })
|
||||
|
||||
const GetEchar = async (name: string) => {
|
||||
let chartDom = document.getElementById('chartMap')
|
||||
@@ -36,6 +43,7 @@ const GetEchar = async (name: string) => {
|
||||
name == dictData.state.area?.[0].name ? (showCircle.value = false) : (showCircle.value = true)
|
||||
|
||||
echarts.registerMap(name, await fetchConfig(name)) //注册可用的地图
|
||||
|
||||
let option = {
|
||||
title: {
|
||||
left: 'center',
|
||||
@@ -91,6 +99,7 @@ const GetEchar = async (name: string) => {
|
||||
// top: 10,
|
||||
// bottom: 0,
|
||||
roam: true,
|
||||
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
@@ -170,6 +179,7 @@ const GetEchar = async (name: string) => {
|
||||
}, 0)
|
||||
window.addEventListener('resize', resizeHandler)
|
||||
const flag1 = ref(true)
|
||||
|
||||
// 点击事件
|
||||
myCharts.value.off('click')
|
||||
myCharts.value.on('click', (e: any) => {
|
||||
|
||||
@@ -1,441 +1,441 @@
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<div>
|
||||
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
|
||||
<div class="bx" id="wave"></div>
|
||||
</div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
|
||||
<el-table stripe :data="Data" :height="height" border style="width: 100%"
|
||||
header-cell-class-name="table_header">
|
||||
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
|
||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
|
||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="number" label="相位跳变(°)">
|
||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="三相电压不平衡度(%)" width="180"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="暂降类型"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import * as echarts from 'echarts'
|
||||
import url from '@/assets/img/point.png'
|
||||
import $ from 'jquery'
|
||||
export default {
|
||||
props: {
|
||||
flag: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
DColor: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
boxoList: {
|
||||
type: [Object, Array]
|
||||
},
|
||||
GJList: {
|
||||
type: [Object, Array]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
|
||||
valA: 0,
|
||||
isOpen: false,
|
||||
time: '',
|
||||
type: '',
|
||||
severity: '',
|
||||
iphasic: '',
|
||||
eventValue: '',
|
||||
persistTime: '',
|
||||
lineName: '',
|
||||
subName: '',
|
||||
waveDatas: [],
|
||||
|
||||
Data: [],
|
||||
height: null,
|
||||
vhh: null,
|
||||
ptpass: '',
|
||||
waveHeight: undefined,
|
||||
$wave: undefined,
|
||||
color: '#006565',
|
||||
charts: {},
|
||||
arrpoints: [],
|
||||
titles: '',
|
||||
vh: null,
|
||||
vw: null,
|
||||
zoom: ''
|
||||
}
|
||||
},
|
||||
created() { },
|
||||
watch: {
|
||||
value: function (a, b) {
|
||||
if (a == 2) {
|
||||
// $("#wave1").remove();
|
||||
this.initWaves()
|
||||
} else {
|
||||
$('#wave1').remove()
|
||||
this.initWaves()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
window.addEventListener('resize', this.setHeight)
|
||||
this.$wave = $('#wave').eq(0)
|
||||
this.$nextTick(() => {
|
||||
this.query()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.setHeight)
|
||||
},
|
||||
methods: {
|
||||
setHeight() {
|
||||
this.zoom = 1 / document.body.style.zoom
|
||||
if (this.flag) {
|
||||
// console.log(123);
|
||||
this.vh = mainHeight(250).height
|
||||
} else {
|
||||
// console.log(3333);
|
||||
this.vh = mainHeight(270).height
|
||||
}
|
||||
},
|
||||
query() {
|
||||
this.loading = true
|
||||
this.initWave()
|
||||
},
|
||||
|
||||
//开始画图
|
||||
initWave() {
|
||||
//清除之前增加的div
|
||||
// $("#wave ~ .bx1").remove();
|
||||
$('div.bx1').remove()
|
||||
//设置暂降触发点的位置 一次值与二次值Y轴不同(不是计算出来的)
|
||||
// var height = $(window).height() - 90;
|
||||
var picHeight
|
||||
var show = true
|
||||
|
||||
//var v = $("#interval").val();
|
||||
var isvisible = false
|
||||
|
||||
picHeight = this.vh
|
||||
// this.$wave.css('height', picHeight)
|
||||
// this.$wave.css('width', '100%')
|
||||
$('#wave').css('height', picHeight)
|
||||
$('#wave').css('width', this.vw)
|
||||
|
||||
var adata = []
|
||||
var bdata = []
|
||||
var cdata = []
|
||||
var max = 0
|
||||
var min = 0
|
||||
//绘制横向第一个波形图
|
||||
this.GJList.smp_x.forEach((item, ind) => {
|
||||
if (this.GJList.smp_a[ind] > max) {
|
||||
max = this.GJList.smp_a[ind]
|
||||
} else if (this.GJList.smp_a[ind] < min) {
|
||||
min = this.GJList.smp_a[ind]
|
||||
}
|
||||
if (this.GJList.smp_b[ind] > max) {
|
||||
max = this.GJList.smp_b[ind]
|
||||
} else if (this.GJList.smp_b[ind] < min) {
|
||||
min = this.GJList.smp_b[ind]
|
||||
}
|
||||
if (this.GJList.smp_c[ind] > max) {
|
||||
max = this.GJList.smp_c[ind]
|
||||
} else if (this.GJList.smp_c[ind] < min) {
|
||||
min = this.GJList.smp_c[ind]
|
||||
}
|
||||
|
||||
adata.push([item, this.GJList.smp_a[ind]])
|
||||
bdata.push([item, this.GJList.smp_b[ind]])
|
||||
cdata.push([item, this.GJList.smp_c[ind]])
|
||||
})
|
||||
//绘制瞬时波形图
|
||||
// const echarts = require('echarts')
|
||||
let wave = document.getElementById('wave')
|
||||
let _this = this
|
||||
var myChartes = echarts.init(wave)
|
||||
let echartsColor = {
|
||||
WordColor: '#000',
|
||||
thread: '#000000',
|
||||
FigureColor: [
|
||||
'#07CCCA ',
|
||||
'#00BFF5',
|
||||
'#FFBF00',
|
||||
'#77DA63',
|
||||
'#D5FF6B',
|
||||
'#Ff6600',
|
||||
'#FF9100',
|
||||
'#5B6E96',
|
||||
'#66FFCC',
|
||||
'#B3B3B3',
|
||||
'#FF00FF',
|
||||
'#CC00FF',
|
||||
'#FF9999'
|
||||
]
|
||||
}
|
||||
var option = {
|
||||
tooltip: {
|
||||
top: '10px',
|
||||
trigger: 'axis',
|
||||
borderColor: 'grey',
|
||||
backgroundColor: '#fff',
|
||||
style: {
|
||||
color: '#000',
|
||||
fontSize: '15px',
|
||||
padding: 10
|
||||
},
|
||||
formatter: function (params) {
|
||||
// console.log(params)
|
||||
var tips = ''
|
||||
tips += '时刻:' + params[0].data[0] + '</br/>'
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].seriesName != '暂降触发点') {
|
||||
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
|
||||
}
|
||||
}
|
||||
return tips
|
||||
},
|
||||
// axisPointer: {
|
||||
// type: "cross",
|
||||
// label: {
|
||||
// color: "#fff",
|
||||
// fontSize: 16,
|
||||
// },
|
||||
// },
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0
|
||||
},
|
||||
|
||||
title: {
|
||||
left: 'center',
|
||||
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
left: '5%',
|
||||
top: '20',
|
||||
verticalAlign: 'top',
|
||||
enabled: true,
|
||||
itemDistance: 5,
|
||||
textStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||
rich: {
|
||||
a: {
|
||||
verticalAlign: 'middle'
|
||||
}
|
||||
},
|
||||
|
||||
padding: [2, 0, 0, 0] //[上、右、下、左]
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
show: false,
|
||||
feature: {
|
||||
//restore: {},
|
||||
saveAsImage: {
|
||||
iconStyle: {
|
||||
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
name: '时刻',
|
||||
boundaryGap: false,
|
||||
min: this.GJList.smp_x[0],
|
||||
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
|
||||
title: {
|
||||
text: 'ms',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
},
|
||||
enabled: true,
|
||||
align: 'high'
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||
},
|
||||
onZero: false //-----------重点
|
||||
},
|
||||
axisLabel: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||
formatter: function (value, index) {
|
||||
if (_this.valA != (value - 0).toFixed(0)) {
|
||||
_this.valA = (value - 0).toFixed(0)
|
||||
return (value - 0).toFixed(0)
|
||||
}
|
||||
}
|
||||
//rotate:39
|
||||
}
|
||||
// data: this.syncExtremes,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: 'kV',
|
||||
title: {
|
||||
align: 'high',
|
||||
offset: 0,
|
||||
text: 'kV',
|
||||
rotation: 0,
|
||||
y: -10
|
||||
},
|
||||
|
||||
boundaryGap: [0, '100%'],
|
||||
showLastLabel: true,
|
||||
max: (max + 10).toFixed(2),
|
||||
min: (min - 10).toFixed(2),
|
||||
opposite: false,
|
||||
nameTextStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
},
|
||||
//minInterval: 1,
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||
},
|
||||
onZero: false //-----------重点
|
||||
},
|
||||
axisLabel: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||
formatter: function (value, index) {
|
||||
return (value - 0).toFixed(2)
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: [_this.DColor ? '#fff' : echartsColor.thread],
|
||||
type: 'dashed',
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '40px',
|
||||
bottom: '40px',
|
||||
top: '55px',
|
||||
containLabel: true
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
bottom: '20px',
|
||||
end: 100
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '20px',
|
||||
end: 100
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: 'A相',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
sampling: 'lttb',
|
||||
itemStyle: {
|
||||
color: '#DAA520'
|
||||
},
|
||||
data: adata
|
||||
},
|
||||
{
|
||||
name: 'B相',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
sampling: 'lttb',
|
||||
itemStyle: {
|
||||
color: '#2E8B57'
|
||||
},
|
||||
data: bdata
|
||||
},
|
||||
{
|
||||
name: 'C相',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
sampling: 'lttb',
|
||||
itemStyle: {
|
||||
color: '#A52a2a'
|
||||
},
|
||||
data: cdata
|
||||
},
|
||||
{
|
||||
name: '暂降触发点',
|
||||
type: 'scatter',
|
||||
symbol: 'image://' + url,
|
||||
itemStyle: {
|
||||
width: 16,
|
||||
height: 16
|
||||
},
|
||||
data: [[0, min]]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
myChartes.setOption(option)
|
||||
// window.echartsArr.push(myChartes)
|
||||
setTimeout(() => {
|
||||
myChartes.resize()
|
||||
this.loading = false
|
||||
}, 400)
|
||||
|
||||
//第一个波形图数据绘制完毕后,绘制后续的波形图
|
||||
|
||||
// let waveDatasTemp = waveDatas.slice(1);
|
||||
// waveDatasTemp.reverse();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<div>
|
||||
<div id="boxi" :style="`height:${vh};overflow: hidden;`">
|
||||
<div class="bx" id="wave"></div>
|
||||
</div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="暂态波形上送" :style="'height:' + vhh">
|
||||
<el-table stripe :data="Data" :height="height" border style="width: 100%"
|
||||
header-cell-class-name="table_header">
|
||||
<el-table-column align="center" prop="number" label="事件段"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="波形起始点相位(°)">
|
||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="number" label="跳变段电压变化率(V/ms)">
|
||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="number" label="相位跳变(°)">
|
||||
<el-table-column align="center" prop="number" label="A相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="B相"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="C相"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="number" label="总分段数目"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="三相电压不平衡度(%)" width="180"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="触发类型"></el-table-column>
|
||||
<el-table-column align="center" prop="number" label="暂降原因"></el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { downloadWaveFile, getMonitorEventAnalyseWave } from '@/api/event-boot/transient'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import * as echarts from 'echarts'
|
||||
import url from '@/assets/img/point.png'
|
||||
import $ from 'jquery'
|
||||
export default {
|
||||
props: {
|
||||
flag: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
DColor: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
boxoList: {
|
||||
type: [Object, Array]
|
||||
},
|
||||
GJList: {
|
||||
type: [Object, Array]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
|
||||
valA: 0,
|
||||
isOpen: false,
|
||||
time: '',
|
||||
type: '',
|
||||
severity: '',
|
||||
iphasic: '',
|
||||
eventValue: '',
|
||||
persistTime: '',
|
||||
lineName: '',
|
||||
subName: '',
|
||||
waveDatas: [],
|
||||
|
||||
Data: [],
|
||||
height: null,
|
||||
vhh: null,
|
||||
ptpass: '',
|
||||
waveHeight: undefined,
|
||||
$wave: undefined,
|
||||
color: '#006565',
|
||||
charts: {},
|
||||
arrpoints: [],
|
||||
titles: '',
|
||||
vh: null,
|
||||
vw: null,
|
||||
zoom: ''
|
||||
}
|
||||
},
|
||||
created() { },
|
||||
watch: {
|
||||
value: function (a, b) {
|
||||
if (a == 2) {
|
||||
// $("#wave1").remove();
|
||||
this.initWaves()
|
||||
} else {
|
||||
$('#wave1').remove()
|
||||
this.initWaves()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
window.addEventListener('resize', this.setHeight)
|
||||
this.$wave = $('#wave').eq(0)
|
||||
this.$nextTick(() => {
|
||||
this.query()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.setHeight)
|
||||
},
|
||||
methods: {
|
||||
setHeight() {
|
||||
this.zoom = 1 / document.body.style.zoom
|
||||
if (this.flag) {
|
||||
// console.log(123);
|
||||
this.vh = mainHeight(250).height
|
||||
} else {
|
||||
// console.log(3333);
|
||||
this.vh = mainHeight(270).height
|
||||
}
|
||||
},
|
||||
query() {
|
||||
this.loading = true
|
||||
this.initWave()
|
||||
},
|
||||
|
||||
//开始画图
|
||||
initWave() {
|
||||
//清除之前增加的div
|
||||
// $("#wave ~ .bx1").remove();
|
||||
$('div.bx1').remove()
|
||||
//设置暂降触发点的位置 一次值与二次值Y轴不同(不是计算出来的)
|
||||
// var height = $(window).height() - 90;
|
||||
var picHeight
|
||||
var show = true
|
||||
|
||||
//var v = $("#interval").val();
|
||||
var isvisible = false
|
||||
|
||||
picHeight = this.vh
|
||||
// this.$wave.css('height', picHeight)
|
||||
// this.$wave.css('width', '100%')
|
||||
$('#wave').css('height', picHeight)
|
||||
$('#wave').css('width', this.vw)
|
||||
|
||||
var adata = []
|
||||
var bdata = []
|
||||
var cdata = []
|
||||
var max = 0
|
||||
var min = 0
|
||||
//绘制横向第一个波形图
|
||||
this.GJList.smp_x.forEach((item, ind) => {
|
||||
if (this.GJList.smp_a[ind] > max) {
|
||||
max = this.GJList.smp_a[ind]
|
||||
} else if (this.GJList.smp_a[ind] < min) {
|
||||
min = this.GJList.smp_a[ind]
|
||||
}
|
||||
if (this.GJList.smp_b[ind] > max) {
|
||||
max = this.GJList.smp_b[ind]
|
||||
} else if (this.GJList.smp_b[ind] < min) {
|
||||
min = this.GJList.smp_b[ind]
|
||||
}
|
||||
if (this.GJList.smp_c[ind] > max) {
|
||||
max = this.GJList.smp_c[ind]
|
||||
} else if (this.GJList.smp_c[ind] < min) {
|
||||
min = this.GJList.smp_c[ind]
|
||||
}
|
||||
|
||||
adata.push([item, this.GJList.smp_a[ind]])
|
||||
bdata.push([item, this.GJList.smp_b[ind]])
|
||||
cdata.push([item, this.GJList.smp_c[ind]])
|
||||
})
|
||||
//绘制瞬时波形图
|
||||
// const echarts = require('echarts')
|
||||
let wave = document.getElementById('wave')
|
||||
let _this = this
|
||||
var myChartes = echarts.init(wave)
|
||||
let echartsColor = {
|
||||
WordColor: '#000',
|
||||
thread: '#000000',
|
||||
FigureColor: [
|
||||
'#07CCCA ',
|
||||
'#00BFF5',
|
||||
'#FFBF00',
|
||||
'#77DA63',
|
||||
'#D5FF6B',
|
||||
'#Ff6600',
|
||||
'#FF9100',
|
||||
'#5B6E96',
|
||||
'#66FFCC',
|
||||
'#B3B3B3',
|
||||
'#FF00FF',
|
||||
'#CC00FF',
|
||||
'#FF9999'
|
||||
]
|
||||
}
|
||||
var option = {
|
||||
tooltip: {
|
||||
top: '10px',
|
||||
trigger: 'axis',
|
||||
borderColor: 'grey',
|
||||
backgroundColor: '#fff',
|
||||
style: {
|
||||
color: '#000',
|
||||
fontSize: '15px',
|
||||
padding: 10
|
||||
},
|
||||
formatter: function (params) {
|
||||
// console.log(params)
|
||||
var tips = ''
|
||||
tips += '时刻:' + params[0].data[0] + '</br/>'
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].seriesName != '暂降触发点') {
|
||||
tips += params[i].seriesName + ':' + params[i].value[1] + '<br/>'
|
||||
}
|
||||
}
|
||||
return tips
|
||||
},
|
||||
// axisPointer: {
|
||||
// type: "cross",
|
||||
// label: {
|
||||
// color: "#fff",
|
||||
// fontSize: 16,
|
||||
// },
|
||||
// },
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.55)',
|
||||
borderWidth: 0
|
||||
},
|
||||
|
||||
title: {
|
||||
left: 'center',
|
||||
text: '发生时刻:' + this.boxoList.startTime + ' PT变化:' + this.boxoList.measurementPointName,
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
left: '5%',
|
||||
top: '20',
|
||||
verticalAlign: 'top',
|
||||
enabled: true,
|
||||
itemDistance: 5,
|
||||
textStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||
rich: {
|
||||
a: {
|
||||
verticalAlign: 'middle'
|
||||
}
|
||||
},
|
||||
|
||||
padding: [2, 0, 0, 0] //[上、右、下、左]
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
show: false,
|
||||
feature: {
|
||||
//restore: {},
|
||||
saveAsImage: {
|
||||
iconStyle: {
|
||||
borderColor: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
name: '时刻',
|
||||
boundaryGap: false,
|
||||
min: this.GJList.smp_x[0],
|
||||
max: this.GJList.smp_x[this.GJList.smp_x.length - 1] + 1,
|
||||
title: {
|
||||
text: 'ms',
|
||||
textStyle: {
|
||||
fontSize: 12,
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
},
|
||||
enabled: true,
|
||||
align: 'high'
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
},
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||
},
|
||||
onZero: false //-----------重点
|
||||
},
|
||||
axisLabel: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||
formatter: function (value, index) {
|
||||
if (_this.valA != (value - 0).toFixed(0)) {
|
||||
_this.valA = (value - 0).toFixed(0)
|
||||
return (value - 0).toFixed(0)
|
||||
}
|
||||
}
|
||||
//rotate:39
|
||||
}
|
||||
// data: this.syncExtremes,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: 'kV',
|
||||
title: {
|
||||
align: 'high',
|
||||
offset: 0,
|
||||
text: 'kV',
|
||||
rotation: 0,
|
||||
y: -10
|
||||
},
|
||||
|
||||
boundaryGap: [0, '100%'],
|
||||
showLastLabel: true,
|
||||
max: (max + 10).toFixed(2),
|
||||
min: (min - 10).toFixed(2),
|
||||
opposite: false,
|
||||
nameTextStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor
|
||||
},
|
||||
//minInterval: 1,
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.thread
|
||||
},
|
||||
onZero: false //-----------重点
|
||||
},
|
||||
axisLabel: {
|
||||
color: _this.DColor ? '#fff' : echartsColor.WordColor,
|
||||
formatter: function (value, index) {
|
||||
return (value - 0).toFixed(2)
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
// 使用深浅的间隔色
|
||||
color: [_this.DColor ? '#fff' : echartsColor.thread],
|
||||
type: 'dashed',
|
||||
opacity: 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '1%',
|
||||
right: '40px',
|
||||
bottom: '40px',
|
||||
top: '55px',
|
||||
containLabel: true
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'inside',
|
||||
height: 13,
|
||||
start: 0,
|
||||
bottom: '20px',
|
||||
end: 100
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
height: 13,
|
||||
bottom: '20px',
|
||||
end: 100
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: 'A相',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
sampling: 'lttb',
|
||||
itemStyle: {
|
||||
color: '#DAA520'
|
||||
},
|
||||
data: adata
|
||||
},
|
||||
{
|
||||
name: 'B相',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
sampling: 'lttb',
|
||||
itemStyle: {
|
||||
color: '#2E8B57'
|
||||
},
|
||||
data: bdata
|
||||
},
|
||||
{
|
||||
name: 'C相',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'none',
|
||||
sampling: 'lttb',
|
||||
itemStyle: {
|
||||
color: '#A52a2a'
|
||||
},
|
||||
data: cdata
|
||||
},
|
||||
{
|
||||
name: '暂降触发点',
|
||||
type: 'scatter',
|
||||
symbol: 'image://' + url,
|
||||
itemStyle: {
|
||||
width: 16,
|
||||
height: 16
|
||||
},
|
||||
data: [[0, min]]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
myChartes.setOption(option)
|
||||
// window.echartsArr.push(myChartes)
|
||||
setTimeout(() => {
|
||||
myChartes.resize()
|
||||
this.loading = false
|
||||
}, 400)
|
||||
|
||||
//第一个波形图数据绘制完毕后,绘制后续的波形图
|
||||
|
||||
// let waveDatasTemp = waveDatas.slice(1);
|
||||
// waveDatasTemp.reverse();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -127,7 +127,7 @@ const timeChange = (e: number) => {
|
||||
|
||||
// 当前
|
||||
const nowTime = () => {
|
||||
console.log(interval.value, '000000000')
|
||||
//console.log(interval.value, '000000000')
|
||||
timeChange(interval.value)
|
||||
}
|
||||
// 上一个
|
||||
@@ -312,7 +312,7 @@ const next = () => {
|
||||
}
|
||||
} else {
|
||||
month = month + 3
|
||||
console.log('🚀 ~ next ~ presentM:', presentM, month)
|
||||
// console.log('🚀 ~ next ~ presentM:', presentM, month)
|
||||
|
||||
// 季度进位后,超过当前月份是不科学的
|
||||
if (year == presentY && !props.nextFlag) {
|
||||
@@ -327,7 +327,7 @@ const next = () => {
|
||||
endTime = year + '-0' + presentM + '-' + presentD
|
||||
}
|
||||
} else if (presentM > 3 && presentM < 7) {
|
||||
console.log(123123)
|
||||
// console.log(123123)
|
||||
// 第二季度
|
||||
startTime = year + '-04-01'
|
||||
if (presentD < 10) {
|
||||
@@ -380,7 +380,7 @@ const next = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(startTime, endTime)
|
||||
// console.log(startTime, endTime)
|
||||
} else if (interval.value == 5) {
|
||||
} else if (interval.value == 4) {
|
||||
//根据开始时间推
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="区域" v-if="area">
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" />
|
||||
<Area ref="areaRef" v-model="tableStore.table.params.deptIndex" @change-value="onAreaChange" />
|
||||
</el-form-item>
|
||||
<slot name="select"></slot>
|
||||
</el-form>
|
||||
@@ -52,7 +52,7 @@
|
||||
<el-button
|
||||
@click="onExport"
|
||||
v-if="showExport"
|
||||
:loading="tableStore.table.loading"
|
||||
:loading="tableStore.table.exportLoading"
|
||||
type="primary"
|
||||
icon="el-icon-Download"
|
||||
>
|
||||
@@ -81,7 +81,7 @@ import { mainHeight } from '@/utils/layout'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { Search, RefreshLeft } from '@element-plus/icons-vue'
|
||||
import { defineProps } from 'vue'
|
||||
const emit = defineEmits(['selectChange'])
|
||||
const emit = defineEmits(['selectChange','areaChange'])
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const tableHeader = ref()
|
||||
const datePickerRef = ref()
|
||||
@@ -132,11 +132,17 @@ const headerFormSecondStyleClose = {
|
||||
padding: '0'
|
||||
}
|
||||
|
||||
const onAreaChange = (data) => {
|
||||
|
||||
emit('areaChange', {label: data.label})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => tableStore?.table.params.deptIndex,
|
||||
newVal => {
|
||||
setTimeout(() => {
|
||||
areaRef.value && areaRef.value.change()
|
||||
|
||||
}, 0)
|
||||
}
|
||||
)
|
||||
@@ -258,7 +264,7 @@ const setTheDate = (val: any) => {
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
console.log('222')
|
||||
|
||||
tableStore.onTableAction('export', { showAllFlag: true })
|
||||
}
|
||||
|
||||
|
||||
187
src/components/tree/allocation.vue
Normal file
187
src/components/tree/allocation.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="transition: all 0.3s; overflow: hidden">
|
||||
<div class="mt15 mr10" style="display: flex; justify-content: end">
|
||||
<el-button type="primary" icon="el-icon-Select" @click="save" :loading="loading">保存</el-button>
|
||||
</div>
|
||||
<Icon
|
||||
v-show="menuCollapse"
|
||||
@click="onMenuCollapse"
|
||||
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
:class="menuCollapse ? 'unfold' : ''"
|
||||
size="18"
|
||||
class="fold ml10 mt20 menu-collapse"
|
||||
style="cursor: pointer"
|
||||
/>
|
||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||
<div style="display: flex; align-items: center" class="mb10">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="filterText" placeholder="请输入内容" clearable>
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
<el-tooltip placement="bottom" :hide-after="0" v-if="props.showPush">
|
||||
<template #content>
|
||||
<span>台账推送</span>
|
||||
</template>
|
||||
|
||||
<Icon
|
||||
name="el-icon-Promotion"
|
||||
size="20"
|
||||
class="fold ml10 menu-collapse"
|
||||
style="cursor: pointer"
|
||||
:style="{ color: config.getColorVal('elementUiPrimary') }"
|
||||
@click="onAdd"
|
||||
/>
|
||||
</el-tooltip>
|
||||
<!-- <Icon @click='onMenuCollapse' :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'" v-else
|
||||
:class="menuCollapse ? 'unfold' : ''" size='18' class='fold ml10 menu-collapse'
|
||||
style='cursor: pointer' v-if='props.canExpand' /> -->
|
||||
</div>
|
||||
|
||||
<el-tree
|
||||
:style="{ height: 'calc(100vh - 235px)' }"
|
||||
style="overflow: auto"
|
||||
ref="treeRef"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:default-expand-all="false"
|
||||
@check-change="checkTreeNodeChange"
|
||||
:filter-node-method="filterNode"
|
||||
node-key="id"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<span class="custom-tree-node">
|
||||
<Icon
|
||||
:name="data.icon"
|
||||
style="font-size: 16px"
|
||||
:style="{ color: data.color }"
|
||||
v-if="data.icon"
|
||||
/>
|
||||
<span style="margin-left: 4px">{{ node.label }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||
import { ElTree } from 'element-plus'
|
||||
import { emit } from 'process'
|
||||
import { ref, watch } from 'vue'
|
||||
import { t } from 'vxe-table'
|
||||
import { useConfig } from '@/stores/config'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/tree'
|
||||
})
|
||||
|
||||
interface Props {
|
||||
width?: string
|
||||
canExpand?: boolean
|
||||
showPush?: boolean
|
||||
}
|
||||
const loading = ref(false)
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
width: '280px',
|
||||
canExpand: true,
|
||||
showPush: false
|
||||
})
|
||||
const config = useConfig()
|
||||
const { proxy } = useCurrentInstance()
|
||||
const menuCollapse = ref(false)
|
||||
const filterText = ref('')
|
||||
const defaultProps = {
|
||||
label: 'name',
|
||||
value: 'id'
|
||||
}
|
||||
const emit = defineEmits(['checkTreeNodeChange', 'onAdd', 'checkChange'])
|
||||
watch(filterText, val => {
|
||||
treeRef.value!.filter(val)
|
||||
})
|
||||
const onMenuCollapse = () => {
|
||||
menuCollapse.value = !menuCollapse.value
|
||||
proxy.eventBus.emit('cnTreeCollapse', menuCollapse)
|
||||
}
|
||||
const save = () => {
|
||||
loading.value = true
|
||||
emit('checkChange')
|
||||
}
|
||||
const filterNode = (value: string, data: any, node: any) => {
|
||||
console.log(value, data, node, 'filterNode')
|
||||
if (!value) return true
|
||||
// return data.name.includes(value)
|
||||
if (data.name) {
|
||||
return chooseNode(value, data, node)
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||
const chooseNode = (value: string, data: any, node: any) => {
|
||||
if (data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
const level = node.level
|
||||
// 如果传入的节点本身就是一级节点就不用校验了
|
||||
if (level === 1) {
|
||||
return false
|
||||
}
|
||||
// 先取当前节点的父节点
|
||||
let parentData = node.parent
|
||||
// 遍历当前节点的父节点
|
||||
let index = 0
|
||||
while (index < level - 1) {
|
||||
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||
if (parentData.data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
// 否则的话再往上一层做匹配
|
||||
parentData = parentData.parent
|
||||
index++
|
||||
}
|
||||
// 没匹配到返回false
|
||||
return false
|
||||
}
|
||||
const checkTreeNodeChange = () => {
|
||||
// console.log(treeRef.value?.getCheckedNodes(), "ikkkkkiisiiisis");
|
||||
emit('checkTreeNodeChange', treeRef.value?.getCheckedNodes())
|
||||
}
|
||||
|
||||
const onAdd = () => {
|
||||
emit('onAdd')
|
||||
}
|
||||
|
||||
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||
defineExpose({ treeRef, loading })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cn-tree {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
:deep(.el-tree) {
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
|
||||
:deep(.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content) {
|
||||
background-color: var(--el-color-primary-light-7);
|
||||
}
|
||||
|
||||
.menu-collapse {
|
||||
color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.custom-tree-node {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -22,7 +22,7 @@
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
</el-input>
|
||||
<Icon
|
||||
@click="onMenuCollapse"
|
||||
:name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
@@ -147,7 +147,7 @@ const onMenuCollapse = () => {
|
||||
}
|
||||
// 查看详情
|
||||
const viewDetails = (data: any) => {
|
||||
console.log('🚀 ~ viewDetails ~ data:', data)
|
||||
// console.log('🚀 ~ viewDetails ~ data:', data)
|
||||
if (data.level == 3) {
|
||||
// 变电站详情
|
||||
// substationDetails
|
||||
@@ -201,7 +201,7 @@ onMounted(async () => {
|
||||
})
|
||||
|
||||
const scrollToNode = (id: string) => {
|
||||
console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||
// console.log("🚀 ~ scrollToNode ~ id:", id)
|
||||
if (!treeRef.value) return
|
||||
|
||||
// 获取目标节点的元素
|
||||
|
||||
@@ -19,7 +19,6 @@ import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||
import Tree from '../index.vue'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { queryAllAlgorithmLibrary } from '@/api/supervision-boot/database/index'
|
||||
defineOptions({
|
||||
@@ -35,7 +34,7 @@ const tree = ref()
|
||||
const treeRef = ref()
|
||||
|
||||
const loadData = (id?: any) => {
|
||||
console.log('🚀 ~ loadData ~ id:', id)
|
||||
// console.log('🚀 ~ loadData ~ id:', id)
|
||||
let nodeKey = ''
|
||||
queryAllAlgorithmLibrary().then(res => {
|
||||
res.data.forEach((item: any) => {
|
||||
|
||||
150
src/components/tree/pqs/areaTree.vue
Normal file
150
src/components/tree/pqs/areaTree.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div class="point-tree">
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<Tree ref="treeRef" :data="tree" style="width: 100%; height: 100%" :canExpand="false" v-bind="$attrs" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||
import Tree from '../index.vue'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { getAreaList } from '@/api/common'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||
defineOptions({
|
||||
name: 'pms/pointTree'
|
||||
})
|
||||
interface Props {
|
||||
showSelect?: boolean
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
showSelect: true
|
||||
})
|
||||
const emit = defineEmits(['init'])
|
||||
const attrs = useAttrs()
|
||||
const adminInfo = useAdminInfo()
|
||||
const dictData = useDictData()
|
||||
const config = useConfig()
|
||||
const tree = ref()
|
||||
const treeRef = ref()
|
||||
|
||||
const loadData = () => {
|
||||
let nodeKey = ''
|
||||
getAreaList().then(res => {
|
||||
processTreeData(res.data, res.data[0].level)
|
||||
let firstLevel6Node = getDeepestFirstChildData(res.data)
|
||||
|
||||
nodeKey = firstLevel6Node.id
|
||||
emit('init', firstLevel6Node)
|
||||
|
||||
tree.value = res.data
|
||||
if (nodeKey) {
|
||||
nextTick(() => {
|
||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||
|
||||
// treeRef.value.treeRef.setExpandedKeys(nodeKey)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const scrollToNode = (id: string) => {
|
||||
// 树滚动
|
||||
treeRef.value.scrollToNode(id)
|
||||
}
|
||||
|
||||
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||
const levelIconMap = {
|
||||
'-1': 'el-icon-HomeFilled',
|
||||
0: 'el-icon-CollectionTag',
|
||||
1: 'el-icon-CollectionTag',
|
||||
2: 'el-icon-Flag',
|
||||
3: 'el-icon-OfficeBuilding',
|
||||
4: 'el-icon-DataAnalysis',
|
||||
5: 'el-icon-DataAnalysis',
|
||||
7: 'el-icon-DataAnalysis',
|
||||
6: 'fa-solid fa-location-dot'
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||
* @param data 树形数据数组
|
||||
* @param level 当前层级(默认从1开始)
|
||||
*/
|
||||
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||
// 空值判断,避免数组为空或undefined时报错
|
||||
if (!Array.isArray(data) || data.length === 0) return
|
||||
|
||||
data.forEach(item => {
|
||||
// 1. 设置基础图标(根据层级匹配)
|
||||
item.icon = levelIconMap[level] || ''
|
||||
item.alias = alias + `${item.name}`
|
||||
// 2. 设置基础颜色
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
|
||||
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||
switch (item.comFlag) {
|
||||
case 0:
|
||||
item.color = 'red !important'
|
||||
break
|
||||
case 1:
|
||||
item.color = '#00f93b !important'
|
||||
break
|
||||
case 2:
|
||||
item.color = '#8c8c8c !important'
|
||||
break
|
||||
// 默认值:保持原有基础颜色
|
||||
default:
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 递归处理子节点,层级+1
|
||||
if (item.children && item.children.length > 0) {
|
||||
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 递归获取树形结构中一直向下的第一个children的最后一组有效数据
|
||||
* @param {Array} treeData - 原始递归树形数据
|
||||
* @returns {Object|null} 路径最后一组有效数据,无有效数据时返回null
|
||||
*/
|
||||
function getDeepestFirstChildData(treeData) {
|
||||
// 递归辅助函数:逐层查找第一个children
|
||||
function findDeepestNode(currentNode) {
|
||||
// 检查当前节点是否有有效的children数组
|
||||
if (currentNode && Array.isArray(currentNode.children) && currentNode.children.length > 0) {
|
||||
// 有下一级children,继续递归查找下一级第一个元素
|
||||
return findDeepestNode(currentNode.children[0])
|
||||
}
|
||||
// 没有下一级children,返回当前节点(递归终止)
|
||||
return currentNode
|
||||
}
|
||||
|
||||
// 边界处理:原始数据非数组/空数组时返回null
|
||||
if (!Array.isArray(treeData) || treeData.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// 从根节点第一个元素开始递归查找
|
||||
return findDeepestNode(treeData[0])
|
||||
}
|
||||
|
||||
defineExpose({ treeRef, scrollToNode, tree })
|
||||
loadData()
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.point-tree {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
</style>
|
||||
@@ -11,7 +11,6 @@ import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||
import Tree from '../index.vue'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { defineProps } from 'vue'
|
||||
import { getTree } from '@/api/advance-boot/assess'
|
||||
|
||||
@@ -36,6 +36,7 @@ const adminInfo = useAdminInfo()
|
||||
const dictData = useDictData()
|
||||
const config = useConfig()
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||
const tree = ref()
|
||||
const treeRef = ref()
|
||||
const formData = ref({
|
||||
@@ -54,6 +55,9 @@ const loadData = () => {
|
||||
}) || { code: '' }
|
||||
let form = JSON.parse(JSON.stringify(formData.value))
|
||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||
form.statisticalType.deptName = 'qujing'
|
||||
}
|
||||
let nodeKey = ''
|
||||
getTerminalTreeForFive(form).then(res => {
|
||||
console.log(res)
|
||||
@@ -67,56 +71,62 @@ const loadData = () => {
|
||||
}
|
||||
]
|
||||
}
|
||||
res.data.forEach((item: any) => {
|
||||
item.icon = 'el-icon-HomeFilled'
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
item.children.forEach((item2: any) => {
|
||||
item2.icon = 'el-icon-CollectionTag'
|
||||
item2.color = config.getColorVal('elementUiPrimary')
|
||||
item2.children.forEach((item3: any) => {
|
||||
item3.icon = 'el-icon-Flag'
|
||||
item3.color = config.getColorVal('elementUiPrimary')
|
||||
item3.children.forEach((item4: any) => {
|
||||
item4.icon = 'el-icon-OfficeBuilding'
|
||||
item4.color = config.getColorVal('elementUiPrimary')
|
||||
item4.children.forEach((item5: anyObj) => {
|
||||
if (item5.level == 7) {
|
||||
item5.icon = 'el-icon-DataAnalysis'
|
||||
item5.color = config.getColorVal('elementUiPrimary')
|
||||
item5.children.forEach((item6: anyObj) => {
|
||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||
item6.pid = item4.id
|
||||
item6.icon = 'fa-solid fa-location-dot'
|
||||
item6.color = config.getColorVal('elementUiPrimary')
|
||||
if (item6.comFlag == 0) {
|
||||
item6.color = 'red !important'
|
||||
} else if (item6.comFlag == 1) {
|
||||
item6.color = '#00f93b !important'
|
||||
} else if (item6.comFlag == 2) {
|
||||
item6.color = '#8c8c8c !important'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||
item5.pid = item4.id
|
||||
item5.icon = 'fa-solid fa-location-dot'
|
||||
item5.color = config.getColorVal('elementUiPrimary')
|
||||
if (item5.comFlag == 0) {
|
||||
item5.color = 'red !important'
|
||||
} else if (item5.comFlag == 1) {
|
||||
item5.color = '#00f93b !important'
|
||||
} else if (item5.comFlag == 2) {
|
||||
item5.color = '#8c8c8c !important'
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
// if (VITE_FLAG) {
|
||||
processTreeData(res.data)
|
||||
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||
|
||||
nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
||||
emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
||||
nodeKey = firstLevel6Node.id
|
||||
emit('init', firstLevel6Node)
|
||||
// res.data.forEach((item: any) => {
|
||||
// item.icon = 'el-icon-HomeFilled'
|
||||
// item.color = config.getColorVal('elementUiPrimary')
|
||||
// item.children.forEach((item2: any) => {
|
||||
// item2.icon = 'el-icon-CollectionTag'
|
||||
// item2.color = config.getColorVal('elementUiPrimary')
|
||||
// item2.children.forEach((item3: any) => {
|
||||
// item3.icon = 'el-icon-Flag'
|
||||
// item3.color = config.getColorVal('elementUiPrimary')
|
||||
// item3.children.forEach((item4: any) => {
|
||||
// item4.icon = 'el-icon-OfficeBuilding'
|
||||
// item4.color = config.getColorVal('elementUiPrimary')
|
||||
// item4.children.forEach((item5: anyObj) => {
|
||||
// if (item5.level == 7) {
|
||||
// item5.icon = 'el-icon-DataAnalysis'
|
||||
// item5.color = config.getColorVal('elementUiPrimary')
|
||||
// item5.children.forEach((item6: anyObj) => {
|
||||
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||
// item6.pid = item4.id
|
||||
// item6.icon = 'fa-solid fa-location-dot'
|
||||
// item6.color = config.getColorVal('elementUiPrimary')
|
||||
// if (item6.comFlag == 0) {
|
||||
// item6.color = 'red !important'
|
||||
// } else if (item6.comFlag == 1) {
|
||||
// item6.color = '#00f93b !important'
|
||||
// } else if (item6.comFlag == 2) {
|
||||
// item6.color = '#8c8c8c !important'
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||
// item5.pid = item4.id
|
||||
// item5.icon = 'fa-solid fa-location-dot'
|
||||
// item5.color = config.getColorVal('elementUiPrimary')
|
||||
// if (item5.comFlag == 0) {
|
||||
// item5.color = 'red !important'
|
||||
// } else if (item5.comFlag == 1) {
|
||||
// item5.color = '#00f93b !important'
|
||||
// } else if (item5.comFlag == 2) {
|
||||
// item5.color = '#8c8c8c !important'
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
|
||||
// nodeKey = res.data[0].children[0].children[0].children[0].children[0].id
|
||||
// emit('init', res.data[0].children[0].children[0].children[0].children[0])
|
||||
|
||||
tree.value = res.data
|
||||
if (nodeKey) {
|
||||
@@ -127,9 +137,113 @@ const loadData = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const setKey = (key: string) => {
|
||||
treeRef.value.treeRef.setCurrentKey(key)
|
||||
}
|
||||
|
||||
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||
const levelIconMap = {
|
||||
'-1': 'el-icon-HomeFilled',
|
||||
0: 'el-icon-CollectionTag',
|
||||
1: 'el-icon-CollectionTag',
|
||||
2: 'el-icon-Flag',
|
||||
3: 'el-icon-OfficeBuilding',
|
||||
4: 'el-icon-DataAnalysis',
|
||||
5: 'el-icon-DataAnalysis',
|
||||
7: 'el-icon-DataAnalysis',
|
||||
6: 'fa-solid fa-location-dot'
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||
* @param data 树形数据数组
|
||||
* @param level 当前层级(默认从1开始)
|
||||
*/
|
||||
function processTreeData(data: any[], level: number = -1) {
|
||||
// 空值判断,避免数组为空或undefined时报错
|
||||
if (!Array.isArray(data) || data.length === 0) return
|
||||
|
||||
data.forEach(item => {
|
||||
// 1. 设置基础图标(根据层级匹配)
|
||||
item.icon = levelIconMap[level] || ''
|
||||
|
||||
// 2. 设置基础颜色
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
|
||||
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||
switch (item.comFlag) {
|
||||
case 0:
|
||||
item.color = 'red !important'
|
||||
break
|
||||
case 1:
|
||||
item.color = '#00f93b !important'
|
||||
break
|
||||
case 2:
|
||||
item.color = '#8c8c8c !important'
|
||||
break
|
||||
// 默认值:保持原有基础颜色
|
||||
default:
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 递归处理子节点,层级+1
|
||||
if (item.children && item.children.length > 0) {
|
||||
processTreeData(item.children, item.children[0].level)
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||
*/
|
||||
function findFirstLevel6Node(tree: any) {
|
||||
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||
if (Array.isArray(tree)) {
|
||||
for (const rootNode of tree) {
|
||||
const result = traverse(rootNode)
|
||||
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||
if (result) return result
|
||||
}
|
||||
// 所有根节点遍历完未找到
|
||||
return null
|
||||
} else {
|
||||
// 入参是单个节点,直接递归遍历
|
||||
return traverse(tree)
|
||||
}
|
||||
|
||||
// 核心递归遍历函数
|
||||
function traverse(node) {
|
||||
// 终止条件1:节点不存在,返回null
|
||||
if (!node) return null
|
||||
|
||||
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||
if (node.level === 6) {
|
||||
return node
|
||||
}
|
||||
|
||||
// 终止条件3:节点无children,返回null
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// 按顺序遍历当前节点的子节点
|
||||
for (const child of node.children) {
|
||||
const foundNode = traverse(child)
|
||||
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||
if (foundNode) {
|
||||
return foundNode
|
||||
}
|
||||
}
|
||||
|
||||
// 当前节点及所有子节点都无匹配,返回null
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ setKey })
|
||||
loadData()
|
||||
</script>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/>
|
||||
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
|
||||
<div style="display: flex; align-items: center" class="mb10">
|
||||
<el-input v-model="filterText" placeholder="请输入内容" clearable>
|
||||
<el-input v-model="filterText" placeholder="请输入内容" maxlength="10" show-word-limit clearable>
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { getTerminalTreeForFive } from '@/api/device-boot/terminalTree'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { defineProps } from 'vue'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||
defineOptions({
|
||||
name: 'pms/pointTree'
|
||||
})
|
||||
@@ -61,6 +62,9 @@ const loadData = () => {
|
||||
}) || { code: '' }
|
||||
let form = JSON.parse(JSON.stringify(formData.value))
|
||||
form.statisticalType = classificationData.find((item: any) => item.id == form.statisticalType)
|
||||
if (VITE_FLAG && form.statisticalType.code == 'Power_Network') {
|
||||
form.statisticalType.deptName = 'qujing'
|
||||
}
|
||||
let nodeKey = ''
|
||||
getTerminalTreeForFive(form).then(res => {
|
||||
//console.log('---',res)
|
||||
@@ -74,62 +78,71 @@ const loadData = () => {
|
||||
}
|
||||
]
|
||||
}
|
||||
res.data.forEach((item: any) => {
|
||||
item.icon = 'el-icon-HomeFilled'
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
item.children.forEach((item2: any) => {
|
||||
item2.icon = 'el-icon-CollectionTag'
|
||||
item2.color = config.getColorVal('elementUiPrimary')
|
||||
item2.children.forEach((item3: any) => {
|
||||
item3.icon = 'el-icon-Flag'
|
||||
item3.color = config.getColorVal('elementUiPrimary')
|
||||
item3.children.forEach((item4: any) => {
|
||||
item4.icon = 'el-icon-OfficeBuilding'
|
||||
item4.color = config.getColorVal('elementUiPrimary')
|
||||
item4.children.forEach((item5: anyObj) => {
|
||||
if (item5.level == 7) {
|
||||
item5.icon = 'el-icon-DataAnalysis'
|
||||
item5.color = config.getColorVal('elementUiPrimary')
|
||||
item5.children.forEach((item6: anyObj) => {
|
||||
item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||
item6.pid = item4.id
|
||||
item6.icon = 'fa-solid fa-location-dot'
|
||||
item6.color = config.getColorVal('elementUiPrimary')
|
||||
if (item6.comFlag == 0) {
|
||||
item6.color = 'red !important'
|
||||
} else if (item6.comFlag == 1) {
|
||||
item6.color = '#00f93b !important'
|
||||
} else if (item6.comFlag == 2) {
|
||||
item6.color = '#8c8c8c !important'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||
item5.pid = item4.id
|
||||
item5.icon = 'fa-solid fa-location-dot'
|
||||
item5.color = config.getColorVal('elementUiPrimary')
|
||||
if (item5.comFlag == 0) {
|
||||
item5.color = 'red !important'
|
||||
} else if (item5.comFlag == 1) {
|
||||
item5.color = '#00f93b !important'
|
||||
} else if (item5.comFlag == 2) {
|
||||
item5.color = '#8c8c8c !important'
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
// if (VITE_FLAG) {
|
||||
processTreeData(res.data)
|
||||
let firstLevel6Node = findFirstLevel6Node(res.data)
|
||||
|
||||
nodeKey =
|
||||
res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
||||
res.data[0].children[0].children[0].children[0].children[0]?.id
|
||||
emit(
|
||||
'init',
|
||||
res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
||||
res.data[0].children[0].children[0].children[0].children[0]
|
||||
)
|
||||
nodeKey = firstLevel6Node.id
|
||||
emit('init', firstLevel6Node)
|
||||
// } else {
|
||||
// // 正常树处理
|
||||
// res.data.forEach((item: any) => {
|
||||
// item.icon = 'el-icon-HomeFilled'
|
||||
// item.color = config.getColorVal('elementUiPrimary')
|
||||
// item.children.forEach((item2: any) => {
|
||||
// item2.icon = 'el-icon-CollectionTag'
|
||||
// item2.color = config.getColorVal('elementUiPrimary')
|
||||
// item2.children.forEach((item3: any) => {
|
||||
// item3.icon = 'el-icon-Flag'
|
||||
// item3.color = config.getColorVal('elementUiPrimary')
|
||||
// item3.children.forEach((item4: any) => {
|
||||
// item4.icon = 'el-icon-OfficeBuilding'
|
||||
// item4.color = config.getColorVal('elementUiPrimary')
|
||||
// item4.children.forEach((item5: anyObj) => {
|
||||
// if (item5.level == 7) {
|
||||
// item5.icon = 'el-icon-DataAnalysis'
|
||||
// item5.color = config.getColorVal('elementUiPrimary')
|
||||
// item5.children.forEach((item6: anyObj) => {
|
||||
// item6.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}>${item6.name}`
|
||||
// item6.pid = item4.id
|
||||
// item6.icon = 'fa-solid fa-location-dot'
|
||||
// item6.color = config.getColorVal('elementUiPrimary')
|
||||
// if (item6.comFlag == 0) {
|
||||
// item6.color = 'red !important'
|
||||
// } else if (item6.comFlag == 1) {
|
||||
// item6.color = '#00f93b !important'
|
||||
// } else if (item6.comFlag == 2) {
|
||||
// item6.color = '#8c8c8c !important'
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// item5.alias = `${item.name}>${item2.name}>${item3.name}>${item4.name}>${item5.name}`
|
||||
// item5.pid = item4.id
|
||||
// item5.icon = 'fa-solid fa-location-dot'
|
||||
// item5.color = config.getColorVal('elementUiPrimary')
|
||||
// if (item5.comFlag == 0) {
|
||||
// item5.color = 'red !important'
|
||||
// } else if (item5.comFlag == 1) {
|
||||
// item5.color = '#00f93b !important'
|
||||
// } else if (item5.comFlag == 2) {
|
||||
// item5.color = '#8c8c8c !important'
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
|
||||
// nodeKey =
|
||||
// res.data[0].children[0].children[0].children[0].children[0].children[0]?.id ||
|
||||
// res.data[0].children[0].children[0].children[0].children[0]?.id
|
||||
// emit(
|
||||
// 'init',
|
||||
// res.data[0].children[0].children[0].children[0].children[0]?.children[0] ||
|
||||
// res.data[0].children[0].children[0].children[0].children[0]
|
||||
// )
|
||||
// }
|
||||
|
||||
tree.value = res.data
|
||||
if (nodeKey) {
|
||||
@@ -145,6 +158,109 @@ const scrollToNode = (id: string) => {
|
||||
// 树滚动
|
||||
treeRef.value.scrollToNode(id)
|
||||
}
|
||||
|
||||
// 定义不同层级对应的图标配置(可根据实际需求调整)
|
||||
const levelIconMap = {
|
||||
'-1': 'el-icon-HomeFilled',
|
||||
0: 'el-icon-CollectionTag',
|
||||
1: 'el-icon-CollectionTag',
|
||||
2: 'el-icon-Flag',
|
||||
3: 'el-icon-OfficeBuilding',
|
||||
4: 'el-icon-DataAnalysis',
|
||||
5: 'el-icon-DataAnalysis',
|
||||
7: 'el-icon-DataAnalysis',
|
||||
6: 'fa-solid fa-location-dot'
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归处理树形数据,为不同层级节点设置图标和颜色
|
||||
* @param data 树形数据数组
|
||||
* @param level 当前层级(默认从1开始)
|
||||
*/
|
||||
function processTreeData(data: any[], level: number = -1, alias: string = '') {
|
||||
// 空值判断,避免数组为空或undefined时报错
|
||||
if (!Array.isArray(data) || data.length === 0) return
|
||||
|
||||
data.forEach(item => {
|
||||
// 1. 设置基础图标(根据层级匹配)
|
||||
item.icon = levelIconMap[level] || ''
|
||||
item.alias = alias + `${item.name}`
|
||||
// 2. 设置基础颜色
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
|
||||
// 3. 第6层特殊处理:根据comFlag调整颜色
|
||||
if (level === 6 && item.hasOwnProperty('comFlag')) {
|
||||
switch (item.comFlag) {
|
||||
case 0:
|
||||
item.color = 'red !important'
|
||||
break
|
||||
case 1:
|
||||
item.color = '#00f93b !important'
|
||||
break
|
||||
case 2:
|
||||
item.color = '#8c8c8c !important'
|
||||
break
|
||||
// 默认值:保持原有基础颜色
|
||||
default:
|
||||
item.color = config.getColorVal('elementUiPrimary')
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 递归处理子节点,层级+1
|
||||
if (item.children && item.children.length > 0) {
|
||||
processTreeData(item.children, item.children[0].level, level == '-1' ? '' : item.alias + '>')
|
||||
}
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 递归查找树形结构中第一个level===6的节点(找到即终止递归)
|
||||
* @param {Object|Array} tree - 树形数据(根节点数组 或 单个根节点)
|
||||
* @returns {Object|null} 第一个level为6的节点,无则返回null
|
||||
*/
|
||||
function findFirstLevel6Node(tree: any) {
|
||||
// 统一处理入参:如果是数组,遍历根节点数组(按顺序找第一个符合条件的)
|
||||
if (Array.isArray(tree)) {
|
||||
for (const rootNode of tree) {
|
||||
const result = traverse(rootNode)
|
||||
// 找到第一个匹配节点,立即返回(终止根节点遍历)
|
||||
if (result) return result
|
||||
}
|
||||
// 所有根节点遍历完未找到
|
||||
return null
|
||||
} else {
|
||||
// 入参是单个节点,直接递归遍历
|
||||
return traverse(tree)
|
||||
}
|
||||
|
||||
// 核心递归遍历函数
|
||||
function traverse(node) {
|
||||
// 终止条件1:节点不存在,返回null
|
||||
if (!node) return null
|
||||
|
||||
// 终止条件2:找到level===6的节点,立即返回(终止递归)
|
||||
if (node.level === 6) {
|
||||
return node
|
||||
}
|
||||
|
||||
// 终止条件3:节点无children,返回null
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// 按顺序遍历当前节点的子节点
|
||||
for (const child of node.children) {
|
||||
const foundNode = traverse(child)
|
||||
// 子节点中找到目标节点,立即返回(终止后续子节点遍历)
|
||||
if (foundNode) {
|
||||
return foundNode
|
||||
}
|
||||
}
|
||||
|
||||
// 当前节点及所有子节点都无匹配,返回null
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ treeRef, scrollToNode, tree })
|
||||
loadData()
|
||||
</script>
|
||||
|
||||
@@ -28,7 +28,7 @@ const tree = ref()
|
||||
const treeRef = ref()
|
||||
|
||||
const loadData = (id?: any) => {
|
||||
console.log('🚀 ~ loadData ~ id:', id)
|
||||
|
||||
let nodeKey = ''
|
||||
queryAll().then(res => {
|
||||
res.data.forEach((item: any) => {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{{ Math.floor(row.eventValue * 10000) / 100 }}
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="eventType" width="100px" title="暂降类型">
|
||||
<vxe-column field="eventType" width="100px" title="触发类型">
|
||||
<template #default="{ row }">
|
||||
{{ event.filter(item => item.id == row.eventType)[0]?.name || '/' }}
|
||||
</template>
|
||||
@@ -79,7 +79,7 @@ const init = async () => {
|
||||
// 设置消息接收回调
|
||||
mqttClient.onMessage((topic, message) => {
|
||||
const msg = JSON.parse(message.toString())
|
||||
console.log('🚀 ~ init ~ msg:', msg)
|
||||
// console.log('🚀 ~ init ~ msg:', msg)
|
||||
if (msg.deptList.includes(adminInfo.$state.deptId)) {
|
||||
drawer.value = true
|
||||
isLoading.value = true
|
||||
|
||||
@@ -1,109 +1,117 @@
|
||||
<template>
|
||||
<el-dialog draggable width="500px" v-model="dialogVisible" :title="title">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="校验密码:" prop="password">
|
||||
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
||||
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
||||
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, inject } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
||||
import { validatePwd } from '@/utils/common'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
|
||||
const adminInfo = useAdminInfo()
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('修改密码')
|
||||
const formRef = ref()
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = reactive({
|
||||
password: '',
|
||||
newPwd: '',
|
||||
confirmPwd: ''
|
||||
})
|
||||
const rules = {
|
||||
password: [
|
||||
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 12,
|
||||
message: '长度在 6 到 12 个字符',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
newPwd: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 12,
|
||||
message: '长度在 6 到 12 个字符',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ validator: validatePwd, trigger: 'blur' }
|
||||
],
|
||||
confirmPwd: [
|
||||
{ required: true, message: '请确认密码', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 12,
|
||||
message: '长度在 6 到 12 个字符',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请再次输入密码'))
|
||||
} else if (value !== form.newPwd) {
|
||||
callback(new Error('两次输入密码不一致!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const open = () => {
|
||||
dialogVisible.value = true
|
||||
form.password = ''
|
||||
form.newPwd = ''
|
||||
form.confirmPwd = ''
|
||||
}
|
||||
const submit = () => {
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
passwordConfirm(form.password).then(res => {
|
||||
updatePassword({
|
||||
id: adminInfo.$state.userIndex,
|
||||
newPassword: form.newPwd
|
||||
}).then((res: any) => {
|
||||
ElMessage.success('密码修改成功')
|
||||
dialogVisible.value = false
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
<template>
|
||||
<el-dialog draggable width="500px" v-model="dialogVisible" :title="title">
|
||||
<el-scrollbar>
|
||||
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" ref="formRef">
|
||||
<el-form-item label="校验密码:" prop="password">
|
||||
<el-input v-model="form.password" type="password" placeholder="请输入校验密码" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码:" prop="newPwd" style="margin-top: 20px">
|
||||
<el-input v-model="form.newPwd" type="password" placeholder="请输入新密码" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码:" prop="confirmPwd" style="margin-top: 20px">
|
||||
<el-input v-model="form.confirmPwd" type="password" placeholder="请输入确认密码" show-password />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">确认</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, inject } from 'vue'
|
||||
import { reactive } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
||||
import { validatePwd } from '@/utils/common'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import router from '@/router'
|
||||
import { useNavTabs } from '@/stores/navTabs'
|
||||
const navTabs = useNavTabs()
|
||||
const adminInfo = useAdminInfo()
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('修改密码')
|
||||
const formRef = ref()
|
||||
// 注意不要和表单ref的命名冲突
|
||||
const form = reactive({
|
||||
password: '',
|
||||
newPwd: '',
|
||||
confirmPwd: ''
|
||||
})
|
||||
const rules = {
|
||||
password: [
|
||||
{ required: true, message: '请输入校验密码', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 12,
|
||||
message: '长度在 6 到 12 个字符',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
newPwd: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 12,
|
||||
message: '长度在 6 到 12 个字符',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ validator: validatePwd, trigger: 'blur' }
|
||||
],
|
||||
confirmPwd: [
|
||||
{ required: true, message: '请确认密码', trigger: 'blur' },
|
||||
{
|
||||
min: 6,
|
||||
max: 12,
|
||||
message: '长度在 6 到 12 个字符',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator: (rule: any, value: string, callback: any) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请再次输入密码'))
|
||||
} else if (value !== form.newPwd) {
|
||||
callback(new Error('两次输入密码不一致!'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
required: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
const open = () => {
|
||||
dialogVisible.value = true
|
||||
form.password = ''
|
||||
form.newPwd = ''
|
||||
form.confirmPwd = ''
|
||||
}
|
||||
const submit = () => {
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
passwordConfirm(form.password).then(res => {
|
||||
updatePassword({
|
||||
id: adminInfo.$state.userIndex,
|
||||
newPassword: form.newPwd
|
||||
}).then((res: any) => {
|
||||
ElMessage.success('密码修改成功,请重新登录!')
|
||||
dialogVisible.value = false
|
||||
setTimeout(() => {
|
||||
navTabs.closeTabs()
|
||||
window.localStorage.clear()
|
||||
adminInfo.reset()
|
||||
router.push({ name: 'login' })
|
||||
}, 0)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
@@ -29,7 +29,7 @@ const emit = defineEmits(['update:modelValue'])
|
||||
const dialogVisible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => {
|
||||
console.log('set: ', val)
|
||||
|
||||
emit('update:modelValue', val)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import staticRoutes from '@/router/static'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import NProgress from 'nprogress'
|
||||
import { loading } from '@/utils/loading'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: staticRoutes
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.configure({ showSpinner: false })
|
||||
NProgress.start()
|
||||
if (!window.existLoading) {
|
||||
loading.show()
|
||||
window.existLoading = true
|
||||
}
|
||||
if (to.path == '/login' || to.path == '/404') {
|
||||
// 登录或者注册才可以往下进行
|
||||
next()
|
||||
} else if (to.path == '/admin/center/homePage') {
|
||||
window.open(window.location.origin + '/homePage/#/')
|
||||
} else {
|
||||
// 获取 token
|
||||
const adminInfo = useAdminInfo()
|
||||
const token = adminInfo.getToken()
|
||||
// token 不存在
|
||||
if (token === null || token === '') {
|
||||
ElMessage.error('您还没有登录,请先登录')
|
||||
next('/login')
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
||||
// next()
|
||||
})
|
||||
|
||||
// 路由加载后
|
||||
router.afterEach(() => {
|
||||
if (window.existLoading) {
|
||||
loading.hide()
|
||||
}
|
||||
NProgress.done()
|
||||
})
|
||||
|
||||
export default router
|
||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||
import staticRoutes from '@/router/static'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import NProgress from 'nprogress'
|
||||
import { loading } from '@/utils/loading'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: staticRoutes
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.configure({ showSpinner: false })
|
||||
NProgress.start()
|
||||
if (!window.existLoading) {
|
||||
loading.show()
|
||||
window.existLoading = true
|
||||
}
|
||||
if (to.path == '/login' || to.path == '/404') {
|
||||
// 登录或者注册才可以往下进行
|
||||
next()
|
||||
} else if (to.path == '/admin/center/homePage') {
|
||||
window.open(window.location.origin + '/homePage/#/')
|
||||
} else {
|
||||
// 获取 token
|
||||
const adminInfo = useAdminInfo()
|
||||
const token = adminInfo.getToken()
|
||||
// token 不存在
|
||||
if (token === null || token === '') {
|
||||
// ElMessage.error('您还没有登录,请先登录')
|
||||
next('/login')
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
||||
// next()
|
||||
})
|
||||
|
||||
// 路由加载后
|
||||
router.afterEach(() => {
|
||||
if (window.existLoading) {
|
||||
loading.hide()
|
||||
}
|
||||
NProgress.done()
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
@@ -1,246 +1,246 @@
|
||||
import { reactive } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { STORE_CONFIG } from '@/stores/constant/cacheKey'
|
||||
import type { Layout } from '@/stores/interface'
|
||||
|
||||
export const useConfig = defineStore(
|
||||
'config',
|
||||
() => {
|
||||
const layout: Layout = reactive({
|
||||
/* 全局 */
|
||||
showDrawer: false,
|
||||
// 是否收缩布局(小屏终端)
|
||||
shrink: false,
|
||||
// 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||
layoutMode: 'Classic',
|
||||
// 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||
mainAnimation: 'slide-right',
|
||||
// 是否暗黑模式
|
||||
isDark: false,
|
||||
elementUiPrimary: ['#002B6A', '#002B6A'],
|
||||
tableHeaderBackground: ['#F3F6F9', '#F3F6F9'],
|
||||
tableHeaderColor: ['#111', '#fff'],
|
||||
tableCurrent: ['#F3F6F9', '#F3F6F9'],
|
||||
/* 侧边菜单 */
|
||||
// 侧边菜单背景色
|
||||
menuBackground: ['#002B6A', '#1d1e1f'],
|
||||
// 侧边菜单文字颜色
|
||||
menuColor: ['#FFFFFF', '#CFD3DC'],
|
||||
// 侧边菜单激活项背景色
|
||||
menuActiveBackground: ['#002255', '#1d1e1f'],
|
||||
// 侧边菜单激活项文字色
|
||||
menuActiveColor: ['#409eff', '#3375b9'],
|
||||
// 侧边菜单顶栏背景色
|
||||
menuTopBarBackground: ['#002B6A', '#1d1e1f'],
|
||||
// 侧边菜单宽度(展开时),单位px
|
||||
menuWidth: 260,
|
||||
// 侧边菜单项默认图标
|
||||
menuDefaultIcon: 'fa fa-circle-o',
|
||||
// 是否水平折叠收起菜单
|
||||
menuCollapse: false,
|
||||
// 是否只保持一个子菜单的展开(手风琴)
|
||||
menuUniqueOpened: false,
|
||||
// 显示菜单栏顶栏(LOGO)
|
||||
menuShowTopBar: true,
|
||||
|
||||
/* 顶栏 */
|
||||
// 顶栏文字色
|
||||
headerBarTabColor: ['#FFFFFF', '#CFD3DC'],
|
||||
// // 顶栏激活项背景色
|
||||
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||
// 顶栏激活项文字色
|
||||
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||
// 顶栏背景色
|
||||
headerBarBackground: ['#002B6A', '#1d1e1f'],
|
||||
// 顶栏悬停时背景色
|
||||
headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||
})
|
||||
|
||||
const lang = reactive({
|
||||
// 默认语言,可选值<zh-cn|en>
|
||||
defaultLang: 'zh-cn',
|
||||
// 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||
fallbackLang: 'zh-cn',
|
||||
// 支持的语言列表
|
||||
langArray: [
|
||||
{ name: 'zh-cn', value: '中文简体' },
|
||||
{ name: 'en', value: 'English' }
|
||||
]
|
||||
})
|
||||
|
||||
function menuWidth() {
|
||||
if (layout.shrink) {
|
||||
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||
}
|
||||
// 菜单是否折叠
|
||||
return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||
}
|
||||
|
||||
function setLang(val: string) {
|
||||
lang.defaultLang = val
|
||||
}
|
||||
|
||||
function onSetLayoutColor(data = layout.layoutMode) {
|
||||
// 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||
const tempValue = layout.isDark
|
||||
? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||
: { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||
if (
|
||||
data == 'Classic' &&
|
||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||
) {
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||
} else if (
|
||||
data == 'Default' &&
|
||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||
) {
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||
}
|
||||
}
|
||||
|
||||
function setLayoutMode(data: string) {
|
||||
layout.layoutMode = data
|
||||
onSetLayoutColor(data)
|
||||
}
|
||||
|
||||
const setLayout = (name: keyof Layout, value: any) => {
|
||||
layout[name] = value as never
|
||||
}
|
||||
|
||||
const getColorVal = function (name: keyof Layout): string {
|
||||
const colors = layout[name] as string[]
|
||||
if (layout.isDark) {
|
||||
return colors[1]
|
||||
} else {
|
||||
return colors[0]
|
||||
}
|
||||
}
|
||||
|
||||
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||
},
|
||||
// () => {
|
||||
//
|
||||
// console.log('🚀 ~ subject:', subject)
|
||||
// const layout: Layout = reactive({
|
||||
// /* 全局 */
|
||||
// showDrawer: false,
|
||||
// // 是否收缩布局(小屏终端)
|
||||
// shrink: false,
|
||||
// // 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||
// layoutMode: 'Classic',
|
||||
// // 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||
// mainAnimation: subject.mainAnimation,
|
||||
// // 是否暗黑模式
|
||||
// isDark: false,
|
||||
// elementUiPrimary: JSON.parse(subject.elementUiPrimary),
|
||||
// tableHeaderBackground: JSON.parse(subject.tableHeaderBackground),
|
||||
// tableHeaderColor:JSON.parse(subject.tableHeaderColor),
|
||||
// tableCurrent: JSON.parse(subject.tableCurrent),
|
||||
// /* 侧边菜单 */
|
||||
// // 侧边菜单背景色
|
||||
// menuBackground: JSON.parse(subject.menuBackground),
|
||||
// // 侧边菜单文字颜色
|
||||
// menuColor:JSON.parse(subject.menuColor),
|
||||
// // 侧边菜单激活项背景色
|
||||
// menuActiveBackground:JSON.parse(subject.menuActiveBackground),
|
||||
// // 侧边菜单激活项文字色
|
||||
// menuActiveColor:JSON.parse(subject.menuActiveColor),
|
||||
// // 侧边菜单顶栏背景色
|
||||
// menuTopBarBackground: JSON.parse(subject.menuTopBarBackground),
|
||||
// // 侧边菜单宽度(展开时),单位px
|
||||
// menuWidth: 260,
|
||||
// // 侧边菜单项默认图标
|
||||
// menuDefaultIcon: 'fa fa-circle-o',
|
||||
// // 是否水平折叠收起菜单
|
||||
// menuCollapse: false,
|
||||
// // 是否只保持一个子菜单的展开(手风琴)
|
||||
// menuUniqueOpened: false,
|
||||
// // 显示菜单栏顶栏(LOGO)
|
||||
// menuShowTopBar: true,
|
||||
|
||||
// /* 顶栏 */
|
||||
// // 顶栏文字色
|
||||
// headerBarTabColor:JSON.parse(subject.headerBarTabColor),
|
||||
// // // 顶栏激活项背景色
|
||||
// headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||
// // 顶栏激活项文字色
|
||||
// headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||
// // 顶栏背景色
|
||||
// headerBarBackground: JSON.parse(subject.headerBarBackground),
|
||||
// // 顶栏悬停时背景色
|
||||
// headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||
// })
|
||||
// // console.log(123, window.localStorage.getItem('getTheme'))
|
||||
|
||||
// const lang = reactive({
|
||||
// // 默认语言,可选值<zh-cn|en>
|
||||
// defaultLang: 'zh-cn',
|
||||
// // 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||
// fallbackLang: 'zh-cn',
|
||||
// // 支持的语言列表
|
||||
// langArray: [
|
||||
// { name: 'zh-cn', value: '中文简体' },
|
||||
// { name: 'en', value: 'English' }
|
||||
// ]
|
||||
// })
|
||||
|
||||
// function menuWidth() {
|
||||
// if (layout.shrink) {
|
||||
// return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||
// }
|
||||
// // 菜单是否折叠
|
||||
// return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||
// }
|
||||
|
||||
// function setLang(val: string) {
|
||||
// lang.defaultLang = val
|
||||
// }
|
||||
|
||||
// function onSetLayoutColor(data = layout.layoutMode) {
|
||||
// // 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||
// const tempValue = layout.isDark
|
||||
// ? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||
// : { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||
// if (
|
||||
// data == 'Classic' &&
|
||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||
// ) {
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||
// } else if (
|
||||
// data == 'Default' &&
|
||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||
// ) {
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||
// }
|
||||
// }
|
||||
|
||||
// function setLayoutMode(data: string) {
|
||||
// layout.layoutMode = data
|
||||
// onSetLayoutColor(data)
|
||||
// }
|
||||
|
||||
// const setLayout = (name: keyof Layout, value: any) => {
|
||||
// layout[name] = value as never
|
||||
// }
|
||||
|
||||
// const getColorVal = function (name: keyof Layout): string {
|
||||
// const colors = layout[name] as string[]
|
||||
// if (layout.isDark) {
|
||||
// return colors[1]
|
||||
// } else {
|
||||
// return colors[0]
|
||||
// }
|
||||
// }
|
||||
|
||||
// return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||
// },
|
||||
{
|
||||
persist: {
|
||||
key: STORE_CONFIG
|
||||
}
|
||||
}
|
||||
)
|
||||
import { reactive } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import { STORE_CONFIG } from '@/stores/constant/cacheKey'
|
||||
import type { Layout } from '@/stores/interface'
|
||||
|
||||
export const useConfig = defineStore(
|
||||
'config',
|
||||
() => {
|
||||
const layout: Layout = reactive({
|
||||
/* 全局 */
|
||||
showDrawer: false,
|
||||
// 是否收缩布局(小屏终端)
|
||||
shrink: false,
|
||||
// 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||
layoutMode: 'Classic',
|
||||
// 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||
mainAnimation: 'slide-right',
|
||||
// 是否暗黑模式
|
||||
isDark: false,
|
||||
elementUiPrimary: ['#002B6A', '#002B6A'],
|
||||
tableHeaderBackground: ['#F3F6F9', '#F3F6F9'],
|
||||
tableHeaderColor: ['#111', '#fff'],
|
||||
tableCurrent: ['#F3F6F9', '#F3F6F9'],
|
||||
/* 侧边菜单 */
|
||||
// 侧边菜单背景色
|
||||
menuBackground: ['#002B6A', '#1d1e1f'],
|
||||
// 侧边菜单文字颜色
|
||||
menuColor: ['#FFFFFF', '#CFD3DC'],
|
||||
// 侧边菜单激活项背景色
|
||||
menuActiveBackground: ['#002255', '#1d1e1f'],
|
||||
// 侧边菜单激活项文字色
|
||||
menuActiveColor: ['#409eff', '#3375b9'],
|
||||
// 侧边菜单顶栏背景色
|
||||
menuTopBarBackground: ['#002B6A', '#1d1e1f'],
|
||||
// 侧边菜单宽度(展开时),单位px
|
||||
menuWidth: 260,
|
||||
// 侧边菜单项默认图标
|
||||
menuDefaultIcon: 'fa fa-circle-o',
|
||||
// 是否水平折叠收起菜单
|
||||
menuCollapse: false,
|
||||
// 是否只保持一个子菜单的展开(手风琴)
|
||||
menuUniqueOpened: false,
|
||||
// 显示菜单栏顶栏(LOGO)
|
||||
menuShowTopBar: true,
|
||||
|
||||
/* 顶栏 */
|
||||
// 顶栏文字色
|
||||
headerBarTabColor: ['#FFFFFF', '#CFD3DC'],
|
||||
// // 顶栏激活项背景色
|
||||
headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||
// 顶栏激活项文字色
|
||||
headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||
// 顶栏背景色
|
||||
headerBarBackground: ['#002B6A', '#1d1e1f'],
|
||||
// 顶栏悬停时背景色
|
||||
headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||
})
|
||||
|
||||
const lang = reactive({
|
||||
// 默认语言,可选值<zh-cn|en>
|
||||
defaultLang: 'zh-cn',
|
||||
// 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||
fallbackLang: 'zh-cn',
|
||||
// 支持的语言列表
|
||||
langArray: [
|
||||
{ name: 'zh-cn', value: '中文简体' },
|
||||
{ name: 'en', value: 'English' }
|
||||
]
|
||||
})
|
||||
|
||||
function menuWidth() {
|
||||
if (layout.shrink) {
|
||||
return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||
}
|
||||
// 菜单是否折叠
|
||||
return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||
}
|
||||
|
||||
function setLang(val: string) {
|
||||
lang.defaultLang = val
|
||||
}
|
||||
|
||||
function onSetLayoutColor(data = layout.layoutMode) {
|
||||
// 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||
const tempValue = layout.isDark
|
||||
? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||
: { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||
if (
|
||||
data == 'Classic' &&
|
||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||
) {
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||
} else if (
|
||||
data == 'Default' &&
|
||||
layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||
) {
|
||||
layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||
}
|
||||
}
|
||||
|
||||
function setLayoutMode(data: string) {
|
||||
layout.layoutMode = data
|
||||
onSetLayoutColor(data)
|
||||
}
|
||||
|
||||
const setLayout = (name: keyof Layout, value: any) => {
|
||||
layout[name] = value as never
|
||||
}
|
||||
|
||||
const getColorVal = function (name: keyof Layout): string {
|
||||
const colors = layout[name] as string[] || ['#082E6C', '#0e8780']
|
||||
if (layout.isDark) {
|
||||
return colors[1]
|
||||
} else {
|
||||
return colors[0]
|
||||
}
|
||||
}
|
||||
|
||||
return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||
},
|
||||
// () => {
|
||||
//
|
||||
// console.log('🚀 ~ subject:', subject)
|
||||
// const layout: Layout = reactive({
|
||||
// /* 全局 */
|
||||
// showDrawer: false,
|
||||
// // 是否收缩布局(小屏终端)
|
||||
// shrink: false,
|
||||
// // 后台布局方式,可选值<Default|Classic|Streamline|Double>
|
||||
// layoutMode: 'Classic',
|
||||
// // 后台主页面切换动画,可选值<slide-right|slide-left|el-fade-in-linear|el-fade-in|el-zoom-in-center|el-zoom-in-top|el-zoom-in-bottom>
|
||||
// mainAnimation: subject.mainAnimation,
|
||||
// // 是否暗黑模式
|
||||
// isDark: false,
|
||||
// elementUiPrimary: JSON.parse(subject.elementUiPrimary),
|
||||
// tableHeaderBackground: JSON.parse(subject.tableHeaderBackground),
|
||||
// tableHeaderColor:JSON.parse(subject.tableHeaderColor),
|
||||
// tableCurrent: JSON.parse(subject.tableCurrent),
|
||||
// /* 侧边菜单 */
|
||||
// // 侧边菜单背景色
|
||||
// menuBackground: JSON.parse(subject.menuBackground),
|
||||
// // 侧边菜单文字颜色
|
||||
// menuColor:JSON.parse(subject.menuColor),
|
||||
// // 侧边菜单激活项背景色
|
||||
// menuActiveBackground:JSON.parse(subject.menuActiveBackground),
|
||||
// // 侧边菜单激活项文字色
|
||||
// menuActiveColor:JSON.parse(subject.menuActiveColor),
|
||||
// // 侧边菜单顶栏背景色
|
||||
// menuTopBarBackground: JSON.parse(subject.menuTopBarBackground),
|
||||
// // 侧边菜单宽度(展开时),单位px
|
||||
// menuWidth: 260,
|
||||
// // 侧边菜单项默认图标
|
||||
// menuDefaultIcon: 'fa fa-circle-o',
|
||||
// // 是否水平折叠收起菜单
|
||||
// menuCollapse: false,
|
||||
// // 是否只保持一个子菜单的展开(手风琴)
|
||||
// menuUniqueOpened: false,
|
||||
// // 显示菜单栏顶栏(LOGO)
|
||||
// menuShowTopBar: true,
|
||||
|
||||
// /* 顶栏 */
|
||||
// // 顶栏文字色
|
||||
// headerBarTabColor:JSON.parse(subject.headerBarTabColor),
|
||||
// // // 顶栏激活项背景色
|
||||
// headerBarTabActiveBackground: ['#ffffff', '#1d1e1f'],
|
||||
// // 顶栏激活项文字色
|
||||
// headerBarTabActiveColor: ['#000000', '#409EFF'],
|
||||
// // 顶栏背景色
|
||||
// headerBarBackground: JSON.parse(subject.headerBarBackground),
|
||||
// // 顶栏悬停时背景色
|
||||
// headerBarHoverBackground: ['#f5f5f5', '#18222c']
|
||||
// })
|
||||
// // console.log(123, window.localStorage.getItem('getTheme'))
|
||||
|
||||
// const lang = reactive({
|
||||
// // 默认语言,可选值<zh-cn|en>
|
||||
// defaultLang: 'zh-cn',
|
||||
// // 当在默认语言包找不到翻译时,继续在 fallbackLang 语言包内查找翻译
|
||||
// fallbackLang: 'zh-cn',
|
||||
// // 支持的语言列表
|
||||
// langArray: [
|
||||
// { name: 'zh-cn', value: '中文简体' },
|
||||
// { name: 'en', value: 'English' }
|
||||
// ]
|
||||
// })
|
||||
|
||||
// function menuWidth() {
|
||||
// if (layout.shrink) {
|
||||
// return layout.menuCollapse ? '0px' : layout.menuWidth + 'px'
|
||||
// }
|
||||
// // 菜单是否折叠
|
||||
// return layout.menuCollapse ? '64px' : layout.menuWidth + 'px'
|
||||
// }
|
||||
|
||||
// function setLang(val: string) {
|
||||
// lang.defaultLang = val
|
||||
// }
|
||||
|
||||
// function onSetLayoutColor(data = layout.layoutMode) {
|
||||
// // 切换布局时,如果是为默认配色方案,对菜单激活背景色重新赋值
|
||||
// const tempValue = layout.isDark
|
||||
// ? { idx: 1, color: '#1d1e1f', newColor: '#141414' }
|
||||
// : { idx: 0, color: '#ffffff', newColor: '#f5f5f5' }
|
||||
// if (
|
||||
// data == 'Classic' &&
|
||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.color
|
||||
// ) {
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.newColor
|
||||
// } else if (
|
||||
// data == 'Default' &&
|
||||
// layout.headerBarBackground[tempValue.idx] == tempValue.color &&
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] == tempValue.newColor
|
||||
// ) {
|
||||
// layout.headerBarTabActiveBackground[tempValue.idx] = tempValue.color
|
||||
// }
|
||||
// }
|
||||
|
||||
// function setLayoutMode(data: string) {
|
||||
// layout.layoutMode = data
|
||||
// onSetLayoutColor(data)
|
||||
// }
|
||||
|
||||
// const setLayout = (name: keyof Layout, value: any) => {
|
||||
// layout[name] = value as never
|
||||
// }
|
||||
|
||||
// const getColorVal = function (name: keyof Layout): string {
|
||||
// const colors = layout[name] as string[]
|
||||
// if (layout.isDark) {
|
||||
// return colors[1]
|
||||
// } else {
|
||||
// return colors[0]
|
||||
// }
|
||||
// }
|
||||
|
||||
// return { layout, lang, menuWidth, setLang, setLayoutMode, setLayout, getColorVal, onSetLayoutColor }
|
||||
// },
|
||||
{
|
||||
persist: {
|
||||
key: STORE_CONFIG
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -29,12 +29,10 @@ export const useMonitoringPoint = defineStore(
|
||||
const setShowCheckBox = (val: boolean) => {
|
||||
if (val && state.lineIds.length === 0) {
|
||||
state.lineIds = [state.lineId]
|
||||
console.log('====================================')
|
||||
console.log(state.lineIds)
|
||||
console.log('====================================')
|
||||
}
|
||||
state.showCheckBox = val
|
||||
}
|
||||
|
||||
return { state, setValue, setShowCheckBox }
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,176 +1,176 @@
|
||||
<template>
|
||||
<div class='default-main'>
|
||||
<!-- 表头 -->
|
||||
<!-- date-picker 时间组件 area区域组件-->
|
||||
<TableHeader date-picker area>
|
||||
<template v-slot:select>
|
||||
<el-form-item label='关键词:'>
|
||||
<el-input
|
||||
style='width: 240px'
|
||||
v-model='tableStore.table.params.searchValue'
|
||||
clearable
|
||||
placeholder='仅根据用户名/登录名'
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<!-- 表格 -->
|
||||
<Table ref='tableRef' />
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref='popupEdit' />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { ref, onMounted, provide, defineOptions } from 'vue'
|
||||
import { ElMessageBox, 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 PopupEdit from './dialog.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
|
||||
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
||||
defineOptions({
|
||||
name: 'auth/userlist'
|
||||
})
|
||||
const popupEdit = ref()
|
||||
const tableStore = new TableStore({
|
||||
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
||||
// publicHeight: 60,
|
||||
url: '/user-boot/user/list',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '用户名称', field: 'name', minWidth: '130' },
|
||||
{ title: '登录名', field: 'loginName', minWidth: '130' },
|
||||
{ title: '角色', field: 'roleName', minWidth: '130' },
|
||||
{ title: '部门', field: 'deptName', minWidth: '200' },
|
||||
{ title: '电话', field: 'phoneShow', minWidth: '100' },
|
||||
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
|
||||
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
|
||||
{ title: '类型', field: 'casualUserName', minWidth: '80' },
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
width: '100',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'danger',
|
||||
1: 'success',
|
||||
2: 'warning',
|
||||
3: 'warning',
|
||||
4: 'info',
|
||||
5: 'danger'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '注销',
|
||||
1: '正常',
|
||||
2: '锁定',
|
||||
3: '待审核',
|
||||
4: '休眠',
|
||||
5: '密码过期'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '修改密码',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Lock',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1
|
||||
},
|
||||
click: row => {
|
||||
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'password'
|
||||
}).then(({ value }) => {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '激活',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '注销',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-SwitchButton',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1 && row.state !== 3
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
item.deptName = item.deptName || '/'
|
||||
item.phoneShow = item.phone || '/'
|
||||
item.roleName = item.role.length ? item.role : '/'
|
||||
switch (item.casualUser) {
|
||||
case 0:
|
||||
item.casualUserName = '临时用户'
|
||||
break
|
||||
case 1:
|
||||
item.casualUserName = '长期用户'
|
||||
break
|
||||
default:
|
||||
item.casualUserName = '/'
|
||||
break
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// 注入到子组件
|
||||
provide('tableStore', tableStore)
|
||||
// 默认参数 参数多的话可以使用Object.assign方法
|
||||
tableStore.table.params.searchState = 1
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.casualUser = -1
|
||||
tableStore.table.params.orderBy = ''
|
||||
onMounted(() => {
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
// 弹框
|
||||
const addUser = () => {
|
||||
popupEdit.value.open('新增用户')
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class='default-main'>
|
||||
<!-- 表头 -->
|
||||
<!-- date-picker 时间组件 area区域组件-->
|
||||
<TableHeader date-picker area>
|
||||
<template v-slot:select>
|
||||
<el-form-item label='关键词:'>
|
||||
<el-input
|
||||
style='width: 240px'
|
||||
v-model='tableStore.table.params.searchValue'
|
||||
clearable
|
||||
placeholder='仅根据用户名/登录名'
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<!-- 表格 -->
|
||||
<Table ref='tableRef' />
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref='popupEdit' />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { ref, onMounted, provide, defineOptions } from 'vue'
|
||||
import { ElMessageBox, 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 PopupEdit from './dialog.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
|
||||
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
||||
defineOptions({
|
||||
name: 'auth/userlist'
|
||||
})
|
||||
const popupEdit = ref()
|
||||
const tableStore = new TableStore({
|
||||
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
||||
// publicHeight: 60,
|
||||
url: '/user-boot/user/list',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '用户名称', field: 'name', minWidth: '130' },
|
||||
{ title: '登录名', field: 'loginName', minWidth: '130' },
|
||||
{ title: '角色', field: 'roleName', minWidth: '130' },
|
||||
{ title: '部门', field: 'deptName', minWidth: '200' },
|
||||
{ title: '电话', field: 'phoneShow', minWidth: '100' },
|
||||
{ title: '注册时间', field: 'registerTime', minWidth: '130' },
|
||||
{ title: '登录时间', field: 'loginTime', minWidth: '130' },
|
||||
{ title: '类型', field: 'casualUserName', minWidth: '80' },
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
width: '100',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'danger',
|
||||
1: 'success',
|
||||
2: 'warning',
|
||||
3: 'warning',
|
||||
4: 'info',
|
||||
5: 'danger'
|
||||
},
|
||||
replaceValue: {
|
||||
0: '注销',
|
||||
1: '正常',
|
||||
2: '锁定',
|
||||
3: '待审核',
|
||||
4: '休眠',
|
||||
5: '密码过期'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '修改密码',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Lock',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1
|
||||
},
|
||||
click: row => {
|
||||
ElMessageBox.prompt('二次校验密码确认', '注销用户', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'password'
|
||||
}).then(({ value }) => {
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '激活',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '注销',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-SwitchButton',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1 && row.state !== 3
|
||||
},
|
||||
click: row => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
item.deptName = item.deptName || '/'
|
||||
item.phoneShow = item.phone || '/'
|
||||
item.roleName = item.role.length ? item.role : '/'
|
||||
switch (item.casualUser) {
|
||||
case 0:
|
||||
item.casualUserName = '临时用户'
|
||||
break
|
||||
case 1:
|
||||
item.casualUserName = '长期用户'
|
||||
break
|
||||
default:
|
||||
item.casualUserName = '/'
|
||||
break
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
// 注入到子组件
|
||||
provide('tableStore', tableStore)
|
||||
// 默认参数 参数多的话可以使用Object.assign方法
|
||||
tableStore.table.params.searchState = 1
|
||||
tableStore.table.params.searchValue = ''
|
||||
tableStore.table.params.casualUser = -1
|
||||
tableStore.table.params.orderBy = ''
|
||||
onMounted(() => {
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
// 弹框
|
||||
const addUser = () => {
|
||||
popupEdit.value.open('新增用户')
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import { downloadFile } from '@/api/system-boot/file'
|
||||
|
||||
const sanitizeUrl = (url: string): string => {
|
||||
return url.replace(/\[/g, '(').replace(/\]/g, ')')
|
||||
}
|
||||
|
||||
// 下载文件
|
||||
export const download = (urls: string) => {
|
||||
//console.log('下载', urls)
|
||||
|
||||
|
||||
downloadFile({ filePath: urls })
|
||||
.then((res: any) => {
|
||||
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||
@@ -55,10 +60,8 @@ function removeLastDotSuffix(str: string) {
|
||||
export const previewFile = async (urls: any) => {
|
||||
//console.log('预览', urls)
|
||||
let url = ''
|
||||
//console.log('urls', decodeURI(urls))
|
||||
await downloadFile({ filePath: decodeURI(urls) })
|
||||
.then((res: any) => {
|
||||
|
||||
.then((res: any) => {
|
||||
// 1. 确定文件MIME类型(优化:用更简洁的方式)
|
||||
const getFileType = (url: string) => {
|
||||
const ext = url.split('.').pop()?.toLowerCase() || ''
|
||||
@@ -74,11 +77,8 @@ export const previewFile = async (urls: any) => {
|
||||
jpg: 'image/jpg'
|
||||
}
|
||||
return mimeMap[ext] || ''
|
||||
}
|
||||
|
||||
}
|
||||
const blob = new Blob([res], { type: getFileType(decodeURI(urls)) })
|
||||
|
||||
|
||||
// 3. 创建下载链接
|
||||
url = window.URL.createObjectURL(blob)
|
||||
})
|
||||
|
||||
@@ -52,11 +52,12 @@ class MQTT {
|
||||
}
|
||||
|
||||
try {
|
||||
const mqttUrl =
|
||||
localStorage.getItem('MqttUrl') == 'null'
|
||||
? 'ws://192.168.1.68:8083/mqtt'
|
||||
: localStorage.getItem('MqttUrl')
|
||||
|
||||
// const mqttUrl =
|
||||
// localStorage.getItem('MqttUrl') == 'null'
|
||||
// ? 'ws://192.168.1.68:8083/mqtt'
|
||||
// : localStorage.getItem('MqttUrl')
|
||||
const mqttUrl = localStorage.getItem('MqttUrl')
|
||||
if (mqttUrl == 'null' || mqttUrl == null) return
|
||||
this.client = mqtt.connect(mqttUrl, this.defaultOptions as IClientOptions)
|
||||
this.setupEventListeners()
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ interface TableStoreParams {
|
||||
publicHeight?: number //计算高度
|
||||
resetCallback?: () => void // 重置
|
||||
loadCallback?: () => void // 接口调用后的回调
|
||||
exportProcessingData?:() => void //导出处理数据
|
||||
exportProcessingData?: () => void //导出处理数据
|
||||
beforeSearchFun?: () => void // 接口调用前的回调
|
||||
}
|
||||
|
||||
@@ -45,8 +45,9 @@ export default class TableStore {
|
||||
pageNum: 1,
|
||||
pageSize: 20
|
||||
},
|
||||
filename:null,
|
||||
filename: null,
|
||||
loading: true,
|
||||
exportLoading: false,
|
||||
column: [],
|
||||
loadCallback: null,
|
||||
exportProcessingData: null,
|
||||
@@ -65,7 +66,7 @@ export default class TableStore {
|
||||
this.table.filename = options.filename || null
|
||||
this.table.column = options.column
|
||||
this.showPage = options.showPage !== false
|
||||
|
||||
|
||||
this.table.publicHeight = options.publicHeight || 0
|
||||
this.table.resetCallback = options.resetCallback || null
|
||||
this.table.loadCallback = options.loadCallback || null
|
||||
@@ -84,13 +85,11 @@ export default class TableStore {
|
||||
this.initData = JSON.parse(JSON.stringify(this.table.params))
|
||||
}
|
||||
if (!this.timeAll) {
|
||||
delete this.table.params.startTime;
|
||||
delete this.table.params.endTime;
|
||||
delete this.table.params.searchBeginTime;
|
||||
delete this.table.params.searchEndTime;
|
||||
delete this.table.params.timeFlag;
|
||||
|
||||
|
||||
delete this.table.params.startTime
|
||||
delete this.table.params.endTime
|
||||
delete this.table.params.searchBeginTime
|
||||
delete this.table.params.searchEndTime
|
||||
delete this.table.params.timeFlag
|
||||
}
|
||||
createAxios(
|
||||
Object.assign(
|
||||
@@ -130,11 +129,11 @@ export default class TableStore {
|
||||
* @param data 携带数据
|
||||
*/
|
||||
onTableAction = (event: string, data: anyObj) => {
|
||||
|
||||
const actionFun = new Map([
|
||||
[
|
||||
'search',
|
||||
() => {
|
||||
|
||||
this.table.params.pageNum = 1
|
||||
this.index()
|
||||
}
|
||||
@@ -202,8 +201,9 @@ export default class TableStore {
|
||||
[
|
||||
'export',
|
||||
() => {
|
||||
this.table.exportLoading = true
|
||||
// this.index()
|
||||
console.log('export')
|
||||
//console.log('export')
|
||||
let params = { ...this.table.params, pageNum: 1, pageSize: this.table.total }
|
||||
createAxios(
|
||||
Object.assign(
|
||||
@@ -213,12 +213,17 @@ export default class TableStore {
|
||||
},
|
||||
requestPayload(this.method, params, this.paramsPOST)
|
||||
)
|
||||
).then(res => {
|
||||
this.table.allData = filtration(res.data.records || res.data)
|
||||
console.log('11111',this.table)
|
||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||
this.table.allFlag = data.showAllFlag || true
|
||||
})
|
||||
)
|
||||
.then(res => {
|
||||
this.table.allData = filtration(res.data.records || res.data)
|
||||
this.table.exportProcessingData && this.table.exportProcessingData()
|
||||
this.table.allFlag = data.showAllFlag || true
|
||||
this.table.exportLoading = false
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.table.exportLoading = false
|
||||
})
|
||||
}
|
||||
]
|
||||
])
|
||||
|
||||
@@ -301,7 +301,7 @@ const options1 = [
|
||||
const height = mainHeight(20)
|
||||
const heightB = mainHeight(448)
|
||||
const heightA = mainHeight(180)
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const TableHeaderRef = ref()
|
||||
const detailRef = ref()
|
||||
const dotList: any = ref({})
|
||||
@@ -786,7 +786,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||
//console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||
if (data.level == 6) {
|
||||
dotList.value = data
|
||||
// dotList.value.id = '6469e77fda42db12c7ca6620a092f03c1'
|
||||
|
||||
@@ -321,7 +321,7 @@ const options1 = [
|
||||
]
|
||||
const height = mainHeight(20)
|
||||
const heightB = mainHeight(445)
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const TableHeaderRef = ref()
|
||||
const detailRef = ref()
|
||||
const dotList: any = ref({})
|
||||
@@ -757,7 +757,7 @@ const timeClick = (row: any) => {
|
||||
}
|
||||
// 点击越限
|
||||
const detailClick = (row: any, title: string, key: string) => {
|
||||
console.log('🚀 ~ detailClick ~ row:', row)
|
||||
// console.log('🚀 ~ detailClick ~ row:', row)
|
||||
detailRef.value.open({
|
||||
row: row,
|
||||
title: title,
|
||||
@@ -802,7 +802,7 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||
// console.log('🚀 ~ handleNodeClick ~ data:', data)
|
||||
if (data.level == 6) {
|
||||
dotList.value = data
|
||||
// dotList.value.id = '6469e77fda42db12c7ca6620a092f03c1'
|
||||
|
||||
@@ -1,125 +1,125 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="新能源场站名称">
|
||||
<el-input v-model="tableStore.table.params.name" clearable placeholder="输入关键字筛选" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!--弹框-->
|
||||
<addForm ref="addFormRef" @onSubmit="tableStore.index()" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import addForm from './components/addForm.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { delNewStation } from '@/api/device-boot/newEnergy'
|
||||
defineOptions({
|
||||
name: 'newEnergy/newEnergyLedger'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
const newEnergy = dictData.getBasicData('new_station_type')
|
||||
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const tableRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const addFormRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/newStation/queryPage',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'name', title: '新能源场站名称' },
|
||||
{
|
||||
field: 'stationType',
|
||||
title: '新能源场站类型',
|
||||
|
||||
formatter: (row: any) => newEnergy.filter(item => item.id == row.cellValue)[0]?.name
|
||||
},
|
||||
{
|
||||
field: 'scale',
|
||||
title: '电压等级',
|
||||
|
||||
formatter: (row: any) => scaleList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
},
|
||||
{ field: 'ratedPower', title: '额定有功功率(kW)' },
|
||||
{ field: 'longitude', title: '经度' },
|
||||
{ field: 'latitude', title: '纬度' },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '修改',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-edit',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
addFormRef.value.open({
|
||||
title: '修改',
|
||||
row: row
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除该数据吗?'
|
||||
},
|
||||
click: row => {
|
||||
delNewStation({ ids: row.id }).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
tableStore.table.params.name = ''
|
||||
const add = () => {
|
||||
addFormRef.value.open({
|
||||
title: '新增'
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="新能源场站名称">
|
||||
<el-input v-model="tableStore.table.params.name" clearable placeholder="输入关键字筛选" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!--弹框-->
|
||||
<addForm ref="addFormRef" @onSubmit="tableStore.index()" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import addForm from './components/addForm.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { delNewStation } from '@/api/device-boot/newEnergy'
|
||||
defineOptions({
|
||||
name: 'newEnergy/newEnergyLedger'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
const newEnergy = dictData.getBasicData('new_station_type')
|
||||
const scaleList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const tableRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const addFormRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/newStation/queryPage',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'name', title: '新能源场站名称' },
|
||||
{
|
||||
field: 'stationType',
|
||||
title: '新能源场站类型',
|
||||
|
||||
formatter: (row: any) => newEnergy.filter(item => item.id == row.cellValue)[0]?.name
|
||||
},
|
||||
{
|
||||
field: 'scale',
|
||||
title: '电压等级',
|
||||
|
||||
formatter: (row: any) => scaleList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
},
|
||||
{ field: 'ratedPower', title: '额定有功功率(kW)' },
|
||||
{ field: 'longitude', title: '经度' },
|
||||
{ field: 'latitude', title: '纬度' },
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
align: 'center',
|
||||
render: 'buttons',
|
||||
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '修改',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-edit',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
addFormRef.value.open({
|
||||
title: '修改',
|
||||
row: row
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除该数据吗?'
|
||||
},
|
||||
click: row => {
|
||||
delNewStation({ ids: row.id }).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
||||
},
|
||||
loadCallback: () => {}
|
||||
})
|
||||
tableStore.table.params.name = ''
|
||||
const add = () => {
|
||||
addFormRef.value.open({
|
||||
title: '新增'
|
||||
})
|
||||
}
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
||||
@@ -38,6 +38,7 @@ const tableStore = new TableStore({
|
||||
echarts.value.Grade(tableStore.table.data.voltageStatistics)
|
||||
echarts.value.Relation(tableStore.table.data.monthlyStatistics)
|
||||
table.value.info(tableStore.table.data)
|
||||
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TableHeader datePicker :showReset="false" showExport ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入"></el-input>
|
||||
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入" clearable maxlength="32" show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
@@ -288,18 +288,21 @@ const equipment = (row: any) => {}
|
||||
// 承载能力评估
|
||||
const assess = () => {
|
||||
// vxeRef.value.getRadioRecord()
|
||||
|
||||
if (equipmentList.value.length == null) {
|
||||
return ElMessage.warning('请选择用户')
|
||||
|
||||
if (equipmentList.value.length == 0) {
|
||||
return ElMessage.warning('请选择有终端设备的用户')
|
||||
}
|
||||
loading.value = true
|
||||
formRef.value.validate((valid: any) => {
|
||||
|
||||
if (valid) {
|
||||
form.value.devList = equipmentList.value
|
||||
carryCapacityEvaluate(form.value).then(res => {
|
||||
rendering(res.data)
|
||||
loading.value = false
|
||||
})
|
||||
}else{
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -450,7 +453,7 @@ const selChange = async (e: any) => {
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
console.log("🚀 ~ onExport ~ document.getElementById('exportId'):", document.getElementById('exportId'))
|
||||
// console.log("🚀 ~ onExport ~ document.getElementById('exportId'):", document.getElementById('exportId'))
|
||||
|
||||
// 转换成canvas
|
||||
html2canvas(document.getElementById('exportId'), {
|
||||
@@ -459,7 +462,7 @@ const onExport = () => {
|
||||
logging: false, // 关闭日志
|
||||
scale: 2 // 提高缩放比例以获得更清晰的截图
|
||||
}).then(function (canvas) {
|
||||
console.log('🚀 ~ onExport ~ canvas:', canvas)
|
||||
// console.log('🚀 ~ onExport ~ canvas:', canvas)
|
||||
// 创建a标签,实现下载
|
||||
let creatIMg = document.createElement('a')
|
||||
creatIMg.download = '光伏电站承载能力评估结果.png' // 设置下载的文件名,
|
||||
|
||||
@@ -205,7 +205,7 @@ const props = defineProps(['rowList'])
|
||||
const harmonic = harmonicOptions.filter(item => item.value < 26)
|
||||
const currentLod = ref(false)
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const dictData = useDictData()
|
||||
const datePickerRef = ref()
|
||||
const height = mainHeight(80).height
|
||||
@@ -734,6 +734,7 @@ const choose = (e: any) => {
|
||||
|
||||
uploadExcel(e.raw, form).then(res => {
|
||||
ElMessage.success('导入成功')
|
||||
onSubmit()
|
||||
})
|
||||
}
|
||||
const tabChange = (e: any) => {
|
||||
|
||||
@@ -176,7 +176,7 @@ const info = () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
console.log('🚀 ~ queyDetail ~ photovoltaicData.value:', photovoltaicData.value)
|
||||
// console.log('🚀 ~ queyDetail ~ photovoltaicData.value:', photovoltaicData.value)
|
||||
})
|
||||
// 电弧炉
|
||||
queyDetailDhl().then(res => {
|
||||
|
||||
@@ -136,7 +136,7 @@ const tableStore: any = new TableStore({
|
||||
{ field: 'evaluateDate', title: '评估日期' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
|
||||
@@ -187,7 +187,7 @@ const tableStore: any = new TableStore({
|
||||
{ field: 'createBy', title: '创建者' },
|
||||
{ field: 'createTime', title: '创建日期' },
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
@@ -259,7 +259,7 @@ const tableStore: any = new TableStore({
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
console.log(tableStore.table.data)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<TableHeader datePicker showExport :showReset="false">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<div :key="key">
|
||||
<Table ref="tableRef" :height="'49vh'"></Table>
|
||||
<Table ref="tableRef" :height="'calc(50vh - 100px)'"></Table>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -31,10 +31,12 @@ const dialogVisible = ref(false)
|
||||
const tableStore = new TableStore({
|
||||
url: '/system-boot/frontLog/queryLogCHild',
|
||||
method: 'POST',
|
||||
filename: '前置交互日志详情',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TableHeader datePicker showExport>
|
||||
<template v-slot:select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable />
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入筛选数据" clearable maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
@@ -77,7 +77,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
></Table>
|
||||
</div>
|
||||
<div class="pd10" style="width: 400px" v-loading="loading">
|
||||
<el-input v-model="filterText" placeholder="请输入内容" clearable show-word-limit @input="change">
|
||||
<el-input v-model="filterText" placeholder="请输入内容" clearable maxlength="32" show-word-limit @input="change">
|
||||
<template #prefix>
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
@@ -83,7 +83,7 @@
|
||||
v-else
|
||||
class="box-item"
|
||||
title="确定重启吗?"
|
||||
placement="bottom"
|
||||
placement="left"
|
||||
@confirm="restart(data)"
|
||||
>
|
||||
<template #actions="{ confirm, cancel }">
|
||||
@@ -139,9 +139,9 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大终端数:" prop="nodeDevNum" class="top">
|
||||
<el-form-item label="最大终端数:" prop="nodeDevNum" class="top" >
|
||||
<el-input
|
||||
v-model="formData.nodeDevNum"
|
||||
v-model.trim.number="formData.nodeDevNum"
|
||||
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
||||
maxlength="5"
|
||||
placeholder="请输入最大终端数"
|
||||
@@ -149,7 +149,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="最大进程数:" prop="maxProcessNum" class="top">
|
||||
<el-input
|
||||
v-model="formData.maxProcessNum"
|
||||
v-model.trim.number="formData.maxProcessNum"
|
||||
onkeyup="value = value.replace(/[^0-9]/g,'')"
|
||||
maxlength="5"
|
||||
placeholder="请根据监测点规模填写合适进程数(1个进程最大可承载200个监测点)"
|
||||
@@ -209,7 +209,8 @@ import {
|
||||
updateNode,
|
||||
nodeDeviceTree,
|
||||
updateDeviceProcess,
|
||||
askRestartProcess
|
||||
askRestartProcess,
|
||||
allotTerminal
|
||||
} from '@/api/device-boot/Business'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
@@ -240,6 +241,7 @@ const tableRef = ref()
|
||||
const processNo = ref('')
|
||||
const ruleFormRef = ref()
|
||||
const dataSource: any = ref([])
|
||||
const deviceInfoList: any = ref([])
|
||||
const defaultProps = {
|
||||
children: 'deviceInfoList',
|
||||
label: 'name'
|
||||
@@ -288,7 +290,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '最大监测点数量',
|
||||
title: '最大终端数量',
|
||||
field: 'nodeDevNum'
|
||||
},
|
||||
{
|
||||
@@ -315,7 +317,7 @@ const tableStore = new TableStore({
|
||||
{ title: '描述', field: 'remark' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
@@ -350,7 +352,7 @@ const tableStore = new TableStore({
|
||||
},
|
||||
click: row => {
|
||||
askRestartProcess({
|
||||
deviceRebootType: null,
|
||||
deviceRebootType: 1,
|
||||
nodeId: row.id,
|
||||
processNo: 1
|
||||
}).then(res => {
|
||||
@@ -373,12 +375,42 @@ const tableStore = new TableStore({
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
if (hasDevices.value) {
|
||||
ElMessage.warning('此前置机绑定了设备,无法删除!');
|
||||
return;
|
||||
}
|
||||
|
||||
delNode(row.id).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '分配终端',
|
||||
type: 'primary',
|
||||
icon: 'InfoFilled',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'primary',
|
||||
title: '确定分配终端吗?'
|
||||
},
|
||||
click: row => {
|
||||
if (!hasDevices.value) {
|
||||
ElMessage.warning('此前置机下无设备,无法分配终端!');
|
||||
return;
|
||||
}
|
||||
allotTerminal({
|
||||
nodeId: row.id
|
||||
}).then(res => {
|
||||
ElMessage.success(res.message)
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -395,12 +427,14 @@ const tableStore = new TableStore({
|
||||
}
|
||||
})
|
||||
const nodeId = ref('')
|
||||
// 点击行
|
||||
const hasDevices = ref(false)
|
||||
/// 点击行
|
||||
const currentChangeEvent = () => {
|
||||
// 确保 tableRef 和当前记录存在
|
||||
if (!tableRef.value || !tableRef.value.getRef().getCurrentRecord()) {
|
||||
loading.value = false
|
||||
dataSource.value = []
|
||||
hasDevices.value = false
|
||||
return
|
||||
}
|
||||
|
||||
@@ -413,15 +447,27 @@ const currentChangeEvent = () => {
|
||||
nodeId.value = tableRef.value.getRef().getCurrentRecord().id
|
||||
// 检查返回的数据是否存在且不为空
|
||||
if (res.data && res.data.processDeviceList) {
|
||||
dataSource.value = res.data.processDeviceList.filter(item => (item.name = item.processNo + ''))
|
||||
// 检查是否有设备绑定
|
||||
const hasAnyDevices = res.data.processDeviceList.some(item =>
|
||||
item.deviceInfoList && item.deviceInfoList.length > 0
|
||||
);
|
||||
hasDevices.value = hasAnyDevices;
|
||||
|
||||
dataSource.value = res.data.processDeviceList.filter(item => {
|
||||
item.name = item.processNo + '';
|
||||
return true; // 保持原有的过滤逻辑
|
||||
});
|
||||
} else {
|
||||
dataSource.value = []
|
||||
hasDevices.value = false;
|
||||
}
|
||||
loading.value = false
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
// 添加错误处理,确保 loading 状态也能关闭
|
||||
dataSource.value = []
|
||||
hasDevices.value = false;
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
@@ -430,11 +476,11 @@ const currentChangeEvent = () => {
|
||||
|
||||
// 重启进程
|
||||
const restart = (data: any) => {
|
||||
console.log('🚀 ~ restart ~ data:', data)
|
||||
// console.log('🚀 ~ restart ~ data:', data)
|
||||
askRestartProcess({
|
||||
deviceRebootType: data.processNo,
|
||||
deviceRebootType: null,
|
||||
nodeId: nodeId.value,
|
||||
processNo: 2
|
||||
processNo: data.processNo
|
||||
}).then(res => {
|
||||
ElMessage.success('重启成功')
|
||||
currentChangeEvent()
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="程序版本">
|
||||
<!-- <el-form-item label="程序版本">
|
||||
<el-select v-model="tableStore.table.params.program" clearable placeholder="请选择程序版本">
|
||||
<el-option
|
||||
v-for="item in programoption"
|
||||
@@ -41,19 +41,21 @@
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input
|
||||
v-model="tableStore.table.params.filterName"
|
||||
@keyup="searchEvent"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
placeholder="输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<!-- <template #operation>
|
||||
<el-button icon="el-icon-Download" @click="add">导出</el-button>
|
||||
<el-button icon="el-icon-Check" @click="add">批量升级</el-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</TableHeader>
|
||||
<div :style="`height: calc(${tableStore.table.height} + 58px)`">
|
||||
<vxe-table
|
||||
@@ -104,7 +106,7 @@
|
||||
<vxe-column field="updateTime" title="最新升级时间"></vxe-column>
|
||||
<vxe-column title="操作" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button>
|
||||
<!-- <el-button v-if="row.level == 4" size="small" link @click="updateprogram(row)">升级</el-button> -->
|
||||
<el-button
|
||||
v-if="row.level == 4"
|
||||
:disabled="row.state == 1 ? true : false"
|
||||
@@ -251,6 +253,7 @@ const tableStore = new TableStore({
|
||||
}
|
||||
})
|
||||
tableStore.table.params.teriminal = ''
|
||||
tableStore.table.params.teriminalstatus = ''
|
||||
tableStore.table.params.state = ''
|
||||
tableStore.table.params.program = ''
|
||||
tableStore.table.params.searchEvent = ''
|
||||
|
||||
@@ -35,7 +35,7 @@ const dialogVisible = ref(false)
|
||||
const tableData = ref([])
|
||||
|
||||
const open = (e: any) => {
|
||||
console.log("🚀 ~ open ~ e:", e)
|
||||
//console.log("🚀 ~ open ~ e:", e)
|
||||
echartsXq.value = {
|
||||
title: {
|
||||
text: e.name + '性能详情'
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
v-model="tableStore.table.params.filterName"
|
||||
@keyup="searchEvent"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
placeholder="输入关键字筛选"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -75,6 +77,7 @@
|
||||
:checkbox-config="{ labelField: 'name' }"
|
||||
>
|
||||
<vxe-column
|
||||
v-if="treeData && treeData.length > 0"
|
||||
field="name"
|
||||
align="left"
|
||||
type="checkbox"
|
||||
@@ -82,6 +85,15 @@
|
||||
min-width="200"
|
||||
tree-node
|
||||
></vxe-column>
|
||||
<!-- 没有数据时显示普通列 -->
|
||||
<vxe-column
|
||||
v-else
|
||||
field="name"
|
||||
align="left"
|
||||
title="电网拓扑"
|
||||
min-width="200"
|
||||
tree-node
|
||||
></vxe-column>
|
||||
<vxe-column field="devType" title="终端型号">
|
||||
<template #default="{ row }">
|
||||
{{ teriminaloption.find((item: any) => item.id === row.devType)?.name }}
|
||||
@@ -223,7 +235,7 @@ const manage = (name: string, key: number) => {
|
||||
.getCheckboxRecords()
|
||||
.filter((item: any) => item.level == 4)
|
||||
.map(item => item.id)
|
||||
console.log('🚀 ~ deviceData ~ selectRecords:', selectRecords)
|
||||
//console.log('🚀 ~ deviceData ~ selectRecords:', selectRecords)
|
||||
if (selectRecords.length == 0) {
|
||||
return ElMessage({
|
||||
message: '请至少选择一台装置',
|
||||
|
||||
@@ -1694,7 +1694,7 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { getYwZtSubstation } from '@/api/device-boot/device'
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const TerminalRef = ref()
|
||||
const pageHeight = mainHeight(20)
|
||||
const Height = mainHeight(100)
|
||||
@@ -2313,7 +2313,7 @@ const remove = () => {
|
||||
const next = async () => {
|
||||
await mainForm.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
console.log('🚀 ~ awaitmainForm.value.validate ~ nodeLevel.value:', nodeLevel.value)
|
||||
// console.log('🚀 ~ awaitmainForm.value.validate ~ nodeLevel.value:', nodeLevel.value)
|
||||
|
||||
switch (nodeLevel.value) {
|
||||
case 100:
|
||||
@@ -2397,35 +2397,45 @@ const onsubmit = () => {
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
const submitData = () => {
|
||||
const submitData = async () => {
|
||||
const project = JSON.parse(JSON.stringify(AddProjectBO.value))
|
||||
|
||||
// project: JSON.stringify(project)
|
||||
addTerminal(project).then((res: any) => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.message
|
||||
})
|
||||
reaseStatus()
|
||||
initAddProjectBo()
|
||||
initAddProjectBoId()
|
||||
treedata()
|
||||
await mainForm.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
addTerminal(project).then((res: any) => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.message
|
||||
})
|
||||
reaseStatus()
|
||||
initAddProjectBo()
|
||||
initAddProjectBoId()
|
||||
treedata()
|
||||
})
|
||||
}
|
||||
})
|
||||
// project: JSON.stringify(project)
|
||||
|
||||
}
|
||||
/**
|
||||
* 修改数据
|
||||
*/
|
||||
const updateDate = () => {
|
||||
const updateDate = async () => {
|
||||
// console.log("updateProject:", this.updateProject);
|
||||
let data = updateProject.value
|
||||
updateTerminal(data).then((res: any) => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.message
|
||||
})
|
||||
pageStatus.value = 1
|
||||
treedata()
|
||||
await mainForm.value.validate((valid: any) => {
|
||||
if (valid){
|
||||
let data = updateProject.value
|
||||
updateTerminal(data).then((res: any) => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: res.message
|
||||
})
|
||||
pageStatus.value = 1
|
||||
treedata()
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
const updateProjectF = () => {
|
||||
updateProject.value = {
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
>
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleFormRef" label-width="100px">
|
||||
<el-form-item label="变压器名:" prop="tfName">
|
||||
<el-input v-model="ruleForm.tfName" placeholder="请输入" clearable></el-input>
|
||||
<el-input v-model="ruleForm.tfName" placeholder="请输入" clearable maxlength="32" show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="接线方式:" prop="wiring" class="top">
|
||||
<el-select style="width: 100%" v-model="ruleForm.wiring" clearable placeholder="请选择接线方式">
|
||||
@@ -113,7 +113,7 @@
|
||||
<el-col :span="8">
|
||||
<div style="border-right: 1px solid; height: 100%" class="xiaoshou">
|
||||
<div style="overflow-y: auto; height: 100%; overflow-x: auto;max-height: 350px;" class="tree mr10 xiaoshou">
|
||||
<el-input placeholder="输入关键字检索" v-model="filterText1" clearable></el-input>
|
||||
<el-input placeholder="输入关键字检索" v-model="filterText1" clearable maxlength="32" show-word-limit></el-input>
|
||||
<el-tree
|
||||
style="cursor: pointer;display: inline-block;"
|
||||
:data="treeMenuLeftData"
|
||||
@@ -163,7 +163,7 @@
|
||||
<el-col :span="8">
|
||||
<div style="border-left: 1px solid; height: 100%" class="xiaoshou">
|
||||
<div style="overflow-y: auto; height: 100%;overflow-x: auto;max-height: 350px;" class="ml10 tree xiaoshou">
|
||||
<el-input placeholder="输入关键字检索" v-model="filterText2" clearable></el-input>
|
||||
<el-input placeholder="输入关键字检索" v-model="filterText2" clearable maxlength="32" show-word-limit></el-input>
|
||||
<el-tree
|
||||
style="cursor: pointer"
|
||||
:data="treeMenuRightData"
|
||||
@@ -328,7 +328,7 @@ const tableStore = new TableStore({
|
||||
field: 'tfDescribe'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
@@ -372,6 +372,7 @@ const tableStore = new TableStore({
|
||||
click: row => {
|
||||
delTransformer([row.tfIndex]).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
menuTree.value.loadData()
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
@@ -413,6 +414,7 @@ const transformerAdd = () => {
|
||||
message: '请选择变电站'
|
||||
})
|
||||
} else {
|
||||
ruleForm.subIndex = parentId.value
|
||||
transformerTitle.value = '新增变压器信息'
|
||||
transformerInformation.value = true
|
||||
nextTick(() => {
|
||||
@@ -602,56 +604,74 @@ const maintenanceData = reactive({
|
||||
//上节点选择
|
||||
const checkLeft = (checkedNodes: any, checkedKeys: any) => {
|
||||
maintenanceData.upNode = checkedNodes.id
|
||||
if (maintenanceData.upNode === maintenanceData.downNode) {
|
||||
menuTreeRight.value?.setCheckedKeys([])
|
||||
maintenanceData.downNode = ''
|
||||
}
|
||||
if (checkedKeys.checkedKeys.length > 1) {
|
||||
menuTreeLeft.value?.setCheckedKeys([checkedNodes.id])
|
||||
}
|
||||
if (maintenanceData.upNode === maintenanceData.downNode) {
|
||||
menuTreeRight.value?.setCheckedKeys([])
|
||||
maintenanceData.downNode = ''
|
||||
}
|
||||
if (checkedKeys.checkedKeys.length > 1) {
|
||||
menuTreeLeft.value?.setCheckedKeys([checkedNodes.id])
|
||||
}
|
||||
}
|
||||
|
||||
//下节点选择
|
||||
const checkRight = (checkedNodes: any, checkedKeys: any) => {
|
||||
maintenanceData.downNode = checkedNodes.id
|
||||
if (maintenanceData.downNode === maintenanceData.upNode) {
|
||||
menuTreeLeft.value?.setCheckedKeys([])
|
||||
maintenanceData.upNode = ''
|
||||
}
|
||||
if (checkedKeys.checkedKeys.length > 1) {
|
||||
menuTreeRight.value?.setCheckedKeys([checkedNodes.id])
|
||||
}
|
||||
|
||||
if (maintenanceData.downNode === maintenanceData.upNode) {
|
||||
menuTreeLeft.value?.setCheckedKeys([])
|
||||
maintenanceData.upNode = ''
|
||||
}
|
||||
if (checkedKeys.checkedKeys.length > 1) {
|
||||
menuTreeRight.value?.setCheckedKeys([checkedNodes.id])
|
||||
}
|
||||
}
|
||||
|
||||
//节点维护提交
|
||||
const maintenanceOnsubmit = () => {
|
||||
for (let i = 0; i < bind.value.length; i++) {
|
||||
if (bind.value[i][0] == maintenanceData.upNode) {
|
||||
for (let j = 0; j < bind.value.length; j++) {
|
||||
if (bind.value[j][1] == maintenanceData.downNode) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '上下节点无法选择相同母线!!!'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if(maintenanceData.downNode == '' || maintenanceData.upNode == '') {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请确保上下节点各自选择一个母线!'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (bindLevel.value != 5) {
|
||||
for (let i = 0; i < bind.value.length; i++) {
|
||||
if (maintenanceData.upNode == bind.value[i][1] && maintenanceData.downNode == bind.value[i][0]) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '上下节点无法选择相同母线!!!'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (maintenanceData.upNode == maintenanceData.downNode) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '上下节点无法选择相同母线!'
|
||||
})
|
||||
}
|
||||
// for (let i = 0; i < bind.value.length; i++) {
|
||||
// if (bind.value[i] == maintenanceData.upNode) {
|
||||
// for (let j = 0; j < bind.value.length; j++) {
|
||||
|
||||
// if (bind.value[j] == maintenanceData.downNode) {
|
||||
// ElMessage({
|
||||
// type: 'warning',
|
||||
// message: '上下节点无法选择相同母线!!!'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (bindLevel.value != 5) {
|
||||
// for (let i = 0; i < bind.value.length; i++) {
|
||||
// if (maintenanceData.upNode == bind.value[i] && maintenanceData.downNode == bind.value[i]) {
|
||||
// ElMessage({
|
||||
// type: 'warning',
|
||||
// message: '上下节点无法选择相同母线!!!'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
nodeMaintenance(maintenanceData).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage({
|
||||
|
||||
@@ -53,12 +53,12 @@
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<div class="box">
|
||||
<el-form :model="form" label-width="100px" ref="ruleFormRef">
|
||||
<el-form-item label="名称:">
|
||||
<el-input v-model="form.tpName" placeholder="请输入"></el-input>
|
||||
<el-form :model="form" label-width="100px" ref="ruleFormRef" :rules="rules">
|
||||
<el-form-item label="名称:" prop="tpName">
|
||||
<el-input v-model="form.tpName" placeholder="请输入" maxlength="32" show-word-limit clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" class="mt20">
|
||||
<el-input v-model="form.tfDescribe" placeholder="请输入"></el-input>
|
||||
<el-input v-model="form.tfDescribe" placeholder="请输入" ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="mt20 ml20">
|
||||
<el-button @click="dialogFormVisible = false">取消</el-button>
|
||||
@@ -122,13 +122,8 @@ const menuTree = ref()
|
||||
const TableHeaderRef = ref()
|
||||
|
||||
const rules = reactive({
|
||||
name: [{ required: true, message: '名称不可为空', trigger: 'blur' }],
|
||||
ip: [{ required: true, message: 'ip不可为空', trigger: 'blur' }],
|
||||
nodeGrade: [{ required: true, message: '等级不可为空', trigger: 'blur' }],
|
||||
nodeDevNum: [{ required: true, message: '最大终端数不可为空', trigger: 'blur' }],
|
||||
maxProcessNum: [{ required: true, message: '最大进程数不可为空', trigger: 'blur' }],
|
||||
sort: [{ required: true, message: '排序不可为空', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '描述不可为空', trigger: 'blur' }]
|
||||
tpName: [{ required: true, message: '名称不可为空', trigger: 'blur' }],
|
||||
|
||||
})
|
||||
|
||||
const dialogFormVisible = ref(false)
|
||||
@@ -161,7 +156,7 @@ const tableStore = new TableStore({
|
||||
field: 'tfDescribe'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
align: 'center',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
v-model.trim="form.projectName"
|
||||
autocomplete="off"
|
||||
placeholder="请输入项目名称"
|
||||
maxlength="64"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -112,7 +112,7 @@
|
||||
v-model.trim="form.substation"
|
||||
autocomplete="off"
|
||||
placeholder="请输入厂站名称"
|
||||
maxlength="64"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -364,6 +364,8 @@
|
||||
v-model.trim="form.evaluationChekDept"
|
||||
autocomplete="off"
|
||||
placeholder="请输入预测评估评审单位"
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item for="-" label="预测评估结论:" style="width: 100%">
|
||||
@@ -1059,7 +1061,7 @@ const filterUsers = (arr: any) => {
|
||||
userTypeList.value = userTypeList.value.filter(item => !arr.includes(item.value))
|
||||
}
|
||||
const setcontroFlag = () => {
|
||||
console.log(12333)
|
||||
|
||||
|
||||
controFlag.value = true
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
{{ proviteData.agreementCapacity }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="装机容量(MW)">
|
||||
{{ proviteData?.ratePower }}
|
||||
{{ detailData?.ratePower }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item
|
||||
label="PCC供电设备容量(MVA)"
|
||||
@@ -332,6 +332,7 @@ const powerSupplyInfoOptionList = dictData.getBasicData('supply_condition')
|
||||
/** 获得数据 */
|
||||
const getInfo = async () => {
|
||||
detailLoading.value = true
|
||||
|
||||
try {
|
||||
if (props.update) {
|
||||
await getUserReportUpdateById(props.id || queryId).then(res => {
|
||||
@@ -341,6 +342,7 @@ const getInfo = async () => {
|
||||
} else {
|
||||
await getUserReportById(props.id || queryId).then(res => {
|
||||
detailData.value = res.data
|
||||
|
||||
getProviteData()
|
||||
})
|
||||
}
|
||||
@@ -383,7 +385,7 @@ const preview = (val: any, url: any) => {
|
||||
}
|
||||
//预测评估报告
|
||||
if (val == 'predictionEvaluationReport') {
|
||||
console.log(url, '9999999')
|
||||
|
||||
predictionEvaluationReportRef?.value.open(url)
|
||||
}
|
||||
//预测评估评审意见报告
|
||||
|
||||
@@ -1,315 +1,315 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="项目名称">
|
||||
<el-input
|
||||
style="width: 200px"
|
||||
placeholder="请输入项目名称"
|
||||
v-model="tableStore.table.params.projectName"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在地市">
|
||||
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
|
||||
<el-option
|
||||
v-for="item in areaOptionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">
|
||||
模板下载
|
||||
</el-button>
|
||||
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
|
||||
<el-dialog title="详情" width="60%" v-model="dialogShow" v-if="dialogShow">
|
||||
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
|
||||
</el-dialog>
|
||||
<!-- 批量导入 -->
|
||||
<sensitive-user-popup ref="sensitiveUserPopup" />
|
||||
|
||||
<!-- 查看详情 detail 新增/修改 create-->
|
||||
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import addForm from './components/addForm.vue'
|
||||
import SensitiveUserPopup from './components/sensitiveUserPopup.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
|
||||
import DetailInfo from './components/detail.vue'
|
||||
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
|
||||
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
|
||||
const addForms = ref()
|
||||
const dictData = useDictData()
|
||||
const sensitiveUserPopup = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const loading = ref(false)
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
const { push, options, currentRoute } = useRouter()
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
defineOptions({
|
||||
name: 'BusinessAdministrator/TerminalManagement/userLedger'
|
||||
})
|
||||
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/userReport/getUserLedgerPage',
|
||||
// publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
width: '60',
|
||||
type: 'checkbox'
|
||||
},
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'city', title: '所在地市', minWidth: 80 },
|
||||
{ field: 'substation', title: '厂站名称', minWidth: 100 },
|
||||
{ field: 'projectName', title: '项目名称', minWidth: 170 },
|
||||
{
|
||||
field: 'userType',
|
||||
title: '用户性质',
|
||||
minWidth: 150,
|
||||
formatter: (obj: any) => {
|
||||
const userType = obj.row.userType
|
||||
return getUserTypeName(userType)
|
||||
}
|
||||
},
|
||||
|
||||
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
|
||||
{ field: 'ratePower', title: '装机容量(MW)', minWidth: 130 },
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建人',
|
||||
minWidth: 80,
|
||||
formatter: (row: any) => {
|
||||
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
minWidth: 150,
|
||||
fixed: 'right',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '详细信息',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
lookInfo(row.id)
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !(row.status == 0)
|
||||
},
|
||||
|
||||
|
||||
click: row => {
|
||||
addForms.value.filterUsers([6])
|
||||
|
||||
addForms.value.open({
|
||||
title: '编辑',
|
||||
row: row
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
||||
}
|
||||
})
|
||||
tableStore.table.params.city = ''
|
||||
tableStore.table.params.orgId = adminInfo.$state.deptId
|
||||
tableStore.table.params.projectName = ''
|
||||
tableStore.table.params.loadType = ''
|
||||
tableStore.table.params.userName = ''
|
||||
tableStore.table.params.relationUserName = ''
|
||||
tableStore.table.params.aisFileUpload = ''
|
||||
|
||||
const userId = ref()
|
||||
const dialogShow = ref(false)
|
||||
|
||||
const lookInfo = (id: string) => {
|
||||
userId.value = id
|
||||
dialogShow.value = true
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
// 禁止点击
|
||||
const checkboxConfig = reactive({
|
||||
checkMethod: ({ row }) => {
|
||||
return adminInfo.roleCode.includes('delete_info')
|
||||
? true
|
||||
: row.createBy == adminInfo.$state.id && row.status == 0
|
||||
}
|
||||
})
|
||||
const deleteEven = () => {
|
||||
if (tableStore.table.selection.length == 0) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请选择要删除的数据'
|
||||
})
|
||||
} else {
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
/**取消流程操作*/
|
||||
const cancelLeave = async (row: any) => {
|
||||
// 二次确认
|
||||
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '取消原因不能为空'
|
||||
})
|
||||
// 发起取消
|
||||
let data = {
|
||||
id: row.id,
|
||||
processInstanceId: row.processInstanceId,
|
||||
dataType: 1,
|
||||
reason: value
|
||||
}
|
||||
await cancelFormData(data)
|
||||
ElMessage.success('取消成功')
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
// 新增
|
||||
const addFormModel = () => {
|
||||
addForms.value.filterUsers([6])
|
||||
|
||||
setTimeout(() => {
|
||||
addForms.value.open({
|
||||
title: '用户档案录入'
|
||||
})
|
||||
})
|
||||
}
|
||||
/**获取用户性质*/
|
||||
const getUserTypeName = (userType: any) => {
|
||||
if (userType === 0) {
|
||||
return '新建电网工程'
|
||||
}
|
||||
if (userType === 1) {
|
||||
return '扩建电网工程'
|
||||
}
|
||||
if (userType === 2) {
|
||||
return '新建非线性负荷用户'
|
||||
}
|
||||
if (userType === 3) {
|
||||
return '扩建非线性负荷用户'
|
||||
}
|
||||
if (userType === 4) {
|
||||
return '新建新能源发电站'
|
||||
}
|
||||
if (userType === 5) {
|
||||
return '扩建新能源发电站'
|
||||
}
|
||||
if (userType === 6) {
|
||||
return '敏感及重要用户'
|
||||
}
|
||||
return '新建电网工程'
|
||||
}
|
||||
//导出模板
|
||||
const exportExcelTemplate = async () => {
|
||||
loading.value = true
|
||||
await downloadSensitiveReportTemplate().then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '干扰源用户台账模板'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
await setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 0)
|
||||
}
|
||||
|
||||
//批量导入用户数据
|
||||
const importUserData = () => {
|
||||
sensitiveUserPopup.value.open('导入干扰源用户')
|
||||
}
|
||||
|
||||
const props = defineProps({ id: { type: String, default: 'null' } })
|
||||
watch(
|
||||
() => props.id,
|
||||
async (newValue, oldValue) => {
|
||||
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
|
||||
const fullId = newValue.split('@')[0]
|
||||
let nowTime = Date.now()
|
||||
const routeTime = Number(newValue.split('@')[1])
|
||||
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms,则不执行
|
||||
await getUserReportById(fullId).then(res => {
|
||||
if (res && res.code == 'A0000') {
|
||||
addForms.value.setcontroFlag()
|
||||
addForms.value.open({
|
||||
title: '重新发起',
|
||||
row: res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="项目名称">
|
||||
<el-input
|
||||
style="width: 200px"
|
||||
placeholder="请输入项目名称"
|
||||
v-model="tableStore.table.params.projectName"
|
||||
clearable
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="所在地市">
|
||||
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
|
||||
<el-option
|
||||
v-for="item in areaOptionList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
|
||||
<!-- <el-button icon="el-icon-Download" type="primary" @click="exportExcelTemplate" :loading="loading">
|
||||
模板下载
|
||||
</el-button>
|
||||
<el-button icon="el-icon-Upload" type="primary" @click="importUserData">批量导入</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
|
||||
<el-dialog title="详情" width="60%" v-model="dialogShow" v-if="dialogShow">
|
||||
<DetailInfo :id="userId" :openType="'sourcesOfInterference'"></DetailInfo>
|
||||
</el-dialog>
|
||||
<!-- 批量导入 -->
|
||||
<sensitive-user-popup ref="sensitiveUserPopup" />
|
||||
|
||||
<!-- 查看详情 detail 新增/修改 create-->
|
||||
<addForm ref="addForms" @onSubmit="tableStore.index()" :openType="'sourcesOfInterference'"></addForm>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, provide, nextTick, watch } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import addForm from './components/addForm.vue'
|
||||
import SensitiveUserPopup from './components/sensitiveUserPopup.vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { downloadSensitiveReportTemplate } from '@/api/supervision-boot/userReport/form'
|
||||
import DetailInfo from './components/detail.vue'
|
||||
import { cancelFormData, getUserReportById } from '@/api/supervision-boot/interfere/index'
|
||||
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
|
||||
const addForms = ref()
|
||||
const dictData = useDictData()
|
||||
const sensitiveUserPopup = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const loading = ref(false)
|
||||
const areaOptionList = dictData.getBasicData('jibei_area')
|
||||
const { push, options, currentRoute } = useRouter()
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
defineOptions({
|
||||
name: 'BusinessAdministrator/TerminalManagement/userLedger'
|
||||
})
|
||||
|
||||
//获取登陆用户姓名和部门
|
||||
const adminInfo = useAdminInfo()
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/userReport/getUserLedgerPage',
|
||||
// publicHeight: 65,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
width: '60',
|
||||
type: 'checkbox'
|
||||
},
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ field: 'city', title: '所在地市', minWidth: 80 },
|
||||
{ field: 'substation', title: '厂站名称', minWidth: 100 },
|
||||
{ field: 'projectName', title: '项目名称', minWidth: 170 },
|
||||
{
|
||||
field: 'userType',
|
||||
title: '用户性质',
|
||||
minWidth: 150,
|
||||
formatter: (obj: any) => {
|
||||
const userType = obj.row.userType
|
||||
return getUserTypeName(userType)
|
||||
}
|
||||
},
|
||||
|
||||
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
|
||||
{ field: 'ratePower', title: '装机容量(MW)', minWidth: 130 },
|
||||
{
|
||||
field: 'createBy',
|
||||
title: '创建人',
|
||||
minWidth: 80,
|
||||
formatter: (row: any) => {
|
||||
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
minWidth: 150,
|
||||
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '详细信息',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
lookInfo(row.id)
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Open',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return !(row.status == 0)
|
||||
},
|
||||
|
||||
|
||||
click: row => {
|
||||
addForms.value.filterUsers([6])
|
||||
|
||||
addForms.value.open({
|
||||
title: '编辑',
|
||||
row: row
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
||||
}
|
||||
})
|
||||
tableStore.table.params.city = ''
|
||||
tableStore.table.params.orgId = adminInfo.$state.deptId
|
||||
tableStore.table.params.projectName = ''
|
||||
tableStore.table.params.loadType = ''
|
||||
tableStore.table.params.userName = ''
|
||||
tableStore.table.params.relationUserName = ''
|
||||
tableStore.table.params.aisFileUpload = ''
|
||||
|
||||
const userId = ref()
|
||||
const dialogShow = ref(false)
|
||||
|
||||
const lookInfo = (id: string) => {
|
||||
userId.value = id
|
||||
dialogShow.value = true
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
// 禁止点击
|
||||
const checkboxConfig = reactive({
|
||||
checkMethod: ({ row }) => {
|
||||
return adminInfo.roleCode.includes('delete_info')
|
||||
? true
|
||||
: row.createBy == adminInfo.$state.id && row.status == 0
|
||||
}
|
||||
})
|
||||
const deleteEven = () => {
|
||||
if (tableStore.table.selection.length == 0) {
|
||||
ElMessage({
|
||||
type: 'warning',
|
||||
message: '请选择要删除的数据'
|
||||
})
|
||||
} else {
|
||||
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
})
|
||||
tableStore.index()
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
/**取消流程操作*/
|
||||
const cancelLeave = async (row: any) => {
|
||||
// 二次确认
|
||||
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputType: 'textarea',
|
||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||
inputErrorMessage: '取消原因不能为空'
|
||||
})
|
||||
// 发起取消
|
||||
let data = {
|
||||
id: row.id,
|
||||
processInstanceId: row.processInstanceId,
|
||||
dataType: 1,
|
||||
reason: value
|
||||
}
|
||||
await cancelFormData(data)
|
||||
ElMessage.success('取消成功')
|
||||
// 加载数据
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
// 新增
|
||||
const addFormModel = () => {
|
||||
addForms.value.filterUsers([6])
|
||||
|
||||
setTimeout(() => {
|
||||
addForms.value.open({
|
||||
title: '用户档案录入'
|
||||
})
|
||||
})
|
||||
}
|
||||
/**获取用户性质*/
|
||||
const getUserTypeName = (userType: any) => {
|
||||
if (userType === 0) {
|
||||
return '新建电网工程'
|
||||
}
|
||||
if (userType === 1) {
|
||||
return '扩建电网工程'
|
||||
}
|
||||
if (userType === 2) {
|
||||
return '新建非线性负荷用户'
|
||||
}
|
||||
if (userType === 3) {
|
||||
return '扩建非线性负荷用户'
|
||||
}
|
||||
if (userType === 4) {
|
||||
return '新建新能源发电站'
|
||||
}
|
||||
if (userType === 5) {
|
||||
return '扩建新能源发电站'
|
||||
}
|
||||
if (userType === 6) {
|
||||
return '敏感及重要用户'
|
||||
}
|
||||
return '新建电网工程'
|
||||
}
|
||||
//导出模板
|
||||
const exportExcelTemplate = async () => {
|
||||
loading.value = true
|
||||
await downloadSensitiveReportTemplate().then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = '干扰源用户台账模板'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
await setTimeout(() => {
|
||||
loading.value = false
|
||||
}, 0)
|
||||
}
|
||||
|
||||
//批量导入用户数据
|
||||
const importUserData = () => {
|
||||
sensitiveUserPopup.value.open('导入干扰源用户')
|
||||
}
|
||||
|
||||
const props = defineProps({ id: { type: String, default: 'null' } })
|
||||
watch(
|
||||
() => props.id,
|
||||
async (newValue, oldValue) => {
|
||||
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
|
||||
const fullId = newValue.split('@')[0]
|
||||
let nowTime = Date.now()
|
||||
const routeTime = Number(newValue.split('@')[1])
|
||||
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms,则不执行
|
||||
await getUserReportById(fullId).then(res => {
|
||||
if (res && res.code == 'A0000') {
|
||||
addForms.value.setcontroFlag()
|
||||
addForms.value.open({
|
||||
title: '重新发起',
|
||||
row: res.data
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -181,7 +181,7 @@ const zoom = (value: any) => {
|
||||
component: registerComponent(item.path)
|
||||
}))
|
||||
}
|
||||
console.log('🚀 ~ zoom ~ layout.value:', layout.value)
|
||||
// console.log('🚀 ~ zoom ~ layout.value:', layout.value)
|
||||
|
||||
flag.value = !flag.value
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ const cycle = [
|
||||
{ value: '3', label: '年' }
|
||||
]
|
||||
const changeTree = (row: any) => {
|
||||
console.log("🚀 ~ changeTree ~ row:", row)
|
||||
// console.log("🚀 ~ changeTree ~ row:", row)
|
||||
TreeList.value = row
|
||||
if (title.value == '修改算法') {
|
||||
if (row.level != 4) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<el-radio-button v-for="(item, i) in dotList?.childrens" :label="item.name" :value="i" />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div v-if="information">
|
||||
<div >
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser">新增</el-button>
|
||||
<el-button icon="el-icon-Edit" type="primary" @click="revise">修改</el-button>
|
||||
<el-button icon="el-icon-Delete" type="primary" @click="deletes">删除</el-button>
|
||||
@@ -134,7 +134,7 @@ defineOptions({
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const heightTab = mainHeight(82)
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const addTreeRef = ref()
|
||||
const editorRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
@@ -26,7 +26,7 @@ defineOptions({
|
||||
})
|
||||
const emits = defineEmits(['algorithm'])
|
||||
const height = mainHeight(20)
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
|
||||
const popupEditFlag = ref(false)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<el-drawer v-model="drawer" size="60%">
|
||||
<div class="box mt20">
|
||||
<el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
|
||||
v-if="information">
|
||||
v-if="information" >
|
||||
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
|
||||
</el-upload>
|
||||
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
|
||||
@@ -15,16 +15,16 @@
|
||||
<el-collapse-item title="国家电网有限公司企业标准" name="2">
|
||||
<!-- <el-empty description="暂无数据" class="custom-empty iframe" /> -->
|
||||
<div :style="`overflow: auto;`" class="iframe">
|
||||
<vue-office-docx v-if="url.includes('.doc') || url.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="url.includes('.xls') || url.includes('.xlsx')" :src="url"
|
||||
<vue-office-docx v-if="urlKey.includes('.doc') || urlKey.includes('.docx')" :src="url" />
|
||||
<vue-office-excel v-if="urlKey.includes('.xls') || urlKey.includes('.xlsx')" :src="url"
|
||||
:options="excelOptions" />
|
||||
<!-- <vue-office-pdf v-if="url.includes('.pdf')" :src="url" /> -->
|
||||
<iframe v-if="url.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<!-- <vue-office-pdf v-if="urlKey.includes('.pdf')" :src="url" /> -->
|
||||
<iframe v-if="urlKey.includes('.pdf')" :src="url" style="width: 100%; height: 99%"></iframe>
|
||||
<img v-if="
|
||||
url.includes('.png') ||
|
||||
url.includes('.jpg') ||
|
||||
url.includes('.gif') ||
|
||||
url.includes('.bmp')
|
||||
urlKey.includes('.png') ||
|
||||
urlKey.includes('.jpg') ||
|
||||
urlKey.includes('.gif') ||
|
||||
urlKey.includes('.bmp')
|
||||
" :src="url" />
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
@@ -45,6 +45,7 @@ import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
|
||||
import { previewFile } from '@/utils/fileDownLoad'
|
||||
const adminInfo = useAdminInfo()
|
||||
const drawer = ref(false)
|
||||
const activeName = ref('2')
|
||||
@@ -53,17 +54,14 @@ const url = ref('')
|
||||
const excelOptions = ref({})
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const open = (row: any) => {
|
||||
// console.log('🚀 ~ open ~ row:', row)
|
||||
// url.value = row
|
||||
|
||||
const urlKey=ref('')
|
||||
const open = async (row: any) => {
|
||||
drawer.value = true
|
||||
if(VITE_FLAG){
|
||||
url.value = `/api-docx/excelreport` + row
|
||||
excelOptions.value = { xls: row.split('.')[1] == 'xls' ? true : false }
|
||||
}else{
|
||||
urlKey.value=row
|
||||
const previewUrl = await previewFile(row);
|
||||
url.value = previewUrl;
|
||||
|
||||
}
|
||||
// getFileNameAndFilePath({ filePath: row }).then(res => {
|
||||
// url.value = res.data.url
|
||||
// })
|
||||
|
||||
@@ -1,274 +1,274 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<!-- 案例库 -->
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
|
||||
<el-button icon="el-icon-View" type="primary" @click="checkOutTheCriteria">查看常见治理措施</el-button>
|
||||
|
||||
<!-- <el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
|
||||
v-if="information">
|
||||
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
|
||||
</el-upload>
|
||||
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
|
||||
下载常见治理措施
|
||||
</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef"></Table>
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 简介详情 -->
|
||||
<el-dialog v-model="dialogVisible" title="事件简介" width="60%">
|
||||
<div class="editor" v-html="summary"></div>
|
||||
</el-dialog>
|
||||
<!-- 抽屉 -->
|
||||
<drawer ref="drawerRef" />
|
||||
<!-- 文件 -->
|
||||
<annex ref="annexRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import PopupEdit from './components/form.vue'
|
||||
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
|
||||
import drawer from './components/drawer.vue'
|
||||
import annex from './components/annex.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import katex from "katex";
|
||||
import "katex/dist/katex.css";
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/case'
|
||||
})
|
||||
|
||||
const popupEditRef = ref()
|
||||
const drawerRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const annexRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const summary = ref('')
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/libcase/pageQuery',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '电能质量事件名称', field: 'name' },
|
||||
{
|
||||
title: '发生地点',
|
||||
field: 'location'
|
||||
},
|
||||
// {
|
||||
// title: '发生事件',
|
||||
// field: 'type'
|
||||
// },
|
||||
// {
|
||||
// title: '事件经过',
|
||||
// field: 'process'
|
||||
// },
|
||||
// {
|
||||
// title: '处理措施',
|
||||
// field: 'measures'
|
||||
// },
|
||||
// {
|
||||
// title: '治理效果',
|
||||
// field: 'effect'
|
||||
// },
|
||||
{
|
||||
title: '事件简介',
|
||||
width: '140',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'view',
|
||||
title: '查看',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
dialogVisible.value = true
|
||||
summary.value = row.summary
|
||||
setTimeout(() => {
|
||||
|
||||
const spans = document.querySelectorAll('span[data-value]');
|
||||
// 遍历每个 span 标签
|
||||
spans.forEach(function (span) {
|
||||
|
||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||
throwOnError: false,
|
||||
})
|
||||
var newDiv = span;
|
||||
newDiv.innerHTML = val;
|
||||
|
||||
span.parentNode.replaceChild(newDiv, span);
|
||||
});
|
||||
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '200',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'view',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
annexRef.value.open(row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'view',
|
||||
title: '下载附件',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
annexRef.value.open(row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '修改',
|
||||
type: 'primary',
|
||||
disabled: row => {
|
||||
return !information
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
popupEditRef.value.open('修改案例', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
disabled: row => {
|
||||
return !information
|
||||
},
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
libcaseBeleteyById({ id: row.id }).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
loadCallback: () => { }
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
// 弹框
|
||||
const addUser = () => {
|
||||
popupEditRef.value.open('新增案例')
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
// console.log('🚀 ~ libcaseBeleteyById ~ tableStore:', tableStore)
|
||||
})
|
||||
const checkOutTheCriteria = () => {
|
||||
queryStandardCase().then(res => {
|
||||
drawerRef.value.open(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
// 上传
|
||||
const choose = (e: any) => {
|
||||
ElMessage.info('上传中,请稍等...')
|
||||
uploadFile(e.raw, '/supervision/').then((row: any) => {
|
||||
addStandardCase({ caseUrl: row.data.name }).then(res => {
|
||||
ElMessage.success('上传成功!')
|
||||
})
|
||||
})
|
||||
//
|
||||
}
|
||||
const downloadTheReport = () => {
|
||||
queryStandardCase().then(res => {
|
||||
let urls = res.data
|
||||
let name = urls.match(/\/([^/]+)\.(\w+)$/)[1]
|
||||
ElMessage.info('下载中,请稍等...')
|
||||
downloadFile({ filePath: urls }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
? 'application/pdf'
|
||||
: urls.includes('.docx')
|
||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
: urls.includes('.xls')
|
||||
? 'application/vnd.ms-excel'
|
||||
: urls.includes('.xlsx')
|
||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
: urls.includes('.png')
|
||||
? 'image/png'
|
||||
: urls.includes('.jpeg')
|
||||
? 'image/jpeg'
|
||||
: urls.includes('.jpg')
|
||||
? 'image/jpg'
|
||||
: ''
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = name
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.editor {
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<!-- 案例库 -->
|
||||
<TableHeader ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入搜索名称" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #operation>
|
||||
<el-button icon="el-icon-Plus" type="primary" @click="addUser" v-if="information">新增</el-button>
|
||||
<el-button icon="el-icon-View" type="primary" @click="checkOutTheCriteria">查看常见治理措施</el-button>
|
||||
|
||||
<!-- <el-upload :show-file-list="false" action="" :auto-upload="false" class="ml10" :on-change="choose"
|
||||
v-if="information">
|
||||
<el-button icon="el-icon-Top" type="primary">上传常见治理措施</el-button>
|
||||
</el-upload>
|
||||
<el-button icon="el-icon-Download" type="primary" class="ml10" @click="downloadTheReport">
|
||||
下载常见治理措施
|
||||
</el-button> -->
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef"></Table>
|
||||
<!-- 弹框 -->
|
||||
<PopupEdit ref="popupEditRef" @onSubmit="tableStore.index()" />
|
||||
<!-- 简介详情 -->
|
||||
<el-dialog v-model="dialogVisible" title="事件简介" width="60%">
|
||||
<div class="editor" v-html="summary"></div>
|
||||
</el-dialog>
|
||||
<!-- 抽屉 -->
|
||||
<drawer ref="drawerRef" />
|
||||
<!-- 文件 -->
|
||||
<annex ref="annexRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref, provide } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import PopupEdit from './components/form.vue'
|
||||
import { libcaseBeleteyById } from '@/api/supervision-boot/database/index'
|
||||
import drawer from './components/drawer.vue'
|
||||
import annex from './components/annex.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { uploadFile, getFileNameAndFilePath, downloadFile } from '@/api/system-boot/file'
|
||||
import { addStandardCase, queryStandardCase } from '@/api/supervision-boot/database/index'
|
||||
import { useAdminInfo } from '@/stores/adminInfo'
|
||||
import katex from "katex";
|
||||
import "katex/dist/katex.css";
|
||||
const adminInfo = useAdminInfo()
|
||||
defineOptions({
|
||||
name: 'database/case'
|
||||
})
|
||||
|
||||
const popupEditRef = ref()
|
||||
const drawerRef = ref()
|
||||
const TableHeaderRef = ref()
|
||||
const annexRef = ref()
|
||||
const dialogVisible = ref(false)
|
||||
const summary = ref('')
|
||||
const information = adminInfo.roleCode.includes('information_info')
|
||||
const tableStore = new TableStore({
|
||||
url: '/supervision-boot/libcase/pageQuery',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '电能质量事件名称', field: 'name' },
|
||||
{
|
||||
title: '发生地点',
|
||||
field: 'location'
|
||||
},
|
||||
// {
|
||||
// title: '发生事件',
|
||||
// field: 'type'
|
||||
// },
|
||||
// {
|
||||
// title: '事件经过',
|
||||
// field: 'process'
|
||||
// },
|
||||
// {
|
||||
// title: '处理措施',
|
||||
// field: 'measures'
|
||||
// },
|
||||
// {
|
||||
// title: '治理效果',
|
||||
// field: 'effect'
|
||||
// },
|
||||
{
|
||||
title: '事件简介',
|
||||
width: '140',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'view',
|
||||
title: '查看',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
dialogVisible.value = true
|
||||
summary.value = row.summary
|
||||
setTimeout(() => {
|
||||
|
||||
const spans = document.querySelectorAll('span[data-value]');
|
||||
// 遍历每个 span 标签
|
||||
spans.forEach(function (span) {
|
||||
|
||||
let val = katex.renderToString(span.getAttribute('data-value'), {
|
||||
throwOnError: false,
|
||||
})
|
||||
var newDiv = span;
|
||||
newDiv.innerHTML = val;
|
||||
|
||||
span.parentNode.replaceChild(newDiv, span);
|
||||
});
|
||||
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '操作',fixed: 'right',
|
||||
width: '200',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'view',
|
||||
title: '详情',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
annexRef.value.open(row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'view',
|
||||
title: '下载附件',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
annexRef.value.open(row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '修改',
|
||||
type: 'primary',
|
||||
disabled: row => {
|
||||
return !information
|
||||
},
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
popupEditRef.value.open('修改案例', row)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'delete',
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
disabled: row => {
|
||||
return !information
|
||||
},
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
libcaseBeleteyById({ id: row.id }).then(res => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
loadCallback: () => { }
|
||||
})
|
||||
tableStore.table.params.searchValue = ''
|
||||
// 弹框
|
||||
const addUser = () => {
|
||||
popupEditRef.value.open('新增案例')
|
||||
}
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
// console.log('🚀 ~ libcaseBeleteyById ~ tableStore:', tableStore)
|
||||
})
|
||||
const checkOutTheCriteria = () => {
|
||||
queryStandardCase().then(res => {
|
||||
drawerRef.value.open(res.data)
|
||||
})
|
||||
}
|
||||
|
||||
// 上传
|
||||
const choose = (e: any) => {
|
||||
ElMessage.info('上传中,请稍等...')
|
||||
uploadFile(e.raw, '/supervision/').then((row: any) => {
|
||||
addStandardCase({ caseUrl: row.data.name }).then(res => {
|
||||
ElMessage.success('上传成功!')
|
||||
})
|
||||
})
|
||||
//
|
||||
}
|
||||
const downloadTheReport = () => {
|
||||
queryStandardCase().then(res => {
|
||||
let urls = res.data
|
||||
let name = urls.match(/\/([^/]+)\.(\w+)$/)[1]
|
||||
ElMessage.info('下载中,请稍等...')
|
||||
downloadFile({ filePath: urls }).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: urls.includes('.pdf')
|
||||
? 'application/pdf'
|
||||
: urls.includes('.docx')
|
||||
? 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
: urls.includes('.xls')
|
||||
? 'application/vnd.ms-excel'
|
||||
: urls.includes('.xlsx')
|
||||
? 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
: urls.includes('.png')
|
||||
? 'image/png'
|
||||
: urls.includes('.jpeg')
|
||||
? 'image/jpeg'
|
||||
: urls.includes('.jpg')
|
||||
? 'image/jpg'
|
||||
: ''
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = name
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
link.remove()
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.editor {
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
th,
|
||||
td {
|
||||
border: 1px solid black;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -64,7 +64,7 @@ defineOptions({
|
||||
const excelOptions = ref({})
|
||||
const monitoringPoint = useMonitoringPoint()
|
||||
const height = mainHeight(20)
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const treeRef = ref()
|
||||
const addTreeRef = ref()
|
||||
const url = ref('')
|
||||
@@ -81,13 +81,14 @@ onMounted(() => {
|
||||
const urlKey=ref('')
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
|
||||
const handleNodeClick = (data: any, node: any) => {
|
||||
console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||
// console.log("🚀 ~ handleNodeClick ~ data:", data)
|
||||
dotList.value = data
|
||||
url.value = ''
|
||||
flag.value = false
|
||||
if (data?.url != null && data?.url != '') {
|
||||
flag.value = true
|
||||
urlKey.value = data.url
|
||||
console.log('urlKey.value',urlKey.value)
|
||||
setTimeout(async () => {
|
||||
if(VITE_FLAG){
|
||||
url.value = `/api-docx/excelreport` + data.url
|
||||
|
||||
@@ -91,8 +91,10 @@ const submit = () => {
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (urlList.value.length > 0) {
|
||||
|
||||
const promises = urlList.value.map(async (item: any) => {
|
||||
if (urlList.value[0].raw) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
uploadFile(item.raw, '/supervision/')
|
||||
.then((res: any) => {
|
||||
|
||||
@@ -49,7 +49,7 @@ const tableStore = new TableStore({
|
||||
field: 'createTime'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '280',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TableHeader datePicker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="筛选数据">
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" />
|
||||
<el-input v-model="tableStore.table.params.searchValue" placeholder="输入关键字筛选" clearable maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计类型:">
|
||||
<el-select
|
||||
@@ -131,7 +131,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'scale', title: '电压等级', minWidth: '110' },
|
||||
// {
|
||||
// field: 'advanceType',
|
||||
// title: '暂降类型',
|
||||
// title: '触发类型',
|
||||
// minWidth: '90',
|
||||
// formatter: (row: any) => {
|
||||
// return row.cellValue || '其他'
|
||||
@@ -147,7 +147,7 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'eventType',
|
||||
title: '暂态统计类型',
|
||||
title: '触发类型',
|
||||
minWidth: '120',
|
||||
formatter: (row: any) => {
|
||||
return eventList.filter(item => item.id === row.cellValue)[0]?.name
|
||||
@@ -179,7 +179,7 @@ const tableStore = new TableStore({
|
||||
{ field: 'duration', title: '持续时间(s)', minWidth: '100' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '120',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classificationData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择干扰源类型"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in interfereoption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
<el-option v-for="item in sign" :key="item.id" :label="item.name" :value="item.algoDescribe" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/harmonicDistortionRate'
|
||||
})
|
||||
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
const sign = dictData.getBasicData('power_flag')
|
||||
|
||||
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/tHDistortion/getTHDistortionTableData',
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'subStation',
|
||||
title: '变电站',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
field: 'city',
|
||||
title: '所在地市',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
field: 'manufacturer',
|
||||
title: '终端厂家',
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
field: 'deviceName',
|
||||
title: '终端名称',
|
||||
minWidth: 80
|
||||
},
|
||||
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'ip',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
title: '总谐波畸变率(%)',
|
||||
field: 'distortion',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue == 3.14159 ? '暂无数据' : row.cellValue
|
||||
},
|
||||
minWidth: 120
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
})
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
@@ -107,7 +107,7 @@ const tableStore = new TableStore({
|
||||
var tips = ''
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
if (params[i].value == 1) {
|
||||
if (params[i].value == 3.14159) {
|
||||
tips += params[i].name + '</br>'
|
||||
tips += params[i].marker + '在线率:暂无数据'
|
||||
} else {
|
||||
@@ -143,7 +143,21 @@ const tableStore = new TableStore({
|
||||
//color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}
|
||||
// 定制显示(按顺序)
|
||||
color: function (params: any) {
|
||||
if (params.value >= 90) {
|
||||
if (params.value == 3.14159) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#ccc'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
}else if (params.value >= 90) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
@@ -171,7 +185,7 @@ const tableStore = new TableStore({
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value <= 60 && params.value > 1) {
|
||||
} else if (params.value > 0 && params.value <= 60) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
@@ -180,12 +194,12 @@ const tableStore = new TableStore({
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#A52a2a'
|
||||
color: '#CC0100'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value > 0 && params.value <= 1) {
|
||||
} else if (params.value == 0) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
|
||||
@@ -153,7 +153,7 @@ const treeData = ref([])
|
||||
const idArr = ref([])
|
||||
const activeName = ref(0)
|
||||
const getTreeData = async () => {
|
||||
console.log('getTreeData')
|
||||
|
||||
await getAreaDept().then(res => {
|
||||
var data = res.data
|
||||
data.forEach(element => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader datePicker ref="header">
|
||||
<TableHeader area datePicker ref="header">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
@@ -11,82 +11,119 @@
|
||||
</TableHeader>
|
||||
<div v-loading="tableStore.table.loading" class="pr10">
|
||||
<el-row>
|
||||
<el-col :span="12" class="pd10">
|
||||
<el-tag style="background: #339966;" class="tag" size="small">5级</el-tag>
|
||||
<span style="color: #339966;" class="text">:优秀--(4.5,5]</span>
|
||||
<el-tag style="background: #3399ff;" class="tag" size="small">4级</el-tag>
|
||||
<span style="color: #3399ff;" class="text">:良好--(4,4.5]</span>
|
||||
<el-tag style="background: #ffcc33;" class="tag" size="small">3级</el-tag>
|
||||
<span style="color: #ffcc33;" class="text">:合格--(3,4]</span>
|
||||
<el-tag style="background: #ff9900;" class="tag" size="small">2级</el-tag>
|
||||
<span style="color: #ff9900;" class="text">:较差--(2,3]</span>
|
||||
<el-tag style="background: #A52a2a;" class="tag" size="small">1级</el-tag>
|
||||
<span style="color: #A52a2a;" class="text">:极差--[1,2]</span>
|
||||
<el-col :span="12" class="pd10" v-if="!VITE_FLAG">
|
||||
<el-tag style="background: #339966" class="tag" size="small">5级</el-tag>
|
||||
<span style="color: #339966" class="text">:优秀--(4.5,5]</span>
|
||||
<el-tag style="background: #3399ff" class="tag" size="small">4级</el-tag>
|
||||
<span style="color: #3399ff" class="text">:良好--(4,4.5]</span>
|
||||
<el-tag style="background: #ffcc33" class="tag" size="small">3级</el-tag>
|
||||
<span style="color: #ffcc33" class="text">:合格--(3,4]</span>
|
||||
<el-tag style="background: #ff9900" class="tag" size="small">2级</el-tag>
|
||||
<span style="color: #ff9900" class="text">:较差--(2,3]</span>
|
||||
<el-tag style="background: #a52a2a" class="tag" size="small">1级</el-tag>
|
||||
<span style="color: #a52a2a" class="text">:极差--[1,2]</span>
|
||||
<div :style="{ height: layout.height }" style="overflow-y: auto" class="mt10">
|
||||
<div class=" cardBox">
|
||||
<div class="cardBox">
|
||||
<el-card v-for="(item, index) in tableStore.table.data" :key="index">
|
||||
<template #header>
|
||||
<div style="cursor: pointer;">
|
||||
<el-tag v-if="item.data == 3.14159 || item.data == 0"
|
||||
style="background: #ccc; color: #fff" size="small">
|
||||
<div style="cursor: pointer">
|
||||
<el-tag
|
||||
v-if="item.data == 3.14159 || item.data == 0"
|
||||
style="background: #ccc; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
无
|
||||
</el-tag>
|
||||
<el-tag v-if="4.5 < item.data && item.data <= 5 && item.data !== 3.14159"
|
||||
style="background: #339966; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="4.5 < item.data && item.data <= 5 && item.data !== 3.14159"
|
||||
style="background: #339966; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
5级
|
||||
</el-tag>
|
||||
<el-tag v-if="4 < item.data && item.data <= 4.5 && item.data !== 3.14159"
|
||||
style="background: #3399ff; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="4 < item.data && item.data <= 4.5 && item.data !== 3.14159"
|
||||
style="background: #3399ff; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
4级
|
||||
</el-tag>
|
||||
<el-tag v-if="3 < item.data && item.data <= 4 && item.data !== 3.14159"
|
||||
style="background: #ffcc33; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="3 < item.data && item.data <= 4 && item.data !== 3.14159"
|
||||
style="background: #ffcc33; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
3级
|
||||
</el-tag>
|
||||
<el-tag v-if="2 < item.data && item.data <= 3 && item.data !== 3.14159"
|
||||
style="background: #ff9900; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="2 < item.data && item.data <= 3 && item.data !== 3.14159"
|
||||
style="background: #ff9900; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
4级
|
||||
</el-tag>
|
||||
<el-tag v-if="1 <= item.data && item.data <= 2 && item.data !== 3.14159"
|
||||
style="background: #A52a2a; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="1 <= item.data && item.data <= 2 && item.data !== 3.14159"
|
||||
style="background: #a52a2a; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
1级
|
||||
</el-tag>
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
<div class="card-content">
|
||||
<div class="card-item" v-for="(item1, index1) in item.children" :key="index1">
|
||||
<el-tag v-if="item1.data == 3.14159 || item1.data == 0"
|
||||
style="background: #ccc; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="item1.data == 3.14159 || item1.data == 0"
|
||||
style="background: #ccc; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
无
|
||||
</el-tag>
|
||||
<el-tag v-if="4.5 < item1.data && item1.data <= 5 && item1.data !== 3.14159"
|
||||
style="background: #339966; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="4.5 < item1.data && item1.data <= 5 && item1.data !== 3.14159"
|
||||
style="background: #339966; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
5级
|
||||
</el-tag>
|
||||
<el-tag v-if="4 < item1.data && item1.data <= 4.5 && item1.data !== 3.14159"
|
||||
style="background: #3399ff; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="4 < item1.data && item1.data <= 4.5 && item1.data !== 3.14159"
|
||||
style="background: #3399ff; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
4级
|
||||
</el-tag>
|
||||
<el-tag v-if="3 < item1.data && item1.data <= 4 && item1.data !== 3.14159"
|
||||
style="background: #ffcc33; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="3 < item1.data && item1.data <= 4 && item1.data !== 3.14159"
|
||||
style="background: #ffcc33; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
3级
|
||||
</el-tag>
|
||||
<el-tag v-if="2 < item1.data && item1.data <= 3 && item1.data !== 3.14159"
|
||||
style="background: #ff9900; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="2 < item1.data && item1.data <= 3 && item1.data !== 3.14159"
|
||||
style="background: #ff9900; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
2级
|
||||
</el-tag>
|
||||
<el-tag v-if="1 <= item1.data && item1.data <= 2 && item1.data !== 3.14159"
|
||||
style="background: #A52a2a; color: #fff" size="small">
|
||||
<el-tag
|
||||
v-if="1 <= item1.data && item1.data <= 2 && item1.data !== 3.14159"
|
||||
style="background: #a52a2a; color: #fff"
|
||||
size="small"
|
||||
>
|
||||
1级
|
||||
</el-tag>
|
||||
<span class="xdf">
|
||||
<el-tooltip :show-arrow="false" :offset="-0" :content="item1.name"
|
||||
popper-class="atooltip" placement="bottom-start">
|
||||
|
||||
<el-tooltip
|
||||
:show-arrow="false"
|
||||
:offset="-0"
|
||||
:content="item1.name"
|
||||
placement="bottom-start"
|
||||
|
||||
>
|
||||
<div class="tooltipText">
|
||||
{{ item1.name }}
|
||||
</div>
|
||||
@@ -98,34 +135,26 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="VITE_FLAG ? 24 : 12">
|
||||
<my-echart class="tall" :options="echartList" />
|
||||
<div class="tall">
|
||||
<div class="tall mb10">
|
||||
<vxe-table height="auto" auto-resize :data="tableStore.table.data" v-bind="defaultAttribute">
|
||||
|
||||
<vxe-column field="name" title="名称"></vxe-column>
|
||||
<vxe-column field="zc" title="综合评估值">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.data == 3.14159" style="color: #000;">
|
||||
暂无数据
|
||||
</span>
|
||||
<span v-if="scope.row.data !== 3.14159" style="color: #000;">
|
||||
<span v-if="scope.row.data == 3.14159" style="color: #000">暂无数据</span>
|
||||
<span v-if="scope.row.data !== 3.14159" style="color: #000">
|
||||
{{ scope.row.data }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="monitors" title="监测点个数(个)"></vxe-column>
|
||||
<vxe-column field="level" title="评估等级">
|
||||
|
||||
</vxe-column>
|
||||
<vxe-column field="level" title="评估等级"></vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -138,14 +167,22 @@ import TableStore from '@/utils/tableStore'
|
||||
import { ref, onMounted, provide } from 'vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import * as echarts from 'echarts/core'
|
||||
const VITE_FLAG = import.meta.env.VITE_NAME == 'qujing'
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/qydetailedAnalysis/pollutionqy'
|
||||
name: 'harmonic-boot/area/powerAssessment'
|
||||
})
|
||||
const dictData = useDictData()
|
||||
const echartList = ref({})
|
||||
const sign = dictData.getBasicData('power_flag')
|
||||
const header = ref()
|
||||
const options = dictData.getBasicData('Pollution_Statis', ['I_Neg', 'V_Inharm', 'V_Dev', 'V_Unbalance', 'Plt', 'Freq_Dev'])
|
||||
const options = dictData.getBasicData('Pollution_Statis', [
|
||||
'I_Neg',
|
||||
'V_Inharm',
|
||||
'V_Dev',
|
||||
'V_Unbalance',
|
||||
'Plt',
|
||||
'Freq_Dev'
|
||||
])
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/comAccess/getComAccessData',
|
||||
method: 'POST',
|
||||
@@ -153,10 +190,6 @@ const tableStore = new TableStore({
|
||||
loadCallback: () => {
|
||||
histogram(tableStore.table.data)
|
||||
header.value.areaRef.change()
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
@@ -167,26 +200,23 @@ tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
|
||||
tableStore.table.params.statisticalType = {}
|
||||
|
||||
|
||||
// 柱状图数据处理
|
||||
const histogram = (res: any) => {
|
||||
console.log(123);
|
||||
|
||||
echartList.value = {
|
||||
title: {
|
||||
text: '区域'
|
||||
},
|
||||
|
||||
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
show: false
|
||||
},
|
||||
|
||||
xAxis: {
|
||||
name: '区域',
|
||||
data: res.map((item: any) => item.name)
|
||||
},
|
||||
yAxis: {
|
||||
name: '等级',// 给X轴加单位
|
||||
name: '等级', // 给X轴加单位
|
||||
min: 0,
|
||||
max: 5,
|
||||
splitLine: {
|
||||
@@ -208,11 +238,10 @@ const histogram = (res: any) => {
|
||||
texts.push('4级')
|
||||
} else if (value == 5) {
|
||||
texts.push('5级')
|
||||
|
||||
}
|
||||
return texts
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
options: {
|
||||
@@ -222,10 +251,10 @@ const histogram = (res: any) => {
|
||||
name: '评估值',
|
||||
type: 'bar',
|
||||
data: res.map((item: any) => {
|
||||
return item.data == 3.14159 ? 0.14159 : item.data
|
||||
return item.data == 3.14159 ? 0.14159 : item.data == 0 ? 0.14158 : item.data
|
||||
}),
|
||||
barMaxWidth: 30,
|
||||
|
||||
barMinHeight: 10,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
// 随机显示
|
||||
@@ -234,44 +263,106 @@ const histogram = (res: any) => {
|
||||
// 定制显示(按顺序)
|
||||
color: function (params) {
|
||||
if (4.5 < params.value && params.value <= 5 && params.value !== 0.2) {
|
||||
return new echarts.graphic.LinearGradient(0, 1, 0, 0, [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#339966',
|
||||
}], false)
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#339966'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (4 < params.value && params.value <= 4.5 && params.value !== 0.2) {
|
||||
return new echarts.graphic.LinearGradient(0, 1, 0, 0, [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#3399FF'
|
||||
}], false)
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#3399FF'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (3 < params.value && params.value <= 4 && params.value !== 0.2) {
|
||||
return new echarts.graphic.LinearGradient(0, 1, 0, 0, [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FFCC33'
|
||||
}], false)
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FFCC33'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (2 < params.value && params.value <= 3 && params.value !== 0.2) {
|
||||
return new echarts.graphic.LinearGradient(0, 1, 0, 0, [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FF9900'
|
||||
}], false)
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FF9900'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value >= 1 && params.value <= 2 && params.value !== 0.2) {
|
||||
return new echarts.graphic.LinearGradient(0, 1, 0, 0, [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#A52a2a'
|
||||
}], false)
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#A52a2a'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value == 0.2) {
|
||||
return new echarts.graphic.LinearGradient(0, 1, 0, 0, [
|
||||
{
|
||||
offset: 1,
|
||||
color: "#999999"
|
||||
}], false)
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#ccc'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
} else if (params.value == 0.14158) {
|
||||
return new echarts.graphic.LinearGradient(
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
[
|
||||
{
|
||||
offset: 1,
|
||||
color: '#ccc'
|
||||
}
|
||||
],
|
||||
false
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
markLine: {
|
||||
silent: false,
|
||||
@@ -283,90 +374,81 @@ const histogram = (res: any) => {
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
width: 1
|
||||
},
|
||||
}
|
||||
},
|
||||
data: [
|
||||
|
||||
{
|
||||
name: "",
|
||||
name: '',
|
||||
yAxis: 1,
|
||||
lineStyle: {
|
||||
color: '#A52a2a',
|
||||
color: '#A52a2a'
|
||||
},
|
||||
label: {
|
||||
// position:"middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#A52a2a',
|
||||
|
||||
|
||||
color: '#A52a2a'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
name: '',
|
||||
yAxis: 2,
|
||||
lineStyle: {
|
||||
color: '#FF9900',
|
||||
|
||||
color: '#FF9900'
|
||||
},
|
||||
label: {
|
||||
// position:"middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#FF9900',
|
||||
|
||||
color: '#FF9900'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
name: '',
|
||||
yAxis: 3,
|
||||
lineStyle: {
|
||||
color: '#FFCC33',
|
||||
color: '#FFCC33'
|
||||
},
|
||||
label: {
|
||||
// position:"middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#FFCC33',
|
||||
|
||||
color: '#FFCC33'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
name: '',
|
||||
yAxis: 4,
|
||||
lineStyle: {
|
||||
color: '#3399FF',
|
||||
color: '#3399FF'
|
||||
},
|
||||
label: {
|
||||
// position:"middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#3399FF',
|
||||
|
||||
color: '#3399FF'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
name: '',
|
||||
yAxis: 5,
|
||||
lineStyle: {
|
||||
color: '#339966',
|
||||
color: '#339966'
|
||||
},
|
||||
label: {
|
||||
// position:"middle",
|
||||
formatter: '{b}',
|
||||
textStyle: {
|
||||
color: '#339966',
|
||||
|
||||
color: '#339966'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -397,7 +479,6 @@ const layout1 = mainHeight(93) as any
|
||||
}
|
||||
|
||||
:deep(.cardBox) {
|
||||
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
display: grid;
|
||||
@@ -410,8 +491,6 @@ const layout1 = mainHeight(93) as any
|
||||
background-image: linear-gradient(var(--el-color-primary), var(--el-color-primary-light-3));
|
||||
font-weight: bold;
|
||||
|
||||
|
||||
|
||||
.el-card__header {
|
||||
padding: 10px !important;
|
||||
color: #fff;
|
||||
@@ -420,7 +499,6 @@ const layout1 = mainHeight(93) as any
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.el-card__body {
|
||||
@@ -440,7 +518,6 @@ const layout1 = mainHeight(93) as any
|
||||
width: 50%;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
.xdf {
|
||||
@@ -456,11 +533,8 @@ const layout1 = mainHeight(93) as any
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-left: 5px;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -74,10 +74,15 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
<el-option v-for="item in sign" :key="item.id" :label="item.name" :value="item.algoDescribe" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
<el-option
|
||||
v-for="item in sign"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.algoDescribe"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
</div>
|
||||
@@ -98,6 +103,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
@@ -158,6 +164,8 @@ const tableStore = new TableStore({
|
||||
title: '电压等级',
|
||||
field: 'voltageLevel',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
@@ -166,6 +174,7 @@ const tableStore = new TableStore({
|
||||
title: '网络参数',
|
||||
field: 'networkParam',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
@@ -174,6 +183,7 @@ const tableStore = new TableStore({
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
minWidth: 120,
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
@@ -182,6 +192,7 @@ const tableStore = new TableStore({
|
||||
title: '厂家',
|
||||
field: 'factoryName',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
}
|
||||
@@ -190,6 +201,7 @@ const tableStore = new TableStore({
|
||||
title: '谐波电压(%)',
|
||||
field: 'harmonicVoltage',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -198,6 +210,7 @@ const tableStore = new TableStore({
|
||||
title: '电压偏差(%)',
|
||||
field: 'voltageOffset',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -206,6 +219,7 @@ const tableStore = new TableStore({
|
||||
title: '三相电压不平衡度(%)',
|
||||
field: 'voltageUnbalance',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -214,6 +228,7 @@ const tableStore = new TableStore({
|
||||
title: '间谐波电压含有率(%)',
|
||||
field: 'interHarmonic',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -222,6 +237,7 @@ const tableStore = new TableStore({
|
||||
title: '谐波电流(%)',
|
||||
field: 'harmonicCurrent',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -230,6 +246,7 @@ const tableStore = new TableStore({
|
||||
title: '负序电流(%)',
|
||||
field: 'negativeCurrent',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -238,6 +255,7 @@ const tableStore = new TableStore({
|
||||
title: '频率偏差(%)',
|
||||
field: 'freqOffset',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -246,6 +264,7 @@ const tableStore = new TableStore({
|
||||
title: '闪变(%)',
|
||||
field: 'flicker',
|
||||
align: 'center',
|
||||
minWidth: 80,
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
}
|
||||
@@ -255,7 +274,7 @@ const tableStore = new TableStore({
|
||||
loadCallback: () => {
|
||||
tableStore.table.data = tree2List(tableStore.table.data, Math.random() * 1000)
|
||||
tableStore.table.column[0].title = tableStore.table.params.statisticalType.name
|
||||
|
||||
|
||||
chartsRef.value && chartsRef.value.getTableStoreParams(tableStore.table.params)
|
||||
setTimeout(() => {
|
||||
activeName.value == 0 && tableRef.value && tableRef.value.getRef().setAllTreeExpand(true)
|
||||
@@ -311,11 +330,12 @@ const tree2List = (list: any, id?: string) => {
|
||||
})
|
||||
// 返回结果数组
|
||||
return arr
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// .online {
|
||||
// width: 100%;
|
||||
|
||||
253
src/views/pqs/harmonicMonitoring/area/qualifiedRate/index1.vue
Normal file
253
src/views/pqs/harmonicMonitoring/area/qualifiedRate/index1.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker area showExport>
|
||||
<template #select>
|
||||
<el-form-item label="统计类型:" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.statisticalType"
|
||||
placeholder="请选择统计类型"
|
||||
value-key="id"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classificationData"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="电压等级:" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.scale"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择电压等级"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in voltageleveloption"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终端厂家:" v-if="false">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.manufacturer"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择终端厂家"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in terminaloption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="干扰源类型:">
|
||||
<el-select
|
||||
v-model="tableStore.table.params.loadType"
|
||||
multiple
|
||||
collapse-tags
|
||||
clearable
|
||||
placeholder="请选择干扰源类型"
|
||||
style="width: 100%"
|
||||
value-key="id"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in interfereoption"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="电网标志">
|
||||
<el-select v-model="tableStore.table.params.powerFlag" placeholder="请选择电网标志">
|
||||
<el-option v-for="item in sign" :key="item.id" :label="item.name" :value="item.algoDescribe" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { getAreaDept } from '@/api/harmonic-boot/area'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'harmonic-boot/area/qualifiedRate'
|
||||
})
|
||||
|
||||
const dictData = useDictData()
|
||||
//字典获取电压等级
|
||||
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
//字典获取终端厂家
|
||||
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
|
||||
//字典获取统计类型
|
||||
const classificationData = dictData.getBasicData('Statistical_Type', ['Report_Type'])
|
||||
//字典获取干扰源类型
|
||||
const interfereoption = dictData.getBasicData('Interference_Source')
|
||||
const sign = dictData.getBasicData('power_flag')
|
||||
|
||||
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/harmonic-boot/steadyQualify/getSteadyQualifyTableData',
|
||||
isWebPaging: true,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{
|
||||
field: 'index',
|
||||
title: '序号',
|
||||
width: '80',
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'subStation',
|
||||
title: '变电站',
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
field: 'city',
|
||||
title: '所在地市',
|
||||
minWidth: 100
|
||||
},
|
||||
{
|
||||
field: 'manufacturer',
|
||||
title: '终端厂家',
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
field: 'deviceName',
|
||||
title: '终端名称',
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '网络参数',
|
||||
field: 'ip',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 120
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 100
|
||||
},
|
||||
|
||||
{
|
||||
title: '谐波电压(%)',
|
||||
field: 'harmonicVoltage',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '电压偏差(%)',
|
||||
field: 'voltageOffset',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '三相电压不平衡度(%)',
|
||||
field: 'voltageUnbalance',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '间谐波电压含有率(%)',
|
||||
field: 'interHarmonic',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '谐波电流(%)',
|
||||
field: 'harmonicCurrent',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '负序电流(%)',
|
||||
field: 'negativeCurrent',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '频率偏差(%)',
|
||||
field: 'freqOffset',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
},
|
||||
{
|
||||
title: '闪变(%)',
|
||||
field: 'flicker',
|
||||
align: 'center',
|
||||
formatter: function (row) {
|
||||
return row.cellValue != 3.14159 ? row.cellValue : '/'
|
||||
},
|
||||
minWidth: 80
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
})
|
||||
|
||||
tableStore.table.params.statisticalType = classificationData[0]
|
||||
tableStore.table.params.scale = []
|
||||
tableStore.table.params.manufacturer = []
|
||||
tableStore.table.params.loadType = []
|
||||
tableStore.table.params.serverName = 'harmonicBoot'
|
||||
tableStore.table.params.powerFlag = sign[0]?.algoDescribe || 0
|
||||
provide('tableStore', tableStore)
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
</script>
|
||||
@@ -85,7 +85,7 @@ const title = ref('')
|
||||
const key = ref(0)
|
||||
const statisticalName = ref('')
|
||||
const open = (row: any, flag: boolean, params: any) => {
|
||||
console.log('🚀 ~ open ~ row:', row)
|
||||
|
||||
voltageLevelFlag.value = flag
|
||||
loading.value = true
|
||||
title.value = row.name + '详情'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<TableHeader :showReset="false" ref="TableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="关键字">
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" />
|
||||
<el-input v-model="tableStore.table.params.searchValue" clearable placeholder="请输入关键字" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
@@ -69,7 +69,7 @@ const tableStore = new TableStore({
|
||||
{ title: '更新时间', field: 'updateTime' },
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
|
||||
@@ -194,7 +194,7 @@ const dotList: any = ref({})
|
||||
const height = mainHeight(20)
|
||||
const heightB = mainHeight(70)
|
||||
const harmonic = harmonicOptions.slice(1)
|
||||
const size = ref(23)
|
||||
const size = ref(19)
|
||||
const showTabs = ref(false)
|
||||
const loadDataOptions: any = ref([])
|
||||
const form: any = reactive({
|
||||
|
||||
@@ -49,7 +49,7 @@ const tableStore = new TableStore({
|
||||
{ title: '计算时间', field: 'updateTime' },
|
||||
{ title: '计算窗口', field: 'timeWindow' },
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
@@ -62,7 +62,7 @@ const tableStore = new TableStore({
|
||||
render: 'basicButton',
|
||||
|
||||
click: row => {
|
||||
console.log("🚀 ~ row:", row)
|
||||
|
||||
push({
|
||||
path: "/admin/division/detail",
|
||||
query: {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<el-card v-for="(item, index) in tableStore.table.data" :key="index">
|
||||
<template #header>
|
||||
<div style="cursor: pointer;" @click="queryline(item, false)">
|
||||
<el-tag v-if="item.data < 60 && item.data >= 0"
|
||||
<el-tag v-if="item.data < 60 && item.data >= 0 && item.data !== 3.14159"
|
||||
style="color: #fff; background: #339966" size="small">
|
||||
优
|
||||
</el-tag>
|
||||
@@ -56,7 +56,7 @@
|
||||
<div class="card-item" v-for="(item1, index1) in item.children"
|
||||
:key="index1" @click="queryline(item1, true)">
|
||||
|
||||
<el-tag v-if="item1.data < 60 && item1.data >= 0"
|
||||
<el-tag v-if="item1.data < 60 && item1.data >= 0 && item1.data !== 3.14159"
|
||||
style="color: #fff; background: #339966" size="small">
|
||||
优
|
||||
</el-tag>
|
||||
|
||||
@@ -107,9 +107,9 @@ const tableStore = new TableStore({
|
||||
minWidth: 150
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
|
||||
@@ -106,9 +106,9 @@ const tableStore = new TableStore({
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: '操作',fixed: 'right',
|
||||
width: '180',
|
||||
fixed: 'right',
|
||||
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
@@ -122,7 +122,7 @@ const tableStore = new TableStore({
|
||||
},
|
||||
click: row => {
|
||||
detailDialogTitle.value = '监测点污染详情'
|
||||
console.log('🚀 ~ row:', row)
|
||||
|
||||
detailLoading.value = true
|
||||
detailData.value = row.powerFlagPollutionList
|
||||
detailDialogVisible.value = true
|
||||
|
||||
@@ -111,7 +111,7 @@ const tableStore = new TableStore({
|
||||
map(tableStore.table.data)
|
||||
histogram(tableStore.table.data)
|
||||
EchartMap.value.GetEchar(header.value.areaRef.areaName)
|
||||
console.log("🚀 ~ header.value.areaRef.areaName:", header.value.areaRef.areaName)
|
||||
// console.log("🚀 ~ header.value.areaRef.areaName:", header.value.areaRef.areaName)
|
||||
|
||||
}
|
||||
})
|
||||
@@ -124,7 +124,7 @@ provide('tableStore', tableStore)
|
||||
|
||||
// 地图点击事件
|
||||
const getRegionByRegion = (list: any) => {
|
||||
console.log("🚀 ~ getRegionByRegion ~ list:", list)
|
||||
// console.log("🚀 ~ getRegionByRegion ~ list:", list)
|
||||
tableStore.table.params.deptIndex = list.id
|
||||
tableStore.onTableAction('search', {})
|
||||
}
|
||||
@@ -134,7 +134,7 @@ const getRegionByRegion = (list: any) => {
|
||||
|
||||
// 地图数处理
|
||||
const map = (res: any) => {
|
||||
console.log("🚀 ~ map ~ res:", res)
|
||||
// console.log("🚀 ~ map ~ res:", res)
|
||||
let areaData: any = []
|
||||
let xarr = []
|
||||
let yarr = []
|
||||
|
||||
@@ -136,7 +136,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'frequencyMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -144,7 +144,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'frequencyBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'frequencyDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -165,7 +173,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'voltageMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -173,7 +181,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'voltageBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'voltageDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -194,15 +210,24 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'harmonicVoltageMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
field: 'harmonicVoltageBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'harmonicVoltageDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -223,7 +248,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'harmonicCurrentMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -231,7 +256,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'harmonicCurrentBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'harmonicCurrentDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -252,7 +285,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'threePhaseVoltageMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -260,7 +293,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'threePhaseVoltageBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'threePhaseVoltageDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -281,7 +322,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'flickerMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -289,7 +330,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'flickerBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'flickerDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -310,7 +359,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'negativeMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -318,7 +367,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'negativeBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'negativeDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -339,7 +396,7 @@ const tableStore = new TableStore({
|
||||
children: [
|
||||
{
|
||||
field: 'interHarmonicMonitorNumber',
|
||||
title: '超标点数(天/点)',
|
||||
title: '超标点数(个)',
|
||||
minWidth: '140px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
@@ -347,7 +404,15 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{
|
||||
field: 'interHarmonicBiLi',
|
||||
title: '超标占比(%)',
|
||||
title: '累计占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'interHarmonicDayAvgBiLi',
|
||||
title: '日均占比(%)',
|
||||
minWidth: '100px',
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue == -1 ? '/' : row.cellValue
|
||||
|
||||
@@ -123,7 +123,8 @@ const tableStore = new TableStore({
|
||||
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数' ,width:'120px',
|
||||
title: '网络参数',
|
||||
width: '120px',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.ip || '/'
|
||||
}
|
||||
@@ -249,7 +250,7 @@ const searchEvent = debounce(() => {
|
||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||
options
|
||||
)
|
||||
console.log('🚀 ~ searchEvent ~ rest:', rest)
|
||||
// console.log('🚀 ~ searchEvent ~ rest:', rest)
|
||||
|
||||
tableStore.table.data = rest
|
||||
|
||||
@@ -288,6 +289,10 @@ const exportEvent = () => {
|
||||
})
|
||||
exportModelJB(form)
|
||||
.then(async res => {
|
||||
if (res == undefined) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
})
|
||||
|
||||
@@ -123,7 +123,8 @@ const tableStore = new TableStore({
|
||||
{ field: 'name', title: '电网拓扑', width: 350, type: 'radio', align: 'left', treeNode: true },
|
||||
{
|
||||
field: 'ip',
|
||||
title: '网络参数' ,width:'120px',
|
||||
title: '网络参数',
|
||||
width: '120px',
|
||||
formatter: ({ row }: any) => {
|
||||
return row.ip || '/'
|
||||
}
|
||||
@@ -249,7 +250,7 @@ const searchEvent = debounce(() => {
|
||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||
options
|
||||
)
|
||||
console.log('🚀 ~ searchEvent ~ rest:', rest)
|
||||
// console.log('🚀 ~ searchEvent ~ rest:', rest)
|
||||
|
||||
tableStore.table.data = rest
|
||||
|
||||
@@ -288,6 +289,10 @@ const exportEvent = () => {
|
||||
})
|
||||
exportModelJB(form)
|
||||
.then(async res => {
|
||||
if (res == undefined) {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="default-main">
|
||||
<TableHeader date-picker ref="TableHeaderRef">
|
||||
<TableHeader date-picker area ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="运行状态">
|
||||
<el-select v-model="tableStore.table.params.lineRunFlag" clearable placeholder="请选择运行状态">
|
||||
@@ -329,7 +329,7 @@ const echart = () => {
|
||||
|
||||
series: [
|
||||
{
|
||||
name: '异常总数',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barWidth: 12,
|
||||
data: [100],
|
||||
@@ -346,7 +346,7 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
color: '#FF9100' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
@@ -355,7 +355,7 @@ const echart = () => {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '异常占比',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barWidth: 13,
|
||||
data: [
|
||||
@@ -378,11 +378,11 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#FF9100' // 0% 处的颜色
|
||||
color: '#57bc6e' // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: '#FF9100' // 100% 处的颜色
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
|
||||
@@ -193,7 +193,7 @@ const searchEvent = debounce(() => {
|
||||
(item: any) => searchProps.some(key => String(item[key]).toLowerCase().indexOf(filterVal) > -1),
|
||||
options
|
||||
)
|
||||
console.log("🚀 ~ searchEvent ~ rest:", rest)
|
||||
// console.log("🚀 ~ searchEvent ~ rest:", rest)
|
||||
|
||||
tableStore.table.data = rest
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user