resolver-egretimp-plus 0.1.96 → 0.1.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/h5/index.js +2 -2
- package/dist/web/index.js +2 -2
- package/package.json +1 -1
- package/src/bpm/bpmInstance.js +50 -45
- package/src/utils/render.jsx +1 -1
package/package.json
CHANGED
package/src/bpm/bpmInstance.js
CHANGED
|
@@ -78,60 +78,65 @@ export class Bpm {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
const saveButton = dynamicMapComp[bpmSubmitBtn]
|
|
81
|
-
if (saveButton) {
|
|
82
|
-
const createAfterRequestService = (fn) => {
|
|
83
|
-
return async (ret) => {
|
|
84
|
-
const { saveAfter } = this.bpmConfigs
|
|
85
|
-
this.saveResponse = ret
|
|
86
|
-
// ======= 刚开始保存的弹框复制单号逻辑 ===== start======
|
|
87
|
-
const { copyModal, lang, calcShowCopyModal } = this.params
|
|
88
|
-
try {
|
|
89
|
-
const tipMsgPath = calcShowCopyModal(ret, eventData)
|
|
90
|
-
if (tipMsgPath) {
|
|
91
|
-
const { submitType } = eventData
|
|
92
|
-
this.showCopyModalCb = () => {
|
|
93
|
-
const msgSubmit = lang?.value?.indexOf('zh') > -1 ? '提交成功' : 'Submit Success'
|
|
94
|
-
const msgSave = lang?.value?.indexOf('zh') > -1 ? '保存成功' : 'Save Success'
|
|
95
|
-
const isSubmit = [SUBMIT_TYPE.SEND, SUBMIT_TYPE.SUBMIT, SUBMIT_TYPE.AGREE].includes(submitType)
|
|
96
|
-
const successMsg = isSubmit ? msgSubmit : msgSave
|
|
97
|
-
this.showCopyModalCb = null
|
|
98
81
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
82
|
+
const createAfterRequestService = (fn) => {
|
|
83
|
+
return async (ret) => {
|
|
84
|
+
const { saveAfter } = this.bpmConfigs
|
|
85
|
+
this.saveResponse = ret
|
|
86
|
+
// ======= 刚开始保存的弹框复制单号逻辑 ===== start======
|
|
87
|
+
const { copyModal, lang, calcShowCopyModal } = this.params
|
|
88
|
+
try {
|
|
89
|
+
const tipMsgPath = calcShowCopyModal(ret, eventData)
|
|
90
|
+
if (tipMsgPath) {
|
|
91
|
+
const { submitType } = eventData
|
|
92
|
+
this.showCopyModalCb = () => {
|
|
93
|
+
const msgSubmit = lang?.value?.indexOf('zh') > -1 ? '提交成功' : 'Submit Success'
|
|
94
|
+
const msgSave = lang?.value?.indexOf('zh') > -1 ? '保存成功' : 'Save Success'
|
|
95
|
+
const isSubmit = [SUBMIT_TYPE.SEND, SUBMIT_TYPE.SUBMIT, SUBMIT_TYPE.AGREE].includes(submitType)
|
|
96
|
+
const successMsg = isSubmit ? msgSubmit : msgSave
|
|
97
|
+
this.showCopyModalCb = null
|
|
98
|
+
|
|
99
|
+
return new Promise(resolve => {
|
|
100
|
+
copyModal?.({
|
|
101
|
+
lang: lang?.value,
|
|
102
|
+
type: 'check',
|
|
103
|
+
showcopy: true,
|
|
104
|
+
copytype: lang?.value?.indexOf('zh') > -1 ? '申请单号' : 'Application No.',
|
|
105
|
+
copymsg: tipMsgPath,
|
|
106
|
+
showCancle: false,
|
|
107
|
+
msg: successMsg,
|
|
108
|
+
handleOk: async () => {
|
|
109
|
+
resolve(true)
|
|
110
|
+
}
|
|
112
111
|
})
|
|
113
|
-
}
|
|
112
|
+
})
|
|
114
113
|
}
|
|
115
|
-
// ======= 刚开始保存的弹框复制单号逻辑 ===== end======
|
|
116
|
-
|
|
117
|
-
await saveAfter?.(ret, eventData)
|
|
118
|
-
} catch (error) {
|
|
119
|
-
console.error('saveAfter error, error:', error)
|
|
120
114
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
// ======= 刚开始保存的弹框复制单号逻辑 ===== end======
|
|
116
|
+
|
|
117
|
+
await saveAfter?.(ret, eventData)
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error('saveAfter error, error:', error)
|
|
124
120
|
}
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
fn?.(ret)
|
|
123
|
+
}, 0);
|
|
125
124
|
}
|
|
126
|
-
|
|
125
|
+
}
|
|
126
|
+
return new Promise((resolve) => {
|
|
127
|
+
const afterRequestService = createAfterRequestService((ret) => { resolve(ret) })
|
|
128
|
+
|
|
129
|
+
if (saveButton) {
|
|
127
130
|
saveButton?.vm?.click({
|
|
128
131
|
// 保存成功的回调
|
|
129
|
-
afterRequestService
|
|
132
|
+
afterRequestService,
|
|
130
133
|
})
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
} else {
|
|
135
|
+
// messageInstance?.warning?.('no set bpmSubmitBtn, or bpmSubmitBtn is invalid.')
|
|
136
|
+
console.log('no set bpmSubmitBtn, or bpmSubmitBtn is invalid.')
|
|
137
|
+
afterRequestService({})
|
|
138
|
+
}
|
|
139
|
+
})
|
|
135
140
|
}
|
|
136
141
|
const getDetail = () => {
|
|
137
142
|
const params = getDetailReq?.(this.saveResponse)
|
package/src/utils/render.jsx
CHANGED
|
@@ -821,7 +821,7 @@ function getFormItemRule(config, lang, params, compProps) {
|
|
|
821
821
|
return
|
|
822
822
|
}
|
|
823
823
|
const val = config?.refValue
|
|
824
|
-
const message = lang.indexOf('zh') > -1 ? `${config.metaNameZh}不能为空` : `${config.metaNameEn} can not be empty`
|
|
824
|
+
const message = lang.indexOf('zh') > -1 ? `${config.metaNameZh || ''}不能为空` : `${config.metaNameEn || ''} can not be empty`
|
|
825
825
|
if (!onlyRequiredFlag && required) {
|
|
826
826
|
if (val === '' || val === null || val === undefined || (Array.isArray(val) && !val.length)) {
|
|
827
827
|
callback(new Error(message))
|