@steedos/service-plugin-amis 2.3.6 → 2.3.7

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.
@@ -19,8 +19,8 @@
19
19
  };
20
20
  }
21
21
  // loadCss(Steedos.absoluteUrl("/unpkg.com/amis/sdk/sdk.css"))
22
- // loadCss(Steedos.absoluteUrl("/unpkg.com/amis/sdk/helper.css"))
23
- // loadCss(Steedos.absoluteUrl("/unpkg.com/amis/sdk/iconfont.css"))
22
+ loadCss(Steedos.absoluteUrl("/unpkg.com/amis/sdk/helper.css"))
23
+ loadCss(Steedos.absoluteUrl("/unpkg.com/amis/sdk/iconfont.css"))
24
24
  loadCss(Steedos.absoluteUrl("/amis/amis.css"))
25
25
 
26
26
  try {
@@ -48,9 +48,9 @@
48
48
  }
49
49
 
50
50
  // 加载Amis SDK: 如果直接放到body中会导致 meteor 编译后的 cordova.js 加载报错
51
- // let amisSDKScript = document.createElement("script");
52
- // amisSDKScript.setAttribute("src", Steedos.absoluteUrl('/unpkg.com/amis/sdk/sdk.js'));
53
- // document.getElementsByTagName("head")[0].appendChild(amisSDKScript);
51
+ let amisSDKScript = document.createElement("script");
52
+ amisSDKScript.setAttribute("src", Steedos.absoluteUrl('/unpkg.com/amis/sdk/sdk.js'));
53
+ document.getElementsByTagName("head")[0].appendChild(amisSDKScript);
54
54
  } catch (error) {
55
55
  console.error(error)
56
56
  };
@@ -73,15 +73,9 @@
73
73
  waitForThing(window, 'assetsLoaded'),
74
74
  waitForThing(window, 'amis'),
75
75
  ]).then(()=>{
76
- // window.React = window.__React;
77
- // window.ReactDOM = window.__ReactDOM;
76
+ window.React = window.__React;
77
+ window.ReactDOM = window.__ReactDOM;
78
78
  const AmisRenderers = [];
79
- let amisLib = amisRequire('amis');
80
- const registerMap = {
81
- renderer: amisLib.Renderer,
82
- formitem: amisLib.FormItem,
83
- options: amisLib.OptionsControl,
84
- };
85
79
 
86
80
  const amisComps = lodash.filter(Builder.registry['meta-components'], function(item){ return item.componentName && item.amis?.render});
87
81
 
@@ -94,7 +88,7 @@
94
88
  if(comp.componentType === 'amisSchema'){
95
89
  let amisReact = amisRequire('react');
96
90
  AmisWrapper = function(props){
97
- const { $schema, body, render } = props
91
+ const { body, render } = props
98
92
  const [schema, setSchema] = amisReact.useState(null);
99
93
  amisReact.useEffect(()=>{
100
94
  const result = Component.class(props);
@@ -105,39 +99,17 @@
105
99
  }else{
106
100
  setSchema(result)
107
101
  }
108
- }, [JSON.stringify($schema)])
102
+ }, [])
109
103
  return amisReact.createElement(amisReact.Fragment, null, amisReact.createElement(amisReact.Fragment, null, schema && render ? render('body', schema) : ''), amisReact.createElement(amisReact.Fragment, null, render ? render('body', body) : ''));
110
104
  }
111
105
  }
112
- // 注册amis渲染器
113
- let asset = comp.amis.render;
114
- if (!registerMap[asset.usage]) {
115
- console.error(
116
- `自定义组件注册失败,不存在${asset.usage}自定义组件类型。`, comp
117
- );
118
- } else {
119
- registerMap[asset.usage]({
120
- test: new RegExp(`(^|\/)${asset.type}`),
121
- type: asset.type,
122
- weight: asset.weight,
123
- autoVar: true,
124
- })(AmisWrapper);
125
- // 记录当前创建的amis自定义组件
126
- console.info('注册了一个自定义amis组件:', {
127
- type: asset.type,
128
- weight: asset.weight,
129
- component: AmisWrapper,
130
- framework: asset.framework,
131
- usage: asset.usage,
132
- });
133
- }
134
- // amisRequire("amis").Renderer(
135
- // {
136
- // type: comp.amis?.render.type,
137
- // weight: comp.amis?.render.weight,
138
- // autoVar: true,
139
- // }
140
- // )(AmisWrapper);
106
+ amisRequire("amis").Renderer(
107
+ {
108
+ type: comp.amis?.render.type,
109
+ weight: comp.amis?.render.weight,
110
+ autoVar: true,
111
+ }
112
+ )(AmisWrapper);
141
113
  } catch(e){console.error(e)}
