@steedos/service-plugin-amis 2.5.0-beta.3 → 2.5.0-beta.33
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/main/default/client/amis.render.client.js +18 -18
- package/main/default/pages/apps_form.page.amis.json +25 -15
- package/main/default/pages/listview_form.page.amis.json +498 -476
- package/main/default/pages/object_layouts.page.amis.json +1 -1
- package/main/default/services/amis-design.service.js +6 -6
- package/main/default/services/amis.service.js +2 -2
- package/main/default/services/metadata/listviews.service.js +7 -0
- package/main/default/services/utils/page-schema.js +11 -56
- package/package.json +2 -2
- package/public/amis/amis.css +31 -0
- package/public/tailwind/tailwind-steedos.css +69 -128
|
@@ -219,28 +219,28 @@
|
|
|
219
219
|
// return div;
|
|
220
220
|
// },
|
|
221
221
|
jumpTo: (to, action) => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
if (to === 'goBack') {
|
|
223
|
+
return window.history.back();
|
|
224
|
+
}
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
to = normalizeLink(to);
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
if (action && action.actionType === 'url') {
|
|
229
|
+
action.blank === false ? (window.location.href = to) : window.open(to);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
232
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
// 主要是支持 nav 中的跳转
|
|
234
|
+
if (action && to && action.target) {
|
|
235
|
+
window.open(to, action.target);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
238
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
if (/^https?:\/\//.test(to)) {
|
|
240
|
+
window.location.replace(to);
|
|
241
|
+
} else {
|
|
242
|
+
FlowRouter.go(to);
|
|
243
|
+
}
|
|
244
244
|
},
|
|
245
245
|
theme: 'antd',
|
|
246
246
|
isCurrentUrl: isCurrentUrl,
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
"api": {
|
|
10
10
|
"method": "post",
|
|
11
11
|
"url": "${context.rootUrl}/graphql",
|
|
12
|
-
"adaptor": "let data = payload.data;\ndata.tabs_options = [];\nif (data.options && data.options.length) {\n data.tabs_options = data.options.map(function (option) { \n option.label = option.label + \"(\" + option.value + \")\";\n return option;\n });\n}\ndelete data.options\npayload.data = data;\nreturn payload;\n",
|
|
12
|
+
"adaptor": "let data = payload.data;\ndata.tabs_options = [];\nif (data.options && data.options.length) {\n data.tabs_options = data.options.map(function (option) { \n option.label = option.label + \"(\" + option.value + \")\";\n return option;\n });\n}\nif (!api.body.recordId) {\n const defaultValues = {\n is_creator: true,\n mobile: true,\n visible: true,\n sort: 9100\n }\n data = Object.assign({}, data, defaultValues);\n}\ndelete data.options\npayload.data = data;\nreturn payload;\n",
|
|
13
13
|
"data": {
|
|
14
|
-
"query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}"
|
|
14
|
+
"query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}",
|
|
15
|
+
"recordId": "${recordId}"
|
|
15
16
|
},
|
|
16
17
|
"headers": {
|
|
17
18
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"sendOn": "!!this.recordId",
|
|
54
55
|
"adaptor": "var data = payload.data.data[0];\nif(data){\n //初始化接口返回的字段移除字段值为null的字段\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n};\nif (data.tab_items && !_.isArray(data.tab_items)) {\n // 数据库中存储的是对象格式而不是数组,转换为数组用于界面显示\n let arrTabItems = [];\n _.each(data.tab_items, function (n, k) {\n n.tab_name = k;\n delete n.index;\n arrTabItems.push(n);\n });\n data.tab_items = arrTabItems;\n}\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ",
|
|
55
56
|
"data": {
|
|
56
|
-
"query": "{data:apps(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,code,icon_slds,visible, showSidebar, description,tabs,tab_items,tab_groups,objects,mobile_objects,is_creator,mobile,sort,url,is_use_ie,is_use_iframe,is_new_window,on_click,auth_name,secret,is_system,from_code_id,instance_state,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{visible,is_creator,mobile,is_use_ie,is_use_iframe,is_new_window,is_system,instance_state,created,modified}}}"
|
|
57
|
+
"query": "{data:apps(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,code,icon_slds,visible, showSidebar, enable_nav_schema, description,tabs,tab_items,tab_groups,objects,mobile_objects,is_creator,mobile,sort,url,is_use_ie,is_use_iframe,is_new_window,on_click,auth_name,secret,is_system,from_code_id,instance_state,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},_display{visible,is_creator,mobile,is_use_ie,is_use_iframe,is_new_window,is_system,instance_state,created,modified}}}"
|
|
57
58
|
},
|
|
58
59
|
"headers": {
|
|
59
60
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -108,8 +109,9 @@
|
|
|
108
109
|
"labelField": "symbol",
|
|
109
110
|
"valueField": "symbol",
|
|
110
111
|
"multiple": false,
|
|
112
|
+
"searchable": true,
|
|
111
113
|
"source": "${sldsIconsOptions}",
|
|
112
|
-
"menuTpl": "<span class=\"flex items-center mt-0.5\">\n <span role=\"img\" aria-label=\"smile\" class=\"anticon anticon-smile\">\n <span class=\"slds-icon_container slds-icon-standard-${symbol|split:_|join:-}\">\n <svg class=\"slds-icon slds-icon_x-small\" aria-hidden=\"true\">\n <use xlink:href=\"
|
|
114
|
+
"menuTpl": "<span class=\"flex items-center mt-0.5\">\n <span role=\"img\" aria-label=\"smile\" class=\"anticon anticon-smile\">\n <span class=\"slds-icon_container slds-icon-standard-${symbol|split:_|join:-}\">\n <svg class=\"slds-icon slds-icon_x-small\" aria-hidden=\"true\">\n <use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${symbol}\"></use>\n </svg>\n </span>\n </span>\n <span class=\"pl-1.5\">${symbol}</span>\n</span>"
|
|
113
115
|
}
|
|
114
116
|
],
|
|
115
117
|
"id": "u:420b0162ce2c",
|
|
@@ -337,11 +339,19 @@
|
|
|
337
339
|
"addable": true,
|
|
338
340
|
"draggable": true,
|
|
339
341
|
"editable": true,
|
|
342
|
+
"needConfirm": false,
|
|
340
343
|
"columns": [
|
|
341
344
|
{
|
|
342
345
|
"name": "group_name",
|
|
343
346
|
"label": "名称",
|
|
344
347
|
"id": "u:383c7744b499"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "default_open",
|
|
351
|
+
"label": "是否默认展开",
|
|
352
|
+
"id": "u:7a243c84ed66",
|
|
353
|
+
"type": "checkbox",
|
|
354
|
+
"value": true
|
|
345
355
|
}
|
|
346
356
|
],
|
|
347
357
|
"removable": true,
|
|
@@ -353,8 +363,8 @@
|
|
|
353
363
|
"actions": [
|
|
354
364
|
{
|
|
355
365
|
"actionType": "custom",
|
|
356
|
-
"script": "const tabGroupKey = \"group\";\nconst getTabsSortFun = function (groupNames) {\n return function (m, n) {\n var tempM = !!m[tabGroupKey] ? 1 : 0;\n var tempN = !!n[tabGroupKey] ? 1 : 0;\n if (!m[tabGroupKey] || !n[tabGroupKey]) {\n // 没有配置group属性的字段排在前面\n return tempM - tempN;\n }\n // 字段所属分组不在groupNames时排在前面,其他字段按其所属分组在groupNames中的排序先后顺序排序,所属分组相同的字段排在一起。\n return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]);\n };\n}\n\nconst clearTabs = function (input) {\n return {\n tab_items: []\n }\n}\n\n// 把”设置分组“弹出窗口中设置的分组转为主表单groups字段值格式\n// 同时根据新的groups排序重新设置tabs属性的字段先后次序\n// 因为直接设置tabs值有bug,即新值老值会串,所以需要先执行上面的clearTabs清除原来的值\nconst convertDataForGroups = function(input) {\n const settingGroups = input.setting_groups || [];\n const convertedGroups = _.uniqBy(settingGroups.map(function (item) {\n return {\n group_name: item.group_name\n }\n }), \"group_name\");\n\n const groupNames = _.compact(_.map(convertedGroups, \"group_name\"));\n const tab_items = input.__super.__super.items;\n // tabs重新按分组排序\n tab_items.sort(getTabsSortFun(groupNames));\n
|
|
357
|
-
|
|
366
|
+
"script": "const tabGroupKey = \"group\";\nconst getTabsSortFun = function (groupNames) {\n return function (m, n) {\n var tempM = !!m[tabGroupKey] ? 1 : 0;\n var tempN = !!n[tabGroupKey] ? 1 : 0;\n if (!m[tabGroupKey] || !n[tabGroupKey]) {\n // 没有配置group属性的字段排在前面\n return tempM - tempN;\n }\n // 字段所属分组不在groupNames时排在前面,其他字段按其所属分组在groupNames中的排序先后顺序排序,所属分组相同的字段排在一起。\n return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]);\n };\n}\n\nconst clearTabs = function (input) {\n return {\n tab_items: []\n }\n}\n\n// 把”设置分组“弹出窗口中设置的分组转为主表单groups字段值格式\n// 同时根据新的groups排序重新设置tabs属性的字段先后次序\n// 因为直接设置tabs值有bug,即新值老值会串,所以需要先执行上面的clearTabs清除原来的值\nconst convertDataForGroups = function(input) {\n const settingGroups = input.setting_groups || [];\n const convertedGroups = _.uniqBy(settingGroups.map(function (item) {\n return {\n group_name: item.group_name,\n default_open: item.default_open\n }\n }), \"group_name\");\n\n const groupNames = _.compact(_.map(convertedGroups, \"group_name\"));\n const tab_items = input.__super.__super.items;\n // tabs重新按分组排序\n tab_items.sort(getTabsSortFun(groupNames));\n return {\n tab_groups: convertedGroups,\n tab_items: tab_items\n }\n};\n\nconst eventData = event.data;\ndoAction({\n actionType: 'setValue',\n componentId: \"apps-form\",\n args: {\n value: clearTabs()\n }\n});\n\ndoAction({\n actionType: 'setValue',\n componentId: \"apps-form\",\n args: {\n value: convertDataForGroups(eventData)\n }\n});\n\n"
|
|
367
|
+
}
|
|
358
368
|
]
|
|
359
369
|
}
|
|
360
370
|
},
|
|
@@ -407,15 +417,6 @@
|
|
|
407
417
|
"labelClassName": "text-left",
|
|
408
418
|
"id": "u:44fa8ee006c1"
|
|
409
419
|
},
|
|
410
|
-
{
|
|
411
|
-
"name": "is_use_iframe",
|
|
412
|
-
"label": "使用iframe打开",
|
|
413
|
-
"type": "checkbox",
|
|
414
|
-
"tpl": null,
|
|
415
|
-
"className": "m-0",
|
|
416
|
-
"labelClassName": "text-left",
|
|
417
|
-
"id": "u:ba806048fa36"
|
|
418
|
-
},
|
|
419
420
|
{
|
|
420
421
|
"name": "is_new_window",
|
|
421
422
|
"label": "在新窗口打开",
|
|
@@ -508,6 +509,15 @@
|
|
|
508
509
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
509
510
|
}
|
|
510
511
|
}
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"name": "enable_nav_schema",
|
|
515
|
+
"label": "启用自定义导航",
|
|
516
|
+
"type": "checkbox",
|
|
517
|
+
"tpl": null,
|
|
518
|
+
"className": "m-0",
|
|
519
|
+
"labelClassName": "text-left",
|
|
520
|
+
"id": "u:07a8a4c5f89"
|
|
511
521
|
}
|
|
512
522
|
],
|
|
513
523
|
"size": "none"
|