@steedos/standard-object-database 2.5.20-beta.8 → 2.5.20

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.
@@ -61,7 +61,7 @@ fields:
61
61
  value: infinite
62
62
  description:
63
63
  columns:
64
- label: Columns
64
+ label: PC Columns
65
65
  help:
66
66
  description:
67
67
  columns.$:
@@ -164,8 +164,23 @@ fields:
164
164
  description:
165
165
  is_enable:
166
166
  label: Enable
167
+ help:
168
+ description:
169
+ requestAdaptor:
170
+ label: Request Adaptor
171
+ help: "Function signature: (api)=>api, the data is in api.data, and after modification, the api object is returned."
172
+ description:
173
+ adaptor:
174
+ label: Adaptor
175
+ help: "Function signature: (payload, response, api)=>payload"
176
+ description:
167
177
  groups:
168
178
  advanced: Advanced
179
+ show_columns: Show Columns
180
+ sort: Sort
181
+ filters: Filters
182
+ search_term: Search Term
183
+ data_interface: Data Interface
169
184
  listviews:
170
185
  all:
171
186
  label: All List View
@@ -52,7 +52,7 @@ fields:
52
52
  value: infinite
53
53
  description:
54
54
  columns:
55
- label: 显示的列
55
+ label: 电脑端显示的列
56
56
  help:
57
57
  description:
58
58
  columns.$:
@@ -161,8 +161,21 @@ fields:
161
161
  label: 使用 amis自定义列表
162
162
  amis_schema:
163
163
  label: Amis Schema
164
+ requestAdaptor:
165
+ label: 发送适配器
166
+ help: "函数签名:(api) => api, 数据在 api.data 中,修改后返回 api 对象。"
167
+ description:
168
+ adaptor:
169
+ label: 接收适配器
170
+ help: "函数签名: (payload, response, api) => payload"
171
+ description:
164
172
  groups:
165
173
  advanced: 高级
174
+ show_columns: 显示列
175
+ sort: 排序
176
+ filters: 过滤
177
+ search_term: 搜索项
178
+ data_interface: 数据接口
166
179
  listviews:
167
180
  all:
168
181
  label: 全部
@@ -2,7 +2,7 @@
2
2
  * @Author: baozhoutao@steedos.com
3
3
  * @Date: 2022-06-23 17:58:55
4
4
  * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2022-07-05 11:26:24
5
+ * @LastEditTime: 2023-12-05 10:35:52
6
6
  * @Description:
7
7
  */
8
8
  var objectql = require('@steedos/objectql');
@@ -53,6 +53,9 @@ Meteor.startup(function () {
53
53
  }
54
54
  },
55
55
  removed: function (oldDocument) {
56
+ if(oldDocument.is_system){
57
+ objectCore.removeObjectConfig(oldDocument.name)
58
+ }
56
59
  return _removeServerObjects(oldDocument);
57
60
  }
58
61
  });
@@ -2,11 +2,12 @@
2
2
  * @Author: baozhoutao@steedos.com
3
3
  * @Date: 2022-08-05 14:17:44
4
4
  * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-06-27 09:32:45
5
+ * @LastEditTime: 2023-12-05 11:04:22
6
6
  * @Description:
7
7
  */
8
8
  var objectql = require('@steedos/objectql');
9
9
  var objectCore = require('./objects.core.js');
10
+ const register = require('@steedos/metadata-registrar');
10
11
  var lodash = require('lodash');
