82 lines
3.9 KiB
Vue
Raw Normal View History

2026-04-13 14:04:56 +08:00
<template>
<div class="root">
<div class="search-box">
<el-input v-model="script.filterData.headline" style="width: 240px; margin-right: 10px" size="large"
placeholder="预警标题" :suffix-icon="Search" />
<el-select v-model="script.filterData.eventType" style="width: 240px; margin-right: 10px" size="large"
placeholder="预警类型" :suffix-icon="ArrowDown" :options="script.eventTypeOptions" clearable />
<el-select v-model="script.filterData.severity" style="width: 240px; margin-right: 10px" size="large"
placeholder="预警级别" :suffix-icon="ArrowDown" :options="script.severityOptions" clearable />
<el-select v-model="script.filterData.responseStatus" style="width: 240px; margin-right: 10px" size="large"
placeholder="响应情况" :suffix-icon="ArrowDown" :options="script.responseOptions" clearable />
</div>
<div class="event-box">
<el-button type="primary" @click="">生成报告</el-button>
2026-04-14 16:25:16 +08:00
<el-button type="primary" @click="script.openAddDialog">发布预警</el-button>
<el-button type="primary" @click="triggerFileSelect">上传线下帮扶</el-button>
2026-04-14 13:46:07 +08:00
<el-button type="primary" @click="script.gotoLedgerPage">线下帮扶台账</el-button>
<el-button type="primary" @click="">立即排班</el-button>
<el-button type="primary" @click="script.gotoDutyPage">值班管理</el-button>
2026-04-13 14:04:56 +08:00
<el-button type="primary" color="#952DE6" @click="">导出</el-button>
<input type="file" ref="fileInput" style="display: none" @change="handleFileSelect" accept=".*"></input>
2026-04-13 14:04:56 +08:00
<!-- <el-button type="primary" @click="script.gotoLedgerPage">驻地台账</el-button> -->
<!-- <el-button type="primary" @click="script.openAddDialog">上报项目</el-button> -->
</div>
<DynamicTable :dataSource="script.tableData.value" :columns="script.columns" :autoHeight="true"
:pagination="script.pagination">
</DynamicTable>
<div class="model-box">
<MyDialog v-model="script.modelVisible.value" :title="script.model?.title"
:dynamicComponent="script.model?.content" :component-props="script.model?.props"
:onConfirm="script.model?.onConfirm" :onCancel="script.model?.onCancel" ref="dialogRef"
:width="script.model?.width">
</MyDialog>
<MyDrawer v-model="script.drawerVisible.value" :title="script.drawer?.title"
:dynamicComponent="script.drawer?.content" :component-props="script.drawer?.props"
:onConfirm="script.drawer?.onConfirm" :onCancel="script.drawer?.onCancel" ref="drawerRef"
:direction="script.drawer?.direction" :size="script.drawer?.size">
</MyDrawer>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
2026-04-13 14:04:56 +08:00
import DynamicTable from "../../../component/DynamicTable/index.js";
import { Search, ArrowDown } from "@element-plus/icons-vue";
import MyDialog from "../../../component/MyDialog/index.js";
import MyDrawer from "../../../component/MyDrawer/index.js";
import scriptFn from "./index.js";
const script = scriptFn();
2026-04-14 16:25:16 +08:00
const { dialogRef, drawerRef } = script;
const fileInput = ref(null);
2026-04-14 16:25:16 +08:00
// 触发文件选择
const triggerFileSelect = () => {
fileInput.value.click();
};
// 处理文件选择
const handleFileSelect = (event) => {
const file = event.target.files[0];
if (file) {
script.uploadFile(file);
}
// 清空input值确保相同文件可以重复选择
event.target.value = '';
};
2026-04-13 14:04:56 +08:00
</script>
<style scoped>
.root {
height: 100%;
padding: 25px;
}
.event-box {
margin: 20px 0;
display: flex;
justify-content: flex-end;
}
</style>