Compare commits
8 Commits
70505ac356
...
2025-09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bde44902f | ||
|
|
11f0c2ee50 | ||
|
|
262b593d86 | ||
|
|
a895684364 | ||
|
|
29a90a36af | ||
|
|
bf141fbaa4 | ||
|
|
d6ef23c642 | ||
|
|
dd3d829820 |
@@ -48,11 +48,10 @@ export function getOnlineUsers(data:any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
//获取表空间大小
|
//获取表空间大小
|
||||||
export function getMemoInfo(data:any) {
|
export function getMemoInfo() {
|
||||||
return createAxios({
|
return createAxios({
|
||||||
url: "/system-boot/audit/getMemoInfo",
|
url: "/system-boot/audit/getMemoInfo",
|
||||||
method: "post",
|
method: "post",
|
||||||
data,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
export function getSysConfig() {
|
export function getSysConfig() {
|
||||||
|
|||||||
234
src/components/table/indexClick.vue
Normal file
234
src/components/table/indexClick.vue
Normal file
@@ -0,0 +1,234 @@
|
|||||||
|
<template>
|
||||||
|
<div :style="{ height: typeof props.height === 'string' ? props.height : tableStore.table.height }">
|
||||||
|
<vxe-table
|
||||||
|
ref="tableRef"
|
||||||
|
height="auto"
|
||||||
|
:key="key"
|
||||||
|
:data="tableStore.table.data"
|
||||||
|
v-loading="tableStore.table.loading"
|
||||||
|
v-bind="Object.assign({}, defaultAttribute, $attrs)"
|
||||||
|
@checkbox-all="selectChangeEvent"
|
||||||
|
@checkbox-change="selectChangeEvent"
|
||||||
|
:showOverflow="showOverflow"
|
||||||
|
@sort-change="handleSortChange"
|
||||||
|
>
|
||||||
|
<!-- Column 组件内部是 el-table-column -->
|
||||||
|
<template v-if="isGroup">
|
||||||
|
<GroupColumn :column="tableStore.table.column" />
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<Column
|
||||||
|
:attr="item"
|
||||||
|
:key="key + '-column'"
|
||||||
|
v-for="(item, key) in tableStore.table.column"
|
||||||
|
:tree-node="item.treeNode"
|
||||||
|
>
|
||||||
|
<!-- tableStore 预设的列 render 方案 -->
|
||||||
|
<template v-if="item.render" #default="scope">
|
||||||
|
<FieldRender
|
||||||
|
:field="item"
|
||||||
|
:row="scope.row"
|
||||||
|
:column="scope.column"
|
||||||
|
:index="scope.rowIndex"
|
||||||
|
:key="
|
||||||
|
key +
|
||||||
|
'-' +
|
||||||
|
item.render +
|
||||||
|
'-' +
|
||||||
|
(item.field ? '-' + item.field + '-' + scope.row[item.field] : '')
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 支持可点击和下划线的列 -->
|
||||||
|
<template v-else-if="item.clickable" #default="scope">
|
||||||
|
<span
|
||||||
|
:class="{ 'clickable-underline':item.clickable }"
|
||||||
|
@click="item.clickable ? handleCellClick(scope.row, scope.column) : undefined"
|
||||||
|
>
|
||||||
|
{{ item.field ? scope.row[item.field] : '' }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</Column>
|
||||||
|
</template>
|
||||||
|
<slot name="columns"></slot>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="tableStore.showPage" class="table-pagination">
|
||||||
|
<el-pagination
|
||||||
|
:currentPage="tableStore.table.params!.pageNum"
|
||||||
|
:page-size="tableStore.table.params!.pageSize"
|
||||||
|
:page-sizes="pageSizes"
|
||||||
|
background
|
||||||
|
:layout="config.layout.shrink ? 'prev, next, jumper' : 'sizes,total, ->, prev, pager, next, jumper'"
|
||||||
|
:total="tableStore.table.total"
|
||||||
|
@size-change="onTableSizeChange"
|
||||||
|
@current-change="onTableCurrentChange"
|
||||||
|
></el-pagination>
|
||||||
|
</div>
|
||||||
|
<slot name="footer"></slot>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, nextTick, inject, computed, onMounted, watch } from 'vue'
|
||||||
|
import type { ElTable } from 'element-plus'
|
||||||
|
import { VxeTableEvents, VxeTableInstance } from 'vxe-table'
|
||||||
|
import FieldRender from '@/components/table/fieldRender/index.vue'
|
||||||
|
import Column from '@/components/table/column/index.vue'
|
||||||
|
import GroupColumn from '@/components/table/column/groupColumn.vue'
|
||||||
|
import { useConfig } from '@/stores/config'
|
||||||
|
import type TableStoreClass from '@/utils/tableStore'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||||
|
|
||||||
|
const config = useConfig()
|
||||||
|
const tableRef = ref<VxeTableInstance>()
|
||||||
|
const tableStore = inject('tableStore') as TableStoreClass
|
||||||
|
const router = useRouter()
|
||||||
|
const key = ref(0)
|
||||||
|
|
||||||
|
const clickedRow = ref<any>(null)
|
||||||
|
const clickedColumn = ref<any>(null)
|
||||||
|
|
||||||
|
const emit = defineEmits(['cell-click'])
|
||||||
|
interface Props extends /* @vue-ignore */ Partial<InstanceType<typeof ElTable>> {
|
||||||
|
isGroup?: boolean
|
||||||
|
showOverflow?: boolean
|
||||||
|
height?: string | boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
isGroup: false,
|
||||||
|
showOverflow: true,
|
||||||
|
height: false
|
||||||
|
})
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.table.ref = tableRef.value as VxeTableInstance
|
||||||
|
})
|
||||||
|
// console.log(props)
|
||||||
|
const onTableSizeChange = (val: number) => {
|
||||||
|
tableStore.onTableAction('page-size-change', { size: val })
|
||||||
|
}
|
||||||
|
|
||||||
|
const onTableCurrentChange = (val: number) => {
|
||||||
|
tableStore.onTableAction('current-page-change', { page: val })
|
||||||
|
}
|
||||||
|
|
||||||
|
const pageSizes = computed(() => {
|
||||||
|
let defaultSizes = [10, 20, 50, 100, 200]
|
||||||
|
if (tableStore.table.params!.pageSize) {
|
||||||
|
if (!defaultSizes.includes(tableStore.table.params!.pageSize)) {
|
||||||
|
defaultSizes.push(tableStore.table.params!.pageSize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return defaultSizes
|
||||||
|
})
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 记录选择的项
|
||||||
|
*/
|
||||||
|
const selectChangeEvent: VxeTableEvents.CheckboxChange<any> = ({ checked }) => {
|
||||||
|
const records = (tableRef.value as VxeTableInstance).getCheckboxRecords()
|
||||||
|
tableStore.onTableAction('selection-change', records)
|
||||||
|
}
|
||||||
|
|
||||||
|
const getRef = () => {
|
||||||
|
return tableRef.value
|
||||||
|
}
|
||||||
|
// 排序
|
||||||
|
const handleSortChange = ({ column, order }: { column: TableColumn; order: 'asc' | 'desc' | null }) => {
|
||||||
|
// console.log('排序列:', column?.property);
|
||||||
|
// console.log('排序顺序:', order);
|
||||||
|
// tableStore.onTableAction('sortable', { column, order })
|
||||||
|
tableStore.table.params.sortBy = column?.property
|
||||||
|
tableStore.table.params.orderBy = order
|
||||||
|
tableStore.table.params.pageNum = 1
|
||||||
|
|
||||||
|
tableStore.index()
|
||||||
|
key.value += 1
|
||||||
|
// // 在这里可以根据 column 和 order 进行相应的数据排序操作
|
||||||
|
// if (order === 'asc') {
|
||||||
|
// } else if (order === 'desc') {
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 单元格点击事件处理函数
|
||||||
|
const handleCellClick = (row: any, column: any) => {
|
||||||
|
clickedRow.value = row
|
||||||
|
clickedColumn.value = column
|
||||||
|
// 触发自定义事件,通知父组件显示 dialog
|
||||||
|
emit('cell-click', row, column)
|
||||||
|
// 你也可以在这里触发一个自定义事件或调用 tableStore 的方法
|
||||||
|
// tableStore.onTableAction('cell-click', { row, column })
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => tableStore.table.allFlag,
|
||||||
|
newVal => {
|
||||||
|
if (tableStore.table.allFlag) {
|
||||||
|
tableRef.value?.exportData({
|
||||||
|
filename:
|
||||||
|
tableStore.table.filename || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
|
||||||
|
sheetName: 'Sheet1',
|
||||||
|
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||||
|
useStyle: true,
|
||||||
|
data: tableStore.table.allData, // 数据源 // 过滤那个字段导出
|
||||||
|
columnFilterMethod: function (column: any) {
|
||||||
|
return !(
|
||||||
|
column.column.title === undefined ||
|
||||||
|
column.column.title === '序号' ||
|
||||||
|
column.column.title === '操作'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tableStore.table.allFlag = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
watch(
|
||||||
|
() => tableStore.table.data,
|
||||||
|
newVal => {
|
||||||
|
tableStore.onTableAction('selection-change', [])
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
getRef
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.ba-data-table :deep(.el-button + .el-button) {
|
||||||
|
margin-left: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ba-data-table :deep(.table-header-cell) .cell {
|
||||||
|
color: var(--el-text-color-primary);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-pagination {
|
||||||
|
height: 58px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
background-color: var(--ba-bg-color-overlay);
|
||||||
|
padding: 13px 15px;
|
||||||
|
border-left: 1px solid #e4e7e9;
|
||||||
|
border-right: 1px solid #e4e7e9;
|
||||||
|
border-bottom: 1px solid #e4e7e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 添加可点击和下划线单元格样式 */
|
||||||
|
.clickable-underline {
|
||||||
|
text-decoration: underline; /* 下划线 */
|
||||||
|
cursor: pointer; /* 鼠标指针 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.clickable-underline:hover {
|
||||||
|
color: #66b1ff; /* 悬停时的颜色 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<my-echart class="tall" :options="echartList_1" :style="{ width: prop.width, height: halfHeight }" />
|
||||||
|
<vxe-table ref="tableRef" :data="tableData" height="auto" :style="{ width: prop.width, height: halfHeight }">
|
||||||
|
<vxe-column type="seq" title="序号"></vxe-column>
|
||||||
|
<vxe-column field="srbName" align="center" title="部门"></vxe-column>
|
||||||
|
<!-- <vxe-column width="200" title="操作">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="primary" size="small" link @click="tactics(row.id, 0)">自动</el-button>
|
||||||
|
<el-button type="primary" size="small" link @click="tactics(row.id, 1)">手动</el-button>
|
||||||
|
<el-button type="primary" size="small" link @click="tactics(row.id, 2)">排除</el-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column> -->
|
||||||
|
</vxe-table>
|
||||||
|
<!-- <Table ref="tableRef" :style="{ width: prop.width, height: halfHeight }"></Table> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, reactive, onMounted, provide } from 'vue'
|
||||||
|
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
const echartList_1 = ref({})
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
const prop = defineProps({
|
||||||
|
width: { type: String },
|
||||||
|
height: { type: String },
|
||||||
|
timeKey: { type: String }
|
||||||
|
})
|
||||||
|
|
||||||
|
const halfHeight = computed(() => {
|
||||||
|
const h = parseFloat(prop.height || '400')
|
||||||
|
return `${h / 2}px`
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableData = ref([])
|
||||||
|
|
||||||
|
const dictData = useDictData()
|
||||||
|
const distributionData: any = ref([])
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/event-boot/area/getAreaLineDetail',
|
||||||
|
method: 'POST',
|
||||||
|
column: [],
|
||||||
|
loadCallback: () => {
|
||||||
|
tabulation(tableStore.table.data)
|
||||||
|
histogram(tableStore.table.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
tableStore.table.params.deptIndex = dictData.state.area[0].id
|
||||||
|
tableStore.table.params.statisticalType = dictData.getBasicData('Statistical_Type', ['Report_Type'])[0]
|
||||||
|
tableStore.table.params.monitorFlag = 2
|
||||||
|
tableStore.table.params.powerFlag = 2
|
||||||
|
tableStore.table.params.serverName = 'event-boot'
|
||||||
|
// 表格数据处理
|
||||||
|
const tabulation = (res: any) => {
|
||||||
|
tableData.value = res.substationDetailVOList
|
||||||
|
distributionData.value = []
|
||||||
|
for (var i = 0; i < res.areaValue.length; i++) {
|
||||||
|
distributionData.value.push({
|
||||||
|
qy: res.areaValue[i][0],
|
||||||
|
jcd: res.areaValue[i][1],
|
||||||
|
zc: res.areaValue[i][2],
|
||||||
|
zd: res.areaValue[i][3]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 柱状图数据处理
|
||||||
|
const histogram = (res: any) => {
|
||||||
|
echartList_1.value = {
|
||||||
|
title: {
|
||||||
|
text: '区域'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
formatter: function (params: any) {
|
||||||
|
// console.log(params);
|
||||||
|
var tips = ''
|
||||||
|
for (var i = 0; i < params.length; i++) {
|
||||||
|
tips += params[i].name + '</br/>'
|
||||||
|
tips += '监测点数' + ':' + ' ' + ' ' + params[i].value + '</br/>'
|
||||||
|
}
|
||||||
|
return tips
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
xAxis: {
|
||||||
|
name: '(区域)',
|
||||||
|
data: distributionData.value.map((item: any) => item.qy)
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
name: '监测点数(个)' // 给X轴加单位
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
// name: '暂降次数',
|
||||||
|
type: 'bar',
|
||||||
|
data: distributionData.value.map((item: any) => item.jcd),
|
||||||
|
barMaxWidth: 30,
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#07CCCA'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
textStyle: {
|
||||||
|
//数值样式
|
||||||
|
color: '#000'
|
||||||
|
},
|
||||||
|
fontSize: 12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
// watch(
|
||||||
|
// () => prop.timeKey,
|
||||||
|
// val => {
|
||||||
|
// tableStore.index()
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
106
src/views/cockpit/teadyStatePowerQuality/pointList.vue
Normal file
106
src/views/cockpit/teadyStatePowerQuality/pointList.vue
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--主要监测点列表 -->
|
||||||
|
<TableHeader :showReset="false" ref="TableHeaderRef">
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</TableHeader>
|
||||||
|
<Table ref="tableRef" @cell-click="handleCellClick"></Table>
|
||||||
|
<!-- 弹框组件 -->
|
||||||
|
<el-dialog v-model="dialogVisible" title="详情信息" width="800px" append-to-body destroy-on-close>
|
||||||
|
<p>行数据: {{ selectedRow }}</p>
|
||||||
|
<p>列数据: {{ selectedColumn }}</p>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted, provide, reactive, watch } from 'vue'
|
||||||
|
|
||||||
|
import TableStore from '@/utils/tableStore'
|
||||||
|
import Table from '@/components/table/indexClick.vue'
|
||||||
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
|
import { useDictData } from '@/stores/dictData'
|
||||||
|
import { getTimeOfTheMonth } from '@/utils/formatTime'
|
||||||
|
const prop = defineProps({
|
||||||
|
width: { type: String },
|
||||||
|
height: { type: String },
|
||||||
|
timeKey: { type: String }
|
||||||
|
})
|
||||||
|
const dictData = useDictData()
|
||||||
|
const fontdveoption = dictData.getBasicData('Dev_Ops')
|
||||||
|
const dialogVisible = ref(false)
|
||||||
|
const selectedRow = ref(null)
|
||||||
|
const selectedColumn = ref(null)
|
||||||
|
|
||||||
|
const tableStore: any = new TableStore({
|
||||||
|
url: '/device-boot/pqsTerminalLogs/getList',
|
||||||
|
method: 'POST',
|
||||||
|
column: [
|
||||||
|
{
|
||||||
|
field: 'index',
|
||||||
|
title: '序号',
|
||||||
|
width: '60',
|
||||||
|
formatter: (row: any) => {
|
||||||
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ title: '名称', field: 'createBy', width: '200', clickable: true },
|
||||||
|
{
|
||||||
|
title: '日志类型',
|
||||||
|
field: 'logsType',
|
||||||
|
width: '100',
|
||||||
|
formatter: (row: any) => {
|
||||||
|
return fontdveoption.find((item: any) => item.id == row.cellValue)?.name
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// {
|
||||||
|
// title: '更改人员',
|
||||||
|
// field: 'createBy',
|
||||||
|
// width: '100'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '更改时间',
|
||||||
|
field: 'updateTime',
|
||||||
|
width: '140'
|
||||||
|
},
|
||||||
|
|
||||||
|
{ title: '描述', field: 'terminalDescribe' }
|
||||||
|
],
|
||||||
|
beforeSearchFun: () => {
|
||||||
|
const timeKey = prop.timeKey ?? ''
|
||||||
|
tableStore.table.params.searchBeginTime = getTimeOfTheMonth(timeKey)[0]
|
||||||
|
tableStore.table.params.searchEndTime = getTimeOfTheMonth(timeKey)[1]
|
||||||
|
},
|
||||||
|
loadCallback: () => {
|
||||||
|
tableStore.table.height = `calc(${prop.height} - 80px)`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableRef = ref()
|
||||||
|
provide('tableRef', tableRef)
|
||||||
|
tableStore.table.params.type = ''
|
||||||
|
tableStore.table.params.searchValue = ''
|
||||||
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
tableStore.index()
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleCellClick = (row: any, column: any) => {
|
||||||
|
selectedRow.value = row
|
||||||
|
selectedColumn.value = column
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => prop.timeKey,
|
||||||
|
val => {
|
||||||
|
tableStore.index()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<div v-show="flg">
|
<div v-show="flg">
|
||||||
<TableHeader datePicker showExport :showReset="false" ref="TableHeaderRef">
|
<TableHeader datePicker showExport ref="TableHeaderRef">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form :inline="true" label-width="90px" class="">
|
<el-form :inline="true" label-width="90px" class="">
|
||||||
<el-form-item label="用户名:">
|
<el-form-item label="用户名:">
|
||||||
@@ -52,59 +52,14 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button type="primary" @click="backups">文件备份</el-button>
|
<el-button type="primary" @click="backups" :icon="DocumentCopy">文件备份</el-button>
|
||||||
<el-button type="primary" @click="details">统计</el-button>
|
<el-button type="primary" @click="details" :icon="Tickets">统计</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef" @sort-change="handleSortChange" />
|
<Table ref="tableRef" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!flg">
|
<div v-if="!flg">
|
||||||
<Statistics @back="onSubmit" ref="statistics" />
|
<Statistics @back="onSubmit" ref="statistics" />
|
||||||
<!-- <TableHeader datePicker showExport :showReset="false" ref="TableHeaderRef">
|
|
||||||
<template v-slot:select>
|
|
||||||
<el-form :inline="true" label-width="90px" class="">
|
|
||||||
<el-form-item label="用户名:">
|
|
||||||
<el-select
|
|
||||||
v-model="tableStore.table.params.loginName"
|
|
||||||
placeholder="用户名"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in userName"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.loginName"
|
|
||||||
:value="item.loginName"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="事件类型:">
|
|
||||||
<el-select v-model="tableStore.table.params.type" placeholder="事件类型" clearable>
|
|
||||||
<el-option
|
|
||||||
v-for="item in eventType"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.id"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="操作类型:">
|
|
||||||
<el-select v-model="tableStore.table.params.operateType" placeholder="操作类型" clearable>
|
|
||||||
<el-option
|
|
||||||
v-for="item in operationType"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<template #operation>
|
|
||||||
<el-button type="primary" @click="back">返回</el-button>
|
|
||||||
</template>
|
|
||||||
</TableHeader>
|
|
||||||
<Table ref="tableRef_1" /> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -113,20 +68,13 @@ import { ref, onMounted, provide, nextTick } from 'vue'
|
|||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import {
|
import { getAllUserList, logFileWriter, recoverLogFile, getMemoInfo, getSysConfig } from '@/api/auditManage/auditList'
|
||||||
getAllUserList,
|
|
||||||
getAuditLog,
|
|
||||||
censusAuditLog,
|
|
||||||
logFileWriter,
|
|
||||||
recoverLogFile,
|
|
||||||
getMemoInfo,
|
|
||||||
getSysConfig
|
|
||||||
} from '@/api/auditManage/auditList'
|
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import Statistics from './statistics.vue'
|
import Statistics from './statistics.vue'
|
||||||
|
import { DocumentCopy, Tickets } from '@element-plus/icons-vue'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'admin/BusinessAdministrator/Audit/Operations/Management'
|
name: 'BusinessAdministrator/Audit/Operations/Management'
|
||||||
})
|
})
|
||||||
|
|
||||||
interface UserInfo {
|
interface UserInfo {
|
||||||
@@ -178,15 +126,32 @@ const tableStore: any = new TableStore({
|
|||||||
url: '/system-boot/audit/getAuditLog',
|
url: '/system-boot/audit/getAuditLog',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
column: [
|
column: [
|
||||||
{ field: 'time', title: '操作时间', sortable: true },
|
{
|
||||||
|
field: 'create_time',
|
||||||
|
title: '操作时间',
|
||||||
|
sortable: true,
|
||||||
|
formatter: (row: any) => {
|
||||||
|
return row.row.time
|
||||||
|
}
|
||||||
|
},
|
||||||
{ field: 'userName', title: '操作人员' },
|
{ field: 'userName', title: '操作人员' },
|
||||||
{ field: 'operate', title: '操作类型', sortable: true },
|
{
|
||||||
|
field: 'operate_type',
|
||||||
|
title: '操作类型',
|
||||||
|
sortable: true,
|
||||||
|
formatter: (row: any) => {
|
||||||
|
return row.row.operate
|
||||||
|
}
|
||||||
|
},
|
||||||
{ field: 'describe', title: '事件描述' },
|
{ field: 'describe', title: '事件描述' },
|
||||||
{ field: 'type', title: '事件类型', sortable: true },
|
{ field: 'type', title: '事件类型', sortable: true },
|
||||||
{ field: 'result', title: '操作结果', sortable: true },
|
{ field: 'result', title: '操作结果', sortable: true },
|
||||||
{ field: 'ip', title: '操作IP' },
|
{ field: 'ip', title: '操作IP' },
|
||||||
{ field: 'level', title: '事件等级', sortable: true }
|
{ field: 'level', title: '事件等级', sortable: true }
|
||||||
]
|
],
|
||||||
|
loadCallback: () => {
|
||||||
|
getLogSize()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
tableStore.table.params.loginName = ''
|
tableStore.table.params.loginName = ''
|
||||||
@@ -194,30 +159,16 @@ tableStore.table.params.type = ''
|
|||||||
tableStore.table.params.operateType = ''
|
tableStore.table.params.operateType = ''
|
||||||
tableStore.table.params.result = null
|
tableStore.table.params.result = null
|
||||||
tableStore.table.params.sortBy = ''
|
tableStore.table.params.sortBy = ''
|
||||||
tableStore.table.params.sortName = ''
|
|
||||||
tableStore.table.params.orderBy = ''
|
tableStore.table.params.orderBy = ''
|
||||||
tableStore.table.params.pageSize = 100
|
tableStore.table.params.pageSize = 100
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// tableStore.index()
|
|
||||||
search()
|
search()
|
||||||
onSubmit()
|
onSubmit()
|
||||||
})
|
})
|
||||||
|
|
||||||
// 排序
|
|
||||||
const handleSortChange = ({ column, order }: { column: TableColumn; order: 'asc' | 'desc' | null }) => {
|
|
||||||
tableStore.table.params.sortName = column?.title
|
|
||||||
tableStore.table.params.sortBy =
|
|
||||||
column?.property == 'operate' ? 'operate_type' : column?.property == 'time' ? 'create_time' : column?.property
|
|
||||||
tableStore.table.params.orderBy = order
|
|
||||||
tableStore.table.params.pageNum = 1
|
|
||||||
|
|
||||||
// tableStore.index()
|
|
||||||
onSubmit()
|
|
||||||
}
|
|
||||||
|
|
||||||
//下拉框查询
|
//下拉框查询
|
||||||
const search = () => {
|
const search = () => {
|
||||||
getAllUserList().then(res => {
|
getAllUserList().then(res => {
|
||||||
@@ -236,12 +187,11 @@ const details = () => {
|
|||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
flg.value = true
|
flg.value = true
|
||||||
await tableStore.index()
|
await tableStore.index()
|
||||||
getLogSize()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询日志大小
|
// 查询日志大小
|
||||||
const getLogSize = () => {
|
const getLogSize = () => {
|
||||||
getMemoInfo({}).then(res => {
|
getMemoInfo().then(res => {
|
||||||
getSysConfig().then(re => {
|
getSysConfig().then(re => {
|
||||||
if (res.data > re.data.logSize) {
|
if (res.data > re.data.logSize) {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
@@ -256,16 +206,16 @@ const getLogSize = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 备份
|
// 备份
|
||||||
const backups = () => {
|
const backups = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
logFileWriter({}).then(res => {})
|
await logFileWriter({}).then(res => {})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '文件备份成功'
|
message: '文件备份成功'
|
||||||
})
|
})
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}, 50000)
|
}, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 恢复
|
// 恢复
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
<template #operation>
|
<template #operation>
|
||||||
<el-button type="primary" @click="back">返回</el-button>
|
<el-button @click="back" :icon="Back">返回</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<Table ref="tableRef_1" />
|
<Table ref="tableRef_1" />
|
||||||
@@ -45,14 +45,12 @@ import { ref, onMounted, provide, nextTick } from 'vue'
|
|||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import {
|
import { getAllUserList } from '@/api/auditManage/auditList'
|
||||||
getAllUserList,
|
import { Back } from '@element-plus/icons-vue'
|
||||||
} from '@/api/auditManage/auditList'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
|
|
||||||
defineOptions({
|
// defineOptions({
|
||||||
name: 'admin/BusinessAdministrator/Audit/Operations/Management'
|
// name: 'admin/BusinessAdministrator/Audit/Operations/Management'
|
||||||
})
|
// })
|
||||||
|
|
||||||
interface UserInfo {
|
interface UserInfo {
|
||||||
id: number | string
|
id: number | string
|
||||||
@@ -64,12 +62,7 @@ const emit = defineEmits(['back'])
|
|||||||
const userName = ref<UserInfo[]>([])
|
const userName = ref<UserInfo[]>([])
|
||||||
const TableHeaderRef = ref()
|
const TableHeaderRef = ref()
|
||||||
|
|
||||||
// 其他响应式数据
|
|
||||||
const loading1 = ref(false)
|
|
||||||
|
|
||||||
const flg = ref(true)
|
const flg = ref(true)
|
||||||
const showMqtt = ref(false)
|
|
||||||
const zoom = ref('') //图表焦点校验
|
|
||||||
|
|
||||||
const eventType = ref([
|
const eventType = ref([
|
||||||
{
|
{
|
||||||
@@ -109,7 +102,6 @@ tableStore.table.params.type = ''
|
|||||||
tableStore.table.params.operateType = ''
|
tableStore.table.params.operateType = ''
|
||||||
tableStore.table.params.result = null
|
tableStore.table.params.result = null
|
||||||
tableStore.table.params.sortBy = ''
|
tableStore.table.params.sortBy = ''
|
||||||
tableStore.table.params.sortName = ''
|
|
||||||
tableStore.table.params.orderBy = ''
|
tableStore.table.params.orderBy = ''
|
||||||
tableStore.table.params.pageSize = 100
|
tableStore.table.params.pageSize = 100
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<TableHeader select :showReset="false" ref="TableHeaderRef"></TableHeader>
|
<TableHeader select :showReset="false" showExport ref="TableHeaderRef"></TableHeader>
|
||||||
<Table ref="tableRef" />
|
<Table ref="tableRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class="default-main">
|
||||||
<TableHeader datePicker :showReset="false" ref="TableHeaderRef">
|
<TableHeader datePicker :showReset="false" showExport ref="TableHeaderRef">
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<el-form-item label="筛选数据">
|
<el-form-item label="筛选数据">
|
||||||
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入"></el-input>
|
<el-input v-model="tableStore.table.params.loginName" placeholder="请输入"></el-input>
|
||||||
|
|||||||
@@ -126,8 +126,11 @@ const LngLat = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
import { getAssessOverview } from '@/api/device-boot/panorama'
|
import { getAssessOverview } from '@/api/device-boot/panorama'
|
||||||
narimap.publicKey =
|
// narimap.publicKey =
|
||||||
'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCRYFEiMdZVgY8+jIjx4GR1QbN7qVgCE0istwPZN8xRqdSV+hePUPIW1k9eCVh9gxIIWHAw2TfNZLb8l0Tmk9OH3XnZ009TNBjzZ2zWLrbjFQzgutKKI2JRLK+CaJbOZ0LiD78QnTo5Zk+ZuQBKgtyFJdp4T5gQS+Mnbj/c4EnK0QIDAQAB'
|
// 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCRYFEiMdZVgY8+jIjx4GR1QbN7qVgCE0istwPZN8xRqdSV+hePUPIW1k9eCVh9gxIIWHAw2TfNZLb8l0Tmk9OH3XnZ009TNBjzZ2zWLrbjFQzgutKKI2JRLK+CaJbOZ0LiD78QnTo5Zk+ZuQBKgtyFJdp4T5gQS+Mnbj/c4EnK0QIDAQAB'
|
||||||
|
narimap.publicKey =
|
||||||
|
'JBb74325ae94dc49358b7d699660b692'
|
||||||
|
|
||||||
narimap.Require(
|
narimap.Require(
|
||||||
[
|
[
|
||||||
'PSRMap',
|
'PSRMap',
|
||||||
|
|||||||
5
types/table.d.ts
vendored
5
types/table.d.ts
vendored
@@ -82,8 +82,9 @@ declare global {
|
|||||||
column: VxeColumnProps,
|
column: VxeColumnProps,
|
||||||
index: number
|
index: number
|
||||||
) => string
|
) => string
|
||||||
children?: TableColumn[],
|
children?: TableColumn[]
|
||||||
property?:string
|
property?: string
|
||||||
|
clickable?: boolean // 是否可点击
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 表格右侧操作按钮 */
|
/* 表格右侧操作按钮 */
|
||||||
|
|||||||
Reference in New Issue
Block a user