Files
admin-govern/src/views/govern/device/control/analysisList/index.vue

120 lines
3.8 KiB
Vue
Raw Normal View History

2024-07-23 17:28:31 +08:00
<!-- 解析列表 -->
<template>
<el-dialog v-model="dialogVisible" title="解析列表" width="70%" draggable @closed="close">
2024-07-24 09:26:37 +08:00
<TableHeader date-picker></TableHeader>
2024-07-23 17:28:31 +08:00
<Table ref="tableRef" />
</el-dialog>
2024-10-15 15:30:01 +08:00
<popup ref="detailRef"></popup>
2024-07-23 17:28:31 +08:00
</template>
<script lang="ts" setup>
import { ref, onMounted, provide, watch, onBeforeUnmount } from 'vue'
2024-07-23 17:28:31 +08:00
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
2024-07-24 09:26:37 +08:00
import TableHeader from '@/components/table/header/index.vue'
2024-07-23 17:28:31 +08:00
import { ArrowLeft } from '@element-plus/icons-vue'
2024-10-15 15:30:01 +08:00
import popup from './popup.vue'
2024-07-23 17:28:31 +08:00
const emit = defineEmits(['back'])
const dialogVisible = ref(false)
const height = ref(0)
2024-09-27 16:22:34 +08:00
height.value = window.innerHeight < 1080 ? 230 : 450
2024-10-15 15:30:01 +08:00
const detailRef:any=ref()
2024-07-23 17:28:31 +08:00
const tableStore: any = new TableStore({
2024-10-15 15:30:01 +08:00
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
publicHeight: height.value,
2024-07-23 17:28:31 +08:00
method: 'POST',
column: [
// { width: '60', type: 'checkbox', fixed: 'left' },
{ title: '序号', type: 'seq', width: 80 },
2024-10-15 15:30:01 +08:00
{ field: 'projectName', title: '工程名称', minWidth: 170 },
2024-10-15 16:41:41 +08:00
{ field: 'successCount', title: '成功解析数', minWidth: 170 },
{ field: 'startTime', title: '导入开始时间', minWidth: 170 },
{ field: 'endTime', title: '导入结束时间', minWidth: 170 },
2024-07-23 17:28:31 +08:00
{
title: '解析状态',
2024-10-15 15:30:01 +08:00
field: 'status',
2024-07-23 17:28:31 +08:00
width: 100,
render: 'tag',
custom: {
2024-07-24 15:36:40 +08:00
0: 'warning',
2024-07-24 09:21:07 +08:00
1: 'success',
2: 'danger',
2024-07-24 15:36:40 +08:00
3: 'primary'
2024-07-23 17:28:31 +08:00
},
replaceValue: {
2024-07-24 15:36:40 +08:00
0: '未解析',
2024-07-24 09:21:07 +08:00
1: '解析成功',
2: '解析失败',
2024-07-24 15:36:40 +08:00
3: '文件不存在'
2024-07-23 17:28:31 +08:00
}
// formatter: row => {
// return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
// },
2024-10-15 15:30:01 +08:00
},
{
title: '操作',
width: '180',
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)
}
}
]
2024-07-24 15:36:40 +08:00
}
2024-07-23 17:28:31 +08:00
],
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
},
2024-10-15 15:30:01 +08:00
loadCallback: () => {
// tableStore.table.data=[]
console.log(tableStore.table.data, 'tableStore.table.data')
}
2024-07-23 17:28:31 +08:00
})
provide('tableStore', tableStore)
//返回
const handleBack = () => {
emit('back')
}
2024-07-24 15:36:40 +08:00
const open = () => {
dialogVisible.value = true
2024-10-15 15:30:01 +08:00
setTimeout(() => {
tableStore.index()
}, 10)
2024-07-23 17:28:31 +08:00
}
2024-07-24 15:36:40 +08:00
const close = () => {
dialogVisible.value = false
2024-07-23 17:28:31 +08:00
}
const updateViewportHeight = async () => {
// height.value = window.innerHeight;
2024-09-27 16:22:34 +08:00
height.value = window.innerHeight < 1080 ? 230 : 450
tableStore.table.publicHeight = height.value
2024-08-30 16:34:06 +08:00
// await tableStore.index()
}
onMounted(() => {
updateViewportHeight() // 初始化视口高度
window.addEventListener('resize', updateViewportHeight) // 监听窗口大小变化
})
onBeforeUnmount(() => {
window.removeEventListener('resize', updateViewportHeight) // 移除监听
})
2024-07-23 17:28:31 +08:00
defineExpose({ open })
</script>
<style lang="scss" scoped>
::v-deep .el-dialog_body {
overflow-y: hidden !important;
}
</style>