@steedos/service-plugin-amis 2.3.4 → 2.3.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/main/default/client/amis.render.client.js +150 -35
- package/main/default/client/load.assets.client.js +9 -2
- package/main/default/client/tailwind.client.js +29 -10
- package/main/default/pages/action_field_updates.page.amis.json +294 -0
- package/main/default/pages/action_field_updates.page.yml +12 -0
- package/main/default/pages/apps_form.page.amis.json +22 -9
- package/main/default/pages/apps_form.page.yml +0 -2
- package/main/default/pages/generate_object_tabs.page.amis.json +2 -2
- package/main/default/pages/listview_form.page.amis.json +34 -1
- package/main/default/pages/object_layouts.page.amis.json +2 -22
- package/main/default/pages/space_user_info_record.page.amis.json +1 -6
- package/main/default/services/amis.service.js +1 -1
- package/package.json +10 -4
- package/public/amis/amis.css +1 -18
- package/public/tailwind/tailwind-base.css +514 -0
- package/public/tailwind/tailwind-steedos.css +454 -0
- package/public/translations/amis/zh-CN.json +2 -2
- package/src/styles/tailwind-base.css +1 -0
- package/src/styles/tailwind.css +3 -0
- package/tailwind.config.js +24 -0
- package/main/default/objects/pages/fields/render_engine.field.yml +0 -11
- package/main/default/objects/pages/pages.object.yml +0 -2
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"sendOn": "!!this.recordId",
|
|
34
34
|
"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 ",
|
|
35
35
|
"data": {
|
|
36
|
-
"query": "{data:apps(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,code,icon_slds,visible,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}}}"
|
|
36
|
+
"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}}}"
|
|
37
37
|
},
|
|
38
38
|
"headers": {
|
|
39
39
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -157,6 +157,15 @@
|
|
|
157
157
|
"labelClassName": "text-left",
|
|
158
158
|
"id": "u:07a8a4c5f875"
|
|
159
159
|
},
|
|
160
|
+
{
|
|
161
|
+
"name": "showSidebar",
|
|
162
|
+
"label": "菜单显示在左侧",
|
|
163
|
+
"type": "checkbox",
|
|
164
|
+
"tpl": null,
|
|
165
|
+
"className": "m-0",
|
|
166
|
+
"labelClassName": "text-left",
|
|
167
|
+
"id": "u:07a8a4c5f877"
|
|
168
|
+
},
|
|
160
169
|
{
|
|
161
170
|
"name": "description",
|
|
162
171
|
"label": "描述",
|
|
@@ -356,6 +365,7 @@
|
|
|
356
365
|
}
|
|
357
366
|
}
|
|
358
367
|
],
|
|
368
|
+
"headerToolbarClassName": "px-1 py-3",
|
|
359
369
|
"id": "crud_tab_items",
|
|
360
370
|
"perPageAvailable": [
|
|
361
371
|
10
|
|
@@ -524,7 +534,16 @@
|
|
|
524
534
|
"script": "const data = context.props.data;\nif (!data._id) { \n return;\n}\nif (data.tab_items) {\n return;\n}\n\nconst tabOptions = data.tabs_options || [];\nconst tabItems = [];\n// 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\nif (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n}\nconst pushObjectsToTabItems = function (objects) {\n objects.forEach(function (item) {\n // 已经有绑定到指定对象的选项卡就不添加\n let existObjectItem = !!tabItems.find(function (tabItem) {\n return !!tabOptions.find(function (option) {\n return tabItem.tab_name === tabItem.value && option.object === item;\n });\n });\n if (existObjectItem) {\n return;\n }\n // 找到指向指定对象的选项卡\n let tempOption = tabOptions.find(function (option) {\n return option.type === \"object\" && option.object === item;\n });\n if (!tempOption) {\n return;\n }\n // 选项卡名称如果重复了就不添加\n let existTabItem = !!tabItems.find(function (tabItem) {\n return tabItem.tab_name === tempOption.value;\n });\n if (existTabItem) {\n return;\n }\n if (tempOption) {\n tabItems.push({ tab_name: tempOption.value });\n }\n });\n}\n// 把应用中原来objects属性值添加到新的tab_items属性的默认值中\nif (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n}\n// 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\nif (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n}\n\ndoAction({\n actionType: 'setValue',\n args: {\n \"value\": { tab_items: tabItems }\n }\n});"
|
|
525
535
|
}
|
|
526
536
|
]
|
|
527
|
-
}
|
|
537
|
+
},
|
|
538
|
+
"submitSucc": {
|
|
539
|
+
"weight": 0,
|
|
540
|
+
"actions": [
|
|
541
|
+
{
|
|
542
|
+
"componentId": "listview_apps",
|
|
543
|
+
"actionType": "reload"
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
}
|
|
528
547
|
},
|
|
529
548
|
"id": "apps-form"
|
|
530
549
|
}
|
|
@@ -533,13 +552,7 @@
|
|
|
533
552
|
"body"
|
|
534
553
|
],
|
|
535
554
|
"data": {
|
|
536
|
-
"objectName": "apps"
|
|
537
|
-
"context": {
|
|
538
|
-
"rootUrl": "http://127.0.0.1:5800",
|
|
539
|
-
"tenantId": "hKdnwE55WcnWveYxS",
|
|
540
|
-
"userId": "62ede4f62161e377e35de58c",
|
|
541
|
-
"authToken": "770a0b9e5b4fc2f8d6317ca109b0c087d3d160da669ac0218c044e15db1da0e74dd7e16c03b9f7e1640539"
|
|
542
|
-
}
|
|
555
|
+
"objectName": "apps"
|
|
543
556
|
},
|
|
544
557
|
"id": "u:953fda4052b6",
|
|
545
558
|
"bodyClassName": "p-0",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"requestAdaptor": "const formData = api.data.$;\napi.data = { objects: formData.objects };\nreturn api;",
|
|
22
22
|
"responseData": null,
|
|
23
|
-
"adaptor": "\nif (api.body.objectName === \"tabs\") {\n // 在tabs列表操作”对象选项卡“按钮,保存后需要刷新主列表\n
|
|
23
|
+
"adaptor": "\nif (api.body.objectName === \"tabs\") {\n // 在tabs列表操作”对象选项卡“按钮,保存后需要刷新主列表\n}\nreturn payload;\n ",
|
|
24
24
|
"headers": {
|
|
25
25
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
26
26
|
}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"actions": [
|
|
64
64
|
{
|
|
65
65
|
"actionType": "custom",
|
|
66
|
-
"script": "const result = event.data.result;\nconst doneCount = result.data && result.data.doneCount || 0;\nconst myMsg = '已成功生成' + doneCount.toString() + \"条选项卡!\";\ndoAction({\n actionType: 'toast',\n args: {\n msg: myMsg,\n msgType: \"success\"\n }\n});\nconst errors = result.data && result.data.errors || [];\nif (errors && errors.length) { \n console.warn(\"以下对象未能生成选项卡:\");\n console.warn(JSON.stringify(errors));\n}\nconst
|
|
66
|
+
"script": "const result = event.data.result;\nconst doneCount = result.data && result.data.doneCount || 0;\nconst myMsg = '已成功生成' + doneCount.toString() + \"条选项卡!\";\ndoAction({\n actionType: 'toast',\n args: {\n msg: myMsg,\n msgType: \"success\"\n }\n});\nconst errors = result.data && result.data.errors || [];\nif (errors && errors.length) { \n console.warn(\"以下对象未能生成选项卡:\");\n console.warn(JSON.stringify(errors));\n}\nconst objectName = event.data.objectName;\nif (objectName === \"apps\") {\n // 在应用表单中生成选项卡后需要触发选项卡列表组件reload重新刷新列表\n doAction({\n actionType: 'reload',\n componentId: \"tabs-options-service\"\n });\n}\nelse {\n // 刷新主列表\n doAction({\n actionType: 'reload',\n componentId: `listview_${objectName}`\n });\n}"
|
|
67
67
|
}
|
|
68
68
|
]
|
|
69
69
|
}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"cache": 100,
|
|
34
34
|
"adaptor": "var data = payload.data.data[0] || { _filters_type_controller: 'conditions' };\n//数据格式转换\nif (data) {\n data.columns = lodash.map(data.columns, 'field');\n data.sort = lodash.map(data.sort, (item) => {\n return `${item.field_name}:${item.order || 'asc'}`\n });\n data.mobile_columns = lodash.map(data.mobile_columns, 'field');\n data.searchable_fields = lodash.map(data.searchable_fields, 'field');\n\n if (data.filters && lodash.isString(data.filters)) {\n try {\n data.filters = JSON.parse(data.filters);\n }catch(e){}\n }\n\n if (data.filters && lodash.isString(data.filters)) {\n data._filters_type_controller = 'function';\n } else {\n data._filters_type_controller = 'conditions'\n }\n\n if (data._filters_type_controller === 'conditions') {\n data._filters_conditions = window.amisConvert.filtersToConditions(data.filters || []);\n } else {\n data._filters_function = data.filters;\n }\n}\npayload.data = data;\ndelete payload.extensions;\nreturn payload;",
|
|
35
35
|
"data": {
|
|
36
|
-
"query": "{data:object_listviews(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,label,name,object_name,filter_scope,shared,show_count,columns,filter_fields,sort,filters,filter_logic,mobile_columns,searchable_fields,sort_no,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},enable_amis_schema,amis_schema,_display{shared,show_count,created,modified}}}"
|
|
36
|
+
"query": "{data:object_listviews(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,label,name,object_name,requestAdaptor,adaptor,filter_scope,shared,show_count,columns,filter_fields,sort,filters,filter_logic,mobile_columns,searchable_fields,sort_no,created,created_by:created_by__expand{_id,name},modified,modified_by:modified_by__expand{_id,name},enable_amis_schema,amis_schema,_display{shared,show_count,created,modified}}}"
|
|
37
37
|
},
|
|
38
38
|
"sendOn": "!!this.recordId",
|
|
39
39
|
"replaceData": false,
|
|
@@ -442,6 +442,39 @@
|
|
|
442
442
|
"title": "searchable"
|
|
443
443
|
}
|
|
444
444
|
},
|
|
445
|
+
{
|
|
446
|
+
"type": "fieldSet",
|
|
447
|
+
"title": "数据接口",
|
|
448
|
+
"description": "获取列表数据的 api",
|
|
449
|
+
"collapsable": true,
|
|
450
|
+
"body": [
|
|
451
|
+
{
|
|
452
|
+
"type": "editor",
|
|
453
|
+
"name": "requestAdaptor",
|
|
454
|
+
"label": "发送适配器",
|
|
455
|
+
"required": false,
|
|
456
|
+
"language": "javascript",
|
|
457
|
+
"description": "函数签名:(api) => api, 数据在 api.data 中,修改后返回 api 对象。",
|
|
458
|
+
"className": "col-span-2 m-1",
|
|
459
|
+
"labelClassName": "text-left"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"type": "editor",
|
|
463
|
+
"name": "adaptor",
|
|
464
|
+
"label": "接收适配器",
|
|
465
|
+
"required": false,
|
|
466
|
+
"language": "javascript",
|
|
467
|
+
"description": "函数签名: (payload, response, api) => payload",
|
|
468
|
+
"className": "col-span-2 m-1",
|
|
469
|
+
"labelClassName": "text-left"
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"collapsed": true,
|
|
473
|
+
"visibleOn": "!!this.object_name",
|
|
474
|
+
"en-US": {
|
|
475
|
+
"title": "API"
|
|
476
|
+
}
|
|
477
|
+
},
|
|
445
478
|
{
|
|
446
479
|
"type": "fieldSet",
|
|
447
480
|
"title": "高级",
|
|
@@ -836,24 +836,7 @@
|
|
|
836
836
|
],
|
|
837
837
|
"panelClassName": "m-0 -mt-3",
|
|
838
838
|
"bodyClassName": "p-4",
|
|
839
|
-
"actions": [
|
|
840
|
-
{
|
|
841
|
-
"type": "button",
|
|
842
|
-
"label": "取消",
|
|
843
|
-
"actionType": "",
|
|
844
|
-
"level": "default",
|
|
845
|
-
"block": false,
|
|
846
|
-
"onClick": "SteedosUI.getRef(props.data.__super.modalName).close();",
|
|
847
|
-
"id": "u:bf2587b53d64"
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
"type": "button",
|
|
851
|
-
"label": "保存",
|
|
852
|
-
"actionType": "submit",
|
|
853
|
-
"level": "info",
|
|
854
|
-
"id": "u:08afd6e53cab"
|
|
855
|
-
}
|
|
856
|
-
],
|
|
839
|
+
"actions": [],
|
|
857
840
|
"actionsClassName": "p-sm b-t b-light text-center",
|
|
858
841
|
"className": "steedos-amis-form",
|
|
859
842
|
"checkAll": false,
|
|
@@ -896,10 +879,7 @@
|
|
|
896
879
|
"body"
|
|
897
880
|
],
|
|
898
881
|
"data": {
|
|
899
|
-
"objectName": "object_layouts"
|
|
900
|
-
"context": {
|
|
901
|
-
"rootUrl": "http://127.0.0.1:5800"
|
|
902
|
-
}
|
|
882
|
+
"objectName": "object_layouts"
|
|
903
883
|
},
|
|
904
884
|
"bodyClassName": "p-0",
|
|
905
885
|
"name": "page_edit_${recordId}",
|
|
@@ -592,12 +592,7 @@
|
|
|
592
592
|
"initialValues": {},
|
|
593
593
|
"appId": "builder",
|
|
594
594
|
"title": "",
|
|
595
|
-
"context": {
|
|
596
|
-
"rootUrl": "https://5000-steedos-steedosplatform-uwiv6wkdp2o.ws-us73.gitpod.io",
|
|
597
|
-
"tenantId": "e4YD58Xx68PQNPD2G",
|
|
598
|
-
"userId": "62ea04550167020d189ce439",
|
|
599
|
-
"authToken": "077c2bb0f4a7c594572fceb47086e2ebd439c6689852b2264c2b20905a38f0f2fbe3491ce3aebfd1872bd5"
|
|
600
|
-
}
|
|
595
|
+
"context": "${context}"
|
|
601
596
|
},
|
|
602
597
|
"id": "u:b80a805eb7fa"
|
|
603
598
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "
|
|
6
|
+
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
7
|
+
"build:tailwind-cdn": "node .scripts/build.tailwind.js",
|
|
8
|
+
"build:tailwind-base": "tailwindcss -i ./src/styles/tailwind-base.css -o ./public/tailwind/tailwind-base.css",
|
|
9
|
+
"build:tailwind": "tailwindcss -i ./src/styles/tailwind.css -o ./public/tailwind/tailwind-steedos.css"
|
|
7
10
|
},
|
|
8
11
|
"license": "MIT",
|
|
9
12
|
"private": false,
|
|
@@ -11,7 +14,10 @@
|
|
|
11
14
|
"access": "public"
|
|
12
15
|
},
|
|
13
16
|
"dependencies": {
|
|
14
|
-
"@steedos-widgets/amis-lib": "^1.0.
|
|
17
|
+
"@steedos-widgets/amis-lib": "^1.0.22"
|
|
15
18
|
},
|
|
16
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "3ef6bf3744c616d6a961b3264e5f204b9697ef6a",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"tailwindcss": "3.2.4"
|
|
22
|
+
}
|
|
17
23
|
}
|
package/public/amis/amis.css
CHANGED
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
vertical-align: initial !important;
|
|
14
14
|
} */
|
|
15
15
|
|
|
16
|
-
body{
|
|
17
|
-
-webkit-font-smoothing: inherit !important;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
/* .row-main{
|
|
21
17
|
border-radius: 0.25rem
|
|
22
18
|
} */
|
|
@@ -52,15 +48,6 @@ body{
|
|
|
52
48
|
min-width: 100px;
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
.steedos-amis-form .antd-Collapse .antd-Form--normal, .antd-Form--normal .antd-Tabs .antd-Tabs-content .antd-Tabs-pane .form-content{
|
|
56
|
-
display: grid!important;
|
|
57
|
-
grid-template-columns: repeat(2,minmax(0,1fr))!important;
|
|
58
|
-
grid-row-gap: 1rem!important;
|
|
59
|
-
row-gap: 1rem!important;
|
|
60
|
-
grid-column-gap: 1.5rem!important;
|
|
61
|
-
-moz-column-gap: 1.5rem!important;
|
|
62
|
-
column-gap: 1.5rem!important;
|
|
63
|
-
}
|
|
64
51
|
|
|
65
52
|
/* fix checkbox 隐藏时导致滚动条异常 */
|
|
66
53
|
.steedos-amis-form .antd-Collapse .antd-Form--normal .antd-Checkbox input{
|
|
@@ -76,10 +63,6 @@ body{
|
|
|
76
63
|
border-bottom: none;
|
|
77
64
|
}
|
|
78
65
|
|
|
79
|
-
.steedos-amis-form .antd-Collapse .antd-Form--normal{
|
|
80
|
-
grid-template-columns: none !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
66
|
.ant-modal-root .amis-scope .antd-Panel-footerWrap{
|
|
84
67
|
position: fixed;
|
|
85
68
|
}
|
|
@@ -104,4 +87,4 @@ body{
|
|
|
104
87
|
|
|
105
88
|
.ant-message{
|
|
106
89
|
z-index: 2600;
|
|
107
|
-
}
|
|
90
|
+
}
|