@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.
Files changed (38) hide show
  1. package/dist/index.js +1 -1
  2. package/lib/index.js +217 -8
  3. package/lib/index.js.map +1 -1
  4. package/lib/methods/approval_engine.js +304 -145
  5. package/lib/methods/approval_engine.js.map +1 -1
  6. package/lib/methods/consts.d.ts +21 -5
  7. package/lib/methods/consts.js +12 -1
  8. package/lib/methods/consts.js.map +1 -1
  9. package/lib/methods/material.d.ts +4 -4
  10. package/lib/methods/material.js +87 -50
  11. package/lib/methods/material.js.map +1 -1
  12. package/main/default/objects/pepsico_approval_process/fields/type.field.yml +17 -0
  13. package/main/default/objects/pepsico_material/buttons/pepsico_material_approve.button.yml +5 -0
  14. package/main/default/objects/pepsico_material/buttons/pepsico_material_reject.button.yml +5 -0
  15. package/main/default/objects/pepsico_material/buttons/pepsico_nullify_material.button.yml +5 -0
  16. package/main/default/objects/pepsico_material/buttons/pepsico_update_material.button.yml +5 -0
  17. package/main/default/objects/pepsico_material/buttons/pepsico_upload_supplement.button.yml +5 -0
  18. package/main/default/objects/pepsico_material/fields/download_from_onedrive.field.yml +5 -0
  19. package/main/default/objects/pepsico_material/fields/remove_share_link_from_onedrive.field.yml +5 -0
  20. package/main/default/objects/pepsico_material_approval/buttons/kids_approve.button.yml +6 -1
  21. package/main/default/objects/pepsico_material_approval/buttons/kids_reject.button.yml +6 -1
  22. package/main/default/objects/pepsico_material_approval/buttons/pepsico_approval.button.yml +5 -0
  23. package/main/default/objects/pepsico_material_approval/buttons/pepsico_confirm_online.button.yml +10 -5
  24. package/main/default/objects/pepsico_material_approval/buttons/pepsico_material_upload.button.yml +6 -1
  25. package/main/default/objects/pepsico_material_approval/buttons/pepsico_postpone_online.button.yml +6 -1
  26. package/main/default/objects/pepsico_material_approval/buttons/pepsico_submit.button.yml +5 -0
  27. package/main/default/objects/pepsico_material_approval/buttons/pepsico_terminate.button.yml +5 -0
  28. package/main/default/objects/pepsico_material_approval/fields/materials_download_from_onedrive_failed_count.field.yml +5 -0
  29. package/main/default/objects/pepsico_material_approval/fields/materials_download_from_onedrive_status.field.yml +14 -0
  30. package/main/default/objects/pepsico_material_approval/fields/materials_remove_share_link_from_onedrive_failed_count.field.yml +5 -0
  31. package/main/default/objects/pepsico_material_approval/fields/materials_remove_share_link_from_onedrive_status.field.yml +14 -0
  32. package/main/default/triggers/pepsico_material_approval_init.trigger.yml +23 -0
  33. package/package.json +1 -1
  34. package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_authorization.button.yml +0 -33
  35. package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_reject.button.yml +0 -38
  36. package/main/default/objects/pepsico_knowledge_maintain/buttons/pepsico_knowledge_submission.button.yml +0 -38
  37. package/main/default/objects/pepsico_knowledge_maintain/fields/approval_status.field.yml +0 -23
  38. 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 != true && kids_approval_status != false && ARRAYINCLUDES(person_pending_approve, context.user.user) && (current_step == 'departmental_review' || current_step == 'personnel_review')}",
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,
@@ -84,6 +84,11 @@ amis_schema: |-
84
84
  "click": {
85
85
  "weight": 0,
86
86
  "actions": [
87
+ {
88
+ "ignoreError": false,
89
+ "actionType": "disabled",
90
+ "componentId": "u:adc7dd843581"
91
+ },
87
92
  {
88
93
  "ignoreError": false,
89
94
  "actionType": "ajax",
@@ -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
- "requiredO": "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')"
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
- "requiredO": "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')",
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
- "requiredO": "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')",
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,
@@ -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",
@@ -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",
@@ -16,6 +16,11 @@ amis_schema: |-
16
16
  "click": {
17
17
  "weight": 0,
18
18
  "actions": [
19
+ {
20
+ "ignoreError": false,
21
+ "actionType": "disabled",
22
+ "componentId": "u:pepsico_submit"
23
+ },
19
24
  {
20
25
  "actionType": "ajax",
21
26
  "ignoreError": false,
@@ -104,6 +104,11 @@ amis_schema: |-
104
104
  "click": {
105
105
  "weight": 0,
106
106
  "actions": [
107
+ {
108
+ "ignoreError": false,
109
+ "actionType": "disabled",
110
+ "componentId": "u:923ba27e2471"
111
+ },
107
112
  {
108
113
  "componentId": "u:a00aca5cd32e",
109
114
  "ignoreError": false,
@@ -0,0 +1,5 @@
1
+ name: materials_download_from_onedrive_failed_count
2
+ type: number
3
+ label: 从OneDrive下载素材状态失败次数
4
+ visible_on: '{{false}}'
5
+ defaultValue: 0
@@ -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,5 @@
1
+ name: materials_remove_share_link_from_onedrive_failed_count
2
+ type: number
3
+ label: 从OneDrive删除共享连接失败次数
4
+ visible_on: '{{false}}'
5
+ defaultValue: 0
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-labs/content-compliance",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "内容审核系统",
5
5
  "main": "package.service.js",
6
6
  "scripts": {
@@ -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
@@ -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
@@ -1,13 +0,0 @@
1
- name: approver
2
- amis:
3
- id: 'u:08567338f3e3'
4
- description: ''
5
- enable_thousands: true
6
- group: 通用
7
- inlineHelpText: ''
8
- label: 审批人
9
- reference_to: space_users
10
- reference_to_field: user
11
- required: true
12
- sort_no: 350
13
- type: lookup