数据填报-表格组件改动引起的bug修改

This commit is contained in:
王兴凯 2026-06-09 09:25:26 +08:00
parent 8739128085
commit c1f3490c2c
5 changed files with 250 additions and 222 deletions

View File

@ -245,7 +245,7 @@ let columns = ref([
title: '过鱼开始时间', title: '过鱼开始时间',
width: 140, width: 140,
customRender: ({ text }) => { customRender: ({ text }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : ''; return text && text!= '-' ? dayjs(text).format('YYYY-MM-DD') : '-';
} }
}, },
{ {
@ -254,7 +254,7 @@ let columns = ref([
title: '过鱼结束时间', title: '过鱼结束时间',
width: 140, width: 140,
customRender: ({ text }) => { customRender: ({ text }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : ''; return text && text!= '-' ? dayjs(text).format('YYYY-MM-DD') : '-';
} }
}, },
{ {

View File

@ -17,12 +17,22 @@
<template v-if="column.key === 'action' || column.dataIndex === 'action'"> <template v-if="column.key === 'action' || column.dataIndex === 'action'">
<div class="flex"> <div class="flex">
<template v-if="editingRowIndex === index"> <template v-if="editingRowIndex === index">
<a-button type="link" size="small" @click="saveEdit(index)">保存</a-button> <a-button type="link" size="small" @click="saveEdit(index)"
<a-button type="link" size="small" @click="cancelEdit">取消</a-button> >保存</a-button
>
<a-button type="link" size="small" @click="cancelEdit"
>取消</a-button
>
</template> </template>
<template v-else> <template v-else>
<a-button type="link" size="small" @click="startEdit(index)">编辑</a-button> <a-button type="link" size="small" @click="startEdit(index)"
<a-button type="link" danger size="small" @click="handlePreviewDelete(index)" >编辑</a-button
>
<a-button
type="link"
danger
size="small"
@click="handlePreviewDelete(index)"
>删除</a-button >删除</a-button
> >
</template> </template>
@ -38,7 +48,9 @@
" "
> >
<div style="color: red; display: flex; align-items: center"> <div style="color: red; display: flex; align-items: center">
<span v-if="record[column.dataIndex]">{{ record[column.dataIndex] }}</span> <span v-if="record[column.dataIndex]">{{
record[column.dataIndex]
}}</span>
<span v-else> 请添加{{ column.title }}</span> <span v-else> 请添加{{ column.title }}</span>
<exclamation-circle-outlined style="margin-left: 4px" /> <exclamation-circle-outlined style="margin-left: 4px" />
</div> </div>
@ -47,7 +59,9 @@
<!-- 3. 编辑状态下的单元格 (绑定到 editingData) --> <!-- 3. 编辑状态下的单元格 (绑定到 editingData) -->
<template <template
v-else-if=" v-else-if="
isEditing(index) && column.dataIndex != 'picpth' && column.dataIndex != 'vdpth' isEditing(index) &&
column.dataIndex != 'picpth' &&
column.dataIndex != 'vdpth'
" "
> >
<!-- 基地 --> <!-- 基地 -->
@ -82,8 +96,12 @@
:filter-option="filterOption" :filter-option="filterOption"
:loading="rowStates[index]?.hbrvcdLoading" :loading="rowStates[index]?.hbrvcdLoading"
style="width: 100%" style="width: 100%"
@change="(val) => handleHbrvcdChange(val, index, 'input')" @change="val => handleHbrvcdChange(val, index, 'input')"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto', minWidth: '300px' }" :dropdown-style="{
maxHeight: '400px',
overflow: 'auto',
minWidth: '300px'
}"
> >
<a-select-option <a-select-option
v-for="opt in hbrvcdOptions" v-for="opt in hbrvcdOptions"
@ -107,7 +125,7 @@
:loading="rowStates[index]?.engLoading" :loading="rowStates[index]?.engLoading"
style="width: 100%" style="width: 100%"
:disabled="!editingData.rvcd" :disabled="!editingData.rvcd"
@change="(val) => handleEngChange(val, index, 'input')" @change="val => handleEngChange(val, index, 'input')"
> >
<a-select-option <a-select-option
v-for="opt in rowStates[index]?.engOptions || []" v-for="opt in rowStates[index]?.engOptions || []"
@ -131,7 +149,7 @@
:loading="rowStates[index]?.fpssLoading" :loading="rowStates[index]?.fpssLoading"
style="width: 100%" style="width: 100%"
:disabled="!editingData.rstcd" :disabled="!editingData.rstcd"
@change="(val) => handleFpssChange(val, index)" @change="val => handleFpssChange(val, index)"
> >
<a-select-option <a-select-option
v-for="opt in rowStates[index]?.fpssOptions || []" v-for="opt in rowStates[index]?.fpssOptions || []"
@ -151,7 +169,8 @@
style="width: 100%" style="width: 100%"
format="YYYY-MM-DD" format="YYYY-MM-DD"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
@change="(val) => delWarning(val, 'strdtStr')" :allow-clear="false"
@change="val => delWarning(val, 'strdtStr')"
/> />
</template> </template>
@ -170,7 +189,7 @@
v-model:value="editingData.direction" v-model:value="editingData.direction"
placeholder="请选择" placeholder="请选择"
style="width: 100%" style="width: 100%"
@change="(val) => delWarning(val, 'direction')" @change="val => delWarning(val, 'direction')"
> >
<a-select-option <a-select-option
v-for="item in direction" v-for="item in direction"
@ -190,7 +209,7 @@
:step="1" :step="1"
:precision="0" :precision="0"
:min="0" :min="0"
@change="(val) => delWarning(val, column.dataIndex)" @change="val => delWarning(val, column.dataIndex)"
/> />
</template> </template>
<template v-else-if="['wt'].includes(column.dataIndex)"> <template v-else-if="['wt'].includes(column.dataIndex)">
@ -204,7 +223,7 @@
<template v-else-if="column.dataIndex === 'isfs'"> <template v-else-if="column.dataIndex === 'isfs'">
<a-radio-group <a-radio-group
v-model:value="editingData.isfs" v-model:value="editingData.isfs"
@change="(val) => delWarning(val, 'isfs')" @change="val => delWarning(val, 'isfs')"
> >
<a-radio :value="1"></a-radio> <a-radio :value="1"></a-radio>
<a-radio :value="0"></a-radio> <a-radio :value="0"></a-radio>
@ -250,7 +269,9 @@
<div class="preview" v-for="(item, index) in record.picpthList"> <div class="preview" v-for="(item, index) in record.picpthList">
<div <div
class="text" class="text"
:class="{ text_warning: record.picpthsWarnings.includes(item.name) }" :class="{
text_warning: record.picpthsWarnings.includes(item.name)
}"
@click="emit('preview-click', record, 'image', index, 'delete')" @click="emit('preview-click', record, 'image', index, 'delete')"
> >
{{ item.name }} {{ item.name }}
@ -275,28 +296,28 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import _ from "lodash"; import _ from 'lodash';
import { ref, reactive, onMounted, h } from "vue"; import { ref, reactive, onMounted, h } from 'vue';
import { message, Tag } from "ant-design-vue"; import { message, Tag } from 'ant-design-vue';
import { ExclamationCircleOutlined } from "@ant-design/icons-vue"; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import fishSearch from "@/components/fishSearch/index.vue"; import fishSearch from '@/components/fishSearch/index.vue';
import { import {
getSelectForDropdown, getSelectForDropdown,
getEngInfoDropdown, getEngInfoDropdown,
getFpssDropdown, getFpssDropdown,
revalidateAndUpdateRow, revalidateAndUpdateRow,
deleteRowById, deleteRowById
} from "@/api/select"; } from '@/api/select';
const props: any = defineProps({ const props: any = defineProps({
taskId: { type: String, default: "" }, taskId: { type: String, default: '' },
getFileList: { type: Function, default: () => {} }, getFileList: { type: Function, default: () => {} },
fileTableData: { type: Array, default: () => [] }, fileTableData: { type: Array, default: () => [] },
fileLoading: { type: Boolean, default: false }, fileLoading: { type: Boolean, default: false },
direction: { type: Array, default: () => [] }, direction: { type: Array, default: () => [] }
}); });
const emit = defineEmits(["preview-click", "update:fileLoading"]); const emit = defineEmits(['preview-click', 'update:fileLoading']);
// --- --- // --- ---
const editingRowIndex = ref<number | null>(null); const editingRowIndex = ref<number | null>(null);
@ -308,91 +329,94 @@ const editingData = ref<any>(null);
const modalColumns = ref([ const modalColumns = ref([
{ {
dataIndex: "rowIndex", dataIndex: 'rowIndex',
key: "rowIndex", key: 'rowIndex',
title: "序号", title: '序号',
width: 60, width: 60,
dataIndexKey: "rowIndex", dataIndexKey: 'rowIndex',
align: "center", align: 'center',
fixed: "left", fixed: 'left'
}, },
{ {
dataIndex: "rvnm", dataIndex: 'rvnm',
key: "rvnm", key: 'rvnm',
dataIndexKey: "rvcd", dataIndexKey: 'rvcd',
title: "流域", title: '流域',
width: 140, width: 140
}, },
{ {
dataIndex: "ennm", dataIndex: 'ennm',
key: "ennm", key: 'ennm',
dataIndexKey: "rstcd", dataIndexKey: 'rstcd',
title: "电站名称", title: '电站名称',
width: 140, width: 140
}, },
{ {
dataIndex: "stnm", dataIndex: 'stnm',
key: "stnm", key: 'stnm',
dataIndexKey: "stcd", dataIndexKey: 'stcd',
title: "过鱼设施名称", title: '过鱼设施名称',
width: 150, width: 150
}, },
{ {
dataIndex: "strdtStr", dataIndex: 'strdtStr',
key: "strdtStr", key: 'strdtStr',
dataIndexKey: "strdtStr", dataIndexKey: 'strdtStr',
title: "过鱼时间", title: '过鱼时间',
width: 190, width: 190
}, },
{ {
dataIndex: "ftpName", dataIndex: 'ftpName',
key: "ftpName", key: 'ftpName',
dataIndexKey: "ftp", dataIndexKey: 'ftp',
title: "鱼种类", title: '鱼种类',
width: 120, width: 120
}, },
{ {
dataIndex: "isfs", dataIndex: 'isfs',
key: "isfs", key: 'isfs',
title: "是否鱼苗", title: '是否鱼苗',
dataIndexKey: "isfs", dataIndexKey: 'isfs',
width: 130, width: 130,
customRender: ({ text }: any) => { customRender: ({ text }: any) => {
const isYes = text === 1 || text === "1"; const isYes = text === 1 || text === '1';
return h(Tag, { color: isYes ? "success" : "error", style: { margin: 0 } }, () => return h(
isYes ? "是" : "否" Tag,
{ color: isYes ? 'success' : 'error', style: { margin: 0 } },
() => (isYes ? '是' : '否')
); );
}, }
}, },
{ {
dataIndex: "direction", dataIndex: 'direction',
dataIndexKey: "direction", dataIndexKey: 'direction',
key: "direction", key: 'direction',
title: "游向", title: '游向',
width: 120, width: 120,
customRender: ({ text }: any) => customRender: ({ text }: any) =>
props.direction.find((item: any) => item.itemCode === text)?.dictName || "-", props.direction.find((item: any) => item.itemCode === text)?.dictName ||
'-'
}, },
{ {
dataIndex: "fcnt", dataIndex: 'fcnt',
key: "fcnt", key: 'fcnt',
dataIndexKey: "fcnt", dataIndexKey: 'fcnt',
title: "过鱼数量(尾)", title: '过鱼数量(尾)',
width: 120, width: 120
}, },
{ dataIndex: "fsz", key: "fsz", title: "体长(cm)", width: 160 }, { dataIndex: 'fsz', key: 'fsz', title: '体长(cm)', width: 160 },
{ dataIndex: "fwet", key: "fwet", title: "平均体重(g)", width: 160 }, { dataIndex: 'fwet', key: 'fwet', title: '平均体重(g)', width: 160 },
{ dataIndex: "wt", key: "wt", title: "水温(℃)", width: 80 }, { dataIndex: 'wt', key: 'wt', title: '水温(℃)', width: 80 },
{ dataIndex: "picpth", key: "picpth", title: "图片", width: 160 }, { dataIndex: 'picpth', key: 'picpth', title: '图片', width: 160 },
{ dataIndex: "vdpth", key: "vdpth", title: "视频", width: 160 }, { dataIndex: 'vdpth', key: 'vdpth', title: '视频', width: 160 },
{ {
title: "操作", title: '操作',
key: "action", key: 'action',
dataIndex: "action", dataIndex: 'action',
fixed: "right", fixed: 'right',
width: 100, width: 100,
align: "center", align: 'center'
}, }
]); ]);
// --- --- // --- ---
@ -419,11 +443,11 @@ const loadHbrvcdOptions = async () => {
const res = await getSelectForDropdown({}); const res = await getSelectForDropdown({});
let list = res.data || []; let list = res.data || [];
if (list && list.length > 0) { if (list && list.length > 0) {
list = list.filter((item: any) => item.rvcd !== "all"); list = list.filter((item: any) => item.rvcd !== 'all');
} }
hbrvcdOptions.value = list; hbrvcdOptions.value = list;
} catch (e) { } catch (e) {
console.error("Load rvcd options failed", e); console.error('Load rvcd options failed', e);
} }
}; };
@ -435,7 +459,7 @@ const ensureRowState = (index: number) => {
baseLoading: false, baseLoading: false,
hbrvcdLoading: false, hbrvcdLoading: false,
engLoading: false, engLoading: false,
fpssLoading: false, fpssLoading: false
}; };
} }
return rowStates[index]; return rowStates[index];
@ -474,19 +498,19 @@ const ensureRowState = (index: number) => {
const handleHbrvcdChange = async ( const handleHbrvcdChange = async (
rvcd: string, rvcd: string,
index: number, index: number,
type = "start" type = 'start'
) => { ) => {
const state = ensureRowState(index); const state = ensureRowState(index);
editingData.value.rvnm = hbrvcdOptions.value.find( editingData.value.rvnm = hbrvcdOptions.value.find(
(item: any) => item.rvcd == rvcd (item: any) => item.rvcd == rvcd
)?.rvnm; )?.rvnm;
delWarning(rvcd, "rvcd"); delWarning(rvcd, 'rvcd');
if (rvcd == null) { if (rvcd == null) {
delWarning(null, "rvcd"); delWarning(null, 'rvcd');
delWarning(null, "stcd"); delWarning(null, 'stcd');
} }
// //
if (type != "start") { if (type != 'start') {
editingData.value.rstcd = undefined; editingData.value.rstcd = undefined;
editingData.value.stcd = undefined; editingData.value.stcd = undefined;
editingData.value.ennm = undefined; editingData.value.ennm = undefined;
@ -499,23 +523,27 @@ const handleHbrvcdChange = async (
const res = await getEngInfoDropdown({ rvcd }); const res = await getEngInfoDropdown({ rvcd });
state.engOptions = res.data || []; state.engOptions = res.data || [];
} catch (e) { } catch (e) {
message.error("获取电站列表失败"); message.error('获取电站列表失败');
} finally { } finally {
state.engLoading = false; state.engLoading = false;
} }
}; };
const handleEngChange = async (rstcd: string, index: number, type = "start") => { const handleEngChange = async (
rstcd: string,
index: number,
type = 'start'
) => {
const state = ensureRowState(index); const state = ensureRowState(index);
editingData.value.ennm = state.engOptions.find( editingData.value.ennm = state.engOptions.find(
(item: any) => item.stcd === rstcd (item: any) => item.stcd === rstcd
)?.ennm; )?.ennm;
delWarning(rstcd, "rstcd"); delWarning(rstcd, 'rstcd');
if (rstcd == null) { if (rstcd == null) {
delWarning(null, "stcd"); delWarning(null, 'stcd');
} }
// //
if (type != "start") { if (type != 'start') {
editingData.value.stcd = undefined; editingData.value.stcd = undefined;
editingData.value.stnm = undefined; editingData.value.stnm = undefined;
state.fpssOptions = []; state.fpssOptions = [];
@ -525,14 +553,14 @@ const handleEngChange = async (rstcd: string, index: number, type = "start") =>
const res = await getFpssDropdown({ rstcd, rvcd: editingData.value.rvcd }); const res = await getFpssDropdown({ rstcd, rvcd: editingData.value.rvcd });
state.fpssOptions = res.data || []; state.fpssOptions = res.data || [];
} catch (e) { } catch (e) {
message.error("获取设施列表失败"); message.error('获取设施列表失败');
} finally { } finally {
state.fpssLoading = false; state.fpssLoading = false;
} }
}; };
const handleFpssChange = (stcd: string, index: number) => { const handleFpssChange = (stcd: string, index: number) => {
const state = ensureRowState(index); const state = ensureRowState(index);
delWarning(stcd, "stcd"); delWarning(stcd, 'stcd');
editingData.value.stnm = state.fpssOptions.find( editingData.value.stnm = state.fpssOptions.find(
(item: any) => item.stcd === stcd (item: any) => item.stcd === stcd
)?.stnm; )?.stnm;
@ -548,7 +576,7 @@ const delWarning = (val: any, key: string) => {
const warnings = editingData.value.warnings; const warnings = editingData.value.warnings;
const hasWarning = warnings.includes(key); const hasWarning = warnings.includes(key);
if (val !== null && val !== undefined && val !== "") { if (val !== null && val !== undefined && val !== '') {
// 1. // 1.
if (hasWarning) { if (hasWarning) {
editingData.value.warnings = warnings.filter((w: string) => w !== key); editingData.value.warnings = warnings.filter((w: string) => w !== key);
@ -573,35 +601,38 @@ const startEdit = (index: number) => {
processStringToMinMax(editingData.value); processStringToMinMax(editingData.value);
editingRowIndex.value = index; editingRowIndex.value = index;
if (editingData.value.warnings.includes("rvcd")) { if (editingData.value.warnings.includes('rvcd')) {
editingData.value.rvcd = null; editingData.value.rvcd = null;
editingData.value.rvnm = null; editingData.value.rvnm = null;
editingData.value.rstcd = null; editingData.value.rstcd = null;
editingData.value.stcd = null; editingData.value.stcd = null;
delWarning(null, "rstcd"); delWarning(null, 'rstcd');
delWarning(null, "stcd"); delWarning(null, 'stcd');
} }
if (editingData.value.warnings.includes("rstcd")) { if (editingData.value.warnings.includes('rstcd')) {
editingData.value.stcd = null; editingData.value.stcd = null;
delWarning(null, "stcd"); delWarning(null, 'stcd');
} }
if (editingData.value.warnings.includes("strdt")) { if (editingData.value.warnings.includes('strdt')) {
editingData.value.strdt = null; editingData.value.strdt = null;
delWarning(null, "strdt"); delWarning(null, 'strdt');
} }
// 3. ( editingData ) // 3. ( editingData )
if (editingData.value.rvcd == "" || editingData.value.rvcd == undefined) { if (editingData.value.rvcd == '' || editingData.value.rvcd == undefined) {
if (editingData.value.rstcd) { if (editingData.value.rstcd) {
handleHbrvcdChange("", index, "start").then(() => { handleHbrvcdChange('', index, 'start').then(() => {
handleEngChange(editingData.value.rstcd, index, "start"); handleEngChange(editingData.value.rstcd, index, 'start');
}); });
} else { } else {
handleEngChange("", index, "start"); handleEngChange('', index, 'start');
} }
} else if (editingData.value.rvcd != "" && editingData.value.rvcd != undefined) { } else if (
handleHbrvcdChange(editingData.value.rvcd, index, "start").then(() => { editingData.value.rvcd != '' &&
handleEngChange(editingData.value.rstcd, index, "start"); editingData.value.rvcd != undefined
) {
handleHbrvcdChange(editingData.value.rvcd, index, 'start').then(() => {
handleEngChange(editingData.value.rstcd, index, 'start');
}); });
} }
}; };
@ -609,45 +640,45 @@ const startEdit = (index: number) => {
// Min/Max // Min/Max
const processStringToMinMax = (data: any) => { const processStringToMinMax = (data: any) => {
if (data.fsz) { if (data.fsz) {
const sizes = String(data.fsz).split("~"); const sizes = String(data.fsz).split('~');
data.bodyLengthMin = sizes[0] || ""; data.bodyLengthMin = sizes[0] || '';
data.bodyLengthMax = sizes[1] || sizes[0] || ""; data.bodyLengthMax = sizes[1] || sizes[0] || '';
} else { } else {
data.bodyLengthMin = ""; data.bodyLengthMin = '';
data.bodyLengthMax = ""; data.bodyLengthMax = '';
} }
if (data.fwet) { if (data.fwet) {
const weights = String(data.fwet).split("~"); const weights = String(data.fwet).split('~');
data.weightMin = weights[0] || ""; data.weightMin = weights[0] || '';
data.weightMax = weights[1] || weights[0] || ""; data.weightMax = weights[1] || weights[0] || '';
} else { } else {
data.weightMin = ""; data.weightMin = '';
data.weightMax = ""; data.weightMax = '';
} }
}; };
// Min/Max // Min/Max
const processMinMaxToString = (data: any) => { const processMinMaxToString = (data: any) => {
// //
if (data.bodyLengthMin !== "" || data.bodyLengthMax !== "") { if (data.bodyLengthMin !== '' || data.bodyLengthMax !== '') {
if (data.bodyLengthMin == data.bodyLengthMax) { if (data.bodyLengthMin == data.bodyLengthMax) {
data.fsz = data.bodyLengthMin; data.fsz = data.bodyLengthMin;
} else { } else {
data.fsz = `${data.bodyLengthMin}~${data.bodyLengthMax}`; data.fsz = `${data.bodyLengthMin}~${data.bodyLengthMax}`;
} }
} else { } else {
data.fsz = ""; data.fsz = '';
} }
// //
if (data.weightMin !== "" || data.weightMax !== "") { if (data.weightMin !== '' || data.weightMax !== '') {
if (data.weightMin == data.weightMax) { if (data.weightMin == data.weightMax) {
data.fwet = data.weightMin; data.fwet = data.weightMin;
} else { } else {
data.fwet = `${data.weightMin}~${data.weightMax}`; data.fwet = `${data.weightMin}~${data.weightMax}`;
} }
} else { } else {
data.fwet = ""; data.fwet = '';
} }
// //
@ -661,26 +692,34 @@ const saveEdit = async (index: number) => {
// 1. Min/Max fsz/fwet // 1. Min/Max fsz/fwet
processMinMaxToString(editingData.value); processMinMaxToString(editingData.value);
// 2. // 2. strdtStr
if (!editingData.value.strdtStr) {
message.error('过鱼时间不能为空');
return;
}
// 3.
const newData = [...props.fileTableData]; const newData = [...props.fileTableData];
newData[index] = { ...editingData.value }; newData[index] = { ...editingData.value };
newData[index].strdt = newData[index].strdtStr + " 00:00:00"; newData[index].strdt = newData[index].strdtStr
emit("update:fileLoading", true); ? newData[index].strdtStr + ' 00:00:00'
: newData[index].strdtStr;
emit('update:fileLoading', true);
try { try {
const res: any = await revalidateAndUpdateRow({ const res: any = await revalidateAndUpdateRow({
taskId: props.taskId, taskId: props.taskId,
data: newData[index], data: newData[index]
}); });
if (res && res?.code == 0) { if (res && res?.code == 0) {
message.success("保存成功"); message.success('保存成功');
props.getFileList(); props.getFileList();
editingRowIndex.value = null; editingRowIndex.value = null;
editingData.value = null; editingData.value = null;
} }
} catch (e) { } catch (e) {
message.error("保存失败"); message.error('保存失败');
} finally { } finally {
emit("update:fileLoading", false); emit('update:fileLoading', false);
} }
}; };
@ -692,29 +731,29 @@ const cancelEdit = () => {
// //
const handlePreviewDelete = async (index: number) => { const handlePreviewDelete = async (index: number) => {
const newData = [...props.fileTableData]; const newData = [...props.fileTableData];
emit("update:fileLoading", true); emit('update:fileLoading', true);
try { try {
const res: any = await deleteRowById({ const res: any = await deleteRowById({
taskId: props.taskId, taskId: props.taskId,
data: newData[index], data: newData[index]
}); });
if (res && res?.code == 0) { if (res && res?.code == 0) {
message.success("删除成功"); message.success('删除成功');
props.getFileList(); props.getFileList();
editingRowIndex.value = null; editingRowIndex.value = null;
editingData.value = null; editingData.value = null;
} }
} catch (e) { } catch (e) {
message.error("删除失败"); message.error('删除失败');
} finally { } finally {
emit("update:fileLoading", false); emit('update:fileLoading', false);
} }
}; };
// //
const handleFtpChange = (val: any, opt: any) => { const handleFtpChange = (val: any, opt: any) => {
editingData.value.ftpName = opt.name; editingData.value.ftpName = opt.name;
delWarning(val, "ftp"); delWarning(val, 'ftp');
}; };
// --- --- // --- ---
@ -723,7 +762,7 @@ const filterOption = (input: string, option: any) => {
}; };
defineExpose({ defineExpose({
editingRowIndex, editingRowIndex,
editingData, editingData
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -37,7 +37,7 @@ const localTypeDate = ref<string>(null);
const basicSearchRef = ref<any>(); const basicSearchRef = ref<any>();
const initSearchData = { const initSearchData = {
rvcd: "rvcd", rvcd: "all",
stcd: null, stcd: null,
rstcd: null, rstcd: null,
strdt: [ strdt: [

View File

@ -19,10 +19,7 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<!-- 使用 bodyCell 插槽自定义单元格渲染 --> <!-- 使用 bodyCell 插槽自定义单元格渲染 -->
<template #bodyCell="{ column, record }"> <template #action="{ column, record }">
<template
v-if="column.key === 'action' || column.dataIndex === 'action'"
>
<div class="flex"> <div class="flex">
<a-button type="link" size="small" @click="handleShowDetail(record)" <a-button type="link" size="small" @click="handleShowDetail(record)"
>详情</a-button >详情</a-button
@ -36,13 +33,6 @@
<!-- <a-button type="link" size="small" @click="handleShowChangeLog(record)">变更详情</a-button> --> <!-- <a-button type="link" size="small" @click="handleShowChangeLog(record)">变更详情</a-button> -->
</div> </div>
</template> </template>
<template v-if="column.dataIndex === 'bizType'">
{{ handName(record.bizType, yeWuType) }}
</template>
<!-- <template v-if="column.dataIndex === 'status'">
{{ handName(record.status, shenStatus) }}
</template> -->
</template>
</BasicTable> </BasicTable>
<!-- 审批操作日志弹框 --> <!-- 审批操作日志弹框 -->
@ -65,11 +55,9 @@
:list-url="getApprovalLogList" :list-url="getApprovalLogList"
:scroll-y="500" :scroll-y="500"
> >
<template #bodyCell="{ column, record }"> <template #action="{ column, record }">
<template v-if="column.dataIndex === 'action'">
{{ handName(record.action, actionTypeDict) }} {{ handName(record.action, actionTypeDict) }}
</template> </template>
</template>
</BasicTable> </BasicTable>
</div> </div>
</a-modal> </a-modal>
@ -94,19 +82,17 @@
:list-url="getApprovalChangeLogList" :list-url="getApprovalChangeLogList"
:scroll-y="500" :scroll-y="500"
> >
<template #bodyCell="{ column, record }"> <template #operationType="{ column, record }">
<template v-if="column.dataIndex === 'operationType'">
{{ handName(record.operationType, operationTypeDict) }} {{ handName(record.operationType, operationTypeDict) }}
</template> </template>
<template v-if="column.dataIndex === 'bizType'"> <template #bizType="{ column, record }">
{{ handName(record.bizType, yeWuType) }} {{ handName(record.bizType, yeWuType) }}
</template> </template>
<template v-if="column.dataIndex === 'changeJson'"> <template #changeJson="{ column, record }">
<pre style="max-height: 200px; overflow: auto; margin: 0">{{ <pre style="max-height: 200px; overflow: auto; margin: 0">{{
record.changeJson record.changeJson
}}</pre> }}</pre>
</template> </template>
</template>
</BasicTable> </BasicTable>
</div> </div>
</a-modal> </a-modal>
@ -136,8 +122,7 @@
:scroll-y="'500px'" :scroll-y="'500px'"
:transform-data="customTransform" :transform-data="customTransform"
> >
<template #bodyCell="{ column, record }"> <template #isfs="{ column, record }">
<template v-if="column.dataIndex === 'isfs'">
<a-tag <a-tag
:color=" :color="
record.isfs === 1 || record.isfs === '1' ? 'success' : 'error' record.isfs === 1 || record.isfs === '1' ? 'success' : 'error'
@ -146,17 +131,14 @@
{{ record.isfs === 1 || record.isfs === '1' ? '是' : '否' }} {{ record.isfs === 1 || record.isfs === '1' ? '是' : '否' }}
</a-tag> </a-tag>
</template> </template>
<template v-if="column.dataIndex === 'direction'"> <template #direction="{ column, record }">
{{ handName(record.direction, direction) }} {{ handName(record.direction, direction) }}
</template> </template>
<template <template #action="{ column, record }">
v-if="column.key === 'action' || column.dataIndex === 'action'"
>
<a-button type="link" size="small" @click="handleView(record)" <a-button type="link" size="small" @click="handleView(record)"
>查看</a-button >查看</a-button
> >
</template> </template>
</template>
</BasicTable> </BasicTable>
</div> </div>
</a-modal> </a-modal>
@ -365,7 +347,8 @@ let columns = ref([
title: '操作', title: '操作',
key: 'action', key: 'action',
width: 120, width: 120,
fixed: 'right' fixed: 'right',
slots: { customRender: 'action' }
} }
]); ]);
const tableRef = ref(); const tableRef = ref();
@ -378,11 +361,11 @@ const handleSearchFinish = (values: any) => {
dataType: 'string', dataType: 'string',
value: values.status value: values.status
}, },
values.rvcd !== "all" && { values.rvcd !== 'all' && {
field: "rvcd", field: 'rvcd',
operator: "eq", operator: 'eq',
dataType: "string", dataType: 'string',
value: values.rvcd, value: values.rvcd
}, },
values.stcd && { values.stcd && {
field: 'stcd', field: 'stcd',
@ -412,7 +395,8 @@ const approvalLogColumns = ref([
dataIndex: 'action', dataIndex: 'action',
key: 'action', key: 'action',
width: 120, width: 120,
align: 'center' align: 'center',
slots: { customRender: 'action' }
}, },
{ {
title: '操作人', title: '操作人',
@ -451,14 +435,16 @@ const changeLogColumns = ref([
dataIndex: 'bizType', dataIndex: 'bizType',
key: 'bizType', key: 'bizType',
width: 120, width: 120,
align: 'center' align: 'center',
slots: { customRender: 'bizType' }
}, },
{ {
title: '操作类型', title: '操作类型',
dataIndex: 'operationType', dataIndex: 'operationType',
key: 'operationType', key: 'operationType',
width: 120, width: 120,
align: 'center' align: 'center',
slots: { customRender: 'operationType' }
}, },
{ {
title: '操作人', title: '操作人',
@ -541,13 +527,15 @@ const detailColumns = ref([
dataIndex: 'isfs', dataIndex: 'isfs',
key: 'isfs', key: 'isfs',
title: '是否鱼苗', title: '是否鱼苗',
width: 74 width: 74,
slots: { customRender: 'isfs' }
}, },
{ {
dataIndex: 'direction', dataIndex: 'direction',
key: 'direction', key: 'direction',
title: '游向', title: '游向',
width: 80 width: 80,
slots: { customRender: 'direction' }
}, },
{ dataIndex: 'fcnt', key: 'fcnt', title: '过鱼数量(尾)', width: 120 }, { dataIndex: 'fcnt', key: 'fcnt', title: '过鱼数量(尾)', width: 120 },
{ dataIndex: 'fsz', key: 'fsz', title: '体长(cm)', width: 110 }, { dataIndex: 'fsz', key: 'fsz', title: '体长(cm)', width: 110 },
@ -560,7 +548,8 @@ const detailColumns = ref([
dataIndex: 'action', dataIndex: 'action',
fixed: 'right', fixed: 'right',
width: 100, width: 100,
align: 'center' align: 'center',
slots: { customRender: 'action' }
} }
]); ]);
@ -616,11 +605,11 @@ const handleDetailSearchFinish = (values: any) => {
dataType: 'string', dataType: 'string',
value: values.rstcd value: values.rstcd
}, },
values.rvcd !== "all" && { values.rvcd !== 'all' && {
field: "rvcd", field: 'rvcd',
operator: "eq", operator: 'eq',
dataType: "string", dataType: 'string',
value: values.rvcd, value: values.rvcd
}, },
approvalId.value && { approvalId.value && {
field: 'approvalId', // field: 'approvalId', //