<template> <div class="water-analysis-page"> <el-table :data="tableData" v-loading="tableLoading" stripe max-height="500" > <el-table-column type="index" width="55" label="序号" align="center" /> <el-table-column :label="i.label" align="center" :prop="i.props" show-overflow-tooltip v-for="i in hazardRectificationAndReviewCloum" > <template #default="{ row }" v-if="i.props == 'projectName'"> <span @click="onCheck(row, 2, '详情')" class="projectName"> {{ row.projectName }}</span > </template> <template #default="{ row }" v-if="i.props == 'measurTime'"> {{ row.measurTime.substring(0, 10) }} </template> </el-table-column> <el-table-column fixed="right" label="操作" width="180" align="center"> <template #default="{ row }"> <!-- <div v-if="FormList.workFlag=='1'"> <el-button link type="primary" @click="onCheck(row, 3)">提交</el-button> <el-button link type="success" @click="onCheck(row, 1)">撤回</el-button> <el-button link type="success" @click="onCheck(row, 2)">处理</el-button> </div> --> <el-button link type="primary" icon="View" @click="onCheck(row, 2)" >详情</el-button > <el-button link type="danger" icon="Delete" @click="onCheck(row, 3)" >删除</el-button > </template> </el-table-column> </el-table> <pagination v-show="FormList.totals > 0" :total="FormList.totals" v-model:page="FormList.pageNum" v-model:limit="FormList.pageSize" @pagination="getInfoList(FormList)" /> </div> <!-- <projectTable v-else @returnClick="returnClick" :category='category'></projectTable> --> <!-- 查看详情弹框 --> <el-dialog v-model="visible" title="环境监测详情" :modal-append-to-body="false" :close-on-click-modal="false" width="50%" > <tableDalgo ref="tableDalgoRef" v-if="visible" @onModalClose="onModalClose" :typeList="typeList" ></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> </template> <script setup> import { defineExpose } from "vue"; import { getInfo, projectInfoDelete, projectInfoGet, } from "@/api/hazardRectificationAndReview"; import { FileSystemList } from "@/api/project/tenderReview"; import tableDalgo from "./tableDalgo.vue"; import { downloadBlob, formatDate, formatMonths } from "@/utils/projectTable"; import { ElMessage, ElMessageBox } from "element-plus"; import { hazardRectificationAndReviewCloum } from "@/utils/cloums"; const { proxy } = getCurrentInstance(); const { project_operation_pattern, unit_property, credit_line } = proxy.useDict( "project_operation_pattern", "unit_property", "credit_line" ); let visible = ref(false); const FormList = ref({ pageNum: 1, pageSize: 10, workFlag: 1, }); let tableData = ref([]); let tableLoading = ref(false); const tableDalgoRef = ref(); //获取列表数据 const getInfoList = async (prams) => { FormList.value = prams; tableLoading.value = true; let { data, total } = await getInfo(prams); tableData.value = data; FormList.value.totals = total; setTimeout(() => { tableLoading.value = false; }, 500); }; //搜索 defineExpose({ getInfoList }); // 查看上报数据 let typeList = ref({}); const onCheck = (row, v) => { if (v == 2 || v == 4) { projectInfoGet(row.id).then(({ code, data }) => { if (code == 200) { typeList.value = { ...data, type: v }; // FileSystemList({ // refId: row.id, // refType: "proEnvironmentComment", // }).then(({ data }) => { // typeList.value.fileList1 = data; visible.value = true; // }); } }); } else { ElMessageBox.confirm(`您确定删除项目信息吗?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(() => { projectInfoDeleteM( row.id) }) // emgBox(row.id, projectInfoDeleteM, "您确定删除吗?"); } }; //删除 const projectInfoDeleteM = async (id) => { let { code } = await projectInfoDelete(id); ElMessage({ message: "删除成功", type: "success", }); getInfoList(FormList.value); }; function onModalClose() { visible.value = false; console.log(232323); // getInfoList(FormList.value); } function submit() { tableDalgoRef.value.submit(); } onMounted(() => { // getInfoList(FormList.value) }); </script> <style lang="scss" scoped> .water-analysis-page { height: 90vh; .top { // margin-bottom: 15px; } .el-input__inner { // color: #fff;// } ::v-deep .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active { font-size: 18px; color: rgb(255, 255, 255); background-color: rgb(22, 132, 252); border-left: 1px solid rgb(22, 132, 252); } } :deep(.el-dialog__body) { background-color: #eef1fb; height: 500px; overflow: auto; } </style>