2026-05-07 08:35:20 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="guoYuSheShiShuJuHistory-page">
|
2026-05-09 19:30:03 +08:00
|
|
|
<GuoYuSheShiShuJuHistorySearch
|
|
|
|
|
ref="searchRef"
|
|
|
|
|
class="search-container"
|
|
|
|
|
:guoyuStatus="guoyuStatus"
|
|
|
|
|
:direction="direction"
|
|
|
|
|
@reset="handleReset"
|
|
|
|
|
@search-finish="handleSearchFinish"
|
|
|
|
|
/>
|
2026-05-07 08:35:52 +08:00
|
|
|
|
2026-05-15 17:38:03 +08:00
|
|
|
<BasicTable
|
|
|
|
|
ref="tableRef"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:list-url="getFishDraftPage"
|
|
|
|
|
:search-params="{}"
|
|
|
|
|
:transform-data="customTransform"
|
|
|
|
|
>
|
|
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
|
|
<template v-if="column.key === 'action' || column.dataIndex === 'action'">
|
|
|
|
|
<div class="flex">
|
|
|
|
|
<a-button type="link" size="small" @click="handleView(record)">查看</a-button>
|
|
|
|
|
</div>
|
2026-05-07 08:35:20 +08:00
|
|
|
</template>
|
2026-05-15 17:38:03 +08:00
|
|
|
</template>
|
|
|
|
|
</BasicTable>
|
2026-05-09 19:30:03 +08:00
|
|
|
<!-- 预览媒体组件 -->
|
|
|
|
|
<PreviewMedia
|
|
|
|
|
ref="previewMediaRef"
|
|
|
|
|
v-model:visible="mediaPreviewVisible"
|
|
|
|
|
:previewList="previewList"
|
|
|
|
|
:previewListIndex="previewListIndex"
|
|
|
|
|
:videoPreviewTitle="videoPreviewTitle"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<EditModal
|
|
|
|
|
ref="editModalRef"
|
|
|
|
|
v-model:visible="editModalVisible"
|
|
|
|
|
:is-view="true"
|
|
|
|
|
:direction="direction"
|
|
|
|
|
:initial-values="currentRecord"
|
|
|
|
|
@cancel="editModalCancel"
|
|
|
|
|
@preview-click="handlePreviewClick"
|
|
|
|
|
/>
|
2026-05-07 08:35:20 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, computed, onMounted, h, nextTick } from "vue";
|
|
|
|
|
import BasicTable from "@/components/BasicTable/index.vue";
|
2026-05-09 19:30:03 +08:00
|
|
|
import PreviewMedia from "@/components/previewMedia/index.vue";
|
2026-05-07 08:35:20 +08:00
|
|
|
import GuoYuSheShiShuJuHistorySearch from "./guoYuSheShiShuJuHistorySearch.vue";
|
|
|
|
|
import EditModal from "../guoYuSheShiShuJuTianBao/guoYuSheShiShuJuTianBaoForm.vue";
|
|
|
|
|
import { getFishDraftPage } from "@/api/guoYuSheShiShuJuTianBao";
|
|
|
|
|
import { Tag } from "ant-design-vue";
|
|
|
|
|
import { getDictItemsByCode } from "@/api/dict";
|
|
|
|
|
|
|
|
|
|
const baseUrl = import.meta.env.VITE_APP_PREVIEW_URL;
|
|
|
|
|
|
|
|
|
|
interface FormData {
|
|
|
|
|
[key: string]: any;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ColumnConfig {
|
|
|
|
|
dataIndex: string;
|
|
|
|
|
key: string;
|
|
|
|
|
title: string;
|
|
|
|
|
width?: number;
|
|
|
|
|
fixed?: string;
|
|
|
|
|
customRender?: (text: any, record: any) => any;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const tableRef = ref<any>(null);
|
|
|
|
|
|
|
|
|
|
const direction = ref<any>([]);
|
|
|
|
|
const guoyuStatus = ref<any>([]);
|
|
|
|
|
|
|
|
|
|
const baseColumnsConfig: ColumnConfig[] = [
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "hbrvnm",
|
|
|
|
|
key: "hbrvnm",
|
|
|
|
|
title: "流域",
|
|
|
|
|
width: 120,
|
|
|
|
|
fixed: "left",
|
|
|
|
|
},
|
|
|
|
|
{ dataIndex: "ennm", key: "ennm", title: "电站名称", width: 120, fixed: "left" },
|
|
|
|
|
{ dataIndex: "stnm", key: "stnm", title: "过鱼设施名称", width: 150, fixed: "left" },
|
|
|
|
|
{ dataIndex: "strdt", key: "strdt", title: "过鱼时间", width: 150 },
|
|
|
|
|
{ dataIndex: "ftpName", key: "ftpName", title: "鱼种类", width: 120 },
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "isfs",
|
|
|
|
|
key: "isfs",
|
|
|
|
|
title: "是否鱼苗",
|
|
|
|
|
width: 74,
|
|
|
|
|
customRender: ({ text }: any) => {
|
|
|
|
|
const isYes = text === 1 || text === "1";
|
|
|
|
|
return h(
|
|
|
|
|
Tag,
|
|
|
|
|
{
|
|
|
|
|
color: isYes ? "success" : "error",
|
|
|
|
|
style: { margin: 0 },
|
|
|
|
|
},
|
|
|
|
|
() => (isYes ? "是" : "否")
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "direction",
|
|
|
|
|
key: "direction",
|
|
|
|
|
title: "游向",
|
|
|
|
|
width: 80,
|
|
|
|
|
customRender: ({ text }: any) =>
|
|
|
|
|
direction.value.find((item: any) => item.itemCode === text)?.dictName || "-",
|
|
|
|
|
},
|
|
|
|
|
{ dataIndex: "fcnt", key: "fcnt", title: "过鱼数量(尾)", width: 120 },
|
|
|
|
|
{ dataIndex: "fsz", key: "fsz", title: "体长(cm)", width: 110 },
|
|
|
|
|
{ dataIndex: "fwet", key: "fwet", title: "平均体重(g)", width: 110 },
|
|
|
|
|
{ dataIndex: "wt", key: "wt", title: "水温(℃)", width: 80 },
|
|
|
|
|
{ dataIndex: "tm", key: "tm", title: "填报时间", width: 150 },
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "status",
|
|
|
|
|
key: "status",
|
|
|
|
|
title: "状态",
|
|
|
|
|
width: 74,
|
|
|
|
|
customRender: ({ text }: any) => {
|
|
|
|
|
let data = guoyuStatus.value.find((item: any) => item.itemCode === text);
|
|
|
|
|
return h(
|
|
|
|
|
Tag,
|
|
|
|
|
{
|
|
|
|
|
color: data?.custom1 || "error",
|
|
|
|
|
},
|
|
|
|
|
() => data?.dictName || "-"
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const editModalVisible = ref(false);
|
|
|
|
|
const currentRecord = ref<FormData | null>(null);
|
|
|
|
|
|
|
|
|
|
const mediaPreviewVisible = ref(false);
|
|
|
|
|
const videoPreviewTitle = ref("视频预览");
|
|
|
|
|
|
|
|
|
|
interface MediaItem {
|
|
|
|
|
id: string;
|
2026-05-09 19:30:03 +08:00
|
|
|
type: "image" | "video";
|
2026-05-07 08:35:20 +08:00
|
|
|
name: string;
|
|
|
|
|
url: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const previewList = ref<MediaItem[]>([]);
|
2026-05-09 19:30:03 +08:00
|
|
|
const previewListIndex = ref(0);
|
2026-05-07 08:35:20 +08:00
|
|
|
const columns = computed(() => {
|
|
|
|
|
return [
|
|
|
|
|
...baseColumnsConfig.map((col) => {
|
|
|
|
|
if (col.dataIndex === "level5") {
|
|
|
|
|
return {
|
|
|
|
|
...col,
|
|
|
|
|
customRender: ({ text }: any) => {
|
|
|
|
|
if (!text) return "-";
|
|
|
|
|
return `<span style="color:#52c41a; cursor:pointer">查看图片</span>`;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
if (col.dataIndex === "level6") {
|
|
|
|
|
return {
|
|
|
|
|
...col,
|
|
|
|
|
customRender: ({ text }: any) => {
|
|
|
|
|
if (!text) return "-";
|
|
|
|
|
return `<span style="color:#1890ff; cursor:pointer">播放视频</span>`;
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return { ...col, visible: true };
|
|
|
|
|
}),
|
|
|
|
|
{
|
|
|
|
|
title: "操作",
|
|
|
|
|
key: "action",
|
|
|
|
|
dataIndex: "action",
|
|
|
|
|
fixed: "right",
|
|
|
|
|
width: 100,
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const handleView = (record: any) => {
|
|
|
|
|
currentRecord.value = { ...record };
|
|
|
|
|
editModalVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const editModalCancel = () => {
|
|
|
|
|
editModalVisible.value = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handlePreviewClick = (record: any, type: string, index: number) => {
|
|
|
|
|
const mixedList: MediaItem[] = [];
|
|
|
|
|
if (type === "image") {
|
|
|
|
|
videoPreviewTitle.value = "图片预览";
|
|
|
|
|
const nameList = JSON.parse(JSON.stringify(record)).picpthList;
|
|
|
|
|
nameList.forEach((item: any) => {
|
|
|
|
|
mixedList.push({
|
|
|
|
|
id: record.id,
|
2026-05-09 19:30:03 +08:00
|
|
|
type: "image",
|
2026-05-07 08:35:20 +08:00
|
|
|
name: item.name,
|
|
|
|
|
url: item.url,
|
|
|
|
|
});
|
|
|
|
|
});
|
2026-05-09 19:30:03 +08:00
|
|
|
} else if (type === "video") {
|
2026-05-07 08:35:20 +08:00
|
|
|
videoPreviewTitle.value = "视频预览";
|
|
|
|
|
const nameList = JSON.parse(JSON.stringify(record)).vdpthList;
|
|
|
|
|
nameList.forEach((item: any) => {
|
|
|
|
|
mixedList.push({
|
|
|
|
|
id: record.id,
|
2026-05-09 19:30:03 +08:00
|
|
|
type: "video",
|
2026-05-07 08:35:20 +08:00
|
|
|
name: item.name,
|
|
|
|
|
url: item.url,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mediaPreviewVisible.value = true;
|
2026-05-09 19:30:03 +08:00
|
|
|
previewListIndex.value = index;
|
2026-05-07 08:35:20 +08:00
|
|
|
nextTick(() => {
|
|
|
|
|
previewList.value = mixedList;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const customTransform = (res: any) => {
|
|
|
|
|
const rawRecords = res?.data?.records || [];
|
|
|
|
|
const modifiedRecords = rawRecords.map((item: any) => {
|
|
|
|
|
return {
|
|
|
|
|
...item,
|
|
|
|
|
picpthList: item.picpth
|
|
|
|
|
? item.picpth.split(",").map((item: string) => baseUrl + "/?" + item) || []
|
|
|
|
|
: [],
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
records: modifiedRecords,
|
|
|
|
|
total: res?.data?.total || 0,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleReset = (values) => {
|
|
|
|
|
handleSearchFinish(values);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleSearchFinish = (values: any) => {
|
|
|
|
|
const filters = [
|
|
|
|
|
values.ftp && {
|
|
|
|
|
field: "ftp",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.ftp,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "strdt",
|
|
|
|
|
operator: "gte",
|
|
|
|
|
dataType: "date",
|
2026-05-09 19:30:03 +08:00
|
|
|
value: values.strdt[0] + " 00:00:00",
|
2026-05-07 08:35:20 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "strdt",
|
|
|
|
|
operator: "lte",
|
|
|
|
|
dataType: "date",
|
2026-05-09 19:30:03 +08:00
|
|
|
value: values.strdt[1] + " 23:59:59",
|
2026-05-07 08:35:20 +08:00
|
|
|
},
|
|
|
|
|
values.direction && {
|
|
|
|
|
field: "direction",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.direction,
|
|
|
|
|
},
|
2026-05-07 08:35:52 +08:00
|
|
|
{
|
2026-05-07 08:35:20 +08:00
|
|
|
field: "status",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
2026-05-09 19:30:03 +08:00
|
|
|
value: "APPROVED",
|
2026-05-07 08:35:20 +08:00
|
|
|
},
|
|
|
|
|
values.stcd && {
|
|
|
|
|
field: "stcd",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.stcd,
|
|
|
|
|
},
|
|
|
|
|
values.rstcd && {
|
|
|
|
|
field: "rstcd",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.rstcd,
|
|
|
|
|
},
|
|
|
|
|
values.hbrvcd !== "all" && {
|
|
|
|
|
field: "hbrvcd",
|
|
|
|
|
operator: "eq",
|
|
|
|
|
dataType: "string",
|
|
|
|
|
value: values.hbrvcd,
|
|
|
|
|
},
|
|
|
|
|
].filter(Boolean);
|
|
|
|
|
|
|
|
|
|
const filter = {
|
|
|
|
|
logic: "and",
|
|
|
|
|
filters: filters,
|
|
|
|
|
};
|
|
|
|
|
tableRef.value?.getList(filter);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getDictItemsByCode({ dictCode: "direction" }).then((res) => {
|
|
|
|
|
direction.value = res.data;
|
|
|
|
|
});
|
2026-05-07 08:35:52 +08:00
|
|
|
|
2026-05-07 08:35:20 +08:00
|
|
|
getDictItemsByCode({ dictCode: "approvalStatus" }).then((res) => {
|
|
|
|
|
guoyuStatus.value.length = 0;
|
|
|
|
|
res.data.forEach((item: any) => {
|
|
|
|
|
if (item.itemCode == "APPROVED") {
|
|
|
|
|
guoyuStatus.value.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.guoYuSheShiShuJuHistory-page {
|
2026-05-13 08:44:35 +08:00
|
|
|
position: relative;
|
|
|
|
|
z-index: 900;
|
|
|
|
|
pointer-events: all;
|
2026-05-07 08:35:20 +08:00
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
padding: 20px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.search-container {
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
</style>
|