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="320"
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
:current-page="currentPage"
|
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
|
:z-index="2100"
|
|
|
|
|
|
:max-width="1000"
|
|
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
|
|
@close="handleClose"
|
|
|
|
|
|
>
|
|
|
|
|
|
<!-- 操作列插槽 -->
|
|
|
|
|
|
<template #operation="{ row }">
|
|
|
|
|
|
<div class="action-btns">
|
|
|
|
|
|
<div class="action-btn" @click="handleVideo(row)" title="视频">
|
|
|
|
|
|
<el-icon><VideoCamera /></el-icon>
|
2026-03-30 10:57:32 +08:00
|
|
|
|
</div>
|
2026-04-08 15:34:49 +08:00
|
|
|
|
<div class="action-btn" @click="handleVoice(row)" title="语音">
|
|
|
|
|
|
<el-icon><Microphone /></el-icon>
|
2026-03-30 10:57:32 +08:00
|
|
|
|
</div>
|
2026-04-08 15:34:49 +08:00
|
|
|
|
<div class="action-btn" @click="handleCall(row)" title="电话">
|
|
|
|
|
|
<el-icon><Phone /></el-icon>
|
2026-03-30 10:57:32 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-04-08 15:34:49 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 驻地名称列插槽 -->
|
|
|
|
|
|
<template #stationName="{ row }">
|
|
|
|
|
|
<el-tooltip :content="row.stationName" placement="top" :show-after="500">
|
|
|
|
|
|
<span class="station-name-text" @click="handleStationNameClick(row)">{{ row.stationName }}</span>
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
</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 { VideoCamera, Microphone, Phone } from "@element-plus/icons-vue";
|
|
|
|
|
|
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", "video", "voice", "call", "stationNameClick"]);
|
|
|
|
|
|
|
2026-04-02 16:35:45 +08:00
|
|
|
|
// 表格列配置
|
|
|
|
|
|
const tableColumns = ref([
|
2026-04-08 15:34:49 +08:00
|
|
|
|
{ prop: "id", label: "序号", width: "60px" },
|
|
|
|
|
|
{ prop: "region", label: "区县/镇街", width: "140px" },
|
|
|
|
|
|
{ prop: "name", label: "姓名", width: "100px" },
|
|
|
|
|
|
{ prop: "phone", label: "电话", width: "120px" },
|
|
|
|
|
|
{ prop: "stationName", label: "驻地名称", width: "180px", slot: "stationName" },
|
|
|
|
|
|
{ prop: "type", label: "类型", width: "auto" },
|
|
|
|
|
|
{ prop: "operation", label: "调度", width: "140px", slot: "operation" },
|
2026-04-02 16:35:45 +08:00
|
|
|
|
]);
|
|
|
|
|
|
|
2026-03-30 10:57:32 +08:00
|
|
|
|
// 表格数据
|
|
|
|
|
|
const tableData = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
region: "沙坪坝区",
|
|
|
|
|
|
name: "赵海浪",
|
2026-04-08 15:34:49 +08:00
|
|
|
|
phone: "18623520688",
|
2026-03-30 10:57:32 +08:00
|
|
|
|
stationName: "沙坪坝区S545茅山峡公路桥新建工程(渝黔铁路扩能改造工程)项目经理部",
|
|
|
|
|
|
type: "交通主管部门",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 2,
|
|
|
|
|
|
region: "沙坪坝区",
|
|
|
|
|
|
name: "府效能",
|
2026-04-08 15:34:49 +08:00
|
|
|
|
phone: "18623520688",
|
2026-03-30 10:57:32 +08:00
|
|
|
|
stationName: "沙坪坝区S545茅山峡公路桥新建工程(渝黔铁路扩能改造工程)项目经理部",
|
|
|
|
|
|
type: "公路机构",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 3,
|
|
|
|
|
|
region: "万州区柏梓镇",
|
|
|
|
|
|
name: "王鑫",
|
2026-04-08 15:34:49 +08:00
|
|
|
|
phone: "18623520688",
|
2026-03-30 10:57:32 +08:00
|
|
|
|
stationName: "万州区项目经理部",
|
|
|
|
|
|
type: "公路机构",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 4,
|
|
|
|
|
|
region: "万州区柏梓镇",
|
|
|
|
|
|
name: "王鑫",
|
2026-04-08 15:34:49 +08:00
|
|
|
|
phone: "18623520688",
|
2026-03-30 10:57:32 +08:00
|
|
|
|
stationName: "万州区项目经理部",
|
|
|
|
|
|
type: "公路机构",
|
|
|
|
|
|
},
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
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 handleVideo = (item) => {
|
|
|
|
|
|
emit("video", item);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleVoice = (item) => {
|
|
|
|
|
|
emit("voice", item);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleCall = (item) => {
|
|
|
|
|
|
emit("call", item);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 点击驻地名称
|
|
|
|
|
|
const handleStationNameClick = (item) => {
|
|
|
|
|
|
emit("stationNameClick", 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
|
|
|
|
// 操作按钮样式
|
|
|
|
|
|
.action-btns {
|
2026-03-30 10:57:32 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
2026-04-08 15:34:49 +08:00
|
|
|
|
gap: 16px;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
|
.action-btn {
|
|
|
|
|
|
width: 28px;
|
|
|
|
|
|
height: 28px;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
display: flex;
|
2026-04-08 15:34:49 +08:00
|
|
|
|
align-items: center;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
justify-content: center;
|
|
|
|
|
|
color: rgba(255, 255, 255, 0.7);
|
|
|
|
|
|
cursor: pointer;
|
2026-04-08 15:34:49 +08:00
|
|
|
|
font-size: 18px;
|
|
|
|
|
|
transition: all 0.3s;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2026-04-08 15:34:49 +08:00
|
|
|
|
color: #40a9ff;
|
|
|
|
|
|
transform: scale(1.1);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
|
.el-icon {
|
|
|
|
|
|
font-size: 18px;
|
2026-03-30 10:57:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
|
// 驻地名称样式
|
|
|
|
|
|
.station-name-text {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
max-width: 180px;
|
|
|
|
|
|
color: #40a9ff;
|
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
|
color: #69c0ff;
|
|
|
|
|
|
text-shadow: 0 0 8px rgba(105, 192, 255, 0.6);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|