倾斜摄影参数完善,推送管理修改

This commit is contained in:
王兴凯 2026-07-13 11:11:51 +08:00
parent fce3a5907a
commit 5ebda11578
7 changed files with 147 additions and 59 deletions

View File

@ -41,6 +41,14 @@ export function getEngInfoDropdown(data: any) {
data data
}); });
} }
// 根据河段获取电站
export function getByRvcd(data: any) {
return request({
url: '/env/engInfo/getByRvcd',
method: 'get',
params:data
});
}
// 根据id获取电站信息 // 根据id获取电站信息
export function getEngInfoById(params: any) { export function getEngInfoById(params: any) {
return request({ return request({

View File

@ -70,7 +70,7 @@ export function setPushConfigSmsSwitch(data: any) {
return request({ return request({
url: '/system/pushConfig/setPushConfigSmsSwitch', url: '/system/pushConfig/setPushConfigSmsSwitch',
method: 'post', method: 'post',
data params:data
}); });
} }
//获取推送历史列表 //获取推送历史列表

View File

@ -23,19 +23,33 @@
placeholder="请输入倾斜影像名称" placeholder="请输入倾斜影像名称"
/> />
</a-form-item> </a-form-item>
<a-form-item label="所在河段" name="hbrvcdName"> <a-form-item label="所在河段" name="hbrvcd">
<a-input <a-select
v-model:value="formData.hbrvcdName" v-model:value="formData.hbrvcd"
show-search
style="width: 100%" style="width: 100%"
placeholder="请输入所在河段" placeholder="请选择所在河段"
:options="riverOptions"
:filter-option="filterOption"
:disabled="isEdit"
@change="handleRiverSelect"
/> />
</a-form-item> </a-form-item>
<a-form-item label="所属电站" name="ennm"> <a-form-item label="所属电站" name="rstcd">
<a-input <a-select
v-model:value="formData.rstcd"
show-search
style="width: 100%"
placeholder="请选择所属电站"
:options="ennmOptions"
:filter-option="filterOption"
:disabled="isEdit"
/>
<!-- <a-input
v-model:value="formData.ennm" v-model:value="formData.ennm"
style="width: 100%" style="width: 100%"
placeholder="请输入所属电站" placeholder="请输入所属电站"
/> /> -->
</a-form-item> </a-form-item>
<a-form-item label="倾斜影像URL" name="url"> <a-form-item label="倾斜影像URL" name="url">
<a-input <a-input
@ -76,9 +90,9 @@
:min="0" :min="0"
/> />
</a-form-item> </a-form-item>
<a-form-item label="备注" name="description"> <a-form-item label="备注" name="comments">
<a-textarea <a-textarea
v-model:value="formData.description" v-model:value="formData.comments"
:rows="4" :rows="4"
style="width: 100%" style="width: 100%"
placeholder="请输入备注" placeholder="请输入备注"
@ -89,33 +103,34 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, computed, watch } from "vue"; import { ref, reactive, computed, watch } from 'vue';
import { message } from "ant-design-vue"; import { message } from 'ant-design-vue';
import type { Rule } from "ant-design-vue/es/form"; import type { Rule } from 'ant-design-vue/es/form';
import dayjs from "dayjs"; import dayjs from 'dayjs';
import { getEngInfoDropdown } from '@/api/select';
interface Props { interface Props {
visible: boolean; visible: boolean;
initialValues?: any | null; initialValues?: any | null;
loading?: boolean; loading?: boolean;
riverOptions?: any[];
} }
const localLoading = ref(false); const localLoading = ref(false);
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
visible: false, visible: false,
initialValues: null, initialValues: null,
loading: false, loading: false,
riverOptions: () => []
}); });
const modalVisible = computed({ const modalVisible = computed({
get: () => props.visible, get: () => props.visible,
set: (val) => emit("update:visible", val), set: val => emit('update:visible', val)
}); });
const emit = defineEmits<{ const emit = defineEmits<{
(e: "update:visible", value: boolean): void; (e: 'update:visible', value: boolean): void;
(e: "cancel"): void; (e: 'cancel'): void;
(e: "ok", values: any): void; (e: 'ok', values: any): void;
}>(); }>();
const formRef = ref(); const formRef = ref();
@ -123,23 +138,23 @@ const formRef = ref();
const defaultFormData = reactive({ const defaultFormData = reactive({
id: undefined, id: undefined,
stnm: undefined, stnm: undefined,
hbrvcdName: undefined, hbrvcd: undefined,
ennm: undefined, rstcd: undefined,
url: undefined, url: undefined,
location: undefined, location: undefined,
accuracy: undefined, accuracy: undefined,
boundary: undefined, boundary: undefined,
height: undefined, height: undefined,
description: undefined, comments: undefined
}); });
const formData: any = reactive({ ...defaultFormData }); const formData: any = reactive({ ...defaultFormData });
const rules: Record<string, Rule[]> = { const rules: Record<string, Rule[]> = {
stnm: [{ required: true, message: "请输入倾斜影像名称", trigger: "blur" }], stnm: [{ required: true, message: '请输入倾斜影像名称', trigger: 'blur' }],
hbrvcdName: [{ required: true, message: "请输入所在河段", trigger: "blur" }], hbrvcd: [{ required: true, message: '请输入所在河段', trigger: 'blur' }],
ennm: [{ required: true, message: "请输入所属电站", trigger: "blur" }], rstcd: [{ required: true, message: '请输入所属电站', trigger: 'blur' }],
url: [{ required: true, message: "请输入倾斜影像URL", trigger: "blur" }], url: [{ required: true, message: '请输入倾斜影像URL', trigger: 'blur' }],
location: [{ required: true, message: "请输入模型坐标", trigger: "blur" }], location: [{ required: true, message: '请输入模型坐标', trigger: 'blur' }]
}; };
const isEdit = computed(() => !!props.initialValues); const isEdit = computed(() => !!props.initialValues);
@ -147,25 +162,33 @@ const isEdit = computed(() => !!props.initialValues);
const handleOk = async () => { const handleOk = async () => {
try { try {
await formRef.value.validate(); await formRef.value.validate();
const ennmItem = ennmOptions.value.find(item => item.value == formData.rstcd);
const riverItem = props.riverOptions.find(item => item.value == formData.hbrvcd);
const submitValues = { const submitValues = {
...formData, ...formData,
ennm: ennmItem?.ennm || '',
lgtd: ennmItem?.lgtd || '',
lttd: ennmItem?.lttd || '',
hbrvcdName: riverItem?.label || '',
baseId: riverItem?.baseId || '',
baseName: riverItem?.baseName || '',
captureDate: formData.captureDate captureDate: formData.captureDate
? dayjs(formData.captureDate).format("YYYY-MM-DD") ? dayjs(formData.captureDate).format('YYYY-MM-DD')
: undefined, : undefined
}; };
emit("ok", submitValues); emit('ok', submitValues);
} catch (error) { } catch (error) {
console.error("Validate Failed:", error); console.error('Validate Failed:', error);
message.error("请检查表单填写是否正确"); message.error('请检查表单填写是否正确');
} }
}; };
const initForm = () => { const initForm = () => {
if (props.initialValues) { if (props.initialValues) {
const values = props.initialValues; const values = props.initialValues;
Object.keys(formData).forEach((key) => { Object.keys(formData).forEach(key => {
if (values.hasOwnProperty(key)) { if (values.hasOwnProperty(key)) {
if (key === "captureDate" && values[key]) { if (key === 'captureDate' && values[key]) {
formData[key] = dayjs(values[key]); formData[key] = dayjs(values[key]);
} else { } else {
formData[key] = values[key]; formData[key] = values[key];
@ -185,23 +208,44 @@ const resetForm = () => {
}; };
const handleCancel = () => { const handleCancel = () => {
emit("update:visible", false); emit('update:visible', false);
emit("cancel"); emit('cancel');
resetForm(); resetForm();
}; };
//
const filterOption = (inputValue: string, option: any) => {
const label = option.label || option.name || '';
const reachcdName = option.reachcdName || '';
const keyword = inputValue || '';
return label.indexOf(keyword) !== -1 || reachcdName.indexOf(keyword) !== -1;
};
const ennmOptions = ref([]);
const handleRiverSelect = async (value: any) => {
let res: any = await getEngInfoDropdown({ reachcd: value });
if (res?.data?.length > 0) {
res.data.forEach((item: any) => {
item.value = item.stcd;
item.label = item.ennm;
});
ennmOptions.value = res.data;
} else {
ennmOptions.value = [];
}
};
watch( watch(
() => props.visible, () => props.visible,
(newVisible) => { newVisible => {
if (newVisible) { if (newVisible) {
initForm(); initForm();
handleRiverSelect('');
} }
}, },
{ immediate: false } { immediate: false }
); );
defineExpose({ defineExpose({
localLoading, localLoading
}); });
</script> </script>

View File

@ -23,6 +23,8 @@ import BasicSearch from "@/components/BasicSearch/index.vue";
interface Props { interface Props {
handleAdd: () => void; handleAdd: () => void;
riverOptions: any[];
riverOptionsLoad: boolean;
} }
const props = defineProps<Props>(); const props = defineProps<Props>();
@ -34,6 +36,7 @@ const emit = defineEmits<{
const initSearchData = { const initSearchData = {
stnm: "", stnm: "",
rvcd:""
}; };
const searchData = ref<any>({ ...initSearchData }); const searchData = ref<any>({ ...initSearchData });
@ -47,13 +50,16 @@ const searchList: any = computed(() => [
}, },
}, },
{ {
type: "Select", type: 'Select',
name: "hbrvcdName", name: 'rvcd',
label: "所在河段", label: '所在河段',
width: 300,
fieldProps: { fieldProps: {
allowClear: true, allowClear: true
},
}, },
options: props.riverOptions,
loading: props.riverOptionsLoad
}
]); ]);
const onSearchFinish = (values: any) => { const onSearchFinish = (values: any) => {

View File

@ -3,6 +3,8 @@
<div class="content"> <div class="content">
<TiltPhotoManagementSearch <TiltPhotoManagementSearch
ref="tiltPhotoManagementSearch" ref="tiltPhotoManagementSearch"
:river-options="riverOptions"
:river-options-load="riverOptionsLoad"
:handle-add="handleAdd" :handle-add="handleAdd"
@reset="handleReset" @reset="handleReset"
@search-finish="onSearchFinish" @search-finish="onSearchFinish"
@ -36,6 +38,8 @@
<TiltPhotoManagementForm <TiltPhotoManagementForm
ref="tiltPhotoManagementForm" ref="tiltPhotoManagementForm"
v-model:visible="editModalVisible" v-model:visible="editModalVisible"
:river-options="riverOptions"
:river-options-load="riverOptionsLoad"
:initial-values="currentRecord" :initial-values="currentRecord"
@cancel="editModalCancel" @cancel="editModalCancel"
@ok="handleEditSubmit" @ok="handleEditSubmit"
@ -54,6 +58,7 @@ import {
saveTiltPhoto, saveTiltPhoto,
deleteTiltPhoto deleteTiltPhoto
} from '@/api/system/map/TiltPhotoManagement'; } from '@/api/system/map/TiltPhotoManagement';
import { getRvcdDropdown } from '@/api/select';
// //
const columns = [ const columns = [
{ {
@ -73,14 +78,14 @@ const columns = [
{ {
title: 'URL', title: 'URL',
dataIndex: 'url', dataIndex: 'url',
key: 'url', key: 'url'
width: 360 // width: 360
}, },
{ {
title: '所在河段', title: '所在河段',
dataIndex: 'hbrvcdName', dataIndex: 'hbrvcdName',
key: 'hbrvcdName', key: 'hbrvcdName',
width: 120 width: 280
}, },
{ {
title: '所属电站', title: '所属电站',
@ -91,7 +96,8 @@ const columns = [
{ {
title: '创建人', title: '创建人',
key: 'recordUser', key: 'recordUser',
dataIndex: 'recordUser' dataIndex: 'recordUser',
width: 150
}, },
{ {
title: '创建时间', title: '创建时间',
@ -108,9 +114,9 @@ const columns = [
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 80, width: 120,
fixed: 'right', fixed: 'right',
slots: { customRender: 'status' } slots: { customRender: 'action' }
} }
]; ];
@ -171,6 +177,12 @@ const onSearchFinish = (values: any) => {
operator: 'contains', operator: 'contains',
dataType: 'string', dataType: 'string',
value: values.stnm value: values.stnm
},
{
field: 'rvcd',
operator: 'contains',
dataType: 'string',
value: values.rvcd
} }
].filter(Boolean) ].filter(Boolean)
}; };
@ -211,7 +223,20 @@ const handleEditSubmit = async (values: any) => {
return; return;
} }
}; };
const initOption = async () => {}; const riverOptions = ref<any>([]);
const riverOptionsLoad = ref(false);
const initOption = () => {
const params = {};
riverOptionsLoad.value = true;
getRvcdDropdown(params).then((res: any) => {
res.data.forEach((item: any) => {
item.value = item.rvcd;
item.label = item.rvnm;
});
riverOptions.value = res.data || [];
riverOptionsLoad.value = false;
});
};
onMounted(() => { onMounted(() => {
initOption(); initOption();
}); });

View File

@ -18,7 +18,8 @@
<template #isSms="{ column, record }"> <template #isSms="{ column, record }">
<a-switch <a-switch
v-model:checked="record.isSms" v-model:checked="record.isSms"
:checkedValue="'1'" :unCheckedValue="0"
:checkedValue="1"
@change="switchChange(record.isSms, record)" @change="switchChange(record.isSms, record)"
/> />
</template> </template>
@ -67,7 +68,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, nextTick, onMounted } from 'vue'; import { ref, nextTick, computed,onMounted } from 'vue';
import BasicTable from '@/components/BasicTable/index.vue'; import BasicTable from '@/components/BasicTable/index.vue';
import ConfigManagementForm from './ConfigManagementForm.vue'; import ConfigManagementForm from './ConfigManagementForm.vue';
import PushTargetModal from './PushTargetModal.vue'; import PushTargetModal from './PushTargetModal.vue';
@ -173,7 +174,7 @@ const handleDelete = (record: any) => {
zIndex: 2002, zIndex: 2002,
onOk: async () => { onOk: async () => {
try { try {
let res = await deletePushConfig([record.id]); let res:any = await deletePushConfig([record.id]);
if ((res.code = 0)) { if ((res.code = 0)) {
message.success('删除成功'); message.success('删除成功');
} }

View File

@ -42,17 +42,17 @@
<template #status="{ record }"> <template #status="{ record }">
<span <span
:class=" :class="
record.status === '1' record.status == '1'
? 'text-success' ? 'text-success'
: record.status === '2' : record.status == '2'
? 'text-error' ? 'text-error'
: '' : ''
" "
> >
{{ {{
record.status === '1' record.status == '1'
? '推送成功' ? '推送成功'
: record.status === '2' : record.status == '2'
? '推送失败' ? '推送失败'
: '待推送' : '待推送'
}} }}
@ -167,7 +167,11 @@ watch(
handleSearch(); handleSearch();
} }
let res1 = await getPushHistoryDetailById({ historyId: props.record.id }); let res1 = await getPushHistoryDetailById({ historyId: props.record.id });
const { failCount = 0, pendingCount = 0, successCount = 0 } = res1.data || {}; const {
failCount = 0,
pendingCount = 0,
successCount = 0
} = res1.data || {};
const total = failCount + pendingCount + successCount; const total = failCount + pendingCount + successCount;
resultStatusOption.value = resultStatusOption.value.map(item => { resultStatusOption.value = resultStatusOption.value.map(item => {
let count = 0; let count = 0;