resolver-egretimp-plus 0.1.97 → 0.1.99

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -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
- 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
- }
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
- setTimeout(() => {
122
- fn?.(ret)
123
- }, 0);
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
- return new Promise((resolve) => {
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: createAfterRequestService((ret) => { resolve(ret) })
132
+ afterRequestService,
130
133
  })
131
- })
132
- } else {
133
- messageInstance?.warning?.('no set bpmSubmitBtn, or bpmSubmitBtn is invalid.')
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({data: {success: true}})
138
+ }
139
+ })
135
140
  }
136
141
  const getDetail = () => {
137
142
  const params = getDetailReq?.(this.saveResponse)