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