@steedos-labs/content-compliance 0.0.37 → 0.0.39
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.
- package/dist/index.js +1 -1
- package/lib/index.js +217 -8
- package/lib/index.js.map +1 -1
- package/lib/methods/approval_engine.js +304 -145
- package/lib/methods/approval_engine.js.map +1 -1
- package/lib/methods/consts.d.ts +21 -5
- package/lib/methods/consts.js +12 -1
- package/lib/methods/consts.js.map +1 -1
- package/lib/methods/material.d.ts +4 -4
- package/lib/methods/material.js +87 -50
- package/lib/methods/material.js.map +1 -1
- package/main/default/objects/pepsico_approval_process/fields/type.field.yml +17 -0
- package/main/default/objects/pepsico_material/buttons/pepsico_material_approve.button.yml +5 -0
- package/main/default/objects/pepsico_material/buttons/pepsico_material_reject.button.yml +5 -0
- package/main/default/objects/pepsico_material/buttons/pepsico_nullify_material.button.yml +5 -0
- package/main/default/objects/pepsico_material/buttons/pepsico_update_material.button.yml +5 -0
- package/main/default/objects/pepsico_material/buttons/pepsico_upload_supplement.button.yml +5 -0
- package/main/default/objects/pepsico_material/fields/download_from_onedrive.field.yml +5 -0
- package/main/default/objects/pepsico_material/fields/remove_share_link_from_onedrive.field.yml +5 -0
- package/main/default/objects/pepsico_material_approval/buttons/kids_approve.button.yml +6 -1
- package/main/default/objects/pepsico_material_approval/buttons/kids_reject.button.yml +6 -1
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_approval.button.yml +5 -0
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_confirm_online.button.yml +10 -5
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_material_upload.button.yml +6 -1
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_postpone_online.button.yml +6 -1
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_submit.button.yml +5 -0
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_terminate.button.yml +5 -0
- package/main/default/objects/pepsico_material_approval/fields/materials_download_from_onedrive_failed_count.field.yml +5 -0
- package/main/default/objects/pepsico_material_approval/fields/materials_download_from_onedrive_status.field.yml +14 -0
- package/main/default/objects/pepsico_material_approval/fields/materials_remove_share_link_from_onedrive_failed_count.field.yml +5 -0
- package/main/default/objects/pepsico_material_approval/fields/materials_remove_share_link_from_onedrive_status.field.yml +14 -0
- package/main/default/triggers/pepsico_material_approval_init.trigger.yml +23 -0
- package/package.json +1 -1
- package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_authorization.button.yml +0 -33
- package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_reject.button.yml +0 -38
- package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_submission.button.yml +0 -38
- package/main/default/objects/pepsico_knowledge_maintain/fields/approval_status.field.yml +0 -23
- package/main/default/objects/pepsico_knowledge_maintain/fields/approver.field.yml +0 -13
|
@@ -12,7 +12,7 @@ amis_schema: |-
|
|
|
12
12
|
"type": "button",
|
|
13
13
|
"label": "驳回",
|
|
14
14
|
"id": "u:pepsico_material_reject",
|
|
15
|
-
"visibleOn": "${kids_reviewer === context.user.user && kids_approval_status
|
|
15
|
+
"visibleOn": "${kids_reviewer === context.user.user && kids_approval_status !== true && kids_approval_status !== false && ARRAYINCLUDES(person_pending_approve, context.user.user) && (current_step == 'departmental_review' || current_step == 'personnel_review')}",
|
|
16
16
|
"editorState": "default",
|
|
17
17
|
"actionType": "ajax",
|
|
18
18
|
"confirmText": "确定要驳回这个材料审批吗?",
|
|
@@ -21,6 +21,11 @@ amis_schema: |-
|
|
|
21
21
|
"click": {
|
|
22
22
|
"weight": 0,
|
|
23
23
|
"actions": [
|
|
24
|
+
{
|
|
25
|
+
"ignoreError": false,
|
|
26
|
+
"actionType": "disabled",
|
|
27
|
+
"componentId": "u:pepsico_material_reject"
|
|
28
|
+
},
|
|
24
29
|
{
|
|
25
30
|
"actionType": "ajax",
|
|
26
31
|
"ignoreError": false,
|
package/main/default/objects/pepsico_material_approval/buttons/pepsico_confirm_online.button.yml
CHANGED
|
@@ -8,7 +8,7 @@ amis_schema: |-
|
|
|
8
8
|
"label": "立即上线",
|
|
9
9
|
"id": "u:pepsico_confirm_online",
|
|
10
10
|
"editorState": "default",
|
|
11
|
-
"visibleOn": "${current_step == 'awaiting_deployment'}",
|
|
11
|
+
"visibleOn": "${owner == context.user.user && current_step == 'awaiting_deployment'}",
|
|
12
12
|
"actionType": "ajax",
|
|
13
13
|
"onEvent": {
|
|
14
14
|
"click": {
|
|
@@ -45,7 +45,7 @@ amis_schema: |-
|
|
|
45
45
|
],
|
|
46
46
|
"id": "u:196d7764fabc",
|
|
47
47
|
"multiple": false,
|
|
48
|
-
"
|
|
48
|
+
"requiredOn": "material_type.includes('223321001114363-2233305175173759') || material_type.includes('223321001114363-223321001114372') || material_type.includes('223321001114363-223321001114381') || material_type.includes('223321001114363-223321001114395') || material_type.includes('2233305104650610-2233305104650637') || material_type.includes('2233305104650610-2233305104650621') || material_type.includes('223321001114468-22334121112868126')"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"type": "tree-select",
|
|
@@ -53,7 +53,7 @@ amis_schema: |-
|
|
|
53
53
|
"name": "fullChannel",
|
|
54
54
|
"id": "u:f537d934666c",
|
|
55
55
|
"visibleOn": "${isAllChannelAuthorized === true}",
|
|
56
|
-
"
|
|
56
|
+
"requiredOn": "material_type.includes('223321001114363-2233305175173759') || material_type.includes('223321001114363-223321001114372') || material_type.includes('223321001114363-223321001114381') || material_type.includes('223321001114363-223321001114395') || material_type.includes('2233305104650610-2233305104650637') || material_type.includes('2233305104650610-2233305104650621') || material_type.includes('223321001114468-22334121112868126')",
|
|
57
57
|
"multiple": false,
|
|
58
58
|
"enableNodePath": true,
|
|
59
59
|
"showIcon": true,
|
|
@@ -69,7 +69,7 @@ amis_schema: |-
|
|
|
69
69
|
"url": "/graphql",
|
|
70
70
|
"method": "post",
|
|
71
71
|
"requestAdaptor": "api.data = { query:`\n query{\n picklists(filters: [[\"code\", \"=\", \"223321022150011\"]]){\n options: _related_picklist_options_picklist{\n label: name, value, , parent: parent__expand{ value }\n }\n }\n }\n `}",
|
|
72
|
-
"adaptor": "const pOptions = payload.data.picklists[0].options;\nlet depth = 0;\nfunction getChildren(value) {\n depth++;\n // 控制递归次数;\n if (depth > 2000) {\n console.log('递归次数过多,请检查数据:', depth, pOptions)\n return [];\n }\n return _.map(_.filter(pOptions, (op) => {\n if (op.label === '部分渠道授权') { \n return false;\n }\n if (value == null) {\n return op.parent == null\n }\n return op.parent && op.parent.value === value;\n }), item => {\n return {\n ...item,\n children: getChildren(item.value || item.label)\n };\n });\n}\nconst options = getChildren(null);\nreturn { options }",
|
|
72
|
+
"adaptor": "const pOptions = payload.data.picklists[0].options;\nlet depth = 0;\nfunction getChildren(value) {\n depth++;\n // 控制递归次数;\n if (depth > 2000) {\n console.log('递归次数过多,请检查数据:', depth, pOptions)\n return [];\n }\n return _.map(_.filter(pOptions, (op) => {\n if (op.label === '部分渠道授权' || op.label === '不授权') { \n return false;\n }\n if (value == null) {\n return op.parent == null\n }\n return op.parent && op.parent.value === value;\n }), item => {\n return {\n ...item,\n children: getChildren(item.value || item.label)\n };\n });\n}\nconst options = getChildren(null);\nreturn { options }",
|
|
73
73
|
"sendOn": "",
|
|
74
74
|
"cache": 86400000,
|
|
75
75
|
"messages": {}
|
|
@@ -90,7 +90,7 @@ amis_schema: |-
|
|
|
90
90
|
"id": "u:32bd0317b1ba",
|
|
91
91
|
"true": false,
|
|
92
92
|
"visibleOn": "${isAllChannelAuthorized === false}",
|
|
93
|
-
"
|
|
93
|
+
"requiredOn": "material_type.includes('223321001114363-2233305175173759') || material_type.includes('223321001114363-223321001114372') || material_type.includes('223321001114363-223321001114381') || material_type.includes('223321001114363-223321001114395') || material_type.includes('2233305104650610-2233305104650637') || material_type.includes('2233305104650610-2233305104650621') || material_type.includes('223321001114468-22334121112868126')",
|
|
94
94
|
"enableNodePath": true,
|
|
95
95
|
"showIcon": true,
|
|
96
96
|
"initiallyOpen": false,
|
|
@@ -160,6 +160,11 @@ amis_schema: |-
|
|
|
160
160
|
"click": {
|
|
161
161
|
"weight": 0,
|
|
162
162
|
"actions": [
|
|
163
|
+
{
|
|
164
|
+
"ignoreError": false,
|
|
165
|
+
"actionType": "disabled",
|
|
166
|
+
"componentId": "u:aa1aeae7b629"
|
|
167
|
+
},
|
|
163
168
|
{
|
|
164
169
|
"actionType": "ajax",
|
|
165
170
|
"ignoreError": false,
|
package/main/default/objects/pepsico_material_approval/buttons/pepsico_material_upload.button.yml
CHANGED
|
@@ -8,7 +8,7 @@ amis_schema: |-
|
|
|
8
8
|
"label": "上传素材",
|
|
9
9
|
"id": "u:pepsico_material_upload",
|
|
10
10
|
"editorState": "default",
|
|
11
|
-
"visibleOn": "${current_step == 'draft' || current_step == 'submitter_revisions' }",
|
|
11
|
+
"visibleOn": "${owner == context.user.user && (current_step == 'draft' || current_step == 'submitter_revisions') }",
|
|
12
12
|
"onEvent": {
|
|
13
13
|
"click": {
|
|
14
14
|
"weight": 0,
|
|
@@ -74,6 +74,11 @@ amis_schema: |-
|
|
|
74
74
|
"click": {
|
|
75
75
|
"weight": 0,
|
|
76
76
|
"actions": [
|
|
77
|
+
{
|
|
78
|
+
"ignoreError": false,
|
|
79
|
+
"actionType": "disabled",
|
|
80
|
+
"componentId": "u:13e69f132b3c"
|
|
81
|
+
},
|
|
77
82
|
{
|
|
78
83
|
"ignoreError": false,
|
|
79
84
|
"actionType": "ajax",
|
package/main/default/objects/pepsico_material_approval/buttons/pepsico_postpone_online.button.yml
CHANGED
|
@@ -8,7 +8,7 @@ amis_schema: |-
|
|
|
8
8
|
"label": "延后上线",
|
|
9
9
|
"id": "u:pepsico_postpone_online",
|
|
10
10
|
"editorState": "default",
|
|
11
|
-
"visibleOn": "${current_step == 'awaiting_deployment'}",
|
|
11
|
+
"visibleOn": "${owner == context.user.user && current_step == 'awaiting_deployment'}",
|
|
12
12
|
"onEvent": {
|
|
13
13
|
"click": {
|
|
14
14
|
"weight": 0,
|
|
@@ -52,6 +52,11 @@ amis_schema: |-
|
|
|
52
52
|
"click": {
|
|
53
53
|
"weight": 0,
|
|
54
54
|
"actions": [
|
|
55
|
+
{
|
|
56
|
+
"ignoreError": false,
|
|
57
|
+
"actionType": "disabled",
|
|
58
|
+
"componentId": "u:0d820c2753bd"
|
|
59
|
+
},
|
|
55
60
|
{
|
|
56
61
|
"ignoreError": false,
|
|
57
62
|
"actionType": "ajax",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: materials_download_from_onedrive_status
|
|
2
|
+
type: select
|
|
3
|
+
label: 从OneDrive下载素材状态
|
|
4
|
+
defaultValue: not_started
|
|
5
|
+
visible_on: '{{false}}'
|
|
6
|
+
options:
|
|
7
|
+
- label: 未开始
|
|
8
|
+
value: not_started
|
|
9
|
+
- label: 等待中
|
|
10
|
+
value: pending
|
|
11
|
+
- label: 完成
|
|
12
|
+
value: completed
|
|
13
|
+
- label: 失败
|
|
14
|
+
value: failed
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: materials_remove_share_link_from_onedrive_status
|
|
2
|
+
type: select
|
|
3
|
+
label: 从OneDrive删除共享连接状态
|
|
4
|
+
defaultValue: not_started
|
|
5
|
+
visible_on: '{{false}}'
|
|
6
|
+
options:
|
|
7
|
+
- label: 未开始
|
|
8
|
+
value: not_started
|
|
9
|
+
- label: 等待中
|
|
10
|
+
value: pending
|
|
11
|
+
- label: 完成
|
|
12
|
+
value: completed
|
|
13
|
+
- label: 失败
|
|
14
|
+
value: failed
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: pepsico_material_approval_init
|
|
2
|
+
listenTo: pepsico_material_approval
|
|
3
|
+
when:
|
|
4
|
+
- beforeInsert
|
|
5
|
+
isEnabled: true
|
|
6
|
+
handler: |-
|
|
7
|
+
const { _ } = global;
|
|
8
|
+
return {
|
|
9
|
+
doc: {
|
|
10
|
+
"current_step": "draft",
|
|
11
|
+
"review_status": "draft",
|
|
12
|
+
"materials_download_from_onedrive_failed_count": 0,
|
|
13
|
+
"materials_download_from_onedrive_status": "not_started",
|
|
14
|
+
"materials_remove_share_link_from_onedrive_failed_count": 0,
|
|
15
|
+
"materials_remove_share_link_from_onedrive_status": "not_started",
|
|
16
|
+
"materials_uploaded_to_onedrive_failed_count": 0,
|
|
17
|
+
"materials_uploaded_to_onedrive_status": "not_started"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
authentication_type: none
|
|
22
|
+
locked: false
|
|
23
|
+
type: code
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
name: pepsico_knowledge_authorization
|
|
2
|
-
amis_schema: |-
|
|
3
|
-
{
|
|
4
|
-
"type": "service",
|
|
5
|
-
"body": [
|
|
6
|
-
{
|
|
7
|
-
"type": "button",
|
|
8
|
-
"label": "核准",
|
|
9
|
-
"id": "u:pepsico_knowledge_authorization",
|
|
10
|
-
"editorState": "default",
|
|
11
|
-
"visibleOn": "${approval_status == 'approving' && approver == context.user.userId}"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"regions": [
|
|
15
|
-
"body"
|
|
16
|
-
],
|
|
17
|
-
"data": {
|
|
18
|
-
"context": {},
|
|
19
|
-
"dataComponentId": "",
|
|
20
|
-
"record_id": "",
|
|
21
|
-
"record": {},
|
|
22
|
-
"permissions": {}
|
|
23
|
-
},
|
|
24
|
-
"id": "u:c80dfe4d5bea",
|
|
25
|
-
"bodyClassName": "p-0",
|
|
26
|
-
"dsType": "api"
|
|
27
|
-
}
|
|
28
|
-
is_enable: true
|
|
29
|
-
label: 核准
|
|
30
|
-
locked: false
|
|
31
|
-
'on': record_only
|
|
32
|
-
type: amis_button
|
|
33
|
-
visible: true
|
package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_reject.button.yml
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
name: pepsico_knowledge_reject
|
|
2
|
-
amis_schema: |-
|
|
3
|
-
{
|
|
4
|
-
"type": "service",
|
|
5
|
-
"body": [
|
|
6
|
-
{
|
|
7
|
-
"type": "button",
|
|
8
|
-
"label": "驳回",
|
|
9
|
-
"id": "u:pepsico_knowledge_reject",
|
|
10
|
-
"editorState": "default",
|
|
11
|
-
"visibleOn": "${approval_status == 'approving' && approver == context.user.userId}"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"regions": [
|
|
15
|
-
"body"
|
|
16
|
-
],
|
|
17
|
-
"data": {
|
|
18
|
-
"context": {},
|
|
19
|
-
"dataComponentId": "",
|
|
20
|
-
"record_id": "",
|
|
21
|
-
"record": {},
|
|
22
|
-
"permissions": {}
|
|
23
|
-
},
|
|
24
|
-
"id": "u:bd6bf9950c12",
|
|
25
|
-
"bodyClassName": "p-0",
|
|
26
|
-
"dsType": "api",
|
|
27
|
-
"asideResizor": false,
|
|
28
|
-
"editorState": "default",
|
|
29
|
-
"pullRefresh": {
|
|
30
|
-
"disabled": true
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
is_enable: true
|
|
34
|
-
label: 驳回
|
|
35
|
-
locked: false
|
|
36
|
-
'on': record_only
|
|
37
|
-
type: amis_button
|
|
38
|
-
visible: true
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
name: pepsico_knowledge_submission
|
|
2
|
-
amis_schema: |-
|
|
3
|
-
{
|
|
4
|
-
"type": "service",
|
|
5
|
-
"body": [
|
|
6
|
-
{
|
|
7
|
-
"type": "button",
|
|
8
|
-
"label": "提交审批",
|
|
9
|
-
"id": "u:pepsico_knowledge_submission",
|
|
10
|
-
"editorState": "default",
|
|
11
|
-
"visibleOn": "${approval_status == 'draft' || approval_status == 'reject'}"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"regions": [
|
|
15
|
-
"body"
|
|
16
|
-
],
|
|
17
|
-
"data": {
|
|
18
|
-
"context": {},
|
|
19
|
-
"dataComponentId": "",
|
|
20
|
-
"record_id": "",
|
|
21
|
-
"record": {},
|
|
22
|
-
"permissions": {}
|
|
23
|
-
},
|
|
24
|
-
"bodyClassName": "p-0",
|
|
25
|
-
"id": "u:e8c007eb2377",
|
|
26
|
-
"dsType": "api",
|
|
27
|
-
"asideResizor": false,
|
|
28
|
-
"editorState": "default",
|
|
29
|
-
"pullRefresh": {
|
|
30
|
-
"disabled": true
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
is_enable: true
|
|
34
|
-
label: 提交审批
|
|
35
|
-
locked: false
|
|
36
|
-
'on': record_only
|
|
37
|
-
type: amis_button
|
|
38
|
-
visible: true
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
name: approval_status
|
|
2
|
-
amis:
|
|
3
|
-
id: 'u:ce038bc0b702'
|
|
4
|
-
data_type: text
|
|
5
|
-
defaultValue: draft
|
|
6
|
-
description: ''
|
|
7
|
-
enable_thousands: true
|
|
8
|
-
filters: []
|
|
9
|
-
group: 通用
|
|
10
|
-
inlineHelpText: ''
|
|
11
|
-
label: 审批状态
|
|
12
|
-
options:
|
|
13
|
-
- label: 草稿
|
|
14
|
-
value: draft
|
|
15
|
-
- label: 审批中
|
|
16
|
-
value: approving
|
|
17
|
-
- label: 核准
|
|
18
|
-
value: approved
|
|
19
|
-
- label: 驳回
|
|
20
|
-
value: reject
|
|
21
|
-
required: true
|
|
22
|
-
sort_no: 450
|
|
23
|
-
type: select
|