@steedos/service-plugin-amis 2.4.0-beta.16 → 2.4.0-beta.19

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.
@@ -161,17 +161,6 @@
161
161
  "clearValueOnHidden": true,
162
162
  "fieldName": "operation",
163
163
  "id": "u:627e520855b5",
164
- "onEvent": {
165
- "change": {
166
- "weight": 0,
167
- "actions": [
168
- {
169
- "actionType": "custom",
170
- "script": "/* 自定义JS使用说明: \n * 1.动作执行函数doAction,可以执行所有类型的动作\n * 2.通过上下文对象context可以获取当前组件实例,例如context.props可以获取该组件相关属性\n * 3.事件对象event,在doAction之后执行event.stopPropagation = true;可以阻止后续动作执行\n*/\n\nconst current_field_name = context.props.name;\nconst current_field_label = context.props.label;\nconst formData = context.props.data;\nconst current_field_value = formData[current_field_name];\n\nif (current_field_value === 'literal') {\n const target_object_name = formData.object_name;\n const target_field_name = formData.field_name;\n const target_object_uiSchema = Creator.getObject(target_object_name);\n const target_fields = target_object_uiSchema && target_object_uiSchema.fields;\n const target_field_type = target_fields && target_fields[target_field_name].type;\n let literal_value_schema = {\n \"type\": \"text\",\n \"name\": \"literal_value\",\n \"label\": \"指定新字段值\",\n \"required\": false,\n \"is_wide\": true,\n \"labelClassName\": \"text-left\"\n }\n if (target_field_type) {\n literal_value_schema = Object.assign({}, target_object_uiSchema.fields[target_field_name], {\n name: \"literal_value\",\n label: \"指定新字段值\",\n disabled: false,\n readonly: false,\n is_wide: true\n });\n doAction({\n actionType: 'setValue',\n componentId: 'service-action_field_updates-form-edit',\n args: {\n value: {\n literal_value_schema\n }\n }\n });\n }\n}\n\n"
171
- }
172
- ]
173
- }
174
- },
175
164
  "multiple": false
176
165
  },
177
166
  {
@@ -188,13 +177,22 @@
188
177
  "hiddenOn": "this.operation != 'formula'"
189
178
  },
190
179
  {
191
- "type": "steedos-field",
192
- "id": "u:dca4fd13be68",
193
- "name": "literal_value",
194
- "clearValueOnHidden": true,
195
- "fieldName": "literal_value",
196
- "field": "${literal_value_schema}",
197
- "hiddenOn": "this.operation != 'literal' "
180
+ "type": "service",
181
+ "id": "u:d201a629c160",
182
+ "body": [],
183
+ "messages": {},
184
+ "schemaApi": {
185
+ "method": "get",
186
+ "url": "${context.rootUrl}/service/api/@${object_name}/uiSchema?field_name=${field_name}&operation=${operation}",
187
+ "adaptor": "const formData = api.body;\nconst target_field_name = formData.field_name;\nconst target_object_uiSchema = payload;\nconst target_fields = target_object_uiSchema && target_object_uiSchema.fields;\nconst target_field_type = target_fields && target_fields[target_field_name].type;\nlet literal_value_schema = {\n \"type\": \"text\",\n \"name\": \"literal_value\",\n \"label\": \"指定新字段值\",\n \"required\": false,\n \"is_wide\": true,\n \"labelClassName\": \"text-left\"\n}\nif (target_field_type) {\n literal_value_schema = Object.assign({}, target_object_uiSchema.fields[target_field_name], {\n name: \"literal_value\",\n label: \"指定新字段值\",\n disabled: false,\n readonly: false,\n is_wide: true\n });\n}\npayload = {\n \"status\": 0,\n \"msg\": \"\",\n \"data\": {\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"field\": literal_value_schema,\n \"name\": \"literal_value\",\n \"clearValueOnHidden\": true,\n \"fieldName\": \"literal_value\",\n \"visibleOn\": \"this.operation === 'literal'\"\n }\n ]\n }\n}\nreturn payload;",
188
+ "sendOn": "!!this.object_name && !!this.field_name && this.operation === 'literal'",
189
+ "headers": {
190
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
191
+ },
192
+ "data": {
193
+ "&": "$$"
194
+ }
195
+ }
198
196
  },
199
197
  {
200
198
  "name": "description",
@@ -282,19 +280,7 @@
282
280
  }
283
281
  }
284
282
  ],
285
- "initApi": null,
286
- "id": "service-action_field_updates-form-edit",
287
- "data": {
288
- "$": "$$",
289
- "literal_value_schema": {
290
- "type": "text",
291
- "name": "literal_value",
292
- "label": "指定新字段值",
293
- "required": false,
294
- "is_wide": true,
295
- "labelClassName": "text-left"
296
- }
297
- }
283
+ "initApi": null
298
284
  }
299
285
  ],
300
286
  "data": {
@@ -534,7 +534,16 @@
534
534
  "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
535
  }
536
536
  ]
537
- }
537
+ },
538
+ "submitSucc": {
539
+ "weight": 0,
540
+ "actions": [
541
+ {
542
+ "componentId": "listview_apps",
543
+ "actionType": "reload"
544
+ }
545
+ ]
546
+ }
538
547
  },
539
548
  "id": "apps-form"
540
549
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-plugin-amis",
3
- "version": "2.4.0-beta.16",
3
+ "version": "2.4.0-beta.19",
4
4
  "main": "package.service.js",
5
5
  "scripts": {
6
6
  "build": "yarn build:tailwind-base && yarn build:tailwind",
@@ -16,5 +16,8 @@
16
16
  "dependencies": {
17
17
  "@steedos-widgets/amis-lib": "^1.0.10"
18
18
  },
19
- "gitHead": "1a6e749338be48912c63f1019b39294267132e3b"
19
+ "gitHead": "0a5d60be217f234f44dfd83ba5886c6e1bcea082",
20
+ "devDependencies": {
21
+ "tailwindcss": "3.2.4"
22
+ }
20
23
  }
@@ -201,10 +201,6 @@ body.steedos .-translate-x-0 {
201
201
  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))
202
202
  }
203
203
 
204
- body.steedos .transform {
205
- 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))
206
- }
207
-
208
204
  body.steedos .flex-col {
209
205
  flex-direction: column
210
206
  }
@@ -230,6 +226,10 @@ body.steedos .gap-x-3 {
230
226
  column-gap: 0.75rem
231
227
  }
232
228
 
229
+ body.steedos .overflow-hidden {
230
+ overflow: hidden
231
+ }
232
+
233
233
  body.steedos .overflow-y-auto {
234
234
  overflow-y: auto
235
235
  }