From 53ed3f94c44709c5d571d580dccd8149f020ffb7 Mon Sep 17 00:00:00 2001 From: 13937891274 <kxc0822> Date: 星期五, 22 七月 2022 11:00:42 +0800 Subject: [PATCH] 应急预案一览对接 --- src/views/contingencyManagement/emergencyPlanStartRecord/index.vue | 130 ++++++++++++++++++++++++------------------- 1 files changed, 73 insertions(+), 57 deletions(-) diff --git a/src/views/contingencyManagement/emergencyPlanStartRecord/index.vue b/src/views/contingencyManagement/emergencyPlanStartRecord/index.vue index deb5088..81f3aa9 100644 --- a/src/views/contingencyManagement/emergencyPlanStartRecord/index.vue +++ b/src/views/contingencyManagement/emergencyPlanStartRecord/index.vue @@ -4,14 +4,13 @@ <div class="system-user-search mb15"> <el-form ref="ruleFormRef" - :model="ruleForm" size="default" label-width="80px" :inline="true" > <el-form-item prop="telephone" > <el-input - v-model="ruleForm.teamLeader" + v-model="listQuery.searchParams.planId" placeholder="请选择应急预案" class="input-with-select" > @@ -20,7 +19,7 @@ </template> </el-input> </el-form-item> - <el-button size="default" type="primary" class="ml10"> + <el-button size="default" type="primary" class="ml10" @click="listApi"> 查询 </el-button> <el-button size="default" class="ml10" @click="submitReset"> @@ -84,15 +83,13 @@ </el-table> <div class="pages"> <el-pagination + v-if="tableData.length == 0 ? false : true" v-model:currentPage="pageIndex" v-model:page-size="pageSize" :page-sizes="[10, 20, 30]" :pager-count="5" - :small="small" - :disabled="disabled" - :background="background" layout="total, sizes, prev, pager, next, jumper" - :total="40" + :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" /> @@ -107,7 +104,7 @@ import { // toRefs, reactive, - // onMounted, + onMounted, ref, defineComponent } from 'vue'; @@ -125,10 +122,12 @@ Download, Refresh, View, + Edit, EditPen, } from '@element-plus/icons-vue' import OpenSee from '/@/views/contingencyManagement/emergencyPlanStartRecord/component/openSee.vue'; import SelectEmergencyPlan from '/@/views/contingencyManagement/emergencyPlanStartRecord/component/selectEmergencyPlan.vue' +import {emergencyPlanLogApi} from "/@/api/emergencyPlanLog"; // 定义表格数据类型 interface User { @@ -149,7 +148,7 @@ View, EditPen, Plus, - // Edit, + Edit, Delete, SelectEmergencyPlan, Download, @@ -157,23 +156,14 @@ }, setup() { const ruleFormRef = ref<FormInstance>() - //定义表单 - const ruleForm = reactive({ - teamName: '', // 队伍名称 - teamLeader: '', //队伍负责人 - department: [], // 负责人部门 - phone: '', // 负责人手机 - telephone: '', // 固定电话 + // 列表参数 + const listQuery = reactive({ + pageIndex: 1, + pageSize: 10, + searchParams: { + planId: '', + }, }); - // const seeRef = ref(); - const editRef = ref(); - // 选择框 - // const value = ref(''); - // const options = - // { - // value: 'Option1', - // label: 'Option1', - // }; const multipleTableRef = ref<InstanceType<typeof ElTable>>() const multipleSelection = ref<User[]>([]) @@ -182,39 +172,56 @@ const upButton=()=>{ upShow.value.openDialog() } - // 定义表格数据 - const tableData: User[] = [ - { - teamName: '消防安全绳', - teamLevel: 'YJWZ20210208104332', - teamDescription: '安全管理部', - materialClassification: '事故气体吸收装置', - }, - { - teamName: '消防安全绳', - teamLevel: 'YJWZ20210208104332', - teamDescription: '安全管理部', - materialClassification: '事故气体吸收装置', - }, - { - teamName: '消防安全绳', - teamLevel: 'YJWZ20210208104332', - teamDescription: '安全管理部', - materialClassification: '事故气体吸收装置', - }, - { - teamName: '消防安全绳', - teamLevel: 'YJWZ20210208104332', - teamDescription: '安全管理部', - materialClassification: '事故气体吸收装置', + // 请求列表数据 + const listApi = async () => { + let res = await emergencyPlanLogApi().getEmergencyPlanLogList(listQuery); + console.log(res); + if (res.data.code == 200) { + tableData.value = res.data.data; + pageIndex.value = res.data.pageIndex; + pageSize.value = res.data.pageSize; + total.value = res.data.total; + } else { + ElMessage.error(res.data.msg); } - ] - // // 打开新增用户弹窗 - // const addRef = ref(); - // const onOpenAdd = () => { - // addRef.value.openDialog(); - // }; + }; + //重置 + const submitReset = () => { + listQuery.searchParams.planId = ''; + listApi(); + }; + const total = ref(); + const tableData = ref([]); + // 定义表格数据 + // const tableData: User[] = [ + // { + // teamName: '消防安全绳', + // teamLevel: 'YJWZ20210208104332', + // teamDescription: '安全管理部', + // materialClassification: '事故气体吸收装置', + // }, + // { + // teamName: '消防安全绳', + // teamLevel: 'YJWZ20210208104332', + // teamDescription: '安全管理部', + // materialClassification: '事故气体吸收装置', + // }, + // { + // teamName: '消防安全绳', + // teamLevel: 'YJWZ20210208104332', + // teamDescription: '安全管理部', + // materialClassification: '事故气体吸收装置', + // }, + // { + // teamName: '消防安全绳', + // teamLevel: 'YJWZ20210208104332', + // teamDescription: '安全管理部', + // materialClassification: '事故气体吸收装置', + // } + // ] + // // 打开修改用户弹窗 + const editRef = ref(); const OnOpenSee = (row: TableDataRow) => { editRef.value.openDialog(row); }; @@ -246,6 +253,9 @@ const handleCurrentChange = (val: number) => { console.log(`current page: ${val}`); }; + onMounted(() => { + listApi(); + }); return { // value, // options, @@ -262,10 +272,16 @@ handleSizeChange, handleCurrentChange, ruleFormRef, - ruleForm, + listApi, Search, daiInpt, showRef, + total, + onMounted, + submitReset, + listQuery, + Edit, + View, // ...toRefs(state), }; }, -- Gitblit v1.9.2