Compare commits

...

12 Commits

Author SHA1 Message Date
guanj
ce9caa8729 Merge branch 'main' of http://192.168.1.22:3000/Web/admin-govern 2025-12-04 15:25:31 +08:00
guanj
2d0349c1b6 微调 2025-12-04 15:25:22 +08:00
stt
8355fc6aed Merge branch 'main' of http://192.168.1.22:3000/Web/admin-govern 2025-12-04 14:51:25 +08:00
stt
23bc2d8f05 组件查询时间加必填校验 2025-12-04 14:51:21 +08:00
guanj
43caddffa3 修改 echart样式 2025-12-04 10:33:48 +08:00
stt
3accaf3079 日期下拉默认修改 2025-12-04 10:30:19 +08:00
guanj
5687367602 Merge branch 'main' of http://192.168.1.22:3000/Web/admin-govern 2025-12-04 09:37:58 +08:00
guanj
b8ee530557 修改驾驶舱zoom缩放问题 2025-12-04 09:37:38 +08:00
stt
0518127792 公共时间修改 2025-12-03 16:30:42 +08:00
guanj
5db43cd4b1 微调 2025-12-03 15:37:08 +08:00
guanj
bf0657cbbc 在线设备录入添加参数
修改组件管理时间线配置
2025-12-03 14:56:57 +08:00
stt
bcb1535d4d 日历只月的时候调接口 2025-12-03 13:26:03 +08:00
18 changed files with 1974 additions and 1432 deletions

View File

@@ -1,27 +1,36 @@
import createAxios from '@/utils/request' import createAxios from '@/utils/request'
// 获取设备补召页面数据 // 获取设备补召页面数据
export function getMakeUpData(data: any) { export function getMakeUpData(data: any) {
return createAxios({ return createAxios({
url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data, url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data,
method: 'POST' method: 'POST'
}) })
} }
//查询装置目录-文件 //查询装置目录-文件
export function getAskDirOrFile(data: any) { export function getAskDirOrFile(data: any) {
return createAxios({ return createAxios({
url: `/cs-harmonic-boot/offlineDataUpload/askDirOrFile?fileType=${data.fileType}&nDid=${data.nDid}&path=${data.path}&prjName=${data.prjName}`, url: `/cs-harmonic-boot/offlineDataUpload/askDirOrFile?fileType=${data.fileType}&nDid=${data.nDid}&path=${data.path}&prjName=${data.prjName}`,
method: 'POST' method: 'POST'
}) })
} }
//设备补召操作 //设备补召操作
// 获取设备补召页面数据 // 获取设备补召页面数据
export function offlineDataUploadMakeUp(data: any) { export function offlineDataUploadMakeUp(data: any) {
return createAxios({ return createAxios({
url: '/cs-harmonic-boot/offlineDataUpload/makeUp', url: '/cs-harmonic-boot/offlineDataUpload/makeUp',
method: 'POST', method: 'POST',
data data
}) })
} }
//设备补召操作
// 根据id集合获取敏感负荷用户列表
export function getListByIds() {
return createAxios({
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
method: 'POST',
})
}

View File