11
12
  Meteor.startup(function () {
12
13
  var _change, _remove, inited = false;
@@ -48,6 +49,11 @@ Meteor.startup(function () {
48
49
  },
49
50
  removed: function (oldDocument) {
50
51
  if(inited){
52
+ const objConfig = register.getOriginalObjectConfig(oldDocument.object);
53
+ if(objConfig && objConfig.actions[oldDocument.name]){
54
+ return _change(Object.assign(objConfig.actions[oldDocument.name], {_previousName: oldDocument.name}));
55
+ }
56
+
51
57
  return _remove(oldDocument);
52
58
  }
53
59
  }
@@ -3,6 +3,19 @@ var objectql = require('@steedos/objectql');
3
3
  var clone = require('clone');
4
4
  var objectCore = require('./objects.core.js');
5
5
 
6
+ const objectFieldsFind = function (filter) {
7
+ return objectql.wrapAsync(async function () {
8
+ return await objectql.getObject('object_fields').find(this.filter);
9
+ }, { filter: filter })
10
+ }
11
+
12
+
13
+ const getRecords = function (objectName) {
14
+ return objectql.wrapAsync(async function () {
15
+ return await objectql.getObject(this.objectName).directFind({fields:["_id"], top: 1});
16
+ }, { objectName: objectName })
17
+ }
18
+
6
19
  const MAX_MASTER_DETAIL_LEAVE = objectql.MAX_MASTER_DETAIL_LEAVE;
7
20
 
8
21
  function canRemoveNameFileld(doc){
@@ -105,20 +118,18 @@ function _syncToObject(doc, event) {
105
118
  };
106
119
 
107
120
  function isRepeatedName(doc, name) {
108
- var other;
109
- other = Creator.getCollection("object_fields").find({
110
- object: doc.object,
111
- space: doc.space,
112
- _id: {
113
- $ne: doc._id
114
- },
115
- name: name || doc.name
116
- }, {
117
- fields: {
118
- _id: 1
119
- }
121
+ var other = objectFieldsFind({
122
+ filters: [[
123
+ 'object', '=', doc.object
124
+ ], [
125
+ 'space', '=', doc.space
126
+ ], [
127
+ '_id', '!=', doc._id
128
+ ], [
129
+ 'name', '=', name || doc.name
130
+ ]]
120
131
  });
121
- if (other.count() > 0) {
132
+ if (other.length > 0) {
122
133
  return true;
123
134
  }
124
135
  return false;
@@ -428,11 +439,11 @@ var triggers = {
428
439
  }
429
440
  });
430
441
  if (object) {
431
- object_documents = Creator.getCollection(object.name).find();
432
- if ((modifier != null ? (ref6 = modifier.$set) != null ? ref6.reference_to : void 0 : void 0) && doc.reference_to !== _reference_to && object_documents.count() > 0) {
442
+ object_documents = getRecords(object.name);
443
+ if ((modifier != null ? (ref6 = modifier.$set) != null ? ref6.reference_to : void 0 : void 0) && doc.reference_to !== _reference_to && object_documents.length > 0) {
433
444
  throw new Meteor.Error(500, `对象${object.label}中已经有记录,不能修改reference_to字段`);
434
445
  }
435
- if ((modifier != null ? (ref7 = modifier.$unset) != null ? ref7.reference_to : void 0 : void 0) && doc.reference_to !== _reference_to && object_documents.count() > 0) {
446
+ if ((modifier != null ? (ref7 = modifier.$unset) != null ? ref7.reference_to : void 0 : void 0) && doc.reference_to !== _reference_to && object_documents.length > 0) {
436
447
  throw new Meteor.Error(500, `对象${object.label}中已经有记录,不能修改reference_to字段`);
437
448
  }
438
449
  }
@@ -465,8 +476,9 @@ var triggers = {
465
476
  if(doc.name === 'name' || doc.is_name){
466
477
  checkNameField({type: doc.type})
467
478
  }
468
-
479
+ console.log('insert', doc)
469
480
  if (isRepeatedName(doc)) {
481
+
470
482
  throw new Meteor.Error(doc.name, "字段名不能重复");
471
483
  }
472
484
 
@@ -25,6 +25,8 @@ fields:
25
25
  label: Label
26
26
  is_name: true
27
27
  sort_no: 120
28
+ amis:
29
+ disabledOn: "${is_system == true}"
28
30
  _name:
29
31
  type: text
30
32
  label: Field Name
@@ -106,26 +108,6 @@ fields:
106
108
  amis:
107
109
  disabledOn: "${is_system == true}"
108
110
  searchable: true
109
- onEvent:
110
- change:
111
- weight: 0
112
- actions:
113
- - componentId: 'u:6a556d8a8514'
114
- args:
115
- value: '${"lookup"=== type}'
116
- actionType: visibility
117
- - componentId: 'u:6a556d8a8514'
118
- args:
119
- value: clear
120
- groupType: component
121
- actionType: setValue
122
- expression: '${"lookup"=== type && required!=true}'
123
- - componentId: 'u:6a556d8a8514'
124
- args:
125
- value: retain
126
- groupType: component
127
- actionType: setValue
128
- expression: '${"lookup"=== type && required==true}'
129
111
  language:
130
112
  type: select
131
113
  label: 语言
@@ -704,18 +686,6 @@ fields:
704
686
  # group: Advanced
705
687
  visible_on: "{{['autonumber','summary','formula'].indexOf(formData.type) > -1 ? false: true}}"
706
688
  sort_no: 272
707
- amis:
708
- # disabledOn: "${is_system == true}"
709
- onEvent:
710
- change:
711
- weight: 0
712
- actions:
713
- - componentId: 'u:6a556d8a8514'
714
- args:
715
- value: retain
716
- groupType: component
717
- actionType: setValue
718
- expression: '${"lookup"=== type && required==true}'
719
689
  deleted_lookup_record_behavior:
720
690
  type: select
721
691
  label: 如果相关表记录被删除怎么办?
@@ -728,10 +698,9 @@ fields:
728
698
  value: retain
729
699
  sort_no: 276
730
700
  is_wide: true
731
- defaultValue: clear
732
701
  amis:
733
- "id": "u:6a556d8a8514"
734
702
  "disabledOn": "${required==true}"
703
+ "value": "${IFS(true===required, \"retain\", !required && !deleted_lookup_record_behavior, \"clear\", deleted_lookup_record_behavior)}"
735
704
  is_wide:
736
705
  type: boolean
737
706
  label: Is Wide
@@ -64,11 +64,37 @@ fields:
64
64
  value: infinite
65
65
  defaultValue: '"standard"'
66
66
  hidden: true
67
+ sort_no:
68
+ label: Sort no
69
+ type: number
70
+ scale: 0
71
+ defaultValue: 100
72
+ is_enable:
73
+ type: toggle
74
+ label: Enable
75
+ defaultValue: true
76
+ crud_mode:
77
+ label: 显示模式
78
+ type: select
79
+ options:
80
+ - label: 表格
81
+ value: table
82
+ - label: 卡片
83
+ value: cards
84
+ defaultValue: table
67
85
  columns:
68
86
  label: Columns
69
- type: grid
87
+ type: table
70
88
  is_wide: true
71
89
  required: true
90
+ group: show_columns
91
+ amis:
92
+ columns:
93
+ - field
94
+ - name: width
95
+ width: 100
96
+ - name: wrap
97
+ width: 100
72
98
  columns.$:
73
99
  label: Column
74
100
  blackbox: true
@@ -83,18 +109,23 @@ fields:
83
109
  - object_name
84
110
  reference_to: object_fields
85
111
  reference_to_field: name
112
+ enable_enhanced_lookup: false
113
+ filtersFunction: !<tag:yaml.org,2002:js/function> |-
114
+ function(filters, values){
115
+ return ['object', '=', values.object_name]
116
+ }
86
117
  columns.$.width:
87
118
  label: Width
88
119
  type: text
89
- # ag-grid配置rowModelType为infinite的话,列的warp属性功能异常,即不会换行显示且显示效果异常 #258
90
- # columns.$.wrap:
91
- # label: Wrap
92
- # type: boolean
120
+ columns.$.wrap:
121
+ label: Wrap
122
+ type: boolean
93
123
  filter_fields:
94
124
  label: Default Filter Fields
95
125
  type: lookup
96
126
  multiple: true
97
127
  is_wide: true
128
+ hidden: true
98
129
  depend_on:
99
130
  - object_name
100
131
  reference_to: object_fields
@@ -105,6 +136,7 @@ fields:
105
136
  is_wide: true
106
137
  depend_on:
107
138
  - object_name
139
+ group: sort
108
140
  sort.$:
109
141
  label: Order
110
142
  blackbox: true
@@ -129,9 +161,9 @@ fields:
129
161
  is_wide: true
130
162
  hidden: false
131
163
  readonly: false
132
- visible_on: "{{global.mode ==='read' ? true : false}}"
133
164
  depend_on:
134
165
  - object_name
166
+ group: filters
135
167
  # filters.$:
136
168
  # label: Filter
137
169
  # blackbox: true
@@ -192,6 +224,7 @@ fields:
192
224
  is_wide: true
193
225
  depend_on:
194
226
  - object_name
227
+ group: show_columns
195
228
  mobile_columns.$:
196
229
  label: Column
197
230
  blackbox: true
@@ -209,6 +242,7 @@ fields:
209
242
  is_wide: true
210
243
  depend_on:
211
244
  - object_name
245
+ group: search_term
212
246
  searchable_fields.$:
213
247
  label: Column
214
248
  blackbox: true
@@ -220,23 +254,6 @@ fields:
220
254
  is_wide: false
221
255
  reference_to: object_fields
222
256
  reference_to_field: name
223
- sort_no:
224
- label: Sort no
225
- type: number
226
- scale: 0
227
- defaultValue: 100
228
- is_enable:
229
- type: boolean
230
- label: Enable
231
- defaultValue: true
232
- crud_mode:
233
- label: 显示模式
234
- type: select
235
- options:
236
- - label: 表格
237
- value: table
238
- - label: 卡片
239
- value: cards
240
257
  is_system:
241
258
  type: boolean
242
259
  label: System
@@ -257,20 +274,26 @@ fields:
257
274
  required: false
258
275
  is_wide: true
259
276
  # visible_on: "{{formData.enable_amis_schema}}"
277
+ visible_on: "{{false}}"
260
278
  requestAdaptor:
261
- label: 发送适配器
279
+ label: Request Adaptor
262
280
  type: code
263
281
  language: "javascript"
264
282
  is_wide: true
265
283
  inlineHelpText: "函数签名:(api) => api, 数据在 api.data 中,修改后返回 api 对象。"
266
- group: 数据接口
284
+ group: data_interface
285
+ # amis:
286
+ # description: "函数签名:(api) => api, 数据在 api.data 中,修改后返回 api 对象。"
267
287
  adaptor:
268
- label: 接收适配器
288
+ label: Adaptor
269
289
  type: code
270
290
  language: "javascript"
271
291
  is_wide: true
272
292
  inlineHelpText: "函数签名: (payload, response, api) => payload"
273
- group: 数据接口
293
+ group: data_interface
294
+ # amis:
295
+ # description: "函数签名: (payload, response, api) => payload"
296
+
274
297
  paging:
275
298
  enabled: false
276
299
  list_views:
@@ -321,4 +344,4 @@ permission_set:
321
344
  allowEdit: true
322
345
  allowRead: false
323
346
  modifyAllRecords: true
324
- viewAllRecords: true
347
+ viewAllRecords: true
@@ -0,0 +1,48 @@
1
+ /*
2
+ * @Author: baozhoutaon@hotoa.com
3
+ * @Date: 2022-03-29 20:33:44
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2023-11-19 17:06:18
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ custom: function (object_name, record_id) {
10
+ $(document.body).addClass('loading');
11
+ let url = `/graphql`;
12
+ const obj = Creator.odata.get("objects", record_id);
13
+ delete obj.record_permissions;
14
+ delete obj["@odata.context"]
15
+ delete obj["@odata.editLink"]
16
+ delete obj["@odata.etag"]
17
+ delete obj["@odata.id"]
18
+ delete obj.idFieldName;
19
+ let options = {
20
+ type: 'post',
21
+ async: true,
22
+ data: JSON.stringify({
23
+ query: `mutation{objects__upsert(id: "${obj.name}", doc: ${JSON.stringify(JSON.stringify(obj))}){_id,name}}`
24
+ }),
25
+ success: function (data) {
26
+ console.log(`data====>`, data)
27
+ SteedosUI.notification.success({
28
+ message: '对象已自定义。'
29
+ });
30
+ // SteedosUI.router.go({}, "/app/" + Session.get("app_id") + "/" + object_name + "/view/" + data.data.objects__upsert._id);
31
+ FlowRouter.reload()
32
+ $(document.body).removeClass('loading');
33
+ },
34
+ error: function (XMLHttpRequest, textStatus, errorThrown) {
35
+ SteedosUI.notification.error({
36
+ message: '操作失败',
37
+ description: t(XMLHttpRequest.responseJSON.error),
38
+ });
39
+ $(document.body).removeClass('loading');
40
+ }
41
+ };
42
+ Steedos.authRequest(url, options);
43
+ },
44
+ customVisible: function (object_name, record_id, permission, data) {
45
+ var record = data && data.record;
46
+ return record && record.is_system && !record.created;
47
+ }
48
+ }
@@ -0,0 +1,6 @@
1
+ name: custom
2
+ is_enable: true
3
+ label: 自定义
4
+ 'on': record_only
5
+ visible: true
6
+ sort: 200
@@ -21,6 +21,12 @@ function canLoadObject(name, datasource) {
21
21
  return true;
22
22
  }
23
23
 
24
+ function removeObjectConfig(objectName){
25
+ broker.call('objects.removeConfig', {
26
+ objectName: objectName
27
+ });
28
+ }
29
+
24
30
  function getDataSource(doc) {
25
31
  if (doc.datasource && !_.include(defaultDatasourcesName, doc.datasource)) {
26
32
  let datasource = Creator.getCollection("datasources").findOne({ _id: doc.datasource })
@@ -216,6 +222,16 @@ function loadObject(doc, oldDoc) {
216
222
 
217
223
  originalObject.isMain = true;
218
224
 
225
+ const objConfig = register.getOriginalObjectConfig(doc.name);
226
+
227
+ if(objConfig){
228
+ _.each(objConfig.fields, (config, name)=>{
229
+ if(!config._id && !doc.fields[name]){
230
+ doc.fields[name] = config;
231
+ }
232
+ })
233
+ }
234
+
219
235
  register.addObjectConfig(doc, datasourceName);
220
236
  register.loadObjectLazyListViews(doc.name);
221
237
  register.loadObjectLazyActions(doc.name);
@@ -380,5 +396,5 @@ function triggerReloadObject(objectName, type, value, event){
380
396
  }
381
397
 
382
398
  module.exports = {
383
- loadObject, removeObject, getDataSourceName, canLoadObject, getObjectFromDB, getDataSource, reloadObject, triggerReloadObject, loadDBObject
399
+ loadObject, removeObject, getDataSourceName, canLoadObject, getObjectFromDB, getDataSource, reloadObject, triggerReloadObject, loadDBObject, removeObjectConfig
384
400
  }
@@ -34,25 +34,29 @@
34
34
  "size": "lg",
35
35
  "body": [
36
36
  {
37
- "type": "input-table",
38
- "columns": [
37
+ "type": "steedos-input-table",
38
+ "fields": [
39
39
  {
40
40
  "name": "group_name",
41
41
  "label": "名称",
42
- "id": "u:ee2fb813a3e7"
42
+ "type": "text",
43
+ "id": "u:31952daa443c"
43
44
  },
44
45
  {
45
46
  "name": "visible_on",
46
47
  "label": "显示条件",
47
- "id": "u:ed37c3ff9dcb"
48
+ "type": "text",
49
+ "id": "u:8d7551abcd28",
50
+ "value": null
48
51
  }
49
52
  ],
50
- "value": "${groups}",
51
- "name": "setting_groups",
53
+ "name": "groups",
52
54
  "addable": true,
53
55
  "editable": true,
54
56
  "removable": true,
55
- "id": "u:483827aac3e8"
57
+ "draggable": false,
58
+ "showIndex": false,
59
+ "id": "u:776ec89804c0"
56
60
  }
57
61
  ],
58
62
  "onEvent": {
@@ -60,7 +64,7 @@
60
64
  "actions": [
61
65
  {
62
66
  "actionType": "custom",
63
- "script": "//整理分组数据\nlet setting_groups = event.data.setting_groups;\nif (!_.find(setting_groups, { is_default: true })) {\n setting_groups.unshift({\n \"id\": \"未分组\",\n \"group_name\": \"未分组\",\n \"visible_on\": \"\",\n \"is_default\": true\n })\n}\nsetting_groups.forEach(function (group) {\n if (group.is_default) {\n group.group_name = \"未分组\";\n group.visible_on = \"\";\n }\n if (!group.id) {\n group.id = group.group_name;\n }\n})\n\n//整理字段与分组关系的数据\nconst fieldForGroup = {};\nlet oldGroup = _.cloneDeep(event.data.fieldForGroup);\nsetting_groups.forEach(function (group) {\n if (_.has(oldGroup, group.id)) {\n fieldForGroup[group.id] = oldGroup[group.id];\n oldGroup = _.omit(oldGroup, group.id);\n } else {\n fieldForGroup[group.id] = [];\n }\n})\nif (oldGroup && !_.isEmpty(oldGroup)) {\n _.forEach(oldGroup, function (value, key) {\n fieldForGroup[\"未分组\"] = _.unionBy(fieldForGroup[\"未分组\"], value);\n });\n}\nconsole.log(\"setting_groups,fieldForGroup===>\", setting_groups, fieldForGroup);\n\ndoAction({\n actionType: 'setValue',\n componentId: 'service_field_design',\n args: {\n value: {\n groups: setting_groups,\n fieldForGroup\n }\n }\n});"
67
+ "script": "//整理分组数据\nlet setting_groups = _.cloneDeep(event.data.groups);\nif (!_.find(setting_groups, { is_default: true })) {\n setting_groups.unshift({\n \"id\": \"未分组\",\n \"group_name\": \"未分组\",\n \"visible_on\": \"\",\n \"is_default\": true\n })\n}\nif (!_.find(setting_groups, { is_hidden: true })) {\n setting_groups.push({\n id: \"隐藏\",\n group_name: \"隐藏\",\n visible_on: \"\",\n is_hidden: true\n });\n}\nsetting_groups.forEach(function (group) {\n if (group.is_hidden) {\n group.group_name = \"隐藏\";\n group.visible_on = \"\";\n }\n if (group.is_default) {\n group.group_name = \"未分组\";\n group.visible_on = \"\";\n }\n if (!group.id) {\n group.id = group.group_name;\n }\n if (!group.visible_on) {\n group.visible_on = \"\"\n }\n})\n\n//整理字段与分组关系的数据\nlet fieldForGroup = {};\nlet oldGroup = _.cloneDeep(event.data.fieldForGroup);\nsetting_groups.forEach(function (group) {\n if (_.has(oldGroup, group.id)) {\n fieldForGroup[group.id] = oldGroup[group.id];\n oldGroup = _.omit(oldGroup, group.id);\n } else {\n fieldForGroup[group.id] = [];\n }\n})\nif (oldGroup && !_.isEmpty(oldGroup)) {\n _.forEach(oldGroup, function (value, key) {\n fieldForGroup[\"未分组\"] = _.unionBy(fieldForGroup[\"未分组\"], value);\n });\n}\n\n//未分组 放在所有分组开头,隐藏 放在所有分组最后\nconst defaultGroup = fieldForGroup[\"未分组\"];\nconst hiddenGroup = fieldForGroup[\"隐藏\"];\ndelete fieldForGroup[\"未分组\"];\ndelete fieldForGroup[\"隐藏\"];\nfieldForGroup = _.merge({ \"未分组\": defaultGroup }, fieldForGroup, { \"隐藏\": hiddenGroup });\n\n//根据fieldForGroup调整groups顺序,设置分组与保存时需要groups按照顺序\nconst keys = _.keys(fieldForGroup);\nsetting_groups = _.sortBy(setting_groups, function (group) { return _.findIndex(keys, function (key) { return key == group.group_name }) });\n\ndoAction({\n actionType: 'setValue',\n componentId: 'service_field_design',\n args: {\n value: {\n groups: setting_groups\n }\n }\n});\n\ndoAction({\n actionType: 'setValue',\n componentId: \"form_field_design\",\n args: {\n value: { design_field: fieldForGroup }\n }\n});"
64
68
  }
65
69
  ]
66
70
  }
@@ -136,7 +140,7 @@
136
140
  "label": "保存",
137
141
  "actionType": "submit",
138
142
  "id": "u:d9039421ea6b",
139
- "target": "form_design_form",
143
+ "target": "form_field_design",
140
144
  "level": "primary"
141
145
  }
142
146
  ]
@@ -178,39 +182,86 @@
178
182
  {
179
183
  "type": "tpl",
180
184
  "tpl": "<p><strong>${label}</strong> ${designObjectLabel}<span style=\"color: rgb(149, 165, 166);\">${_name}</span></p>",
181
- "className": "w-4/5",
182
- "inline": true
183
- },
184
- {
185
- "type": "steedos-dropdown-button",
186
- "label": "",
187
- "buttons": [
188
- {
189
- "type": "steedos-object-button",
190
- "name": "standard_edit",
191
- "objectName": "object_fields",
192
- "className": "antd-Button--default"
193
- },
194
- {
195
- "type": "steedos-object-button",
196
- "name": "standard_delete",
197
- "objectName": "object_fields",
198
- "className": "antd-Button--default",
199
- "visibleOn": "false"
185
+ "className": "w-4/5 field-amplify",
186
+ "inline": true,
187
+ "onEvent": {
188
+ "click": {
189
+ "actions": [
190
+ {
191
+ "actionType": "dialog",
192
+ "dialog": {
193
+ "type": "dialog",
194
+ "title": "编辑字段",
195
+ "data": {
196
+ "appId": "${appId}",
197
+ "global": "${global}",
198
+ "context": "${context}",
199
+ "designObjectName": "${designObjectName}",
200
+ "_master": "${_master}",
201
+ "_id": "${_id}"
202
+ },
203
+ "body": [
204
+ {
205
+ "type": "steedos-object-form",
206
+ "label": "对象表单",
207
+ "objectApiName": "object_fields",
208
+ "recordId": "${_id}",
209
+ "mode": "edit",
210
+ "defaultData": {
211
+ "name": "",
212
+ "shared": false,
213
+ "object": "${designObjectName}"
214
+ },
215
+ "fields": [
216
+ "label",
217
+ "readonly",
218
+ "is_wide"
219
+ ],
220
+ "fieldsExtend": {
221
+ "label": {
222
+ "is_wide": true,
223
+ "group": ""
224
+ },
225
+ "readonly": {
226
+ "group": ""
227
+ },
228
+ "is_wide": {
229
+ "group": ""
230
+ }
231
+ },
232
+ "id": "u:b71796d3cb8c",
233
+ "className": "mb-4",
234
+ "apiRequestAdaptor": "api.data.query = api.data.query.replace('object_fields__update', 'object_fields__upsert')",
235
+ "onEvent": {
236
+ "submitSucc": {
237
+ "weight": 0,
238
+ "actions": [
239
+ {
240
+ "actionType": "custom",
241
+ "script": "setTimeout(() => {\n doAction({\n \"actionType\": \"broadcast\",\n \"args\": {\n \"eventName\": \"@data.changed.object_fields\"\n }\n });\n}, 500);\n\n\n"
242
+ }
243
+ ]
244
+ }
245
+ }
246
+ }
247
+ ],
248
+ "showCloseButton": true,
249
+ "showErrorMsg": true,
250
+ "showLoading": true,
251
+ "closeOnEsc": false,
252
+ "dataMapSwitch": false,
253
+ "size": "md",
254
+ "id": "u:066b3884bdd8"
255
+ }
256
+ }
257
+ ]
200
258
  }
201
- ],
202
- "placement": "bottomRight",
203
- "overlayClassName": "shadow !min-w-[160px]",
204
- "trigger": [
205
- "click"
206
- ],
207
- "id": "u:c2140a365019",
208
- "mode": "edit",
209
- "className": "mr-7 w-fit h-fit opacity-0"
259
+ }
210
260
  }
211
261
  ],
212
262
  "bodyClassName": "h-7 flex justify-between items-center p-0 pl-10 my-2",
213
- "toolbar": [ ],
263
+ "toolbar": [
264
+ ],
214
265
  "className": "mb-0 border-0 bg-none card",
215
266
  "id": "u:296298da1bef"
216
267
  },
@@ -237,7 +288,7 @@
237
288
  "headers": {
238
289
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
239
290
  },
240
- "requestAdaptor": "var graphqlOrder = \"\";\n//根据groups,修改对象的字段分组field_groups\nvar field_groups = _.cloneDeep(api.data.groups);\n_.remove(field_groups, { is_default: true });\nfield_groups = field_groups.map(function (group) {\n return _.omit(group, 'id');\n})\nconst groupOrder = 'upsert0:objects__upsert(id:\"' + api.data.$self.designObjectId + '\" , doc:' + JSON.stringify(JSON.stringify({ field_groups })) + ') {_id}';\ngraphqlOrder += groupOrder;\n\n//根据design_field,修改对象字段的sort_no与groups\nvar index = 1;\n_.forEach(api.data.design_field, function (items, key) {\n _.forEach(items, function (item) {\n const field = _.find(api.data.fields, { 'id': item });\n const itemOrder = 'upsert' + index + ':object_fields__upsert(id:\"' + item + '\" , doc:' + JSON.stringify(JSON.stringify({ object: api.data.$self.designObjectName, _name: field._name, label: field.label, sort_no: index * 10, group: key == \"未分组\" ? null : key })) + '){_id}\\n';\n graphqlOrder += itemOrder;\n index++;\n })\n})\n\ngraphqlOrder = 'mutation {' + graphqlOrder + '}';\nreturn {\n ...api,\n data: {\n query: graphqlOrder\n }\n}",
291
+ "requestAdaptor": "var graphqlOrder = \"\";\n//先修改字段,使系统对象自行自定义\n//根据design_field,修改对象字段的sort_no与groups\nvar index = 1;\n_.forEach(api.data.design_field, function (items, key) {\n let group = key;\n if (key == \"未分组\" || key == \"隐藏\") {\n group = null;\n }\n _.forEach(items, function (item) {\n const field = _.find(api.data.fields, { 'id': item });\n //如果是在隐藏分组里的字段,就给visible_on属性赋予{{false}};如果不在隐藏分组里,就判断来自数据库内的visible_on属性是不是{{false}},是就清除,不是就保持不变\n const visible_on = key == \"隐藏\" ? \"{{false}}\" : (field.attr_visible_on == \"{{false}}\" ? \"{{true}}\" : field.attr_visible_on);\n let docJson = {\n sort_no: index * 10,\n group, visible_on\n }\n if (field.id == field._id && field.is_system) {\n docJson = {\n object: api.data.$self.designObjectName,\n type: field.type,\n _name: field._name,\n label: field.label,\n sort_no: index * 10,\n group,\n visible_on,\n is_system: field.is_system\n }\n }\n if (key != \"隐藏\") {\n docJson.hidden = false;\n }\n let itemOrder = 'upsert' + index + ':object_fields__upsert(id:\"' + item + '\" , doc:' + JSON.stringify(JSON.stringify(docJson)) + '){_id}\\n';\n graphqlOrder += itemOrder;\n index++;\n })\n})\n\n//根据groups,修改对象的字段分组field_groups\nvar field_groups = _.cloneDeep(api.data.groups);\n_.remove(field_groups, { is_default: true });\n_.remove(field_groups, { is_hidden: true });\nfield_groups = field_groups.map(function (group) {\n return _.omit(group, 'id');\n})\nconst keys = _.keys(api.data.design_field);\nfield_groups = _.sortBy(field_groups, function (group) { return _.findIndex(keys, function (key) { return key == group.group_name }) });\nconst groupOrder = 'upsert0:objects__upsert(id:\"' + api.data.$self.designObjectId + '\" , doc:' + JSON.stringify(JSON.stringify({ field_groups, name: api.data.$self.designObjectName })) + ') {_id}';\ngraphqlOrder += groupOrder;\n\n\ngraphqlOrder = 'mutation {' + graphqlOrder + '}';\nreturn {\n ...api,\n data: {\n query: graphqlOrder\n }\n}",
241
292
  "adaptor": "if (payload.errors) {\n payload.status = 2;\n payload.msg = window.t ? window.t(payload.errors[\n 0\n ].message) : payload.errors[\n 0\n ].message;\n}\nreturn payload;",
242
293
  "messages": {
243
294
  },
@@ -250,7 +301,18 @@
250
301
  },
251
302
  "visibleOn": "${dataInitialed}",
252
303
  "wrapWithPanel": false,
253
- "name": "form_design_form"
304
+ "name": "form_field_design",
305
+ "onEvent": {
306
+ "submitSucc": {
307
+ "weight": 0,
308
+ "actions": [
309
+ {
310
+ "actionType": "custom",
311
+ "script": "setTimeout(() => {\n doAction({\n \"actionType\": \"broadcast\",\n \"args\": {\n \"eventName\": \"@data.changed.object_fields\"\n }\n });\n}, 500);\n\n\n"
312
+ }
313
+ ]
314
+ }
315
+ }
254
316
  }
255
317
  ],
256
318
  "className": "Panel--default max-w-4xl m-auto",
@@ -261,7 +323,7 @@
261
323
  "method": "post",
262
324
  "url": "${context.rootUrl}/graphql?designObjectId=${designObjectId}",
263
325
  "data": {
264
- "query": "{fields:object_fields(filters: [[\"object\",\"=\",\"${designObjectName}\"]],sort: \"sort_no asc\"){_id,label,_name,group,type,sort_no,modified,is_wide,is_system,recordPermissions: _permissions{allowEdit}}}",
326
+ "query": "{fields:object_fields(filters: [[\"object\",\"=\",\"${designObjectName}\"]],sort: \"sort_no asc\"){_id,label,_name,group,type,sort_no,modified,is_wide,is_system,hidden,visible_on,recordPermissions: _permissions{allowEdit}}}",
265
327
  "field_groups": "${field_groups}",
266
328
  "dataInitialed": "${dataInitialed}",
267
329
  "designObjectName": "${designObjectName}",
@@ -274,7 +336,7 @@
274
336
  "messages": {
275
337
  },
276
338
  "requestAdaptor": "",
277
- "adaptor": "//筛选出可编辑的字段\r\n\r\nvar oldFields = _.filter(payload.data.fields, function (obj) { return obj.recordPermissions.allowEdit; });\r\n//将group为空的字段分为未分组的组中\r\noldFields = _.map(oldFields, function (obj) {\r\n obj.originId = obj._id;\r\n if (obj.group === null) {\r\n obj.group = \"未分组\";\r\n }\r\n if (obj.is_system) {\r\n obj._id = api.data.designObjectName + \".\" + obj._name;\r\n }\r\n return obj;\r\n});\r\n\r\n//整合出字段的属性集合\r\nconst fields = oldFields.map((field) => {\r\n return {\r\n \"id\": field._id,\r\n \"_name\": field._name,\r\n \"label\": field.label,\r\n \"_id\": field.originId,\r\n \"columnSpan\": field.is_wide ? 2 : 1\r\n }\r\n})\r\n\r\n//从字段的group属性中,整合出字段分组的属性集合\r\nlet field_groups = _.map(_.uniqBy(oldFields, \"group\"), function (obj) {\r\n return {\r\n \"id\": obj.group,\r\n \"group_name\": obj.group,\r\n \"visible_on\": \"\"\r\n };\r\n});\r\n\r\n//合并对象上的field_groups与字段上的group\r\nconst groups = _.unionBy(api.data.field_groups, field_groups, 'id');\r\n\r\n//判断是否第一次调用接口,不是的话(说明是触发了datachange事件),返回fields与fieldUpdateData\r\nif (api.data.dataInitialed) {\r\n const eventData = api.data.eventData;\r\n let fieldUpdateData = \"\";\r\n const fieldForGroup = api.data.fieldForGroup;\r\n let fieldForGroupLength = 0;\r\n _.forIn(fieldForGroup, function (value, key) {\r\n fieldForGroupLength += value.length;\r\n });\r\n if (fieldForGroupLength < fields.length) {\r\n fieldUpdateData = {\r\n type: \"insert\",\r\n id: eventData.result.data.recordId\r\n }\r\n } else if (fieldForGroupLength > fields.length) {\r\n fieldUpdateData = {\r\n type: \"delete\",\r\n id: eventData._id\r\n }\r\n }\r\n return payload = {\r\n data: {\r\n fields,\r\n fieldUpdateData\r\n }\r\n }\r\n}\r\n\r\n//整合字段与分组的关系\r\nconst oldFieldsInGroups = _.groupBy(oldFields, \"group\");\r\nconst fieldForGroup = _.mapValues(_.groupBy(groups, \"id\"), function (group,key) {\r\n if (oldFieldsInGroups[key]) {\r\n return _.map(oldFieldsInGroups[key], function (obj) {\r\n return obj._id;\r\n });\r\n } else {\r\n return [];\r\n }\r\n});\r\n\r\nreturn payload = {\r\n data: {\r\n fields,\r\n groups,\r\n fieldForGroup,\r\n dataInitialed: true\r\n }\r\n};",
339
+ "adaptor": "//筛选出可编辑的字段\r\nvar oldFields = _.filter(payload.data.fields, function (obj) { return obj.recordPermissions.allowEdit; });\r\n//将group为空的字段分为未分组的组中,将系统字段的_id改为对象名.字段名\r\noldFields = _.map(oldFields, function (obj) {\r\n obj.originId = obj._id;\r\n if (obj.hidden || obj.visible_on == \"{{false}}\") {\r\n obj.group = \"隐藏\";\r\n }else if (obj.group === null) {\r\n obj.group = \"未分组\";\r\n }\r\n if (obj.is_system) {\r\n obj._id = api.data.designObjectName + \".\" + obj._name;\r\n }\r\n return obj;\r\n});\r\n\r\n//整合出字段的属性集合\r\nconst fields = oldFields.map((field) => {\r\n return {\r\n \"id\": field._id,//用与steedos-board组件的关系分辨\r\n \"_name\": field._name,\r\n \"label\": field.label,\r\n \"_id\": field.originId,//用于打开steedos-objectform\r\n \"columnSpan\": field.is_wide ? 2 : 1,\r\n \"is_system\": field.is_system,\r\n \"type\": field.type,\r\n \"attr_visible_on\": field.visible_on\r\n }\r\n})\r\n\r\n//从字段的group属性中,整合出字段分组的属性集合\r\nlet field_groups = _.map(_.uniqBy(oldFields, \"group\"), function (obj) {\r\n return {\r\n \"id\": obj.group,\r\n \"group_name\": obj.group,\r\n \"visible_on\": \"\"\r\n };\r\n});\r\n\r\n//合并对象上的field_groups与字段上的group\r\nlet groups = _.unionBy(api.data.field_groups, field_groups, 'id');\r\n\r\n//判断是否第一次调用接口,不是的话(说明是触发了datachange事件),返回fields与fieldUpdateData\r\nif (api.data.dataInitialed) {\r\n const eventData = api.data.eventData;\r\n let fieldUpdateData = \"\";\r\n const fieldForGroup = api.data.fieldForGroup;\r\n let fieldForGroupLength = 0;\r\n _.forIn(fieldForGroup, function (value, key) {\r\n fieldForGroupLength += value.length;\r\n });\r\n if (fieldForGroupLength < fields.length) {\r\n fieldUpdateData = {\r\n type: \"insert\",\r\n id: eventData.result.data.recordId\r\n }\r\n } else if (fieldForGroupLength > fields.length) {\r\n fieldUpdateData = {\r\n type: \"delete\",\r\n id: eventData._id\r\n }\r\n }\r\n return payload = {\r\n data: {\r\n fields,\r\n fieldUpdateData\r\n }\r\n }\r\n}\r\n\r\n//整合字段与分组的关系\r\nconst oldFieldsInGroups = _.groupBy(oldFields, \"group\");\r\nlet fieldForGroup = _.mapValues(_.groupBy(groups, \"id\"), function (group,key) {\r\n if (oldFieldsInGroups[key]) {\r\n return _.map(oldFieldsInGroups[key], function (obj) {\r\n return obj._id;\r\n });\r\n } else {\r\n return [];\r\n }\r\n});\r\n\r\n//未分组 放在所有分组开头,隐藏 放在所有分组最后\r\nconst defaultGroup = fieldForGroup[\"未分组\"];\r\nconst hiddenGroup = fieldForGroup[\"隐藏\"];\r\ndelete fieldForGroup[\"未分组\"];\r\ndelete fieldForGroup[\"隐藏\"];\r\nfieldForGroup = _.merge({ \"未分组\": defaultGroup }, fieldForGroup, { \"隐藏\": hiddenGroup });\r\n\r\n//根据fieldForGroup调整groups顺序,设置分组与保存时需要groups按照顺序\r\nconst keys = _.keys(fieldForGroup);\r\ngroups = _.sortBy(groups, function (group) { return _.findIndex(keys, function (key) { return key == group.group_name }) });\r\n\r\nreturn payload = {\r\n data: {\r\n fields,\r\n groups,\r\n fieldForGroup,\r\n dataInitialed: true\r\n }\r\n};",
278
340
  "sendOn": "!!this.designObjectId"
279
341
  },
280
342
  "messages": {
@@ -284,7 +346,7 @@
284
346
  "actions": [
285
347
  {
286
348
  "actionType": "custom",
287
- "script": "const fieldForGroup = context.props.data.fieldForGroup;\nconst fieldUpdateData = event.data.fieldUpdateData;\nif (fieldUpdateData && fieldUpdateData.type == \"delete\") {\n _.forIn(fieldForGroup, function (group, group_name) {\n _.remove(group, function (field) {\n return field === fieldUpdateData.id;\n })\n });\n} else if (fieldUpdateData && fieldUpdateData.type == \"insert\") {\n fieldForGroup[\"未分组\"].push(fieldUpdateData.id);\n}\n// doAction({\n// actionType: 'setValue',\n// componentId: \"service_field_design\",\n// args: {\n// value: { fieldForGroup }\n// }\n// });\n\ndoAction({\n actionType: 'setValue',\n componentId: \"form_field_design\",\n args: {\n value: { design_field:fieldForGroup }\n }\n});\n\n",
349
+ "script": "\nconst fieldForGroup = context.props.data.fieldForGroup;\nconst fieldUpdateData = event.data.fieldUpdateData;\nif (fieldUpdateData && fieldUpdateData.type == \"delete\") {\n _.forIn(fieldForGroup, function (group, group_name) {\n _.remove(group, function (field) {\n return field === fieldUpdateData.id;\n })\n });\n} else if (fieldUpdateData && fieldUpdateData.type == \"insert\") {\n fieldForGroup[\"未分组\"].push(fieldUpdateData.id);\n}\n// doAction({\n// actionType: 'setValue',\n// componentId: \"service_field_design\",\n// args: {\n// value: { fieldForGroup }\n// }\n// });\n\ndoAction({\n actionType: 'setValue',\n componentId: \"form_field_design\",\n args: {\n value: { design_field:fieldForGroup }\n }\n});\n\n",
288
350
  "expression": "${event.data.fieldUpdateData}"
289
351
  }
290
352
  ]
@@ -309,7 +371,7 @@
309
371
  "messages": {
310
372
  },
311
373
  "requestAdaptor": "",
312
- "adaptor": "const field_groups = payload.data.objects[0] && _.map(payload.data.objects[0].field_groups, function (obj) {\r\n return {\r\n \"id\": obj.group_name,\r\n \"group_name\": obj.group_name,\r\n \"visible_on\": obj.visible_on\r\n }\r\n});\r\nfield_groups.unshift({\r\n id: \"未分组\",\r\n group_name: \"未分组\",\r\n visible_on: \"\",\r\n is_default: true\r\n});\r\nconst designObjectId = payload.data.objects[0] && payload.data.objects[0]._id;\r\nreturn payload = {\r\n data: {\r\n field_groups,\r\n designObjectId,\r\n designObjectLabel: payload.data.objects[0] && payload.data.objects[0].label,\r\n _master: {\r\n recordId: designObjectId\r\n }\r\n }\r\n}"
374
+ "adaptor": "const field_groups = payload.data.objects[0] && _.map(payload.data.objects[0].field_groups, function (obj) {\r\n return {\r\n \"id\": obj.group_name,\r\n \"group_name\": obj.group_name,\r\n \"visible_on\": obj.visible_on\r\n }\r\n});\r\nfield_groups.unshift({\r\n id: \"隐藏\",\r\n group_name: \"隐藏\",\r\n visible_on: \"\",\r\n is_hidden: true\r\n});\r\nfield_groups.unshift({\r\n id: \"未分组\",\r\n group_name: \"未分组\",\r\n visible_on: \"\",\r\n is_default: true\r\n});\r\n\r\n\r\n\r\nconst designObjectId = payload.data.objects[0] && payload.data.objects[0]._id;\r\nreturn payload = {\r\n data: {\r\n field_groups,\r\n designObjectId,\r\n designObjectLabel: payload.data.objects[0] && payload.data.objects[0].label,\r\n _master: {\r\n recordId: designObjectId\r\n }\r\n }\r\n}"
313
375
  },
314
376
  "messages": {
315
377
  },
@@ -341,12 +403,16 @@
341
403
  },
342
404
  "id": "u:993ee4316643",
343
405
  "css": {
344
- ".steedos-design-field li.p-1:hover .opacity-0": {
345
- "opacity": "0.99"
346
- },
347
406
  ".antd-TplField p": {
348
407
  "margin": "0.625rem 0.625rem"
408
+ },
409
+ ".steedos-design-field li.p-1 .field-amplify:hover": {
410
+ "font-size": "17px"
349
411
  }
350
412
  },
351
- "className": "steedos-design-field"
413
+ "className": "steedos-design-field",
414
+ "asideResizor": false,
415
+ "pullRefresh": {
416
+ "disabled": true
417
+ }
352
418
  }
@@ -125,18 +125,18 @@
125
125
  ]
126
126
  },
127
127
  {
128
- "title": "${'objects_amis_process_mapping' | t}",
128
+ "title": "${'objects_amis_object_workflows' | t}",
129
+ "hiddenOn": "${_master.record.enable_workflow != true}",
129
130
  "body": [
130
131
  {
131
132
  "type": "steedos-object-related-listview",
132
133
  "objectApiName": "objects",
133
134
  "recordId": "${recordId}",
134
135
  "relatedObjectApiName": "object_workflows",
135
- "perPage": 20,
136
- "id": "u:e14df76cfa51"
136
+ "relatedKey": "object_name",
137
+ "perPage": 20
137
138
  }
138
- ],
139
- "id": "u:cbc13e1a7033"
139
+ ]
140
140
  },
141
141
  {
142
142
  "title": "${'objects_amis_validation_rule' | t}",
@@ -175,20 +175,6 @@
175
175
  "perPage": 20
176
176
  }
177
177
  ]
178
- },
179
- {
180
- "title": "${'objects_amis_object_workflows' | t}",
181
- "hiddenOn": "${_master.record.enable_workflow != true}",
182
- "body": [
183
- {
184
- "type": "steedos-object-related-listview",
185
- "objectApiName": "objects",
186
- "recordId": "${recordId}",
187
- "relatedObjectApiName": "object_workflows",
188
- "relatedKey": "object_name",
189
- "perPage": 20
190
- }
191
- ]
192
178
  }
193
179
  ],
194
180
  "id": "u:6a3b45d7adcf",
@@ -3,7 +3,7 @@
3
3
  "body": [
4
4
  {
5
5
  "type": "steedos-object-form",
6
- "label": "对象表单",
6
+ "label": "对象字段表单",
7
7
  "objectApiName": "object_fields",
8
8
  "recordId": "${recordId}",
9
9
  "className": "",
@@ -1,6 +1,6 @@
1
1
  name: object_form
2
2
  is_active: true
3
- label: 对象字段表单
3
+ label: 对象表单
4
4
  object_name: objects
5
5
  pageAssignments:
6
6
  - type: orgDefault
@@ -226,7 +226,11 @@ module.exports = {
226
226
  let fields = await InternalData.getObjectFields(objectName, this.userId, filters.name ? true : false);
227
227
  if(fields){
228
228
  _.each(fields, (field)=>{
229
- this.data.values.push(Object.assign({_id: `${objectName}.${field.name}`}, field))
229
+ if(!_.find(this.data.values, (item)=>{
230
+ return item.object == field.object && item.name == field.name
231
+ })){
232
+ this.data.values.push(Object.assign({_id: `${objectName}.${field.name}`}, field))
233
+ }
230
234
  })
231
235
  // this.data.values = this.data.values.concat(fields)
232
236
  this.data.values = objectql.getSteedosSchema().metadataDriver.find(this.data.values, this.query, this.spaceId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.5.20-beta.8",
3
+ "version": "2.5.20",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -15,5 +15,5 @@
15
15
  },
16
16
  "repository": {},
17
17
  "license": "MIT",
18
- "gitHead": "9501bbf23858aa74a7bb9dcf53f3c7ce4dc765b1"
18
+ "gitHead": "1e2c9a88c8eeddc492481195d2d8c5e3519680e8"
19
19
  }
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 1985-10-26 16:15:00
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-11-10 16:53:59
4
+ * @LastEditors: 孙浩林 sunhaolin@steedos.com
5
+ * @LastEditTime: 2023-11-30 10:13:13
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -114,7 +114,8 @@ module.exports = {
114
114
  }
115
115
  }
116
116
  if(data.is_system){
117
- data = _.pick(data, ['label', 'defaultValue', 'group', 'rows', 'sort_no', 'is_wide', 'index', 'sortable', 'searchable', 'filterable', 'visible_on', 'inlineHelpText', 'description', 'amis', 'required'])
117
+ // 'label' 先禁止编辑label , 目前由于i18n的问题导致 label无效.
118
+ data = _.pick(data, ['defaultValue', 'group', 'rows', 'sort_no', 'is_wide', 'index', 'sortable', 'searchable', 'filterable', 'visible_on', 'inlineHelpText', 'description', 'amis', 'required', 'unique', 'readonly', 'hidden', 'deleted_lookup_record_behavior']);
118
119
  }
119
120
  return object.update(id, data, userSession)
120
121
  },