Merge branch 'wxk-main'

This commit is contained in:
王兴凯 2026-08-20 16:59:14 +08:00
commit d03b6e7cbf
39 changed files with 415 additions and 299 deletions

View File

@ -388,6 +388,33 @@ export function getFishReleaseList(data) {
}); });
} }
// 鱼类放鱼 - 详情查询
export function getFishReleaseDetailList(data) {
return request({
url: '/fb/fishrun/qgc/detail/GetKendoListCust',
method: 'post',
data
});
}
// 鱼类放鱼 - 详情删除
export function deleteFishRunQgcDetailData(data) {
return request({
url: '/fb/fishrun/qgc/removeFishRunQgcDetailData',
method: 'post',
data
});
}
// 鱼类放鱼 - 详情修改
export function updateFishRunQgcDetailData(data) {
return request({
url: '/fb/fishrun/qgc/updateFishRunQgcDetailData',
method: 'post',
data
});
}
// 流量站 - 断面 // 流量站 - 断面
export function getFlowStationSectionList(data) { export function getFlowStationSectionList(data) {
return request({ return request({

View File

@ -35,7 +35,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue'; import { ref, computed, watch } from 'vue';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -72,4 +72,12 @@ const handleCancel = () => {
sourceValue.value = ''; sourceValue.value = '';
emit('cancel'); emit('cancel');
}; };
//
watch(
() => props.open,
val => {
if (val) sourceValue.value = '';
}
);
</script> </script>

View File

@ -82,10 +82,16 @@ import { useDraggable } from "@/utils/drag";
defineOptions({ name: "OperationLogModal" }); defineOptions({ name: "OperationLogModal" });
const props = defineProps<{ const props = withDefaults(
defineProps<{
open: boolean; open: boolean;
tableName: string; tableName: string;
}>(); recordNameTitle?: string;
}>(),
{
recordNameTitle: "电站",
}
);
const emit = defineEmits(["update:open"]); const emit = defineEmits(["update:open"]);
@ -129,10 +135,10 @@ const searchList: any = [
]; ];
// //
const columns = ref<any[]>([ const columns = computed<any[]>(() => [
{ {
key: "recordName", key: "recordName",
title: "电站", title: props.recordNameTitle,
dataIndex: "recordName", dataIndex: "recordName",
visible: true, visible: true,
width: 120, width: 120,
@ -151,11 +157,8 @@ const columns = ref<any[]>([
dataIndex: "operateTime", dataIndex: "operateTime",
visible: true, visible: true,
width: 160, width: 160,
customRender: ({ text }: { text: string }) => { sort: true,
if (!text || text === "-") return "-";
const date = dayjs(text);
return date.isValid() ? date.format("YYYY-MM-DD") : "-";
},
}, },
{ {
key: "source", key: "source",

View File

@ -76,6 +76,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="'SD_ENGINFO_B_H'" :table-name="'SD_ENGINFO_B_H'"
:record-name-title="'电站'"
/> />
</div> </div>
</template> </template>

View File

@ -123,7 +123,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FISHDICTORY_B'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FISHDICTORY_B'" :record-name-title="'鱼类名称'" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_AIBOX_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_AIBOX_B_H'" :record-name-title="'站名'" />
</div> </div>
</template> </template>

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_OTTE_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_OTTE_B_H'" :record-name-title="'工程名称'" />
</div> </div>
</template> </template>

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_AIMONITOR_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_AIMONITOR_B_H'" :record-name-title="'站名'" />
</div> </div>
</template> </template>

View File

@ -13,7 +13,7 @@
<DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteFpFn" :label="'过鱼设施'" title="删除过鱼设施" @success="handleEditSuccess" /> <DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteFpFn" :label="'过鱼设施'" title="删除过鱼设施" @success="handleEditSuccess" />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FPSS_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FPSS_B_H'" :record-name-title="'设施名称'" />
</div> </div>
</template> </template>

View File

@ -383,7 +383,7 @@ const loadDropdownData = () => {
field: 'sttpCode', field: 'sttpCode',
operator: 'in', operator: 'in',
dataType: 'string', dataType: 'string',
value: ['TE', 'OTTE'] value: ['TE']
} }
] ]
} }

View File

@ -82,7 +82,7 @@ const getBaseList = async () => {
"field": "sttpCode", "field": "sttpCode",
"operator": "in", "operator": "in",
"dataType": "string", "dataType": "string",
"value": ["TE", "OTTE"] "value": ["TE"]
} }
] ]
} }

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_TE_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_TE_B_H'" :record-name-title="'断面名称'" />
</div> </div>
</template> </template>

View File

@ -37,7 +37,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FHBT_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FHBT_B_H'" :record-name-title="'栖息地名称'" />
</div> </div>
</template> </template>

View File

@ -9,7 +9,7 @@
</BasicTable> </BasicTable>
<EditVaModal v-model:open="editVisible" :record="editRecord" :is-add="isAdd" @success="handleEditSuccess" /> <EditVaModal v-model:open="editVisible" :record="editRecord" :is-add="isAdd" @success="handleEditSuccess" />
<DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteVaFn" :label="'动物救助站'" title="删除动物救助站" @success="handleEditSuccess" /> <DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteVaFn" :label="'动物救助站'" title="删除动物救助站" @success="handleEditSuccess" />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_VA_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_VA_B_H'" :record-name-title="'救助站名称'" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -13,7 +13,7 @@
<DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteEqFn" :label="'生态流量设施'" title="删除生态流量设施" @success="handleEditSuccess" /> <DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteEqFn" :label="'生态流量设施'" title="删除生态流量设施" @success="handleEditSuccess" />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_EQ_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_EQ_B_H'" :record-name-title="'设施名称'" />
</div> </div>
</template> </template>

View File

@ -13,7 +13,7 @@
<DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteVdFn" :label="'视频监控'" title="删除视频监控点" @success="handleEditSuccess" /> <DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteVdFn" :label="'视频监控'" title="删除视频监控点" @success="handleEditSuccess" />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_VDINFO_B'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_VDINFO_B'" :record-name-title="'监控点名'" />
</div> </div>
</template> </template>

View File

@ -394,7 +394,7 @@ const loadDropdownData = () => {
field: 'sttpCode', field: 'sttpCode',
operator: 'in', operator: 'in',
dataType: 'string', dataType: 'string',
value: ['WE', 'OTWE'] value: ['WE']
} }
] ]
} }

