2026-03-30 10:57:32 +08:00
|
|
|
|
<template>
|
2026-04-08 15:34:49 +08:00
|
|
|
|
<base-dialog
|
|
|
|
|
|
v-model:visible="props.visible"
|
2026-04-17 14:50:25 +08:00
|
|
|
|
:title="props.allCountyData.name + '基本信息表'"
|
2026-04-08 15:34:49 +08:00
|
|
|
|
: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">
|
2026-04-17 14:50:25 +08:00
|
|
|
|
<span class="station-name-text" @click="handleStationNameClick(row)">
|
|
|
|
|
|
{{ row.stationName }}
|
|
|
|
|
|
</span>
|
2026-04-08 15:34:49 +08:00
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</base-dialog>
|
2026-03-30 10:57:32 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2026-04-17 14:50:25 +08:00
|
|
|
|
import { ref, computed, watch } from 'vue';
|
|
|
|
|
|
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,
|
|
|
|
|
|
},
|
2026-04-17 14:50:25 +08:00
|
|
|
|
allCountyData: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
default: () => {},
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
tongnanInfoItemData: {
|
|
|
|
|
|
type: Object,
|
|
|
|
|
|
default: () => ({
|
|
|
|
|
|
name: '',
|
|
|
|
|
|
}),
|
|
|
|
|
|
},
|
2026-03-30 10:57:32 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const emit = defineEmits(['update:visible', 'close', 'video', 'voice', 'call', 'stationNameClick']);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
2026-04-02 16:35:45 +08:00
|
|
|
|
// 表格列配置
|
|
|
|
|
|
const tableColumns = ref([
|
2026-04-20 10:22:34 +08:00
|
|
|
|
{ prop: 'id', label: '序号', width: '' },
|
|
|
|
|
|
{ prop: 'region', label: '区县/镇街', width: '' },
|
|
|
|
|
|
{ prop: 'name', label: '姓名', width: '' },
|
|
|
|
|
|
{ prop: 'phone', label: '电话', width: '' },
|
|
|
|
|
|
// { prop: 'stationName', label: '驻地名称', width: '180px', slot: 'stationName' },
|
2026-04-17 14:50:25 +08:00
|
|
|
|
{ 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,
|
2026-04-17 14:50:25 +08:00
|
|
|
|
region: '沙坪坝区',
|
|
|
|
|
|
name: '赵海浪',
|
|
|
|
|
|
phone: '18623520688',
|
|
|
|
|
|
stationName: '沙坪坝区S545茅山峡公路桥新建工程(渝黔铁路扩能改造工程)项目经理部',
|
|
|
|
|
|
type: '交通主管部门',
|
2026-03-30 10:57:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 2,
|
2026-04-17 14:50:25 +08:00
|
|
|
|
region: '沙坪坝区',
|
|
|
|
|
|
name: '府效能',
|
|
|
|
|
|
phone: '18623520688',
|
|
|
|
|
|
stationName: '沙坪坝区S545茅山峡公路桥新建工程(渝黔铁路扩能改造工程)项目经理部',
|
|
|
|
|
|
type: '公路机构',
|
2026-03-30 10:57:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 3,
|
2026-04-17 14:50:25 +08:00
|
|
|
|
region: '万州区柏梓镇',
|
|
|
|
|
|
name: '王鑫',
|
|
|
|
|
|
phone: '18623520688',
|
|
|
|
|
|
stationName: '万州区项目经理部',
|
|
|
|
|
|
type: '公路机构',
|
2026-03-30 10:57:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 4,
|
2026-04-17 14:50:25 +08:00
|
|
|
|
region: '万州区柏梓镇',
|
|
|
|
|
|
name: '王鑫',
|
|
|
|
|
|
phone: '18623520688',
|
|
|
|
|
|
stationName: '万州区项目经理部',
|
|
|
|
|
|
type: '公路机构',
|
2026-03-30 10:57:32 +08:00
|
|
|
|
},
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
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 = () => {
|
2026-04-17 14:50:25 +08:00
|
|
|
|
emit('update:visible', false);
|
|
|
|
|
|
emit('close');
|
2026-03-30 10:57:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
|
// 点击遮罩关闭已由base-dialog组件处理
|
2026-03-30 10:57:32 +08:00
|
|
|
|
|
|
|
|
|
|
// 操作按钮
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const handleVideo = item => {
|
|
|
|
|
|
emit('video', item);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const handleVoice = item => {
|
|
|
|
|
|
emit('voice', item);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const handleCall = item => {
|
|
|
|
|
|
emit('call', item);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 点击驻地名称
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const handleStationNameClick = item => {
|
|
|
|
|
|
emit('stationNameClick', item);
|
2026-03-30 10:57:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-04-08 15:34:49 +08:00
|
|
|
|
// 分页事件处理
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const handleSizeChange = size => {
|
2026-04-08 15:34:49 +08:00
|
|
|
|
pageSize.value = size;
|
|
|
|
|
|
currentPage.value = 1;
|
|
|
|
|
|
fetchData();
|
2026-03-30 10:57:32 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
2026-04-17 14:50:25 +08:00
|
|
|
|
const handleCurrentChange = page => {
|
2026-03-30 10:57:32 +08:00
|
|
|
|
currentPage.value = page;
|
|
|
|
|
|
fetchData();
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 获取数据
|
|
|
|
|
|
const fetchData = () => {
|
2026-04-17 14:50:25 +08:00
|
|
|
|
console.log('获取第', currentPage.value, '页数据');
|
2026-03-30 10:57:32 +08:00
|
|
|
|
// 实际项目中调用API获取数据
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 监听visible变化
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => props.visible,
|
2026-04-17 14:50:25 +08:00
|
|
|
|
newVal => {
|
2026-03-30 10:57:32 +08:00
|
|
|
|
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-17 14:50:25 +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>
|