2026-05-19 18:56:33 +08:00
|
|
|
<!-- d:\wordpack\WholeProcessPlatform\frontend\src\views\system\map\components\TiltPhotoManagement\index.vue -->
|
|
|
|
|
<template>
|
2026-05-20 17:55:48 +08:00
|
|
|
<div class="content">
|
2026-05-19 18:56:33 +08:00
|
|
|
<TiltPhotoManagementSearch
|
|
|
|
|
ref="tiltPhotoManagementSearch"
|
|
|
|
|
:handle-add="handleAdd"
|
|
|
|
|
@reset="handleReset"
|
|
|
|
|
@search-finish="onSearchFinish"
|
|
|
|
|
/>
|
|
|
|
|
<BasicTable
|
2026-05-25 08:54:17 +08:00
|
|
|
ref="basicTable"
|
2026-05-19 18:56:33 +08:00
|
|
|
:columns="columns"
|
2026-05-25 08:54:17 +08:00
|
|
|
:list-url="getAllTiltPhotoTree"
|
2026-05-19 18:56:33 +08:00
|
|
|
:search-params="searchParams"
|
|
|
|
|
>
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.key === 'action'">
|
2026-05-20 17:55:48 +08:00
|
|
|
<div class="flex gap-[6px]">
|
2026-05-25 08:54:17 +08:00
|
|
|
<a-button class="!p-0" type="link" size="small" @click="handleEdit(record)"
|
2026-05-19 18:56:33 +08:00
|
|
|
>编辑</a-button
|
|
|
|
|
>
|
|
|
|
|
<a-button
|
2026-05-20 17:55:48 +08:00
|
|
|
class="!p-0"
|
2026-05-19 18:56:33 +08:00
|
|
|
type="link"
|
|
|
|
|
size="small"
|
|
|
|
|
danger
|
|
|
|
|
@click="handleDelete(record)"
|
|
|
|
|
>删除</a-button
|
|
|
|
|
>
|
2026-05-20 17:55:48 +08:00
|
|
|
</div>
|
2026-05-19 18:56:33 +08:00
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
|
|
|
|
<TiltPhotoManagementForm
|
|
|
|
|
ref="tiltPhotoManagementForm"
|
|
|
|
|
v-model:visible="editModalVisible"
|
|
|
|
|
:initial-values="currentRecord"
|
|
|
|
|
@cancel="editModalCancel"
|
|
|
|
|
@ok="handleEditSubmit"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2026-05-25 08:54:17 +08:00
|
|
|
import { ref, nextTick, onMounted } from "vue";
|
|
|
|
|
import BasicTable from "@/components/BasicTable/index.vue";
|
|
|
|
|
import TiltPhotoManagementSearch from "./TiltPhotoManagementSearch.vue";
|
|
|
|
|
import TiltPhotoManagementForm from "./TiltPhotoManagementForm.vue";
|
|
|
|
|
import { message, Modal } from "ant-design-vue";
|
|
|
|
|
import {
|
|
|
|
|
getAllTiltPhotoTree,
|
|
|
|
|
saveTiltPhoto,
|
|
|
|
|
deleteTiltPhoto,
|
|
|
|
|
} from "@/api/system/map/TiltPhotoManagement";
|
2026-05-19 18:56:33 +08:00
|
|
|
// 表格列配置
|
|
|
|
|
const columns = [
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "序号",
|
|
|
|
|
dataIndex: "index",
|
|
|
|
|
key: "index",
|
2026-05-20 17:55:48 +08:00
|
|
|
width: 60,
|
2026-05-25 08:54:17 +08:00
|
|
|
align: "center",
|
|
|
|
|
customRender: ({ text, record, index }) => index + 1,
|
2026-05-20 17:55:48 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "倾斜影像名称",
|
|
|
|
|
dataIndex: "stnm",
|
|
|
|
|
key: "stnm",
|
|
|
|
|
width: 150,
|
2026-05-19 18:56:33 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "URL",
|
|
|
|
|
dataIndex: "url",
|
|
|
|
|
key: "url",
|
|
|
|
|
width: 360,
|
2026-05-20 17:55:48 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "所在河段",
|
|
|
|
|
dataIndex: "hbrvcdName",
|
|
|
|
|
key: "hbrvcdName",
|
|
|
|
|
width: 120,
|
2026-05-19 18:56:33 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "所属电站",
|
|
|
|
|
key: "ennm",
|
|
|
|
|
dataIndex: "ennm",
|
|
|
|
|
width: 140,
|
2026-05-19 18:56:33 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "创建人",
|
|
|
|
|
key: "recordUser",
|
|
|
|
|
dataIndex: "recordUser",
|
2026-05-19 18:56:33 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "创建时间",
|
|
|
|
|
key: "recordTime",
|
|
|
|
|
dataIndex: "recordTime",
|
|
|
|
|
width: 150,
|
2026-05-20 17:55:48 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "更新时间",
|
|
|
|
|
key: "modifyTime",
|
|
|
|
|
dataIndex: "modifyTime",
|
|
|
|
|
width: 150,
|
2026-05-19 18:56:33 +08:00
|
|
|
},
|
|
|
|
|
{
|
2026-05-25 08:54:17 +08:00
|
|
|
title: "操作",
|
|
|
|
|
key: "action",
|
2026-05-20 17:55:48 +08:00
|
|
|
width: 80,
|
2026-05-25 08:54:17 +08:00
|
|
|
fixed: "right",
|
|
|
|
|
},
|
2026-05-19 18:56:33 +08:00
|
|
|
];
|
|
|
|
|
|
2026-05-25 08:54:17 +08:00
|
|
|
// 表格实例
|
|
|
|
|
const basicTable = ref<any>(null);
|
2026-05-19 18:56:33 +08:00
|
|
|
// 搜索参数
|
|
|
|
|
const searchParams = ref({});
|
|
|
|
|
// 编辑弹窗数据
|
|
|
|
|
const currentRecord = ref<any | null>(null);
|
|
|
|
|
const editModalVisible = ref(false);
|
|
|
|
|
|
2026-05-25 08:54:17 +08:00
|
|
|
// 添加处理
|
2026-05-19 18:56:33 +08:00
|
|
|
const handleAdd = () => {
|
|
|
|
|
currentRecord.value = null;
|
|
|
|
|
editModalVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 编辑处理
|
|
|
|
|
const handleEdit = (record: any) => {
|
|
|
|
|
currentRecord.value = { ...record };
|
|
|
|
|
editModalVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 删除处理
|
|
|
|
|
const handleDelete = (record: any) => {
|
2026-05-25 08:54:17 +08:00
|
|
|
Modal.confirm({
|
|
|
|
|
title: "确认删除",
|
|
|
|
|
content: "确定要删除选中的记录吗?",
|
|
|
|
|
zIndex: 2002,
|
|
|
|
|
onOk: async () => {
|
|
|
|
|
try {
|
|
|
|
|
let res = await deleteTiltPhoto({ id: record.id });
|
|
|
|
|
message.success("删除成功");
|
|
|
|
|
basicTable.value.refresh();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
message.error("删除失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
2026-05-19 18:56:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 搜索完成处理
|
|
|
|
|
const onSearchFinish = (values: any) => {
|
2026-05-25 08:54:17 +08:00
|
|
|
const params = {
|
|
|
|
|
logic: "and",
|
|
|
|
|
filters: [
|
|
|
|
|
values.parentId
|
|
|
|
|
? {
|
|
|
|
|
field: "parentId",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.parentId,
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
{
|
|
|
|
|
field: "stnm",
|
|
|
|
|
operator: "contains",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.stnm,
|
|
|
|
|
},
|
|
|
|
|
].filter(Boolean),
|
|
|
|
|
};
|
|
|
|
|
basicTable.value.getList(params);
|
2026-05-19 18:56:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 重置
|
2026-05-25 08:54:17 +08:00
|
|
|
const handleReset = () => {
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
basicTable.value.getList({
|
|
|
|
|
logic: "and",
|
|
|
|
|
filters: [],
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
};
|
2026-05-19 18:56:33 +08:00
|
|
|
|
|
|
|
|
// 表单取消
|
|
|
|
|
const editModalCancel = () => {
|
2026-05-25 08:54:17 +08:00
|
|
|
currentRecord.value = null;
|
2026-05-19 18:56:33 +08:00
|
|
|
editModalVisible.value = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 表单提交
|
2026-05-25 08:54:17 +08:00
|
|
|
const handleEditSubmit = async (values: any) => {
|
|
|
|
|
try {
|
|
|
|
|
let res = await saveTiltPhoto({
|
|
|
|
|
...currentRecord.value,
|
|
|
|
|
...values,
|
|
|
|
|
});
|
|
|
|
|
message.success(`保存成功`);
|
|
|
|
|
|
|
|
|
|
editModalVisible.value = false;
|
|
|
|
|
basicTable.value.refresh();
|
|
|
|
|
} catch (error) {
|
|
|
|
|
message.error(`保存失败`);
|
|
|
|
|
|
|
|
|
|
editModalVisible.value = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2026-05-19 18:56:33 +08:00
|
|
|
};
|
2026-05-25 08:54:17 +08:00
|
|
|
const initOption = async () => {};
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
initOption();
|
|
|
|
|
});
|
2026-05-19 18:56:33 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.tilt-photo-management {
|
|
|
|
|
height: 100%;
|
|
|
|
|
padding: 16px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|