@steedos/service-plugin-amis 2.5.12-beta.4 → 2.5.12-beta.40
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.
|
@@ -69,14 +69,18 @@
|
|
|
69
69
|
options: amisLib.OptionsControl,
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
const amisComps = lodash.filter(Builder.registry['meta-components'], function(item){ return item.componentName && item.amis
|
|
72
|
+
const amisComps = lodash.filter(Builder.registry['meta-components'], function(item){ return item.componentName && item.amis && item.amis.render});
|
|
73
73
|
|
|
74
74
|
lodash.each(amisComps,(comp)=>{
|
|
75
75
|
const Component = Builder.components.find(item => item.name === comp.componentName);
|
|
76
|
-
|
|
76
|
+
var type = null;
|
|
77
|
+
if(comp.amis){
|
|
78
|
+
type = comp.amis.render.type
|
|
79
|
+
}
|
|
80
|
+
if (Component && !AmisRenderers.includes(type)){
|
|
77
81
|
try {
|
|
78
82
|
let AmisWrapper = Component.class
|
|
79
|
-
AmisRenderers.push(
|
|
83
|
+
AmisRenderers.push(type);
|
|
80
84
|
if(comp.componentType === 'amisSchema'){
|
|
81
85
|
let amisReact = amisRequire('react');
|
|
82
86
|
AmisWrapper = function(props){
|
|
@@ -108,7 +112,7 @@
|
|
|
108
112
|
})
|
|
109
113
|
|
|
110
114
|
if (props.env.enableAMISDebug && schema) {
|
|
111
|
-
console.groupCollapsed(`[steedos render ${
|
|
115
|
+
console.groupCollapsed(`[steedos render ${type}]`);
|
|
112
116
|
console.trace('Component: ', props, 'Generated Amis Schema: ', schema);
|
|
113
117
|
console.groupEnd();
|
|
114
118
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: baozhoutao@steedos.com
|
|
3
3
|
* @Date: 2022-05-20 17:42:20
|
|
4
4
|
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2023-08-22 22:36:38
|
|
6
6
|
* @Description: 提供辅助函数
|
|
7
7
|
*/
|
|
8
8
|
(function(){
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
[
|
|
98
98
|
React17.createElement(SteedosUI.components.Button, {
|
|
99
99
|
onClick: function(){
|
|
100
|
-
|
|
100
|
+
SteedosUI.getRef(pageName) && SteedosUI.getRef(pageName).close();
|
|
101
101
|
}
|
|
102
102
|
} , t('cancel')),
|
|
103
103
|
React17.createElement(SteedosUI.components.Button, {
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
if (error) {
|
|
133
133
|
return console.log("error", error);
|
|
134
134
|
} else if (result) {
|
|
135
|
-
|
|
135
|
+
SteedosUI.getRef(pageName) && SteedosUI.getRef(pageName).close();
|
|
136
136
|
return Session.set("filter_items", filter_items);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
const formValues = window.amisScopes[pageName].getComponentByName("filtersForm").getValues();
|
|
142
142
|
const filters = window.amisConvert.conditionsToFilters(formValues.filters);
|
|
143
143
|
Session.set("filter_items", filters);
|
|
144
|
-
SteedosUI.getRef(pageName)
|
|
144
|
+
SteedosUI.getRef(pageName) && SteedosUI.getRef(pageName).close();
|
|
145
145
|
},
|
|
146
146
|
type: 'primary'
|
|
147
147
|
} , canSave ? t('save'): t('apply'))
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
"actionType": "custom",
|
|
248
|
-
"script": "\n const { recordId, listViewId } = context.props.data;\n const data = event.data;\n const appId = data.appId;\n const objectName = data.objectName;\n // 在记录详细界面时isRecordDetail为true\n // TODO: isRecordDetail这个判断需要优化\n const isRecordDetail = data._isRelated;\n if(recordId){\n // 编辑记录时,刷新主表单\n doAction({\n componentId: `detail_${recordId}`,\n actionType: \"reload\",\n expression: `!${listViewId}`\n });\n }\n else if(!isRecordDetail){\n // 在列表视图界面新建记录时跳转到详细页面\n const jumpTo = event.context.env && event.context.env.jumpTo;\n if(jumpTo){\n const newRecordId = data.result.data
|
|
248
|
+
"script": "\n const { recordId, listViewId } = context.props.data;\n const data = event.data;\n const appId = data.appId;\n const objectName = data.objectName;\n // 在记录详细界面时isRecordDetail为true\n // TODO: isRecordDetail这个判断需要优化\n const isRecordDetail = data._isRelated;\n if(recordId){\n // 编辑记录时,刷新主表单\n doAction({\n componentId: `detail_${recordId}`,\n actionType: \"reload\",\n expression: `!${listViewId}`\n });\n }\n else if(!isRecordDetail){\n // 在列表视图界面新建记录时跳转到详细页面\n const jumpTo = event.context.env && event.context.env.jumpTo;\n if(jumpTo){\n var _data$result$data;const newRecordId = (_data$result$data = data.result.data) === null || _data$result$data === void 0 ? void 0 : _data$result$data.recordId;\n jumpTo(\"/app/\" + appId + \"/\" + objectName + \"/view/\" + newRecordId);\n }\n }\n "
|
|
249
249
|
}
|
|
250
250
|
]
|
|
251
251
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.5.12-beta.
|
|
3
|
+
"version": "2.5.12-beta.40",
|
|
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": "5d6da49a11a2d893c5bf916612572d1206c68a8e",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "3.2.4"
|
|
19
19
|
}
|