在线设备录入添加参数

修改组件管理时间线配置
This commit is contained in:
guanj
2025-12-03 14:56:57 +08:00
parent bcb1535d4d
commit bf0657cbbc
9 changed files with 1755 additions and 1297 deletions

View File

@@ -25,3 +25,12 @@ export function offlineDataUploadMakeUp(data: any) {
data
})
}
//设备补召操作
// 根据id集合获取敏感负荷用户列表
export function getListByIds() {
return createAxios({
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
method: 'POST',
})
}

View File

@@ -116,3 +116,11 @@ export const start = (params: any) => {
params
})
}
// 查询监测对象类型
export const getDicDataByTypeCode = (params: any) => {
return request({
url: '/system-boot/dictData/getDicDataByTypeCode',
method: 'get',
params
})
}

View File

@@ -361,3 +361,21 @@ export function getTimeOfTheMonth(key: any): [string, string] {
throw new Error('Invalid key')
}
}
/**
* 获取当月时间
* @param timeKey 组件外部时间 1 年 2 季 3 月 4 周 5 日
* @param timeList 组件勾选时间 []
* @param fullScreen 是否全屏 true 是 false 否
* @param externalTime //外部传入时间
*/
export function getTime(timeKey: number, timeList: any[], fullScreen: boolean, externalTime: any[]) {
// 1、先匹配时间
// if(匹配上){
// 是全屏 返回缓存值
// 不是全屏返回外部传入时间 externalTime
// }else{
// 返回 getTimeOfTheMonth(timeList.at(-1))
// }
}

File diff suppressed because it is too large Load Diff

View File

@@ -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"
@@ -86,7 +86,7 @@ interface LayoutItem {
y: number
w: number
h: number
timeKey: number | string
timeKeys: any
i: string | number
name: string
path: string

View File

@@ -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>

View File

@@ -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')

View File

@@ -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')

View File

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