@@ -1,118 +1,126 @@
import request from '@/utils/request' import request from '@/utils/request'
// 新增字典数据 // 新增字典数据
export const addCsDictData = (data: any) => { export const addCsDictData = (data: any) => {
return request({ return request({
url: '/system-boot/csDictData/add', url: '/system-boot/csDictData/add',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 查询字典数据 // 查询字典数据
export const queryCsDictDataPage = (data: any) => { export const queryCsDictDataPage = (data: any) => {
return request({ return request({
url: '/system-boot/csDictData/list', url: '/system-boot/csDictData/list',
method: 'post', method: 'post',
data: Object.assign( data: Object.assign(
{ {
orderBy: '', orderBy: '',
pageNum: 0, pageNum: 0,
pageSize: 0, pageSize: 0,
searchBeginTime: '', searchBeginTime: '',
searchEndTime: '', searchEndTime: '',
searchState: 0, searchState: 0,
searchValue: '', searchValue: '',
dataType: '', dataType: '',
sortBy: '' sortBy: ''
}, },
data data
) )
}) })
} }
//删除字典数据 //删除字典数据
export const delCsDictData = (id: string) => { export const delCsDictData = (id: string) => {
let form = new FormData() let form = new FormData()
form.append('id', id) form.append('id', id)
return request({ return request({
url: '/system-boot/csDictData/delete', url: '/system-boot/csDictData/delete',
method: 'post', method: 'post',
data: form, data: form,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded'
} }
}) })
} }
// 修改字典数据 // 修改字典数据
export const updateCsDictData = (data: any) => { export const updateCsDictData = (data: any) => {
return request({ return request({
url: '/system-boot/csDictData/update', url: '/system-boot/csDictData/update',
method: 'post', method: 'post',
data: data data: data
}) })
} }
// 执行算法 // 执行算法
export const timerRun = (params: any) => { export const timerRun = (params: any) => {
return request({ return request({
url: '/system-boot/timer/run', url: '/system-boot/timer/run',
method: 'GET', method: 'GET',
params params
}) })
} }
// 任务表达式 // 任务表达式
export const getActionClasses = () => { export const getActionClasses = () => {
return request({ return request({
url: '/system-boot/timer/getActionClasses', url: '/system-boot/timer/getActionClasses',
method: 'GET' method: 'GET'
}) })
} }
// 新增任务 // 新增任务
export const addTimer = (data: any) => { export const addTimer = (data: any) => {
return request({ return request({
url: '/system-boot/timer/add', url: '/system-boot/timer/add',
method: 'POST', method: 'POST',
data data
}) })
} }
// 修改任务 // 修改任务
export const updateTimer = (data: any) => { export const updateTimer = (data: any) => {
return request({ return request({
url: '/system-boot/timer/update', url: '/system-boot/timer/update',
method: 'POST', method: 'POST',
data data
}) })
} }
// 补招配置 // 补招配置
export const runTimer = (data: any) => { export const runTimer = (data: any) => {
return request({ return request({
url: '/system-boot/timer/run', url: '/system-boot/timer/run',
method: 'GET', method: 'GET',
params: data params: data
}) })
} }
// 删除任务 // 删除任务
export const deleteTimer = (data: any) => { export const deleteTimer = (data: any) => {
return request({ return request({
url: '/system-boot/timer/delete', url: '/system-boot/timer/delete',
method: 'POST', method: 'POST',
data: data data: data
}) })
} }
// 关闭任务 // 关闭任务
export const stop = (params: any) => { export const stop = (params: any) => {
return request({ return request({
url: '/system-boot/timer/stop', url: '/system-boot/timer/stop',
method: 'get', method: 'get',
params params
}) })
} }
// 启动任务 // 启动任务
export const start = (params: any) => { export const start = (params: any) => {
return request({ return request({
url: '/system-boot/timer/start', url: '/system-boot/timer/start',
method: 'get', method: 'get',
params params
}) })
}
// 查询监测对象类型
export const getDicDataByTypeCode = (params: any) => {
return request({
url: '/system-boot/dictData/getDicDataByTypeCode',
method: 'get',
params
})
} }

View File

@@ -8,6 +8,7 @@
datePicker datePicker
v-if="fullscreen" v-if="fullscreen"
:timeCacheFlag="false" :timeCacheFlag="false"
:timeKeyList="['3']"
></TableHeader> ></TableHeader>
<el-calendar <el-calendar
v-model="value" v-model="value"
@@ -44,6 +45,7 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { dayjs } from 'element-plus' import { dayjs } from 'element-plus'
import { getTime } from '@/utils/formatTime'
const prop = defineProps({ const prop = defineProps({
w: { type: [String, Number] }, w: { type: [String, Number] },
@@ -51,7 +53,8 @@ const prop = defineProps({
width: { type: [String, Number] }, width: { type: [String, Number] },
height: { type: [String, Number] }, height: { type: [String, Number] },
timeKey: { type: [String, Number] }, timeKey: { type: [String, Number] },
timeValue: { type: Object } timeValue: { type: Object },
interval: { type: Number }
}) })
const headerHeight = ref(57) const headerHeight = ref(57)
@@ -95,11 +98,22 @@ const tableStore: any = new TableStore({
method: 'POST', method: 'POST',
showPage: false, showPage: false,
column: [], column: [],
// beforeSearchFun: () => {
// if (!fullscreen.value && prop.timeValue && Array.isArray(prop.timeValue)) {
// tableStore.table.params.searchBeginTime = prop.timeValue[0]
// tableStore.table.params.searchEndTime = prop.timeValue[1]
// }
// },
beforeSearchFun: () => { beforeSearchFun: () => {
if (!fullscreen.value && prop.timeValue && Array.isArray(prop.timeValue)) { const time = getTime(
tableStore.table.params.searchBeginTime = prop.timeValue[0] prop.interval ?? 0,
tableStore.table.params.searchEndTime = prop.timeValue[1] prop.timeKey,
} tableStore.table.params.searchBeginTime && tableStore.table.params.searchEndTime
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
: prop.timeValue
)
tableStore.table.params.searchBeginTime = time[0]
tableStore.table.params.searchEndTime = time[1]
}, },
loadCallback: () => { loadCallback: () => {
value.value = tableStore.table.params.searchBeginTime value.value = tableStore.table.params.searchBeginTime
@@ -144,11 +158,24 @@ provide('tableStore', tableStore)
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
if (TableHeaderRef.value && typeof TableHeaderRef.value.setDatePicker === 'function') { // if (TableHeaderRef.value && typeof TableHeaderRef.value.setDatePicker === 'function') {
TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }]) // TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }])
} // }
if (fullscreen.value) { if (fullscreen.value) {
TableHeaderRef.value.setInterval(3) if (prop.interval == 3) {
const time = getTime(
prop.interval ?? 0,
prop.timeKey,
tableStore.table.params.searchBeginTime && tableStore.table.params.searchEndTime
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
: prop.timeValue
)
tableStore.table.params.searchBeginTime = time[0]
tableStore.table.params.searchEndTime = time[1]
TableHeaderRef.value.setTimeInterval(prop.timeValue)
} else {
TableHeaderRef.value.setInterval(3)
}
} }
tableStore.index() tableStore.index()
}) })
@@ -161,18 +188,14 @@ watch(
) )
watch( watch(
() => prop.timeValue, () => prop.timeValue,
// (newVal, oldVal) => { (newVal, oldVal) => {
// // 当外部时间值变化时,更新表格的时间参数 // 当外部时间值变化时,更新表格的时间参数
// if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) { if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
// tableStore.table.params.searchBeginTime = newVal[0] tableStore.table.params.searchBeginTime = newVal[0]
// tableStore.table.params.searchEndTime = newVal[1] tableStore.table.params.searchEndTime = newVal[1]
// tableStore.index() tableStore.index()
// } }
// },
val => {
tableStore.index()
}, },
{ {
deep: true deep: true
} }

View File

@@ -21,7 +21,7 @@
:options="echartList" :options="echartList"
:style="{ :style="{
width: prop.width, width: prop.width,
height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )` height: `calc(${prop.height} / 2 - ${headerHeight / 2}px + ${fullscreen ? 0 : 28}px )`,
}" }"
/> />
<my-echart <my-echart
@@ -187,43 +187,19 @@ const initProbabilityData = () => {
type: 'category', type: 'category',
name: '越限程度', name: '越限程度',
nameLocation: 'middle', nameLocation: 'middle',
nameGap: 30, nameGap: 50,
data: ['0-20%', '20-40%', '40-60%', '60-80%', '80-100%'], data: ['0-20%', '20-40%', '40-60%', '60-80%', '80-100%'],
axisLine: {
lineStyle: {
color: '#111'
}
},
axisLabel: {
color: '#111',
margin: 15
},
nameTextStyle: {
color: '#111'
}
}, },
yAxis3D: { yAxis3D: {
type: 'category', type: 'category',
name: '指标类型', name: '指标类型',
nameLocation: 'middle', nameLocation: 'middle',
nameGap: 30, nameGap: 50,
data: yAxisData, data: yAxisData,
nameTextStyle: {
color: '#111'
},
axisLine: {
show: true,
lineStyle: {
color: '#111'
}
},
axisLabel: {
color: '#111',
margin: 15
},
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: ['#111'],
type: 'dashed', type: 'dashed',
opacity: 0.5 opacity: 0.5
} }
@@ -234,19 +210,8 @@ const initProbabilityData = () => {
name: '越限次数', name: '越限次数',
nameLocation: 'middle', nameLocation: 'middle',
nameGap: 30, nameGap: 30,
nameTextStyle: { minInterval: 10,
color: '#111'
},
axisLine: {
lineStyle: {
color: '#111'
}
},
axisLabel: {
color: '#111'
},
min: 0,
max: zAxisMax // 使用计算出的最大值加5
// max: 100 // max: 100
}, },
grid3D: { grid3D: {

View File

@@ -22,11 +22,10 @@ import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
import { getTimeOfTheMonth } from '@/utils/formatTime' import { getTime } from '@/utils/formatTime'
import OverLimitDetails from '@/components/cockpit/indicatorFittingChart/components/overLimitDetails.vue' import OverLimitDetails from '@/components/cockpit/indicatorFittingChart/components/overLimitDetails.vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { useTimeCacheStore } from '@/stores/timeCache' import { useTimeCacheStore } from '@/stores/timeCache'
import { log } from 'console'
const prop = defineProps({ const prop = defineProps({
w: { type: [String, Number] }, w: { type: [String, Number] },
@@ -34,7 +33,8 @@ const prop = defineProps({
width: { type: [String, Number] }, width: { type: [String, Number] },
height: { type: [String, Number] }, height: { type: [String, Number] },
timeKey: { type: [String, Number] }, timeKey: { type: [String, Number] },
timeValue: { type: Object } timeValue: { type: Object },
interval: { type: Number }
}) })
const OverLimitDetailsRef = ref() const OverLimitDetailsRef = ref()
const headerHeight = ref(57) const headerHeight = ref(57)
@@ -104,8 +104,18 @@ const tableStore: any = new TableStore({
{ title: '主要存在的电能质量问题', field: 'problems', minWidth: '150', showOverflow: true } { title: '主要存在的电能质量问题', field: 'problems', minWidth: '150', showOverflow: true }
], ],
beforeSearchFun: () => { beforeSearchFun: () => {
tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0] // tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0]
tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1] // tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1]
const time = getTime(
prop.interval ?? 0,
prop.timeKey,
tableStore.table.params.searchBeginTime && tableStore.table.params.searchEndTime
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
: prop.timeValue
)
tableStore.table.params.searchBeginTime = time[0]
tableStore.table.params.searchEndTime = time[1]
}, },
loadCallback: () => { loadCallback: () => {
tableStore.table.height = `calc(${prop.height} - 80px)` tableStore.table.height = `calc(${prop.height} - 80px)`

View File

@@ -1,7 +1,13 @@
<template> <template>
<div> <div>
<!--指标拟合图 --> <!--指标拟合图 -->
<TableHeader datePicker @selectChange="selectChange" v-if="fullscreen"> <TableHeader
datePicker
@selectChange="selectChange"
v-if="fullscreen"
ref="TableHeaderRef"
:timeKeyList="['4', '5']"
>
<template v-slot:select> <template v-slot:select>
<el-form-item label="监测点"> <el-form-item label="监测点">
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点" clearable> <el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点" clearable>
@@ -75,6 +81,7 @@ import { useConfig } from '@/stores/config'
import { cslineList, fittingData } from '@/api/harmonic-boot/cockpit/cockpit' import { cslineList, fittingData } from '@/api/harmonic-boot/cockpit/cockpit'
import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree' import { queryByCode, queryCsDictTree } from '@/api/system-boot/dictTree'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { getTime } from '@/utils/formatTime'
const prop = defineProps({ const prop = defineProps({
w: { type: [String, Number] }, w: { type: [String, Number] },
@@ -82,9 +89,12 @@ const prop = defineProps({
width: { type: [String, Number] }, width: { type: [String, Number] },
height: { type: [String, Number] }, height: { type: [String, Number] },
timeKey: { type: [String, Number] }, timeKey: { type: [String, Number] },
timeValue: { type: Object } timeValue: { type: Object },
interval: { type: Number }
}) })
const TableHeaderRef = ref()
const config = useConfig() const config = useConfig()
const lineList: any = ref() const lineList: any = ref()
@@ -131,7 +141,6 @@ const echartList = ref()
const headerHeight = ref(57) const headerHeight = ref(57)
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => { const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
headerHeight.value = height headerHeight.value = height
if (datePickerValue && datePickerValue.timeValue) { if (datePickerValue && datePickerValue.timeValue) {
// 更新时间参数 // 更新时间参数
tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0] tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
@@ -255,6 +264,7 @@ const initCode = () => {
tableStore.table.params.power = powerList.value[0].id tableStore.table.params.power = powerList.value[0].id
tableStore.table.params.indicator = indicatorList.value[0].id tableStore.table.params.indicator = indicatorList.value[0].id
nextTick(() => { nextTick(() => {
// setTime()
tableStore.index() tableStore.index()
}) })
}) })
@@ -268,9 +278,19 @@ const tableStore: any = new TableStore({
exportName: '主要监测点列表', exportName: '主要监测点列表',
column: [], column: [],
beforeSearchFun: () => { beforeSearchFun: () => {
setTime()
// 设置时间参数 // 设置时间参数
tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0] // tableStore.table.params.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0]
tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1] // tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1]
// const time = getTime(
// prop.interval ?? 0,
// prop.timeKey,
// tableStore.table.params.searchBeginTime && tableStore.table.params.searchEndTime
// ? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
// : prop.timeValue
// )
// tableStore.table.params.searchBeginTime = time[0]
// tableStore.table.params.searchEndTime = time[1]
// 只有当 lineList 已加载且有数据时才设置默认 lineId // 只有当 lineList 已加载且有数据时才设置默认 lineId
if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) { if (!tableStore.table.params.lineId && lineList.value && lineList.value.length > 0) {
@@ -373,25 +393,57 @@ watch(
) )
onMounted(() => { onMounted(() => {
// if (fullscreen.value) {
// if (prop.interval == 4 || prop.interval == 5) {
// const time = getTime(
// prop.interval ?? 0,
// prop.timeKey,
// tableStore.table.params.searchBeginTime && tableStore.table.params.searchEndTime
// ? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
// : prop.timeValue
// )
// tableStore.table.params.searchBeginTime = time[0]
// tableStore.table.params.searchEndTime = time[1]
// TableHeaderRef.value.setTimeInterval(prop.timeValue)
// } else {
// TableHeaderRef.value.setInterval(5)
// }
// }
initLineList().then(() => { initLineList().then(() => {
initCode() initCode()
}) })
}) })
watch( watch(
() => prop.timeKey, () => prop.timeKey,
val => { val => {
tableStore.index() tableStore.index()
} }
) )
const setTime = () => {
const time = getTime(
(TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
prop.timeKey,
fullscreen.value
? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
: prop.timeValue
)
console.log("🚀 ~ setTime ~ time:", time)
tableStore.table.params.searchBeginTime = time[0]
tableStore.table.params.searchEndTime = time[1]
TableHeaderRef.value?.setInterval(time[2] - 0)
TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
}
watch( watch(
() => prop.timeValue, () => prop.timeValue,
(newVal, oldVal) => { (newVal, oldVal) => {
// 当外部时间值变化时,更新表格的时间参数 // 当外部时间值变化时,更新表格的时间参数
if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) { // if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
tableStore.table.params.searchBeginTime = newVal[0] tableStore.index()
tableStore.table.params.searchEndTime = newVal[1]
tableStore.index() // }
}
}, },
{ {
deep: true deep: true

View File

@@ -68,7 +68,8 @@ const prop = defineProps({
width: { type: [String, Number] }, width: { type: [String, Number] },
height: { type: [String, Number] }, height: { type: [String, Number] },
timeKey: { type: [String, Number] }, timeKey: { type: [String, Number] },
timeValue: { type: Object } timeValue: { type: Object },
interval: { type: [String, Number] }
}) })
const headerHeight = ref(57) const headerHeight = ref(57)
@@ -119,9 +120,14 @@ const tableStore: any = new TableStore({
column: [], column: [],
beforeSearchFun: () => { beforeSearchFun: () => {
if (!fullscreen.value && prop.timeValue && Array.isArray(prop.timeValue)) { if (!fullscreen.value) {
tableStore.table.params.searchBeginTime = prop.timeValue[0] if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) {
tableStore.table.params.searchEndTime = prop.timeValue[1] tableStore.table.params.searchBeginTime = prop.timeValue[0]
tableStore.table.params.searchEndTime = prop.timeValue[1]
} else {
tableStore.table.params.searchBeginTime = '2025-12-1'
tableStore.table.params.searchEndTime = '2025-12-31'
}
} }
}, },
@@ -152,7 +158,13 @@ onMounted(() => {
TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }]) TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }])
} }
if (fullscreen.value) { if (fullscreen.value) {
TableHeaderRef.value.setInterval(3) if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) {
tableStore.table.params.searchBeginTime = prop.timeValue[0] || tableStore.table.params.searchBeginTime
tableStore.table.params.searchEndTime = prop.timeValue[1] || tableStore.table.params.searchEndTime
TableHeaderRef.value.setTimeInterval(prop.timeValue)
} else {
TableHeaderRef.value.setInterval(3)
}
} }
tableStore.index() tableStore.index()
}) })
@@ -160,7 +172,16 @@ onMounted(() => {
watch( watch(
() => prop.timeKey, () => prop.timeKey,
val => { val => {
tableStore.index() // tableStore.index()
}
)
watch(
() => prop.interval,
val => {
if (val == 3) {
tableStore.index()
}
} }
) )
watch( watch(
@@ -183,7 +204,7 @@ watch(
) )
// 电压暂降点击事件 // 电压暂降点击事件
const descentClick = (item:any) => { const descentClick = (item: any) => {
transientListRef.value.open(item.name) transientListRef.value.open(item.name)
} }
</script> </script>

View File

@@ -302,34 +302,17 @@ const tableStore: any = new TableStore({
type: 'category', type: 'category',
name: '特征幅值', name: '特征幅值',
data: xLabels, data: xLabels,
axisLine: { nameGap: 40,
lineStyle: {
color: '#111'
}
},
axisLabel: {
color: '#111'
}
}, },
yAxis3D: { yAxis3D: {
type: 'category', type: 'category',
name: '持续时间', name: '持续时间',
data: yLabels, data: yLabels,
nameTextStyle: { nameGap: 40,
color: '#111'
},
axisLine: {
show: true,
lineStyle: {
color: '#111'
}
},
axisLabel: {
color: '#111'
},
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: ['#111'],
type: 'dashed', type: 'dashed',
opacity: 0.5 opacity: 0.5
} }
@@ -337,15 +320,16 @@ const tableStore: any = new TableStore({
}, },
zAxis3D: { zAxis3D: {
type: 'value', type: 'value',
splitNumber: 10,
minInterval: 10, minInterval: 10,
name: '暂态事件次数' name: '暂态事件次数',
nameGap: 30,
}, },
grid3D: { grid3D: {
viewControl: { viewControl: {
projection: 'perspective', projection: 'perspective',
distance: 250 distance: 250
}, },
boxWidth: 200, boxWidth: 200,
boxDepth: 80, boxDepth: 80,
light: { light: {
@@ -369,20 +353,8 @@ const tableStore: any = new TableStore({
borderWidth: 1 borderWidth: 1
} }
}, },
itemStyle: {
opacity: 1
},
emphasis: {
label: {
textStyle: {
fontSize: 20,
color: '#900'
}
},
itemStyle: {
color: '#900'
}
}
} }
] ]
} }

View File

@@ -5,7 +5,7 @@
style="min-width: 90px; width: 90px; margin-right: 10px" style="min-width: 90px; width: 90px; margin-right: 10px"
@change="timeChange" @change="timeChange"
> >
<el-option v-for="item in timeOptions" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in filteredTimeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-date-picker <el-date-picker
v-model.trim="timeValue" v-model.trim="timeValue"
@@ -35,13 +35,15 @@ interface Props {
theCurrentTime?: boolean theCurrentTime?: boolean
initialInterval?: number initialInterval?: number
initialTimeValue?: any initialTimeValue?: any
timeKeyList?: string[] //日期下拉
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
nextFlag: false, nextFlag: false,
theCurrentTime: true, theCurrentTime: true,
initialInterval: 3, initialInterval: 3,
initialTimeValue: undefined initialTimeValue: undefined,
timeKeyList: () => []
}) })
const emit = defineEmits(['change']) const emit = defineEmits(['change'])
@@ -89,6 +91,19 @@ const shortcuts = [
} }
} }
] ]
// 计算过滤后的 timeOptions
const filteredTimeOptions = computed(() => {
if (!props.timeKeyList || props.timeKeyList.length === 0) {
return timeOptions.value
}
return timeOptions.value.filter((option: any) =>
props.timeKeyList.includes(option.value.toString())
)
})
onMounted(() => { onMounted(() => {
// 使用传入的初始值 // 使用传入的初始值
if (props.initialInterval !== undefined) { if (props.initialInterval !== undefined) {

View File

@@ -15,6 +15,7 @@
:nextFlag="nextFlag" :nextFlag="nextFlag"
:theCurrentTime="theCurrentTime" :theCurrentTime="theCurrentTime"
@change="handleDatePickerChange" @change="handleDatePickerChange"
:timeKeyList="props.timeKeyList"
></DatePicker> ></DatePicker>
</el-form-item> </el-form-item>
@@ -89,6 +90,7 @@ interface Props {
showReset?: boolean //是否显示重置 showReset?: boolean //是否显示重置
showExport?: boolean //导出控制 showExport?: boolean //导出控制
timeCacheFlag?: boolean //是否取缓存时间 timeCacheFlag?: boolean //是否取缓存时间
timeKeyList?: Array<string> //日期下拉列表
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
@@ -99,7 +101,8 @@ const props = withDefaults(defineProps<Props>(), {
theCurrentTime: true, theCurrentTime: true,
showReset: true, showReset: true,
showExport: false, showExport: false,
timeCacheFlag: true timeCacheFlag: true,
timeKeyList: () => [] // 修改为箭头函数返回空数组
}) })
// 处理 DatePicker 值变化事件 // 处理 DatePicker 值变化事件

View File

@@ -352,6 +352,7 @@ export function getTimeOfTheMonth(key: any): [string, string] {
const dayOfWeek = now.getDay() // 0是周日 const dayOfWeek = now.getDay() // 0是周日
const diff = now.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1) // 调整为周一 const diff = now.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1) // 调整为周一
const weekStart = new Date(year, month, diff) const weekStart = new Date(year, month, diff)
console.log("🚀 ~ getTimeOfTheMonth ~ weekStart:", weekStart)
return [formatDate(weekStart, 'YYYY-MM-DD'), formatDate(now, 'YYYY-MM-DD')] return [formatDate(weekStart, 'YYYY-MM-DD'), formatDate(now, 'YYYY-MM-DD')]
case '5': // 日 case '5': // 日
@@ -361,3 +362,37 @@ export function getTimeOfTheMonth(key: any): [string, string] {
throw new Error('Invalid key') throw new Error('Invalid key')
} }
} }
/**
* 获取当月时间
* @param interval 组件外部时间 1 年 2 季 3 月 4 周 5 日
* @param timeList 组件勾选时间 []
* @param externalTime //外部传入时间
* @param fullscreen // 全屏是否全屏
*/
export function getTime(interval: number | 3, timeList: any , externalTime: any, ) {
console.log("🚀 ~ getTime ~ timeList:", timeList)
// 1、先匹配时间
// 检查 interval 是否在 timeList 中
if (timeList && timeList.includes(interval.toString())) {
return [externalTime[0], externalTime[1], interval]
// 匹配上了,返回外部传入时间 externalTime
// if (externalTime && externalTime.length >= 2) {
// return [externalTime[0], externalTime[1]]
// } else {
// // 如果 externalTime 无效,回退到默认逻辑
// return getTimeOfTheMonth(interval.toString())
// }
} else {
return [...getTimeOfTheMonth(timeList[0]), timeList[0], ]
// 没有匹配上,返回 timeList 中最后一项的时间范围
// if (timeList && timeList.length > 0) {
// const lastItem = timeList[timeList.length - 1]
// return getTimeOfTheMonth(lastItem)
// } else {
// // 如果 timeList 为空,使用 interval 参数
// return getTimeOfTheMonth(interval.toString())
// }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,6 @@
<el-button type="primary" icon="el-icon-Tools" @click="settings">设置</el-button> <el-button type="primary" icon="el-icon-Tools" @click="settings">设置</el-button>
</template> </template>
</TableHeader> </TableHeader>
<GridLayout <GridLayout
v-model:layout="layout" v-model:layout="layout"
:row-height="rowHeight" :row-height="rowHeight"
@@ -26,6 +25,7 @@
:vertical-compact="false" :vertical-compact="false"
prevent-collision prevent-collision
:col-num="12" :col-num="12"
:style="{ zoom: zoom }"
> >
<template #item="{ item }"> <template #item="{ item }">
<div class="box"> <div class="box">
@@ -34,8 +34,8 @@
<Icon class="HelpFilled" :name="(item as LayoutItem).icon" /> <Icon class="HelpFilled" :name="(item as LayoutItem).icon" />
{{ (item as LayoutItem).name }} {{ (item as LayoutItem).name }}
</div> </div>
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="zoom(item)" /> --> <!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="setZoom(item)" /> -->
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" /> <img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="setZoom(item)" />
</div> </div>
<div> <div>
<component <component
@@ -46,7 +46,7 @@
:timeValue="datePickerRef?.timeValue || 3" :timeValue="datePickerRef?.timeValue || 3"
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'" :height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
:width="rowWidth * item.w - 30 + 'px'" :width="rowWidth * item.w - 30 + 'px'"
:timeKey="(item as LayoutItem).timeKey" :timeKey="(item as LayoutItem).timeKeys"
:interval="datePickerRef?.interval" :interval="datePickerRef?.interval"
:w="item.w" :w="item.w"
:h="item.h" :h="item.h"
@@ -80,13 +80,14 @@ const timeCacheStore = useTimeCacheStore()
defineOptions({ defineOptions({
// name: 'dashboard/index' // name: 'dashboard/index'
}) })
// 定义类型 // 定义类型
interface LayoutItem { interface LayoutItem {
x: number x: number
y: number y: number
w: number w: number
h: number h: number
timeKey: number | string timeKeys: any
i: string | number i: string | number
name: string name: string
path: string path: string
@@ -95,6 +96,7 @@ interface LayoutItem {
loading?: boolean loading?: boolean
error?: any error?: any
} }
const zoom = ref(1)
const RoutingConfigRef = ref() const RoutingConfigRef = ref()
const key = ref(0) const key = ref(0)
const img = new URL(`@/assets/img/amplify.png`, import.meta.url).href const img = new URL(`@/assets/img/amplify.png`, import.meta.url).href
@@ -120,13 +122,16 @@ const componentMap = reactive(new Map<string, Component | string>())
const dataList: any = ref({}) const dataList: any = ref({})
// 获取主内容区域高度 // 获取主内容区域高度
const getMainHeight = () => { const getMainHeight = () => {
const elMain = document.querySelector('.el-main') const elMain = document.querySelector('.el-main') as HTMLElement | null
return (elMain?.offsetHeight || 0) - 70 zoom.value =
layout.value.length == 1 ? 1 : (elMain?.offsetHeight ?? 0) > 1080 ? 1 : (elMain?.offsetHeight ?? 0) / 1080
// console.log('🚀 ~ getMainHeight ~ elMain:', elMain?.offsetHeight)
return ((elMain?.offsetHeight || 0) - 70) / zoom.value
} }
// 获取主内容区域高度 // 获取主内容区域高度
const getMainWidth = () => { const getMainWidth = () => {
const elMain = document.querySelector('.el-main') const elMain = document.querySelector('.el-main') as HTMLElement | null
return (elMain?.offsetWidth || 0) - 20 return ((elMain?.offsetWidth || 0) - 20) / zoom.value
} }
// 初始化行高 // 初始化行高
@@ -170,8 +175,9 @@ const registerComponent = (path: string): Component | string | null => {
return null return null
} }
} }
// 缩放 // 缩放
const zoom = (value: any) => { const setZoom = (value: any) => {
if (flag.value) { if (flag.value) {
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }] layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
} else { } else {
@@ -181,7 +187,6 @@ const zoom = (value: any) => {
component: registerComponent(item.path) component: registerComponent(item.path)
})) }))
} }
console.log("🚀 ~ zoom ~ layout.value:", layout.value)
flag.value = !flag.value flag.value = !flag.value

View File

@@ -337,7 +337,7 @@ function dragEnd(row: any) {
name: row.name, name: row.name,
path: row.path, path: row.path,
icon: row.icon, icon: row.icon,
timeKey: row.timeKey timeKeys: row.timeKeys
}) })
gridLayout.value.dragEvent('dragend', dragItem.i, dragItem.x, dragItem.y, dragItem.h, dragItem.w) gridLayout.value.dragEvent('dragend', dragItem.i, dragItem.x, dragItem.y, dragItem.h, dragItem.w)
const item = gridLayout.value.getItem(dropId) const item = gridLayout.value.getItem(dropId)

View File

@@ -43,7 +43,7 @@
:timeValue="datePickerRef.timeValue" :timeValue="datePickerRef.timeValue"
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'" :height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
:width="rowWidth * item.w - 30 + 'px'" :width="rowWidth * item.w - 30 + 'px'"
:timeKey="item.timeKey" :timeKey="item.timeKeys"
/> />
<div v-else class="pd10">组件加载失败...</div> <div v-else class="pd10">组件加载失败...</div>
</div> </div>

View File

@@ -1,14 +1,25 @@
<template> <template>
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" width="1000px" :title="title" <el-dialog
@close="cancel"> draggable
class="cn-operate-dialog"
v-model="dialogVisible"
width="1000px"
:title="title"
@close="cancel"
>
<div style="display: flex"> <div style="display: flex">
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef" style="flex: 1"> <el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef" style="flex: 1">
<el-form-item class="top" label="组件名称" prop="name"> <el-form-item class="top" label="组件名称" prop="name">
<el-input v-model="form.name" placeholder="请输入组件名称"></el-input> <el-input v-model="form.name" placeholder="请输入组件名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="top" label="父组件节点" prop="system"> <el-form-item class="top" label="父组件节点" prop="system">
<el-cascader v-model="form.system" :options="customDeptOption" :props="props" placeholder="请选择父组件节点" <el-cascader
style="width: 100%" /> v-model="form.system"
:options="customDeptOption"
:props="props"
placeholder="请选择父组件节点"
style="width: 100%"
/>
</el-form-item> </el-form-item>
<el-form-item label="组件图标" prop="icon"> <el-form-item label="组件图标" prop="icon">
<IconSelector v-model="form.icon" placeholder="请选择图标" /> <IconSelector v-model="form.icon" placeholder="请选择图标" />
@@ -19,24 +30,39 @@
<el-form-item class="top" label="组件路径" prop="path"> <el-form-item class="top" label="组件路径" prop="path">
<el-input v-model="form.path" placeholder="请输入组件路径"></el-input> <el-input v-model="form.path" placeholder="请输入组件路径"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item class="top" label="组件查询时间"> <el-form-item class="top" label="组件查询时间" prop="timeKeys">
<el-radio-group v-model="form.timeKey" style="width: 100%"> <!-- <el-radio-group v-model="form.timeKeys" style="width: 100%">
<el-radio-button label="年" value="1" /> <el-radio-button label="年" value="1" />
<el-radio-button label="季" value="2" /> <el-radio-button label="季" value="2" />
<el-radio-button label="月" value="3" /> <el-radio-button label="月" value="3" />
<el-radio-button label="周" value="4" /> <el-radio-button label="周" value="4" />
<el-radio-button label="日" value="5" /> <el-radio-button label="日" value="5" />
</el-radio-group> </el-radio-group> -->
</el-form-item> --> <el-checkbox-group v-model="form.timeKeys">
<el-checkbox-button value="1"></el-checkbox-button>
<el-checkbox-button value="2"></el-checkbox-button>
<el-checkbox-button value="3"></el-checkbox-button>
<el-checkbox-button value="4"></el-checkbox-button>
<el-checkbox-button value="5"></el-checkbox-button>
</el-checkbox-group>
</el-form-item>
<el-form-item class="top" label="组件排序" prop="sort"> <el-form-item class="top" label="组件排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入组件排序"></el-input> <el-input v-model="form.sort" placeholder="请输入组件排序"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="width: 600px; height: 390px; overflow: hidden"> <div style="width: 600px; height: 390px; overflow: hidden">
<div class="ml10" style="font-weight: 600">组件展示</div> <div class="ml10" style="font-weight: 600">组件展示</div>
<component :is="registerComponent(form.path)" v-if="registerComponent(form.path)" <component
class="pd10 GridLayout" :key="form.path" :height="'350px'" :width="'580px'" :is="registerComponent(form.path)"
:timeKey="form.timeKey" :w="12" :h="6"/> v-if="registerComponent(form.path)"
class="pd10 GridLayout"
:key="form.path"
:height="'350px'"
:width="'580px'"
:timeKey="form.timeKeys"
:w="12"
:h="6"
/>
<!-- <div class="pd10">组件加载失败...</div> --> <!-- <div class="pd10">组件加载失败...</div> -->
<el-empty v-else description="未查询到组件" style="height: 350px; width: 533px" /> <el-empty v-else description="未查询到组件" style="height: 350px; width: 533px" />
</div> </div>
@@ -57,7 +83,7 @@ import { useDictData } from '@/stores/dictData'
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept' import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
import IconSelector from '@/components/baInput/components/iconSelector.vue' import IconSelector from '@/components/baInput/components/iconSelector.vue'
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
const emit = defineEmits(['cancel','submit']) const emit = defineEmits(['cancel', 'submit'])
const dictData = useDictData() const dictData = useDictData()
const dialogVisible = ref(false) const dialogVisible = ref(false)
const title = ref('') const title = ref('')
@@ -67,7 +93,7 @@ const form = ref<anyObj>({
name: '', name: '',
sort: 100, sort: 100,
system: [], system: [],
timeKey: '3', timeKeys: ['1', '2', '3', '4', '5'],
code: '', code: '',
path: '' path: ''
}) })
@@ -78,7 +104,8 @@ const rules = {
system: [{ required: true, message: '请先择父组件节点', trigger: 'change' }], system: [{ required: true, message: '请先择父组件节点', trigger: 'change' }],
icon: [{ required: true, message: '请先择组件图标', trigger: 'change' }], icon: [{ required: true, message: '请先择组件图标', trigger: 'change' }],
path: [{ required: true, message: '请输入组件路径', trigger: 'blur' }], path: [{ required: true, message: '请输入组件路径', trigger: 'blur' }],
sort: [{ required: true, message: '请输入排序', trigger: 'blur' }] sort: [{ required: true, message: '请输入排序', trigger: 'blur' }],
timeKeys: [{ required: true, message: '请选择组件查询时间', trigger: 'change' }]
} }
const customDeptOption: any = ref([]) const customDeptOption: any = ref([])
onMounted(() => { onMounted(() => {
@@ -98,6 +125,8 @@ const open = (text: string, data?: anyObj) => {
let Data = JSON.parse(JSON.stringify(data)) let Data = JSON.parse(JSON.stringify(data))
form.value = Data form.value = Data
form.value.system = [Data.systemType, Data.pid] form.value.system = [Data.systemType, Data.pid]
// form.value.timeKeys = Data.timeKeys.split(',').map(Number)
form.value.timeKeys = Data.timeKeys || []
} }
} }
const submit = () => { const submit = () => {
@@ -105,7 +134,6 @@ const submit = () => {
if (valid) { if (valid) {
let url = '' let url = ''
await html2canvas(document.querySelector('.GridLayout'), { await html2canvas(document.querySelector('.GridLayout'), {
scale: 2 scale: 2
}).then(canvas => { }).then(canvas => {
@@ -117,6 +145,7 @@ const submit = () => {
systemType: form.value.system[0], systemType: form.value.system[0],
pid: form.value.system[1], pid: form.value.system[1],
image: url image: url
}).then(res => { }).then(res => {
ElMessage.success('新增成功!') ElMessage.success('新增成功!')
emit('submit') emit('submit')
@@ -130,7 +159,7 @@ const submit = () => {
image: url image: url
}).then(res => { }).then(res => {
ElMessage.success('修改成功!') ElMessage.success('修改成功!')
emit('submit') emit('submit')
cancel() cancel()
}) })
} }

View File

@@ -38,6 +38,7 @@ import { useDictData } from '@/stores/dictData'
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept' import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
import { componentTree } from '@/api/user-boot/user' import { componentTree } from '@/api/user-boot/user'
import { pid } from 'process'
const dictData = useDictData() const dictData = useDictData()
const emit = defineEmits(['cancel', 'submit']) const emit = defineEmits(['cancel', 'submit'])
const dialogVisible = ref(false) const dialogVisible = ref(false)
@@ -47,7 +48,10 @@ const formRef = ref()
const form = ref<anyObj>({ const form = ref<anyObj>({
name: '', name: '',
sort: 100, sort: 100,
system: '' system: [],
timeKey: '3',
code: 'base',
}) })
const props = { label: 'name', value: 'id', checkStrictly: true } const props = { label: 'name', value: 'id', checkStrictly: true }
const rules = { const rules = {
@@ -78,7 +82,7 @@ const getFather = () => {
} }
// 递归删除path不为null的数据 // 递归删除path不为null的数据
function deletePathNotNull(data:any) { function deletePathNotNull(data: any) {
// 若为数组,遍历处理每个元素 // 若为数组,遍历处理每个元素
if (Array.isArray(data)) { if (Array.isArray(data)) {
const filtered = [] const filtered = []
@@ -110,7 +114,7 @@ const submit = () => {
await componentAdd({ await componentAdd({
...form.value, ...form.value,
systemType: form.value.system[0], systemType: form.value.system[0],
pid: form.value.system[1] pid: form.value.system?.at(-1)
}).then(res => { }).then(res => {
ElMessage.success('新增成功!') ElMessage.success('新增成功!')
emit('submit') emit('submit')

View File

@@ -90,13 +90,11 @@ const tableStore = new TableStore({
title: '确定删除?' title: '确定删除?'
}, },
click: row => { click: row => {
if (row.path == '' || row.path == null) {
} else {
deleteSubassembly({ id: row.id }).then(() => { deleteSubassembly({ id: row.id }).then(() => {
ElMessage.success('删除成功!') ElMessage.success('删除成功!')
tableStore.index() tableStore.index()
}) })
}
} }
} }
] ]