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);