修改测试问题

This commit is contained in:
guanj
2026-06-30 08:38:05 +08:00
parent 490b52b525
commit 536f22584d
103 changed files with 3220 additions and 2394 deletions

File diff suppressed because one or more lines are too long

View File

@@ -84,7 +84,7 @@ export const updateTimer = (data: any) => {
data
})
}
// 补招配置
//补召配置
export const runTimer = (data: any) => {
return request({
url: '/system-boot/timer/run',

View File

@@ -36,6 +36,20 @@ export function addVersion(data:any) {
data
})
}
export function updateVersion(data: any) {
return createAxios({
url: '/cs-system-boot/appVersion/update',
method: 'post',
data
})
}
export function deleteVersion(data: any) {
return createAxios({
url: '/cs-system-boot/appVersion/delete',
method: 'post',
params:data
})
}
export function getLastData(data:any) {
return createAxios({
url: '/cs-system-boot/appVersion/getLastData',

View File

@@ -477,10 +477,6 @@ const handleTolerableEventClick = async (row: any) => {
})
}
// 不可容忍事件点击处理函数
const handleIntolerableEventClick = (params: any) => {
console.log('不可容忍事件详情:', params)
}
watch(
() => prop.timeKey,

View File

@@ -409,10 +409,6 @@ const handleTolerableEventClick = async (row: any) => {
})
}
// 不可容忍事件点击处理函数
const handleIntolerableEventClick = (params: any) => {
console.log('不可容忍事件详情:', params)
}
watch(
() => prop.timeKey,

View File

@@ -141,7 +141,6 @@ provide('tableStore', tableStore)
tableStore.table.params.sortBy = ''
tableStore.table.params.orderBy = ''
const open = async (row: any, searchBeginTime: any, searchEndTime: any, data: any = []) => {
console.log("🚀 ~ open ~ row:", row)
dialogVisible.value = true
// initCSlineList()
options.value = data

View File

@@ -148,7 +148,6 @@ const open = async (row: any) => {
// 点击行
const cellClickEvent = ({ row, column }: any) => {
console.log(row, '1111')
if (column.field != 'name' && column.field != 'time') {
harmonicRatioRef.value.openDialog(row)
}

View File

@@ -169,18 +169,85 @@ const formatExceedanceValue = (value: any) => {
return value
}
const COLOR_NOT_EXCEED = '#2ab914'
const COLOR_EXCEED = '#e26257'
const mapExceedanceChartValue = (val: number) => {
if (val == 1) return 1
if (val == 0) return 10
return val
}
const getExceedanceChartText = (val: number | string) => {
if (val === 1 || val === '1') return '越限'
if (val === 10 || val === '10') return '不越限'
return formatExceedanceValue(val)
}
/** 越限阶梯线分段着色:不越限绿色,越限红色 */
const buildColoredExceedanceSeries = (data: any[], seriesName: string) => {
const points = data.filter(item => item[1] != null).map(item => [item[0], mapExceedanceChartValue(item[1])])
if (points.length === 0) return []
const series: any[] = []
let i = 0
while (i < points.length) {
const value = points[i][1]
const color = value === 1 ? COLOR_EXCEED : COLOR_NOT_EXCEED
const segment: any[] = []
if (i > 0 && points[i][1] !== points[i - 1][1]) {
segment.push([points[i][0], points[i - 1][1]])
}
segment.push(points[i])
let j = i + 1
while (j < points.length && points[j][1] === value) {
segment.push(points[j])
j++
}
if (j < points.length) {
segment.push([points[j][0], value])
}
series.push({
name: seriesName,
type: 'line',
step: 'end',
showSymbol: false,
clip: true,
data: segment,
yAxisIndex: 1,
lineStyle: { color, width: 2 }
})
i = j
}
return series
}
const qualityChartData = ref<any[]>([])
const getSeriesForCsvExport = () => {
const indicatorSeriesName = indicatorList.value?.find(
(item: any) => item.id === tableStore.table.params.indicator
)?.name
return echartList.value.options.series.map((item: any) => ({
name: item.name,
data: item.data?.map((point: any) => [
point[0],
item.name === indicatorSeriesName ? formatExceedanceValue(point[1]) : point[1],
point[2]
])
}))
const powerName = powerList.value?.find((item: any) => item.id === tableStore.table.params.power)?.name
const powerSeries = echartList.value.options.series.find((item: any) => item.type === 'bar')
return [
{
name: powerSeries?.name || powerName,
data: powerSeries?.data || []
},
{
name: indicatorSeriesName,
data: qualityChartData.value.map(point => [point[0], formatExceedanceValue(point[1]), point[2]])
}
]
}
const getChartExportFileName = () => ({
@@ -218,19 +285,17 @@ const setEchart = () => {
trigger: 'axis',
formatter: function (params: any) {
let result = params[0].axisValueLabel
params.forEach((item: any) => {
if (item.seriesName === indicatorName) {
// 对于电能质量指标格式化Y轴值显示
let valueText = formatExceedanceValue(item.value[1])
if (valueText === item.value[1]) {
valueText = item.value[1]
}
result += `<br/>${item.marker}${item.seriesName}: ${valueText}`
} else {
// 对于功率数据,正常显示数值
result += `<br/>${item.marker}${item.seriesName}: ${item.value[1]} ${item.value[2]}`
}
})
const powerItem = params.find((item: any) => item.seriesName === powerName)
if (powerItem) {
result += `<br/>${powerItem.marker}${powerItem.seriesName}: ${powerItem.value[1]} ${powerItem.value[2] || ''}`
}
const indicatorItems = params.filter(
(item: any) => item.seriesName === indicatorName && item?.data?.[1] != null
)
if (indicatorItems.length) {
const item = indicatorItems[indicatorItems.length - 1]
result += `<br/>${item.marker}${indicatorName}: ${getExceedanceChartText(item.data[1])}`
}
return result
}
},
@@ -244,23 +309,47 @@ const setEchart = () => {
}
}
},
dataZoom: [
{
type: 'inside',
height: 13,
start: 0,
bottom: '20px',
end: 100,
filterMode: 'filter'
},
{
start: 0,
height: 13,
bottom: '20px',
end: 100,
filterMode: 'filter'
}
],
yAxis: [
{},
indicatorName
? {
min: 0,
max: 1,
axisLabel: {
formatter: function (value: number) {
if (value === 0) {
return '不越限'
} else if (value === 1) {
return '越限'
}
return value
}
}
}
position: 'right',
min: 0,
max: 11,
interval: 1,
splitLine: {
lineStyle: {
color: ['#ccc'],
type: 'dashed',
opacity: 0
}
},
axisLabel: {
formatter: function (value: number) {
if (value === 1) return '越限'
if (value === 10) return '不越限'
return ''
}
}
}
: {}
],
// grid: {
@@ -287,7 +376,7 @@ const setEchart = () => {
series: [
{
type: 'bar',
name: powerName, // 动态设置功率名称
name: powerName,
data: [],
clip: true,
itemStyle: {
@@ -302,15 +391,6 @@ const setEchart = () => {
}
},
yAxisIndex: 0
},
{
name: indicatorName, // 动态设置指标名称
type: 'line',
step: 'end',
showSymbol: false,
clip: true,
data: [],
yAxisIndex: 1
}
]
}
@@ -356,9 +436,12 @@ const setEchart = () => {
const hasPowerData = processedPowerData.length > 0 && processedPowerData.some(item => item[1] !== null)
const hasQualityData = processedQualityData.length > 0 && processedQualityData.some(item => item[1] !== null)
// 更新图表配置
qualityChartData.value = processedQualityData
echartList.value.options.series = [
echartList.value.options.series[0],
...buildColoredExceedanceSeries(processedQualityData, indicatorName)
]
echartList.value.options.series[0].data = processedPowerData
echartList.value.options.series[1].data = processedQualityData
} catch (error) {
console.error('处理图表数据时出错:', error)
}

View File

@@ -29,7 +29,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="uploadDialogVisible = false">取消</el-button>
<el-button type="primary" @click="handleUpload">确定</el-button>
<el-button type="primary" @click="handleUpload" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -66,7 +66,7 @@ const uploadDialogVisible = ref(false)
const currentUploadRow = ref<any>(null)
const uploadRef = ref()
const fileList = ref([])
const loading = ref(false)
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
headerHeight.value = height
@@ -139,20 +139,13 @@ const tableStore: any = new TableStore({
render: 'tag',
width: 90,
custom: {
// 0运行1检修2停运3调试4退运
0: 'success',
1: 'warning',
2: 'danger',
3: 'warning',
4: 'info',
null: 'info'
},
replaceValue: {
0: '运行',
1: '检修',
2: '停运',
3: '调试',
4: '退运',
0: '在线',
2: '离线',
null: '/'
}
},
@@ -405,7 +398,7 @@ const beforeUpload = (file: any) => {
const handleUpload = async () => {
// return
loading.value = true
const formData = new FormData()
formData.append('file', fileList.value[0]?.raw)
formData.append('lineId', currentUploadRow.value?.lineId || currentUploadRow.value?.id || '')
@@ -416,9 +409,12 @@ const handleUpload = async () => {
uploadDialogVisible.value = false
tableStore.index()
return Promise.resolve(result)
} catch (error: any) {
ElMessage.error('上传失败: ' + (error.message || '未知错误'))
return Promise.reject(error)
} finally {
loading.value = false
}
}

View File

@@ -122,7 +122,6 @@ provide('tableStore', tableStore)
// 点击行
const cellClickEvent = ({ row, column }: any) => {
if (column.field != 'name') {
console.log(row)
OverLimitDetailsRef.value.open(row)
}
}

View File

@@ -113,14 +113,14 @@ const initChart = () => {
bottom: '20px',
end: 100,
filterMode: 'filter'
filterMode: 'none'
},
{
start: 0,
height: 13,
bottom: '20px',
end: 100,
filterMode: 'filter'
filterMode: 'none'
}
// {
// show: true,
@@ -133,7 +133,7 @@ const initChart = () => {
],
color: props.options?.color || color,
series: props.options?.series,
...props.options?.options
...setStep(props.options?.options)
}
// console.log(options.series,"获取x轴");
handlerBar(options)
@@ -251,6 +251,21 @@ const handlerXAxis = () => {
}
}
}
// const setStep = (name: string) => {
// const isShanBian = name.includes('闪变')
// return isShanBian ? { step: 'end' as const } : { }
// }
const setStep = (options: any) => {
if(options?.series){
options.series.forEach((item: any) => {
if(item.type === 'line' && item.name.includes('闪变')){
item.step = 'end'
}
})
}
return options
}
let throttle: ReturnType<typeof setTimeout>
// 动态计算table高度

View File

@@ -647,7 +647,15 @@ const initWave = (
rms.style.width = '100%'
rms.style.height = vh.value
}, 0)
let titlename = ''
if (props.boxoList.systemType == 'ZL' || props.boxoList.systemType == 'YPT') {
if (props.wp.channelNames[1].includes('L')) {
titlename = '电网侧'
}
if (props.wp.channelNames[1].includes('S')) {
titlename = '负载侧'
}
}
const option = {
tooltip: {
top: '10px',
@@ -755,7 +763,7 @@ const initWave = (
},
yAxis: {
type: 'value',
name: unit,
name: unit + (titlename ? '_' + titlename : ''),
title: {
align: 'high',
offset: 0,
@@ -807,7 +815,7 @@ const initWave = (
// containLabel: true
},
dataZoom: [
{
{
type: 'inside',
height: 13,
start: 0,
@@ -948,28 +956,39 @@ const drawPics = (
}
let titlename = ''
if (props.boxoList.systemType == 'ZL') {
if (props.boxoList.systemType == 'ZL' || props.boxoList.systemType == 'YPT') {
const str = rmsId.split('s')
const str1 = Number(str[1])
props.wp.channelNames.forEach((element: string, i: number) => {
if (i == 4 || i == 7 || i == 10) {
if (str1 == 1 && i == 4) {
const s = element.split('A')
const s1 = s[0] == 'LI' ? '电网侧-电流' : s[0] + '侧' + s[1]
titlename = s1 + ' ' + title
if ((str1 == 1 && i == 4) || (str1 == 2 && i == 7) || (str1 == 3 && i == 10)) {
if (element.includes('L')) {
titlename = '电网侧'
}
if (str1 == 2 && i == 7) {
const s = element.split('A')
const s1 = s[0] == 'SU' ? '负载侧-电压' : s[0] + '侧' + s[1]
titlename = s1 + ' ' + title
}
if (str1 == 3 && i == 10) {
const s = element.split('A')
const s1 = s[0] == 'SI' ? '负载侧-电流' : s[0] + '侧' + s[1]
titlename = s1 + ' ' + title
if (element.includes('S')) {
titlename = '负载侧'
}
}
// if (i == 4 || i == 7 || i == 10) {
// if (i == 4 || i == 7 || i == 10) {
// if (str1 == 1 && i == 4) {
// const s = element.split('A')
// const s1 = s[0] == 'LI' ? '电网侧' : ''//s[0] + '侧' + s[1]
// titlename = s1 //+ ' ' + title
// }
// if (str1 == 2 && i == 7) {
// const s = element.split('A')
// const s1 = s[0] == 'SU' ? '负载侧' : ''//s[0] + '侧' + s[1]
// titlename = s1 //+ ' ' + title
// }
// if (str1 == 3 && i == 10) {
// const s = element.split('A')
// const s1 = s[0] == 'SI' ? '负载侧' : ''//s[0] + '侧' + s[1]
// titlename = s1 //+ ' ' + title
// }
// }
// }
})
}
@@ -1093,7 +1112,7 @@ const drawPics = (
},
yAxis: {
type: 'value',
name: unit,
name: unit + (titlename ? '_' + titlename : ''),
title: {
align: 'high',
offset: 0,
@@ -1145,7 +1164,7 @@ const drawPics = (
// containLabel: true
},
dataZoom: [
{
{
type: 'inside',
height: 13,
start: 0,

View File

@@ -149,7 +149,6 @@ self.addEventListener('message', function (e) {
boxoList.evtParamTm +
's'
} else if (boxoList.systemType == 'YPT') {
console.log("🚀 ~ boxoList.featureAmplitude:", boxoList.featureAmplitude)
titles =
(boxoList.engineeringName == undefined ? '' : ' 项目名称:' + boxoList.engineeringName) +
' 监测点名称:' +

View File

@@ -410,6 +410,20 @@ const initWave = (
'#CC00FF',
'#FF9999'
]
}
let titlename = ''
if (props.boxoList.systemType == 'ZL' || props.boxoList.systemType == 'YPT') {
if (props.wp.channelNames[1].includes('L')) {
titlename = '电网侧'
}
if (props.wp.channelNames[1].includes('S')) {
titlename = '负载侧'
}
}
const option = {
@@ -515,7 +529,7 @@ const initWave = (
},
yAxis: {
type: 'value',
name: unit,
name: unit + (titlename ? '_' + titlename : ''),
title: {
align: 'high',
offset: 0,
@@ -694,28 +708,41 @@ const drawPics = (
}
let titlename = ''
if (props.boxoList.systemType == 'ZL') {
if (props.boxoList.systemType == 'ZL' || props.boxoList.systemType == 'YPT') {
const str = waveId.split('e')
const str1 = Number(str[1])
console.log("🚀 ~ drawPics ~ props.wp.channelNames:", props.wp.channelNames)
props.wp.channelNames.forEach((element: string, i: number) => {
if (i == 4 || i == 7 || i == 10) {
if (str1 == 1 && i == 4) {
const s = element.split('A')
const s1 = s[0] == 'LI' ? '电网侧-电流' : s[0] + '侧' + s[1]
titlename = s1 + ' ' + title
if ((str1 == 1 && i == 4) || (str1 == 2 && i == 7) || (str1 == 3 && i == 10)) {
if (element.includes('L')) {
titlename = '电网侧'
}
if (str1 == 2 && i == 7) {
const s = element.split('A')
const s1 = s[0] == 'SU' ? '负载侧-电压' : s[0] + '侧' + s[1]
titlename = s1 + ' ' + title
}
if (str1 == 3 && i == 10) {
const s = element.split('A')
const s1 = s[0] == 'SI' ? '负载侧-电流' : s[0] + '侧' + s[1]
titlename = s1 + ' ' + title
if (element.includes('S')) {
titlename = '负载侧'
}
// if (str1 == 1 && i == 4) {
// const s = element.split('A')
// const s1 = s[0] == 'LI' ? '电网侧' : ''//s[0] + '侧' + s[1]
// titlename = s1 //+ ' ' + title
// }
// if (str1 == 2 && i == 7) {
// const s = element.split('A')
// const s1 = s[0] == 'SU' ? '负载侧' : ''//s[0] + '侧' + s[1]
// titlename = s1 //+ ' ' + title
// }
// if (str1 == 3 && i == 10) {
// const s = element.split('A')
// const s1 = s[0] == 'SI' ? '负载侧' : ''//s[0] + '侧' + s[1]
// titlename = s1 //+ ' ' + title
// }
}
})
}
const waveIds = document.getElementById(waveId)
@@ -830,7 +857,7 @@ const drawPics = (
},
yAxis: {
type: 'value',
name: unit,
name: unit + (titlename ? '_' + titlename : ''),
title: {
align: 'high',
offset: 0,

View File

@@ -146,7 +146,7 @@ import { ElMessageBox, type TagProps } from 'element-plus'
import type TableStoreClass from '@/utils/tableStore'
import { fullUrl, timeFormat } from '@/utils/common'
import type { VxeColumnProps } from 'vxe-table'
import { getFileUrl } from '@/api/system-boot/file'
import { downLoadFile } from '@/api/cs-system-boot/manage'
const TableStore = inject('tableStore') as TableStoreClass
interface Props {
@@ -228,8 +228,12 @@ const handlerCommand = (item: OptButton) => {
}
const imgList: any = ref({})
const getUrl = (url: string) => {
getFileUrl({ filePath: url }).then(res => {
imgList.value[url] = res.data
if (imgList.value[url]) return true
downLoadFile(url).then(res => {
const blob = res as unknown as Blob
if (blob?.type && blob.type !== 'application/json') {
imgList.value[url] = window.URL.createObjectURL(blob)
}
})
return true
}

View File

@@ -1,6 +1,6 @@
<!-- 设备管理使用折叠面板渲染多个tree -->
<template>
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="display: flex; overflow: hidden">
<div :style="{ width: menuCollapse ? '40px' : props.width }" class="device-tree-root">
<!-- <Icon
v-show="menuCollapse"
@click="onMenuCollapse"
@@ -11,7 +11,7 @@
style="cursor: pointer"
/> -->
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1 }">
<div style="display: flex; align-items: center" class="mb10">
<div class="tree-search mb10">
<el-input maxlength="32" show-word-limit
v-model.trim="filterText"
@@ -48,29 +48,29 @@
<el-collapse
:accordion="true"
v-model="activeName"
style="flex: 1; height: 100%"
class="device-collapse"
@change="changeDevice"
v-if="treeType == '1'"
v-loading="loading"
>
<el-collapse-item title="治理设备" name="0" v-if="zlDeviceData.length">
<el-select v-model="process" clearable placeholder="请选择状态" class="mb10">
<el-option label="功能调试" value="2" />
<el-option label="出厂调试" value="3" />
<el-option label="正式投运" value="4" />
</el-select>
<el-tree
:style="{ height: governTreeHeight }"
ref="treeRef1"
:props="defaultProps"
highlight-current
:filter-node-method="filterNode"
node-key="id"
:default-expand-all="false"
v-bind="$attrs"
:data="zlDevList"
style="overflow: auto"
>
<div class="collapse-tree-panel collapse-tree-panel--govern">
<el-select v-model="process" clearable placeholder="请选择状态" class="mb10">
<el-option label="功能调试" value="2" />
<el-option label="出厂调试" value="3" />
<el-option label="正式投运" value="4" />
</el-select>
<el-tree
ref="treeRef1"
:props="defaultProps"
highlight-current
:filter-node-method="filterNode"
node-key="id"
:default-expand-all="false"
v-bind="$attrs"
:data="zlDevList"
class="collapse-tree"
>
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
@@ -83,20 +83,21 @@
</span>
</template>
</el-tree>
</div>
</el-collapse-item>
<el-collapse-item title="便携式设备" name="1" v-if="bxsDeviceData.length">
<el-tree
:style="{ height: otherTreeHeight }"
ref="treeRef2"
:props="defaultProps"
highlight-current
:default-expand-all="false"
:filter-node-method="filterNode"
node-key="id"
:data="bxsDeviceData"
v-bind="$attrs"
style="overflow: auto"
>
<div class="collapse-tree-panel">
<el-tree
ref="treeRef2"
:props="defaultProps"
highlight-current
:default-expand-all="false"
:filter-node-method="filterNode"
node-key="id"
:data="bxsDeviceData"
v-bind="$attrs"
class="collapse-tree"
>
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
@@ -109,20 +110,21 @@
</span>
</template>
</el-tree>
</div>
</el-collapse-item>
<el-collapse-item title="监测设备" name="2" v-if="frontDeviceData.length">
<el-tree
:style="{ height: otherTreeHeight }"
ref="treeRef3"
:props="defaultProps"
highlight-current
:default-expand-all="false"
:filter-node-method="filterNode"
node-key="id"
:data="frontDeviceData"
v-bind="$attrs"
style="overflow: auto"
>
<div class="collapse-tree-panel">
<el-tree
ref="treeRef3"
:props="defaultProps"
highlight-current
:default-expand-all="false"
:filter-node-method="filterNode"
node-key="id"
:data="frontDeviceData"
v-bind="$attrs"
class="collapse-tree"
>
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
@@ -135,11 +137,11 @@
</span>
</template>
</el-tree>
</div>
</el-collapse-item>
</el-collapse>
<div v-if="treeType == '2'" v-loading="loading">
<div v-if="treeType == '2'" class="engineering-tree-wrap" v-loading="loading">
<el-tree
:style="{ height: engineeringTreeHeight }"
ref="treeRef4"
:props="defaultProps"
highlight-current
@@ -147,7 +149,7 @@
node-key="id"
v-bind="$attrs"
:data="props.data"
style="overflow: auto"
class="engineering-tree"
:default-expand-all="false"
>
<template #default="{ node, data: nodeData }">
@@ -170,7 +172,7 @@
<script lang="ts" setup>
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree, type CollapseModelValue } from 'element-plus'
import { ref, watch, onMounted, nextTick, computed } from 'vue'
import { ref, watch, onMounted, nextTick } from 'vue'
import { collectDeviceLeaves } from './govern/lineTreeUtils'
import { collectDeviceApiLeaves } from './govern/deviceTreeUtils'
@@ -222,12 +224,6 @@ const zlDevList = ref<any[]>([])
const bxsDeviceData = ref<any[]>([])
const frontDeviceData = ref<any[]>([])
const governTreeHeight = computed(() => `calc(100vh - 380px - ${props.height}px)`)
const otherTreeHeight = computed(() =>
zlDeviceData.value.length ? `calc(100vh - 340px - ${props.height}px)` : `calc(100vh - 238px - ${props.height}px)`
)
const engineeringTreeHeight = computed(() => `calc(100vh - 188px - ${props.height}px)`)
const treeRef1 = ref<InstanceType<typeof ElTree>>()
const treeRef2 = ref<InstanceType<typeof ElTree>>()
const treeRef3 = ref<InstanceType<typeof ElTree>>()
@@ -384,6 +380,13 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
.device-tree-root {
display: flex;
overflow: hidden;
height: 100%;
min-height: 0;
}
.cn-tree {
flex-shrink: 0;
display: flex;
@@ -391,7 +394,10 @@ onMounted(() => {
box-sizing: border-box;
padding: 10px;
height: 100%;
min-height: 0;
max-height: 100%;
width: 100%;
overflow: hidden;
:deep(.el-tree) {
border: 1px solid var(--el-border-color);
@@ -401,6 +407,85 @@ onMounted(() => {
background-color: var(--el-color-primary-light-7);
}
.tree-search {
display: flex;
align-items: center;
flex-shrink: 0;
}
.device-collapse {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
border: none;
:deep(.el-collapse-item) {
flex-shrink: 0;
.el-collapse-item__header {
height: 48px;
line-height: 48px;
}
&.is-active {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
.el-collapse-item__wrap {
flex: 1;
min-height: 0;
}
.el-collapse-item__content {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
padding-bottom: 0;
box-sizing: border-box;
}
}
}
}
.engineering-tree-wrap {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.engineering-tree {
flex: 1;
min-height: 0;
overflow: auto;
}
.collapse-tree-panel {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
height: 100%;
overflow: hidden;
&--govern > .el-select {
flex-shrink: 0;
}
}
.collapse-tree {
flex: 1;
min-height: 0;
overflow: auto;
}
.menu-collapse {
color: var(--el-color-primary);
}

View File

@@ -17,8 +17,7 @@ export function decorateDeviceTree(
child.children?.forEach((grand: any) => {
applyMeta(grand, {
icon: 'el-icon-Platform',
color: statusColor(grand.comFlag),
level: 3
color: statusColor(grand.comFlag)
})
leaves.engineering.push(grand)
})
@@ -69,7 +68,6 @@ export function decorateDeviceTree(
l3.pName = '监测设备'
applyMeta(l3, {
icon: 'el-icon-Platform',
level: 3,
color: l3.comFlag === 1 ? '#e26257 !important' : primary()
})
leaves.monitor.push(l3)
@@ -117,10 +115,16 @@ export function decorateCloudTree(root: any, decorators: LineTreeDecorators): an
l2.children?.forEach((l3: any) => {
applyMeta(l3, {
icon: 'el-icon-Platform',
level: 2,
// level: 2,
color: statusColor(l3.comFlag)
})
leaves.push(l3)
l3.children?.forEach((l4: any) => {
applyMeta(l4, {
icon: 'local-监测点',
color: statusColor(l4.comFlag)
})
leaves.push(l4)
})
})
})
})

View File

@@ -19,12 +19,9 @@ export interface LineTreeDecorators {
export function createLineTreeDecorators(getPrimaryColor: () => string): LineTreeDecorators {
const offlineColor = '#e26257 !important'
// const statusColor = (comFlag: number) => (comFlag === 2 ? getPrimaryColor() : offlineColor)
const statusColor = (comFlag: number) => (comFlag === 2 ? "#2ab914" : offlineColor)
const statusColor = (comFlag: number) => (comFlag === 2 ? '#2ab914' : offlineColor)
const applyMeta = (
node: any,
meta: { icon: string; color?: string; level?: number; disabled?: boolean }
) => {
const applyMeta = (node: any, meta: { icon: string; color?: string; level?: number; disabled?: boolean }) => {
node.icon = meta.icon
if (meta.color !== undefined) node.color = meta.color
if (meta.level !== undefined) node.level = meta.level
@@ -88,11 +85,10 @@ export function decorateLineTree(
applyMeta(leaf, {
icon: 'local-监测点',
color: statusColor(leaf.comFlag),
...LINE_LEAF_META
})
leaf.pname=item.name,
leaves.engineering.push(leaf)
;(leaf.pname = item.name), leaves.engineering.push(leaf)
})
})
})
@@ -115,27 +111,28 @@ export function decorateLineTree(
applyMeta(l4, {
icon: 'local-监测点',
color: statusColor(l4.comFlag),
...LINE_LEAF_META
})
l4.pname=item.name,
leaves.govern.push(l4)
;(l4.pname = item.name), (l4.devConType = l3.devConType), leaves.govern.push(l4)
})
})
})
})
} else if (item.name === '便携式设备') {
item.pname = item.name
item.children?.forEach((l1: any) => {
applyMeta(l1, { icon: 'el-icon-Platform', color: statusColor(l1.comFlag) })
l1.pname = item.name
l1.children?.forEach((l2: any) => {
applyMeta(l2, {
icon: 'local-监测点',
color: statusColor(l2.comFlag),
...LINE_LEAF_META
})
l2.pname=item.name,
leaves.portable.push(l2)
;(l2.pname = item.name), (l2.devConType = l1.devConType), leaves.portable.push(l2)
})
})
} else if (item.name === '监测设备') {
@@ -154,11 +151,10 @@ export function decorateLineTree(
applyMeta(l4, {
icon: 'local-监测点',
color: statusColor(l4.comFlag),
...LINE_LEAF_META
})
l4.pname=item.name,
leaves.monitor.push(l4)
;(l4.pname = item.name), (l4.devConType = l3.devConType), leaves.monitor.push(l4)
})
})
})

View File

@@ -1,13 +1,6 @@
<template>
<Tree
ref="treRef"
:width="width"
:data="tree"
default-expand-all
@changePointType="changePointType"
@changeTreeType="loadTree"
:height="height"
/>
<Tree ref="treRef" :width="width" :data="tree" default-expand-all @changePointType="changePointType"
@changeTreeType="loadTree" :height="height" />
</template>
<script lang="ts" setup>
@@ -56,10 +49,10 @@ async function selectInitialNode(type: string | undefined, leaves: LineTreeLeave
type === '2'
? [{ refKey: 'treeRef4', list: leaves.engineering, level: 3 }]
: [
{ refKey: 'treeRef1', list: leaves.govern, level: 2 },
{ refKey: 'treeRef2', list: leaves.portable, level: 2 },
{ refKey: 'treeRef3', list: leaves.monitor, level: 2 }
]
{ refKey: 'treeRef1', list: leaves.govern, level: 2 },
{ refKey: 'treeRef2', list: leaves.portable, level: 2 },
{ refKey: 'treeRef3', list: leaves.monitor, level: 2 }
]
for (const { refKey, list, level } of candidates) {
const node = list[0]
@@ -96,9 +89,9 @@ function bootstrap() {
loadTree('2')
})
.catch(() => loadTree())
} else {
} else {
loadTree('2')
}
}

View File

@@ -1,11 +1,6 @@
<template>
<Tree
ref="treRef"
:width="width"
:data="tree"
default-expand-all
@checkedNodesChange="handleCheckedNodesChange"
/>
<Tree ref="treRef" :width="width" :data="tree" :expand-on-click-node="false" default-expand-all
@checkedNodesChange="handleCheckedNodesChange" />
</template>
<script lang="ts" setup>
@@ -38,12 +33,25 @@ const decorators = createLineTreeDecorators(() => config.getColorVal('elementUiP
const handleCheckedNodesChange = (nodes: any[]) => emit('checkChange', nodes)
function markPortableNoCheckbox(node: any) {
node.noCheckbox = true
node.children?.forEach(markPortableNoCheckbox)
}
async function loadTree() {
tree.value = []
const res = await getLineTree()
const leaves = decorateLineTree(res.data, '1', decorators, { disableParents: false })
tree.value = res.data.filter((item: any) => item.name === '监测设备')
// tree.value = res.data.filter((item: any) => (item.name === '监测设备'||item.name === '便携式设备'))
const monitorRoot = res.data.find((item: any) => item.name === '监测设备')
const portableRoot = res.data.find((item: any) => item.name === '便携式设备')
if (portableRoot) {
markPortableNoCheckbox(portableRoot)
}
tree.value = [monitorRoot, portableRoot].filter(Boolean)
const node = leaves.monitor[0]
if (!node) {
emit('init')

View File

@@ -44,7 +44,7 @@
<el-tree
ref="treeRef"
:style="{ height: treeHeight }"
:style="{ height: treeHeight,overflowY: 'auto' }"
:props="defaultProps"
highlight-current
:default-expand-all="false"
@@ -146,6 +146,7 @@ defineExpose({ treeRef })
width: 270px;
transition: width 0.3s;
box-sizing: border-box;
&.is-fill-height {
height: 100%;

View File

@@ -1,6 +1,6 @@
<!-- 设备监控使用折叠面板渲染多个tree -->
<template>
<div :style="{ width: menuCollapse ? '40px' : props.width }" style="display: flex; overflow: hidden">
<div :style="{ width: menuCollapse ? '40px' : props.width }" class="point-tree-root">
<!-- <Icon
v-show="menuCollapse"
@click="onMenuCollapse"
@@ -12,16 +12,12 @@
v-if="route.path != '/admin/govern/reportCore/statistics/index'"
/> -->
<div class="cn-tree" :style="{ opacity: menuCollapse ? 0 : 1, display: menuCollapse ? 'none' : '' }">
<div style="display: flex; align-items: center" class="mb10">
<el-input v-model.trim="filterText" placeholder="请输入内容" clearable>
<div class="tree-search mb10">
<el-input v-model.trim="filterText" placeholder="请输入内容" clearable>
<template #prepend>
<el-select v-model="treeType" @change="changeTreeType" style="min-width: 75px">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</template>
<template #prefix>
@@ -39,120 +35,67 @@
/> -->
</div>
<el-collapse
:accordion="true"
v-model="activeName"
style="flex: 1; height: 100%"
@change="changeDevice"
v-if="treeType == '1'"
v-loading="loading"
>
<el-collapse :accordion="true" v-model="activeName" class="device-collapse" @change="changeDevice"
v-if="treeType == '1'" v-loading="loading">
<el-collapse-item title="治理设备" name="0" v-if="zlDeviceData.length">
<el-select v-model="process" clearable placeholder="请选择状态" class="mb10">
<el-option label="功能调试" value="2" />
<el-option label="出厂调试" value="3" />
<el-option label="正式投运" value="4" />
</el-select>
<el-tree
:style="{ height: governTreeHeight }"
ref="treeRef1"
:props="defaultProps"
highlight-current
:filter-node-method="filterNode"
node-key="id"
v-bind="$attrs"
:data="zlDevList"
style="overflow: auto"
:default-expand-all="false"
>
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
:name="nodeData.icon"
style="font-size: 16px"
:style="{ color: nodeData.color }"
v-if="nodeData.icon"
/>
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
</el-tree>
<div class="collapse-tree-panel collapse-tree-panel--govern">
<el-select v-model="process" clearable placeholder="请选择状态" class="mb10">
<el-option label="功能调试" value="2" />
<el-option label="出厂调试" value="3" />
<el-option label="正式投运" value="4" />
</el-select>
<el-tree ref="treeRef1" :props="defaultProps" highlight-current :filter-node-method="filterNode"
node-key="id" v-bind="$attrs" :data="zlDevList" class="collapse-tree"
:default-expand-all="false">
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon :name="nodeData.icon" style="font-size: 16px"
:style="{ color: nodeData.color }" v-if="nodeData.icon" />
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
</el-tree>
</div>
</el-collapse-item>
<el-collapse-item title="便携式设备" name="1" v-if="bxsDeviceData.length">
<el-tree
:style="{ height: otherTreeHeight }"
ref="treeRef2"
:props="defaultProps"
highlight-current
:default-expand-all="false"
:filter-node-method="filterNode"
node-key="id"
:data="bxsDeviceData"
v-bind="$attrs"
style="overflow: auto"
>
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
:name="nodeData.icon"
style="font-size: 16px"
:style="{ color: nodeData.color }"
v-if="nodeData.icon"
/>
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
</el-tree>
<div class="collapse-tree-panel">
<el-tree ref="treeRef2" :props="defaultProps" highlight-current :default-expand-all="false"
:filter-node-method="filterNode" node-key="id" :data="bxsDeviceData" v-bind="$attrs"
class="collapse-tree">
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon :name="nodeData.icon" style="font-size: 16px"
:style="{ color: nodeData.color }" v-if="nodeData.icon" />
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
</el-tree>
</div>
</el-collapse-item>
<el-collapse-item title="监测设备" name="2" v-if="yqfDeviceData.length">
<el-tree
:style="{ height: otherTreeHeight }"
ref="treeRef3"
:props="defaultProps"
highlight-current
:default-expand-all="false"
:filter-node-method="filterNode"
node-key="id"
:data="yqfDeviceData"
v-bind="$attrs"
style="overflow: auto"
>
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
:name="nodeData.icon"
style="font-size: 16px"
:style="{ color: nodeData.color }"
v-if="nodeData.icon"
/>
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
</el-tree>
<div class="collapse-tree-panel">
<el-tree ref="treeRef3" :props="defaultProps" highlight-current :default-expand-all="false"
:filter-node-method="filterNode" node-key="id" :data="yqfDeviceData" v-bind="$attrs"
class="collapse-tree">
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon :name="nodeData.icon" style="font-size: 16px"
:style="{ color: nodeData.color }" v-if="nodeData.icon" />
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
</el-tree>
</div>
</el-collapse-item>
</el-collapse>
<div v-if="treeType == '2'" v-loading="loading">
<el-tree
:style="{ height: engineeringTreeHeight }"
class="pt10"
ref="treeRef4"
:props="defaultProps"
highlight-current
:filter-node-method="filterNode"
node-key="id"
v-bind="$attrs"
:data="props.data"
style="overflow: auto"
:default-expand-all="false"
>
<div v-if="treeType == '2'" class="engineering-tree-wrap" v-loading="loading">
<el-tree class="engineering-tree pt10 collapse-tree" ref="treeRef4" :props="defaultProps"
highlight-current :filter-node-method="filterNode" node-key="id" v-bind="$attrs" :data="props.data"
:default-expand-all="false">
<template #default="{ node, data: nodeData }">
<span class="custom-tree-node">
<Icon
:name="nodeData.icon"
style="font-size: 16px"
:style="{ color: nodeData.color }"
v-if="nodeData.icon"
/>
<Icon :name="nodeData.icon" style="font-size: 16px" :style="{ color: nodeData.color }"
v-if="nodeData.icon" />
<span style="margin-left: 4px">{{ node.label }}</span>
</span>
</template>
@@ -165,7 +108,7 @@
<script lang="ts" setup>
import useCurrentInstance from '@/utils/useCurrentInstance'
import { ElTree, type CollapseModelValue } from 'element-plus'
import { ref, watch, nextTick, computed } from 'vue'
import { ref, watch, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { collectDeviceLeaves } from './govern/lineTreeUtils'
@@ -214,12 +157,6 @@ const zlDevList = ref<any[]>([])
const bxsDeviceData = ref<any[]>([])
const yqfDeviceData = ref<any[]>([])
const governTreeHeight = computed(() => `calc(100vh - 380px - ${props.height}px)`)
const otherTreeHeight = computed(() =>
zlDeviceData.value.length ? `calc(100vh - 340px - ${props.height}px)` : `calc(100vh - 238px - ${props.height}px)`
)
const engineeringTreeHeight = computed(() => `calc(100vh - 188px - ${props.height}px)`)
const treeRef1 = ref<InstanceType<typeof ElTree>>()
const treeRef2 = ref<InstanceType<typeof ElTree>>()
const treeRef3 = ref<InstanceType<typeof ElTree>>()
@@ -381,6 +318,17 @@ const changeTreeType = (val: string) => {
</script>
<style lang="scss" scoped>
:deep(.el-tree-node) {
white-space: none;
}
.point-tree-root {
display: flex;
overflow: hidden;
height: 100%;
min-height: 0;
}
.cn-tree {
flex-shrink: 0;
display: flex;
@@ -388,8 +336,11 @@ const changeTreeType = (val: string) => {
box-sizing: border-box;
padding: 10px;
height: 100%;
min-height: 0;
max-height: 100%;
width: 280px;
background: #fff;
overflow: hidden;
:deep(.el-tree) {
border: 1px solid var(--el-border-color);
@@ -399,6 +350,85 @@ const changeTreeType = (val: string) => {
background-color: var(--el-color-primary-light-7);
}
.tree-search {
display: flex;
align-items: center;
flex-shrink: 0;
}
.device-collapse {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
border: none;
:deep(.el-collapse-item) {
flex-shrink: 0;
.el-collapse-item__header {
height: 48px;
line-height: 48px;
}
&.is-active {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
.el-collapse-item__wrap {
flex: 1;
min-height: 0;
}
.el-collapse-item__content {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
padding-bottom: 0;
box-sizing: border-box;
}
}
}
}
.engineering-tree-wrap {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.engineering-tree {
flex: 1;
min-height: 0;
overflow: auto;
}
.collapse-tree-panel {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
height: 100%;
overflow: hidden;
&--govern>.el-select {
flex-shrink: 0;
}
}
.collapse-tree {
flex: 1;
min-height: 0;
overflow: auto;
}
.menu-collapse {
color: var(--el-color-primary);
}
@@ -408,7 +438,9 @@ const changeTreeType = (val: string) => {
display: flex;
align-items: center;
}
:deep(.el-input-group__prepend) {
background-color: var(--el-fill-color-blank);
}
</style>

View File

@@ -71,7 +71,11 @@ const emit = defineEmits(['changePointType', 'checkedNodesChange'])
const { proxy } = useCurrentInstance()
const menuCollapse = ref(false)
const filterText = ref('')
const defaultProps = { label: 'name', value: 'id' }
const defaultProps = {
label: 'name',
value: 'id',
class: (data: any) => (data.noCheckbox ? 'is-no-checkbox' : '')
}
const filterNode = createTreeFilterNode()
const checkedNodes = ref<any[]>([])
const defaultCheckedKeys = ref<string[]>([])
@@ -152,6 +156,10 @@ defineExpose({ treeRef })
background-color: var(--el-color-primary-light-7);
}
:deep(.el-tree-node.is-no-checkbox > .el-tree-node__content .el-checkbox) {
display: none;
}
.menu-collapse {
color: var(--el-color-primary);
}

View File

@@ -3,25 +3,23 @@
<el-scrollbar>
<el-form :inline="false" :model="form" label-width="120px" :rules="rules" class="form-one" ref="formRef">
<el-form-item label="校验密码" prop="password">
<el-input maxlength="32" show-word-limit v-model.trim="form.password" type="password" placeholder="请输入校验密码" show-password />
<el-input maxlength="32" show-word-limit v-model.trim="form.password" type="password"
placeholder="请输入校验密码" show-password />
</el-form-item>
<el-form-item label="新密码" prop="newPwd">
<el-input maxlength="32" show-word-limit v-model.trim="form.newPwd" type="password" placeholder="请输入新密码" show-password />
<el-input maxlength="32" show-word-limit v-model.trim="form.newPwd" type="password"
placeholder="请输入新密码" show-password />
</el-form-item>
<el-form-item label="确认密码" prop="confirmPwd">
<el-input maxlength="32" show-word-limit
v-model.trim="form.confirmPwd"
type="password"
placeholder="请输入确认密码"
show-password
/>
<el-input maxlength="32" show-word-limit v-model.trim="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>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -46,6 +44,7 @@ const form = reactive({
newPwd: '',
confirmPwd: ''
})
const loading = ref(false)
const rules = {
password: [
{ required: true, message: '请输入校验密码', trigger: 'blur' },
@@ -99,6 +98,7 @@ const open = () => {
const submit = () => {
formRef.value.validate(async (valid: boolean) => {
if (valid) {
loading.value = true
passwordConfirm(form.password).then(res => {
updatePassword({
id: adminInfo.$state.userIndex,
@@ -106,14 +106,18 @@ const submit = () => {
}).then(async (res: any) => {
ElMessage.success('密码修改成功')
dialogVisible.value = false
setTimeout(() => {
navTabs.closeTabs()
navTabs.closeTabs()
window.localStorage.clear()
adminInfo.reset()
router.push({ name: 'login' })
}, 0)
}).finally(() => {
loading.value = false
})
}).finally(() => {
loading.value = false
})
}
})

View File

@@ -1,4 +1,3 @@
/* 修复 Chrome 浏览器输入框内选中字符行高异常的bug-s */
.el-input .el-input__inner {
height: 30px;
@@ -104,7 +103,7 @@
border-radius: var(--el-border-radius-base);
box-shadow: none;
-webkit-box-shadow: none;
cursor: pointer !important;
cursor: pointer !important;
}
&:hover {
@@ -229,11 +228,19 @@
}
}
.el-collapse-item__content{
.el-collapse-item__content {
padding-bottom: 0;
}
//解决打开dialog body容器宽度变为 calc(100% - 8px)问题
.el-popup-parent--hidden{
.el-popup-parent--hidden {
width: 100% !important;
}
}
// 树x轴滚动、
.el-scrollbar .el-scrollbar__wrap {
overflow-x: hidden !important;
}
.el-tree > .el-tree-node {
min-width: 100% !important;
display: inline-block !important;
}

View File

@@ -17,7 +17,7 @@
<template #footer>
<span class='dialog-footer'>
<el-button @click='dialogVisible = false'>取消</el-button>
<el-button type='primary' @click='submit'></el-button>
<el-button type='primary' @click='submit' :loading="loading"></el-button>
</span>
</template>
</el-dialog>
@@ -40,6 +40,7 @@ const form = reactive({
remark: '',
id: ''
})
const loading = ref(false)
const rules = {
name: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入角色编码', trigger: 'blur' }]
@@ -63,6 +64,7 @@ const open = (text: string, data?: anyObj) => {
const submit = () => {
formRef.value.validate(async (valid) => {
if (valid) {
loading.value = true
if (form.id) {
// await update(form)
} else {
@@ -71,6 +73,7 @@ const submit = () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -55,7 +55,6 @@ export function getAwesomeIconfontNames() {
nextTick(() => {
const iconfonts = []
const sheets = getStylesFromVite('all.css')
console.log(sheets)
for (const key in sheets) {
const rules: any = sheets[key].cssRules
for (const k in rules) {

View File

@@ -81,6 +81,7 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
config.url == '/cs-harmonic-boot/csevent/f47Curve' ||
config.url == '/cs-harmonic-boot/sysExcel/querySysExcel' ||
config.url == '/cs-device-boot/csLedger/lineTree' ||
config.url == '/system-boot/file/download' ||
config.url == '/cs-harmonic-boot/pqSensitiveUser/getUserDevTree'
)
)
@@ -103,10 +104,7 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
}
}
if (
config.url == '/user-boot/user/generateSm2Key' ||
config.url == '/pqs-auth/oauth/token'
) {
if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') {
config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw=='
}
@@ -195,7 +193,8 @@ function createAxios<Data = any, T = ApiPromise<Data>>(
}, 6000)
} else if (response.config.url == '/cs-harmonic-boot/cspage/getByUserId') {
} else {
ElMessage.error(response.data.message || '未知错误')
let message = response.data.message
ElMessage.error(message.substring(message.indexOf(',') + 1) || '未知错误')
}
}
return Promise.reject(response.data)

View File

@@ -120,7 +120,6 @@ watch(
provide('tableStore', tableStore)
const addMenu = () => {
console.log(popupRef)
popupRef.value.open('新增接口权限', {
pid: props.id
})

View File

@@ -1,28 +1,16 @@
<template>
<el-dialog width="500px" v-model.trim="dialogVisible" :title="title">
<el-scrollbar>
<el-form
:mode="form"
:inline="false"
ref="formRef"
:model="form"
label-width="120px"
:rules="rules"
class="form-one"
>
<el-form :mode="form" :inline="false" ref="formRef" :model="form" label-width="120px" :rules="rules"
class="form-one">
<el-form-item prop="name" label="接口/按钮名称">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入接口名称" />
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入接口名称" />
</el-form-item>
<el-form-item prop="code" label="接口/按钮标识">
<el-input maxlength="32" show-word-limit
v-model.trim="form.code"
placeholder="请输入英文接口标识"
/>
<el-input maxlength="32" show-word-limit v-model.trim="form.code" placeholder="请输入英文接口标识" />
</el-form-item>
<el-form-item prop="path" label="接口路径">
<el-input v-model.trim="form.path" placeholder="请输入接口路径" />
<el-input v-model.trim="form.path" placeholder="请输入接口路径" />
</el-form-item>
<el-form-item prop="type" label="接口类型">
<el-radio-group v-model.trim="form.type">
@@ -34,14 +22,8 @@
<el-input-number v-model.number="form.sort" style="width: 100%;" :min="0" />
</el-form-item>
<el-form-item prop="remark" label="接口/按钮描述">
<el-input show-word-limit
maxlength="300"
v-model.trim="form.remark"
:rows="2"
type="textarea"
placeholder="请输入描述"
/>
<el-input show-word-limit maxlength="300" v-model.trim="form.remark" :rows="2" type="textarea"
placeholder="请输入描述" />
</el-form-item>
</el-form>
</el-scrollbar>
@@ -49,7 +31,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -66,6 +48,7 @@ const emits = defineEmits<{
(e: 'init'): void
}>()
const formRef = ref()
const loading = ref(false)
const form: any = reactive({
id: '',
pid: '0',
@@ -113,15 +96,20 @@ const open = (text: string, data: anyObj) => {
const submit = async () => {
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
await update(form).then(() => {
ElMessage.success('修改成功!')
}).finally(() => {
loading.value = false
})
} else {
let obj = JSON.parse(JSON.stringify(form))
delete obj.id
await add(obj).then(() => {
ElMessage.success('新增成功!')
}).finally(() => {
loading.value = false
})
}
emits('init')

View File

@@ -45,7 +45,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -61,6 +61,7 @@ defineOptions({
name: 'auth/menu/popupMenu'
})
const formRef = ref()
const loading = ref(false)
const emits = defineEmits<{
(e: 'init'): void
}>()
@@ -116,10 +117,13 @@ const open = (text: string, data: anyObj) => {
const submit = async () => {
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
form.pid = form.pid || '0'
await updateMenu(form).then(() => {
ElMessage.success('编辑成功!')
}).finally(() => {
loading.value = false
})
} else {
form.code = 'menu'
@@ -129,6 +133,8 @@ const submit = async () => {
await addMenu(obj).then(() => {
ElMessage.success('新增成功!')
}).finally(() => {
loading.value = false
})
}
emits('init')

View File

@@ -22,7 +22,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -45,6 +45,7 @@ const form = reactive({
id: '',
type: 0
})
const loading = ref(false)
const rules = {
name: [{ required: true, message: '请输入角色名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入角色编码', trigger: 'blur' }]
@@ -69,6 +70,7 @@ const open = (text: string, data?: anyObj) => {
const submit = async () => {
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
await update(form)
} else {
@@ -78,6 +80,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -95,7 +95,6 @@ const tableStore = new TableStore({
},
click: row => {
popupEditRef.value.open('编辑用户', row)
console.log("🚀 ~ row:", row)
}
},
{

View File

@@ -101,7 +101,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -139,6 +139,7 @@ const form = reactive({
type: 0
})
const formRef = ref()
const loading = ref(false)
const rules: Partial<Record<string, Arrayable<FormItemRule>>> = {
name: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
role: [{ required: true, message: '请输入角色', trigger: 'blur' }],
@@ -203,7 +204,8 @@ const rules: Partial<Record<string, Arrayable<FormItemRule>>> = {
}
const UserTypeOption = [
{ label: '管理员', value: 1 },
{ label: '普通用户', value: 2 }
{ label: '普通用户', value: 2 },
{ label: 'APP用户', value: 3 },
]
const TypeOptions = [
{ label: '临时用户', value: 0 },
@@ -253,8 +255,10 @@ const open = (text: string, data?: anyObj) => {
}
}
const submit = async () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
loading.value = true
let obj = JSON.parse(JSON.stringify(form))
obj.limitTime = obj.limitTime.join('-')
delete obj.password
@@ -268,6 +272,7 @@ const submit = async () => {
}
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -16,7 +16,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -31,6 +31,7 @@ import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
import { debug } from 'console'
const formRef = ref()
const loading = ref(false)
const tableStore = inject('tableStore') as TableStore
const form = reactive({
id: '',
@@ -84,12 +85,15 @@ const open = (id: string, loginName: string) => {
const submit = async () => {
formRef.value.validate((valid: boolean) => {
if (valid) {
loading.value = true
updatePassword({
id: form.id,
newPassword: form.newPwd
}).then((res: any) => {
ElMessage.success('密码修改成功')
dialogVisible.value = false
}).finally(() => {
loading.value = false
})
}
})

View File

@@ -201,7 +201,7 @@ const tableStore = new TableStore({
render: 'basicButton',
disabled: row => {
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
return !(code == 'Direct_Connected_Device' || code == 'Gateway')
return !((code == 'Direct_Connected_Device' || code == 'Gateway') && row.wavePath == null)
},
},
@@ -213,7 +213,8 @@ const tableStore = new TableStore({
render: 'basicButton',
loading: 'loading2',
disabled: row => {
return row.wavePath
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
return !((code == 'Portable' || code == 'DEV_CLD') && row.wavePath == null)
},
click: row => {
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code

View File

@@ -3,7 +3,7 @@
@closed="handleClosed">
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto" class="form-one">
<el-form-item label="方案名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入方案名称" clearable />
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入方案名称" clearable />
</el-form-item>
<el-form-item label="在线率阈值" prop="onlineRateLimit">
<el-input-number v-model="form.onlineRateLimit" :min="0" :max="100" :precision="0" style="width: 100%"
@@ -22,7 +22,7 @@
</el-form>
<template #footer>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">确定</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading">确定</el-button>
</template>
</el-dialog>
</template>
@@ -38,7 +38,7 @@ const emit = defineEmits(['Cancels'])
const dialogVisible = ref(false)
const title = ref('')
const formRef = ref()
const loading = ref(false)
const defaultForm = () => ({
id: '',
name: '',
@@ -109,6 +109,7 @@ const onSubmit = () => {
integrityLimit: form.integrityLimit,
active: form.active
}
loading.value = true
try {
if (isEdit()) {
await update(payload)
@@ -121,6 +122,8 @@ const onSubmit = () => {
emit('Cancels')
} catch {
/* 请求层一般会统一提示 */
} finally {
loading.value = false
}
})
}

View File

@@ -44,7 +44,7 @@
</el-form>
<template #footer>
<div>
<el-button type="primary" @click="onConfirm"></el-button>
<el-button type="primary" @click="onConfirm"></el-button>
</div>
</template>
</el-dialog>

View File

@@ -4,19 +4,23 @@
<el-scrollbar max-height="60vh">
<el-form ref="formRef" :model="form" :rules="rules" label-width="auto" class="form-two">
<el-form-item label="指标名称" prop="indexName">
<el-input maxlength="32" show-word-limit v-model.trim="form.indexName" placeholder="请输入指标名称" clearable/>
<el-input maxlength="32" show-word-limit v-model.trim="form.indexName" placeholder="请输入指标名称"
clearable />
</el-form-item>
<el-form-item label="指标Code" prop="indexCode">
<el-input maxlength="32" show-word-limit v-model.trim="form.indexCode" placeholder="请输入指标Code" clearable />
<el-input maxlength="32" show-word-limit v-model.trim="form.indexCode" placeholder="请输入指标Code"
clearable />
</el-form-item>
<el-form-item label="表名" prop="influxdbTableName">
<el-input maxlength="32" show-word-limit v-model.trim="form.influxdbTableName" placeholder="请输入表名" clearable />
<el-input maxlength="32" show-word-limit v-model.trim="form.influxdbTableName" placeholder="请输入表名"
clearable />
</el-form-item>
<el-form-item label="列属性" prop="influxdbColumnName">
<el-input maxlength="32" show-word-limit v-model.trim="form.influxdbColumnName" placeholder="实体类属性名" clearable />
<el-input maxlength="32" show-word-limit v-model.trim="form.influxdbColumnName" placeholder="实体类属性名"
clearable />
</el-form-item>
<el-form-item label="谐波次数">
<el-slider v-model.trim="form.harmSlider" range :max="50" style="width: 90%" />
@@ -60,10 +64,10 @@
</el-select>
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input maxlength="32" show-word-limit v-model.trim="form.unit" placeholder="请输入单位" clearable />
<el-input maxlength="32" show-word-limit v-model.trim="form.unit" placeholder="请输入单位" clearable />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="form.sort" :min="0" style="width: 100%;" :precision="0" />
<el-input-number v-model="form.sort" :min="0" style="width: 100%;" :precision="0" />
</el-form-item>
<!-- <el-form-item label="状态" prop="state">
<el-select v-model="form.state" placeholder="请选择" style="width: 100%">
@@ -72,18 +76,18 @@
</el-select>
</el-form-item> -->
<el-form-item label="条件描述" prop="otherAlgorithm" class="form-item-full">
<el-input show-word-limit v-model.trim="form.otherAlgorithm" type="textarea" :rows="2" placeholder="无具体范围时的判断条件描述"
maxlength="300" />
<el-input show-word-limit v-model.trim="form.otherAlgorithm" type="textarea" :rows="2"
placeholder="无具体范围时的判断条件描述" maxlength="300" />
</el-form-item>
<el-form-item label="备注" prop="remark" class="form-item-full">
<el-input show-word-limit v-model.trim="form.remark" type="textarea" :rows="2" placeholder="备注" maxlength="300"
/>
<el-input show-word-limit v-model.trim="form.remark" type="textarea" :rows="2" placeholder="备注"
maxlength="300" />
</el-form-item>
</el-form>
</el-scrollbar>
<template #footer>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="onSubmit">确定</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading">确定</el-button>
</template>
</el-dialog>
</template>
@@ -97,6 +101,7 @@ const emit = defineEmits(['Cancels'])
const dialogVisible = ref(false)
const title = ref('')
const formRef = ref()
const loading = ref(false)
const phaseSelect = [
{
name: 'A相',
@@ -240,6 +245,7 @@ const handleClosed = () => {
const onSubmit = () => {
formRef.value?.validate(async (valid: boolean) => {
if (!valid) return
loading.value = true
form.harmStart = form.harmSlider[0]
form.harmEnd = form.harmSlider[1]
form.phaseType = form.phaseList.join(',')
@@ -256,6 +262,8 @@ const onSubmit = () => {
emit('Cancels')
} catch {
/* 统一错误提示 */
} finally {
loading.value = false
}
})
}

View File

@@ -138,16 +138,17 @@
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="500px" :before-close="handleClose">
<el-form :model="formData" :rules="formRules" ref="formRef" class="form-one" label-width="100px">
<el-form-item label="方案名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="formData.name" placeholder="请输入方案名称" clearable />
<el-input maxlength="32" show-word-limit v-model.trim="formData.name" placeholder="请输入方案名称"
clearable />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number v-model.number="formData.sort" :min="0" style="width: 100%;" />
<el-input-number v-model.number="formData.sort" :min="0" style="width: 100%;" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
<el-button type="primary" @click="submitForm" :loading="loading1">确定</el-button>
</span>
</template>
</el-dialog>
@@ -184,6 +185,7 @@ const lineList: any = ref([])
const copyRow: any = ref({})
const treeRef = ref()
const loading = ref(false)
const loading1 = ref(false)
// 弹框相关
const dialogVisible = ref(false)
const dialogTitle = ref('新增方案')
@@ -384,6 +386,7 @@ const handleClose = () => {
// 提交表单
const submitForm = async () => {
await formRef.value?.validate()
loading1.value = true
if (dialogTitle.value == '新增方案') {
await save({
harmonicTarget: '',
@@ -395,6 +398,8 @@ const submitForm = async () => {
ElMessage.success(`${dialogTitle.value}成功`)
dialogVisible.value = false
tableStore.index() // 刷新列表
}).finally(() => {
loading1.value = false
})
} else {
await update({
@@ -407,6 +412,8 @@ const submitForm = async () => {
ElMessage.success(`${dialogTitle.value}成功`)
dialogVisible.value = false
tableStore.index() // 刷新列表
}).finally(() => {
loading1.value = false
})
}

View File

@@ -195,7 +195,6 @@ const setEchart = () => {
let units = Object.keys(list)
// console.log('🚀 ~ .then ~ units:', units)
for (let unit in list) {
console.log('🚀 ~ .then ~ unit:', unit)
let [min, max] = yMethod(list[unit].map((item: any) => item.statisticalData))
yAxis.push({
name: unit == 'null' ? '' : unit,

View File

@@ -38,9 +38,9 @@
<!-- 补召日志 -->
<analysisList ref="analysisListRef"></analysisList>
</div>
<waveFormAnalysis v-loading="loading" v-if="isWaveCharts" ref="waveFormAnalysisRef"
@handleHideCharts="isWaveCharts = false" :wp="wp" />
@handleHideCharts="isWaveCharts = false" :wp="wp" />
</div>
</template>
@@ -216,7 +216,7 @@ const tableStore = new TableStore({
render: 'basicButton',
disabled: row => {
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
return !(code == 'Direct_Connected_Device' || code == 'Gateway')
return !((code == 'Direct_Connected_Device' || code == 'Gateway') && row.wavePath == null)
},
},
@@ -228,7 +228,8 @@ const tableStore = new TableStore({
render: 'basicButton',
loading: 'loading2',
disabled: row => {
return row.wavePath
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
return !((code == 'Portable' || code == 'DEV_CLD') && row.wavePath == null)
},
click: row => {
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
@@ -282,6 +283,7 @@ Object.assign(tableStore.table.params, {
const flag = ref(false)
tableStore.table.params.type = 0
tableStore.table.params.eventType = ''
tableStore.table.params.isDvr = '1'
tableStore.table.params.location = ''
provide('tableStore', tableStore)
const deviceTypeChange = (val: any, obj: any) => {

View File

@@ -22,7 +22,7 @@
<el-button icon="el-icon-Edit" type="primary" @click="update" v-if="nodeLevel != 0">
修改
</el-button>
<el-button icon="el-icon-Close" type="danger" @click="remove" v-if="nodeLevel != 0">
<el-button icon="el-icon-Close" type="danger" @click="remove" v-if="nodeLevel != 0" :loading="loading2">
删除
</el-button>
<el-button icon="el-icon-Right" :disabled="nextfalg" type="primary" @click="next"
@@ -32,10 +32,10 @@
<el-button type="info" @click="black" icon="el-icon-Back" v-if="pageStatus == 2 || pageStatus == 3">
</el-button>
<el-button icon="el-icon-Check" type="primary" v-if="pageStatus == 2" @click="onsubmit">
<el-button icon="el-icon-Check" type="primary" v-if="pageStatus == 2" @click="onsubmit" :loading="loading1">
确认提交
</el-button>
<el-button icon="el-icon-Check" type="primary" v-if="pageStatus == 3" @click="onsubmit">
<el-button icon="el-icon-Check" type="primary" v-if="pageStatus == 3" @click="onsubmit" :loading="loading1">
修改提交
</el-button>
</el-form-item>
@@ -116,7 +116,8 @@
<div style="width: 100%" class="mt10"
v-if="(nodeLevel > 0 || pageStatus == 2) && formData.projectInfoList.length > 0">
<el-tabs v-model="deviceIndex" type="border-card" :addable="false" :closable="pageStatus != 1"
@edit="handleDeviceTabsEdit" @tab-click="tabChange('deviceIndex', $event)">
style="width: 100%" @edit="handleDeviceTabsEdit"
@tab-click="tabChange('deviceIndex', $event)">
<el-tab-pane v-for="(item, index) in formData.projectInfoList" :key="index"
:label="item.name ? item.name : '新建项目' + index" :name="index + ''">
<div class="flex mt10">
@@ -853,7 +854,7 @@ import {
queryPushResult
} from '@/api/cs-device-boot/cloudDeviceEntry'
import { getTopoTemplate } from '@/api/cs-device-boot/topologyTemplate'
import { getFileUrl } from '@/api/system-boot/file'
import { downLoadFile } from '@/api/cs-system-boot/manage'
import tree from '@/assets/map/area.json'
import { queryByCode, queryCsDictTree, queryByid } from '@/api/system-boot/dictTree'
import MacAddressInput from '@/components/form/mac/MacAddressInput.vue'
@@ -872,6 +873,7 @@ const Height = mainHeight(124)
const mainForm = ref()
const loading = ref(false)
const nextfalg = ref(false)
const loading1 = ref(false)
const dictData = useDictData()
const nodeLevel = ref(0)
const nodeLevelCopy = ref(0)
@@ -889,7 +891,7 @@ const devId: any = ref('0')
const busBarId: any = ref('0')
const lineId: any = ref('0')
const userList: any = ref([])
const monitorObjList: any = dictData.getBasicData('M_Obj_Types')
const monitorObjList: any = dictData.getBasicData('Interference_Source')
const linePosition: any = dictData.getBasicData('Line_Position')
const currentGdName: any = ref('')
@@ -996,7 +998,7 @@ interface DeviceInfo {
//const deviceInfoList = ref<DeviceInfo[]>([])
interface LineInfo {
name: string
lineNo: number
lineNo: number | string
conType: number
lineInterval: number
ptRatio: number
@@ -1170,8 +1172,10 @@ const getImageList = async () => {
getTopoTemplate().then(res => {
images.value = res.data
images.value.forEach(async item => {
let row = await getFileUrl({ filePath: item.filePath })
item.url = row.data
const blob = (await downLoadFile(item.filePath)) as unknown as Blob
if (blob?.type && blob.type !== 'application/json') {
item.url = window.URL.createObjectURL(blob)
}
})
})
}
@@ -1403,7 +1407,7 @@ const add = () => {
// 添加一个新的空监测点到lineInfoList
formData.value.lineInfoList.push({
name: '',
lineNo: 1,
lineNo: '',
conType: 0,
lineInterval: 1,
ptRatio: 1,
@@ -1480,6 +1484,7 @@ const updateEngineering = (id: any) => {
province: engData.province
}
loading1.value = true
auditEngineering(engineeringData).then((res: any) => {
ElMessage({
type: 'success',
@@ -1487,6 +1492,8 @@ const updateEngineering = (id: any) => {
})
pageStatus.value = 1
TerminalRef.value.info()
}).finally(() => {
loading1.value = false
})
}
/**
@@ -1503,6 +1510,7 @@ const updateProjectFunc = (id: any) => {
return
}
loading1.value = true
deleteProject(
id,
currentProject.name,
@@ -1518,6 +1526,8 @@ const updateProjectFunc = (id: any) => {
})
pageStatus.value = 1
treedata()
}).finally(() => {
loading1.value = false
})
}
/**
@@ -1552,6 +1562,7 @@ const updateEquipmentFunc = (id: any) => {
sort: currentDevice.sort
}
loading1.value = true
updateEquipment(deviceData).then((res: any) => {
ElMessage({
type: 'success',
@@ -1559,6 +1570,8 @@ const updateEquipmentFunc = (id: any) => {
})
pageStatus.value = 1
TerminalRef.value.info()
}).finally(() => {
loading1.value = false
})
}
@@ -1597,7 +1610,7 @@ const updateLineFunc = (id: any) => {
const lineData = {
lineId: id,
name: currentLine.name || '',
lineNo: currentLine.lineNo || 1,
lineNo: currentLine.lineNo,
conType: currentLine.conType || 0,
lineInterval: currentLine.lineInterval || 1,
ptRatio: currentLine.ptRatio || 1,
@@ -1620,6 +1633,7 @@ const updateLineFunc = (id: any) => {
devId: devId
}
loading1.value = true
updateLine(lineData).then((res: any) => {
ElMessage({
type: 'success',
@@ -1627,9 +1641,11 @@ const updateLineFunc = (id: any) => {
})
pageStatus.value = 1
treedata()
}).finally(() => {
loading1.value = false
})
}
const loading2 = ref(false)
// 删除
const remove = () => {
if (Object.keys(nodeData.value).length == 0) {
@@ -1656,6 +1672,7 @@ const remove = () => {
type: 'warning'
})
.then(() => {
loading2.value = true
switch (nodeData.value.level) {
case 0:
let data = {
@@ -1672,6 +1689,8 @@ const remove = () => {
setTimeout(() => {
treedata()
}, 100)
}).finally(() => {
loading2.value = false
})
break
@@ -1692,6 +1711,8 @@ const remove = () => {
} else {
treedata()
}
}).finally(() => {
loading2.value = false
})
break
@@ -1712,6 +1733,8 @@ const remove = () => {
} else {
treedata()
}
}).finally(() => {
loading2.value = false
})
break
@@ -1732,6 +1755,8 @@ const remove = () => {
} else {
treedata()
}
}).finally(() => {
loading2.value = false
})
break
@@ -1883,7 +1908,7 @@ const next = async () => {
// 创建新的监测点Tab
formData.value.lineInfoList.push({
name: '',
lineNo: 1,
lineNo: '',
conType: 0,
lineInterval: 1,
ptRatio: 1,
@@ -2326,7 +2351,7 @@ const resetAllForms = () => {
// 清空监测点表单
formData.value.lineInfoList.forEach(line => {
line.name = ''
line.lineNo = 1
line.lineNo = ''
line.conType = 0
line.lineInterval = 1
line.ptRatio = 1
@@ -2397,7 +2422,9 @@ const submitData = () => {
}
}
loading1.value = true
addLedger(project).then((res: any) => {
loading1.value = false
ElMessage({
type: 'success',
message: '新增项目成功'
@@ -2416,6 +2443,8 @@ const submitData = () => {
} else {
TerminalRef.value.info()
}
}).finally(() => {
loading1.value = false
})
break
case 2: // 新增设备
@@ -2454,7 +2483,9 @@ const submitData = () => {
]
}
loading1.value = true
addLedger(deviceData).then((res: any) => {
loading1.value = false
ElMessage({
type: 'success',
message: '新增设备成功'
@@ -2473,6 +2504,8 @@ const submitData = () => {
} else {
TerminalRef.value.info()
}
}).finally(() => {
loading1.value = false
})
break
case 3: // 新增监测点
@@ -2528,7 +2561,9 @@ const submitData = () => {
]
}
loading1.value = true
addLedger(lineData).then((res: any) => {
loading1.value = false
ElMessage({
type: 'success',
message: '新增监测点成功'
@@ -2547,6 +2582,8 @@ const submitData = () => {
} else {
TerminalRef.value.info()
}
}).finally(() => {
loading1.value = false
})
break
}
@@ -2702,7 +2739,7 @@ const handleLineTabsEdit = (targetName: any, action: any) => {
// 新增监测点
formData.value.lineInfoList.push({
name: '',
lineNo: 1,
lineNo: '',
conType: 0,
lineInterval: 1,
ptRatio: 1,
@@ -3070,4 +3107,7 @@ area()
height: 60px;
line-height: 60px;
}
:deep(.el-tabs--top ){
width: 100%;
}
</style>

View File

@@ -32,7 +32,7 @@ height.value = window.innerHeight < 1080 ? 230 : 450
const tableStore: any = new TableStore({
url: '',
// publicHeight: height.value,
showPage: false,
column: [
{ width: '60', type: 'checkbox', fixed: 'left' },
@@ -94,7 +94,7 @@ const open = (val: any) => {
dialogVisible.value = true
tableData.value = val
setTimeout(() => {
tableStore.index()
// tableStore.index()
}, 10)
}
const close = () => {

View File

@@ -693,12 +693,12 @@ const lineId: any = ref('')
const dataLevel: any = ref('')
const dataSource = ref([])
const engineeringName = ref('')
const devConType = ref('')
const nodeClick = async (e: anyObj, node?: any) => {
console.log("🚀 ~ nodeClick ~ node:", e)
if (e == undefined) {
return (loading.value = false)
}
if (e.pname?.includes('便携')) {
if (e?.pname.includes('便携')) {
deviceType.value = '1'
} else {
deviceType.value = '2'
@@ -1140,6 +1140,7 @@ const handleClick = async (tab?: any) => {
devId: deviceId.value, //e.id
lineId: lineId.value, //e.pid
engineeringName: engineeringName.value, //e.name
lineName: (TrendList.value as any)?.name || devData.value?.name,
type: 3,
list: [
{
@@ -1391,7 +1392,11 @@ const downloadTxt = () => {
URL.revokeObjectURL(url)
}
onMounted(() => { })
onMounted(() => {
setTimeout(() => {
loading.value=false
}, 3000)
})
onBeforeUnmount(() => {
clearInterval(realDataTimer.value)
clearInterval(trendTimer.value)

View File

@@ -381,7 +381,6 @@ const changeDataType = () => {
? list.value[activeTab.value]?.modOutList.map(k => (k.data == 3.14159 ? 0 : k.data))
: [0]
let [modOuMin, modOuMax] = yMethod([...data1||[0], ...data2||[0]])
console.log("🚀 ~ changeDataType ~ modOuMin:", modOuMin,modOuMax)
echartsData.value.yAxis[0] = {
name: 'A',
@@ -396,7 +395,7 @@ const changeDataType = () => {
{
name: 'A相负载电流',
type: 'line',
data: list.value[activeTab.value].loadList
data: list.value[activeTab.value]?.loadList
.filter((k: any) => k.phasicType == 'A')
.map((k: any) => [k.time, k.data == 3.14159 ? null : k.data, 'A', lineStyle[0].type]),
smooth: true, //让线变得平滑
@@ -408,7 +407,7 @@ const changeDataType = () => {
{
name: 'B相负载电流',
type: 'line',
data: list.value[activeTab.value].loadList
data: list.value[activeTab.value]?.loadList
.filter((k: any) => k.phasicType == 'B')
.map((k: any) => [k.time, k.data == 3.14159 ? null : k.data, 'A', lineStyle[0].type]),
smooth: true, //让线变得平滑
@@ -420,7 +419,7 @@ const changeDataType = () => {
{
name: 'C相负载电流',
type: 'line',
data: list.value[activeTab.value].loadList
data: list.value[activeTab.value]?.loadList
.filter((k: any) => k.phasicType == 'C')
.map((k: any) => [k.time, k.data == 3.14159 ? null : k.data, 'A', lineStyle[0].type]),
smooth: true, //让线变得平滑

View File

@@ -81,8 +81,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="resetForm"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
<el-button @click="resetForm">取消</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading"></el-button>
</template>
</el-dialog>
@@ -116,7 +116,7 @@ import { fullUrl } from '@/utils/common'
defineOptions({
name: 'govern/log/debug'
})
const loading = ref(false)
const devTypeOptions: any = ref([])
const deivce: any = ref({})
const ruleFormRef = ref()
@@ -510,17 +510,22 @@ const add = () => {
const onSubmit = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
loading.value = true
if (dialogTitle.value == '新增设备') {
addEquipmentDelivery(form).then(res => {
ElMessage.success('新增成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading.value = false
})
} else {
editEquipmentDelivery(form).then(res => {
ElMessage.success('修改成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading.value = false
})
}
}

View File

@@ -254,6 +254,11 @@ const tableStore: any = new TableStore({
tableStore.table.params.list = tableParams.value.list
tableStore.table.params.type = 3
},
exportProcessingData: () => {
tableStore.table.allData?.forEach((row: any) => {
row.lineName = row.lineName || tableParams.value.lineName || '/'
})
},
loadCallback: () => { }
})
Object.assign(tableStore.table.params, {
@@ -283,6 +288,7 @@ const isWaveCharts = ref(false)
const getTableParams = (val: any) => {
tableParams.value = val
isWaveCharts.value = false
tableStore.exportName = { subject: val.lineName, feature: '暂态事件' }
tableStore.index()
}
const onFilterConfirm = () => {

View File

@@ -199,6 +199,23 @@ const init = () => {
}
}
},
dataZoom: [
{
type: 'inside',
height: 13,
start: 70,
bottom: '20px',
end: 100,
filterMode: 'none'
},
{
start: 0,
height: 13,
bottom: '20px',
end: 100,
filterMode: 'none'
}],
series: buildColoredStepSeries(list.value)
}
}

View File

@@ -5,7 +5,7 @@
<TableHeader ref="tableHeaderRef" :showSearch="false" @selectChange="selectChange">
<template v-slot:select>
<el-form-item>
<DatePicker ref="datePickerRef" :timeKeyList="[ '3', '4', '5']"></DatePicker>
<DatePicker ref="datePickerRef" :timeKeyList="['3', '4', '5']"></DatePicker>
</el-form-item>
<el-form-item label="统计指标" label-width="80px">
<el-select style="width: 200px" multiple :multiple-limit="3" collapse-tags filterable
@@ -331,7 +331,7 @@ const setEchart = () => {
itemStyle: { opacity: 0 }, //去圆点
type: 'scroll', // 开启滚动分页
// orient: 'vertical', // 垂直排列
// width: 550,
// height: 50
},
@@ -503,7 +503,8 @@ const setEchart = () => {
echartsData.value.options.series.push({
name: kk[0].phase ? kk[0].phase + '相' + kk[0].anotherName : kk[0].anotherName,
type: 'line',
smooth: true,
smooth: true,
color:
colorName == 'A' ? '#DAA520' : colorName == 'B' ? '#2E8B57' : colorName == 'C' ? '#A52a2a' : '',
symbol: 'none',
@@ -538,6 +539,7 @@ const selectChange = (flag: boolean) => {
pageHeight.value = mainHeight(290)
}
}
//导出
const historyChart = ref()
// const chart: any = ref(null)

View File

@@ -26,7 +26,7 @@
<template #footer>
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm">
<el-button type="primary" @click="handleConfirm" :loading="loading">
确定
</el-button>
</template>
@@ -53,6 +53,7 @@ const height = mainHeight(295).height
const dataList = ref([])
const key: any = ref(0)
const ruleFormRef = ref()
const loading = ref(false)
const adminInfo = useAdminInfo()
const showButtom = ref(adminInfo.roleCode.includes('operation_manager') || adminInfo.roleCode.includes('root'))
const dialogVisible = ref(false)
@@ -111,14 +112,18 @@ const handleClose = () => {
const handleConfirm = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
loading.value = true
let data = betweenDay(new Date(form.proStartTime), new Date(form.proEndTime))
if (data < 0) {
loading.value = false
ElMessage.warning('数据结束时间不能小于数据起始时间')
} else {
updateRecordData(form).then((res) => {
ElMessage.success(res.message)
dialogVisible.value = false
emit('onSubmit')
}).finally(() => {
loading.value = false
})
}
}

View File

@@ -63,8 +63,8 @@
</vxe-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addMarketData"> </el-button>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="addMarketData" :loading="loading1"></el-button>
</span>
</template>
</el-dialog>
@@ -84,7 +84,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
const pageHeight = mainHeight(60)
const loading = ref(false)
const loading1 = ref(false)
const tableHeight = mainHeight(173)
const user: any = ref({})
const tableData = ref([])
@@ -145,10 +145,13 @@ const addMarketData = () => {
userId: user.value.id
})
})
loading1.value = true
add(form).then((res: any) => {
ElMessage.success(res.message)
selectUser(user.value)
dialogVisible.value = false
}).finally(() => {
loading1.value = false
})
}
</script>

View File

@@ -136,7 +136,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submitDeviceDir">确定</el-button>
<el-button type="primary" @click="submitDeviceDir" :loading="loading1">确定</el-button>
</div>
</template>
</el-dialog>
@@ -174,6 +174,7 @@ const pageHeight = mainHeight(20)
const tableHeight = mainHeight(130)
const adminInfo = useAdminInfo()
const loading = ref(false)
const loading1 = ref(false)
//nDid
const nDid = ref<string>('')
const devId = ref<string>('')
@@ -502,6 +503,7 @@ const reloadCurrentMenu = (msg: string) => {
const submitDeviceDir = () => {
formRef.value.validate((valid: any) => {
if (valid) {
loading1.value = true
if (devConType.value == 'CLD') {
let obj = {
devId: devId.value,
@@ -516,6 +518,8 @@ const submitDeviceDir = () => {
reloadCurrentMenu(res.message)
addDeviceDirOpen.value = false
}
}).finally(() => {
loading1.value = false
})
} else {
let obj = {
@@ -531,6 +535,8 @@ const submitDeviceDir = () => {
reloadCurrentMenu(res.message)
addDeviceDirOpen.value = false
}
}).finally(() => {
loading1.value = false
})
}
}

View File

@@ -144,7 +144,6 @@ const handleDownLoad = () => {
}
})
.catch(e => {
console.log(e, '0000000')
if (e) {
downLoading.value = false
}

View File

@@ -42,8 +42,8 @@
</el-tree>
</div>
<template #footer="">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</template>
</el-dialog>
</template>

View File

@@ -126,8 +126,8 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addData"> </el-button>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="addData" :loading="loading1"></el-button>
</span>
</template>
</el-dialog>
@@ -156,7 +156,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
const pageHeight = mainHeight(60)
const pageHeight1 = mainHeight(125)
const loading = ref(false)
const loading1 = ref(false)
const user: any = ref({})
const tableData = ref([])
const deviceTableData = ref([]) // 设备表格数据
@@ -291,12 +291,14 @@ const addData = () => {
selectedDevices.forEach((item: any) => {
form.portableDevList.push(item.id)
})
loading1.value = true
// 发送请求
add(form).then((res: any) => {
ElMessage.success(res.message)
selectUser(user.value)
dialogVisible.value = false
}).finally(() => {
loading1.value = false
})
}
const treeRef = ref()

View File

@@ -96,8 +96,8 @@
</el-tab-pane>
</el-tabs>
<template #footer="">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</template>
</el-dialog>
</template>

View File

@@ -153,12 +153,12 @@ const tableStore = new TableStore({
isWaveCharts.value = true
row.loading1 = false
if (res != undefined) {
boxoList.value = {
...row,
featureAmplitude:
row.featureAmplitude != '-' ? (row.featureAmplitude - 0) / 100 : null,
systemType: 'YPT',
}
boxoList.value = {
...row,
featureAmplitude:
row.featureAmplitude != '-' ? (row.featureAmplitude - 0) / 100 : null,
systemType: 'YPT',
}
wp.value = res.data
@@ -225,7 +225,7 @@ const tableStore = new TableStore({
render: 'basicButton',
disabled: row => {
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
return !(code == 'Direct_Connected_Device' || code == 'Gateway')
return !((code == 'Direct_Connected_Device' || code == 'Gateway') && row.wavePath == null)
},
},
@@ -237,7 +237,8 @@ const tableStore = new TableStore({
render: 'basicButton',
loading: 'loading2',
disabled: row => {
return row.wavePath
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code
return !((code == 'Portable' || code == 'DEV_CLD') && row.wavePath == null)
},
click: row => {
let code = DeviceType.value.filter((item: any) => item.id == row.devType)[0]?.code

File diff suppressed because it is too large Load Diff

View File

@@ -30,7 +30,6 @@ const tableData = ref([])
const treeRef = ref(null)
const ignoreCheckChange = ref(false)
const checkChange = (data: any) => {
console.log("🚀 ~ checkChange ~ data:", data)
if (data == undefined) return (loading.value = false)
if (data.data.pName == '便携式设备') {
if (ignoreCheckChange.value) {

View File

@@ -248,7 +248,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click=";(dialogVisible = false), emit('close')">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -263,6 +263,7 @@ import { addCsDictData, updateCsDictData } from '@/api/system-boot/csDictData'
const emit = defineEmits(['close'])
const formRef = ref()
const formRef2 = ref()
const loading = ref(false)
const dictData = useDictData()
const DataSelect = dictData.getBasicData('Data')
const DataTypeSelect = dictData.getBasicData('Cs_Data_Type')
@@ -406,6 +407,7 @@ const open = (text: string, data?: anyObj) => {
const submit = async () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
loading.value = true
form.harmStart = form.harm[0]
form.harmEnd = form.harm[1]
if (form.id) {
@@ -417,6 +419,7 @@ const submit = async () => {
tableStore.index()
dialogVisible.value = false
emit('close')
loading.value = false
}
})
}

View File

@@ -58,7 +58,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -80,6 +80,7 @@ const devModelOptions: any = ref([])
const fileList: any = ref([])
const tableStore = inject('tableStore') as TableStore
const formRef = ref()
const loading = ref(false)
const form = reactive<any>({
devType: null,
devTypeName: null,
@@ -219,10 +220,12 @@ const submit = () => {
formRef.value.validate(async (valid: boolean) => {
// console.log(valid)
if (valid) {
if (fileList.value.length == 0) {
ElMessage.warning('请上传升级文件')
return
}
loading.value = true
let submitForm = new FormData()
for (let key in form) {
submitForm.append(key, form[key])
@@ -236,6 +239,7 @@ const submit = () => {
tableStore.index()
dialogVisible.value = false
emit('closePopup')
loading.value = false
}
})
}

View File

@@ -48,7 +48,7 @@ import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
import { Plus } from '@element-plus/icons-vue'
import { addDevModel } from '@/api/access-boot/analyzeModel'
import { AuditDevModel } from '@/api/cs-device-boot/devmodel'
import { getFileUrl, downLoadFile } from '@/api/cs-system-boot/manage'
import { downLoadFile } from '@/api/cs-system-boot/manage'
defineOptions({
name: 'govern/manage/basic/template'
})

View File

@@ -40,8 +40,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="handleCancel"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading"></el-button>
</template>
</el-dialog>
</template>
@@ -74,7 +74,7 @@ const visible = defineModel<boolean>('visible', { default: false })
const dialogTitle = ref('新增设备')
const ruleFormRef = ref()
const form: any = reactive(getDefaultForm())
const loading = ref(false)
const cascaderProps = {
label: 'projectName',
value: 'projectId',
@@ -236,11 +236,12 @@ const addProject = () => {
const onSubmit = () => {
ruleFormRef.value.validate((valid: boolean) => {
if (!valid) return
loading.value = true
const payload = buildSubmitPayload()
if (dialogTitle.value === '新增设备') {
addEquipmentDelivery(payload).then(res => {
ElMessage.success('新增成功')
const devType = props.devTypeOptions.find((item: any) => item.value == payload.devType)
if (devType?.code === 'Portable') {
@@ -250,19 +251,27 @@ const onSubmit = () => {
portableDeviceRegister({ nDid: res.data.ndid })
.then(pres => {
ElMessage.success(pres.message)
})
.catch(() => {
})
.catch(() => { })
}
resetForm()
emit('success')
}).finally(() => {
loading.value = false
})
} else {
editEquipmentDelivery(payload).then(() => {
ElMessage.success('修改成功')
resetForm()
emit('success')
}).finally(() => {
loading.value = false
})
}
})
}

View File

@@ -1,15 +1,8 @@
<template>
<div class="default-main" :style="{ height: pageHeight.height }">
<vxe-table
v-loading="tableStore.table.loading"
height="auto"
auto-resize
ref="tableRef"
v-bind="defaultAttribute"
:data="tableStore.table.data"
:column-config="{ resizable: true }"
:tree-config="{ expandAll: true }"
>
<vxe-table v-loading="tableStore.table.loading" height="auto" auto-resize ref="tableRef"
v-bind="defaultAttribute" :data="tableStore.table.data" :column-config="{ resizable: true }"
:tree-config="{ expandAll: true }">
<vxe-column field="name" align="left" title="名称" tree-node></vxe-column>
<vxe-column field="area" title="区域">
<template #default="{ row }">
@@ -25,12 +18,7 @@
<template #default="{ row }">
<el-button type="primary" link @click="edit(row)" v-if="!row.path">编辑</el-button>
<el-popconfirm
title="确定删除吗?"
confirm-button-type="danger"
@confirm="deletes(row)"
v-if="!row.path"
>
<el-popconfirm title="确定删除吗?" confirm-button-type="danger" @confirm="deletes(row)" v-if="!row.path">
<template #reference>
<el-button type="danger" link>删除</el-button>
</template>
@@ -42,30 +30,23 @@
<el-dialog v-model="dialogVisible" title="编辑" width="500">
<el-form :model="form" ref="ruleFormRef" label-width="80px" :rules="rules">
<el-form-item label="名称" prop="name">
<el-input maxlength="32" show-word-limit v-model="form.name" clearable placeholder="请输入名称" />
<el-input maxlength="32" show-word-limit v-model="form.name" clearable placeholder="请输入名称" />
</el-form-item>
<el-form-item label="区域" :prop="form.pid == '0' ? 'city' : 'area'">
<!-- <el-input maxlength="32" show-word-limit v-model="form.city" clearable placeholder="请输入区域" /> -->
<el-cascader
v-model="form.city"
v-if="form.pid == '0'"
style="width: 100%"
:options="areaTree"
:props="props"
clearable
filterable
placeholder="请输入区域"
/>
<el-input maxlength="32" show-word-limit v-else v-model="form.area" clearable placeholder="请输入区域" />
<el-cascader v-model="form.city" v-if="form.pid == '0'" style="width: 100%" :options="areaTree"
:props="props" clearable filterable placeholder="请输入区域" />
<el-input maxlength="32" show-word-limit v-else v-model="form.area" clearable placeholder="请输入区域" />
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input maxlength="300" show-word-limit v-model="form.description" :rows="2" type="textarea" clearable placeholder="请输入备注" />
<el-input maxlength="300" show-word-limit v-model="form.description" :rows="2" type="textarea"
clearable placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="save">保存</el-button>
<el-button type="primary" @click="save" :loading="loading">确定</el-button>
</div>
</template>
</el-dialog>
@@ -88,6 +69,7 @@ const dictData = useDictData()
const tableRef = ref()
const dialogVisible = ref(false)
const pageHeight = mainHeight(20)
const loading = ref(false)
const tableStore = new TableStore({
url: '/cs-device-boot/csLedger/getProjectTree',
method: 'POST',
@@ -177,14 +159,17 @@ const edit = (row: any) => {
const save = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
loading.value = true
if (form.value.pid == '0') {
auditEngineering({ ...form.value, city: form.value.city[form.value.city.length - 1] }).then(
(res: any) => {
ElMessage.success('保存成功')
dialogVisible.value = false
tableStore.index()
}).finally(() => {
loading.value = false
}
)
)
} else {
let params = new FormData()
params.append('id', form.value.id)
@@ -196,6 +181,8 @@ const save = () => {
ElMessage.success('保存成功')
dialogVisible.value = false
tableStore.index()
}).finally(() => {
loading.value = false
})
}
}

View File

@@ -3,7 +3,7 @@
<div style="height: 300px;overflow-y: auto;">
<el-form :inline="false" ref="formRef" :model="form" label-width="auto" class="form-one" :rules="rules">
<el-form-item label="项目名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入项目名称" />
<el-input maxlength="50" show-word-limit v-model.trim="form.name" placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="所属工程" prop="engineeringId">
<el-select v-model="form.engineeringId" filterable placeholder="请选择工程" clearable>
@@ -12,7 +12,7 @@
</el-select>
</el-form-item>
<el-form-item label="区域" prop="area">
<el-input maxlength="32" show-word-limit v-model="form.area" clearable placeholder="请输入区域" />
<el-input maxlength="32" show-word-limit v-model="form.area" clearable placeholder="例: 南京市江宁区蓝霞路201号" />
</el-form-item>
<el-form-item label="备注" prop="description">
<el-input maxlength="300" show-word-limit v-model="form.description" :rows="2" type="textarea"
@@ -49,7 +49,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -63,10 +63,11 @@ import { add, update } from '@/api/user-boot/role'
import { useAdminInfo } from '@/stores/adminInfo'
import { addProject, updateProjects } from '@/api/cs-device-boot/edData'
import { getTopoTemplate } from '@/api/cs-device-boot/topologyTemplate'
import { getFileUrl } from '@/api/system-boot/file'
import { Check } from '@element-plus/icons-vue'
import { downLoadFile } from '@/api/cs-system-boot/manage'
const adminInfo = useAdminInfo()
const tableStore = inject('tableStore') as TableStore
const loading = ref(false)
// do not use same name with ref
const form = reactive({
name: '',
@@ -114,7 +115,7 @@ const open = (text: string, List: any, data?: anyObj, id?: string) => {
form.name = ''
form.area = ''
form.description = ''
form.engineeringId = ''
form.engineeringId = id || ''
form.topoIds = ''
form.sort = 100
}
@@ -125,6 +126,7 @@ const submit = async () => {
}
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
await updateProjects({ ...form, topoIds: [form.topoIds] })
} else {
@@ -133,6 +135,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}
@@ -141,8 +144,10 @@ const getImageList = async () => {
getTopoTemplate().then(res => {
images.value = res.data
images.value.forEach(async item => {
let row = await getFileUrl({ filePath: item.filePath })
item.url = row.data
const blob = (await downLoadFile(item.filePath)) as unknown as Blob
if (blob?.type && blob.type !== 'application/json') {
item.url = window.URL.createObjectURL(blob)
}
})
})
}

View File

@@ -2,7 +2,7 @@
<el-dialog draggable class="cn-operate-dialog" width="500px" v-model.trim="dialogVisible" :title="title">
<el-form :inline="false" ref="formRef" :model="form" label-width="auto" class="form-one" :rules="rules">
<el-form-item label="工程名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" placeholder="请输入工程名称" />
<el-input maxlength="50" show-word-limit v-model.trim="form.name" placeholder="请输入工程名称" />
</el-form-item>
<el-form-item label="区域" prop="city">
<el-cascader
@@ -26,7 +26,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -52,7 +52,7 @@ const form = reactive({
description: ''
})
const areaTree: any = tree
const loading = ref(false)
const rules = {
name: [{ required: true, message: '请输入工程名称', trigger: 'blur' }],
city: [{ required: true, message: '请输入区域', trigger: 'blur' }],
@@ -90,6 +90,7 @@ const open = (text: string, data?: anyObj) => {
const submit = async () => {
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
await updateEngineering({ ...form, province: form.city[0], city: form.city[1] || '' })
} else {
@@ -98,6 +99,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -1,274 +1,244 @@
<template>
<div class="default-main">
<el-row v-loading="tableStore.table.loading">
<el-col :span="11">
<div class="custom-table-header">
<div class="title">
工程列表
<el-input maxlength="32" show-word-limit
class="ml10"
v-model="searchValue"
placeholder="请输入工程名称"
clearable
style="width: 240px"
@input="inpChaange"
/>
</div>
<el-button :icon="Plus" type="primary" @click="addRole" class="ml10">新增工程</el-button>
</div>
<Table ref="tableRef" @currentChange="currentChange" />
</el-col>
<el-col :span="13">
<div class="custom-table-header">
<div class="title">項目列表</div>
<el-button type="primary" icon="el-icon-Plus" @click="add">新增項目</el-button>
</div>
<div :style="height">
<vxe-table
ref="tableRef1"
v-bind="defaultAttribute"
:data="itemList"
height="auto"
style="width: 100%"
>
<vxe-column field="projectName" title="项目名称" minWidth="140px"></vxe-column>
<vxe-column field="projectArea" title="地址" minWidth="100px"></vxe-column>
<vxe-column field="projectRemark" title="备注" minWidth="100px"></vxe-column>
<vxe-column title="拓扑图" width="100px">
<template #default="{ row }">
<el-image
:hide-on-click-modal="true"
:preview-teleported="true"
v-if="row.topologyInfo"
:preview-src-list="[row.topologyImageUrl]"
:src="row.topologyImageUrl"
></el-image>
<span v-else>/</span>
</template>
</vxe-column>
<vxe-column field="projectSort" title="排序" width="80px"></vxe-column>
<vxe-column title="操作" width="130px">
<template #default="{ row }">
<el-button
style="margin-left: 4px"
type="primary"
link
size="small"
@click="itemModification(row)"
class="ml10 mr10"
>
编辑
</el-button>
<el-popconfirm
@confirm="itemeRemove(row)"
title="确定删除吗?"
confirm-button-type="danger"
>
<template #reference>
<el-button style="margin-left: 4px" type="danger" size="small" link>
刪除
</el-button>
</template>
</el-popconfirm>
</template>
</vxe-column>
</vxe-table>
</div>
</el-col>
</el-row>
<!-- 新增工程 -->
<popup ref="popupRef" @save="save" />
<!-- 新增項目 -->
<itemAdd ref="itemAddRef" @save="save" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import { Plus } from '@element-plus/icons-vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { delTemplate, deleteSysExcel, bandRelation, queryList } from '@/api/harmonic-boot/luckyexcel'
import { deleteProject, deleteEngineering } from '@/api/cs-device-boot/edData'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout'
import popup from './components/popup.vue'
import itemAdd from './components/itemAdd.vue'
const dictData = useDictData()
defineOptions({
name: 'govern/manage/engineering'
})
const height = mainHeight(80)
const volConTypeList: any = dictData.getBasicData('Dev_Connect')
import { getFileUrl } from '@/api/system-boot/file'
const popupRef = ref()
const tableRef = ref()
const tableRef1 = ref()
const searchValue = ref('')
const itemList: any = ref([])
const menuListId = ref([])
const itemAddRef = ref()
const engineeringId = ref('')
const tableList = ref([])
const tableStore: any = new TableStore({
url: '/cs-device-boot/engineeringProjectRelation/list',
method: 'POST',
publicHeight: 60,
showPage: false,
column: [
{ field: 'engineeringName', title: '工程名称' },
{
field: 'engineeringAreaName',
title: '区域'
},
{
field: 'engineeringRemark',
title: '备注'
},
{
field: 'engineeringSort',
title: '排序',
width: '80px'
},
{
title: '操作',
fixed: 'right',
width: '130',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
popupRef.value.open('编辑工程', row)
}
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
click: row => {
deleteEngineering({ id: row.engineeringId }).then(res => {
engineeringId.value = ''
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
loadCallback: () => {
tableList.value = JSON.parse(JSON.stringify(tableStore.table.data))
setTableRow()
}
})
provide('tableStore', tableStore)
// 过滤
const inpChaange = (val: any) => {
engineeringId.value = ''
if (val == '') {
tableStore.table.data = tableList.value
} else {
tableStore.table.data = tableList.value.filter((item: any) => item.engineeringName.includes(val))
}
setTableRow()
}
const setTableRow = () => {
if (engineeringId.value == '') {
engineeringId.value = tableStore.table.data[0].engineeringId
}
let list = tableStore.table.data.filter((item: any) => item.engineeringId == engineeringId.value)
tableRef.value.getRef().setCurrentRow(list[0] ?? {})
itemList.value = list?.[0]?.projectInfoList ?? []
if (itemList.value.length > 0) {
itemList.value.forEach((item: any) => {
item.topologyImageUrl = getUrl(item)
})
}
}
// 修改模版
const itemModification = (row: any) => {
itemAddRef.value.open('新增项目', tableStore.table.data, row, engineeringId.value)
}
// 删除模版
const itemeRemove = (row: any) => {
deleteProject({ id: row.projectId }).then(res => {
ElMessage.success('删除成功')
tableStore.index()
})
}
const addRole = () => {
// add()
popupRef.value.open('新增工程')
}
const add = () => {
itemAddRef.value.open('新增项目', tableStore.table.data)
}
// 查询绑定模版
const currentChange = (data: any) => {
engineeringId.value = data.row.engineeringId
itemList.value = data.row.projectInfoList
if (itemList.value.length > 0) {
itemList.value.forEach((item: any) => {
item.topologyImageUrl = getUrl(item)
})
}
}
// 保存模版
const save = () => {
bandRelation({
modelIds: tableRef1.value.getCheckboxRecords().map(item => item.id),
id: menuListId.value
})
.then(() => {
ElMessage.success('操作成功!')
})
.catch(() => {})
}
const imgList = ref([])
// 获取拓扑图
const getUrl = async (row: any) => {
if (!row.topologyInfo || row.topologyInfo === '/') return ''
const res = await getFileUrl({ filePath: row.topologyInfo })
row.topologyImageUrl = res.data
return res.data
}
onMounted(() => {
tableStore.index()
})
</script>
<style scoped>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.el-image {
height: 36px;
}
</style>
<template>
<div class="default-main">
<div class="custom-table-header">
<div>
关键字筛选
<el-input maxlength="32" show-word-limit class="ml10" v-model="searchValue" placeholder="请输入工程/项目名称"
clearable style="width: 240px" @input="inpChaange" />
</div>
<div style="margin-left: auto;">
<el-button :icon="Plus" type="primary" @click="addRole">新增工程</el-button>
<!-- <el-button type="primary" icon="el-icon-Plus" class="ml10" @click="add">新增项目</el-button> -->
</div>
</div>
<Table ref="tableRef" :tree-config="{ childrenField: 'children', rowField: 'id' }"
@current-change="currentChange">
<template #columns>
<vxe-column title="拓扑图" width="130">
<template #default="{ row }">
<template v-if="row.rowType === 'project'">
<el-image v-if="row.topologyInfo" :hide-on-click-modal="true" :preview-teleported="true"
:preview-src-list="[row.topologyImageUrl]" :src="row.topologyImageUrl" />
<span v-else>/</span>
</template>
<span v-else>/</span>
</template>
</vxe-column>
<vxe-column title="排序" field="sort" width="100"> </vxe-column>
</template>
</Table>
<popup ref="popupRef" />
<itemAdd ref="itemAddRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, nextTick } from 'vue'
import { Plus } from '@element-plus/icons-vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { deleteProject, deleteEngineering } from '@/api/cs-device-boot/edData'
import { ElMessage } from 'element-plus'
import popup from './components/popup.vue'
import itemAdd from './components/itemAdd.vue'
import { downLoadFile } from '@/api/cs-system-boot/manage'
defineOptions({
name: 'govern/manage/engineering'
})
const popupRef = ref()
const tableRef = ref()
const itemAddRef = ref()
const searchValue = ref('')
const rawList = ref<any[]>([])
const currentRow = ref<any>(null)
function buildTreeData(list: any[]) {
return list.map(eng => ({
...eng,
id: eng.engineeringId,
rowType: 'engineering',
name: eng.engineeringName,
area: eng.engineeringAreaName || '/',
remark: eng.engineeringRemark || '/',
sort: eng.engineeringSort,
children: (eng.projectInfoList || []).map((proj: any) => ({
...proj,
id: proj.projectId,
rowType: 'project',
name: proj.projectName,
area: proj.projectArea || '/',
remark: proj.projectRemark || '/',
sort: proj.projectSort,
engineeringId: eng.engineeringId
}))
}))
}
async function loadTopologyImages(treeData: any[]) {
for (const eng of treeData) {
for (const proj of eng.children || []) {
if (proj.topologyInfo && proj.topologyInfo !== '/') {
const blob = (await downLoadFile(proj.topologyInfo)) as unknown as Blob
if (blob?.type && blob.type !== 'application/json') {
proj.topologyImageUrl = window.URL.createObjectURL(blob)
}
}
}
}
}
function filterEngineeringList(list: any[], keyword: string) {
if (!keyword) return list
return list
.map(eng => {
const parentMatch = eng.engineeringName?.includes(keyword)
const matchedProjects = (eng.projectInfoList || []).filter((proj: any) =>
proj.projectName?.includes(keyword)
)
if (parentMatch) {
return eng
}
if (matchedProjects.length > 0) {
return { ...eng, projectInfoList: matchedProjects }
}
return null
})
.filter(Boolean)
}
function expandFirstTreeNode() {
nextTick(() => {
const treeInstance = tableRef.value?.getRef()
if (!treeInstance) return
treeInstance.setAllTreeExpand(false)
const firstNode = tableStore.table.data[0]
if (firstNode) {
treeInstance.setTreeExpand([firstNode], true)
treeInstance.setCurrentRow(firstNode)
currentRow.value = firstNode
}
})
}
function applyTreeData() {
const list = filterEngineeringList(rawList.value, searchValue.value)
tableStore.table.data = buildTreeData(list)
expandFirstTreeNode()
loadTopologyImages(tableStore.table.data)
}
const tableStore: any = new TableStore({
url: '/cs-device-boot/engineeringProjectRelation/list',
method: 'POST',
publicHeight: 60,
showPage: false,
column: [
{ field: 'name', title: '工程/项目名称', align: 'left', treeNode: true, minWidth: '250' },
{ field: 'area', title: '区域', minWidth: '180' },
{ field: 'remark', title: '备注', minWidth: '180' },
{
title: '操作',
fixed: 'right',
width: '220',
render: 'buttons',
buttons: [
{
title: '新增项目',
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
disabled: (row: any) => row.rowType !== 'engineering',
click: (row: any) => {
itemAddRef.value.open('新增项目', rawList.value, undefined, row.engineeringId)
}
},
{
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: (row: any) => {
if (row.rowType === 'engineering') {
popupRef.value.open('编辑工程', row)
} else {
itemAddRef.value.open('编辑项目', rawList.value, row, row.engineeringId)
}
}
},
{
title: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除吗?'
},
click: (row: any) => {
if (row.rowType === 'engineering') {
deleteEngineering({ id: row.engineeringId }).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
} else {
deleteProject({ id: row.projectId }).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
}
]
}
],
loadCallback: () => {
rawList.value = JSON.parse(JSON.stringify(tableStore.table.data))
applyTreeData()
}
})
provide('tableStore', tableStore)
const inpChaange = () => {
applyTreeData()
}
const currentChange = ({ row }: any) => {
currentRow.value = row
}
const addRole = () => {
popupRef.value.open('新增工程')
}
const add = () => {
const engineeringId =
currentRow.value?.rowType === 'engineering'
? currentRow.value.engineeringId
: currentRow.value?.rowType === 'project'
? currentRow.value.engineeringId
: ''
if (!engineeringId) {
ElMessage.warning('请先选择工程')
return
}
itemAddRef.value.open('新增项目', rawList.value, undefined, engineeringId)
}
onMounted(() => {
tableStore.index()
})
</script>
<style scoped>
.el-image {
height: 36px;
}
</style>

View File

@@ -35,7 +35,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -59,7 +59,7 @@ const pointList = ref<any[]>([])
const topoId = ref()
const imgUrl = ref('')
const linePosition = useDictData().getBasicData('Line_Position')
const loading = ref(false)
const dialogVisible = ref(false)
const open = (data: anyObj) => {
pointList.value = data.csLineTopologyTemplateVOList.map((item: any) => {
@@ -123,10 +123,13 @@ const submit = async () => {
topoId: topoId.value
}
})
loading.value = true
addLineTemplate(arr).then(res => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
}).finally(() => {
loading.value = false
})
}

View File

@@ -17,7 +17,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit" :loading="loading"></el-button>
<el-button type="primary" @click="submit" :loading="loading"></el-button>
</span>
</template>
</el-dialog>

View File

@@ -16,7 +16,7 @@ import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { Setting } from '@element-plus/icons-vue'
import { eventRecall, fileRecall, } from '@/api/cs-device-boot/recall'
import { eventRecall, fileRecall, } from '@/api/cs-device-boot/recall'
import { ElMessage } from 'element-plus'
const props = defineProps({
@@ -39,42 +39,10 @@ const tableStore: any = new TableStore({
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'engineeringName',
title: '项目名称',
width: 100,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'projectName',
title: '工程名称',
width: 100,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'deviceName',
title: '设备名称',
width: 100,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'lineName',
title: '监测点名称',
width: 150,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'logTime',
title: '补召时间',
width: 150,
width: 160,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
@@ -82,27 +50,60 @@ const tableStore: any = new TableStore({
{
field: 'log',
title: '类型',
width: 80,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{
field: 'status',
title: '状态',
width: 90,
width: 120,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
// {
// field: 'status',
// title: '状态',
// width: 120,
// formatter: row => {
// return row.cellValue ? row.cellValue : '/'
// }
// },
{
field: 'result',
title: '结果',
minWidth: 200,
minWidth: 300,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
}
},
// {
// field: 'engineeringName',
// title: '项目名称',
// width: 150,
// formatter: row => {
// return row.cellValue ? row.cellValue : '/'
// }
// },
// {
// field: 'projectName',
// title: '工程名称',
// width: 150,
// formatter: row => {
// return row.cellValue ? row.cellValue : '/'
// }
// },
// {
// field: 'deviceName',
// title: '设备名称',
// width: 150,
// formatter: row => {
// return row.cellValue ? row.cellValue : '/'
// }
// },
// {
// field: 'lineName',
// title: '监测点名称',
// width: 150,
// formatter: row => {
// return row.cellValue ? row.cellValue : '/'
// }
// },
],
beforeSearchFun: () => {
if (!nodeClick.value || nodeClick.value.level !== 3) {
@@ -113,9 +114,9 @@ const tableStore: any = new TableStore({
tableStore.table.params.searchValue = nodeClick.value.id
}
},
loadCallback: () => {}
loadCallback: () => { }
})
tableStore.table.params.sortBy = 'event'
provide('tableStore', tableStore)
const nodeClick = ref(null)
@@ -126,10 +127,12 @@ const handleTreeNodeClick = (node: any) => {
// 判断当前节点是否为监测点层级
if (node) {
if (node.level !== 3) {
tableStore.table.loading = false
ElMessage.warning('请先选中监测点')
return
}
} else {
tableStore.table.loading = false
ElMessage.warning('请先选中监测点')
return
}
@@ -143,14 +146,20 @@ const recall1 = async () => {
return
}
let list = props.checkedNodes.filter((node: any) => node.devConType == 'MQTT')
if (list.length > 0) {
ElMessage.warning('通讯协议为MQTT的装置暂不支持补召,[' + list.map((node: any) => node.name).join(',') + ']')
return
}
await eventRecall({
startTime: tableStore.table.params.startTime,
endTime: tableStore.table.params.endTime,
lineList: props.checkedNodes.map((node: any) => node.id),
}).then((res: any) => {
ElMessage.success('补召事件成功')
tableStore.index()
ElMessage.success(res.message)
tableStore.index()
})
}
@@ -159,12 +168,19 @@ const recall2 = async () => {
ElMessage.warning('请先勾选监测点')
return
}
let list = props.checkedNodes.filter((node: any) => node.devConType == 'MQTT')
if (list.length > 0) {
ElMessage.warning('通讯协议为MQTT的装置暂不支持补召,[' + list.map((node: any) => node.name).join(',') + ']')
return
}
await fileRecall({
startTime: tableStore.table.params.startTime,
endTime: tableStore.table.params.endTime,
lineList: props.checkedNodes.map((node: any) => node.id)
}).then((res: any) => {
ElMessage.success('补召波形成功')
ElMessage.success(res.message)
})
}
@@ -172,6 +188,11 @@ const recall2 = async () => {
defineExpose({
handleTreeNodeClick
})
onMounted(() => {
setTimeout(() => {
tableStore.table.loading = false
}, 3000)
})
</script>
<style lang="scss" scoped>

View File

@@ -1,24 +1,25 @@
<template>
<div
class="default-main device-control"
:style="{ height: pageHeight.height }"
v-loading="loading"
style="position: relative"
>
<div class="default-main device-control" :style="{ height: pageHeight.height }" v-loading="loading"
style="position: relative">
<!-- @init="nodeClick" -->
<PointTree @node-click="nodeClick" @init="nodeClick" @checkChange="handleCheckedNodesChange"></PointTree>
<div class="device-control-right" >
<el-tabs type="border-card" class="mb10" @tab-click="handleClick" v-model="activeTab">
<el-tab-pane label="稳态补召" name="deviceInfo1">
<div style="height: calc(100vh - 205px)">
<div class="device-control-right">
<el-tabs type="border-card" class="mb10" @tab-click="handleClick" v-model="activeTab">
<el-tab-pane label="稳态补召" name="1" v-if="showTab">
<div style="height: calc(100vh - 205px)">
<SteadyRecall ref="steadyRef" :checked-nodes="checkedNodes"></SteadyRecall>
</div>
</el-tab-pane>
<el-tab-pane label="暂态补召" name="deviceInfo2">
<div style="height: calc(100vh - 205px)">
<el-tab-pane label="暂态补召" name="2" v-if="showTab">
<div style="height: calc(100vh - 205px)">
<Event ref="eventRef" :checked-nodes="checkedNodes"></Event>
</div>
</el-tab-pane>
<el-tab-pane label="补招日志" name="3" v-if="!showTab">
<div style="height: calc(100vh - 205px)">
<Log ref="logRef"></Log>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
@@ -31,20 +32,23 @@ import DatePicker from '@/components/form/datePicker/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { mainHeight } from '@/utils/layout'
import Event from './eventRecall.vue'
import Log from './log.vue'
import SteadyRecall from './steadyRecall.vue'
const showTab = ref(true)
const pageHeight = mainHeight(20)
const steadyRef = ref()
const eventRef = ref()
const loading = ref(false)
const activeTab = ref('deviceInfo1')
const activeTab = ref('1')
const checkedNodes = ref<any[]>([]) // 存储左侧树勾选的节点
const currentNode = ref<any>(null) // 存储当前点击的树节点
defineOptions({
name: '/cs-device-boot/monitorRecall'
name: 'cs-device-boot/monitorRecall'
})
const logRef = ref()
// 处理子组件传递的勾选节点变化
const handleCheckedNodesChange = (nodes: any[]) => {
checkedNodes.value = nodes
@@ -53,29 +57,42 @@ const handleCheckedNodesChange = (nodes: any[]) => {
// tab切换时的处理
const handleClick = (tab: any) => {
activeTab.value = tab.props.name
// tab切换时刷新对应组件的数据
nextTick(() => {
if (tab.props.name === 'deviceInfo1' && steadyRef.value) {
} else if (tab.props.name === 'deviceInfo2' && eventRef.value) {
// tab切换后触发查询
triggerEventRecallQuery()
}
// tab切换后触发查询
triggerEventRecallQuery()
})
}
const nodeClick = (node: any) => {
currentNode.value = node
// 只有在暂态补召页面时才触发查询
if (activeTab.value === 'deviceInfo2') {
if(node==undefined){
return
}
if (node?.pname.includes('便携')) {
activeTab.value = '3'
showTab.value = false
nextTick(() => {
logRef.value.open(node)
})
} else {
activeTab.value = '1'
showTab.value = true
currentNode.value = node
// 只有在暂态补召页面时才触发查询
triggerEventRecallQuery()
}
}
// 触发暂态补召查询
const triggerEventRecallQuery = () => {
nextTick(() => {
if (activeTab.value === 'deviceInfo2' && eventRef.value) {
if (activeTab.value === '1' && steadyRef.value) {
if (steadyRef.value.handleTreeNodeClick) {
steadyRef.value.handleTreeNodeClick(currentNode.value)
}
} else if (activeTab.value === '2' && eventRef.value) {
// 将当前点击的节点传递给暂态补召组件
if (eventRef.value.handleTreeNodeClick) {
@@ -168,7 +185,7 @@ const triggerEventRecallQuery = () => {
}
}
.device-control-right > div {
.device-control-right>div {
height: 100%;
}
</style>

View File

@@ -0,0 +1,193 @@
<!-- 补召日志 -->
<template>
<TableHeader date-picker :showReset="false">
<template #operation>
<el-button type="primary" icon="el-icon-Connection" @click="handleImport">
离线补召
</el-button>
<el-button type="primary" icon="el-icon-Monitor" @click="handleaddDevice">
在线补召
</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<popup ref="detailRef"></popup>
<!-- 离线数据导入组件 -->
<!-- <offLineDataImport ref="offLineDataImportRef"></offLineDataImport> -->
</template>
<script lang="ts" setup>
import { ref, onMounted, provide, onBeforeUnmount } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import offLineDataImport from '../offLineDataImport/index.vue'
import popup from '@/views/govern/device/control/analysisList/popup.vue'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'offLineDataImport'
})
const emit = defineEmits(['back'])
const height = ref(0)
height.value = window.innerHeight < 1080 ? 230 : 450
const detailRef: any = ref()
const lineId = ref('')
const deviceId = ref('')
const deviceData = ref({})
import {
getDeviceData,
} from '@/api/cs-device-boot/EquipmentDelivery'
const { push, options, currentRoute } = useRouter()
const tableStore: any = new TableStore({
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
publicHeight: 80,
method: 'POST',
column: [
// { width: '60', type: 'checkbox', fixed: 'left' },
{
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
field: 'projectName',
title: '工程名称',
minWidth: 170,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'successCount', title: '成功解析数', minWidth: 150 },
{ field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true },
{ field: 'endTime', title: '导入结束时间', minWidth: 170, sortable: true },
{
title: '解析状态',
field: 'status',
width: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'success',
2: 'danger',
3: 'primary'
},
replaceValue: {
0: '未解析',
1: '解析成功',
2: '解析失败',
3: '文件不存在'
}
// formatter: row => {
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
// },
},
{
title: '操作', fixed: 'right',
width: '100',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
// console.log(row.portableOfflLogList)
detailRef.value.open(row.portableOfflLogList)
}
}
]
}
],
beforeSearchFun: () => {
// tableStore.table.params.devId = tableParams.value.devId
// tableStore.table.params.lineId = tableParams.value.lineId
// tableStore.table.params.list = tableParams.value.list
// tableStore.table.params.type = 3
},
loadCallback: () => {
// tableStore.table.data=[]
tableStore.table.height = 400
// console.log(tableStore.table.publicHeight, 'tableStore.table.data')
}
})
provide('tableStore', tableStore)
//返回
const handleBack = () => {
emit('back')
}
const open = (row: any) => {
if (row) {
if (row.level !== 3) {
tableStore.table.loading = false
ElMessage.warning('请先选中监测点')
return
}
} else {
tableStore.table.loading = false
ElMessage.warning('请先选中监测点')
return
}
getDeviceData(row.level == 3 ? row.pid : row.id, 'history', row.level == 3 ? row.id : row.children[0].id)
.then((res: any) => {
deviceData.value = res.data
console.log("🚀 ~ open ~ deviceData.value:", deviceData.value)
})
lineId.value = row.id
// deviceData.value = row.deviceData
deviceId.value = row.pid
setTimeout(() => {
tableStore.index()
}, 10)
}
const updateViewportHeight = async () => {
// height.value = window.innerHeight;
height.value = window.innerHeight < 1080 ? 230 : 450
// tableStore.table.publicHeight = height.value
// await tableStore.index()
}
//设备补召
const handleaddDevice = () => {
push({
path: '/supplementaryRecruitment',
query: {
activeName: '0',
id: lineId.value,
ndid: deviceData.value?.ndid,
}
})
}
const offLineDataImportRef = ref()
const handleImport = () => {
//设备devId&监测点lineId带入组件
// offLineDataImportRef.value && offLineDataImportRef.value.open(deviceId.value, lineId.value)
push({
path: '/supplementaryRecruitment',
query: {
activeName: '1',
lineId: lineId.value,
deviceId: deviceId.value,
}
})
}
onMounted(() => {
updateViewportHeight() // 初始化视口高度
window.addEventListener('resize', updateViewportHeight) // 监听窗口大小变化
})
onBeforeUnmount(() => {
window.removeEventListener('resize', updateViewportHeight) // 移除监听
})
defineExpose({ open })
</script>
<style lang="scss" scoped></style>

View File

@@ -28,10 +28,10 @@ const tableParams: any = ref({})
const headerRef = ref()
const tableStore: any = new TableStore({
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
url: '/cs-device-boot/csTerminalReply/bzLogs',
publicHeight: 80,
method: 'POST',
exportName: '态补召',
exportName: '态补召',
column: [
{
title: '序号',
@@ -41,63 +41,92 @@ const tableStore: any = new TableStore({
}
},
{
field: 'projectName',
title: '工程名称',
minWidth: 170,
field: 'logTime',
title: '补召时间',
width: 160,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
{ field: 'successCount', title: '成功解析数', minWidth: 150 },
{ field: 'startTime', title: '导入开始时间', minWidth: 170, sortable: true },
{ field: 'endTime', title: '导入结束时间', minWidth: 170, sortable: true },
{
title: '解析状态',
field: 'status',
width: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'success',
2: 'danger',
3: 'primary'
},
replaceValue: {
0: '未解析',
1: '解析成功',
2: '解析失败',
3: '文件不存在'
field: 'log',
title: '类型',
width: 120,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
}
},
// {
// title: '操作',
// fixed: 'right',
// width: '100',
// render: 'buttons',
// buttons: [
// {
// name: 'edit',
// title: '详情',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// click: row => {}
// }
// ]
// }
// field: 'status',
// title: '状态',
// width: 120,
// formatter: row => {
// return row.cellValue ? row.cellValue : '/'
// }
// },
{
field: 'result',
title: '结果',
minWidth: 300,
formatter: row => {
return row.cellValue ? row.cellValue : '/'
}
},
],
beforeSearchFun: () => {},
loadCallback: () => {}
beforeSearchFun: () => {
if (!nodeClick.value || nodeClick.value.level !== 3) {
ElMessage.warning('请先选中监测点')
return // 阻止查询
}
if (nodeClick.value) {
tableStore.table.params.searchValue = nodeClick.value.id
}
},
loadCallback: () => { }
})
tableStore.table.params.sortBy = 'harmonic'
provide('tableStore', tableStore)
const nodeClick = ref(null)
// 处理父组件传递的树节点点击事件
const handleTreeNodeClick = (node: any) => {
nodeClick.value = node
if (tableStore && tableStore.index) {
// 判断当前节点是否为监测点层级
if (node) {
if (node.level !== 3) {
tableStore.table.loading = false
ElMessage.warning('请先选中监测点')
return
}
} else {
tableStore.table.loading = false
ElMessage.warning('请先选中监测点')
return
}
tableStore.index()
}
}
const exportTab = async () => {
// ElMessage.info('稳态补召功能暂未开发!')
if (!props.checkedNodes || props.checkedNodes.length === 0) {
ElMessage.warning('请先勾选监测点')
return
}
let list=props.checkedNodes.filter((node: any) => node.devConType == 'MQTT')
if(list.length > 0){
ElMessage.warning('通讯协议为MQTT的装置暂不支持补召,['+list.map((node: any) => node.name).join(',')+']')
return
}
await eventRecall({
startTime: tableStore.table.params.startTime,
@@ -105,22 +134,20 @@ const exportTab = async () => {
lineList: props.checkedNodes.map((node: any) => node.id),
bzType: 0
}).then((res: any) => {
ElMessage.success('补召成功')
ElMessage.success(res.message)
tableStore.index()
})
}
//获取请求参数
const getTableParams = (val: any) => {
tableParams.value = val
tableStore.index()
}
defineExpose({
getTableParams
handleTreeNodeClick
})
onMounted(() => {
tableStore.index()
setTimeout(() => {
tableStore.table.loading = false
}, 3000)
})
</script>

View File

@@ -58,8 +58,8 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="addFn">确定</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="addFn" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -83,6 +83,7 @@ const defaultProps = {
multiple: true,
expandTrigger: 'hover' as const
}
const loading = ref(false)
const form: any = reactive({
name: '',
projectIds: [],
@@ -95,17 +96,20 @@ const rules = {
projectIds: [{ required: true, message: '请选择工程项目', trigger: 'change' }],
orderBy: [{ required: true, message: '请输入排序', trigger: 'blur' }]
}
const addFn = () => {
console.log('🚀 ~ add ~ form:', form)
formRef.value.validate((valid: boolean) => {
if (valid) {
loading.value = true
if (title.value == '新增项目') {
add({ ...form, projectIds: form.scope == 1 ? ['WIRELESS_PROJECT_ID'] : form.projectIds }).then(
(res: any) => {
ElMessage.success('新增项目成功!')
dialogVisible.value = false
emit('submit')
}).finally(() => {
loading.value = false
}
)
} else {
@@ -114,6 +118,8 @@ const addFn = () => {
ElMessage.success('修改项目成功!')
dialogVisible.value = false
emit('submit')
}).finally(() => {
loading.value = false
}
)
}

View File

@@ -27,7 +27,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -49,6 +49,7 @@ const form = reactive({
sort: 100,
modelType: ''
})
const loading = ref(false)
const reportFormList = [
{
value: '1',
@@ -95,6 +96,7 @@ const open = (text: string, data?: anyObj) => {
const submit = async () => {
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
await updateSysExcel(form)
} else {
@@ -103,6 +105,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -1,91 +1,91 @@
<template>
<el-dialog draggable v-model.trim="dialogVisible" title="模板绑定" width="500px" :before-close="handleClose">
<el-tree default-expand-all show-checkbox node-key="id" :data="dataTree" :expand-on-click-node="false"
ref="tree" style="height: 440px; overflow-y: auto">
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ data.name }}</span>
<span>
<el-switch v-model.trim="data.activation" active-value="1" inactive-value="0"
:active-text="data.activation == 1 ? '激活 ' : '未激活'" />
</span>
</span>
</template>
</el-tree>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="bind">绑定</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
import { getDataByTempId, updateBindTemplate } from '@/api/harmonic-boot/luckyexcel'
const emit = defineEmits(['shutDown'])
const dictData = useDictData()
const dialogVisible = ref(false)
const keyarr: any = ref([])
const idarr: any = ref([])
const dataTree: any = ref([])
const area = ref(dictData.state.area)
const handleClose = () => {
dialogVisible.value = false
// emit('handleClose')
}
const open = (row: any) => {
dialogVisible.value = true
getDataByTempId({ id: row.id }).then(res => {
res.data.forEach(item => {
keyarr.value.push({
name: item.deptName,
id: item.deptId,
activation: item.activation
})
idarr.value.push({ id: item.deptId })
})
gettreeData(area.value, keyarr.value)
dataTree.value = area.value
})
}
//过滤数据
const gettreeData = (mdata, ids) => {
mdata.forEach(m => {
ids.forEach(n => {
if (m.id == n.id && n.activation == 1) {
m.activation = 1
} else {
m.activation = 0
}
})
if (m.children != null || m.children.length > 0) {
gettreeData(m.children, ids)
} else {
m.children = null
}
})
}
// 绑定
const bind = () => {
updateBindTemplate().then(res => {
// ElMessage.success('绑定成功')
})
}
defineExpose({ open })
</script>
<style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>
<template>
<el-dialog draggable v-model.trim="dialogVisible" title="模板绑定" width="500px" :before-close="handleClose">
<el-tree default-expand-all show-checkbox node-key="id" :data="dataTree" :expand-on-click-node="false"
ref="tree" style="height: 440px; overflow-y: auto">
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ data.name }}</span>
<span>
<el-switch v-model.trim="data.activation" active-value="1" inactive-value="0"
:active-text="data.activation == 1 ? '激活 ' : '未激活'" />
</span>
</span>
</template>
</el-tree>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="bind" >绑定</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
import { getDataByTempId, updateBindTemplate } from '@/api/harmonic-boot/luckyexcel'
const emit = defineEmits(['shutDown'])
const dictData = useDictData()
const dialogVisible = ref(false)
const keyarr: any = ref([])
const idarr: any = ref([])
const dataTree: any = ref([])
const area = ref(dictData.state.area)
const handleClose = () => {
dialogVisible.value = false
// emit('handleClose')
}
const open = (row: any) => {
dialogVisible.value = true
getDataByTempId({ id: row.id }).then(res => {
res.data.forEach(item => {
keyarr.value.push({
name: item.deptName,
id: item.deptId,
activation: item.activation
})
idarr.value.push({ id: item.deptId })
})
gettreeData(area.value, keyarr.value)
dataTree.value = area.value
})
}
//过滤数据
const gettreeData = (mdata, ids) => {
mdata.forEach(m => {
ids.forEach(n => {
if (m.id == n.id && n.activation == 1) {
m.activation = 1
} else {
m.activation = 0
}
})
if (m.children != null || m.children.length > 0) {
gettreeData(m.children, ids)
} else {
m.children = null
}
})
}
// 绑定
const bind = () => {
updateBindTemplate().then(res => {
// ElMessage.success('绑定成功')
})
}
defineExpose({ open })
</script>
<style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@@ -50,8 +50,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="preservation"> </el-button>
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="preservation">确定</el-button>
</template>
</el-dialog>
</template>

View File

@@ -1,6 +1,6 @@
<template>
<div class="default-main">
<div class="mb10" style="display: flex; justify-content: flex-end">
<div class="mb10 pt10" style="display: flex; justify-content: flex-end">
<el-upload
ref="upload"
action=""
@@ -29,7 +29,7 @@ import { ElMessage } from 'element-plus'
import { viewCustomReportTemplateById } from '@/api/harmonic-boot/luckyexcel'
const emit = defineEmits(['shutDown'])
const height = mainHeight(65).height
const height = mainHeight(75).height
const options: any = ref({
container: 'luckysheet',
title: '', // 表 头名

View File

@@ -1,14 +1,8 @@
<template>
<div class="default-main">
<div class="mb10" style="display: flex; justify-content: flex-end">
<el-upload
ref="upload"
action=""
:auto-upload="false"
:show-file-list="false"
:limit="1"
:on-change="beforeUpload"
>
<div class="mb10 pt10" style="display: flex; justify-content: flex-end">
<el-upload ref="upload" action="" :auto-upload="false" :show-file-list="false" :limit="1"
:on-change="beforeUpload">
<el-button icon="el-icon-Upload" type="primary" class="mr10">导入excel</el-button>
</el-upload>
<el-button @click="downloadExcel" class="" type="primary" icon="el-icon-Download">导出</el-button>
@@ -37,7 +31,7 @@ const emit = defineEmits(['shutDown'])
const formFer = ref()
const title = ref('')
const list = ref({})
const height = mainHeight(65).height
const height = mainHeight(75).height
const options: any = ref({
container: 'luckysheet',
title: '', // 表 头名
@@ -162,7 +156,7 @@ const open = async (text: string, row?: any) => {
info()
}
defineExpose({ open })
onMounted(() => {})
onMounted(() => { })
</script>
<style lang="scss" scoped>
:deep(.el-tab-pane) {

View File

@@ -43,7 +43,7 @@ const tableStore = new TableStore({
field: 'governType',
width: 120,
formatter: row => {
return row.cellValue == 'harmonic' ? '稳态' : '暂态'
return row.cellValue == 'harmonic' ? '稳态治理' : '暂态治理'
}
},
{ title: '治理方法', field: 'governMethod', width: 120 },

View File

@@ -7,8 +7,8 @@
</el-form-item>
<el-form-item label="治理类型" prop="governType">
<el-select v-model="form.governType" placeholder="请选择治理类型" style="width: 100%">
<el-option label="稳态" value="harmonic" />
<el-option label="暂态" value="event" />
<el-option label="稳态治理" value="harmonic" />
<el-option label="暂态治理" value="event" />
</el-select>
</el-form-item>
<el-form-item label="治理方法" prop="governMethod">
@@ -42,7 +42,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -65,6 +65,7 @@ const tableStore = inject('tableStore') as TableStore
const formRef = ref()
const dialogVisible = ref(false)
const title = ref('新增')
const loading = ref(false)
const lineTreeData = ref<any[]>([])
const filterNode = createTreeFilterNode()
/** 打开弹窗时传入的治理前/后监测点 id未变更时不做绑定冲突校验 */
@@ -240,6 +241,7 @@ const submit = () => {
governAfter: form.governAfter,
sort: form.sort
}
loading.value = true
if (form.id) {
await updateGovernPlan(payload)
} else {
@@ -248,6 +250,7 @@ const submit = () => {
ElMessage.success('操作成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
})
}

View File

@@ -32,7 +32,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -52,7 +52,7 @@ const dictData = useDictData()
const DataTypeSelect = dictData.getBasicData('Interference_Source')
const tableStore = inject('tableStore') as TableStore
const loading = ref(false)
const formRef = ref()
const form = reactive<any>({
loadType: [],
@@ -92,6 +92,7 @@ const open = (text: string, data?: anyObj) => {
const submit = () => {
formRef.value.validate(async (valid: boolean) => {
if (valid) {
loading.value = true
if (form.id) {
await updateUser(form)
} else {
@@ -100,6 +101,7 @@ const submit = () => {
ElMessage.success('操作成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -58,7 +58,7 @@
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
<el-button type="warning" size="small" @click="confirm"></el-button>
<el-button type="warning" size="small" @click="confirm"></el-button>
</template>
</el-popconfirm>
</template>
@@ -112,8 +112,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="resetForm"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
<el-button @click="resetForm">取消</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading1"></el-button>
</template>
</el-dialog>
@@ -138,8 +138,8 @@
</el-form>
<template #footer>
<el-button @click="popUps = false"> </el-button>
<el-button type="primary" @click="bindTheProcess"> </el-button>
<el-button @click="popUps = false">取消</el-button>
<el-button type="primary" @click="bindTheProcess" :loading="loading2"></el-button>
</template>
</el-dialog>
</div>
@@ -164,6 +164,7 @@ import {
defineOptions({
name: 'govern/setting/frontManagement'
})
const loading1 = ref(false)
const filterText = ref('')
const fontdveoption: any = ref([
{ id: 0, name: '极重要' },
@@ -236,7 +237,7 @@ const tableStore = new TableStore({
{ title: 'IP', field: 'ip', minWidth: '110' },
{
title: '最大监测点数量',
title: '最大终端数',
field: 'nodeDevNum',
minWidth: '80',
},
@@ -432,11 +433,12 @@ const handleNodeChange = (nodeId: any) => {
// 加载新选中前置机的进程号选项
loadProcessOptionsForNode(nodeId)
}
const loading2 = ref(false)
// 更新进程号
const bindTheProcess = () => {
bindProcessFormRef.value.validate((valid: any) => {
if (valid) {
loading2.value = true
updateProcess({
id: processId.value,
processNo: bindProcessForm.value.processNo,
@@ -445,6 +447,8 @@ const bindTheProcess = () => {
ElMessage.success('修改成功!')
popUps.value = false
currentChangeEvent()
}).finally(() => {
loading2.value = false
})
}
})
@@ -499,17 +503,22 @@ const add = () => {
const onSubmit = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
loading1.value = true
if (dialogTitle.value == '新增前置机') {
addNode(formData.value).then(res => {
ElMessage.success('新增前置机')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading1.value = false
})
} else {
updateNode(formData.value).then(res => {
ElMessage.success('修改成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading1.value = false
})
}
}

View File

@@ -24,7 +24,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -43,6 +43,7 @@ defineOptions({
name: 'govern/setting/statisticalType/add'
})
const tableStore = inject('tableStore') as TableStore
const loading = ref(false)
const form = reactive({
name: '',
code: '',
@@ -85,9 +86,12 @@ const submit = async () => {
// 非空校验
formRef.value.validate(async valid => {
if (valid) {
loading.value = true
if (form.id) {
await updateStatistical(form).then(res => {
ElMessage.success('编辑成功')
}).finally(() => {
loading.value = false
})
} else {
if (!form.pid) {
@@ -95,6 +99,8 @@ const submit = async () => {
}
await addDictTree(form).then(res => {
ElMessage.success('新增成功')
}).finally(() => {
loading.value = false
})
}
emits('over')

View File

@@ -75,7 +75,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="close">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -102,6 +102,7 @@ const fromData = ref<treeData[]>([])
const fromDataValue = ref<string[]>([])
const toData = ref<treeData[]>([])
const toDataValue = ref<string[]>([])
const loading = ref(false)
const init = (val: any) => {
queryStatistical(pid.value).then(res => {
if (val == 0) {
@@ -401,9 +402,12 @@ const submit = async () => {
if (one.ids.length) {
ids.push(one)
}
loading.value = true
addStatistical(ids).then(res => {
ElMessage.success('绑定指标成功')
dialogVisible.value = false
}).finally(() => {
loading.value = false
})
}
const close = () => {

View File

@@ -79,8 +79,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="resetForm"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
<el-button @click="resetForm">取消</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading"></el-button>
</template>
</el-dialog>
@@ -114,7 +114,7 @@ import { fullUrl } from '@/utils/common'
defineOptions({
name: 'govern/log/debug'
})
const loading = ref(false)
const devTypeOptions: any = ref([])
const deivce: any = ref({})
const ruleFormRef = ref()
@@ -344,17 +344,22 @@ const add = () => {
const onSubmit = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
loading.value = true
if (dialogTitle.value == '新增设备') {
addEquipmentDelivery(form).then(res => {
ElMessage.success('新增成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading.value = false
})
} else {
editEquipmentDelivery(form).then(res => {
ElMessage.success('修改成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading.value = false
})
}
}

View File

@@ -48,11 +48,11 @@
:before-close="resetForm" draggable width="40%">
<el-form :model="form" label-width="120px" :rules="rules" ref="ruleFormRef">
<el-form-item label="设备名称" prop="name">
<el-input maxlength="32" show-word-limit v-model.trim="form.name" autocomplete="off" clearable
<el-input maxlength="32" show-word-limit v-model.trim="form.name" autocomplete="off" clearable
placeholder="请输入(项目名称+设备名称)"></el-input>
</el-form-item>
<el-form-item label="网络设备ID" prop="ndid" class="top">
<el-input maxlength="32" show-word-limit v-model.trim="form.ndid" autocomplete="off"
<el-input maxlength="32" show-word-limit v-model.trim="form.ndid" autocomplete="off"
placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="设备类型" prop="devType" class="top">
@@ -75,13 +75,13 @@
</el-form-item>
<el-form-item label="合同号" prop="cntractNo" class="top">
<el-input maxlength="32" show-word-limit v-model.trim="form.cntractNo" autocomplete="off"
<el-input maxlength="32" show-word-limit v-model.trim="form.cntractNo" autocomplete="off"
placeholder="请输入"></el-input>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="resetForm"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
<el-button @click="resetForm">取消</el-button>
<el-button type="primary" @click="onSubmit" :loading="loading"></el-button>
</template>
</el-dialog>
@@ -115,6 +115,7 @@ import { fullUrl } from '@/utils/common'
defineOptions({
name: 'govern/log/debug'
})
const loading = ref(false)
const devTypeOptions: any = ref([])
const deivce: any = ref({})
@@ -345,17 +346,22 @@ const add = () => {
const onSubmit = () => {
ruleFormRef.value.validate((valid: any) => {
if (valid) {
loading.value = true
if (dialogTitle.value == '新增设备') {
addEquipmentDelivery(form).then(res => {
ElMessage.success('新增成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading.value = false
})
} else {
editEquipmentDelivery(form).then(res => {
ElMessage.success('修改成功')
resetForm()
tableStore.onTableAction('search', {})
}).finally(() => {
loading.value = false
})
}
}

View File

@@ -14,7 +14,7 @@
</div>
<div class="bottom-container">
<el-button type="primary" :icon="show ? 'el-icon-ArrowDownBold' : 'el-icon-ArrowUpBold'"
@click="show = !show" style="width: 100%" v-if="bindId">
@click="show = !show" style="width: 100%" >
事件列表
</el-button>
<!-- <el-button class="bindBut" type="primary" icon="el-icon-Sort" @click="bindClick">绑定</el-button> -->

View File

@@ -296,7 +296,6 @@ const tree2List = (list: any, id: any) => {
return arr
}
const changeTab = (e: any) => {
console.log('🚀 ~ changeTab ~ e:', e)
tableName1.value = treeComponents.filter(item => item.name == e)[0].children[0].name
}
// 删除拖拽
@@ -420,7 +419,6 @@ const onSubmit = () => {
return ElMessage.warning('页面设计不能为空!')
}
let repeat = findDuplicateNames(layout.value) || []
console.log('🚀 ~ onSubmit ~ layout.value:', layout.value)
if (repeat.length > 0) {
return ElMessage.warning(repeat.join('、') + ' 组件重复,请删除重复组件!')
}
@@ -548,7 +546,6 @@ onMounted(() => {
nextTick(() => {
GridHeight.value = PaneRef.value?.offsetHeight - 60 //wrapper.value?.offsetWidth / 1.77777
setTimeout(() => {
console.log('🚀 ~ wrapper.value?.offsetWidth:', PaneRef.value?.offsetWidth)
}, 500)
rowHeight.value = GridHeight.value / 6 - 11.5
document.documentElement.style.setProperty('--GridLayout-height', rowHeight.value + 10 + 'px')

View File

@@ -33,7 +33,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -52,6 +52,7 @@ const emit = defineEmits(['cancel', 'submit'])
const dialogVisible = ref(false)
const title = ref('')
const formRef = ref()
const loading = ref(false)
// 注意不要和表单ref的命名冲突
const form = ref<anyObj>({
name: '',
@@ -118,6 +119,7 @@ function deletePathNotNull(data: any) {
const submit = () => {
formRef.value.validate(async (valid: boolean) => {
if (valid) {
loading.value = true
if (title.value == '新增树') {
await componentAdd({
...form.value,
@@ -127,6 +129,8 @@ const submit = () => {
ElMessage.success('新增成功!')
emit('submit')
cancel()
}).finally(() => {
loading.value = false
})
} else {
await componentEdit({
@@ -137,6 +141,8 @@ const submit = () => {
ElMessage.success('修改成功!')
emit('submit')
cancel()
}).finally(() => {
loading.value = false
})
}
}

View File

@@ -190,7 +190,6 @@ const tableStore = new TableStore({
}
})
const changeTab = (e: any) => {
console.log('🚀 ~ changeTab ~ e:', e)
tableName1.value = tableStore.table.data.filter(item => item.name == e)[0].children[0].name
}
const tree2List = (list: any, id: any) => {

View File

@@ -118,7 +118,7 @@ const tableStore = new TableStore({
provide('tableStore', tableStore)
tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = 0
tableStore.table.params.searchState = ''
onMounted(() => {
tableStore.index()
})

View File

@@ -53,7 +53,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -73,6 +73,7 @@ defineOptions({
const adminInfo = useAdminInfo()
const tableStore = inject('tableStore') as TableStore
const formRef = ref()
const loading = ref(false)
// do not use same name with ref
const form = reactive({
algoDescribe: '',
@@ -128,6 +129,7 @@ const open = (text: string, data: anyObj) => {
}
const submit = async () => {
await formRef.value.validate()
loading.value = true
if (form.id) {
await dictDataUpdate(form)
} else {
@@ -136,6 +138,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
defineExpose({ open })

View File

@@ -36,7 +36,7 @@
<template #footer>
<span class='dialog-footer'>
<el-button @click='dialogVisible = false'>取消</el-button>
<el-button type='primary' @click='submit'></el-button>
<el-button type='primary' @click='submit' :loading="loading"></el-button>
</span>
</template>
</el-dialog>
@@ -51,6 +51,7 @@ import { dictTypeAdd, dictTypeUpdate } from '@/api/system-boot/dictType'
const adminInfo = useAdminInfo()
const tableStore = inject('tableStore') as TableStore
const loading = ref(false)
const OpenLevel = [
{ value: 0, label: '不开启' },
{ value: 1, label: '开启' }
@@ -96,6 +97,7 @@ const open = (text: string, data?: anyObj) => {
const submit = async () => {
formRef.value.validate(async (valid: boolean) => {
if (valid) {
loading.value = true
if (form.id) {
await dictTypeUpdate(form)
} else {
@@ -104,6 +106,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -1,16 +1,22 @@
<template>
<div class='default-main'>
<div class='custom-table-header'>
<div class="title">字典树列表</div>
<el-button :icon='Plus' type='primary' @click='addMenu'>新增字典类型</el-button>
<div>
关键字筛选
<el-input maxlength="32" show-word-limit class="ml10" v-model="searchValue" placeholder="请输入字典名称"
clearable style="width: 240px" @input="inpChaange" />
</div>
<div style="margin-left: auto;"> <el-button :icon='Plus' type='primary' @click='addMenu'>新增字典类型</el-button>
</div>
</div>
<Table ref='tableRef' />
<Table ref='tableRef' :tree-config="{ childrenField: 'children', rowField: 'id' }" />
<PopupForm ref='popupFormRef'></PopupForm>
</div>
</template>
<script setup lang='ts'>
import { Plus } from '@element-plus/icons-vue'
import { ref, onMounted, provide } from 'vue'
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { ElMessage } from 'element-plus'
@@ -20,10 +26,54 @@ import { dicDelete } from '@/api/system-boot/dic'
defineOptions({
name: 'setting/dictionary/tree'
})
const searchValue = ref('')
const rawList = ref<any[]>([])
const tableRef = ref()
const popupFormRef = ref()
/** 父级命中保留全部子级;仅子级命中则保留父级及匹配子级 */
function filterTreeByName(nodes: any[], keyword: string): any[] {
if (!keyword) return nodes
const result: any[] = []
nodes.forEach(node => {
const selfMatch = node.name?.includes(keyword)
if (selfMatch) {
result.push(node)
return
}
const filteredChildren = node.children?.length ? filterTreeByName(node.children, keyword) : []
if (filteredChildren.length > 0) {
result.push({ ...node, children: filteredChildren })
}
})
return result
}
function expandFirstTreeNode() {
nextTick(() => {
const treeInstance = tableRef.value?.getRef()
if (!treeInstance) return
treeInstance.setAllTreeExpand(false)
const firstNode = tableStore.table.data[0]
if (firstNode) {
treeInstance.setTreeExpand([firstNode], true)
treeInstance.setCurrentRow(firstNode)
}
})
}
function applyTreeData() {
tableStore.table.data = filterTreeByName(rawList.value, searchValue.value)
expandFirstTreeNode()
}
const inpChaange = () => {
applyTreeData()
}
const tableStore = new TableStore({
showPage:false,
showPage: false,
url: '/system-boot/dictTree/queryTree',
method: 'GET',
publicHeight: 60,
@@ -52,7 +102,7 @@ const tableStore = new TableStore({
title: '操作', fixed: 'right',
width: '180',
render: 'buttons',
buttons: [
{
title: '新增',
@@ -100,7 +150,11 @@ const tableStore = new TableStore({
}
]
}
]
],
loadCallback: () => {
rawList.value = JSON.parse(JSON.stringify(tableStore.table.data))
applyTreeData()
}
})
provide('tableStore', tableStore)

View File

@@ -1,7 +1,7 @@
<template>
<el-dialog class="cn-operate-dialog" width="500px" v-model.trim="dialogVisible" :title="title">
<el-scrollbar>
<el-form :inline="false" :model="form" ref="formRef" label-width="auto" :rules="rules">
<el-form :inline="false" :model="form" ref="formRef" label-width="auto" :rules="rules" class="form-one">
<el-form-item label="字典名称" prop="name">
<el-input maxlength="32" show-word-limit
@@ -44,7 +44,7 @@
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="primary" @click="submit" :loading="loading">确定</el-button>
</span>
</template>
</el-dialog>
@@ -59,6 +59,7 @@ import { dicAdd, dicUpdate } from '@/api/system-boot/dic'
const adminInfo = useAdminInfo()
const tableStore = inject('tableStore') as TableStore
const loading = ref(false)
// do not use same name with ref
const form = reactive({
name: '',
@@ -97,6 +98,7 @@ const open = (text: string, data?: anyObj) => {
const submit = async () => {
formRef.value.validate(async (valid: any) => {
if (valid) {
loading.value = true
if (form.id) {
await dicUpdate(form)
} else {
@@ -105,6 +107,7 @@ const submit = async () => {
ElMessage.success('保存成功')
tableStore.index()
dialogVisible.value = false
loading.value = false
}
})
}

View File

@@ -13,13 +13,13 @@
</TableHeader>
<Table ref="tableRef">
<template v-slot:columns>
<vxe-column field="androidPath" title="Android路径" width="250px"
<vxe-column field="androidPath" title="Android路径" minWidth="250px"
v-if="tableStore.table.params.versionType == 'APP'"></vxe-column>
<vxe-column field="iosPath" title="IOS路径" width="250px"
<vxe-column field="iosPath" title="IOS路径" minWidth="250px"
v-if="tableStore.table.params.versionType == 'APP'"></vxe-column>
</template>
</Table>
<el-dialog width="500px" v-model.trim="dialogVisible" title="新增版本">
<el-dialog width="500px" v-model.trim="dialogVisible" :title="dialogTitle">
<el-form :inline="false" :model="form" ref="formRef" label-width="auto" class="form-one" :rules="rules">
<el-form-item label="版本号" prop="appVersion">
<el-input maxlength="32" show-word-limit v-model.trim="form.appVersion" placeholder="请输入版本号" />
@@ -41,18 +41,17 @@
</el-select>
</el-form-item>
<el-form-item label="Android路径" prop="androidPath" v-if="form.versionType == 'APP'">
<el-input v-model.trim="form.androidPath"
placeholder="请输入Android路径" />
<el-input v-model.trim="form.androidPath" placeholder="请输入Android路径" />
</el-form-item>
<el-form-item label="IOS路径" prop="iosPath" v-if="form.versionType == 'APP'">
<el-input v-model.trim="form.iosPath" placeholder="请输入IOS路径" />
<el-input v-model.trim="form.iosPath" placeholder="请输入IOS路径" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="submit"></el-button>
<el-button type="primary" @click="submit"></el-button>
</span>
</template>
</el-dialog>
@@ -63,12 +62,14 @@ import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
import { addVersion } from '@/api/systerm'
import { addVersion, updateVersion, deleteVersion } from '@/api/systerm'
import router from '@/router/index'
const dialogVisible = ref(false)
const dialogTitle = ref('新增版本')
const isEdit = ref(false)
const form = ref({
id: '',
appVersion: '',
content: '',
versionType: '',
@@ -105,7 +106,45 @@ const tableStore = new TableStore({
},
width: '150'
},
{ title: '整改内容', field: 'content' }
{ title: '整改内容', field: 'content', minWidth: '250' },
{
title: '操作',
fixed: 'right',
align: 'center',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
editMenu(row)
}
},
// {
// name: 'del',
// title: '删除',
// type: 'danger',
// icon: 'el-icon-Delete',
// render: 'confirmButton',
// popconfirm: {
// confirmButtonText: '确认',
// cancelButtonText: '取消',
// confirmButtonType: 'danger',
// title: '确定删除版本信息吗?'
// },
// click: row => {
// deleteVersion({ id: row.id }).then(() => {
// ElMessage.success('删除成功')
// tableStore.index()
// })
// }
// }
]
}
],
beforeSearchFun: () => {
// console.log("🚀 ~ tableStore.table.params", tableStore.table)
@@ -127,21 +166,38 @@ onMounted(async () => {
})
const submit = async () => {
await formRef.value.validate()
console.log(123)
addVersion(form.value).then(res => {
ElMessage.success('新增成功')
const request = isEdit.value ? updateVersion(form.value) : addVersion(form.value)
request.then(() => {
ElMessage.success(isEdit.value ? '修改成功' : '新增成功')
tableStore.index()
dialogVisible.value = false
router.go(0)
if (!isEdit.value) {
router.go(0)
}
})
}
const addMenu = async () => {
const addMenu = () => {
isEdit.value = false
dialogTitle.value = '新增版本'
dialogVisible.value = true
form.value.appVersion = tableStore.table.data[0].versionName || ''
form.value.id = ''
form.value.appVersion = tableStore.table.data[0]?.versionName || ''
form.value.content = ''
form.value.iosPath = ''
form.value.androidPath = ''
form.value.sev = tableStore.table.data[0].sev || 0
form.value.versionType = tableStore.table.data[0].versionType || 'WEB'
form.value.sev = tableStore.table.data[0]?.sev ?? 0
form.value.versionType = tableStore.table.data[0]?.versionType || tableStore.table.params.versionType || 'WEB'
}
const editMenu = (row: any) => {
isEdit.value = true
dialogTitle.value = '编辑版本'
dialogVisible.value = true
form.value.id = row.id
form.value.appVersion = row.versionName || ''
form.value.content = row.content || ''
form.value.sev = row.sev ?? 0
form.value.versionType = row.versionType || 'WEB'
form.value.androidPath = row.androidPath || ''
form.value.iosPath = row.iosPath || ''
}
</script>

View File

@@ -1,91 +1,94 @@
<template>
<el-dialog draggable v-model.trim="dialogVisible" title="模板绑定" width="500px" :before-close="handleClose">
<el-tree default-expand-all show-checkbox node-key="id" :data="dataTree" :expand-on-click-node="false"
ref="tree" style="height: 440px; overflow-y: auto">
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ data.name }}</span>
<span>
<el-switch v-model.trim="data.activation" active-value="1" inactive-value="0"
:active-text="data.activation == 1 ? '激活 ' : '未激活'" />
</span>
</span>
</template>
</el-tree>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="bind">绑定</el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
import { getDataByTempId, updateBindTemplate } from '@/api/harmonic-boot/luckyexcel'
const emit = defineEmits(['shutDown'])
const dictData = useDictData()
const dialogVisible = ref(false)
const keyarr: any = ref([])
const idarr: any = ref([])
const dataTree: any = ref([])
const area = ref(dictData.state.area)
const handleClose = () => {
dialogVisible.value = false
// emit('handleClose')
}
const open = (row: any) => {
dialogVisible.value = true
getDataByTempId({ id: row.id }).then(res => {
res.data.forEach(item => {
keyarr.value.push({
name: item.deptName,
id: item.deptId,
activation: item.activation
})
idarr.value.push({ id: item.deptId })
})
gettreeData(area.value, keyarr.value)
dataTree.value = area.value
})
}
//过滤数据
const gettreeData = (mdata, ids) => {
mdata.forEach(m => {
ids.forEach(n => {
if (m.id == n.id && n.activation == 1) {
m.activation = 1
} else {
m.activation = 0
}
})
if (m.children != null || m.children.length > 0) {
gettreeData(m.children, ids)
} else {
m.children = null
}
})
}
// 绑定
const bind = () => {
updateBindTemplate().then(res => {
// ElMessage.success('绑定成功')
})
}
defineExpose({ open })
</script>
<style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>
<template>
<el-dialog draggable v-model.trim="dialogVisible" title="模板绑定" width="500px" :before-close="handleClose">
<el-tree default-expand-all show-checkbox node-key="id" :data="dataTree" :expand-on-click-node="false"
ref="tree" style="height: 440px; overflow-y: auto">
<template #default="{ node, data }">
<span class="custom-tree-node">
<span>{{ data.name }}</span>
<span>
<el-switch v-model.trim="data.activation" active-value="1" inactive-value="0"
:active-text="data.activation == 1 ? '激活 ' : '未激活'" />
</span>
</span>
</template>
</el-tree>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="bind" :loading="loading">绑定</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { ElMessageBox } from 'element-plus'
import { useDictData } from '@/stores/dictData'
import { getDataByTempId, updateBindTemplate } from '@/api/harmonic-boot/luckyexcel'
const emit = defineEmits(['shutDown'])
const dictData = useDictData()
const dialogVisible = ref(false)
const keyarr: any = ref([])
const idarr: any = ref([])
const dataTree: any = ref([])
const area = ref(dictData.state.area)
const loading = ref(false)
const handleClose = () => {
dialogVisible.value = false
// emit('handleClose')
}
const open = (row: any) => {
dialogVisible.value = true
getDataByTempId({ id: row.id }).then(res => {
res.data.forEach(item => {
keyarr.value.push({
name: item.deptName,
id: item.deptId,
activation: item.activation
})
idarr.value.push({ id: item.deptId })
})
gettreeData(area.value, keyarr.value)
dataTree.value = area.value
})
}
//过滤数据
const gettreeData = (mdata, ids) => {
mdata.forEach(m => {
ids.forEach(n => {
if (m.id == n.id && n.activation == 1) {
m.activation = 1
} else {
m.activation = 0
}
})
if (m.children != null || m.children.length > 0) {
gettreeData(m.children, ids)
} else {
m.children = null
}
})
}
// 绑定
const bind = () => {
loading.value = true
updateBindTemplate().then(res => {
// ElMessage.success('绑定成功')
}).finally(() => {
loading.value = false
})
}
defineExpose({ open })
</script>
<style scoped lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@@ -24,8 +24,8 @@
</el-form-item>
</el-form>
<template #footer>
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="preservation"> </el-button>
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="preservation">确定</el-button>
</template>
</el-dialog>
</template>

Some files were not shown because too many files have changed in this diff Show More