151 lines
4.2 KiB
Vue
151 lines
4.2 KiB
Vue
<template>
|
|
<div class="view" style="height: 100%">
|
|
<TableHeader datePicker ref="TableHeaderRef" :showReset="false">
|
|
<template #operation>
|
|
<el-button type="primary" :icon="Setting" @click="recall1">事件补召</el-button>
|
|
<el-button type="primary" :icon="Setting" @click="recall2">波形补召</el-button>
|
|
</template>
|
|
</TableHeader>
|
|
<Table ref="tableRef" style="height: calc(100% - 120px)" />
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref, onMounted, provide, nextTick, defineEmits, watch } from 'vue'
|
|
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 { ElMessage } from 'element-plus'
|
|
import DatePicker from '@/components/form/datePicker/time.vue'
|
|
|
|
const props = defineProps({
|
|
checkedNodes: {
|
|
type: Array,
|
|
default: () => []
|
|
}
|
|
});
|
|
|
|
const headerRef = ref()
|
|
const datePickerRef = ref()
|
|
|
|
const tableStore: any = new TableStore({
|
|
url: '/cs-device-boot/portableOfflLog/queryMainLogPage',
|
|
publicHeight: 0,
|
|
method: 'POST',
|
|
column: [
|
|
{
|
|
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: '文件不存在'
|
|
}
|
|
},
|
|
{
|
|
title: '操作',
|
|
width: '100',
|
|
render: 'buttons',
|
|
buttons: [
|
|
{
|
|
name: 'edit',
|
|
title: '详情',
|
|
type: 'primary',
|
|
icon: 'el-icon-EditPen',
|
|
render: 'basicButton',
|
|
click: row => {
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
beforeSearchFun: () => {
|
|
},
|
|
loadCallback: () => {
|
|
|
|
}
|
|
})
|
|
|
|
provide('tableStore', tableStore)
|
|
|
|
const recall1 = async () => {
|
|
if (!props.checkedNodes || props.checkedNodes.length === 0) {
|
|
ElMessage.warning('请先勾选监测点')
|
|
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('补召事件成功')
|
|
})
|
|
}
|
|
|
|
const recall2 = async () => {
|
|
if (!props.checkedNodes || props.checkedNodes.length === 0) {
|
|
ElMessage.warning('请先勾选监测点')
|
|
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('补召波形成功')
|
|
})
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
tableStore.index()
|
|
})
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.header_btn {
|
|
width: 100%;
|
|
height: 30px;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
align-items: center;
|
|
}
|
|
|
|
.view {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
}
|
|
|
|
.view :deep(.el-table) {
|
|
height: calc(100% - 56px);
|
|
}
|
|
</style> |