@steedos-labs/content-compliance 0.8.35 → 1.0.0

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 (164) hide show
  1. package/dist/index.js +1 -1
  2. package/lib/actions/contentHubMaterialGroups.d.ts +19 -0
  3. package/lib/actions/contentHubMaterialGroups.js +70 -0
  4. package/lib/actions/contentHubMaterialGroups.js.map +1 -0
  5. package/lib/actions/contentHubSyncPreview.d.ts +21 -0
  6. package/lib/actions/contentHubSyncPreview.js +51 -0
  7. package/lib/actions/contentHubSyncPreview.js.map +1 -0
  8. package/lib/actions/contentHubTagValues.d.ts +12 -0
  9. package/lib/actions/contentHubTagValues.js +70 -0
  10. package/lib/actions/contentHubTagValues.js.map +1 -0
  11. package/lib/actions/index.d.ts +3 -0
  12. package/lib/actions/index.js +3 -0
  13. package/lib/actions/index.js.map +1 -1
  14. package/lib/actions/sendToContentHub.js +1 -1
  15. package/lib/actions/sendToContentHub.js.map +1 -1
  16. package/lib/actions/spotCheckMaterial.js +3 -1
  17. package/lib/actions/spotCheckMaterial.js.map +1 -1
  18. package/lib/index.js +173 -30
  19. package/lib/index.js.map +1 -1
  20. package/lib/methods/__tests__/contentHubMaterialGroup.test.d.ts +1 -0
  21. package/lib/methods/__tests__/contentHubMaterialGroup.test.js +97 -0
  22. package/lib/methods/__tests__/contentHubMaterialGroup.test.js.map +1 -0
  23. package/lib/methods/__tests__/contentHubMaterialGroupRule.test.d.ts +1 -0
  24. package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js +131 -0
  25. package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js.map +1 -0
  26. package/lib/methods/__tests__/contentHubPush.test.d.ts +1 -0
  27. package/lib/methods/__tests__/contentHubPush.test.js +279 -0
  28. package/lib/methods/__tests__/contentHubPush.test.js.map +1 -0
  29. package/lib/methods/__tests__/contentHubSyncRule.test.d.ts +1 -0
  30. package/lib/methods/__tests__/contentHubSyncRule.test.js +130 -0
  31. package/lib/methods/__tests__/contentHubSyncRule.test.js.map +1 -0
  32. package/lib/methods/__tests__/contentHubTagSync.test.d.ts +1 -0
  33. package/lib/methods/__tests__/contentHubTagSync.test.js +743 -0
  34. package/lib/methods/__tests__/contentHubTagSync.test.js.map +1 -0
  35. package/lib/methods/__tests__/tagLabel.test.d.ts +1 -0
  36. package/lib/methods/__tests__/tagLabel.test.js +136 -0
  37. package/lib/methods/__tests__/tagLabel.test.js.map +1 -0
  38. package/lib/methods/__tests__/voidMaterialReasonTrigger.test.d.ts +1 -0
  39. package/lib/methods/__tests__/voidMaterialReasonTrigger.test.js +315 -0
  40. package/lib/methods/__tests__/voidMaterialReasonTrigger.test.js.map +1 -0
  41. package/lib/methods/approval_engine.js +1 -1
  42. package/lib/methods/approval_engine.js.map +1 -1
  43. package/lib/methods/consts.d.ts +3 -0
  44. package/lib/methods/consts.js.map +1 -1
  45. package/lib/methods/content_hub.d.ts +7 -1
  46. package/lib/methods/content_hub.js +92 -9
  47. package/lib/methods/content_hub.js.map +1 -1
  48. package/lib/methods/content_hub_material_group.d.ts +29 -0
  49. package/lib/methods/content_hub_material_group.js +268 -0
  50. package/lib/methods/content_hub_material_group.js.map +1 -0
  51. package/lib/methods/content_hub_material_group_rule.d.ts +16 -0
  52. package/lib/methods/content_hub_material_group_rule.js +46 -0
  53. package/lib/methods/content_hub_material_group_rule.js.map +1 -0
  54. package/lib/methods/content_hub_sync_rule.d.ts +51 -0
  55. package/lib/methods/content_hub_sync_rule.js +122 -0
  56. package/lib/methods/content_hub_sync_rule.js.map +1 -0
  57. package/lib/methods/content_hub_tag.d.ts +57 -0
  58. package/lib/methods/content_hub_tag.js +830 -0
  59. package/lib/methods/content_hub_tag.js.map +1 -0
  60. package/lib/methods/pls.d.ts +1 -1
  61. package/lib/methods/pls.js +21 -16
  62. package/lib/methods/pls.js.map +1 -1
  63. package/lib/methods/tag_label.d.ts +19 -0
  64. package/lib/methods/tag_label.js +192 -0
  65. package/lib/methods/tag_label.js.map +1 -0
  66. package/main/default/applications/pepsico_content_setting.app.yml +8 -0
  67. package/main/default/objects/pepsico_brand_leader/fields/name.field.yml +2 -0
  68. package/main/default/objects/pepsico_ch_material_group_rule/fields/active.field.yml +6 -0
  69. package/main/default/objects/pepsico_ch_material_group_rule/fields/classification.field.yml +73 -0
  70. package/main/default/objects/pepsico_ch_material_group_rule/fields/name.field.yml +9 -0
  71. package/main/default/objects/pepsico_ch_material_group_rule/fields/orgs.field.yml +10 -0
  72. package/main/default/objects/pepsico_ch_material_group_rule/fields/remark.field.yml +7 -0
  73. package/main/default/objects/pepsico_ch_material_group_rule/listviews/all.listview.yml +18 -0
  74. package/main/default/objects/pepsico_ch_material_group_rule/pepsico_ch_material_group_rule.object.yml +18 -0
  75. package/main/default/objects/pepsico_ch_material_group_rule/permissions/admin.permission.yml +15 -0
  76. package/main/default/objects/pepsico_ch_material_group_rule/permissions/user.permission.yml +14 -0
  77. package/main/default/objects/pepsico_ch_sync_rule/fields/active.field.yml +6 -0
  78. package/main/default/objects/pepsico_ch_sync_rule/fields/classification.field.yml +73 -0
  79. package/main/default/objects/pepsico_ch_sync_rule/fields/kol_classification.field.yml +67 -0
  80. package/main/default/objects/pepsico_ch_sync_rule/fields/name.field.yml +9 -0
  81. package/main/default/objects/pepsico_ch_sync_rule/fields/need_sync.field.yml +11 -0
  82. package/main/default/objects/pepsico_ch_sync_rule/fields/orgs.field.yml +10 -0
  83. package/main/default/objects/pepsico_ch_sync_rule/fields/priority.field.yml +10 -0
  84. package/main/default/objects/pepsico_ch_sync_rule/fields/product.field.yml +65 -0
  85. package/main/default/objects/pepsico_ch_sync_rule/fields/remark.field.yml +7 -0
  86. package/main/default/objects/pepsico_ch_sync_rule/fields/spot_check.field.yml +12 -0
  87. package/main/default/objects/pepsico_ch_sync_rule/listviews/all.listview.yml +24 -0
  88. package/main/default/objects/pepsico_ch_sync_rule/pepsico_ch_sync_rule.object.yml +19 -0
  89. package/main/default/objects/pepsico_ch_sync_rule/permissions/admin.permission.yml +15 -0
  90. package/main/default/objects/pepsico_ch_sync_rule/permissions/user.permission.yml +14 -0
  91. package/main/default/objects/pepsico_ch_tag_sync_log/fields/action.field.yml +6 -0
  92. package/main/default/objects/pepsico_ch_tag_sync_log/fields/changed_at.field.yml +6 -0
  93. package/main/default/objects/pepsico_ch_tag_sync_log/fields/duration.field.yml +6 -0
  94. package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_code.field.yml +6 -0
  95. package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_msg.field.yml +6 -0
  96. package/main/default/objects/pepsico_ch_tag_sync_log/fields/expired_date.field.yml +6 -0
  97. package/main/default/objects/pepsico_ch_tag_sync_log/fields/name.field.yml +7 -0
  98. package/main/default/objects/pepsico_ch_tag_sync_log/fields/parent_tag_val_id.field.yml +6 -0
  99. package/main/default/objects/pepsico_ch_tag_sync_log/fields/request_id.field.yml +7 -0
  100. package/main/default/objects/pepsico_ch_tag_sync_log/fields/result.field.yml +6 -0
  101. package/main/default/objects/pepsico_ch_tag_sync_log/fields/source_ip.field.yml +6 -0
  102. package/main/default/objects/pepsico_ch_tag_sync_log/fields/space.field.yml +6 -0
  103. package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_id.field.yml +6 -0
  104. package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_id.field.yml +7 -0
  105. package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_name.field.yml +6 -0
  106. package/main/default/objects/pepsico_ch_tag_sync_log/listviews/all.listview.yml +21 -0
  107. package/main/default/objects/pepsico_ch_tag_sync_log/pepsico_ch_tag_sync_log.object.yml +16 -0
  108. package/main/default/objects/pepsico_ch_tag_sync_log/permissions/admin.permission.yml +15 -0
  109. package/main/default/objects/pepsico_ch_tag_sync_log/permissions/user.permission.yml +14 -0
  110. package/main/default/objects/pepsico_ch_tag_sync_request/fields/changed_at.field.yml +6 -0
  111. package/main/default/objects/pepsico_ch_tag_sync_request/fields/duration.field.yml +6 -0
  112. package/main/default/objects/pepsico_ch_tag_sync_request/fields/expired_date.field.yml +6 -0
  113. package/main/default/objects/pepsico_ch_tag_sync_request/fields/item_count.field.yml +6 -0
  114. package/main/default/objects/pepsico_ch_tag_sync_request/fields/name.field.yml +7 -0
  115. package/main/default/objects/pepsico_ch_tag_sync_request/fields/request_id.field.yml +7 -0
  116. package/main/default/objects/pepsico_ch_tag_sync_request/fields/response.field.yml +9 -0
  117. package/main/default/objects/pepsico_ch_tag_sync_request/fields/result_code.field.yml +6 -0
  118. package/main/default/objects/pepsico_ch_tag_sync_request/fields/source_ip.field.yml +6 -0
  119. package/main/default/objects/pepsico_ch_tag_sync_request/fields/space.field.yml +6 -0
  120. package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_id.field.yml +6 -0
  121. package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_label.field.yml +6 -0
  122. package/main/default/objects/pepsico_ch_tag_sync_request/listviews/all.listview.yml +19 -0
  123. package/main/default/objects/pepsico_ch_tag_sync_request/pepsico_ch_tag_sync_request.object.yml +16 -0
  124. package/main/default/objects/pepsico_ch_tag_sync_request/permissions/admin.permission.yml +15 -0
  125. package/main/default/objects/pepsico_ch_tag_sync_request/permissions/user.permission.yml +14 -0
  126. package/main/default/objects/pepsico_mail_send_log/fields/product.field.yml +2 -0
  127. package/main/default/objects/pepsico_material/fields/material_type_label.field.yml +10 -0
  128. package/main/default/objects/pepsico_material/fields/product.field.yml +2 -0
  129. package/main/default/objects/pepsico_material/fields/supplement_materials.field.yml +1 -1
  130. package/main/default/objects/pepsico_material_approval/buttons/pepsico_modify_pls.button.yml +1 -1
  131. package/main/default/objects/pepsico_material_approval/fields/available_channels_label.field.yml +10 -0
  132. package/main/default/objects/pepsico_material_approval/fields/ch_material_group.field.yml +56 -0
  133. package/main/default/objects/pepsico_material_approval/fields/ch_material_group_path.field.yml +14 -0
  134. package/main/default/objects/pepsico_material_approval/fields/ch_sync_enabled.field.yml +11 -0
  135. package/main/default/objects/pepsico_material_approval/fields/ch_sync_rule_check.field.yml +55 -0
  136. package/main/default/objects/pepsico_material_approval/fields/content_rule_label.field.yml +10 -0
  137. package/main/default/objects/pepsico_material_approval/fields/ec_check_food_name.field.yml +2 -2
  138. package/main/default/objects/pepsico_material_approval/fields/ec_check_ingredients.field.yml +2 -2
  139. package/main/default/objects/pepsico_material_approval/fields/ec_check_net_content.field.yml +2 -2
  140. package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_address.field.yml +2 -2
  141. package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_name.field.yml +2 -2
  142. package/main/default/objects/pepsico_material_approval/fields/ec_check_shelf_life.field.yml +2 -2
  143. package/main/default/objects/pepsico_material_approval/fields/ec_check_standard_code.field.yml +2 -2
  144. package/main/default/objects/pepsico_material_approval/fields/ec_check_storage_condition.field.yml +2 -2
  145. package/main/default/objects/pepsico_material_approval/fields/ec_has_detail_page.field.yml +1 -1
  146. package/main/default/objects/pepsico_material_approval/fields/ec_producers.field.yml +1 -1
  147. package/main/default/objects/pepsico_material_approval/fields/ec_qc_production_email.field.yml +2 -2
  148. package/main/default/objects/pepsico_material_approval/fields/ec_related_approval.field.yml +1 -1
  149. package/main/default/objects/pepsico_material_approval/fields/form_version.field.yml +6 -2
  150. package/main/default/objects/pepsico_material_approval/fields/has_nutrition_table.field.yml +1 -1
  151. package/main/default/objects/pepsico_material_approval/fields/material_type_label.field.yml +10 -0
  152. package/main/default/objects/pepsico_material_approval/fields/pls_file.field.yml +1 -1
  153. package/main/default/objects/pepsico_material_approval/fields/pls_km_files.field.yml +2 -2
  154. package/main/default/objects/pepsico_material_approval/fields/pls_upload_files.field.yml +1 -1
  155. package/main/default/objects/pepsico_material_approval/fields/product_label.field.yml +10 -0
  156. package/main/default/objects/picklist_options/fields/ch_changed_at.field.yml +8 -0
  157. package/main/default/objects/picklist_options/picklist_options.object.yml +7 -0
  158. package/main/default/tabs/object_pepsico_ch_material_group_rule.tab.yml +8 -0
  159. package/main/default/tabs/object_pepsico_ch_sync_rule.tab.yml +8 -0
  160. package/main/default/triggers/pepsico_material_approval_tag_label.trigger.yml +80 -0
  161. package/main/default/triggers/pepsico_material_tag_label.trigger.yml +77 -0
  162. package/package.json +1 -1
  163. package/scripts/audit-legacy-tags.js +246 -0
  164. package/scripts/probe-content-hub-tags.js +134 -0
