@steedos/service-plugin-amis 2.7.27-beta.6 → 3.0.0-beta.100

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,17 +29,12 @@
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
  };
40
35
 
41
36
  const getAmisLng = ()=>{
42
- var locale = Creator.USER_CONTEXT ? Creator.USER_CONTEXT.user.language : null;
37
+ var locale = Builder.settings.context.user ? Builder.settings.context.user.language : null;
43
38
  if(locale){
44
39
  locale = locale.replace('_', '-');
45
40
  locale = locale === 'en' ? 'en-US' : locale;
@@ -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类型报错
@@ -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: 2023-08-22 22:36:38
5
+ * @LastEditTime: 2025-03-05 11:30:22
6
6
  * @Description: 提供辅助函数
7
7
  */
8
8
  (function(){
@@ -73,7 +73,7 @@
73
73
  }
74
74
  }
75
75
 
76
- Creator.showListFilter = (objectName, listView, data, props)=>{
76
+ Steedos.showListFilter = (objectName, listView, data, props)=>{
77
77
  const pageName = `${objectName}-list-filter`;
78
78
  const canSave = canSaveFilters();
79
79
  return Steedos.Page.render(SteedosUI.Drawer, {
@@ -141,16 +141,19 @@
141
141
  "multiple": false
142
142
  },
143
143
  {
144
- "name": "formula",
145
- "label": "${'action_field_updates.action_field_updates_form.formula' | t}",
146
- "required": false,
147
- "type": "textarea",
148
- "tpl": "<b><%=data.formula%></b>",
144
+ "type": "service",
145
+ "schemaApi": {
146
+ "method": "get",
147
+ "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/${target_object}/fields/options",
148
+ "cache": 30000,
149
+ "adaptor": "const field = {label: t('action_field_updates.action_field_updates_form.formula')}; const variables = SteedosUI.getFormulaVariables(payload.data.options);\n var fieldSchema={label: field.label, type:'input-formula', name: 'formula', 'evalMode': false, variableMode: 'tabs', variables: variables, labelRemark: field.inlineHelpText, description: field.description } \n return {...payload, data:fieldSchema};",
150
+ "trackExpression": "${target_object}",
151
+ "sendOn": "${target_object}"
152
+ },
153
+ "dsType": "api",
154
+ "id": "u:508198dbfac7",
149
155
  "className": "col-span-2 m-1",
150
156
  "labelClassName": "text-left",
151
- "clearValueOnHidden": true,
152
- "fieldName": "formula",
153
- "id": "u:20766a86a9f4",
154
157
  "hiddenOn": "this.operation != 'formula'"
155
158
  },
156
159
  {
@@ -76,7 +76,6 @@
76
76
  ],
77
77
  "data": {
78
78
  "context": {
79
- "rootUrl": "http://127.0.0.1:5800"
80
79
  }
81
80
  },
82
81
  "id": "u:3b0de7e88def",
@@ -289,7 +289,7 @@
289
289
  }
290
290
  },
291
291
  "initApiAdaptor": "\nvar data;\nif (recordId) {\n data = payload.data || { _filters_type_controller: 'conditions' };\n //数据格式转换\n if (data) {\n data.sort = lodash.map(data.sort, (item) => {\n return item.field_name + \":\" + item.order;\n });\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 }\n} else {\n const uiSchema = api.body.uiSchema;\n const contextDefaultData = context && context.data && context.data.defaultData; const defaultData = api.body.defaultData || contextDefaultData;\n let defaultValues = {};\n _.each(uiSchema && uiSchema.fields, function (field) {\n var value = SteedosUI.getFieldDefaultValue(field, api.body.global);\n if (!_.isNil(value)) {\n defaultValues[field.name] = value;\n }\n });\n if (defaultData && _.isObject(defaultData) && !_.isArray(defaultData)) {\n data = Object.assign({}, defaultValues, defaultData); \n }else{data = Object.assign({}, defaultValues) } \n}\nfor (key in data) {\n if (data[key] === null) {\n delete data[key];\n }\n}\npayload.data = data;\ndelete payload.extensions; if (data.is_enable != false) { data.is_enable = true; };\nreturn payload;",
292
- "apiRequestAdaptor": "delete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\n\n//数据格式转换\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1] };\n});\n\nformData.searchable_fields = lodash.map(formData.searchable_fields, (item) => {\n return { field: item };\n});\n\nif (!formData._filters_type_controller) {\n formData._filters_type_controller = 'conditions';\n}\n\nif (formData._filters_type_controller === 'conditions' && formData._filters_conditions) {\n formData.filters = window.amisConvert.conditionsToFilters(formData._filters_conditions);\n // formData.filters = JSON.stringify(window.amisConvert.conditionsToFilters(formData._filters_conditions), null, 4);\n} else {\n formData.filters = formData._filters_function || null;\n}\n\ndelete formData._filters_type_controller;\ndelete formData._filters_conditions;\ndelete formData._filters_function;\n\nquery = `mutation{record: object_listviews__insert(doc: {__saveData}){_id}}`;\nif (formData.recordId) {\n query = `mutation{record: object_listviews__update(id: \"` + formData._id + `\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = { query: query.replace('{__saveData}', __saveData) };\nreturn api;",
292
+ "apiRequestAdaptor": "delete formData.created;\ndelete formData.created_by;\ndelete formData.modified;\ndelete formData.modified_by;\ndelete formData._display;\n\n//数据格式转换\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1] };\n});\n\nformData.searchable_fields = lodash.map(formData.searchable_fields, (item) => {\n return { field: item };\n});\n\nif (!formData._filters_type_controller) {\n formData._filters_type_controller = 'conditions';\n}\n\nif (formData._filters_type_controller === 'conditions' && formData._filters_conditions) {\n formData.filters = window.amisConvert.conditionsToFilters(formData._filters_conditions);\n // formData.filters = JSON.stringify(window.amisConvert.conditionsToFilters(formData._filters_conditions), null, 4);\n} else {\n formData.filters = formData._filters_function || null;\n}\n\ndelete formData._filters_type_controller;\ndelete formData._filters_conditions;\ndelete formData._filters_function;\n\nquery = `mutation{record: object_listviews__insert(doc: {__saveData}){_id}}`;\nif (formData.recordId) {\n query = `mutation{record: object_listviews__update(id: \"` + api.body.recordId + `\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = { query: query.replace('{__saveData}', __saveData) };\nreturn api;",
293
293
  "id": "u:ce9e3fcc411a"
294
294
  }
295
295
  ],
@@ -304,16 +304,5 @@
304
304
  "initApi": null,
305
305
  "initFetch": null,
306
306
  "id": "u:6ada123f9d4a",
307
- "onEvent": {
308
- "init": {
309
- "weight": 0,
310
- "actions": [
311
- {
312
- "actionType": "custom",
313
- "script": "//初始化时给外层dialog加上类名,使过滤组件popover正常显示\n$('.steedos-object-listview-form-page').closest('.amis-dialog-widget.antd-Modal').addClass('steedos-overflow-visible-dialog');"
314
- }
315
- ]
316
- }
317
- },
318
307
  "className": "steedos-object-listview-form-page"
319
308
  }