View File

@ -82,7 +82,7 @@ const getBaseList = async () => {
"field": "sttpCode", "field": "sttpCode",
"operator": "in", "operator": "in",
"dataType": "string", "dataType": "string",
"value": ["WE", "OTWE"] "value": ["WE"]
} }
] ]
} }

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_WE_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_WE_B_H'" :record-name-title="'断面名称'" />
</div> </div>
</template> </template>

View File

@ -53,6 +53,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="'SD_WT_B_H'" :table-name="'SD_WT_B_H'"
:record-name-title="'测站'"
/> />
</div> </div>
</template> </template>

View File

@ -46,6 +46,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="'SD_WQ_B_H'" :table-name="'SD_WQ_B_H'"
:record-name-title="'测站'"
/> />
</div> </div>
</template> </template>

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_SONAR_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_SONAR_B_H'" :record-name-title="'站名'" />
</div> </div>
</template> </template>

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_DW_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_DW_B_H'" :record-name-title="'设施名称'" />
</div> </div>
</template> </template>

View File

@ -49,7 +49,7 @@
@success="handleEditSuccess" @success="handleEditSuccess"
/> />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_OTWE_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_OTWE_B_H'" :record-name-title="'工程名称'" />
</div> </div>
</template> </template>

View File

@ -303,7 +303,7 @@ const loadEngOptions = async (baseId?: string) => {
const loadDropdownData = () => { const loadDropdownData = () => {
sttpGetKendoList({ sttpGetKendoList({
filter: { logic: 'and', filters: [{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['FB', 'VD_FB', 'VD_FBP'] }] } filter: { logic: 'and', filters: [{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['FB'] }] }
}).then(res => { }).then(res => {
sttpOptions.value = (res.data?.data || []).map((item: any) => ({ label: item.sttpName, value: item.sttpCode })); sttpOptions.value = (res.data?.data || []).map((item: any) => ({ label: item.sttpName, value: item.sttpCode }));
}); });

View File

@ -71,7 +71,7 @@ const getBaseList = async () => {
filter: { filter: {
logic: 'and', logic: 'and',
filters: [ filters: [
{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['FB', 'VD_FB', 'VD_FBP'] } { field: 'sttpCode', operator: 'in', dataType: 'string', value: ['FB'] }
] ]
} }
}); });

