<template> <div class="water-analysis-page"> <div class="top"> <el-form label-width="auto" ref="ruleForm" inline :model="tableData" v-show="showSearch" > <el-form-item label="项目名称:" prop="projectName"> <el-input clearable v-model="tableData.projectName" placeholder="请输入项目名称" style="width: 240px" ></el-input> </el-form-item> <el-form-item label="仪器名称:" prop="instrumentName"> <el-input clearable v-model="tableData.instrumentName" style="width: 240px" placeholder="请输入仪器名称" ></el-input> </el-form-item> <el-form-item label="测量人:" prop="measurUserName"> <el-input clearable v-model="tableData.measurUserName" style="width: 200px" placeholder="请输入测量人" ></el-input> </el-form-item> <el-form-item label="责任人:" prop="measurDutyUserName"> <el-input clearable v-model="tableData.measurDutyUserName" style="width: 200px" placeholder="请输入责任人" ></el-input> </el-form-item> <el-form-item label="测量日期:"> <el-date-picker v-model="tableData.timer" value-format="YYYY-MM-DD" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" style="width: 240px" ></el-date-picker> </el-form-item> <el-form-item> <el-button type="primary" icon="Search" @click="searchForm"> 查询</el-button > <el-button icon="Refresh" @click="resetQuery">重置</el-button> </el-form-item> </el-form> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> <el-button type="primary" plain icon="Plus" @click="onCheck(4)" v-hasPermi="['system:post:add']" >新增</el-button > </el-col> <right-toolbar v-model:showSearch="showSearch" @queryTable="searchForm" ></right-toolbar> </el-row> </div> <!-- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-top: -10px;" type="border-card"> <el-tab-pane label="待办列表" name="1"> --> <todoDon ref="todoDonRef"></todoDon> <!-- </el-tab-pane> <el-tab-pane label="已办列表" name="2"> <todoDon ref="todoDonRef"></todoDon> </el-tab-pane> </el-tabs> --> <el-dialog v-model="visible" title="环境监测新增" :modal-append-to-body="false" :close-on-click-modal="false" width="50%" > <tableDalgo ref="tableDalgoRef" :typeList="typeList" @onModalClose="onModalClose" ></tableDalgo> <template #footer> <div class="dialog-footer"> <el-button v-show="typeList.type != 2" type="primary" @click="submit" >保存 </el-button> <el-button @click="visible = false">关闭</el-button> </div> </template> </el-dialog> </div> <!-- 查看详情弹框 --> </template> <script setup> import { reactive } from "vue"; import tableDalgo from "./hazardCopmonents/tableDalgo"; import todoDon from "./hazardCopmonents/todoDon.vue"; const { proxy } = getCurrentInstance(); const { project_operation_pattern } = proxy.useDict( "project_operation_pattern" ); const todoDonRef = ref(null); const lcProject = ref([{}, {}]); let typeList = ref({}); const showSearch = ref(true); const activeName = ref("1"); const acKey = ref(0); let visible = ref(false); const tableDalgoRef = ref(); //动态组件 let dataForm = reactive({ tableData: { pageNum: 1, pageSize: 10, workFlag: 1 }, }); let { tableData } = toRefs(dataForm); //搜索 const searchForm = () => { if (tableData.value.timer) { tableData.value.measurStartTime = tableData.value.timer[0]; tableData.value.measurEndTime = tableData.value.timer[1]; } else { tableData.value.measurStartTime = ""; tableData.value.measurEndTime = ""; } todoDonRef.value.getInfoList(tableData.value); }; function resetQuery() { tableData.value = { pageNum: 1, pageSize: 10 }; todoDonRef.value.getInfoList(tableData.value); } // 新增 const onCheck = (v) => { typeList.value.type = v; visible.value = true; nextTick(()=>{ tableDalgoRef.value.desertFilds() }) }; //关闭 function onModalClose() { visible.value = false; todoDonRef.value.getInfoList(tableData.value); } function submit() { tableDalgoRef.value.submit(); } onMounted(() => { todoDonRef.value.getInfoList(tableData.value); }); </script> <style lang="scss" scoped> .water-analysis-page { padding: 20px; height: 90vh; .top { // margin-bottom: 15px; } .el-input__inner { // color: #fff;// } } :deep(.el-dialog__body) { background-color: #eef1fb; height: 500px; overflow: hidden; } </style>