From 205768fbc34a92251a0e37e7c100de4866304bd8 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 23 Jul 2026 15:50:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=B7=A5=E8=89=BA=E8=B7=AF=E7=BA=BF?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=AE=8B=E7=95=99=E9=97=AE=E9=A2=98=E6=A0=B9?= =?UTF-8?q?=E6=B2=BB:xtSelect=E5=A4=96=E9=83=A8=E6=B8=85=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E6=97=B6=E5=90=8C=E6=AD=A5=E6=B8=85=E7=A9=BA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E5=AD=97(=E6=AE=8B=E7=95=99=E4=B8=BB=E5=9B=A0);?= =?UTF-8?q?=E7=94=BB=E5=B8=83/=E5=8F=B3=E4=BE=A7=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E5=8A=A0key=E6=AF=8F=E6=AC=A1=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=BC=BA=E5=88=B6=E9=87=8D=E5=BB=BA=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?;route=5Fform=E7=BC=96=E8=BE=91=E6=97=B6sort=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E8=A2=ABcount+1=E8=A6=86=E7=9B=96;=E6=97=A0routeId=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=85=A8=E9=87=8F=E6=8B=89=E8=BE=85=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- src/components/xtFlowEditor.vue | 5 ++++- src/components/xtSelect/index.vue | 15 ++++++++++++--- src/views/mtm/route_form.vue | 8 +++++++- src/views/mtm/routepack_form.vue | 5 ++++- 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/components/xtFlowEditor.vue b/src/components/xtFlowEditor.vue index 4c871628..115ffe28 100644 --- a/src/components/xtFlowEditor.vue +++ b/src/components/xtFlowEditor.vue @@ -87,9 +87,10 @@ - + { const inst = this.$refs.routeForm.open(mode); diff --git a/src/components/xtSelect/index.vue b/src/components/xtSelect/index.vue index 83405748..8eef005f 100644 --- a/src/components/xtSelect/index.vue +++ b/src/components/xtSelect/index.vue @@ -123,8 +123,18 @@ onMounted(() => { const init = () => { if (props.label) { selectLabel.value = props.label; - } else { - if (props.multiple) { + return; + } + // 外部把值清空(表单重置/实例复用)时同步清空显示文字,否则输入框会残留上次选择的内容 + const emptyVal = + props.modelValue == null || + props.modelValue === "" || + (Array.isArray(props.modelValue) && props.modelValue.length === 0); + if (emptyVal) { + selectLabel.value = ""; + return; + } + if (props.multiple) { if (isFixOptions.value) { selectLabel.value = props.options .filter((item) => @@ -149,7 +159,6 @@ const init = () => { selectLabel.value = props.obj[props.labelField]; } } - } } const isFixOptions = ref(false); diff --git a/src/views/mtm/route_form.vue b/src/views/mtm/route_form.vue index 2d620ae0..5d192144 100644 --- a/src/views/mtm/route_form.vue +++ b/src/views/mtm/route_form.vue @@ -397,6 +397,11 @@ export default { }, getroutemats(){ let that = this; + // 无 routeId(画布拉线预填等新增场景)时不请求,避免拉回全量辅料 + if (!that.routeId) { + that.routemats = []; + return; + } that.$API.mtm.routemat.list.req({ route: that.routeId,page: 0}).then((res) => { that.routemats = res; }); @@ -500,7 +505,8 @@ export default { that.resetForm(); that.visible = true; that.$nextTick(() => { - if(that.count){ + // 仅新增时按现有数量预填排序;编辑时保留 setData 带入的原 sort + if(that.count && mode === "add"){ that.form.sort = that.count+1; } that.$refs.dialogForm && that.$refs.dialogForm.clearValidate(); diff --git a/src/views/mtm/routepack_form.vue b/src/views/mtm/routepack_form.vue index 0ea87702..f5806356 100644 --- a/src/views/mtm/routepack_form.vue +++ b/src/views/mtm/routepack_form.vue @@ -184,6 +184,7 @@ { this.$refs.saveDialog.open("add"); }); }, table_edit(row) { + this.dialogSeq += 1; this.dialog.save = true; this.$nextTick(() => { this.$refs.saveDialog.open("edit").setData(row);