Compare commits
6 Commits
2025-11
...
5687367602
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5687367602 | ||
|
|
b8ee530557 | ||
|
|
0518127792 | ||
|
|
5db43cd4b1 | ||
|
|
bf0657cbbc | ||
|
|
bcb1535d4d |
@@ -1,27 +1,36 @@
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 获取设备补召页面数据
|
||||
export function getMakeUpData(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
//查询装置目录-文件
|
||||
export function getAskDirOrFile(data: any) {
|
||||
return createAxios({
|
||||
url: `/cs-harmonic-boot/offlineDataUpload/askDirOrFile?fileType=${data.fileType}&nDid=${data.nDid}&path=${data.path}&prjName=${data.prjName}`,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
//设备补召操作
|
||||
// 获取设备补召页面数据
|
||||
export function offlineDataUploadMakeUp(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/offlineDataUpload/makeUp',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
import createAxios from '@/utils/request'
|
||||
|
||||
// 获取设备补召页面数据
|
||||
export function getMakeUpData(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/offlineDataUpload/makeUpData?lineId='+data,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
//查询装置目录-文件
|
||||
export function getAskDirOrFile(data: any) {
|
||||
return createAxios({
|
||||
url: `/cs-harmonic-boot/offlineDataUpload/askDirOrFile?fileType=${data.fileType}&nDid=${data.nDid}&path=${data.path}&prjName=${data.prjName}`,
|
||||
method: 'POST'
|
||||
})
|
||||
}
|
||||
|
||||
//设备补召操作
|
||||
// 获取设备补召页面数据
|
||||
export function offlineDataUploadMakeUp(data: any) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/offlineDataUpload/makeUp',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
//设备补召操作
|
||||
// 根据id集合获取敏感负荷用户列表
|
||||
export function getListByIds() {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
|
||||
method: 'POST',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,118 +1,126 @@
|
||||
import request from '@/utils/request'
|
||||
// 新增字典数据
|
||||
export const addCsDictData = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/csDictData/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典数据
|
||||
export const queryCsDictDataPage = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/csDictData/list',
|
||||
method: 'post',
|
||||
data: Object.assign(
|
||||
{
|
||||
orderBy: '',
|
||||
pageNum: 0,
|
||||
pageSize: 0,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
searchState: 0,
|
||||
searchValue: '',
|
||||
dataType: '',
|
||||
sortBy: ''
|
||||
},
|
||||
data
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
//删除字典数据
|
||||
export const delCsDictData = (id: string) => {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
return request({
|
||||
url: '/system-boot/csDictData/delete',
|
||||
method: 'post',
|
||||
data: form,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典数据
|
||||
export const updateCsDictData = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/csDictData/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 执行算法
|
||||
export const timerRun = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/run',
|
||||
method: 'GET',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 任务表达式
|
||||
export const getActionClasses = () => {
|
||||
return request({
|
||||
url: '/system-boot/timer/getActionClasses',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
// 新增任务
|
||||
export const addTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/add',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 修改任务
|
||||
export const updateTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/update',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 补招配置
|
||||
export const runTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/run',
|
||||
method: 'GET',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 删除任务
|
||||
export const deleteTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/delete',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 关闭任务
|
||||
export const stop = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/stop',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 启动任务
|
||||
export const start = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/start',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
import request from '@/utils/request'
|
||||
// 新增字典数据
|
||||
export const addCsDictData = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/csDictData/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询字典数据
|
||||
export const queryCsDictDataPage = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/csDictData/list',
|
||||
method: 'post',
|
||||
data: Object.assign(
|
||||
{
|
||||
orderBy: '',
|
||||
pageNum: 0,
|
||||
pageSize: 0,
|
||||
searchBeginTime: '',
|
||||
searchEndTime: '',
|
||||
searchState: 0,
|
||||
searchValue: '',
|
||||
dataType: '',
|
||||
sortBy: ''
|
||||
},
|
||||
data
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
//删除字典数据
|
||||
export const delCsDictData = (id: string) => {
|
||||
let form = new FormData()
|
||||
form.append('id', id)
|
||||
return request({
|
||||
url: '/system-boot/csDictData/delete',
|
||||
method: 'post',
|
||||
data: form,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 修改字典数据
|
||||
export const updateCsDictData = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/csDictData/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 执行算法
|
||||
export const timerRun = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/run',
|
||||
method: 'GET',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 任务表达式
|
||||
export const getActionClasses = () => {
|
||||
return request({
|
||||
url: '/system-boot/timer/getActionClasses',
|
||||
method: 'GET'
|
||||
})
|
||||
}
|
||||
// 新增任务
|
||||
export const addTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/add',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 修改任务
|
||||
export const updateTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/update',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 补招配置
|
||||
export const runTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/run',
|
||||
method: 'GET',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
// 删除任务
|
||||
export const deleteTimer = (data: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/delete',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 关闭任务
|
||||
export const stop = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/stop',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 启动任务
|
||||
export const start = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/timer/start',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 查询监测对象类型
|
||||
export const getDicDataByTypeCode = (params: any) => {
|
||||
return request({
|
||||
url: '/system-boot/dictData/getDicDataByTypeCode',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
@@ -44,6 +44,7 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { dayjs } from 'element-plus'
|
||||
import { getTime } from '@/utils/formatTime'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: [String, Number] },
|
||||
@@ -51,7 +52,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -95,11 +97,16 @@ const tableStore: any = new TableStore({
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
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: () => {
|
||||
if (!fullscreen.value && prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||
tableStore.table.params.searchBeginTime = prop.timeValue[0]
|
||||
tableStore.table.params.searchEndTime = prop.timeValue[1]
|
||||
}
|
||||
const time = getTime(prop.interval ?? 0, prop.timeKey, prop.timeValue)
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
value.value = tableStore.table.params.searchBeginTime
|
||||
@@ -148,7 +155,14 @@ onMounted(() => {
|
||||
TableHeaderRef.value.setDatePicker([{ label: '月份', value: 3 }])
|
||||
}
|
||||
if (fullscreen.value) {
|
||||
TableHeaderRef.value.setInterval(3)
|
||||
if (prop.interval == 3) {
|
||||
const time = getTime(prop.interval ?? 0, prop.timeKey, 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()
|
||||
})
|
||||
@@ -161,18 +175,14 @@ watch(
|
||||
)
|
||||
watch(
|
||||
() => prop.timeValue,
|
||||
// (newVal, oldVal) => {
|
||||
// // 当外部时间值变化时,更新表格的时间参数
|
||||
// if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
|
||||
// tableStore.table.params.searchBeginTime = newVal[0]
|
||||
// tableStore.table.params.searchEndTime = newVal[1]
|
||||
// tableStore.index()
|
||||
// }
|
||||
// },
|
||||
val => {
|
||||
tableStore.index()
|
||||
(newVal, oldVal) => {
|
||||
// 当外部时间值变化时,更新表格的时间参数
|
||||
if (newVal && (!oldVal || newVal[0] !== oldVal[0] || newVal[1] !== oldVal[1])) {
|
||||
tableStore.table.params.searchBeginTime = newVal[0]
|
||||
tableStore.table.params.searchEndTime = newVal[1]
|
||||
tableStore.index()
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
:options="echartList"
|
||||
:style="{
|
||||
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
|
||||
@@ -187,7 +187,7 @@ const initProbabilityData = () => {
|
||||
type: 'category',
|
||||
name: '越限程度',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
nameGap: 50,
|
||||
data: ['0-20%', '20-40%', '40-60%', '60-80%', '80-100%'],
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@@ -206,7 +206,7 @@ const initProbabilityData = () => {
|
||||
type: 'category',
|
||||
name: '指标类型',
|
||||
nameLocation: 'middle',
|
||||
nameGap: 30,
|
||||
nameGap: 50,
|
||||
data: yAxisData,
|
||||
nameTextStyle: {
|
||||
color: '#111'
|
||||
|
||||
@@ -22,11 +22,10 @@ import { ref, onMounted, provide, reactive, watch, nextTick } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/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 { useRoute } from 'vue-router'
|
||||
import { useTimeCacheStore } from '@/stores/timeCache'
|
||||
import { log } from 'console'
|
||||
|
||||
const prop = defineProps({
|
||||
w: { type: [String, Number] },
|
||||
@@ -34,7 +33,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
interval: { type: Number }
|
||||
})
|
||||
const OverLimitDetailsRef = ref()
|
||||
const headerHeight = ref(57)
|
||||
@@ -104,8 +104,12 @@ const tableStore: any = new TableStore({
|
||||
{ title: '主要存在的电能质量问题', field: 'problems', minWidth: '150', showOverflow: true }
|
||||
],
|
||||
beforeSearchFun: () => {
|
||||
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.searchBeginTime = tableStore.table.params.searchBeginTime || prop.timeValue?.[0]
|
||||
// tableStore.table.params.searchEndTime = tableStore.table.params.searchEndTime || prop.timeValue?.[1]
|
||||
|
||||
const time = getTime(prop.interval ?? 0, prop.timeKey, prop.timeValue)
|
||||
tableStore.table.params.searchBeginTime = time[0]
|
||||
tableStore.table.params.searchEndTime = time[1]
|
||||
},
|
||||
loadCallback: () => {
|
||||
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||
|
||||
@@ -68,7 +68,8 @@ const prop = defineProps({
|
||||
width: { type: [String, Number] },
|
||||
height: { type: [String, Number] },
|
||||
timeKey: { type: [String, Number] },
|
||||
timeValue: { type: Object }
|
||||
timeValue: { type: Object },
|
||||
interval: { type: [String, Number] }
|
||||
})
|
||||
|
||||
const headerHeight = ref(57)
|
||||
@@ -119,9 +120,14 @@ const tableStore: any = new TableStore({
|
||||
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]
|
||||
if (!fullscreen.value) {
|
||||
if (prop.interval == 3 && prop.timeValue && Array.isArray(prop.timeValue)) {
|
||||
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 }])
|
||||
}
|
||||
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()
|
||||
})
|
||||
@@ -160,7 +172,16 @@ onMounted(() => {
|
||||
watch(
|
||||
() => prop.timeKey,
|
||||
val => {
|
||||
tableStore.index()
|
||||
// tableStore.index()
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => prop.interval,
|
||||
val => {
|
||||
if (val == 3) {
|
||||
tableStore.index()
|
||||
}
|
||||
}
|
||||
)
|
||||
watch(
|
||||
@@ -183,7 +204,7 @@ watch(
|
||||
)
|
||||
|
||||
// 电压暂降点击事件
|
||||
const descentClick = (item:any) => {
|
||||
const descentClick = (item: any) => {
|
||||
transientListRef.value.open(item.name)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -361,3 +361,32 @@ export function getTimeOfTheMonth(key: any): [string, string] {
|
||||
throw new Error('Invalid key')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当月时间
|
||||
* @param interval 组件外部时间 1 年 2 季 3 月 4 周 5 日
|
||||
* @param timeList 组件勾选时间 []
|
||||
* @param externalTime //外部传入时间
|
||||
*/
|
||||
export function getTime(interval: number, timeList: any, externalTime: any) {
|
||||
// 1、先匹配时间
|
||||
// 检查 interval 是否在 timeList 中
|
||||
if (timeList && timeList.includes(interval.toString())) {
|
||||
// 匹配上了,返回外部传入时间 externalTime
|
||||
if (externalTime && externalTime.length >= 2) {
|
||||
return [externalTime[0], externalTime[1]]
|
||||
} else {
|
||||
// 如果 externalTime 无效,回退到默认逻辑
|
||||
return getTimeOfTheMonth(interval.toString())
|
||||
}
|
||||
} else {
|
||||
// 没有匹配上,返回 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
@@ -16,7 +16,6 @@
|
||||
<el-button type="primary" icon="el-icon-Tools" @click="settings">设置</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
|
||||
<GridLayout
|
||||
v-model:layout="layout"
|
||||
:row-height="rowHeight"
|
||||
@@ -26,6 +25,7 @@
|
||||
:vertical-compact="false"
|
||||
prevent-collision
|
||||
:col-num="12"
|
||||
:style="{ zoom: zoom }"
|
||||
>
|
||||
<template #item="{ item }">
|
||||
<div class="box">
|
||||
@@ -34,8 +34,8 @@
|
||||
<Icon class="HelpFilled" :name="(item as LayoutItem).icon" />
|
||||
{{ (item as LayoutItem).name }}
|
||||
</div>
|
||||
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="zoom(item)" /> -->
|
||||
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="zoom(item)" />
|
||||
<!-- <FullScreen class="HelpFilled" style="cursor: pointer" @click="setZoom(item)" /> -->
|
||||
<img :src="flag ? img : img1" style="cursor: pointer; height: 16px" @click="setZoom(item)" />
|
||||
</div>
|
||||
<div>
|
||||
<component
|
||||
@@ -46,7 +46,7 @@
|
||||
:timeValue="datePickerRef?.timeValue || 3"
|
||||
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||
:width="rowWidth * item.w - 30 + 'px'"
|
||||
:timeKey="(item as LayoutItem).timeKey"
|
||||
:timeKey="(item as LayoutItem).timeKeys"
|
||||
:interval="datePickerRef?.interval"
|
||||
:w="item.w"
|
||||
:h="item.h"
|
||||
@@ -80,13 +80,14 @@ const timeCacheStore = useTimeCacheStore()
|
||||
defineOptions({
|
||||
// name: 'dashboard/index'
|
||||
})
|
||||
|
||||
// 定义类型
|
||||
interface LayoutItem {
|
||||
x: number
|
||||
y: number
|
||||
w: number
|
||||
h: number
|
||||
timeKey: number | string
|
||||
timeKeys: any
|
||||
i: string | number
|
||||
name: string
|
||||
path: string
|
||||
@@ -95,6 +96,7 @@ interface LayoutItem {
|
||||
loading?: boolean
|
||||
error?: any
|
||||
}
|
||||
const zoom = ref(1)
|
||||
const RoutingConfigRef = ref()
|
||||
const key = ref(0)
|
||||
const img = new URL(`@/assets/img/amplify.png`, import.meta.url).href
|
||||
@@ -120,13 +122,15 @@ const componentMap = reactive(new Map<string, Component | string>())
|
||||
const dataList: any = ref({})
|
||||
// 获取主内容区域高度
|
||||
const getMainHeight = () => {
|
||||
const elMain = document.querySelector('.el-main')
|
||||
return (elMain?.offsetHeight || 0) - 70
|
||||
const elMain = document.querySelector('.el-main') as HTMLElement | null
|
||||
zoom.value = layout.value.length==1?1: (elMain?.offsetHeight ?? 0) / 1080
|
||||
// console.log('🚀 ~ getMainHeight ~ elMain:', elMain?.offsetHeight)
|
||||
return ((elMain?.offsetHeight || 0) - 70) / zoom.value
|
||||
}
|
||||
// 获取主内容区域高度
|
||||
const getMainWidth = () => {
|
||||
const elMain = document.querySelector('.el-main')
|
||||
return (elMain?.offsetWidth || 0) - 20
|
||||
const elMain = document.querySelector('.el-main') as HTMLElement | null
|
||||
return ((elMain?.offsetWidth || 0) - 20) / zoom.value
|
||||
}
|
||||
|
||||
// 初始化行高
|
||||
@@ -170,8 +174,9 @@ const registerComponent = (path: string): Component | string | null => {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// 缩放
|
||||
const zoom = (value: any) => {
|
||||
const setZoom = (value: any) => {
|
||||
if (flag.value) {
|
||||
layout.value = [{ ...value, x: 0, y: 0, w: 12, h: 6 }]
|
||||
} else {
|
||||
@@ -181,7 +186,6 @@ const zoom = (value: any) => {
|
||||
component: registerComponent(item.path)
|
||||
}))
|
||||
}
|
||||
console.log("🚀 ~ zoom ~ layout.value:", layout.value)
|
||||
|
||||
flag.value = !flag.value
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ function dragEnd(row: any) {
|
||||
name: row.name,
|
||||
path: row.path,
|
||||
icon: row.icon,
|
||||
timeKey: row.timeKey
|
||||
timeKeys: row.timeKeys
|
||||
})
|
||||
gridLayout.value.dragEvent('dragend', dragItem.i, dragItem.x, dragItem.y, dragItem.h, dragItem.w)
|
||||
const item = gridLayout.value.getItem(dropId)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
:timeValue="datePickerRef.timeValue"
|
||||
:height="rowHeight * item.h - seRowHeight(item.h) + 'px'"
|
||||
:width="rowWidth * item.w - 30 + 'px'"
|
||||
:timeKey="item.timeKey"
|
||||
:timeKey="item.timeKeys"
|
||||
/>
|
||||
<div v-else class="pd10">组件加载失败...</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,25 @@
|
||||
<template>
|
||||
<el-dialog draggable class="cn-operate-dialog" v-model="dialogVisible" width="1000px" :title="title"
|
||||
@close="cancel">
|
||||
<el-dialog
|
||||
draggable
|
||||
class="cn-operate-dialog"
|
||||
v-model="dialogVisible"
|
||||
width="1000px"
|
||||
:title="title"
|
||||
@close="cancel"
|
||||
>
|
||||
<div style="display: flex">
|
||||
<el-form :inline="false" :model="form" label-width="auto" :rules="rules" ref="formRef" style="flex: 1">
|
||||
<el-form-item class="top" label="组件名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入组件名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="top" label="父组件节点" prop="system">
|
||||
<el-cascader v-model="form.system" :options="customDeptOption" :props="props" placeholder="请选择父组件节点"
|
||||
style="width: 100%" />
|
||||
<el-cascader
|
||||
v-model="form.system"
|
||||
:options="customDeptOption"
|
||||
:props="props"
|
||||
placeholder="请选择父组件节点"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="组件图标" prop="icon">
|
||||
<IconSelector v-model="form.icon" placeholder="请选择图标" />
|
||||
@@ -19,24 +30,39 @@
|
||||
<el-form-item class="top" label="组件路径" prop="path">
|
||||
<el-input v-model="form.path" placeholder="请输入组件路径"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item class="top" label="组件查询时间">
|
||||
<el-radio-group v-model="form.timeKey" style="width: 100%">
|
||||
<el-form-item class="top" label="组件查询时间">
|
||||
<!-- <el-radio-group v-model="form.timeKeys" style="width: 100%">
|
||||
<el-radio-button label="年" value="1" />
|
||||
<el-radio-button label="季" value="2" />
|
||||
<el-radio-button label="月" value="3" />
|
||||
<el-radio-button label="周" value="4" />
|
||||
<el-radio-button label="日" value="5" />
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
</el-radio-group> -->
|
||||
<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-input v-model="form.sort" placeholder="请输入组件排序"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="width: 600px; height: 390px; overflow: hidden">
|
||||
<div class="ml10" style="font-weight: 600">组件展示</div>
|
||||
<component :is="registerComponent(form.path)" v-if="registerComponent(form.path)"
|
||||
class="pd10 GridLayout" :key="form.path" :height="'350px'" :width="'580px'"
|
||||
:timeKey="form.timeKey" :w="12" :h="6"/>
|
||||
<component
|
||||
:is="registerComponent(form.path)"
|
||||
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> -->
|
||||
<el-empty v-else description="未查询到组件" style="height: 350px; width: 533px" />
|
||||
</div>
|
||||
@@ -57,7 +83,7 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
|
||||
import IconSelector from '@/components/baInput/components/iconSelector.vue'
|
||||
import html2canvas from 'html2canvas'
|
||||
const emit = defineEmits(['cancel','submit'])
|
||||
const emit = defineEmits(['cancel', 'submit'])
|
||||
const dictData = useDictData()
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('')
|
||||
@@ -67,7 +93,7 @@ const form = ref<anyObj>({
|
||||
name: '',
|
||||
sort: 100,
|
||||
system: [],
|
||||
timeKey: '3',
|
||||
timeKeys: ['1', '2', '3', '4', '5'],
|
||||
code: '',
|
||||
path: ''
|
||||
})
|
||||
@@ -98,6 +124,8 @@ const open = (text: string, data?: anyObj) => {
|
||||
let Data = JSON.parse(JSON.stringify(data))
|
||||
form.value = Data
|
||||
form.value.system = [Data.systemType, Data.pid]
|
||||
// form.value.timeKeys = Data.timeKeys.split(',').map(Number)
|
||||
form.value.timeKeys = Data.timeKeys || []
|
||||
}
|
||||
}
|
||||
const submit = () => {
|
||||
@@ -105,7 +133,6 @@ const submit = () => {
|
||||
if (valid) {
|
||||
let url = ''
|
||||
|
||||
|
||||
await html2canvas(document.querySelector('.GridLayout'), {
|
||||
scale: 2
|
||||
}).then(canvas => {
|
||||
@@ -117,6 +144,7 @@ const submit = () => {
|
||||
systemType: form.value.system[0],
|
||||
pid: form.value.system[1],
|
||||
image: url
|
||||
|
||||
}).then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
emit('submit')
|
||||
@@ -130,7 +158,7 @@ const submit = () => {
|
||||
image: url
|
||||
}).then(res => {
|
||||
ElMessage.success('修改成功!')
|
||||
emit('submit')
|
||||
emit('submit')
|
||||
cancel()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ import { useDictData } from '@/stores/dictData'
|
||||
import { getFatherComponent, componentAdd, componentEdit } from '@/api/user-boot/dept'
|
||||
|
||||
import { componentTree } from '@/api/user-boot/user'
|
||||
import { pid } from 'process'
|
||||
const dictData = useDictData()
|
||||
const emit = defineEmits(['cancel', 'submit'])
|
||||
const dialogVisible = ref(false)
|
||||
@@ -47,7 +48,10 @@ const formRef = ref()
|
||||
const form = ref<anyObj>({
|
||||
name: '',
|
||||
sort: 100,
|
||||
system: ''
|
||||
system: [],
|
||||
timeKey: '3',
|
||||
code: 'base',
|
||||
|
||||
})
|
||||
const props = { label: 'name', value: 'id', checkStrictly: true }
|
||||
const rules = {
|
||||
@@ -78,7 +82,7 @@ const getFather = () => {
|
||||
}
|
||||
|
||||
// 递归删除path不为null的数据
|
||||
function deletePathNotNull(data:any) {
|
||||
function deletePathNotNull(data: any) {
|
||||
// 若为数组,遍历处理每个元素
|
||||
if (Array.isArray(data)) {
|
||||
const filtered = []
|
||||
@@ -110,7 +114,7 @@ const submit = () => {
|
||||
await componentAdd({
|
||||
...form.value,
|
||||
systemType: form.value.system[0],
|
||||
pid: form.value.system[1]
|
||||
pid: form.value.system?.at(-1)
|
||||
}).then(res => {
|
||||
ElMessage.success('新增成功!')
|
||||
emit('submit')
|
||||
|
||||
@@ -90,13 +90,11 @@ const tableStore = new TableStore({
|
||||
title: '确定删除?'
|
||||
},
|
||||
click: row => {
|
||||
if (row.path == '' || row.path == null) {
|
||||
} else {
|
||||
|
||||
deleteSubassembly({ id: row.id }).then(() => {
|
||||
ElMessage.success('删除成功!')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user