2025-10-20 13:25:30 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<!--敏感负荷列表 -->
|
2026-06-11 20:27:37 +08:00
|
|
|
|
<TableHeader ref="TableHeaderRef" :showReset="false" @selectChange="selectChange" v-if="fullscreen"
|
|
|
|
|
|
:timeKeyList="prop.timeKey">
|
2026-02-04 09:35:24 +08:00
|
|
|
|
<template #select>
|
|
|
|
|
|
<el-form-item label="关键字筛选">
|
2026-06-11 20:27:37 +08:00
|
|
|
|
<el-input maxlength="32" show-word-limit style="width: 240px"
|
2026-06-16 08:34:45 +08:00
|
|
|
|
v-model.trim="tableStore.table.params.searchValue" clearable placeholder="请输入用户名称" />
|
2026-02-04 09:35:24 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</TableHeader>
|
2026-06-11 20:27:37 +08:00
|
|
|
|
<Table ref="tableRef" @cell-click="cellClickEvent"
|
|
|
|
|
|
:height="`calc(${prop.height} - ${headerHeight}px + ${fullscreen ? -58 : 56}px )`" isGroup></Table>
|
2025-10-20 13:25:30 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { ref, onMounted, provide, reactive, watch, h } from 'vue'
|
|
|
|
|
|
import TableStore from '@/utils/tableStore'
|
|
|
|
|
|
import Table from '@/components/table/index.vue'
|
2025-11-07 11:28:24 +08:00
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
2025-11-25 10:14:50 +08:00
|
|
|
|
import { useDictData } from '@/stores/dictData'
|
2025-12-04 20:27:05 +08:00
|
|
|
|
import { getTime } from '@/utils/formatTime'
|
2025-11-07 11:28:24 +08:00
|
|
|
|
|
2025-10-20 13:25:30 +08:00
|
|
|
|
const prop = defineProps({
|
2025-12-04 20:27:05 +08:00
|
|
|
|
w: { type: [String, Number] },
|
|
|
|
|
|
h: { type: [String, Number] },
|
|
|
|
|
|
width: { type: [String, Number] },
|
|
|
|
|
|
height: { type: [String, Number] },
|
2026-01-07 21:01:28 +08:00
|
|
|
|
timeKey: { type: Array as () => string[] },
|
2025-12-04 20:27:05 +08:00
|
|
|
|
timeValue: { type: Object },
|
2026-06-11 20:27:37 +08:00
|
|
|
|
interval: { type: Number },
|
|
|
|
|
|
flag: { type: Boolean }
|
2025-10-20 13:25:30 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2025-11-07 11:28:24 +08:00
|
|
|
|
const headerHeight = ref(57)
|
|
|
|
|
|
|
2025-12-04 20:27:05 +08:00
|
|
|
|
const TableHeaderRef = ref()
|
|
|
|
|
|
|
2025-11-25 10:14:50 +08:00
|
|
|
|
const dictData = useDictData()
|
2026-01-04 14:55:31 +08:00
|
|
|
|
const sensitiveUserType = dictData.getBasicData('Interference_Source')
|
2025-11-25 10:14:50 +08:00
|
|
|
|
|
2025-11-07 11:28:24 +08:00
|
|
|
|
const selectChange = (showSelect: any, height: any, datePickerValue?: any) => {
|
|
|
|
|
|
headerHeight.value = height
|
|
|
|
|
|
|
2026-01-27 16:32:33 +08:00
|
|
|
|
// if (datePickerValue && datePickerValue.timeValue) {
|
|
|
|
|
|
// // 更新时间参数
|
|
|
|
|
|
// tableStore.table.params.searchBeginTime = datePickerValue.timeValue[0]
|
|
|
|
|
|
// tableStore.table.params.searchEndTime = datePickerValue.timeValue[1]
|
|
|
|
|
|
// }
|
2025-11-07 11:28:24 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 计算是否全屏展示
|
|
|
|
|
|
const fullscreen = computed(() => {
|
|
|
|
|
|
const w = Number(prop.w)
|
|
|
|
|
|
const h = Number(prop.h)
|
|
|
|
|
|
if (!isNaN(w) && !isNaN(h) && w === 12 && h === 6) {
|
|
|
|
|
|
// 执行相应逻辑
|
|
|
|
|
|
return true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2025-10-20 13:25:30 +08:00
|
|
|
|
const OverLimitDetailsRef = ref()
|
|
|
|
|
|
const tableStore: any = new TableStore({
|
2026-02-04 09:35:24 +08:00
|
|
|
|
url: '/cs-harmonic-boot/pqSensitiveUser/getListByUser',
|
2025-10-20 13:25:30 +08:00
|
|
|
|
method: 'POST',
|
2025-11-25 09:30:49 +08:00
|
|
|
|
showPage: fullscreen.value ? true : false,
|
2025-10-20 13:25:30 +08:00
|
|
|
|
column: [
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'index',
|
|
|
|
|
|
title: '序号',
|
2025-10-21 16:11:00 +08:00
|
|
|
|
width: '80',
|
2025-10-20 13:25:30 +08:00
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2026-06-16 08:34:45 +08:00
|
|
|
|
title: '用户名称',
|
2025-10-20 13:25:30 +08:00
|
|
|
|
field: 'name',
|
|
|
|
|
|
minWidth: '90'
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2026-06-17 09:23:35 +08:00
|
|
|
|
title: '用户类型',
|
2025-11-25 09:30:49 +08:00
|
|
|
|
field: 'loadType',
|
2025-11-25 10:14:50 +08:00
|
|
|
|
minWidth: '70',
|
2025-12-04 20:27:05 +08:00
|
|
|
|
formatter: row => {
|
2025-11-25 10:14:50 +08:00
|
|
|
|
return sensitiveUserType.filter(item => item.id == row.cellValue)[0]?.name
|
|
|
|
|
|
}
|
2025-10-20 13:25:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '是否监测',
|
2025-11-25 09:30:49 +08:00
|
|
|
|
field: 'isMonitor',
|
2026-01-07 21:01:28 +08:00
|
|
|
|
minWidth: '80',
|
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
|
return row.cellValue || '/'
|
|
|
|
|
|
}
|
2025-10-20 13:25:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
title: '是否治理',
|
2025-11-25 09:30:49 +08:00
|
|
|
|
field: 'isGovern',
|
2026-01-07 21:01:28 +08:00
|
|
|
|
minWidth: '80',
|
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
|
return row.cellValue || '/'
|
|
|
|
|
|
}
|
2025-10-20 13:25:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
2025-11-14 14:09:34 +08:00
|
|
|
|
beforeSearchFun: () => {
|
2025-12-04 20:27:05 +08:00
|
|
|
|
setTime()
|
2025-10-20 13:25:30 +08:00
|
|
|
|
},
|
2025-11-14 14:09:34 +08:00
|
|
|
|
|
2026-06-11 20:27:37 +08:00
|
|
|
|
loadCallback: () => { }
|
2025-10-20 13:25:30 +08:00
|
|
|
|
})
|
2026-02-04 09:35:24 +08:00
|
|
|
|
tableStore.table.params.searchValue = ''
|
2025-10-20 13:25:30 +08:00
|
|
|
|
const tableRef = ref()
|
|
|
|
|
|
provide('tableRef', tableRef)
|
|
|
|
|
|
|
|
|
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
|
|
|
|
|
|
|
// 点击行
|
|
|
|
|
|
const cellClickEvent = ({ row, column }: any) => {
|
|
|
|
|
|
if (column.field != 'name') {
|
|
|
|
|
|
console.log(row)
|
|
|
|
|
|
OverLimitDetailsRef.value.open(row)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-04 20:27:05 +08:00
|
|
|
|
const setTime = () => {
|
2026-01-27 16:32:33 +08:00
|
|
|
|
// const time = getTime(
|
|
|
|
|
|
// (TableHeaderRef.value?.datePickerRef.interval || prop.interval) ?? 0,
|
|
|
|
|
|
// prop.timeKey,
|
|
|
|
|
|
// fullscreen.value
|
|
|
|
|
|
// ? [tableStore.table.params.searchBeginTime, tableStore.table.params.searchEndTime]
|
|
|
|
|
|
// : prop.timeValue
|
|
|
|
|
|
// )
|
|
|
|
|
|
// if (Array.isArray(time)) {
|
|
|
|
|
|
// tableStore.table.params.searchBeginTime = time[0]
|
|
|
|
|
|
// tableStore.table.params.searchEndTime = time[1]
|
|
|
|
|
|
// TableHeaderRef.value?.setInterval(time[2] - 0)
|
|
|
|
|
|
// TableHeaderRef.value?.setTimeInterval([time[0], time[1]])
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// console.warn('获取时间失败,time 不是一个有效数组')
|
|
|
|
|
|
// }
|
2025-12-04 20:27:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-20 13:25:30 +08:00
|
|
|
|
onMounted(() => {
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
tableStore.index()
|
|
|
|
|
|
}, 500)
|
|
|
|
|
|
})
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => prop.timeKey,
|
|
|
|
|
|
val => {
|
|
|
|
|
|
tableStore.index()
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
watch(
|
2025-11-14 14:09:34 +08:00
|
|
|
|
() => prop.timeValue,
|
2025-10-20 13:25:30 +08:00
|
|
|
|
(newVal, oldVal) => {
|
2025-12-04 20:27:05 +08:00
|
|
|
|
tableStore.index()
|
2025-10-20 13:25:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-11-14 14:09:34 +08:00
|
|
|
|
deep: true
|
2025-10-20 13:25:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
)
|
2026-06-11 20:27:37 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => prop.flag,
|
|
|
|
|
|
val => {
|
|
|
|
|
|
tableStore.showPage = fullscreen.value ? true : false
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
2025-10-20 13:25:30 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|