@steedos-labs/plugin-workflow 3.0.0-beta.15 → 3.0.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.
|
@@ -631,7 +631,7 @@ actions:
|
|
|
631
631
|
"requestAdaptor": "\n var filters = [];\n var top = 1000;\n if(api.data.$term){\n filters = [[\"label\", \"contains\", api.data.$term]];\n }\n // else if(api.data.$value){\n // filters = [[\"_id\", \"=\", api.data.$value]];\n // }\n\n var fieldFilters = [\"enable_workflow\",\"=\",true];\n if(fieldFilters && fieldFilters.length){\n filters.push(fieldFilters);\n }\n\n const filtersFunction = undefined;\n\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data.$);\n if(_filters && _filters.length > 0){\n filters.push(_filters);\n }\n }\n var sort = \"\";\n api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', top).replace('{__sort}', sort.trim());\n\n var defaultValue = api.data.$value;\n var optionsFiltersOp = \"=\";\n var optionsFilters = [[\"name\", optionsFiltersOp, []]];\n if (defaultValue && !api.data.$term) { \n // 字段值单独请求,没值的时候在请求中返回空\n optionsFilters = [[\"name\", optionsFiltersOp, defaultValue]];\n }\n api.data.query = api.data.query.replace(/{__options_filters}/g, JSON.stringify(optionsFilters));\n return api;\n "
|
|
632
632
|
},
|
|
633
633
|
"multiple": false
|
|
634
|
-
}
|
|
634
|
+
}
|
|
635
635
|
],
|
|
636
636
|
"api": {
|
|
637
637
|
"method": "post",
|
|
@@ -640,7 +640,7 @@ actions:
|
|
|
640
640
|
"&": "$$",
|
|
641
641
|
"space": "${spaceId}"
|
|
642
642
|
},
|
|
643
|
-
"requestAdaptor": "const {id, name, space
|
|
643
|
+
"requestAdaptor": "const {id, name, space} = api.body;var form = {\n id,\n name,\n space,\n is_valid: true,\n app: 'workflow',\n current: {\n id\n }\n\n};\nvar body = api.body;\nif (body.category) {\n form.category = body.category\n}\n\nlet companyId = body.company_id\nif (companyId) {\n form.company_id = companyId\n}\n\nif (body.object_name2) {\n form.object_name = body.object_name2\n}\n\napi.data = {\n Forms: [form]\n};\n\nconsole.log(`api`, api)\nreturn api;"
|
|
644
644
|
},
|
|
645
645
|
"onEvent": {
|
|
646
646
|
"submitSucc": {
|
|
@@ -796,8 +796,8 @@ actions:
|
|
|
796
796
|
todo: !<tag:yaml.org,2002:js/function> |-
|
|
797
797
|
function (object_name, record_id, fields, data) {
|
|
798
798
|
var record = data && data.record;
|
|
799
|
-
var userSession =
|
|
800
|
-
var authorization = "Bearer " + userSession.spaceId + "," + userSession.
|
|
799
|
+
var userSession = Builder.settings.context.user;
|
|
800
|
+
var authorization = "Bearer " + userSession.spaceId + "," + userSession.authToken;
|
|
801
801
|
var formId = _.isObject(record.form) ? record.form._id : record.form;
|
|
802
802
|
window.$.ajax({
|
|
803
803
|
type: "POST",
|
|
@@ -22,6 +22,21 @@ fields:
|
|
|
22
22
|
readonly: true
|
|
23
23
|
name: state
|
|
24
24
|
filterable: true
|
|
25
|
+
style:
|
|
26
|
+
type: select
|
|
27
|
+
label: Style
|
|
28
|
+
options:
|
|
29
|
+
- label: Table
|
|
30
|
+
value: table
|
|
31
|
+
- label: Groups
|
|
32
|
+
value: groups
|
|
33
|
+
- label: Tabs
|
|
34
|
+
value: tabs
|
|
35
|
+
- label: Wizard
|
|
36
|
+
value: wizard
|
|
37
|
+
readonly: true
|
|
38
|
+
name: style
|
|
39
|
+
filterable: true
|
|
25
40
|
description:
|
|
26
41
|
type: textarea
|
|
27
42
|
label: Description
|
|
@@ -524,6 +524,9 @@ module.exports = {
|
|
|
524
524
|
// 数据库更新操作:将forms表current的fields字段更新为最终数组
|
|
525
525
|
form.current.fields = getFinalFormFields(inputFields);
|
|
526
526
|
form.current.amis_schema = amis_schema;
|
|
527
|
+
form.current.style = formSchema.style;
|
|
528
|
+
form.style = formSchema.style;
|
|
529
|
+
form.description = formSchema.description;
|
|
527
530
|
|
|
528
531
|
// 以下为将解析字段存储的功能,为将解析字段存储至数据库forms表的功能
|
|
529
532
|
let updatedForms = [];
|
|
@@ -221,6 +221,7 @@ async function updateForm(formId, form, forms, flows, currentUserId) {
|
|
|
221
221
|
current.fields = _formatFieldsID(form["current"]["fields"]);
|
|
222
222
|
current.form_script = form["current"]["form_script"];
|
|
223
223
|
current.name_forumla = form["current"]["name_forumla"];
|
|
224
|
+
current.style = form["current"]["style"];
|
|
224
225
|
|
|
225
226
|
formUpdateObj.$set = {
|
|
226
227
|
'current': current,
|
|
@@ -228,6 +229,7 @@ async function updateForm(formId, form, forms, flows, currentUserId) {
|
|
|
228
229
|
'modified': now,
|
|
229
230
|
'modified_by': currentUserId,
|
|
230
231
|
'is_valid': form["is_valid"],
|
|
232
|
+
'style': form["style"],
|
|
231
233
|
'description': form["description"],
|
|
232
234
|
'help_text': form["help_text"],
|
|
233
235
|
'error_message': form["error_message"],
|