@@ -0,0 +1,7 @@
1
+ name: request_id
2
+ group: 通用
3
+ label: requestId
4
+ index: true
5
+ required: false
6
+ sort_no: 200
7
+ type: text
@@ -0,0 +1,9 @@
1
+ name: response
2
+ group: 通用
3
+ label: 首次响应快照
4
+ description: 7 天内重复调用同一 requestId 时原样返回这份结果
5
+ is_wide: true
6
+ required: false
7
+ rows: 6
8
+ sort_no: 1200
9
+ type: textarea
@@ -0,0 +1,6 @@
1
+ name: result_code
2
+ group: 通用
3
+ label: 响应码
4
+ required: false
5
+ sort_no: 700
6
+ type: number
@@ -0,0 +1,6 @@
1
+ name: source_ip
2
+ group: 通用
3
+ label: 来源 IP
4
+ required: false
5
+ sort_no: 800
6
+ type: text
@@ -0,0 +1,6 @@
1
+ name: space
2
+ group: 通用
3
+ label: 工作区ID
4
+ required: false
5
+ sort_no: 1100
6
+ type: text
@@ -0,0 +1,6 @@
1
+ name: tag_id
2
+ group: 通用
3
+ label: 标签类目编码
4
+ required: false
5
+ sort_no: 300
6
+ type: text
@@ -0,0 +1,6 @@
1
+ name: tag_label
2
+ group: 通用
3
+ label: 标签类目
4
+ required: false
5
+ sort_no: 400
6
+ type: text
@@ -0,0 +1,19 @@
1
+ name: all
2
+ columns:
3
+ - field: request_id
4
+ wrap: true
5
+ - field: tag_label
6
+ - field: item_count
7
+ - field: result_code
8
+ - field: duration
9
+ - field: changed_at
10
+ - field: created
11
+ filter_scope: space
12
+ filters: []
13
+ is_enable: true
14
+ label: 所有
15
+ shared: true
16
+ shared_to: space
17
+ sort:
18
+ - field_name: created
19
+ order: desc
@@ -0,0 +1,16 @@
1
+ name: pepsico_ch_tag_sync_request
2
+ custom: true
3
+ enable_api: true
4
+ enable_audit: false
5
+ enable_dataloader: true
6
+ enable_enhanced_lookup: true
7
+ enable_inline_edit: false
8
+ enable_lock_detail: true
9
+ enable_workflow: false
10
+ enable_trash: false
11
+ field_groups:
12
+ - group_name: 通用
13
+ icon: action_list_component
14
+ is_enable: true
15
+ label: Content Hub 标签同步请求
16
+ version: 2
@@ -0,0 +1,15 @@
1
+ name: pepsico_ch_tag_sync_request.admin
2
+ allowCreate: true
3
+ allowCreateFiles: true
4
+ allowDelete: true
5
+ allowDeleteFiles: true
6
+ allowEdit: true
7
+ allowEditFiles: true
8
+ allowRead: true
9
+ allowReadFiles: true
10
+ modifyAllFiles: true
11
+ modifyAllRecords: true
12
+ permission_set_id: admin
13
+ viewAllFiles: true
14
+ viewAllRecords: true
15
+ field_permissions: []
@@ -0,0 +1,14 @@
1
+ name: pepsico_ch_tag_sync_request.user
2
+ allowCreate: false
3
+ allowCreateFiles: false
4
+ allowDelete: false
5
+ allowDeleteFiles: false
6
+ allowEdit: false
7
+ allowEditFiles: false
8
+ allowRead: false
9
+ allowReadFiles: false
10
+ modifyAllRecords: false
11
+ permission_set_id: user
12
+ viewAllFiles: false
13
+ viewAllRecords: false
14
+ field_permissions: []
@@ -17,6 +17,8 @@ options:
17
17
  value: '1654151762018542'
