<template> <!-- 单位维护 --> <div class="water-analysis-page" :key="isFlag"> <div class="top"> <el-form label-width="auto" ref="ruleForm" inline :model="tableData" v-show="showSearch"> <el-form-item label="单位名称:" prop="unitName"> <el-input clearable v-model="tableData.unitName" placeholder="请输入单位名称" style="width: 240px"></el-input> </el-form-item> <el-form-item label="类型:" prop="unitType"> <el-select clearable v-model="tableData.unitType" placeholder="请选择类型"> <el-option v-for="dict in unit_type" :key="dict.stCode" :label="dict.label" :value="dict.value"></el-option> </el-select> </el-form-item> <el-form-item label="单位属性:" prop="unitProperty"> <el-select clearable v-model="tableData.unitProperty" placeholder="请选择单位属性"> <el-option v-for="dict in unit_property" :key="dict.stCode" :label="dict.label" :value="dict.value"></el-option> </el-select> </el-form-item> <el-form-item label="责任人:" prop="primaryConcatPersonName"> <el-input clearable v-model="tableData.primaryConcatPersonName" placeholder="请输入责任人" style="width: 240px"></el-input> </el-form-item> <el-form-item> <el-button type="primary" icon="Search" @click="searchForm"> 搜索</el-button> <el-button icon="Refresh" @click="resectClcik"> 重置</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('add')" v-hasPermi="['system:post:add']">新增</el-button> </el-col> <right-toolbar v-model:showSearch="showSearch" @queryTable="searchForm"></right-toolbar> </el-row> </div> <todoDon ref="todoDonRef" :tableData="tableData"></todoDon> <el-dialog v-model="visible" title="单位维护新增" :modal-append-to-body="false" :close-on-click-modal="false" width="65%"> <tableDalgo :typeList="typeList" @onModalClose="onModalClose" ref="tableDalgoRef"></tableDalgo> <template #footer> <div class="dialog-footer"> <el-button @click="open2" type="primary">保 存</el-button> <el-button @click="visible = false">关闭</el-button> </div> </template> </el-dialog> </div> </template> <script setup> import tableDalgo from './tableDalgo.vue'; import todoDon from './todoDon.vue'; import { formatMonths } from '@/utils'; const { proxy } = getCurrentInstance(); const { unit_type, unit_property } = proxy.useDict('unit_type', 'unit_property'); const todoDonRef = ref(null); const ruleForm = ref(null); const tableDalgoRef = ref(); let typeList = reactive({}); import { reactive } from 'vue'; let visible = ref(false); let isFlag = ref(1); const showSearch = ref(true); //动态组件 let dataForm = reactive({ date: formatMonths(new Date()), tableData: { pageNum: 1, pageSize: 10 }, tableDateTwo: '', tableLoading: true, }); let { tableData } = toRefs(dataForm); //搜索 const searchForm = () => { todoDonRef.value.search(tableData.value); // isFlag.value++ }; function resectClcik() { tableData.value = { pageNum: 1, pageSize: 10 }; todoDonRef.value.search(tableData.value); } // 查看上报数据 const onCheck = ty => { typeList.add = ty; visible.value = true; nextTick(() => { tableDalgoRef.value.desertFilds(); }); }; function onModalClose() { visible.value = false; todoDonRef.value.search(tableData.value); } function open2() { tableDalgoRef.value.submit(); todoDonRef.value.search(tableData.value); } onMounted(() => { // getTableData(Date.parse(date.value)); }); </script> <style lang="scss" scoped> .water-analysis-page { padding: 20px; height: 90vh; } </style>