142
114
  }
143
115
  });
@@ -179,31 +151,8 @@
179
151
 
180
152
  return pathname + search + hash;
181
153
  };
182
- const isCurrentUrl = (to, ctx)=>{
183
- try {
184
- if (!to) {
185
- return false;
186
- }
187
- const pathname = window.location.pathname;
188
- const link = normalizeLink(to, {
189
- ...location,
190
- pathname,
191
- hash: ''
192
- });
193
-
194
- if (!~link.indexOf('http') && ~link.indexOf(':')) {
195
- let strict = ctx && ctx.strict;
196
- return match(link, {
197
- decode: decodeURIComponent,
198
- strict: typeof strict !== 'undefined' ? strict : true
199
- })(pathname);
200
- }
201
- return decodeURI(pathname) === link || decodeURI(pathname).startsWith(`${link}/`);
202
- } catch (error) {
203
- console.error(`error`, error)
204
- }
205
- }
206
- AmisEnv = {
154
+
155
+ const AmisEnv = {
207
156
  // getModalContainer: (props)=>{
208
157
  // let div = document.querySelector("#amisModalContainer");
209
158
  // if(!div){
@@ -223,7 +172,7 @@
223
172
  to = normalizeLink(to);
224
173
 
225
174
  if (action && action.actionType === 'url') {
226
- action.blank === true ? window.open(to): (window.location.href = to);
175
+ action.blank === false ? (window.location.href = to) : window.open(to);
227
176
  return;
228
177
  }
229
178
 
@@ -240,7 +189,6 @@
240
189
  }
241
190
  },
242
191
  theme: 'antd',
243
- isCurrentUrl: isCurrentUrl,
244
192
  };
245
193
 
