From 2b4328392746fc59f5edf98fed629f8db2804e18 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期三, 27 七月 2022 09:29:23 +0800 Subject: [PATCH] 对接 --- src/views/contingencyManagement/emergencyPlanStartRecord/index.vue | 133 ++++++++++++++++++++++++-------------------- 1 files changed, 73 insertions(+), 60 deletions(-) diff --git a/src/views/contingencyManagement/emergencyPlanStartRecord/index.vue b/src/views/contingencyManagement/emergencyPlanStartRecord/index.vue index d60ce4e..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" /> @@ -100,7 +97,6 @@ </el-card> <SelectEmergencyPlan ref="showRef"/> <OpenSee ref="editRef" /> - <upData ref="upShow"></upData> </div> </template> @@ -108,7 +104,7 @@ import { // toRefs, reactive, - // onMounted, + onMounted, ref, defineComponent } from 'vue'; @@ -126,11 +122,12 @@ Download, Refresh, View, + Edit, EditPen, } from '@element-plus/icons-vue' import OpenSee from '/@/views/contingencyManagement/emergencyPlanStartRecord/component/openSee.vue'; -import UpData from '/@/views/contingencyManagement/panManagement/component/upData.vue'; import SelectEmergencyPlan from '/@/views/contingencyManagement/emergencyPlanStartRecord/component/selectEmergencyPlan.vue' +import {emergencyPlanLogApi} from "/@/api/emergencyPlanLog"; // 定义表格数据类型 interface User { @@ -151,32 +148,22 @@ View, EditPen, Plus, - // Edit, + Edit, Delete, SelectEmergencyPlan, Download, Refresh, - UpData }, 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[]>([]) @@ -185,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); }; @@ -249,6 +253,9 @@ const handleCurrentChange = (val: number) => { console.log(`current page: ${val}`); }; + onMounted(() => { + listApi(); + }); return { // value, // options, @@ -265,10 +272,16 @@ handleSizeChange, handleCurrentChange, ruleFormRef, - ruleForm, + listApi, Search, daiInpt, showRef, + total, + onMounted, + submitReset, + listQuery, + Edit, + View, // ...toRefs(state), }; }, -- Gitblit v1.9.2