@steedos-widgets/amis-lib 6.10.34-beta.5 → 6.10.34-beta.6
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +44 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +44 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +199 -200
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/file.d.ts +0 -6
- package/dist/types/workflow/approve.d.ts +0 -1
- package/dist/types/workflow/flow.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1214,8 +1214,8 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
|
|
|
1214
1214
|
/*
|
|
1215
1215
|
* @Author: baozhoutao@steedos.com
|
|
1216
1216
|
* @Date: 2022-10-28 14:15:09
|
|
1217
|
-
* @LastEditors:
|
|
1218
|
-
* @LastEditTime: 2025-
|
|
1217
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
1218
|
+
* @LastEditTime: 2025-12-12 16:47:28
|
|
1219
1219
|
* @Description:
|
|
1220
1220
|
*/
|
|
1221
1221
|
|
|
@@ -1363,7 +1363,7 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
|
1363
1363
|
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
1364
1364
|
// <% });} %>`
|
|
1365
1365
|
"type": "control",
|
|
1366
|
-
"name": "",//control若存在name,内部each组件的source则会获取不到内容
|
|
1366
|
+
// "name": "",//control若存在name,内部each组件的source则会获取不到内容 //加上这个空nmae字段会造成列表页面报错 TypeError: Unexpected token } in 1:3,移除后原issue #6977 经测试并没有问题
|
|
1367
1367
|
"body": {
|
|
1368
1368
|
type: 'each',
|
|
1369
1369
|
placeholder: "",
|
|
@@ -17137,8 +17137,7 @@ const getNextStepInput = async (instance, nextStepChangeEvents) => {
|
|
|
17137
17137
|
required: true,
|
|
17138
17138
|
// selectFirst: true,
|
|
17139
17139
|
autoFill: {
|
|
17140
|
-
"new_next_step": "${step}"
|
|
17141
|
-
"next_users": null
|
|
17140
|
+
"new_next_step": "${step}"
|
|
17142
17141
|
},
|
|
17143
17142
|
"source": {
|
|
17144
17143
|
"url": "/api/workflow/v2/nextStep?judge=${new_judge}",
|
|
@@ -19162,6 +19161,24 @@ const getScrollToBottomAutoOpenApproveDrawerScript = () => {
|
|
|
19162
19161
|
`;
|
|
19163
19162
|
};
|
|
19164
19163
|
|
|
19164
|
+
const checkInstanceFlowVersion = async (instance) => {
|
|
19165
|
+
const flow = await fetchAPI$1(`/api/v1/flows/${instance.flow._id}?fields=["name","current._id"]`, {
|
|
19166
|
+
method: "get"
|
|
19167
|
+
});
|
|
19168
|
+
if (flow.data.current._id !== instance.flowVersion._id) {
|
|
19169
|
+
console.log("checkInstanceFlowVersion: flow version changed");
|
|
19170
|
+
return false;
|
|
19171
|
+
}
|
|
19172
|
+
const form = await fetchAPI$1(`/api/v1/forms/${instance.form._id}?fields=["name","current._id"]`, {
|
|
19173
|
+
method: "get"
|
|
19174
|
+
});
|
|
19175
|
+
if (form.data.current._id !== instance.formVersion._id) {
|
|
19176
|
+
console.log("checkInstanceFlowVersion: form version changed");
|
|
19177
|
+
return false;
|
|
19178
|
+
}
|
|
19179
|
+
return true;
|
|
19180
|
+
};
|
|
19181
|
+
|
|
19165
19182
|
const getFlowFormSchema = async (instance, box) => {
|
|
19166
19183
|
const formStyle = instance.formVersion.style || "table";
|
|
19167
19184
|
let formContentSchema;
|
|
@@ -19189,7 +19206,28 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
19189
19206
|
nextStepChangeEvents = onEvent?.nextStepChange?.actions || [];
|
|
19190
19207
|
nextStepUserChangeEvents = onEvent?.nextStepUserChange?.actions || [];
|
|
19191
19208
|
}
|
|
19192
|
-
|
|
19209
|
+
if (box == 'draft' && instance.state === 'draft') {
|
|
19210
|
+
// 草稿调用流程版本接口确认是否有新版本,有则调用一次暂存接口,它会提示升级并自动刷新浏览器
|
|
19211
|
+
let isFlowVersionChecked = await checkInstanceFlowVersion(instance);
|
|
19212
|
+
if (!isFlowVersionChecked) {
|
|
19213
|
+
initedEvents.push({
|
|
19214
|
+
"actionType": "ajax",
|
|
19215
|
+
"api": {
|
|
19216
|
+
"url": "/api/workflow/v2/instance/save",
|
|
19217
|
+
"method": "post",
|
|
19218
|
+
"sendOn": "",
|
|
19219
|
+
"requestAdaptor": "var _SteedosUI$getRef$get, _approveValues$next_s;\nconst formValues = context._scoped.getComponentById(\"instance_form\").getValues(); const _formValues = JSON.parse(JSON.stringify(formValues)); if(_formValues){delete _formValues.__applicant} \nconst approveValues = (_SteedosUI$getRef$get = context._scoped.getComponentById(\"instance_approval\")) === null || _SteedosUI$getRef$get === void 0 ? void 0 : _SteedosUI$getRef$get.getValues();\nlet nextUsers = approveValues === null || approveValues === void 0 ? void 0 : approveValues.next_users;\nif (_.isString(nextUsers)) {\n nextUsers = [approveValues.next_users];\n}\nconst instance = context.record;\nconst body = {\n instance: {\n _id: instance._id,\n applicant: context.__applicant,\n submitter: formValues.submitter,\n traces: [{\n _id: instance.trace._id,\n step: instance.step._id,\n approves: [{\n _id: instance.approve._id,\n next_steps: [{\n step: approveValues === null || approveValues === void 0 || (_approveValues$next_s = approveValues.next_step) === null || _approveValues$next_s === void 0 ? void 0 : _approveValues$next_s._id,\n users: nextUsers\n }],\n description: approveValues === null || approveValues === void 0 ? void 0 : approveValues.suggestion,\n values: _formValues\n }]\n }]\n }\n};\napi.data = body;\nreturn api;",
|
|
19220
|
+
"adaptor": "if (payload.instance == \"upgraded\") { window.setTimeout(function(){ window.location.reload(); }, 2000); return {...payload, status: 1, msg: t('instance_action_instance_save_msg_upgraded')}; } \n return payload.instance === true ? {...payload, status: 0, msg: ''} : {...payload, status: 1, msg: t('instance_action_instance_save_msg_failed')};",
|
|
19221
|
+
"headers": {
|
|
19222
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
19223
|
+
},
|
|
19224
|
+
"data": {
|
|
19225
|
+
"&": "$$"
|
|
19226
|
+
}
|
|
19227
|
+
}
|
|
19228
|
+
});
|
|
19229
|
+
}
|
|
19230
|
+
}
|
|
19193
19231
|
if ((box == 'inbox' || box == 'draft') && !!!window.disableAutoOpenApproveDrawer) {
|
|
19194
19232
|
// 滚动条滚动到底部弹出底部签批drawer窗口
|
|
19195
19233
|
initedEvents.push({
|