246
194
  const AmisRender = function (props) {
@@ -248,18 +196,6 @@
248
196
  const schema = props.schema;
249
197
  const data = props.data;
250
198
  const name = props.name;
251
- const refName = schema.name || schema.id;
252
- if(SteedosUI.refs[refName]){
253
- if(SteedosUI.refs[refName].unmount){
254
- try {
255
- SteedosUI.refs[refName].unmount()
256
- } catch (Exception) {
257
- }
258
- }else{
259
- console.log(`not find amis scope unmount`)
260
- }
261
- }
262
-
263
199
  if(props.pageType === 'form'){
264
200
  env = Object.assign({
265
201
  getModalContainer: ()=>{
@@ -282,84 +218,33 @@
282
218
  return scoped = ref
283
219
  }
284
220
 
285
-
286
- let amisReact = amisRequire('react');
287
-
288
- amisReact.useEffect(()=>{
289
- const amisScope = amisRequire('amis/embed').embed(`.steedos-amis-render-scope-${name}`,schema, {data, name, locale: getAmisLng()}, Object.assign({}, AmisEnv, env))
290
- const refName = schema.name || schema.id;
291
- if(window.SteedosUI && refName){
292
- SteedosUI.refs[refName] = amisScope;
293
- }
221
+ React.useEffect(()=>{
222
+ amisRequire('amis/embed').embed(`.steedos-amis-render-scope-${name}`,schema, {data, name, locale: getAmisLng()}, Object.assign({}, AmisEnv, env))
294
223
  }, [])
295
- return amisReact.createElement("div", {
224
+ return React.createElement("div", {
296
225
  className: "amis-scope"
297
- }, amisReact.createElement("div", {
226
+ }, React.createElement("div", {
298
227
  className: `steedos-amis-render-scope-${name}`
299
228
  }));
300
229
  };
301
230
 
302
- window.renderAmis = function (root, schema, data, env) {
303
- const refName = schema.name || schema.id;
304
- if(SteedosUI.refs[refName]){
305
- if(SteedosUI.refs[refName].unmount){
306
- try {
307
- SteedosUI.refs[refName].unmount()
308
- } catch (Exception) {
309
- }
310
- }else{
311
- console.log(`not find amis scope unmount`)
312
- }
313
- }
314
-
315
- // if(props.pageType === 'form'){
316
- // env = Object.assign({
317
- // getModalContainer: ()=>{
318
- // return document.querySelector('.amis-scope');
319
- // }
320
- // }, env);
321
- // }
322
- schema.scopeRef = (ref) => {
323
- try {
324
- if(!window.amisScopes){
325
- window.amisScopes = {};
326
- }
327
- if(name){
328
- window.amisScopes[name] = ref;
329
- }
330
- } catch (error) {
331
- console.error('error', error)
332
- }
333
-
334
- return scoped = ref
335
- }
336
-
337
-
338
- const amisScope = amisRequire('amis/embed').embed(root, schema, {data, name, locale: getAmisLng()}, Object.assign({}, AmisEnv, env))
339
- if(window.SteedosUI && refName){
340
- SteedosUI.refs[refName] = amisScope;
341
- }
342
- };
343
-
344
231
  const initMonaco = ()=>{
345
232
 
346
- // const { detect } = require('detect-browser');
233
+ const { detect } = require('detect-browser');
347
234
 
348
- // const browser = detect();
235
+ const browser = detect();
349
236
 
350
- // // 低于86版的chrome 不支持code类型字段及功能
351
- // if (browser && browser.name === 'chrome' && Number(browser.version.split(".")[0]) < 86) {
352
- // return Promise.resolve(true)
353
- // }
354
-
355
- // // 手机版暂不支持code类型字段.
356
- // if(Meteor.isCordova){
357
- // return Promise.resolve(true)
358
- // }else{
359
- // return Builder.initMonaco()
360
- // }
237
+ // 低于86版的chrome 不支持code类型字段及功能
238
+ if (browser && browser.name === 'chrome' && Number(browser.version.split(".")[0]) < 86) {
239
+ return Promise.resolve(true)
240
+ }
361
241
 
362
- return Promise.resolve(true)
242
+ // 手机版暂不支持code类型字段.
243
+ if(Meteor.isCordova){
244
+ return Promise.resolve(true)
245
+ }else{
246
+ return Builder.initMonaco()
247
+ }
363
248
  }
364
249
  //Amis SDK 中已清理了monaco, 所以这里需要提前注册,否则会导致amis code类型报错
365
250
  initMonaco().catch((err)=>{
@@ -1,10 +1,3 @@
1
- /*
2
- * @Author: baozhoutao@steedos.com
3
- * @Date: 2022-12-09 18:23:36
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2022-12-17 14:35:49
6
- * @Description:
7
- */
8
1
  // 解决多个react 问题. 注册组件时, 使用 amis 自带的 react , 运行 steedos 相关组件时, 使用 全局 react
9
2
  window.addEventListener('message', function (event) {
10
3
  const { data } = event;
@@ -14,8 +7,8 @@ window.addEventListener('message', function (event) {
14
7
  Promise.all([
15
8
  waitForThing(window, 'amis'),
16
9
  ]).then(()=>{
17
- // window.__React = window.React;
18
- // window.__ReactDOM = window.ReactDOM;
10
+ window.__React = window.React;
11
+ window.__ReactDOM = window.ReactDOM;
19
12
  window.React = amisRequire('react');
20
13
  window.ReactDOM = amisRequire('react-dom');
21
14
  window.ReactDom = window.ReactDOM;
@@ -1,35 +1,16 @@
1
1
  try {
2
2
  // 加载 tailwind
3
- // if(typeof BigInt === 'undefined') {
4
- // let tailwindStyle = document.createElement("link");
5
- // tailwindStyle.setAttribute("rel", "stylesheet");
6
- // tailwindStyle.setAttribute("type", "text/css");
7
- // tailwindStyle.setAttribute("href", Steedos.absoluteUrl("/tailwind/tailwind.css"));
8
- // document.getElementsByTagName("head")[0].appendChild(tailwindStyle);
9
- // }else{
10
- // let tailwindScript = document.createElement("script");
11
- // tailwindScript.setAttribute("src", Steedos.absoluteUrl('/tailwind/tailwind.js'));
12
- // document.getElementsByTagName("head")[0].appendChild(tailwindScript);
13
- // }
14
-
15
- const head = document.head || document.getElementsByTagName('head')[0]
16
-
17
- let tailwindBase = document.createElement("link");
18
- tailwindBase.setAttribute("rel", "stylesheet");
19
- tailwindBase.setAttribute("type", "text/css");
20
- tailwindBase.setAttribute("href", Steedos.absoluteUrl("/tailwind/tailwind-base.css"));
21
-
22
- if (head.firstChild) {
23
- head.insertBefore(tailwindBase, head.firstChild)
24
- } else {
25
- head.appendChild(tailwindBase)
3
+ if(typeof BigInt === 'undefined') {
4
+ let tailwindStyle = document.createElement("link");
5
+ tailwindStyle.setAttribute("rel", "stylesheet");
6
+ tailwindStyle.setAttribute("type", "text/css");
7
+ tailwindStyle.setAttribute("href", Steedos.absoluteUrl("/tailwind/tailwind.css"));
8
+ document.getElementsByTagName("head")[0].appendChild(tailwindStyle);
9
+ }else{
10
+ let tailwindScript = document.createElement("script");
11
+ tailwindScript.setAttribute("src", Steedos.absoluteUrl('/tailwind/tailwind.js'));
12
+ document.getElementsByTagName("head")[0].appendChild(tailwindScript);
26
13
  }
27
-
28
- let tailwindStyle = document.createElement("link");
29
- tailwindStyle.setAttribute("rel", "stylesheet");
30
- tailwindStyle.setAttribute("type", "text/css");
31
- tailwindStyle.setAttribute("href", Steedos.absoluteUrl("/tailwind/tailwind-steedos.css"));
32
- head.appendChild(tailwindStyle)
33
14
  } catch (error) {
34
15
  console.error(error)
35
16
  };
@@ -0,0 +1,11 @@
1
+ name: render_engine
2
+ type: select
3
+ label: 渲染器
4
+ defaultValue: amis
5
+ options:
6
+ - label: Amis
7
+ value: amis
8
+ - label: Redash
9
+ value: redash
10
+ required: true
11
+ sort_no: 125
@@ -0,0 +1,2 @@
1
+ extend: pages
2
+ name: pages
@@ -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, 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}}}"
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}}}"
37
37
  },
38
38
  "headers": {
39
39
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
@@ -157,15 +157,6 @@
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
- },
169
160
  {
170
161
  "name": "description",
171
162
  "label": "描述",
@@ -365,7 +356,6 @@
365
356
  }
366
357
  }
367
358
  ],
368
- "headerToolbarClassName": "px-1 py-3",
369
359
  "id": "crud_tab_items",
370
360
  "perPageAvailable": [
371
361
  10
@@ -534,16 +524,7 @@
534
524
  "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});"
535
525
  }
536
526
  ]
537
- },
538
- "submitSucc": {
539
- "weight": 0,
540
- "actions": [
541
- {
542
- "componentId": "listview_apps",
543
- "actionType": "reload"
544
- }
545
- ]
546
- }
527
+ }
547
528
  },
548
529
  "id": "apps-form"
549
530
  }
@@ -552,7 +533,13 @@
552
533
  "body"
553
534
  ],
554
535
  "data": {
555
- "objectName": "apps"
536
+ "objectName": "apps",
537
+ "context": {
538
+ "rootUrl": "http://127.0.0.1:5800",
539
+ "tenantId": "hKdnwE55WcnWveYxS",
540
+ "userId": "62ede4f62161e377e35de58c",
541
+ "authToken": "770a0b9e5b4fc2f8d6317ca109b0c087d3d160da669ac0218c044e15db1da0e74dd7e16c03b9f7e1640539"
542
+ }
556
543
  },
557
544
  "id": "u:953fda4052b6",
558
545
  "bodyClassName": "p-0",
@@ -1,4 +1,6 @@
1
1
  name: apps_form
2
+ __filename: >-
3
+ /Users/yinlianghui/Documents/GitHub/steedos-platform2-3/services/service-plugin-amis/main/default/pages/apps_form.page.yml
2
4
  is_active: true
3
5
  label: 应用程序表单
4
6
  object_name: apps
@@ -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}\nreturn payload;\n ",
23
+ "adaptor": "\nif (api.body.objectName === \"tabs\") {\n // 在tabs列表操作”对象选项卡“按钮,保存后需要刷新主列表\n refreshGrid && refreshGrid();\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 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}"
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 superData = event.data.__super;\nif (superData && superData.objectName === \"apps\") { \n // 在应用表单中生成选项卡后需要触发选项卡列表组件reload重新刷新列表\n doAction({\n actionType: 'reload',\n componentId: \"tabs-options-service\"\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,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}}}"
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}}}"
37
37
  },
