@steedos/standard-object-database 2.5.0-beta.24 → 2.5.0-beta.26

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.
@@ -268,7 +268,7 @@ function checkName(name){
268
268
  var reg = new RegExp('^[a-z]([a-z0-9]|_(?!_))*[a-z0-9]$'); //支持表格类型的验证表达式(待优化.$.限制只能出现一次): new RegExp('^[a-z]([a-z0-9]|_(?!_))*(\\.\\$\\.\\w+)*[a-z0-9]$')
269
269
  //TODO 撤销注释
270
270
  if(!reg.test(name)){
271
- throw new Error("名称只能包含小写字母、数字,必须以字母开头,不能以下划线字符结尾或包含两个连续的下划线字符");
271
+ throw new Error("'字段名'只能包含小写字母、数字,必须以字母开头,不能以下划线字符结尾或包含两个连续的下划线字符");
272
272
  }
273
273
  if(name.length > 50){
274
274
  throw new Error("名称长度不能大于50个字符");
@@ -110,6 +110,8 @@ fields:
110
110
  visible_on: "{{['lookup', 'master_detail'].indexOf(formData.type) > -1 ? true: false}}"
111
111
  required: "{{['master_detail'].indexOf(formData.type) > -1 ? true: false}}"
112
112
  sort_no: 180
113
+ amis:
114
+ menuTpl: "<div>${label}(${value})</div>"
113
115
  depend_on:
114
116
  type: lookup
115
117
  group: Advanced
@@ -12,9 +12,7 @@ fields:
12
12
  required: true
13
13
  name:
14
14
  data_type: text
15
- formula: listenTo.name+"_"+_name
16
- formula_blank_value: blanks
17
- type: formula
15
+ type: text
18
16
  visible_on: "{{false}}"
19
17
  listenTo:
20
18
  label: Object
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2021-06-03 15:11:52
4
4
  * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-04-27 17:41:52
5
+ * @LastEditTime: 2023-05-15 09:26:19
6
6
  * @Description:
7
7
  */
8
8
  const Cache = require('@steedos/cachers');
@@ -78,7 +78,8 @@ module.exports = {
78
78
  const count = await objectql.getObject('object_triggers').count({filters: [['_name', '=', doc._name], ['listenTo','=', doc.listenTo]]})
79
79
  if(count > 0){
80
80
  throw new Error('触发器名称不能重复')
81
- }
81
+ }
82
+ doc.name = `${doc.listenTo}_${doc._name}`
82
83
  },
83
84
  beforeUpdate: async function () {
84
85
  const doc = this.doc;
@@ -88,6 +89,7 @@ module.exports = {
88
89
  const count = await objectql.getObject('object_triggers').count({filters: [['_name', '=', doc._name], ['listenTo','=', doc.listenTo], ['_id', '!=', this.id]]})
89
90
  if(count > 0){
90
91
  throw new Error('触发器名称不能重复')
91
- }
92
+ }
93
+ doc.name = `${doc.listenTo}_${doc._name}`
92
94
  }
93
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-object-database",
3
- "version": "2.5.0-beta.24",
3
+ "version": "2.5.0-beta.26",
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": "a12153914810e9e5967827ab0ec01b58a2b3b0cb"
18
+ "gitHead": "8f62fb81db976cfd84586ee18ef6f1e7fbd6a599"
19
19
  }