倾斜摄影参数完善,推送管理修改
This commit is contained in:
commit
d7c33850b5
@ -41,6 +41,14 @@ export function getEngInfoDropdown(data: any) {
|
||||
data
|
||||
});
|
||||
}
|
||||
// 根据河段获取电站
|
||||
export function getByRvcd(data: any) {
|
||||
return request({
|
||||
url: '/env/engInfo/getByRvcd',
|
||||
method: 'get',
|
||||
params:data
|
||||
});
|
||||
}
|
||||
// 根据id获取电站信息
|
||||
export function getEngInfoById(params: any) {
|
||||
return request({
|
||||
|
||||
@ -70,7 +70,7 @@ export function setPushConfigSmsSwitch(data: any) {
|
||||
return request({
|
||||
url: '/system/pushConfig/setPushConfigSmsSwitch',
|
||||
method: 'post',
|
||||
data
|
||||
params:data
|
||||
});
|
||||
}
|
||||
//获取推送历史列表
|
||||
|
||||
@ -23,19 +23,33 @@
|
||||
placeholder="请输入倾斜影像名称"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所在河段" name="hbrvcdName">
|
||||
<a-input
|
||||
v-model:value="formData.hbrvcdName"
|
||||
<a-form-item label="所在河段" name="hbrvcd">
|
||||
<a-select
|
||||
v-model:value="formData.hbrvcd"
|
||||
show-search
|
||||
style="width: 100%"
|
||||
placeholder="请输入所在河段"
|
||||
placeholder="请选择所在河段"
|
||||
:options="riverOptions"
|
||||
:filter-option="filterOption"
|
||||
:disabled="isEdit"
|
||||
@change="handleRiverSelect"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="所属电站" name="ennm">
|
||||
<a-input
|
||||
<a-form-item label="所属电站" name="rstcd">
|
||||
<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"
|
||||
style="width: 100%"
|
||||
placeholder="请输入所属电站"
|
||||
/>
|
||||
/> -->
|
||||
</a-form-item>
|
||||
<a-form-item label="倾斜影像URL" name="url">
|
||||
<a-input
|
||||
@ -76,9 +90,9 @@
|
||||
:min="0"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="description">
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
v-model:value="formData.description"
|
||||
v-model:value="formData.comments"
|
||||
:rows="4"
|
||||
style="width: 100%"
|
||||
placeholder="请输入备注"
|
||||
@ -89,33 +103,34 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed, watch } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import type { Rule } from "ant-design-vue/es/form";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
import { ref, reactive, computed, watch } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import dayjs from 'dayjs';
|
||||
import { getEngInfoDropdown } from '@/api/select';
|
||||
interface Props {
|
||||
visible: boolean;
|
||||
initialValues?: any | null;
|
||||
loading?: boolean;
|
||||
riverOptions?: any[];
|
||||
}
|
||||
|
||||
const localLoading = ref(false);
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
visible: false,
|
||||
initialValues: null,
|
||||
loading: false,
|
||||
riverOptions: () => []
|
||||
});
|
||||
|
||||
const modalVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (val) => emit("update:visible", val),
|
||||
set: val => emit('update:visible', val)
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "update:visible", value: boolean): void;
|
||||
(e: "cancel"): void;
|
||||
(e: "ok", values: any): void;
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'cancel'): void;
|
||||
(e: 'ok', values: any): void;
|
||||
}>();
|
||||
|
||||
const formRef = ref();
|
||||
@ -123,23 +138,23 @@ const formRef = ref();
|
||||
const defaultFormData = reactive({
|
||||
id: undefined,
|
||||
stnm: undefined,
|
||||
hbrvcdName: undefined,
|
||||
ennm: undefined,
|
||||
hbrvcd: undefined,
|
||||
rstcd: undefined,
|
||||
url: undefined,
|
||||
location: undefined,
|
||||
accuracy: undefined,
|
||||
boundary: undefined,
|
||||
height: undefined,
|
||||
description: undefined,
|
||||
comments: undefined
|
||||
});
|
||||
const formData: any = reactive({ ...defaultFormData });
|
||||
|
||||
const rules: Record<string, Rule[]> = {
|
||||
stnm: [{ required: true, message: "请输入倾斜影像名称", trigger: "blur" }],
|
||||
hbrvcdName: [{ required: true, message: "请输入所在河段", trigger: "blur" }],
|
||||
ennm: [{ required: true, message: "请输入所属电站", trigger: "blur" }],
|
||||
url: [{ required: true, message: "请输入倾斜影像URL", trigger: "blur" }],
|
||||
location: [{ required: true, message: "请输入模型坐标", trigger: "blur" }],
|
||||
stnm: [{ required: true, message: '请输入倾斜影像名称', trigger: 'blur' }],
|
||||
hbrvcd: [{ required: true, message: '请输入所在河段', trigger: 'blur' }],
|
||||
rstcd: [{ required: true, message: '请输入所属电站', trigger: 'blur' }],
|
||||
url: [{ required: true, message: '请输入倾斜影像URL', trigger: 'blur' }],
|
||||
location: [{ required: true, message: '请输入模型坐标', trigger: 'blur' }]
|
||||
};
|
||||
|
||||
const isEdit = computed(() => !!props.initialValues);
|
||||
@ -147,25 +162,33 @@ const isEdit = computed(() => !!props.initialValues);
|
||||
const handleOk = async () => {
|
||||
try {
|
||||
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 = {
|
||||
...formData,
|
||||
ennm: ennmItem?.ennm || '',
|
||||
lgtd: ennmItem?.lgtd || '',
|
||||
lttd: ennmItem?.lttd || '',
|
||||
hbrvcdName: riverItem?.label || '',
|
||||
baseId: riverItem?.baseId || '',
|
||||
baseName: riverItem?.baseName || '',
|
||||
captureDate: formData.captureDate
|
||||
? dayjs(formData.captureDate).format("YYYY-MM-DD")
|
||||
: undefined,
|
||||
? dayjs(formData.captureDate).format('YYYY-MM-DD')
|
||||
: undefined
|
||||
};
|
||||
emit("ok", submitValues);
|
||||
emit('ok', submitValues);
|
||||
} catch (error) {
|
||||
console.error("Validate Failed:", error);
|
||||
message.error("请检查表单填写是否正确");
|
||||
console.error('Validate Failed:', error);
|
||||
message.error('请检查表单填写是否正确');
|
||||
}
|
||||
};
|
||||
|
||||
const initForm = () => {
|
||||
if (props.initialValues) {
|
||||
const values = props.initialValues;
|
||||
Object.keys(formData).forEach((key) => {
|
||||
Object.keys(formData).forEach(key => {
|
||||
if (values.hasOwnProperty(key)) {
|
||||
if (key === "captureDate" && values[key]) {
|
||||
if (key === 'captureDate' && values[key]) {
|
||||
formData[key] = dayjs(values[key]);
|
||||
} else {
|
||||
formData[key] = values[key];
|
||||
@ -185,23 +208,44 @@ const resetForm = () => {
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
emit("update:visible", false);
|
||||
emit("cancel");
|
||||
emit('update:visible', false);
|
||||
emit('cancel');
|
||||
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(
|
||||
() => props.visible,
|
||||
(newVisible) => {
|
||||
newVisible => {
|
||||
if (newVisible) {
|
||||
initForm();
|
||||
handleRiverSelect('');
|
||||
}
|
||||
},
|
||||
{ immediate: false }
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
localLoading,
|
||||
localLoading
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@ import BasicSearch from "@/components/BasicSearch/index.vue";
|
||||
|
||||
interface Props {
|
||||
handleAdd: () => void;
|
||||
riverOptions: any[];
|
||||
riverOptionsLoad: boolean;
|
||||
}
|
||||
|
||||
const props = defineProps<Props>();
|
||||
@ -34,6 +36,7 @@ const emit = defineEmits<{
|
||||
|
||||
const initSearchData = {
|
||||
stnm: "",
|
||||
rvcd:""
|
||||
};
|
||||
|
||||
const searchData = ref<any>({ ...initSearchData });
|
||||
@ -47,13 +50,16 @@ const searchList: any = computed(() => [
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "Select",
|
||||
name: "hbrvcdName",
|
||||
label: "所在河段",
|
||||
type: 'Select',
|
||||
name: 'rvcd',
|
||||
label: '所在河段',
|
||||
width: 300,
|
||||
fieldProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
allowClear: true
|
||||
},
|
||||
options: props.riverOptions,
|
||||
loading: props.riverOptionsLoad
|
||||
}
|
||||
]);
|
||||
|
||||
const onSearchFinish = (values: any) => {
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
<div class="content">
|
||||
<TiltPhotoManagementSearch
|
||||
ref="tiltPhotoManagementSearch"
|
||||
:river-options="riverOptions"
|
||||
:river-options-load="riverOptionsLoad"
|
||||
:handle-add="handleAdd"
|
||||
@reset="handleReset"
|
||||
@search-finish="onSearchFinish"
|
||||
@ -36,6 +38,8 @@
|
||||
<TiltPhotoManagementForm
|
||||
ref="tiltPhotoManagementForm"
|
||||
v-model:visible="editModalVisible"
|
||||
:river-options="riverOptions"
|
||||
:river-options-load="riverOptionsLoad"
|
||||
:initial-values="currentRecord"
|
||||
@cancel="editModalCancel"
|
||||
@ok="handleEditSubmit"
|
||||
@ -54,6 +58,7 @@ import {
|
||||
saveTiltPhoto,
|
||||
deleteTiltPhoto
|
||||
} from '@/api/system/map/TiltPhotoManagement';
|
||||
import { getRvcdDropdown } from '@/api/select';
|
||||
// 表格列配置
|
||||
const columns = [
|
||||
{
|
||||
@ -73,14 +78,14 @@ const columns = [
|
||||
{
|
||||
title: 'URL',
|
||||
dataIndex: 'url',
|
||||
key: 'url',
|
||||
width: 360
|
||||
key: 'url'
|
||||
// width: 360
|
||||
},
|
||||
{
|
||||
title: '所在河段',
|
||||
dataIndex: 'hbrvcdName',
|
||||
key: 'hbrvcdName',
|
||||
width: 120
|
||||
width: 280
|
||||
},
|
||||
{
|
||||
title: '所属电站',
|
||||
@ -91,7 +96,8 @@ const columns = [
|
||||
{
|
||||
title: '创建人',
|
||||
key: 'recordUser',
|
||||
dataIndex: 'recordUser'
|
||||
dataIndex: 'recordUser',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
@ -108,9 +114,9 @@ const columns = [
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: 80,
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
slots: { customRender: 'status' }
|
||||
slots: { customRender: 'action' }
|
||||
}
|
||||
];
|
||||
|
||||
@ -171,6 +177,12 @@ const onSearchFinish = (values: any) => {
|
||||
operator: 'contains',
|
||||
dataType: 'string',
|
||||
value: values.stnm
|
||||
},
|
||||
{
|
||||
field: 'rvcd',
|
||||
operator: 'contains',
|
||||
dataType: 'string',
|
||||
value: values.rvcd
|
||||
}
|
||||
].filter(Boolean)
|
||||
};
|
||||
@ -211,7 +223,20 @@ const handleEditSubmit = async (values: any) => {
|
||||
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(() => {
|
||||
initOption();
|
||||
});
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
<template #isSms="{ column, record }">
|
||||
<a-switch
|
||||
v-model:checked="record.isSms"
|
||||
:checkedValue="'1'"
|
||||
:unCheckedValue="0"
|
||||
:checkedValue="1"
|
||||
@change="switchChange(record.isSms, record)"
|
||||
/>
|
||||
</template>
|
||||
@ -67,7 +68,7 @@
|
||||
</template>
|
||||
|
||||
<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 ConfigManagementForm from './ConfigManagementForm.vue';
|
||||
import PushTargetModal from './PushTargetModal.vue';
|
||||
@ -173,7 +174,7 @@ const handleDelete = (record: any) => {
|
||||
zIndex: 2002,
|
||||
onOk: async () => {
|
||||
try {
|
||||
let res = await deletePushConfig([record.id]);
|
||||
let res:any = await deletePushConfig([record.id]);
|
||||
if ((res.code = 0)) {
|
||||
message.success('删除成功');
|
||||
}
|
||||
|
||||
@ -42,17 +42,17 @@
|
||||
<template #status="{ record }">
|
||||
<span
|
||||
:class="
|
||||
record.status === '1'
|
||||
record.status == '1'
|
||||
? 'text-success'
|
||||
: record.status === '2'
|
||||
: record.status == '2'
|
||||
? 'text-error'
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{
|
||||
record.status === '1'
|
||||
record.status == '1'
|
||||
? '推送成功'
|
||||
: record.status === '2'
|
||||
: record.status == '2'
|
||||
? '推送失败'
|
||||
: '待推送'
|
||||
}}
|
||||
@ -167,7 +167,11 @@ watch(
|
||||
handleSearch();
|
||||
}
|
||||
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;
|
||||
resultStatusOption.value = resultStatusOption.value.map(item => {
|
||||
let count = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user