2026-03-30 10:57:32 +08:00
|
|
|
<template>
|
2026-04-08 15:34:49 +08:00
|
|
|
<base-dialog
|
|
|
|
|
v-model:visible="props.visible"
|
|
|
|
|
title="潼南建设项目责任人明细"
|
|
|
|
|
:table-data="tableData"
|
|
|
|
|
:table-columns="tableColumns"
|
|
|
|
|
:table-height="400"
|
|
|
|
|
:total="total"
|
|
|
|
|
:current-page="currentPage"
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
:z-index="1000"
|
|
|
|
|
:max-width="1100"
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
@close="handleClose"
|
|
|
|
|
>
|
|
|
|
|
<!-- 操作列插槽 -->
|
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
<span class="detail-link" @click="handleDetail(row)">详情</span>
|
|
|
|
|
</template>
|
|
|
|
|
</base-dialog>
|
2026-03-30 10:57:32 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref, computed, watch } from "vue";
|
2026-04-08 15:34:49 +08:00
|
|
|
import baseDialog from "../component/baseDialog.vue";
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
visible: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
default: false,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(["update:visible", "close", "detail"]);
|
|
|
|
|
|
2026-04-02 16:35:45 +08:00
|
|
|
// 表格列配置
|
|
|
|
|
const tableColumns = ref([
|
2026-04-08 15:34:49 +08:00
|
|
|
{ prop: "id", label: "序号", width: "" },
|
|
|
|
|
{ prop: "region", label: "区县/镇街", width: "" },
|
|
|
|
|
{ prop: "totalCount", label: "总人数", width: "" },
|
|
|
|
|
{ prop: "whistleblower", label: "吹哨人", width: "" },
|
|
|
|
|
{ prop: "constructionUnit", label: "建设单位包保责任人", width: "" },
|
|
|
|
|
{ prop: "contractorUnit", label: "施工单位包保责任人", width: "" },
|
|
|
|
|
{ prop: "stationed", label: "驻地包保责任人", width: "" },
|
|
|
|
|
{ prop: "districtLevel", label: "区县级包保责任人", width: "" },
|
|
|
|
|
{ prop: "cityLevel", label: "市级包保责任人", width: "" },
|
|
|
|
|
{ prop: "operation", label: "操作", width: "60px", slot: "operation" },
|
2026-04-02 16:35:45 +08:00
|
|
|
]);
|
|
|
|
|
|
2026-03-30 10:57:32 +08:00
|
|
|
// 表格数据
|
|
|
|
|
const tableData = ref([
|
|
|
|
|
{
|
|
|
|
|
id: 1,
|
|
|
|
|
region: "万州区",
|
|
|
|
|
totalCount: 6,
|
|
|
|
|
whistleblower: 2,
|
|
|
|
|
constructionUnit: 2,
|
|
|
|
|
contractorUnit: 2,
|
|
|
|
|
stationed: 2,
|
|
|
|
|
districtLevel: 2,
|
|
|
|
|
cityLevel: 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: 2,
|
|
|
|
|
region: "柏梓镇",
|
|
|
|
|
totalCount: 6,
|
|
|
|
|
whistleblower: 2,
|
|
|
|
|
constructionUnit: 2,
|
|
|
|
|
contractorUnit: 2,
|
|
|
|
|
stationed: 2,
|
|
|
|
|
districtLevel: 2,
|
|
|
|
|
cityLevel: 2,
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
const currentPage = ref(1);
|
|
|
|
|
const pageSize = ref(10);
|
|
|
|
|
const total = ref(36);
|
|
|
|
|
|
|
|
|
|
const totalPages = computed(() => Math.ceil(total.value / pageSize.value));
|
|
|
|
|
|
|
|
|
|
const visiblePages = computed(() => {
|
|
|
|
|
const pages = [];
|
|
|
|
|
const maxVisible = 4;
|
|
|
|
|
let start = Math.max(1, currentPage.value - Math.floor(maxVisible / 2));
|
|
|
|
|
let end = Math.min(totalPages.value, start + maxVisible - 1);
|
|
|
|
|
|
|
|
|
|
if (end - start + 1 < maxVisible) {
|
|
|
|
|
start = Math.max(1, end - maxVisible + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let i = start; i <= end; i++) {
|
|
|
|
|
pages.push(i);
|
|
|
|
|
}
|
|
|
|
|
return pages;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 关闭对话框
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
emit("update:visible", false);
|
|
|
|
|
emit("close");
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
// 点击遮罩关闭已由base-dialog组件处理
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
// 查看详情
|
|
|
|
|
const handleDetail = (item) => {
|
|
|
|
|
emit("detail", item);
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
// 分页事件处理
|
|
|
|
|
const handleSizeChange = (size) => {
|
|
|
|
|
pageSize.value = size;
|
|
|
|
|
currentPage.value = 1;
|
|
|
|
|
fetchData();
|
2026-03-30 10:57:32 +08:00
|
|
|
};
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
const handleCurrentChange = (page) => {
|
2026-03-30 10:57:32 +08:00
|
|
|
currentPage.value = page;
|
|
|
|
|
fetchData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取数据
|
|
|
|
|
const fetchData = () => {
|
|
|
|
|
console.log("获取第", currentPage.value, "页数据");
|
|
|
|
|
// 实际项目中调用API获取数据
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听visible变化
|
|
|
|
|
watch(
|
|
|
|
|
() => props.visible,
|
|
|
|
|
(newVal) => {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
currentPage.value = 1;
|
|
|
|
|
fetchData();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2026-04-08 15:34:49 +08:00
|
|
|
// 详情链接样式
|
|
|
|
|
.detail-link {
|
|
|
|
|
color: #40a9ff;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
color: #69c0ff;
|
|
|
|
|
text-decoration: underline;
|
2026-03-30 10:57:32 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|