表单设计时配置组件不提交,表单填写时配置不提交组件不参与表单的提交
parent
9ce7599ad2
commit
08d710ef53
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -362,4 +362,10 @@ export const baseFormItemControlAttrs: IBaseFormItemControlAttrs[] = [
|
|||
componentProps: {},
|
||||
includes: ['Input'],
|
||||
},
|
||||
{
|
||||
name: 'noSubmit',
|
||||
label: '不提交数据',
|
||||
component: 'Checkbox',
|
||||
exclude: ['alert'],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue