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

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, instanceInfo: Object,
issueId: String, issueId: String,
isDetail: Boolean, isDetail: Boolean,
noSubmit: Array<String>,
}); });
const subTableId = ref(null); const subTableId = ref(null);
const subTableColumns: any = ref([]); 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: {}, componentProps: {},
includes: ['Input'], includes: ['Input'],
}, },
{
name: 'noSubmit',
label: '不提交数据',
component: 'Checkbox',
exclude: ['alert'],
},
]; ];

View File

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

View File

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