信息体组件增加配置项,当值为空时,初始值是否反向更新回去,默认为否,由后端赋值,否则会由于表单数据后加载和双向绑定导致重新赋值
样式调整,去掉列表行按钮间隔竖线 列表也拷贝数据发起流程或无流程数据发起流程的代码生成 增加从localstorage里加载数据发起流程的方法 流程配置中自动填充组件字段可配置必填和编辑
This commit is contained in:
@ -1008,10 +1008,10 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
formName: formName
|
||||
}
|
||||
});
|
||||
} else if (record.workflowData?.schemaId && !record.workflowData.taskIds) {
|
||||
} else if (record.workflowData?.schemaId && !record.workflowData.taskIds && record.workflowData.processId) {
|
||||
const { processId, schemaId } = record.workflowData;
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||
query: {
|
||||
readonly: 1,
|
||||
taskId: '',
|
||||
@ -1085,7 +1085,8 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
${
|
||||
hasCopyDataButton
|
||||
? `
|
||||
function handleCopyData(record: Recordable) {
|
||||
async function handleCopyData(record: Recordable) {
|
||||
/*//弹框添加数据
|
||||
${
|
||||
formType === 'modal'
|
||||
? `
|
||||
@ -1098,7 +1099,32 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
id: record.${camelCaseString(mainTable.pkField)},
|
||||
isCopy: true,
|
||||
});`
|
||||
}
|
||||
}*/
|
||||
|
||||
const result = await get${pascalMainTableName}(record['${camelCaseString(mainTable.pkField)}']);
|
||||
const form={};
|
||||
const key="form_copy_"+record['${camelCaseString(mainTable.pkField)}'];
|
||||
form[key]=result;
|
||||
localStorage.setItem('formJsonStr', JSON.stringify(form));
|
||||
|
||||
const schemaId=record.workflowData?.schemaId||schemaIdComputedRef.value;
|
||||
if(schemaId){
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/0/createFlow',
|
||||
query: {
|
||||
fromKey: key
|
||||
}
|
||||
});
|
||||
}else{
|
||||
router.push({
|
||||
path: '/form/${lowerClassName}/0/createForm',
|
||||
query: {
|
||||
formPath: '${model.outputConfig.outputValue}/${lowerClassName}',
|
||||
formName: formName,
|
||||
fromKey: key
|
||||
}
|
||||
});
|
||||
}
|
||||
}`
|
||||
: ''
|
||||
}
|
||||
@ -1481,14 +1507,14 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
let editAndDelBtn: ActionItem[] = [];
|
||||
${hasFlowRecordButton ? `let hasFlowRecord = false;` : ''}
|
||||
actionButtonConfig.value?.map((button) => {
|
||||
if (button.code === 'view') {
|
||||
if (['view', 'copyData'].includes(button.code)) {
|
||||
actionsList.push({
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
onClick: handleView.bind(null, record),
|
||||
onClick: btnEvent[button.code].bind(null, record),
|
||||
});
|
||||
}
|
||||
if (['edit', 'copyData', 'delete'].includes(button.code)) {
|
||||
if (['edit', 'delete'].includes(button.code)) {
|
||||
editAndDelBtn.push({
|
||||
icon: button?.icon,
|
||||
tooltip: button?.name,
|
||||
@ -1594,28 +1620,31 @@ ${hasTemplatePrint ? ' reactive ' : ''}
|
||||
}
|
||||
|
||||
async function handleLaunchProcess(record: Recordable) {
|
||||
if (record.workflowData) {
|
||||
if (record.workflowData.draftId) {
|
||||
let res = await getDraftInfo(record.workflowData.draftId);
|
||||
let data = isValidJSON(res.formData);
|
||||
if (data) {
|
||||
for (let key in data) {
|
||||
if (key.includes(formIdComputedRef.value)) {
|
||||
formDataRef.value = data[key];
|
||||
}
|
||||
const schemaId=record.workflowData?.schemaId||schemaIdComputedRef.value;
|
||||
if(schemaId){
|
||||
if(record.workflowData?.draftId){
|
||||
let res = await getDraftInfo(record.workflowData.draftId);
|
||||
if (isValidJSON(res.formData)) {
|
||||
localStorage.setItem('draftsJsonStr', res.formData);
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/'+record.workflowData.draftId+'/createFlow'
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
draftsId.value = record.workflowData.draftId;
|
||||
} else {
|
||||
const result = await get${pascalMainTableName}(record['${camelCaseString(
|
||||
mainTable.pkField,
|
||||
)}']);
|
||||
formDataRef.value = result;
|
||||
|
||||
const result = await get${pascalMainTableName}(record['${camelCaseString(mainTable.pkField)}']);
|
||||
const form={};
|
||||
const key="form_"+schemaId+"_"+record['${camelCaseString(mainTable.pkField)}'];
|
||||
form[key]=result;
|
||||
localStorage.setItem('formJsonStr', JSON.stringify(form));
|
||||
router.push({
|
||||
path: '/flow/' + schemaId + '/0/createFlow',
|
||||
query: {
|
||||
fromKey: key
|
||||
}
|
||||
});
|
||||
}
|
||||
rowKeyData.value = record['${camelCaseString(mainTable.pkField)}'];
|
||||
visibleLaunchProcessRef.value = true;
|
||||
schemaIdRef.value = record.workflowData.schemaId;
|
||||
}
|
||||
}
|
||||
function handleApproveProcess(record: Recordable) {
|
||||
const { processId, taskIds, schemaId } = record.workflowData;
|
||||
|
||||
Reference in New Issue
Block a user