@steedos/service-plugin-amis 2.5.0-beta.27 → 2.5.0-beta.29
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.
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"labelField": "symbol",
|
|
109
109
|
"valueField": "symbol",
|
|
110
110
|
"multiple": false,
|
|
111
|
+
"searchable": true,
|
|
111
112
|
"source": "${sldsIconsOptions}",
|
|
112
113
|
"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
114
|
}
|
|
@@ -343,6 +344,13 @@
|
|
|
343
344
|
"name": "group_name",
|
|
344
345
|
"label": "名称",
|
|
345
346
|
"id": "u:383c7744b499"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "default_open",
|
|
350
|
+
"label": "是否默认展开",
|
|
351
|
+
"id": "u:7a243c84ed66",
|
|
352
|
+
"type": "checkbox",
|
|
353
|
+
"value": true
|
|
346
354
|
}
|
|
347
355
|
],
|
|
348
356
|
"removable": true,
|
|
@@ -354,8 +362,8 @@
|
|
|
354
362
|
"actions": [
|
|
355
363
|
{
|
|
356
364
|
"actionType": "custom",
|
|
357
|
-
"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
|
|
358
|
-
|
|
365
|
+
"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"
|
|
366
|
+
}
|
|
359
367
|
]
|
|
360
368
|
}
|
|
361
369
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.5.0-beta.
|
|
3
|
+
"version": "2.5.0-beta.29",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "c434d29647fa4613b78b0993bed2a0c2b8b35f41",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|
package/public/amis/amis.css
CHANGED