表单设计时配置组件不提交,表单填写时配置不提交组件不参与表单的提交

main
zhufu 2025-05-20 09:36:55 +08:00
parent 9ce7599ad2
commit 08d710ef53
4 changed files with 40 additions and 6 deletions

View File

@ -103,6 +103,7 @@
instanceInfo: Object,
issueId: String,
isDetail: Boolean,
noSubmit: Array<String>,
});
const subTableId = ref(null);
const subTableColumns: any = ref([]);
@ -192,6 +193,12 @@
});
});
}
// id
if(configElement?.itemProps?.noSubmit){
if(!props.noSubmit?.includes(configElement.field)){
props.noSubmit?.push(configElement.field)
}
}
});
});
});

View File

@ -362,4 +362,10 @@ export const baseFormItemControlAttrs: IBaseFormItemControlAttrs[] = [
componentProps: {},
includes: ['Input'],
},
{
name: 'noSubmit',
label: '不提交数据',
component: 'Checkbox',
exclude: ['alert'],
},
];

View File

@ -34,6 +34,7 @@
:processId="designerData.process.id"
:formRelationId="designerData.formCurrentNode.formRelationId"
:instanceInfo="designerData.process.instanceInfo"
:noSubmit="noSubmit"
v-if="formVisble"
/>
</div>
@ -144,6 +145,7 @@
const emit = defineEmits(['closeModel']);
const keyValue = ref('');
const pcForm = ref();
const noSubmit = ref<string[]>([])
//
const formConfig = ref<IFormConfig>({
//
@ -323,11 +325,20 @@
}
}
}
querys.data = JSON.stringify(res);
const formValue = await functionsaveForm(querys);
if (formValue) {
handleCreateFlow(processId);
}
setTimeout(async () => {
//
let resultQuery = {}
Object.keys(res).forEach(key => {
if(!noSubmit.value.includes(key)){
resultQuery[key] = res[key]
}
})
querys.data = JSON.stringify(resultQuery);
const formValue = await functionsaveForm(querys);
if (formValue) {
handleCreateFlow(processId);
}
},100)
}
})
.catch((error) => {

View File

@ -62,6 +62,7 @@
:formVerison="designerData.formCurrentNode.formVerison"
:formRelationId="designerData.formCurrentNode.formRelationId"
:instanceInfo="designerData.process.instanceInfo"
:noSubmit="noSubmit"
@getFormSuccess="getFormSuccess"
v-if="formVisble"
/>
@ -136,6 +137,7 @@
:formVerison="designerData.formCurrentNode.formVerison"
:formRelationId="designerData.formCurrentNode.formRelationId"
:instanceInfo="designerData.process.instanceInfo"
:noSubmit="noSubmit"
@getFormSuccess="getFormSuccess"
v-if="formVisble"
/>
@ -424,6 +426,7 @@
bottom: '0px',
right: '0px',
});
const noSubmit = ref<string[]>([])
function changeActive(activeKey) {
if (activeKey == 'flow') {
@ -802,7 +805,14 @@
}
console.log('审核提交');
setTimeout(async () => {
querys.data = JSON.stringify(res);
//
let resultQuery = {}
Object.keys(res).forEach(key => {
if(!noSubmit.value.includes(key)){
resultQuery[key] = res[key]
}
})
querys.data = JSON.stringify(resultQuery);
spinning.value = true;
const formValue = await functionsaveForm(querys);
spinning.value = false;