@steedos/service-plugin-amis 3.0.0-beta.29 → 3.0.0-beta.32

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.
@@ -29,11 +29,6 @@
29
29
 
30
30
  return true;
31
31
  }
32
-
33
- // 加载Amis SDK: 如果直接放到body中会导致 meteor 编译后的 cordova.js 加载报错
34
- // let amisSDKScript = document.createElement("script");
35
- // amisSDKScript.setAttribute("src", Steedos.absoluteUrl('/unpkg.com/amis/sdk/sdk.js'));
36
- // document.getElementsByTagName("head")[0].appendChild(amisSDKScript);
37
32
  } catch (error) {
38
33
  console.error(error)
39
34
  };
@@ -257,13 +252,8 @@
257
252
 
258
253
  // 主要是支持 nav 中的跳转
259
254
  if (action && to && action.target) {
260
- if(Meteor.isCordova && to.indexOf('http') != 0){
261
- window.open(Steedos.absoluteUrl(to), action.target);
262
- return;
263
- }else{
264
- window.open(to, action.target);
265
- return;
266
- }
255
+ window.open(to, action.target);
256
+ return;
267
257
  }
268
258
 
269
259
  if (/^https?:\/\//.test(to)) {
@@ -281,10 +271,6 @@
281
271
  }
282
272
  // url是相对路径
283
273
  if(config.url && (!/^http[s]?:\/\//i.test(config.url))){
284
- if(Meteor.isCordova){
285
- config.url = Meteor.absoluteUrl(config.url)
286
- }
287
-
288
274
  if(!config.headers){
289
275
  config.headers = {}
290
276
  }
@@ -292,17 +278,6 @@
292
278
  if(!config.headers.Authorization && Builder.settings.context && Builder.settings.context.tenantId && Builder.settings.context.authToken){
293
279
  config.headers.Authorization = `Bearer ${Builder.settings.context.tenantId},${Builder.settings.context.authToken}`;
294
280
  }
295
- }else if(config.url && Meteor.isCordova && Builder.settings.context && Builder.settings.context.rootUrl && config.url.startsWith(Builder.settings.context.rootUrl)){
296
- // 是绝对路径,且是cordova环境, 且以root url开头, 则自动处理认证
297
- if(Meteor.isCordova){
298
- if(!config.headers){
299
- config.headers = {}
300
- }
301
-
302
- if(!config.headers.Authorization && Builder.settings.context && Builder.settings.context.tenantId && Builder.settings.context.authToken){
303
- config.headers.Authorization = `Bearer ${Builder.settings.context.tenantId},${Builder.settings.context.authToken}`;
304
- }
305
- }
306
281
  }
307
282
  return config;
308
283
  },
@@ -418,23 +393,6 @@
418
393
  };
419
394
 
420
395
  const initMonaco = ()=>{
421
-
422
- // const { detect } = require('detect-browser');
423
-
424
- // const browser = detect();
425
-
426
- // // 低于86版的chrome 不支持code类型字段及功能
427
- // if (browser && browser.name === 'chrome' && Number(browser.version.split(".")[0]) < 86) {
428
- // return Promise.resolve(true)
429
- // }
430
-
431
- // // 手机版暂不支持code类型字段.
432
- // if(Meteor.isCordova){
433
- // return Promise.resolve(true)
434
- // }else{
435
- // return Builder.initMonaco()
436
- // }
437
-
438
396
  return Promise.resolve(true)
439
397
  }
440
398
  //Amis SDK 中已清理了monaco, 所以这里需要提前注册,否则会导致amis code类型报错
@@ -195,7 +195,7 @@ const getField = (objectName, fieldName, type, lng)=>{
195
195
  case 'date':
196
196
  // 华炎魔方中日期字段存的是utc的0点
197
197
  field = {
198
- type: "date",
198
+ type: "text",
199
199
  format: "YYYY-MM-DDT00:00:00+00:00",
200
200
  operators: getFieldOperators("date", lng)
201
201
  };
@@ -203,7 +203,7 @@ const getField = (objectName, fieldName, type, lng)=>{
203
203
  case 'datetime':
204
204
  // 即amis中日期时间控件的format默认值为"YYYY-MM-DDTHH:mm+08:00"正好满足需求
205
205
  field = {
206
- type: "datetime",
206
+ type: "text",
207
207
  operators: getFieldOperators("datetime", lng)
208
208
  };
209
209
  break;
@@ -217,6 +217,11 @@ const getField = (objectName, fieldName, type, lng)=>{
217
217
  break;
218
218
  case 'lookup':
219
219
  case 'master_detail':
220
+ field = {
221
+ type: 'text',
222
+ operators: getFieldOperators("select", lng)
223
+ };
224
+ break;
220
225
  case 'select':
221
226
  field = {
222
227
  type: 'select',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-plugin-amis",
3
- "version": "3.0.0-beta.29",
3
+ "version": "3.0.0-beta.32",
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": "9a9a8b8bbab234f5d6666ca88063d53ad0cd2c4f",
16
+ "gitHead": "fcff940305b05294cce7c852009c04a769ae0df7",
17
17
  "devDependencies": {
18
18
  "tailwindcss": "3.2.4"
19
19
  }