<template> <!-- 排水防涝子系统 公众服务 通知公告--> <div class="publicContainer"> <!-- 搜索区域 --> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> <el-form-item label="水体名称:" prop="riverName" style="width: 250px"> <el-input v-model="queryParams.riverName" placeholder="请输入水体名称" clearable @keyup.enter="handleQuery" /> </el-form-item> <el-form-item> <el-button type="primary" icon="Search" @click="handleQuery">搜索</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="handleAdd" v-hasPermi="['floodSys:jing:add']">新增</el-button> </el-col> <right-toolbar v-model:showSearch="showSearch" @queryTable="getDataList"></right-toolbar> </el-row> <!-- 表格 --> <el-table v-loading="tableLoading" :data="tableData" max-height="650"> <el-table-column label="序号" type="index" width="55" /> <el-table-column label="水体名称" prop="riverName" /> <el-table-column label="河道编码" prop="riverCode"> </el-table-column> <el-table-column label="防洪标准" prop="floodStandard" width="100" /> <el-table-column label="设计雨量(防洪标准24h降雨)" prop="designRainfall" width="150" /> <el-table-column label="境内流域面积(km)" prop="drainageArea"> </el-table-column> <el-table-column label="境内河道长度" prop="riverLength" /> <el-table-column label="河道宽度" prop="riverWidth" /> <el-table-column label="设防水位" prop="fortifyWaterLevel"> </el-table-column> <el-table-column label="空间数据" prop="geometrys" width="200" show-overflow-tooltip /> <el-table-column label="治理措施" prop="governanceMeasures" /> <el-table-column label="简介" prop="introduction" width="400" show-overflow-tooltip> </el-table-column> <el-table-column label="设计流量(立方米/秒)" prop="designFlow" /> <el-table-column label="治理后流量(立方米/秒)" prop="afterGovernance" /> <el-table-column label="达标情况评价" prop="situationEvaluation" width="250" show-overflow-tooltip /> <el-table-column label="操作" width="240" class-name="small-padding fixed-width" fixed="right"> <template #default="scope"> <el-button link icon="View" type="primary" @click="handleDetail(scope.row)">详情</el-button> <el-button link type="warning" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button> <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"> 删除 </el-button> </template> </el-table-column> </el-table> <!-- 分页 --> <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getDataList" /> <!-- 添加或修改弹窗 --> <el-dialog :title="dialogTitle" v-model="dialogShow" width="1100px" append-to-body> <el-form ref="formRef" :model="formData" :rules="rulesForm" label-width="220px" class="publicForm" :disabled="isDisab"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="水体名称:" prop="riverName"> <el-input type="text" v-model="formData.riverName" placeholder="请输入水体名称" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="河道编码:" prop="riverCode"> <el-input type="text" v-model="formData.riverCode" placeholder="请输入河道编码" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="防洪标准:" prop="floodStandard"> <el-input type="text" v-model="formData.floodStandard" placeholder="请输入防洪标准" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="设计雨量(防洪标准24h降雨):" prop="designRainfall"> <el-input type="text" v-model="formData.designRainfall" placeholder="请输入设计雨量(防洪标准24h降雨)" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="境内流域面积(km):" prop="drainageArea"> <el-input type="text" v-model="formData.drainageArea" placeholder="请输入境内流域面积(km)" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="境内河道长度:" prop="riverLength"> <el-input type="text" v-model="formData.riverLength" placeholder="请输入境内河道长度" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="河道宽度:" prop="riverWidth"> <el-input type="text" v-model="formData.riverWidth" placeholder="请输入河道宽度" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="设防水位:" prop="fortifyWaterLevel"> <el-input type="text" v-model="formData.fortifyWaterLevel" placeholder="请输入设防水位" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="空间数据:" prop="geometrys"> <el-input type="text" v-model="formData.geometrys" placeholder="请输入空间数据" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="治理措施:" prop="governanceMeasures"> <el-input type="text" v-model="formData.governanceMeasures" placeholder="请输入治理措施" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="简介:" prop="introduction"> <el-input type="textarea" v-model="formData.introduction" placeholder="请输入简介" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="设计流量(立方米/秒):" prop="designFlow"> <el-input type="text" v-model="formData.designFlow" placeholder="请输入设计流量(立方米/秒)" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="治理后流量(立方米/秒):" prop="afterGovernance"> <el-input type="text" v-model="formData.afterGovernance" placeholder="请输入治理后流量(立方米/秒)" clearable style="width: 100%" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="达标情况评价:" prop="situationEvaluation"> <el-input type="textarea" v-model="formData.situationEvaluation" placeholder="请输入达标情况评价" clearable style="width: 100%" /> </el-form-item> </el-col> </el-row> </el-form> <template #footer> <div class="dialog-footer"> <el-button type="info" @click="cancelForm">取 消</el-button> <el-button type="primary" @click="submitForm" v-show="!isDisab">确 定</el-button> </div> </template> </el-dialog> </div> </template> <script setup name="河道基础信息管理"> import { riverInfoNewpage, riverInfoNewID, riverInfoNewedit, riverInfoNewadd, riverInfoNewdelete } from '@/api/longoPeration/BasicRiver'; import bus from '@/utils/mitt'; const { proxy } = getCurrentInstance(); const isDisab = ref(false); const tableData = ref([]); const tableLoading = ref(true); const total = ref(0); const dialogShow = ref(false); const dialogTitle = ref(''); const showSearch = ref(true); const Editor = ref(null); const allData = reactive({ formData: {}, queryParams: { pageNum: 1, pageSize: 10, }, rulesForm: { riverName: [{ required: true, message: '请输入水体名称', trigger: 'blur' }], riverCode: [{ required: true, message: '请输入河道编码', trigger: 'blur' }], }, }); const { queryParams, formData, rulesForm } = toRefs(allData); /** 获取搜索数据列表 */ function getDataList() { tableLoading.value = true; riverInfoNewpage(queryParams.value).then(response => { tableData.value = response.data; total.value = response.total; tableLoading.value = false; }); } /** 取消按钮 */ function cancelForm() { dialogShow.value = false; } /** 搜索按钮操作 */ function handleQuery() { queryParams.value.pageNum = 1; getDataList(); } /** 重置按钮操作 */ function resetQuery() { proxy.resetForm('queryRef'); handleQuery(); } /** 新增按钮操作 */ function handleAdd() { proxy.resetForm('formRef'); //清空表单 formData.value.content = ' '; dialogShow.value = true; isDisab.value = false; dialogTitle.value = '新增河道基础信息管理'; } /** 修改按钮操作 */ function handleUpdate(row) { riverInfoNewID(row.id).then(response => { dialogShow.value = true; isDisab.value = false; dialogTitle.value = '修改河道基础信息管理'; nextTick(() => { formData.value = response.data; bus.emit('changeEdit', true); }); }); } //详情按钮 function handleDetail(row) { riverInfoNewID(row.id).then(response => { dialogShow.value = true; isDisab.value = true; dialogTitle.value = '查看河道基础信息管理'; nextTick(() => { formData.value = response.data; bus.emit('changeEdit', false); }); }); } /** 提交按钮 */ function submitForm() { proxy.$refs['formRef'].validate(valid => { if (valid) { if (dialogTitle.value == '修改河道基础信息管理') { riverInfoNewedit(formData.value).then(response => { proxy.$modal.msgSuccess('修改成功'); dialogShow.value = false; getDataList(); }); } else { if (formData.value.id) delete formData.value.id; riverInfoNewadd(formData.value).then(response => { proxy.$modal.msgSuccess('新增成功'); dialogShow.value = false; getDataList(); }); } } }); } /** 删除按钮操作 */ function handleDelete(row) { const postIds = row.id; proxy.$modal .confirm('是否确认删除该数据项?') .then(function () { return riverInfoNewdelete(postIds); }) .then(() => { getDataList(); proxy.$modal.msgSuccess('删除成功'); }) .catch(() => {}); } onMounted(() => { getDataList(); }); </script>