38
38
  "sendOn": "!!this.recordId",
39
39
  "replaceData": false,
@@ -442,39 +442,6 @@
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
- },
478
445
  {
479
446
  "type": "fieldSet",
480
447
  "title": "高级",
@@ -879,7 +879,10 @@
879
879
  "body"
880
880
  ],
881
881
  "data": {
882
- "objectName": "object_layouts"
882
+ "objectName": "object_layouts",
883
+ "context": {
884
+ "rootUrl": "http://127.0.0.1:5800"
885
+ }
883
886
  },
884
887
  "bodyClassName": "p-0",
885
888
  "name": "page_edit_${recordId}",
@@ -592,7 +592,12 @@
592
592
  "initialValues": {},
593
593
  "appId": "builder",
594
594
  "title": "",
595
- "context": "${context}"
595
+ "context": {
596
+ "rootUrl": "https://5000-steedos-steedosplatform-uwiv6wkdp2o.ws-us73.gitpod.io",
597
+ "tenantId": "e4YD58Xx68PQNPD2G",
598
+ "userId": "62ea04550167020d189ce439",
599
+ "authToken": "077c2bb0f4a7c594572fceb47086e2ebd439c6689852b2264c2b20905a38f0f2fbe3491ce3aebfd1872bd5"
600
+ }
596
601
  },