View File

@ -13,7 +13,7 @@
<DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteFbFn" :label="'鱼类增殖站'" title="删除鱼类增殖站" @success="handleEditSuccess" /> <DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteFbFn" :label="'鱼类增殖站'" title="删除鱼类增殖站" @success="handleEditSuccess" />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FBRD_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_FBRD_B_H'" :record-name-title="'增殖站名称'"/>
</div> </div>
</template> </template>

View File

@ -258,7 +258,7 @@ const loadEngOptions = async (baseId?: string) => {
const loadDropdownData = () => { const loadDropdownData = () => {
sttpGetKendoList({ sttpGetKendoList({
filter: { logic: 'and', filters: [{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['VP', 'VD_VP', 'AI_VP_GRAZE', 'AI_VP_WATER'] }] } filter: { logic: 'and', filters: [{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['VP', 'AI_VP_GRAZE', 'AI_VP_WATER'] }] }
}).then(res => { }).then(res => {
sttpOptions.value = (res.data?.data || []).map((item: any) => ({ label: item.sttpName, value: item.sttpCode })); sttpOptions.value = (res.data?.data || []).map((item: any) => ({ label: item.sttpName, value: item.sttpCode }));
}); });

View File

@ -28,7 +28,7 @@ const searchList: any = computed(() => [
const getBaseList = async () => { const getBaseList = async () => {
const res = await sttpGetKendoList({ const res = await sttpGetKendoList({
filter: { logic: 'and', filters: [{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['VP', 'VD_VP', 'AI_VP_GRAZE', 'AI_VP_WATER'] }] } filter: { logic: 'and', filters: [{ field: 'sttpCode', operator: 'in', dataType: 'string', value: ['VP', 'AI_VP_GRAZE', 'AI_VP_WATER'] }] }
}); });
sttpOption.value = res.data.data.map(item => ({ label: item.sttpName, value: item.sttpCode })); sttpOption.value = res.data.data.map(item => ({ label: item.sttpName, value: item.sttpCode }));
}; };

View File

@ -13,7 +13,7 @@
<DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteVpFn" :label="'珍稀植物园'" title="删除珍稀植物园" @success="handleEditSuccess" /> <DeleteConfirmModal ref="deleteModalRef" :delete-fn="deleteVpFn" :label="'珍稀植物园'" title="删除珍稀植物园" @success="handleEditSuccess" />
<OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_VP_B_H'" /> <OperationLogModal v-model:open="operationLogVisible" :table-name="'SD_VP_B_H'" :record-name-title="'植物园名称'" />
</div> </div>
</template> </template>

View File

@ -192,14 +192,13 @@
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<a-checkbox value="baseId">基地</a-checkbox> <a-checkbox value="baseId">基地</a-checkbox>
<a-select <a-select
v-model:value="formData.rvcd" v-model:value="formData.yearBaseId"
placeholder="请选择水电基地" placeholder="请选择水电基地"
mode="multiple" mode="multiple"
allow-clear allow-clear
show-search show-search
:filter-option="filterOption" :filter-option="filterOption"
:loading="rvcdLoading" :loading="rvcdLoading"
@change="handleRvcdChange"
style="width: 200px; margin-right: 10px" style="width: 200px; margin-right: 10px"
:max-tag-count="2" :max-tag-count="2"
> >
@ -292,6 +291,7 @@ const formData = reactive({
yearStatContent: [] as string[], yearStatContent: [] as string[],
statYears: [] as string[], statYears: [] as string[],
yearDimContent: [] as string[], yearDimContent: [] as string[],
yearBaseId: [] as string[],
lyRvcd: [] as string[], lyRvcd: [] as string[],
dimensionStat: '', dimensionStat: '',
content: '' content: ''
@ -403,6 +403,50 @@ const loadLyOptions = async () => {
lyLoading.value = false; lyLoading.value = false;
} }
}; };
//
watch(
() => formData.timeDimension,
(newVal, oldVal) => {
if (newVal === oldVal) return;
// //
formData.rvcd = [];
formData.stations = [];
formData.lyRvcd = [];
formData.yearBaseId = [];
if (newVal === 'year') {
// //
formData.monitorElements = [];
formData.statMonths = [];
formData.dataSource = 'true';
//
formData.yearStatContent = ['wq', 'qec'];
formData.yearDimContent = ['stcd', 'baseId'];
formData.statYears = [String(new Date().getFullYear())];
// /
if (rvcdOptions.value.length > 0) {
formData.rvcd = [rvcdOptions.value[0].value];
formData.yearBaseId = [rvcdOptions.value[0].value];
loadStationOptions(formData.rvcd);
}
loadLyOptions();
} else {
//
formData.yearStatContent = [];
formData.statYears = [];
formData.yearDimContent = [];
//
formData.statMonths = getDefaultStatMonths();
if (dataFieldOption.value.length > 0) {
formData.monitorElements = dataFieldOption.value.map((item: any) => item.itemCode);
}
if (rvcdOptions.value.length > 0) {
formData.rvcd = [rvcdOptions.value[0].value];
loadStationOptions(formData.rvcd);
}
}
}
);
const getExstatus = async (taskId, exportParams) => { const getExstatus = async (taskId, exportParams) => {
let res1: any = await qgcExportstatus({ taskId: taskId }); let res1: any = await qgcExportstatus({ taskId: taskId });
if (res1.status == 'PROCESSING') { if (res1.status == 'PROCESSING') {
@ -457,8 +501,11 @@ const handleExport = async () => {
if (formData.yearDimContent.includes('stcd')) { if (formData.yearDimContent.includes('stcd')) {
params.stcd = formData.stations.join(','); params.stcd = formData.stations.join(',');
} }
if (formData.yearDimContent.includes('baseId')) { if (
params.baseId = formData.rvcd.join(','); formData.yearDimContent.includes('baseId') &&
formData.yearBaseId.length > 0
) {
params.baseId = formData.yearBaseId.join(',');
} }
if (formData.yearDimContent.includes('ly')) { if (formData.yearDimContent.includes('ly')) {
params.hbRvcd = formData.lyRvcd.join(','); params.hbRvcd = formData.lyRvcd.join(',');

View File

@ -1,17 +1,66 @@
<template> <template>
<a-modal <a-modal
v-model:open="visible" v-model:open="visible"
title="编辑放鱼数据" title="修改放鱼数据"
width="600px" width="60vw"
:footer="null" :confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
> >
<a-empty description="编辑功能开发中,接口待接入" /> <a-form
ref="formRef"
:model="formData"
:label-col="{ span: 8 }"
:wrapper-col="{ span: 16 }"
:rules="formRules"
class="max-h-[70vh] overflow-y-auto pr-4"
>
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="电站名称">
<a-input :value="formData.stnm" disabled />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="放鱼时间">
<a-input :value="formData.tm" disabled />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="放鱼种类">
<a-input :value="formData.ftpName" disabled />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="数量(万尾)" name="fcnt">
<a-input-number
v-model:value="formData.fcnt"
placeholder="请输入数量"
:min="0"
:precision="4"
style="width: 100%"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal> </a-modal>
<ConfirmModal
v-model:open="confirmModalVisible"
:diff-list="diffList"
:confirm-loading="confirmLoading"
@confirm="handleConfirmSubmit"
@cancel="handleConfirmCancel"
/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed } from 'vue'; import { ref, computed, watch } from 'vue';
import { message } from 'ant-design-vue';
import ConfirmModal from '@/components/ConfirmModal/index.vue';
import { useDraggable } from '@/utils/drag'; import { useDraggable } from '@/utils/drag';
import { updateFishRunQgcDetailData } from '@/api/DataQueryMenuModule';
const props = defineProps<{ const props = defineProps<{
open: boolean; open: boolean;
@ -25,4 +74,142 @@ const visible = computed({
set: val => emit('update:open', val) set: val => emit('update:open', val)
}); });
useDraggable(visible, { boundary: true, resetOnOpen: true }); useDraggable(visible, { boundary: true, resetOnOpen: true });
const formRef = ref();
const confirmLoading = ref(false);
const confirmModalVisible = ref(false);
const formData = ref<any>({});
const originalRecord = ref<any>({});
const formRules = ref<any>({
fcnt: [{ required: true, message: '请输入数量', trigger: 'blur' }]
});
//
const changeOrder = ref<
{ field: string; label: string; oldValue: string; newValue: string }[]
>([]);
const diffList = changeOrder;
watch(
() => formData.value,
newData => {
const original = originalRecord.value;
for (const key in newData) {
const oldVal = original[key];
const newVal = newData[key];
if (oldVal !== newVal) {
const existingIdx = changeOrder.value.findIndex(c => c.field === key);
const oldNorm =
oldVal === null || oldVal === undefined || oldVal === '-'
? null
: oldVal;
const newNorm = newVal === null || newVal === undefined ? null : newVal;
if (oldNorm === newNorm) continue;
if (
oldNorm !== null &&
newNorm !== null &&
!isNaN(Number(oldNorm)) &&
!isNaN(Number(newNorm)) &&
Number(oldNorm) === Number(newNorm)
)
continue;
const entry = {
field: key,
label: '数量(万尾)',
oldValue: oldNorm === null ? '空' : String(oldNorm),
newValue: newNorm === null ? '空' : String(newNorm)
};
if (existingIdx >= 0) {
changeOrder.value[existingIdx] = entry;
} else {
changeOrder.value.push(entry);
}
} else {
changeOrder.value = changeOrder.value.filter(c => c.field !== key);
}
}
},
{ deep: true }
);
// record
watch(
() => props.record,
newRecord => {
if (!newRecord) {
formData.value = {};
originalRecord.value = {};
changeOrder.value = [];
return;
}
// /
const fcntWan = Number(newRecord.fcnt) / 10000;
formData.value = {
stnm: newRecord.stnm,
tm: newRecord.tm ?? newRecord.flyr,
ftpName: newRecord.ftpName,
fcnt: isNaN(fcntWan) ? null : fcntWan
};
originalRecord.value = { ...formData.value };
changeOrder.value = [];
confirmModalVisible.value = false;
},
{ deep: true, immediate: true }
);
const handleOk = async () => {
try {
await formRef.value?.validateFields();
if (changeOrder.value.length === 0) {
message.info('未检测到任何修改');
return;
}
confirmModalVisible.value = true;
} catch (error) {
console.error('验证失败:', error);
}
};
const handleConfirmSubmit = async (source: string) => {
confirmLoading.value = true;
try {
const updateData: Record<string, any> = {
id: props.record?.id,
stnm: formData.value.stnm,
tm: formData.value.tm,
ftpName: formData.value.ftpName,
fcnt:
formData.value.fcnt === null || formData.value.fcnt === undefined
? ''
: formData.value.fcnt * 10000
};
const res = await updateFishRunQgcDetailData({
updateData,
source: source.trim()
});
if (res?.code == 0 || res?.success) {
message.success('修改成功');
confirmModalVisible.value = false;
visible.value = false;
emit('success');
} else {
message.error(res?.msg || '修改失败');
}
} catch (error) {
message.error('提交失败,请重试');
} finally {
confirmLoading.value = false;
}
};
const handleConfirmCancel = () => {
confirmModalVisible.value = false;
};
const handleCancel = () => {
visible.value = false;
confirmModalVisible.value = false;
formRef.value?.resetFields();
};
</script> </script>

View File

@ -5,84 +5,22 @@
width="90vw" width="90vw"
:footer="null" :footer="null"
> >
<!-- 查询区复用页面搜索项 --> <div class="title_xiang">
<BasicSearch
ref="basicSearchRef"
:searchList="searchList"
:initial-values="initSearchData"
:zhujianfujian="'fu'"
@reset="handleResetWrapper"
@finish="onSearchFinish"
@values-change="onValuesChange"
>
<template #jcdt>
<a-date-picker
class="w-[160px]"
v-model:value="jcdt.min"
format="YYYY"
value-format="YYYY-MM-DD HH:mm:ss"
picker="year"
:showTime="timeShowTime"
placeholder="起始时间"
:showToday="false"
>
<template #renderExtraFooter>
<div class="flex items-center flex-wrap px-2">
<span
v-for="item in timeDateList"
:key="item"
@click="handleRangeClick(item)"
>
<a class="text-[#1890ff] mr-1"> {{ item.label }}</a>
</span>
</div>
</template>
</a-date-picker>
<a-form-item-rest>
<a-date-picker
class="w-[160px]"
v-model:value="jcdt.max"
format="YYYY"
value-format="YYYY-MM-DD HH:mm:ss"
picker="year"
:showTime="timeShowTime"
:disabledDate="disabledEndDate"
placeholder="结束时间"
:showToday="false"
>
<template #renderExtraFooter>
<div class="flex items-center flex-wrap px-2">
<span
v-for="item in timeDateList"
:key="item"
@click="handleRangeClick(item)"
>
<a class="text-[#1890ff] mr-1"> {{ item.label }}</a>
</span>
</div>
</template>
</a-date-picker>
</a-form-item-rest>
</template>
<template #actions>
<a-button <a-button
danger danger
:disabled="!selectedRowKeys.length" :disabled="!selectedRowKeys.length"
@click="handleBatchDelete" @click="handleBatchDelete"
>批量删除</a-button >批量删除</a-button
> >
</template> </div>
</BasicSearch>
<!-- 表格无放流总量列 --> <!-- 表格无放流总量列 -->
<BasicTable <BasicTable
ref="tableRef" ref="tableRef"
:enable-row-selection="true" :enable-row-selection="true"
:row-key="getRowKey"
:columns="columns" :columns="columns"
:list-url="listUrl"
:scrollY="500" :scrollY="500"
:list-url="getFishReleaseDetailList"
:searchParams="{ sort }" :searchParams="{ sort }"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
@ -119,13 +57,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, nextTick } from 'vue'; import { ref, computed, watch, nextTick } from 'vue';
import dayjs from 'dayjs';
import BasicSearch from '@/components/BasicSearch/index.vue';
import BasicTable from '@/components/BasicTable/index.vue'; import BasicTable from '@/components/BasicTable/index.vue';
import EditFishReleaseModal from './EditFishReleaseModal.vue'; import EditFishReleaseModal from './EditFishReleaseModal.vue';
import DeleteConfirmModal from '@/views/DataQueryMenuModule/components/conventionalHydropower/BasicData/DeleteConfirmModal.vue'; import DeleteConfirmModal from '@/views/DataQueryMenuModule/components/conventionalHydropower/BasicData/DeleteConfirmModal.vue';
import { useTimeScale } from '@/store/composables/useTimeScale'; import {
getFishReleaseDetailList,
deleteFishRunQgcDetailData
} from '@/api/DataQueryMenuModule';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import { useDraggable } from '@/utils/drag'; import { useDraggable } from '@/utils/drag';
@ -143,92 +82,6 @@ const visible = computed({
useDraggable(visible, { boundary: true, resetOnOpen: true }); useDraggable(visible, { boundary: true, resetOnOpen: true });
const tableRef = ref(); const tableRef = ref();
const basicSearchRef = ref();
const initSearchData = {
rvcd: 'all',
rstcd: null,
stcd: null
};
const timeDateList = ref([
{
label: '一年',
value: [dayjs().startOf('year'), dayjs().endOf('year')]
},
{
label: '两年',
value: [dayjs().subtract(1, 'year').startOf('year'), dayjs().endOf('year')]
},
{
label: '三年',
value: [dayjs().subtract(2, 'year').startOf('year'), dayjs().endOf('year')]
},
{
label: '五年',
value: [
dayjs().subtract(4, 'year').startOf('year'),
dayjs().startOf('year')
]
}
]);
const {
jcdt,
currentTimeScale,
timeShowTime,
handleRangeClick,
disabledEndDate,
handleSearchFinish,
handleValuesChange,
init
} = useTimeScale({
defaultTimeScale: initSearchData.timeScale,
onSearchFinish: values => initTable(values),
onReset: () => initTable(initSearchData)
});
const searchList: any = computed(() => [
{
type: 'waterStation',
name: 'rvcd',
label: '流域',
placeholder: '请输入流域名称',
fieldProps: {
allowClear: true
},
options: []
},
{
type: 'custom',
name: 'jcdt',
label: '时间',
fieldProps: {
allowClear: false
}
}
]);
const onSearchFinish = (values: any) => {
handleSearchFinish(values);
};
const onValuesChange = (changedValues: any, allValues: any) => {
handleValuesChange(changedValues, allValues);
};
const handleResetWrapper = () => {
currentTimeScale.value = initSearchData.timeScale;
const now = dayjs();
jcdt.value = {
min: `${now
.subtract(1, 'year')
.startOf('year')
.format('YYYY-MM-DD')} 00:00:00`,
max: `${now.endOf('year').format('YYYY-MM-DD')} 23:59:59`
};
handleSearchFinish({ ...initSearchData });
};
const sort = ref<any>([ const sort = ref<any>([
{ field: 'baseStepSort', dir: 'asc' }, { field: 'baseStepSort', dir: 'asc' },
@ -237,12 +90,6 @@ const sort = ref<any>([
{ field: 'flyr', dir: 'asc' } { field: 'flyr', dir: 'asc' }
]); ]);
// TODO:
const listUrl = async () => {
console.warn('放鱼详情查询接口待接入');
return { data: { records: [], total: 0 } };
};
// //
const columns: any[] = [ const columns: any[] = [
{ {
@ -250,44 +97,26 @@ const columns: any[] = [
title: '电站名称', title: '电站名称',
dataIndex: 'stnm', dataIndex: 'stnm',
visible: true, visible: true,
width: 200,
sort: true, sort: true,
ellipsis: true, ellipsis: true,
}, },
{ {
key: 'baseName', key: 'tm',
title: '所属基地', title: '放鱼时间',
dataIndex: 'baseName', dataIndex: 'tm',
sort: true, sort: true,
width: 160,
mergeDeps: ['stnm'] mergeDeps: ['stnm']
}, },
{
key: 'flyr',
title: '放鱼年份',
dataIndex: 'flyr',
sort: true,
width: 160,
mergeDeps: ['stnm']
},
{
key: 'release',
title: '放流来源',
dataIndex: 'release',
mergeDeps: ['stnm'],
width: 250
},
{ {
key: 'ftpName', key: 'ftpName',
title: '放鱼种类', title: '放鱼种类',
dataIndex: 'ftpName', dataIndex: 'ftpName',
width: 100
}, },
{ {
key: 'fcnt', key: 'fcnt',
title: '数量(万尾)', title: '数量(万尾)',
dataIndex: 'fcnt', dataIndex: 'fcnt',
width: 100, sort: true,
customRender: ({ record }: any) => customRender: ({ record }: any) =>
(record.fcnt / 10000).toFixed(4) || '-' (record.fcnt / 10000).toFixed(4) || '-'
}, },
@ -303,12 +132,55 @@ const columns: any[] = [
// stcd+ftpName // stcd+ftpName
const selectedRowKeys = ref<string[]>([]); const selectedRowKeys = ref<string[]>([]);
const selectedRows = ref<any[]>([]); const selectedRows = ref<any[]>([]);
const getRowKey = (record: any) => `${record.stcd}_${record.ftpName}`;
const handleSelectionChange = (keys: string[], rows: any[]) => { const handleSelectionChange = (keys: string[], rows: any[]) => {
selectedRowKeys.value = keys; selectedRowKeys.value = keys;
selectedRows.value = rows; selectedRows.value = rows;
}; };
// 使 stcdflyrftp
const loadDetail = (record: any) => {
if (!record) return;
const filters = [
{
field: 'stcd',
operator: 'eq',
dataType: 'string',
value: record.stcd
},
{
field: 'flyr',
operator: 'eq',
dataType: 'string',
value: String(record.flyr ?? '')
},
{
field: 'ftp',
operator: 'eq',
dataType: 'string',
value: record.ftp
}
].filter(f => f.value !== undefined && f.value !== null && f.value !== '');
tableRef.value?.getList({
logic: 'and',
filters
});
};
// record
// nextTick tableRef
watch(
() => props.record,
newRecord => {
selectedRowKeys.value = [];
selectedRows.value = [];
nextTick(() => {
tableRef.value?.clearSelection();
loadDetail(newRecord);
});
},
{ deep: true }
);
// //
const editVisible = ref(false); const editVisible = ref(false);
const editRecord = ref<any>(null); const editRecord = ref<any>(null);
@ -318,68 +190,29 @@ const handleEdit = (record: any) => {
}; };
const handleEditSuccess = () => { const handleEditSuccess = () => {
initTable(currentSearchParams.value); loadDetail(props.record);
}; emit('success');
const currentSearchParams = ref<any>({});
const initTable = (values: any) => {
currentSearchParams.value = values;
const filters = [
values.rvcd && values.rvcd !== 'all'
? {
field: 'rvcd',
operator: 'contains',
dataType: 'string',
value: values.rvcd
}
: null,
values.rstcd
? {
field: 'rstcd',
operator: 'eq',
dataType: 'string',
value: values.rstcd
}
: null
].filter(Boolean);
if (values.jcdt) {
filters.push(
{
field: 'flyr',
operator: 'gte',
dataType: 'date',
value: dayjs(values.jcdt.min).format('YYYY-MM-DD HH:mm:ss')
},
{
field: 'flyr',
operator: 'lte',
dataType: 'date',
value: dayjs(values.jcdt.max).format('YYYY-MM-DD HH:mm:ss')
}
);
}
tableRef.value?.getList({
logic: 'and',
filters
});
}; };
// //
const deleteModalRef = ref(); const deleteModalRef = ref();
const deleteLabel = '放鱼数据'; const deleteLabel = '放鱼数据';
// // record.idrecord.ids id
const handleDeleteFn = async (record: any, reason: string) => { const handleDeleteFn = async (record: any, reason: string) => {
message.error('删除接口暂未提供'); const ids = record.ids || [record.id];
throw new Error('删除接口暂未提供'); return deleteFishRunQgcDetailData({
ids,
source: reason
});
}; };
const refreshAfterDelete = () => { const refreshAfterDelete = () => {
selectedRowKeys.value = []; selectedRowKeys.value = [];
selectedRows.value = []; selectedRows.value = [];
tableRef.value?.clearSelection(); tableRef.value?.clearSelection();
initTable(currentSearchParams.value); loadDetail(props.record);
emit('success');
}; };
const handleDelete = (record: any) => { const handleDelete = (record: any) => {
@ -396,7 +229,7 @@ const handleBatchDelete = () => {
} }
deleteModalRef.value?.open( deleteModalRef.value?.open(
{ {
ids: [...selectedRowKeys.value], ids: selectedRows.value.map((r: any) => r.id),
stnm: `选中的 ${selectedRowKeys.value.length} 条数据` stnm: `选中的 ${selectedRowKeys.value.length} 条数据`
}, },
() => { () => {
@ -404,17 +237,12 @@ const handleBatchDelete = () => {
} }
); );
}; };
onMounted(() => {
init();
const now = dayjs();
jcdt.value = {
min: `${now
.subtract(1, 'year')
.startOf('year')
.format('YYYY-MM-DD')} 00:00:00`,
max: `${now.endOf('year').format('YYYY-MM-DD')} 23:59:59`
};
handleSearchFinish({ ...initSearchData });
});
</script> </script>
<style>
.title_xiang{
width: 100%;
display: flex;
justify-content: end;
margin-bottom: 10px;
}
</style>

View File

@ -35,12 +35,14 @@
<FishReleaseDetailModal <FishReleaseDetailModal
v-model:open="detailVisible" v-model:open="detailVisible"
:record="detailRecord" :record="detailRecord"
@success="handleDetailSuccess"
/> />
<!-- 操作日志弹框 --> <!-- 操作日志弹框 -->
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="operationTableName" :table-name="operationTableName"
:record-name-title="'电站'"
/> />
</div> </div>
</template> </template>
@ -247,6 +249,11 @@ const handleDetail = (record: any) => {
detailVisible.value = true; detailVisible.value = true;
}; };
// /
const handleDetailSuccess = () => {
initTable(currentSearchParams.value);
};
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
tableScrollY.value = calcTableScrollY(); tableScrollY.value = calcTableScrollY();

View File

@ -215,6 +215,7 @@ watch(
q: null, q: null,
v: null v: null
}; };
sourceValue.value = '';
return; return;
} }
@ -273,6 +274,7 @@ const handleConfirmSubmit = async () => {
if (res?.code == 0 || res?.success) { if (res?.code == 0 || res?.success) {
message.success('编辑成功'); message.success('编辑成功');
confirmModalVisible.value = false; confirmModalVisible.value = false;
sourceValue.value = '';
visible.value = false; visible.value = false;
emit('success'); emit('success');
} else { } else {

View File

@ -65,6 +65,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="operationTableName" :table-name="operationTableName"
:record-name-title="'站点'"
/> />
</div> </div>
</template> </template>

View File

@ -65,6 +65,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="operationTableName" :table-name="operationTableName"
:record-name-title="'断面名称'"
/> />
</div> </div>
</template> </template>

View File

@ -104,6 +104,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="operationTableName" :table-name="operationTableName"
:record-name-title="'测站'"
/> />
</div> </div>
</template> </template>

View File

@ -67,6 +67,7 @@
<OperationLogModal <OperationLogModal
v-model:open="operationLogVisible" v-model:open="operationLogVisible"
:table-name="operationTableName" :table-name="operationTableName"
:record-name-title="'测站/断面名称'"
/> />
</div> </div>
</template> </template>