@@ -302,8 +302,9 @@ module.exports = {
302
302
  fields: 1
303
303
  }
304
304
  };
305
+ const forceUnHiddenObjectNames = ["cms_files", "tasks", "notes", "events", "instances", "approvals", "process_instance_history", "audit_records"];
305
306
  let objects = _.map(_.filter((allObjects), (obj)=>{
306
- return obj.hidden != true;
307
+ return obj.hidden != true || forceUnHiddenObjectNames.includes(obj.name);
307
308
  }), (obj)=>{
308
309
  return {
309
310
  name: obj.name,
@@ -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',
@@ -193,7 +193,7 @@ function convertSFieldToAmisFilesField(field,readonly){
193
193
  type: getAmisStaticFieldType(fieldType, readonly),
194
194
  receiver: {
195
195
  method: "post",
196
- url: `\${context.rootUrl}/s3/${table_name}`,
196
+ url: `/api/v6/files/${table_name}`,
197
197
  adaptor: `
198
198
  var rootUrl = ${JSON.stringify(rootUrl)};
199
199
  payload = {
@@ -160,7 +160,7 @@ function getScriptForRewriteValueForFileFields(fields){
160
160
  return {
161
161
  value: value,
162
162
  name: fileFieldNames[index],
163
- url: fileRootUrl + value + "?download=true",
163
+ url: fileRootUrl + value,
164
164
  state: "uploaded"
165
165
  }
166
166
  });
@@ -169,7 +169,7 @@ function getScriptForRewriteValueForFileFields(fields){
169
169
  data[item] = {
170
170
  value: fileFieldValue,
171
171
  name: fileFieldNames[0],
172
- url: fileRootUrl + fileFieldValue + "?download=true",
172
+ url: fileRootUrl + fileFieldValue,
173
173
  state: "uploaded"
174
174
  };
175
175
  }
@@ -41,7 +41,7 @@ const getListPageInitSchema = function (objectApiName) {
41
41
  return {
42
42
  type: 'page',
43
43
  name: getScopeId(objectApiName, "list"),
44
- bodyClassName: '',
44
+ bodyClassName: 'p-0',
45
45
  regions: [
46
46
  "body"
47
47
  ],
@@ -112,7 +112,7 @@ const getRecordPageInitSchema = async function (objectApiName, userSession) {
112
112
  name: getScopeId(objectApiName, "record_detail"),
113
113
  objectApiName: "${objectName}",
114
114
  bodyClassName: '',
115
- className: "object-detail-page steedos-record-content overflow-y-auto p-0 m-0 flex-1 h-full bg-gray-100",
115
+ className: "object-detail-page steedos-record-content overflow-y-auto p-0 m-0 flex-1 h-full bg-gray-50",
116
116
  regions: [
117
117
  "body"
118
118
  ],
@@ -9,7 +9,7 @@ function getSvgUrl(source, name) {
9
9
  name = foo[1];
10
10
  }
11
11
  url = "/assets/icons/" + source + "/svg/symbols.svg#" + name;
12
- return Creator.getRelativeUrl(url);
12
+ return Steedos.getRelativeUrl(url);
13
13
  }
14
14
 
15
15
  exports.getSvgUrl = getSvgUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-plugin-amis",
3
- "version": "2.7.27-beta.6",
3
+ "version": "3.0.0-beta.100",
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": "4cc6978a51be2b5b8efcad8ec8adba467df6e02a",
16
+ "gitHead": "89c69deb3ceb9d9e97c70ee23694ccecf1b4ce2b",
17
17
  "devDependencies": {
18
18
  "tailwindcss": "3.2.4"
19
19
  }
@@ -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: 2023-08-02 15:05:31
5
+ * @LastEditTime: 2025-03-10 11:59:01
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -49,16 +49,7 @@ module.exports = {
49
49
  * Events
50
50
  */
51
51
  events: {
52
- "steedos-server.started": {
53
- async handler() {
54
- await this.publicClientJS();
55
- }
56
- },
57
- "space.initialized": {
58
- async handler() {
59
- await this.publicClientJS();
60
- }
61
- }
52
+
62
53
  },
63
54
 
64
55
  /**
@@ -74,10 +65,11 @@ module.exports = {
74
65
  const { path : packagePath } = packageInfo;
75
66
  let publicPath = path.join(packagePath, 'main', 'default', 'client');
76
67
  try {
77
- if (!fs.existsSync(publicPath) || this.settings.loadedPublicClientJS || typeof WebApp == 'undefined') {
68
+ if (!fs.existsSync(publicPath) || this.settings.loadedPublicClientJS) {
78
69
  return;
79
70
  }
80
71
  } catch (error) {
72
+ console.log('error', error)
81
73
  return
82
74
  }
83
75
 
@@ -87,12 +79,11 @@ module.exports = {
87
79
  try {
88
80
  const router = require('@steedos/router').staticRouter();
89
81
  let routerPath = "";
90
- if (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX) {
91
- routerPath = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
82
+ if (process.env.ROOT_URL_PATH_PREFIX) {
83
+ routerPath = process.env.ROOT_URL_PATH_PREFIX;
92
84
  }
93
85
  const cacheTime = 86400000 * 1; // one day
94
86
  router.use(`${routerPath}/amis-pages/js`, express.static(publicPath, { maxAge: cacheTime }));
95
- // WebApp.connectHandlers.use(router);
96
87
  } catch (error) {
97
88
  console.error(error)
98
89
  this.settings.loadedPublicClientJS = false;
@@ -115,9 +106,7 @@ module.exports = {
115
106
  * Service started lifecycle event handler
116
107
  */
117
108
  async started() {
118
- this.broker.waitForServices("steedos-server").then(async () => {
119
- await this.publicClientJS()
120
- });
109
+ await this.publicClientJS()
121
110
  },
122
111
 
123
112
  /**
@@ -68,17 +68,6 @@
68
68
  position: sticky
69
69
  }
70
70
 
71
- .inset-0 {
72
- top: 0px;
73
- right: 0px;
74
- bottom: 0px;
75
- left: 0px
76
- }
77
-
78
- .z-20 {
79
- z-index: 20
80
- }
81
-
82
71
  .col-span-2 {
83
72
  grid-column: span 2 / span 2
84
73
  }
@@ -87,25 +76,20 @@
87
76
  float: right
88
77
  }
89
78
 
90
- .m-1 {
91
- margin: 0.25rem
92
- }
93
-
94
79
  .m-0 {
95
80
  margin: 0px
96
81
  }
97
82
 
98
- .-m-8 {
99
- margin: -2rem
100
- }
101
-
102
83
  .m-auto {
103
84
  margin: auto
104
85
  }
105
86
 
106
- .mx-4 {
107
- margin-left: 1rem;
108
- margin-right: 1rem
87
+ .m-4 {
88
+ margin: 1rem
89
+ }
90
+
91
+ .m-1 {
92
+ margin: 0.25rem
109
93
  }
110
94
 
111
95
  .my-2 {
@@ -113,45 +97,54 @@
113
97
  margin-bottom: 0.5rem
114
98
  }
115
99
 
116
- .-mx-11 {
117
- margin-left: -2.75rem;
118
- margin-right: -2.75rem
119
- }
120
-
121
- .mt-3 {
122
- margin-top: 0.75rem
100
+ .my-4 {
101
+ margin-top: 1rem;
102
+ margin-bottom: 1rem
123
103
  }
124
104
 
125
- .mb-4 {
126
- margin-bottom: 1rem
105
+ .mx-4 {
106
+ margin-left: 1rem;
107
+ margin-right: 1rem
127
108
  }
128
109
 
129
- .mt-2 {
130
- margin-top: 0.5rem
110
+ .mb-0 {
111
+ margin-bottom: 0px
131
112
  }
132
113
 
133
- .mr-4 {
134
- margin-right: 1rem
114
+ .ml-2 {
115
+ margin-left: 0.5rem
135
116
  }
136
117
 
137
118
  .mb-2 {
138
119
  margin-bottom: 0.5rem
139
120
  }
140
121
 
141
- .-mt-3 {
142
- margin-top: -0.75rem
122
+ .mb-4 {
123
+ margin-bottom: 1rem
143
124
  }
144
125
 
145
126
  .mr-7 {
146
127
  margin-right: 1.75rem
147
128
  }
148
129
 
149
- .mb-0 {
150
- margin-bottom: 0px
130
+ .ml-4 {
131
+ margin-left: 1rem
151
132
  }
152
133
 
153
- .ml-2 {
154
- margin-left: 0.5rem
134
+ .mr-1 {
135
+ margin-right: 0.25rem
136
+ }
137
+
138
+ .mt-2 {
139
+ margin-top: 0.5rem
140
+ }
141
+
142
+ .mr-4 {
143
+ margin-right: 1rem
144
+ }
145
+
146
+ .-mt-3 {
147
+ margin-top: -0.75rem
155
148
  }
156
149
 
157
150
  .block {
@@ -186,34 +179,22 @@
186
179
  display: none
187
180
  }
188
181
 
189
- .h-9 {
190
- height: 2.25rem
191
- }
192
-
193
182
  .h-full {
194
183
  height: 100%
195
184
  }
196
185
 
197
- .h-0 {
198
- height: 0px
199
- }
200
-
201
186
  .h-7 {
202
187
  height: 1.75rem
203
188
  }
204
189
 
205
- .w-9 {
206
- width: 2.25rem
190
+ .h-9 {
191
+ height: 2.25rem
207
192
  }
208
193
 
209
194
  .w-full {
210
195
  width: 100%
211
196
  }
212
197
 
213
- .w-6\/12 {
214
- width: 50%
215
- }
216
-
217
198
  .w-4\/5 {
218
199
  width: 80%
219
200
  }
@@ -222,12 +203,12 @@
222
203
  width: 24rem
223
204
  }
224
205
 
225
- .min-w-\[240px\] {
226
- min-width: 240px
206
+ .w-9 {
207
+ width: 2.25rem
227
208
  }
228
209
 
229
- .min-w-\[200px\] {
230
- min-width: 200px
210
+ .min-w-\[220px\] {
211
+ min-width: 220px
231
212
  }
232
213
 
233
214
  .max-w-4xl {
@@ -246,19 +227,10 @@
246
227
  flex-grow: 1
247
228
  }
248
229
 
249
- .-translate-x-0 {
250
- --tw-translate-x: -0px;
251
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
252
- }
253
-
254
230
  .transform {
255
231
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
256
232
  }
257
233
 
258
- .flex-row {
259
- flex-direction: row
260
- }
261
-
262
234
  .flex-col {
263
235
  flex-direction: column
264
236
  }
@@ -275,6 +247,10 @@
275
247
  justify-content: space-between
276
248
  }
277
249
 
250
+ .gap-3 {
251
+ gap: 0.75rem
252
+ }
253
+
278
254
  .overflow-auto {
279
255
  overflow: auto
280
256
  }
@@ -283,18 +259,10 @@
283
259
  overflow: hidden
284
260
  }
285
261
 
286
- .overflow-x-auto {
287
- overflow-x: auto
288
- }
289
-
290
262
  .overflow-y-auto {
291
263
  overflow-y: auto
292
264
  }
293
265
 
294
- .whitespace-nowrap {
295
- white-space: nowrap
296
- }
297
-
298
266
  .rounded {
299
267
  border-radius: 0.25rem
300
268
  }
@@ -311,17 +279,12 @@
311
279
  border-width: 0px
312
280
  }
313
281
 
314
- .border-y {
315
- border-top-width: 1px;
282
+ .border-b {
316
283
  border-bottom-width: 1px
317
284
  }
318
285
 
319
- .border-r {
320
- border-right-width: 1px
321
- }
322
-
323
- .border-b {
324
- border-bottom-width: 1px
286
+ .border-none {
287
+ border-style: none
325
288
  }
326
289
 
327
290
  .border-gray-300 {
@@ -329,38 +292,33 @@
329
292
  border-color: rgb(209 213 219 / var(--tw-border-opacity))
330
293
  }
331
294
 
332
- .border-gray-200 {
333
- --tw-border-opacity: 1;
334
- border-color: rgb(229 231 235 / var(--tw-border-opacity))
335
- }
336
-
337
295
  .bg-white {
338
296
  --tw-bg-opacity: 1;
339
297
  background-color: rgb(255 255 255 / var(--tw-bg-opacity))
340
298
  }
341
299
 
342
- .bg-gray-50 {
300
+ .bg-gray-100 {
343
301
  --tw-bg-opacity: 1;
344
- background-color: rgb(249 250 251 / var(--tw-bg-opacity))
302
+ background-color: rgb(243 244 246 / var(--tw-bg-opacity))
345
303
  }
346
304
 
347
- .bg-gray-100 {
305
+ .bg-gray-50 {
348
306
  --tw-bg-opacity: 1;
349
- background-color: rgb(243 244 246 / var(--tw-bg-opacity))
307
+ background-color: rgb(249 250 251 / var(--tw-bg-opacity))
350
308
  }
351
309
 
352
310
  .bg-none {
353
311
  background-image: none
354
312
  }
355
313
 
356
- .p-0 {
357
- padding: 0px
358
- }
359
-
360
314
  .p-4 {
361
315
  padding: 1rem
362
316
  }
363
317
 
318
+ .p-0 {
319
+ padding: 0px
320
+ }
321
+
364
322
  .p-2 {
365
323
  padding: 0.5rem
366
324
  }
@@ -369,6 +327,21 @@
369
327
  padding: 0.25rem
370
328
  }
371
329
 
330
+ .py-1 {
331
+ padding-top: 0.25rem;
332
+ padding-bottom: 0.25rem
333
+ }
334
+
335
+ .px-0 {
336
+ padding-left: 0px;
337
+ padding-right: 0px
338
+ }
339
+
340
+ .py-4 {
341
+ padding-top: 1rem;
342
+ padding-bottom: 1rem
343
+ }
344
+
372
345
  .px-2 {
373
346
  padding-left: 0.5rem;
374
347
  padding-right: 0.5rem
@@ -394,29 +367,14 @@
394
367
  padding-bottom: 0.5rem
395
368
  }
396
369
 
397
- .px-0 {
398
- padding-left: 0px;
399
- padding-right: 0px
400
- }
401
-
402
- .py-1 {
403
- padding-top: 0.25rem;
404
- padding-bottom: 0.25rem
405
- }
406
-
407
- .py-4 {
408
- padding-top: 1rem;
409
- padding-bottom: 1rem
370
+ .pt-4 {
371
+ padding-top: 1rem
410
372
  }
411
373
 
412
374
  .pl-10 {
413
375
  padding-left: 2.5rem
414
376
  }
415
377
 
416
- .pt-4 {
417
- padding-top: 1rem
418
- }
419
-
420
378
  .text-left {
421
379
  text-align: left
422
380
  }
@@ -433,22 +391,18 @@
433
391
  font-weight: 700
434
392
  }
435
393
 
436
- .italic {
437
- font-style: italic
438
- }
439
-
440
394
  .leading-none {
441
395
  line-height: 1
442
396
  }
443
397
 
444
- .text-gray-600 {
398
+ .text-black {
445
399
  --tw-text-opacity: 1;
446
- color: rgb(75 85 99 / var(--tw-text-opacity))
400
+ color: rgb(0 0 0 / var(--tw-text-opacity))
447
401
  }
448
402
 
449
- .text-black {
403
+ .text-gray-300 {
450
404
  --tw-text-opacity: 1;
451
- color: rgb(0 0 0 / var(--tw-text-opacity))
405
+ color: rgb(209 213 219 / var(--tw-text-opacity))
452
406
  }
453
407
 
454
408
  .text-gray-500 {
@@ -456,13 +410,15 @@
456
410
  color: rgb(107 114 128 / var(--tw-text-opacity))
457
411
  }
458
412
 
459
- .text-gray-300 {
413
+ .text-gray-600 {
460
414
  --tw-text-opacity: 1;
461
- color: rgb(209 213 219 / var(--tw-text-opacity))
415
+ color: rgb(75 85 99 / var(--tw-text-opacity))
462
416
  }
463
417
 
464
- .underline {
465
- text-decoration-line: underline
418
+ .shadow {
419
+ --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
420
+ --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
421
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
466
422
  }
467
423
 
468
424
  .shadow-none {
@@ -471,12 +427,6 @@
471
427
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
472
428
  }
473
429
 
474
- .shadow {
475
- --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
476
- --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
477
- box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
478
- }
479
-
480
430
  .filter {
481
431
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)
482
432
  }
@@ -489,30 +439,6 @@
489
439
  transition-duration: 150ms
490
440
  }
491
441
 
492
- .duration-300 {
493
- transition-duration: 300ms
494
- }
495
-
496
- .ease-in-out {
497
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1)
498
- }
499
-
500
- .hover\:ml-2\.5:hover {
501
- margin-left: 0.625rem
502
- }
503
-
504
- .hover\:ml-2:hover {
505
- margin-left: 0.5rem
506
- }
507
-
508
- .hover\:inline-block:hover {
509
- display: inline-block
510
- }
511
-
512
- .hover\:cursor-pointer:hover {
513
- cursor: pointer
514
- }
515
-
516
442
  .focus\:outline-none:focus {
517
443
  outline: 2px solid transparent;
518
444
  outline-offset: 2px
@@ -523,14 +449,18 @@
523
449
  margin: 0.5rem
524
450
  }
525
451
 
526
- .sm\:rounded-lg {
527
- border-radius: 0.5rem
452
+ .sm\:m-4 {
453
+ margin: 1rem
528
454
  }
529
455
 
530
456
  .sm\:rounded {
531
457
  border-radius: 0.25rem
532
458
  }
533
459
 
460
+ .sm\:rounded-lg {
461
+ border-radius: 0.5rem
462
+ }
463
+
534
464
  .sm\:border {
535
465
  border-width: 1px
536
466
  }
@@ -540,15 +470,6 @@
540
470
  border-color: rgb(209 213 219 / var(--tw-border-opacity))
541
471
  }
542
472
 
543
- .sm\:px-3 {
544
- padding-left: 0.75rem;
545
- padding-right: 0.75rem
546
- }
547
-
548
- .sm\:pt-3 {
549
- padding-top: 0.75rem
550
- }
551
-
552
473
  .sm\:shadow {
553
474
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
554
475
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
@@ -1,336 +0,0 @@
1
- {
2
- "type": "page",
3
- "title": "Welcome to Steedos",
4
- "body": [
5
- {
6
- "type": "steedos-object-form",
7
- "className": "sm:border sm:rounded sm:border-gray-300 bg-white p-4",
8
- "label": "对象表单",
9
- "objectApiName": "apps",
10
- "recordId": "${recordId}",
11
- "mode": "edit",
12
- "fieldsExtend": {
13
- "tab_items": {
14
- "amis": {
15
- "name": "tab_items",
16
- "type": "steedos-input-table",
17
- "label": "",
18
- "showIndex": true,
19
- "source": "${tab_items}",
20
- "strictMode": true,
21
- "affixHeader": false,
22
- "editable": true,
23
- "addable": false,
24
- "removable": true,
25
- "draggable": false,
26
- "fields": [
27
- {
28
- "label": "${'apps.apps_form.tab' | t}",
29
- "type": "lookup",
30
- "multiple": false,
31
- "is_wide": false,
32
- "required": true,
33
- "reference_to": "tabs",
34
- "reference_to_field": "name",
35
- "sort_no": 30,
36
- "name": "tab_name",
37
- "hidden": false,
38
- "readonly": false,
39
- "disabled": false,
40
- "_prefix": "tab_items."
41
- },
42
- {
43
- "label": "${'apps.apps_form.tab_grouping' | t}",
44
- "name": "group",
45
- "_prefix": "tab_items.",
46
- "type": "text",
47
- "amis": {
48
- "type": "select",
49
- "source": "${tab_groups|pick:group_name}",
50
- "onEvent": {
51
- "change": {
52
- "actions": [
53
- {
54
- "actionType": "custom",
55
- "script": "const tabGroupKey = \"group\";const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const quickEidtSaveForTab = function (input, prop_name) { const currentPropValue = input.value; const rowValue = input.__super; const formValue = input.__super.__super; const tab_name = rowValue.tab_name; rowValue[prop_name] = currentPropValue; delete rowValue.index; let newTabs = formValue.tab_items.map(function (item) { if (item.tab_name == tab_name) { return Object.assign({}, item, rowValue); } else { return item; } }); const tabGroups = input.__super.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, \"group_name\")); if (groupNames && groupNames.length) { newTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: newTabs }};const eventData = event.data;const newTabTtemsProp = quickEidtSaveForTab(eventData, \"group\");setTimeout(function () { doAction({ actionType: 'setValue', componentId: \"object_form\", args: { value: newTabTtemsProp } });},300);"
56
- }
57
- ]
58
- }
59
- },
60
- "placeholder": "-"
61
- },
62
- "className": "m-0",
63
- "checkAll": false,
64
- "selectFirst": false,
65
- "searchable": true,
66
- "clearable": true,
67
- "multiple": false,
68
- "mode": "inline"
69
- }
70
- ],
71
- "columns": [
72
- {
73
- "name": "tab_name",
74
- "inlineEditMode": false
75
- },
76
- "group"
77
- ],
78
- "headerToolbar": [
79
- {
80
- "type": "service",
81
- "id": "tabs-options-service",
82
- "className": "mb-2",
83
- "body": [
84
- {
85
- "type": "button",
86
- "id": "u:a35a2276145d",
87
- "label": "${'apps.apps_form.tab_generate' | t}",
88
- "onEvent": {
89
- "click": {
90
- "actions": [
91
- {
92
- "script": "const appId = null; const page = Steedos.Page.getPage('app', appId, null, null, 'generate_object_tabs'); if (page && page.schema) { const pageSchema = JSON.parse(page.schema); let formSchema = pageSchema.body[0]; formSchema.canAccessSuperData = false; formSchema.wrapWithPanel = false; formSchema.className = 'steedos-amis-form'; const title = t('apps.apps_form.tab_generate_title'); doAction({ 'actionType': 'dialog', 'dialog': { 'type': 'dialog', 'title': title, 'body': formSchema, 'size': 'lg' } }); }",
93
- "actionType": "custom"
94
- }
95
- ],
96
- "weight": 0
97
- }
98
- },
99
- "tpl": "内容"
100
- },
101
- {
102
- "type": "button",
103
- "label": "${'apps.apps_form.tab_set' | t}",
104
- "id": "u:853b890ab524",
105
- "actionType": "dialog",
106
- "dialog": {
107
- "type": "dialog",
108
- "title": "${'apps.apps_form.tab_set' | t}",
109
- "body": [
110
- {
111
- "type": "transfer",
112
- "name": "picked_tabs",
113
- "value": "${tab_items|pick:tab_name}",
114
- "sortable": true,
115
- "source": "${tabs_options}",
116
- "searchable": true,
117
- "itemHeight": 40,
118
- "id": "u:f2d36873abd1"
119
- }
120
- ],
121
- "onEvent": {
122
- "confirm": {
123
- "actions": [
124
- {
125
- "actionType": "custom",
126
- "script": "const tabGroupKey = 'group';const getTabsSortFun = function (groupNames) { return function (m, n) { var tempM = !!m[tabGroupKey] ? 1 : 0; var tempN = !!n[tabGroupKey] ? 1 : 0; if (!m[tabGroupKey] || !n[tabGroupKey]) { return tempM - tempN; } return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]); };};const clearTabs = function (input) { return { tab_items: [] }};const convertDataForTabs = function (input) { let pickedTabs = input.picked_tabs || []; const superTabs = _.keyBy(input.__super.tab_items, 'tab_name'); if (typeof pickedTabs === 'string') { pickedTabs = pickedTabs.split(','); } const tabOptions = _.keyBy(input.__super.tabs_options, 'value'); const convertedTabs = pickedTabs.map(function (tab_name) { const superTab = superTabs[tab_name]; if (superTab) { return superTab; } else { const tabOption = tabOptions[tab_name]; return { tab_name: tab_name, group: tabOption.group } } }); const tabGroups = input.__super.tab_groups; const groupNames = _.compact(_.map(tabGroups, 'group_name')); if (groupNames && groupNames.length) { convertedTabs.sort(getTabsSortFun(groupNames)); } return { tab_items: convertedTabs }};const eventData = event.data;doAction({ actionType: 'setValue', componentId: 'object_form', args: { value: convertDataForTabs(eventData) }});doAction({ actionType: 'setValue', componentId: 'tabs-options-service', args: { value: convertDataForTabs(eventData) }});"
127
- }
128
- ]
129
- }
130
- },
131
- "size": "lg",
132
- "id": "u:9c93896a73cf",
133
- "closeOnEsc": false,
134
- "closeOnOutside": false,
135
- "showCloseButton": true,
136
- "showErrorMsg": true,
137
- "showLoading": true,
138
- "dataMapSwitch": false
139
- }
140
- },
141
- {
142
- "type": "button",
143
- "label": "${'apps.apps_form.tab_grouping_set' | t}",
144
- "actionType": "dialog",
145
- "dialog": {
146
- "title": "${'apps.apps_form.tab_grouping_set' | t}",
147
- "body": [
148
- {
149
- "type": "input-table",
150
- "name": "setting_groups",
151
- "value": "${tab_groups}",
152
- "addable": true,
153
- "draggable": true,
154
- "editable": true,
155
- "needConfirm": false,
156
- "columns": [
157
- {
158
- "name": "group_name",
159
- "label": "${'apps.apps_form.tab_grouping_name' | t}",
160
- "id": "u:383c7744b499"
161
- },
162
- {
163
- "name": "default_open",
164
- "label": "${'apps.apps_form.tab_grouping_open' | t}",
165
- "id": "u:7a243c84ed66",
166
- "type": "checkbox",
167
- "value": true
168
- }
169
- ],
170
- "removable": true,
171
- "id": "setting_groups"
172
- }
173
- ],
174
- "onEvent": {
175
- "confirm": {
176
- "actions": [
177
- {
178
- "actionType": "custom",
179
- "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 return tempM - tempN;\n }\n return groupNames.indexOf(m[tabGroupKey]) - groupNames.indexOf(n[tabGroupKey]);\n };\n};\nconst clearTabs = function (input) { return { tab_items: [] } };\nconst convertDataForGroups = function (input) {\n \n const settingGroups = input.setting_groups || [];\n const convertedGroups = _.uniqBy(settingGroups.map(function (item) {\n return { group_name: item.group_name, default_open: item.default_open }\n }), 'group_name');\n const groupNames = _.compact(_.map(convertedGroups, 'group_name'));\n const tab_items = input.tab_items;\n tab_items?.sort(getTabsSortFun(groupNames));\n \n return { tab_groups: convertedGroups, tab_items: tab_items }\n};\nconst eventData = event.data;\ndoAction(\n {\n actionType: 'setValue',\n componentId: 'object_form',\n args: { value: convertDataForGroups(eventData) }\n }\n);"
180
- }
181
- ]
182
- }
183
- },
184
- "type": "dialog",
185
- "size": "lg",
186
- "id": "setting_groups",
187
- "closeOnEsc": false,
188
- "closeOnOutside": false,
189
- "showCloseButton": true,
190
- "showErrorMsg": true,
191
- "showLoading": true,
192
- "dataMapSwitch": false
193
- },
194
- "id": "u:111b043b193c"
195
- }
196
- ],
197
- "messages": {
198
- },
199
- "api": {
200
- "method": "post",
201
- "url": "${context.rootUrl}/graphql",
202
- "adaptor": "let data = payload.data;\ndata.tabs_options = [];\nif (data.options && data.options.length) {\n data.tabs_options = data.options.map(function (option) {\n option.label = option.label + '(' + option.value + ')';\n return option;\n });\n}\nif (!api.body.recordId) {\n const defaultValues = {\n is_creator: true,\n mobile: true,\n visible: true,\n sort: 9100\n };\n data = Object.assign({}, data, defaultValues);\n}\ndelete data.options;\npayload.data = data;\nreturn payload; ",
203
- "data": {
204
- "query": "{options:tabs{_id label:label value:name,type,object,desktop,mobile}}",
205
- "recordId": "${recordId}"
206
- },
207
- "headers": {
208
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
209
- },
210
- "messages": {
211
- },
212
- "requestAdaptor": ""
213
- }
214
- }
215
- ],
216
- "enableDialog": false,
217
- "id": "u:7949aecf0ca9"
218
- }
219
- },
220
- "objects": {
221
- "amis": {
222
- "name": "objects",
223
- "type": "select",
224
- "className": "m-0",
225
- "labelClassName": "text-left",
226
- "id": "u:4e5047e44905",
227
- "joinValues": false,
228
- "extractValue": true,
229
- "labelField": "label",
230
- "valueField": "value",
231
- "multiple": true,
232
- "checkAll": false,
233
- "searchable": true,
234
- "menuTpl": "",
235
- "source": {
236
- "method": "get",
237
- "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
238
- "headers": {
239
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
240
- }
241
- },
242
- "autoComplete": ""
243
- }
244
- },
245
- "mobile_objects": {
246
- "amis": {
247
- "name": "mobile_objects",
248
- "type": "select",
249
- "className": "m-0",
250
- "labelClassName": "text-left",
251
- "id": "u:cfaeb2f857a8",
252
- "joinValues": false,
253
- "extractValue": true,
254
- "labelField": "label",
255
- "valueField": "value",
256
- "multiple": true,
257
- "checkAll": false,
258
- "searchable": true,
259
- "menuTpl": "",
260
- "source": {
261
- "method": "get",
262
- "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/options",
263
- "messages": {
264
- },
265
- "headers": {
266
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
267
- }
268
- },
269
- "autoComplete": ""
270
- }
271
- },
272
- "visible_on": {
273
- "amis": {
274
- "type": "control",
275
- "body": [
276
- {
277
- "type": "service",
278
- "id": "u:edcd865de7d8",
279
- "body": [
280
- {
281
- "type": "input-formula",
282
- "name": "visible_on",
283
- "evalMode": false,
284
- "variableMode": "tabs",
285
- "variables": "${visibleOnVariables}",
286
- "visibleOn": "${visibleOnVariables}",
287
- "id": "u:618105d5bfad",
288
- "labelClassName": "none"
289
- }
290
- ],
291
- "api": {
292
- "method": "get",
293
- "url": "${context.rootUrl}/service/api/amis-metadata-objects/objects/apps/fields/options",
294
- "cache": 30000,
295
- "adaptor": "const visibleOnVariables = SteedosUI.getFormulaVariables(payload.data.options);\nconst defaultValueVariables = [visibleOnVariables[1]];\npayload = {\n data: {\n visibleOnVariables,\n defaultValueVariables\n }\n};\nreturn payload;",
296
- "headers": {
297
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
298
- }
299
- },
300
- "dsType": "api"
301
- }
302
- ],
303
- "id": "u:996ef29c6851"
304
- }
305
- }
306
- },
307
- "enableTabs": true,
308
- "debug": false,
309
- "initApiRequestAdaptor": "",
310
- "initApiAdaptor": "var data = payload.data;\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}\nif (data._id && !data.tab_items) {\n const tabOptions = data.tabs_options || [];\n const tabItems = [];\n // 把应用中原来tabs属性值添加到新的tab_items属性的默认值中\n if (data.tabs && data.tabs.length) {\n data.tabs.forEach(function (item) {\n tabItems.push({ tab_name: item });\n });\n }\n const 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属性的默认值中\n if (data.objects && data.objects.length) {\n pushObjectsToTabItems(data.objects);\n }\n // 把应用中原来mobile_objects属性值添加到新的tab_items属性的默认值中\n if (data.mobile_objects && data.mobile_objects.length) {\n pushObjectsToTabItems(data.mobile_objects);\n }\n data.tab_items = tabItems;\n}\n\npayload.data = data;\ndelete payload.extensions;\nreturn payload;\n ",
311
- "apiRequestAdaptor": "delete formData.tabs_options;\nconst recordId = formData.recordId;\n\n// 新加字段tab_items,值同步回传到老字段tabs中兼容老UI界面\nformData.tabs = [];\nif (formData.tab_items && formData.tab_items.length) { \n formData.tabs = formData.tab_items.map(function (item) { return item.tab_name; });\n}\n\n/*\ntab_items存储为:\ntab_items: {\n test1:{\n group:\"xxx\"\n },\n test3:{\n group:\"yyy\"\n }\n}\n而不是:\ntab_items: [\n {\n \"index\":1,\n \"group\":\"xxx\"\n },\n {\n \"index\":2,\n \"group\":\"yyy\"\n }\n]\n*/\nif (formData.tab_items) { \n formData.tab_items = _.keyBy(formData.tab_items, \"tab_name\")\n let tempIndex = 0;\n _.each(formData.tab_items, function (n, k) {\n tempIndex++;\n n.index = tempIndex;\n delete n.tab_name;\n });\n}\n\nquery = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\nif(recordId){\n query = `mutation{record: ${objectName}__update(id: \"${recordId}\", doc: {__saveData}){_id}}`;\n};\n__saveData = JSON.stringify(JSON.stringify(formData));\n\napi.data = {query: query.replace('{__saveData}', __saveData)};\nreturn api;\n",
312
- "apiAdaptor": "",
313
- "form": {
314
- "id": "object_form"
315
- },
316
- "id": "u:e1c1a841d373",
317
- "tabsMode": "line"
318
- }
319
- ],
320
- "regions": [
321
- "body"
322
- ],
323
- "data": {
324
- "objectName": "apps",
325
- "initialValues": {},
326
- "appId": "builder",
327
- "title": "",
328
- "context": {
329
- "rootUrl": "http://127.0.0.1:5800",
330
- "tenantId": "64a4d6dd7fe9acaf8c330a37",
331
- "userId": "683e09cd-8482-4034-bd29-5a30643e6c0f",
332
- "authToken": "2906ff4353c25cfe291352f899ba3446aa5577f3de7ad60e1aa500c60dee7ca6fb446412f1c9693775b4cc"
333
- }
334
- },
335
- "id": "u:de840f3523f2"
336
- }
@@ -1,12 +0,0 @@
1
- name: apps_form
2
- is_active: true
3
- label: 应用程序表单
4
- object_name: apps
5
- pageAssignments:
6
- - desktop: true
7
- mobile: true
8
- page: apps_form
9
- type: orgDefault
10
- render_engine: amis
11
- type: form
12
- widgets: []