18
18
  - label: 妙脆角
19
19
  value: '165788230400'
20
+ - label: 零食大礼包
21
+ value: '1649752'
20
22
  - label: 桂格
21
23
  value: '16541517620103133'
22
24
  - label: 百事食品
@@ -0,0 +1,10 @@
1
+ name: material_type_label
2
+ description: 选中「素材类型」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 通用
4
+ is_wide: true
5
+ label: 素材类型(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 210
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -17,6 +17,8 @@ options:
17
17
  value: '1654151762018542'
18
18
  - label: 妙脆角
19
19
  value: '165788230400'
20
+ - label: 零食大礼包
21
+ value: '1649752'
20
22
  - label: 桂格
21
23
  value: '16541517620103133'
22
24
  - label: 百事食品
@@ -2,7 +2,7 @@ name: supplement_materials
2
2
  amis:
3
3
  id: 'u:e77e52033014'
4
4
  description: >-
5
- 素材驳回后通过“上传补充素材”按钮来上传的补充(版权)文件,以及素材上线前关联其他补充文件的字段;</br> 请勿将将审核的素材上传到该字段!</br>
5
+ 素材驳回后通过“上传补充素材”按钮来上传的补充(版权)文件,以及素材上线前关联其他补充文件的字段;</br> 请勿将待审核的素材上传到该字段!</br>
6
6
  审核驳回后,Word、PPT素材请在线修改、图片、视频素材请直接替换素材。
7
7
  group: 通用
8
8
  is_wide: true
@@ -12,7 +12,7 @@ amis_schema: |-
12
12
  "type": "button",
13
13
  "label": "修改PLS文件",
14
14
  "level": "primary",
15
- "visibleOn": "${owner === context.userId && current_step === 'submitter_revisions' && formFactor != 'SMALL' && (form_version === 'v1' || form_version === 'v2') && (classification === 'MD-PO1-PO15' || classification === 'SLS-PO2-PO25' || has_nutrition_table === 'yes')}",
15
+ "visibleOn": "${owner === context.userId && current_step === 'submitter_revisions' && formFactor != 'SMALL' && (form_version === 'v1' || form_version === 'v2' || form_version === 'v3') && (classification === 'MD-PO1-PO15' || classification === 'SLS-PO2-PO25' || has_nutrition_table === 'yes')}",
16
16
  "onEvent": {
17
17
  "click": {
18
18
  "actions": [
@@ -0,0 +1,10 @@
1
+ name: available_channels_label
2
+ description: 选中「可使用渠道」时的标签名称快照, 路径各级名称用 - 连接, 多个用 、 分隔。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 可使用渠道(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1460
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -0,0 +1,56 @@
1
+ name: ch_material_group
2
+ amis:
3
+ id: 'u:ch_material_group'
4
+ type: tree-select
5
+ label: Content Hub 素材组
6
+ multiple: false
7
+ clearable: true
8
+ searchable: true
9
+ onlyLeaf: false
10
+ enableNodePath: false
11
+ showIcon: false
12
+ initiallyOpen: false
13
+ unfoldedLevel: 1
14
+ placeholder: 请选择素材组(如果列表为空,请先选择品牌/产品)
15
+ # 需要同步到 Content Hub 时必填
16
+ requiredOn: "${form_version == 'v3' && ch_sync_enabled == true}"
17
+ description: 素材同步到 Content Hub 后存放的位置
18
+ source:
19
+ # url 里引用这几个字段, 任一变化时 amis 才会重新请求:
20
+ # 发起人部门 + 分类命中「Content Hub 素材组查询规则」时按 Sales 范围查, 否则按品牌/产品查
21
+ url: '/api/pepsico-content/content-hub/material-groups?product=${product}&owner_department=${owner_department}&classification=${classification}'
22
+ method: get
23
+ # 树形 / 查找字段在表单里的值可能是 { value } / { _id } 对象, 直接拼进 url 会变成 [object Object];
24
+ # 这里从表单数据取出字符串值, 重写查询串
25
+ requestAdaptor: |-
26
+ const pick = (v) => _.isPlainObject(v) ? (v.value || v._id) : v;
27
+ const str = (v) => { const raw = pick(v); return _.isArray(raw) ? _.map(raw, pick).join(',') : (raw || ''); };
28
+ const query = {
29
+ product: str(context && context.product),
30
+ owner_department: str(context && context.owner_department),
31
+ classification: str(context && context.classification)
32
+ };
33
+ api.url = api.url.split('?')[0] + '?' + _.map(query, (v, k) => k + '=' + encodeURIComponent(v)).join('&');
34
+ api.query = query;
35
+ return api;
36
+ messages: {}
37
+ onEvent:
38
+ change:
39
+ weight: 0
40
+ actions:
41
+ # 同时把选中节点的完整名称路径存下来, Content Hub 那边目录改名 / 删除后历史单据照样能看
42
+ - ignoreError: true
43
+ actionType: setValue
44
+ componentId: 'u:ch_material_group_path'
45
+ args:
46
+ value: '${event.data.item.materialGroupPath || ""}'
47
+ data_type: text
48
+ description: 素材同步到 Content Hub 后存放的位置
49
+ group: 素材标签
50
+ is_wide: true
51
+ label: Content Hub 素材组
52
+ required: false
53
+ sort_no: 1370
54
+ type: select
55
+ # 只在 Content Hub 改版后的新版表单(form_version 见 content_hub_sync_rule.ts 的 CONTENT_HUB_FORM_VERSIONS)显示, 存量单据不受影响
56
+ visible_on: form_version == 'v3' && ch_sync_enabled == true
@@ -0,0 +1,14 @@
1
+ name: ch_material_group_path
2
+ amis:
3
+ id: 'u:ch_material_group_path'
4
+ static: true
5
+ description: 选择素材组后自动带出
6
+ group: 素材标签
7
+ is_wide: true
8
+ label: Content Hub 素材组路径
9
+ readonly: true
10
+ required: false
11
+ sort_no: 1380
12
+ type: text
13
+ # 只在 Content Hub 改版后的新版表单(form_version 见 content_hub_sync_rule.ts 的 CONTENT_HUB_FORM_VERSIONS)显示, 存量单据不受影响
14
+ visible_on: form_version == 'v3' && ch_sync_enabled == true
@@ -0,0 +1,11 @@
1
+ name: ch_sync_enabled
2
+ amis:
3
+ id: 'u:ch_sync_enabled'
4
+ description: 系统会根据填写的信息自动勾选。如果这批素材不需要同步到 Content Hub,可以取消勾选。
5
+ group: 素材标签
6
+ label: 同步到 Content Hub
7
+ required: false
8
+ sort_no: 1365
9
+ type: boolean
10
+ # 只在 Content Hub 改版后的新版表单(form_version 见 content_hub_sync_rule.ts 的 CONTENT_HUB_FORM_VERSIONS)显示, 存量单据不受影响
11
+ visible_on: form_version == 'v3'
@@ -0,0 +1,55 @@
1
+ name: ch_sync_rule_check
2
+ # 辅助字段, 不存值: 只是挂一个 service, 填单时按同步规则预判是否需要同步, 写入「同步到 Content Hub」开关
3
+ amis:
4
+ type: service
5
+ className: hidden
6
+ api:
7
+ # url 里引用这几个字段, 任一变化时 service 会重新请求
8
+ url: '/api/pepsico-content/content-hub/sync-preview?owner_department=${owner_department}&classification=${classification}&product=${product}&kol_classification=${kol_classification}'
9
+ method: get
10
+ # 树形 / 查找字段在表单里的值可能是 { value } / { _id } 对象, 取出字符串值后重写查询串
11
+ requestAdaptor: |-
12
+ const pick = (v) => _.isPlainObject(v) ? (v.value || v._id) : v;
13
+ const str = (v) => { const raw = pick(v); return _.isArray(raw) ? _.map(raw, pick).join(',') : (raw || ''); };
14
+ const query = {
15
+ owner_department: str(context && context.owner_department),
16
+ classification: str(context && context.classification),
17
+ product: str(context && context.product),
18
+ kol_classification: str(context && context.kol_classification)
19
+ };
20
+ api.url = api.url.split('?')[0] + '?' + _.map(query, (v, k) => k + '=' + encodeURIComponent(v)).join('&');
21
+ api.query = query;
22
+ return api;
23
+ messages: {}
24
+ body: []
25
+ onEvent:
26
+ fetchInited:
27
+ weight: 0
28
+ actions:
29
+ - ignoreError: true
30
+ actionType: custom
31
+ script: |-
32
+ if (event.data.responseStatus !== 0) {
33
+ return;
34
+ }
35
+ const pick = (v) => _.isPlainObject(v) ? (v.value || v._id) : v;
36
+ const str = (v) => { const raw = pick(v); return _.isArray(raw) ? _.map(raw, pick).join(',') : (raw || ''); };
37
+ const key = _.map(['owner_department', 'classification', 'product', 'kol_classification'], (k) => str(event.data[k])).join('|');
38
+ const store = window.__chSyncRuleKeys || (window.__chSyncRuleKeys = {});
39
+ const recordId = event.data._id || 'new';
40
+ const prevKey = store[recordId];
41
+ store[recordId] = key;
42
+ const current = event.data.ch_sync_enabled;
43
+ // 打开已有单据时保留已存的选择(用户可能手动关过); 之后这几个字段变了再按规则重新带出
44
+ if ((current === true || current === false) && (prevKey === undefined || prevKey === key)) {
45
+ return;
46
+ }
47
+ doAction({ actionType: 'setValue', componentId: 'u:ch_sync_enabled', args: { value: !!event.data.needSync } });
48
+ description: 辅助字段, 不存值。填单时按「Content Hub 同步规则」预判是否需要同步, 带出「同步到 Content Hub」的默认值
49
+ group: 素材标签
50
+ label: 同步规则预判
51
+ required: false
52
+ sort_no: 1366
53
+ type: text
54
+ # 只在 Content Hub 改版后的新版表单(form_version 见 content_hub_sync_rule.ts 的 CONTENT_HUB_FORM_VERSIONS)显示, 存量单据不受影响
55
+ visible_on: form_version == 'v3'
@@ -0,0 +1,10 @@
1
+ name: content_rule_label
2
+ description: 选中「素材授权规则」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 素材授权规则(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1510
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -15,4 +15,4 @@ options:
15
15
  value: 'yes'
16
16
  - label: 否
17
17
  value: 'no'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3')
@@ -16,4 +16,4 @@ group: 电商合规自查
16
16
  sort_no: 1276
17
17
  is_wide: true
18
18
  required: true
19
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_check_producer_name == 'yes' && ec_check_producer_address == 'yes' && ec_has_detail_page == 'yes'
19
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_check_producer_name == 'yes' && ec_check_producer_address == 'yes' && ec_has_detail_page == 'yes'
@@ -12,5 +12,5 @@ amis:
12
12
  accept: image/*,.pdf
13
13
  requiredOn: >-
14
14
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
15
- form_version == 'v2' && ec_has_detail_page == 'yes'}
16
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
15
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
16
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -6,4 +6,4 @@ group: 电商合规自查
6
6
  sort_no: 1259
7
7
  is_wide: true
8
8
  required: true
9
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'no'
9
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'no'
@@ -1,10 +1,14 @@
1
1
  name: form_version
2
+ # 只在界面上藏起来, 字段仍渲染在表单里: 多个字段的 visible_on 引用 form_version,
3
+ # 新建时的默认值 v1 也要靠表单写入; 用 visible_on 置 false 会把它从表单数据里拿掉
4
+ amis:
5
+ className: hidden
2
6
  label: 表单版本
3
7
  type: text
4
8
  data_type: text
5
9
  group: 系统信息
6
- inlineHelpText: v1=PLS知识库关联;v2=增加电商合规自查与QC审核
10
+ inlineHelpText: v1=PLS知识库关联;v2=增加电商合规自查与QC审核;v3=Content Hub 改版(含 v1、v2 全部功能, 另加同步规则、同步开关、素材组)
7
11
  sort_no: 100000
8
12
  is_wide: false
9
13
  readonly: true
10
- defaultValue: 'v1'
14
+ defaultValue: 'v3'
@@ -15,4 +15,4 @@ options:
15
15
  value: 'yes'
16
16
  - label: 否
17
17
  value: 'no'
18
- visible_on: (classification == 'MD-SC1-SC16' || classification == 'MD-SC1-SC16-SC161' || classification == 'MD-SC1-SC16-SC162' || classification == 'MD-SC1-SC112' || classification == 'SLS-SC2-SC26' || classification == 'SLS-SC2-SC26-SC261' || classification == 'SLS-SC2-SC26-SC262' || classification == 'SLS-SC2-SC212') && form_version == 'v2'
18
+ visible_on: (classification == 'MD-SC1-SC16' || classification == 'MD-SC1-SC16-SC161' || classification == 'MD-SC1-SC16-SC162' || classification == 'MD-SC1-SC112' || classification == 'SLS-SC2-SC26' || classification == 'SLS-SC2-SC26-SC261' || classification == 'SLS-SC2-SC26-SC262' || classification == 'SLS-SC2-SC212') && (form_version == 'v2' || form_version == 'v3')
@@ -0,0 +1,10 @@
1
+ name: material_type_label
2
+ description: 选中「素材类型」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 素材类型(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1410
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -8,4 +8,4 @@ multiple: true
8
8
  required: false
9
9
  sort_no: 800
10
10
  type: file
11
- visible_on: '${(classification == ''MD-PO1-PO15'') && form_version != ''v2'' && form_version != ''v1''}'
11
+ visible_on: '${(classification == ''MD-PO1-PO15'') && form_version != ''v2'' && form_version != ''v1'' && form_version != ''v3''}'
@@ -22,7 +22,7 @@ amis:
22
22
  className: pepsico-pls-files-field m-1 border-b
23
23
  # requiredOn: >-
24
24
  # ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' ||
25
- # has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2') && (!pls_upload_files ||
25
+ # has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3') && (!pls_upload_files ||
26
26
  # pls_upload_files.length === 0)}
27
27
  placeholder: 请选择PLS文件
28
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2')
28
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3')
@@ -6,7 +6,7 @@ group: 基本信息
6
6
  sort_no: 1241
7
7
  is_wide: false
8
8
  required: false
9
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2')
9
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3')
10
10
  amis:
11
11
  accept: .pdf
12
12
  btnLabel: 上传本地PLS文件
@@ -0,0 +1,10 @@
1
+ name: product_label
2
+ description: 选中「品牌/产品」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 品牌/产品(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1360
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -0,0 +1,8 @@
1
+ name: ch_changed_at
2
+ group: 通用
3
+ label: Content Hub 变更时间
4
+ description: 该选项最近一次已处理的 Content Hub 同步事件的 changedAt, 用于丢弃迟到的过期事件
5
+ hidden: true
6
+ required: false
7
+ sort_no: 900
8
+ type: datetime
@@ -0,0 +1,7 @@
1
+ name: picklist_options
2
+ custom: true
3
+ extend: picklist_options
4
+ is_enable: true
5
+ is_system: true
6
+ label: 选项列表值
7
+ version: 2
@@ -0,0 +1,8 @@
1
+ name: object_pepsico_ch_material_group_rule
2
+ desktop: true
3
+ icon: hierarchy
4
+ label: Content Hub 素材组查询规则
5
+ mobile: false
6
+ object: pepsico_ch_material_group_rule
7
+ permissions: []
8
+ type: object
@@ -0,0 +1,8 @@
1
+ name: object_pepsico_ch_sync_rule
2
+ desktop: true
3
+ icon: approval
4
+ label: Content Hub 同步规则
5
+ mobile: false
6
+ object: pepsico_ch_sync_rule
7
+ permissions: []
8
+ type: object