在线设备录入添加参数
修改组件管理时间线配置
This commit is contained in:
@@ -25,3 +25,12 @@ export function offlineDataUploadMakeUp(data: any) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//设备补召操作
|
||||||
|
// 根据id集合获取敏感负荷用户列表
|
||||||
|
export function getListByIds() {
|
||||||
|
return createAxios({
|
||||||
|
url: '/cs-harmonic-boot/pqSensitiveUser/getListByIds',
|
||||||
|
method: 'POST',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -116,3 +116,11 @@ export const start = (params: any) => {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询监测对象类型
|
||||||
|
export const getDicDataByTypeCode = (params: any) => {
|
||||||
|
return request({
|
||||||
|
url: '/system-boot/dictData/getDicDataByTypeCode',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -361,3 +361,21 @@ export function getTimeOfTheMonth(key: any): [string, string] {
|
|||||||
throw new Error('Invalid key')
|
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
@@ -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"
|
||||||
@@ -86,7 +86,7 @@ interface LayoutItem {
|
|||||||
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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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="组件查询时间">
|
||||||
<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: ''
|
||||||
})
|
})
|
||||||
@@ -98,6 +124,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 +133,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 +144,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 +158,7 @@ const submit = () => {
|
|||||||
image: url
|
image: url
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
ElMessage.success('修改成功!')
|
ElMessage.success('修改成功!')
|
||||||
emit('submit')
|
emit('submit')
|
||||||
cancel()
|
cancel()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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')
|
||||||
|
|||||||
@@ -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()
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user