@steedos/service-plugin-amis 2.4.0-beta.15 → 2.4.0-beta.16
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.
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
console.error(`error`, error)
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
|
|
206
|
+
AmisEnv = {
|
|
207
207
|
// getModalContainer: (props)=>{
|
|
208
208
|
// let div = document.querySelector("#amisModalContainer");
|
|
209
209
|
// if(!div){
|
|
@@ -279,19 +279,61 @@
|
|
|
279
279
|
return scoped = ref
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
|
|
283
|
+
let amisReact = amisRequire('react');
|
|
284
|
+
|
|
285
|
+
amisReact.useEffect(()=>{
|
|
283
286
|
const amisScope = amisRequire('amis/embed').embed(`.steedos-amis-render-scope-${name}`,schema, {data, name, locale: getAmisLng()}, Object.assign({}, AmisEnv, env))
|
|
284
287
|
if(window.SteedosUI && schema.name){
|
|
285
288
|
SteedosUI.refs[schema.name] = amisScope;
|
|
286
289
|
}
|
|
287
290
|
}, [])
|
|
288
|
-
return
|
|
291
|
+
return amisReact.createElement("div", {
|
|
289
292
|
className: "amis-scope"
|
|
290
|
-
},
|
|
293
|
+
}, amisReact.createElement("div", {
|
|
291
294
|
className: `steedos-amis-render-scope-${name}`
|
|
292
295
|
}));
|
|
293
296
|
};
|
|
294
297
|
|
|
298
|
+
window.renderAmis = function (root, schema, data, env) {
|
|
299
|
+
|
|
300
|
+
if(SteedosUI.refs[schema.name]){
|
|
301
|
+
if(SteedosUI.refs[schema.name].unmount){
|
|
302
|
+
SteedosUI.refs[schema.name].unmount()
|
|
303
|
+
}else{
|
|
304
|
+
console.log(`not find amis scope unmount`)
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// if(props.pageType === 'form'){
|
|
309
|
+
// env = Object.assign({
|
|
310
|
+
// getModalContainer: ()=>{
|
|
311
|
+
// return document.querySelector('.amis-scope');
|
|
312
|
+
// }
|
|
313
|
+
// }, env);
|
|
314
|
+
// }
|
|
315
|
+
schema.scopeRef = (ref) => {
|
|
316
|
+
try {
|
|
317
|
+
if(!window.amisScopes){
|
|
318
|
+
window.amisScopes = {};
|
|
319
|
+
}
|
|
320
|
+
if(name){
|
|
321
|
+
window.amisScopes[name] = ref;
|
|
322
|
+
}
|
|
323
|
+
} catch (error) {
|
|
324
|
+
console.error('error', error)
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return scoped = ref
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
const amisScope = amisRequire('amis/embed').embed(root, schema, {data, name, locale: getAmisLng()}, Object.assign({}, AmisEnv, env))
|
|
332
|
+
if(window.SteedosUI && schema.name){
|
|
333
|
+
SteedosUI.refs[schema.name] = amisScope;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
|
|
295
337
|
const initMonaco = ()=>{
|
|
296
338
|
|
|
297
339
|
// const { detect } = require('detect-browser');
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "page",
|
|
3
|
+
"body": [
|
|
4
|
+
{
|
|
5
|
+
"type": "service",
|
|
6
|
+
"className": "p-0",
|
|
7
|
+
"name": "page_edit_${recordId}",
|
|
8
|
+
"api": {
|
|
9
|
+
"method": "post",
|
|
10
|
+
"url": "${context.rootUrl}/graphql",
|
|
11
|
+
"adaptor": "\n if(payload.data.data){\n var data = payload.data.data[0];\n if(data){\n \n \n //初始化接口返回的字段移除字段值为null的字段\n for (key in data){\n if(data[key] === null){\n delete data[key];\n }\n }\n };\n payload.data = data;\n delete payload.extensions;\n }\n return payload;\n ",
|
|
12
|
+
"data": {
|
|
13
|
+
"query": "{data:action_field_updates(filters:[\"_id\", \"=\", \"${recordId}\"]){_id,name,label,object_name,target_object,field_name,operation,formula,literal_value,description,reevaluate_on_change,undirect,created,created_by,modified,modified_by,_display:_ui{object_name,target_object,field_name,operation,reevaluate_on_change,undirect,created,created_by,modified,modified_by}, \n recordPermissions: _permissions{\n allowCreate,\n allowCreateFiles,\n allowDelete,\n allowDeleteFiles,\n allowEdit,\n allowEditFiles,\n allowRead,\n allowReadFiles,\n disabled_actions,\n disabled_list_views,\n field_permissions,\n modifyAllFiles,\n modifyAllRecords,\n modifyAssignCompanysRecords,\n modifyCompanyRecords,\n uneditable_fields,\n unreadable_fields,\n unrelated_objects,\n viewAllFiles,\n viewAllRecords,\n viewAssignCompanysRecords,\n viewCompanyRecords,\n }\n }}"
|
|
14
|
+
},
|
|
15
|
+
"headers": {
|
|
16
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
17
|
+
},
|
|
18
|
+
"sendOn": "!!this.recordId",
|
|
19
|
+
"cache": 100
|
|
20
|
+
},
|
|
21
|
+
"initFetch": null,
|
|
22
|
+
"body": [
|
|
23
|
+
{
|
|
24
|
+
"type": "form",
|
|
25
|
+
"title": "",
|
|
26
|
+
"body": [
|
|
27
|
+
{
|
|
28
|
+
"type": "fieldSet",
|
|
29
|
+
"id": "u:3ce1d050bcac",
|
|
30
|
+
"title": "通用",
|
|
31
|
+
"collapsable": true,
|
|
32
|
+
"body": [
|
|
33
|
+
{
|
|
34
|
+
"name": "name",
|
|
35
|
+
"label": "API 名称",
|
|
36
|
+
"required": true,
|
|
37
|
+
"type": "input-text",
|
|
38
|
+
"className": "m-1",
|
|
39
|
+
"labelClassName": "text-left",
|
|
40
|
+
"clearValueOnHidden": true,
|
|
41
|
+
"fieldName": "name",
|
|
42
|
+
"id": "u:8ebca359c714"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "label",
|
|
46
|
+
"label": "显示名称",
|
|
47
|
+
"required": true,
|
|
48
|
+
"type": "input-text",
|
|
49
|
+
"className": "m-1",
|
|
50
|
+
"labelClassName": "text-left",
|
|
51
|
+
"clearValueOnHidden": true,
|
|
52
|
+
"fieldName": "label",
|
|
53
|
+
"id": "u:124c34a09c5c"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "object_name",
|
|
57
|
+
"label": "对象",
|
|
58
|
+
"required": false,
|
|
59
|
+
"type": "select",
|
|
60
|
+
"joinValues": false,
|
|
61
|
+
"extractValue": true,
|
|
62
|
+
"autoComplete": {
|
|
63
|
+
"method": "post",
|
|
64
|
+
"url": "${context.rootUrl}/graphql",
|
|
65
|
+
"data": {
|
|
66
|
+
"query": "{objects(filters: [\"_id\", \"=\", \"-1\"]){_id}}",
|
|
67
|
+
"$": "$$",
|
|
68
|
+
"$term": "$term",
|
|
69
|
+
"$value": "$object_name._id",
|
|
70
|
+
"rfield": "${object_name}"
|
|
71
|
+
},
|
|
72
|
+
"requestAdaptor": "\n var filters = '[]';\n var top = 10;\n if(api.data.$term){\n filters = '[\"name\", \"contains\", \"'+ api.data.$term +'\"]';\n }else if(api.data.$value){\n filters = '[\"_id\", \"=\", \"'+ api.data.$value +'\"]';\n }\n api.data.query = api.data.query.replace(/{__filters}/g, filters).replace('{__top}', top);\n return api;\n ",
|
|
73
|
+
"adaptor": "\n payload.data.options = eval(function anonymous(\n) {\n\n return Steedos.getObjectsOptions();\n\n})(api.data);\n return payload;\n "
|
|
74
|
+
},
|
|
75
|
+
"className": "m-1",
|
|
76
|
+
"labelClassName": "text-left",
|
|
77
|
+
"clearValueOnHidden": true,
|
|
78
|
+
"fieldName": "object_name",
|
|
79
|
+
"id": "u:0f2e40f882e2"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "target_object",
|
|
83
|
+
"label": "要更新的对象",
|
|
84
|
+
"required": false,
|
|
85
|
+
"type": "select",
|
|
86
|
+
"joinValues": false,
|
|
87
|
+
"extractValue": true,
|
|
88
|
+
"autoComplete": {
|
|
89
|
+
"method": "post",
|
|
90
|
+
"url": "${context.rootUrl}/graphql",
|
|
91
|
+
"data": {
|
|
92
|
+
"query": "{objects(filters: [\"_id\", \"=\", \"-1\"]){_id}}",
|
|
93
|
+
"$": "$$",
|
|
94
|
+
"$term": "$term",
|
|
95
|
+
"$value": "$target_object._id",
|
|
96
|
+
"object_name": "$object_name",
|
|
97
|
+
"rfield": "${object_name}"
|
|
98
|
+
},
|
|
99
|
+
"requestAdaptor": "\n var filters = '[]';\n var top = 10;\n if(api.data.$term){\n filters = '[\"name\", \"contains\", \"'+ api.data.$term +'\"]';\n }else if(api.data.$value){\n filters = '[\"_id\", \"=\", \"'+ api.data.$value +'\"]';\n }\n api.data.query = api.data.query.replace(/{__filters}/g, filters).replace('{__top}', top);\n return api;\n ",
|
|
100
|
+
"adaptor": "\n payload.data.options = eval(function anonymous(doc\n) {\n\n var object = Creator.objectsByName[doc.object_name];\n if(object){\n var _options = [{label: object.label, value: object.name}];\n _.forEach(object.fields, function (field, fname) {\n if(field && field.type === 'master_detail' && _.isString(field.reference_to)){\n var referenceToObject = Creator.objectsByName[field.reference_to];\n if(referenceToObject){\n _options.push({\n label: referenceToObject.label,\n value: field.name,\n });\n }\n }\n });\n return _options;\n }\n return [];\n\n})(api.data);\n return payload;\n "
|
|
101
|
+
},
|
|
102
|
+
"className": "m-1",
|
|
103
|
+
"labelClassName": "text-left",
|
|
104
|
+
"clearValueOnHidden": true,
|
|
105
|
+
"fieldName": "target_object",
|
|
106
|
+
"id": "u:dd1c95753238"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "field_name",
|
|
110
|
+
"label": "要更新的字段",
|
|
111
|
+
"required": false,
|
|
112
|
+
"type": "select",
|
|
113
|
+
"joinValues": false,
|
|
114
|
+
"extractValue": true,
|
|
115
|
+
"autoComplete": {
|
|
116
|
+
"method": "post",
|
|
117
|
+
"url": "${context.rootUrl}/graphql",
|
|
118
|
+
"data": {
|
|
119
|
+
"query": "{objects(filters: [\"_id\", \"=\", \"-1\"]){_id}}",
|
|
120
|
+
"$": "$$",
|
|
121
|
+
"$term": "$term",
|
|
122
|
+
"$value": "$field_name._id",
|
|
123
|
+
"object_name": "$object_name",
|
|
124
|
+
"target_object": "$target_object",
|
|
125
|
+
"rfield": "${object_name}"
|
|
126
|
+
},
|
|
127
|
+
"requestAdaptor": "\n var filters = '[]';\n var top = 10;\n if(api.data.$term){\n filters = '[\"name\", \"contains\", \"'+ api.data.$term +'\"]';\n }else if(api.data.$value){\n filters = '[\"_id\", \"=\", \"'+ api.data.$value +'\"]';\n }\n api.data.query = api.data.query.replace(/{__filters}/g, filters).replace('{__top}', top);\n return api;\n ",
|
|
128
|
+
"adaptor": "\n payload.data.options = eval(function anonymous(doc\n) {\n\n var mainObjectName = null;\n if(doc.target_object && doc.target_object != doc.object_name){\n mainObjectName = Creator.objectsByName[doc.object_name].fields[doc.target_object].reference_to;\n }else{\n mainObjectName = doc.object_name;\n }\n var object = Creator.objectsByName[mainObjectName];\n if(object){\n var _options = [];\n _.forEach(object.fields, function (field, fname) {\n if([\"formula\", \"summary\", \"autonumber\"].indexOf(field.type) < 0){\n /*公式、累计汇总、自动编号三种字段类型是只读的,不允许字段更新来变更其值*/\n _options.push({\n label: field.label,\n value: field.name,\n });\n }\n });\n return _options;\n }\n return [];\n\n})(api.data);\n return payload;\n "
|
|
129
|
+
},
|
|
130
|
+
"className": "m-1",
|
|
131
|
+
"labelClassName": "text-left",
|
|
132
|
+
"clearValueOnHidden": true,
|
|
133
|
+
"fieldName": "field_name",
|
|
134
|
+
"id": "u:204fadb7cef0"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "operation",
|
|
138
|
+
"label": "新字段值类型",
|
|
139
|
+
"required": false,
|
|
140
|
+
"type": "select",
|
|
141
|
+
"joinValues": false,
|
|
142
|
+
"extractValue": true,
|
|
143
|
+
"autoComplete": {
|
|
144
|
+
"method": "post",
|
|
145
|
+
"url": "${context.rootUrl}/graphql",
|
|
146
|
+
"data": {
|
|
147
|
+
"query": "{objects(filters: [\"_id\", \"=\", \"-1\"]){_id}}",
|
|
148
|
+
"$": "$$",
|
|
149
|
+
"$term": "$term",
|
|
150
|
+
"$value": "$operation._id",
|
|
151
|
+
"field_name": "$field_name",
|
|
152
|
+
"target_object": "$target_object",
|
|
153
|
+
"object_name": "$object_name",
|
|
154
|
+
"rfield": "${object_name}"
|
|
155
|
+
},
|
|
156
|
+
"requestAdaptor": "\n var filters = '[]';\n var top = 10;\n if(api.data.$term){\n filters = '[\"name\", \"contains\", \"'+ api.data.$term +'\"]';\n }else if(api.data.$value){\n filters = '[\"_id\", \"=\", \"'+ api.data.$value +'\"]';\n }\n api.data.query = api.data.query.replace(/{__filters}/g, filters).replace('{__top}', top);\n return api;\n ",
|
|
157
|
+
"adaptor": "\n payload.data.options = eval(function anonymous(doc\n) {\n\n var mainObjectName = null;\n if(doc.target_object && doc.target_object != doc.object_name){\n mainObjectName = Creator.objectsByName[doc.object_name].fields[doc.target_object].reference_to;\n }else{\n mainObjectName = doc.object_name;\n }\n var object = Creator.objectsByName[mainObjectName];\n if(object && doc.field_name){\n var _options = [];\n var field = object.fields[doc.field_name];\n if(field && field.type != 'boolean'){\n _options.push({\n label: TAPi18n.__(\"action_field_updates_field_operation_options_null\"),\n value: 'null',\n }) \n }\n _options.push({\n label: TAPi18n.__(\"action_field_updates_field_operation_options_formula\"),\n value: 'formula',\n });\n _options.push({\n label: TAPi18n.__(\"action_field_updates_field_operation_options_literal\"),\n value: 'literal',\n })\n return _options;\n }\n return [];\n\n})(api.data);\n return payload;\n "
|
|
158
|
+
},
|
|
159
|
+
"className": "m-1",
|
|
160
|
+
"labelClassName": "text-left",
|
|
161
|
+
"clearValueOnHidden": true,
|
|
162
|
+
"fieldName": "operation",
|
|
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
|
+
"multiple": false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "formula",
|
|
179
|
+
"label": "公式",
|
|
180
|
+
"required": false,
|
|
181
|
+
"type": "textarea",
|
|
182
|
+
"tpl": "<b><%=data.formula%></b>",
|
|
183
|
+
"className": "col-span-2 m-1",
|
|
184
|
+
"labelClassName": "text-left",
|
|
185
|
+
"clearValueOnHidden": true,
|
|
186
|
+
"fieldName": "formula",
|
|
187
|
+
"id": "u:20766a86a9f4",
|
|
188
|
+
"hiddenOn": "this.operation != 'formula'"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
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' "
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "description",
|
|
201
|
+
"label": "描述",
|
|
202
|
+
"required": false,
|
|
203
|
+
"type": "textarea",
|
|
204
|
+
"tpl": "<b><%=data.description%></b>",
|
|
205
|
+
"className": "col-span-2 m-1",
|
|
206
|
+
"labelClassName": "text-left",
|
|
207
|
+
"clearValueOnHidden": true,
|
|
208
|
+
"fieldName": "description",
|
|
209
|
+
"id": "u:16a7ebd835a6"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "reevaluate_on_change",
|
|
213
|
+
"label": "字段更改后重新评估工作流规则",
|
|
214
|
+
"required": false,
|
|
215
|
+
"type": "checkbox",
|
|
216
|
+
"tpl": null,
|
|
217
|
+
"className": "m-1",
|
|
218
|
+
"labelClassName": "text-left",
|
|
219
|
+
"clearValueOnHidden": true,
|
|
220
|
+
"fieldName": "reevaluate_on_change",
|
|
221
|
+
"id": "u:b9baf683b6b0"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "undirect",
|
|
225
|
+
"label": "触发对象触发器、工作流规则、字段验证规则",
|
|
226
|
+
"required": false,
|
|
227
|
+
"type": "checkbox",
|
|
228
|
+
"tpl": null,
|
|
229
|
+
"className": "m-1",
|
|
230
|
+
"labelClassName": "text-left",
|
|
231
|
+
"clearValueOnHidden": true,
|
|
232
|
+
"fieldName": "undirect",
|
|
233
|
+
"id": "u:b86f699bbe4f"
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"id": "u:f57077c2a95f",
|
|
239
|
+
"mode": "horizontal",
|
|
240
|
+
"persistData": false,
|
|
241
|
+
"promptPageLeave": true,
|
|
242
|
+
"name": "form_edit_${recordId}",
|
|
243
|
+
"debug": false,
|
|
244
|
+
"submitText": "",
|
|
245
|
+
"api": {
|
|
246
|
+
"method": "post",
|
|
247
|
+
"url": "${context.rootUrl}/graphql",
|
|
248
|
+
"data": {
|
|
249
|
+
"objectName": "${objectName}",
|
|
250
|
+
"$": "$$",
|
|
251
|
+
"recordId": "${recordId}",
|
|
252
|
+
"modalName": "${modalName}"
|
|
253
|
+
},
|
|
254
|
+
"requestAdaptor": "\n \n const formData = api.data.$;\n for (key in formData){\n // image、select等字段清空值后保存的空字符串转换为null。\n if(formData[key] === ''){\n formData[key] = null;\n }\n }\n const objectName = api.data.objectName;\n const fieldsName = Object.keys(formData);\n delete formData.created;\n delete formData.created_by;\n delete formData.modified;\n delete formData.modified_by;\n delete formData._display;\n delete formData.created;\r\ndelete formData.created_by;\r\ndelete formData.modified;\r\ndelete formData.modified_by;\n \n \n let query = `mutation{record: ${objectName}__insert(doc: {__saveData}){_id}}`;\n if(formData.recordId && formData.recordId !='new'){\n query = `mutation{record: ${objectName}__update(id: \"${formData._id}\", doc: {__saveData}){_id}}`;\n };\n delete formData._id;\n let __saveData = JSON.stringify(JSON.stringify(formData));\n \n api.data = {query: query.replace('{__saveData}', __saveData)};\n return api;\n ",
|
|
255
|
+
"responseData": {
|
|
256
|
+
"recordId": "${record._id}"
|
|
257
|
+
},
|
|
258
|
+
"adaptor": "\n if(payload.errors){\n payload.status = 2;\n payload.msg = payload.errors[0].message;\n }\n return payload;\n ",
|
|
259
|
+
"headers": {
|
|
260
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"initFetch": true,
|
|
264
|
+
"panelClassName": "m-0 sm:rounded-lg shadow-none",
|
|
265
|
+
"bodyClassName": "p-0",
|
|
266
|
+
"className": "steedos-amis-form",
|
|
267
|
+
"onEvent": {
|
|
268
|
+
"submitSucc": {
|
|
269
|
+
"weight": 0,
|
|
270
|
+
"actions": [
|
|
271
|
+
{
|
|
272
|
+
"componentId": "listview_action_field_updates",
|
|
273
|
+
"actionType": "reload",
|
|
274
|
+
"expression": "!!listViewId"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"actionType": "custom",
|
|
278
|
+
"script": "\n const { recordId, listViewId } = context.props.data;\n const data = event.data;\n const appId = data.appId;\n const objectName = data.objectName;\n // 在记录详细界面时isRecordDetail为true\n // TODO: isRecordDetail这个判断需要优化\n const isRecordDetail = !!data.$master && data.$master.$master?.recordId;\n if(recordId){\n // 编辑记录时,刷新主表单\n doAction({\n componentId: `detail_${recordId}`,\n actionType: \"reload\",\n expression: `!${listViewId}`\n });\n }\n else if(!isRecordDetail){\n // 在列表视图界面新建记录时跳转到详细页面\n const jumpTo = event.context.env && event.context.env.jumpTo;\n if(jumpTo){\n const newRecordId = data.result.data?.recordId;\n jumpTo(\"/app/\" + appId + \"/\" + objectName + \"/view/\" + newRecordId);\n }\n }\n "
|
|
279
|
+
}
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
],
|
|
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
|
+
}
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"data": {
|
|
301
|
+
"objectName": "action_field_updates",
|
|
302
|
+
"context": {}
|
|
303
|
+
},
|
|
304
|
+
"regions": [
|
|
305
|
+
"body"
|
|
306
|
+
],
|
|
307
|
+
"bodyClassName": ""
|
|
308
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "2.4.0-beta.
|
|
3
|
+
"version": "2.4.0-beta.16",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@steedos-widgets/amis-lib": "^1.0.10"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "1a6e749338be48912c63f1019b39294267132e3b"
|
|
20
20
|
}
|
|
@@ -54,10 +54,6 @@ body.steedos .absolute {
|
|
|
54
54
|
position: absolute
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
body.steedos .relative {
|
|
58
|
-
position: relative
|
|
59
|
-
}
|
|
60
|
-
|
|
61
57
|
body.steedos .sticky {
|
|
62
58
|
position: sticky
|
|
63
59
|
}
|
|
@@ -85,14 +81,14 @@ body.steedos .col-span-2 {
|
|
|
85
81
|
grid-column: span 2 / span 2
|
|
86
82
|
}
|
|
87
83
|
|
|
88
|
-
body.steedos .m-0 {
|
|
89
|
-
margin: 0px
|
|
90
|
-
}
|
|
91
|
-
|
|
92
84
|
body.steedos .m-1 {
|
|
93
85
|
margin: 0.25rem
|
|
94
86
|
}
|
|
95
87
|
|
|
88
|
+
body.steedos .m-0 {
|
|
89
|
+
margin: 0px
|
|
90
|
+
}
|
|
91
|
+
|
|
96
92
|
body.steedos .mx-4 {
|
|
97
93
|
margin-left: 1rem;
|
|
98
94
|
margin-right: 1rem
|
|
@@ -328,6 +324,10 @@ body.steedos .pb-16 {
|
|
|
328
324
|
padding-bottom: 4rem
|
|
329
325
|
}
|
|
330
326
|
|
|
327
|
+
body.steedos .pb-4 {
|
|
328
|
+
padding-bottom: 1rem
|
|
329
|
+
}
|
|
330
|
+
|
|
331
331
|
body.steedos .pl-1\.5 {
|
|
332
332
|
padding-left: 0.375rem
|
|
333
333
|
}
|
|
@@ -369,6 +369,12 @@ body.steedos .underline {
|
|
|
369
369
|
text-decoration-line: underline
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
body.steedos .shadow-none {
|
|
373
|
+
--tw-shadow: 0 0 #0000;
|
|
374
|
+
--tw-shadow-colored: 0 0 #0000;
|
|
375
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)
|
|
376
|
+
}
|
|
377
|
+
|
|
372
378
|
body.steedos .filter {
|
|
373
379
|
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)
|
|
374
380
|
}
|
|
@@ -414,6 +420,10 @@ body.steedos .ease-in-out {
|
|
|
414
420
|
border-radius: 0.25rem
|
|
415
421
|
}
|
|
416
422
|
|
|
423
|
+
body.steedos .sm\:rounded-lg {
|
|
424
|
+
border-radius: 0.5rem
|
|
425
|
+
}
|
|
426
|
+
|
|
417
427
|
body.steedos .sm\:border {
|
|
418
428
|
border-width: 1px
|
|
419
429
|
}
|