597
602
  "id": "u:b80a805eb7fa"
598
603
  }
@@ -2,7 +2,7 @@
2
2
  * @Author: baozhoutao@steedos.com
3
3
  * @Date: 2022-05-19 11:38:30
4
4
  * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2022-12-01 16:20:59
5
+ * @LastEditTime: 2022-05-23 10:01:02
6
6
  * @Description:
7
7
  */
8
8
  const AmisSchema = require('./utils/amis-schema');
package/package.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
2
  "name": "@steedos/service-plugin-amis",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "main": "package.service.js",
5
5
  "scripts": {
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"
6
+ "build": "node .scripts/build.tailwind.js"
10
7
  },
11
8
  "license": "MIT",
12
9
  "private": false,
@@ -14,10 +11,7 @@
14
11
  "access": "public"
15
12
  },
16
13
  "dependencies": {
17
- "@steedos-widgets/amis-lib": "^1.0.22"
14
+ "@steedos-widgets/amis-lib": "^1.0.10"
18
15
  },
19
- "gitHead": "3ef6bf3744c616d6a961b3264e5f204b9697ef6a",
20
- "devDependencies": {
21
- "tailwindcss": "3.2.4"
22
- }
16
+ "gitHead": "e81279db5d8aab35332334cf3eeecf5fd8ead99f"
23
17
  }
@@ -13,6 +13,10 @@
13
13
  vertical-align: initial !important;
14
14
  } */
15
15
 
16
+ body{
17
+ -webkit-font-smoothing: inherit !important;
18
+ }
19
+
16
20
  /* .row-main{
17
21
  border-radius: 0.25rem
18
22
  } */
@@ -48,6 +52,15 @@
48
52
  min-width: 100px;
49
53
  }
50
54
 
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
+ }
51
64
 
52
65
  /* fix checkbox 隐藏时导致滚动条异常 */
53
66
  .steedos-amis-form .antd-Collapse .antd-Form--normal .antd-Checkbox input{
@@ -63,6 +76,10 @@
63
76
  border-bottom: none;
64
77
  }
65
78
 
79
+ .steedos-amis-form .antd-Collapse .antd-Form--normal{
80
+ grid-template-columns: none !important;
81
+ }
82
+
66
83
  .ant-modal-root .amis-scope .antd-Panel-footerWrap{
67
84
  position: fixed;
68
85
  }
@@ -87,4 +104,4 @@
87
104
 
88
105
  .ant-message{
89
106
  z-index: 2600;
90
- }
107
+ }
@@ -282,8 +282,8 @@
282
282
  "Editor.fullscreen": "全屏",
283
283
  "Editor.exitFullscreen": "退出全屏",
284
284
  "Condition.not": "非",
285
- "Condition.and": "",
286
- "Condition.or": "",
285
+ "Condition.and": "并且",
286
+ "Condition.or": "或者",
287
287
  "Condition.add_cond": "添加条件",
288
288
  "Condition.add_cond_group": "添加条件组",
289
289
  "Condition.delete_cond_group": "删除组",