@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.
- package/dist/index.js +1 -1
- package/lib/actions/contentHubMaterialGroups.d.ts +19 -0
- package/lib/actions/contentHubMaterialGroups.js +70 -0
- package/lib/actions/contentHubMaterialGroups.js.map +1 -0
- package/lib/actions/contentHubSyncPreview.d.ts +21 -0
- package/lib/actions/contentHubSyncPreview.js +51 -0
- package/lib/actions/contentHubSyncPreview.js.map +1 -0
- package/lib/actions/contentHubTagValues.d.ts +12 -0
- package/lib/actions/contentHubTagValues.js +70 -0
- package/lib/actions/contentHubTagValues.js.map +1 -0
- package/lib/actions/index.d.ts +3 -0
- package/lib/actions/index.js +3 -0
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/sendToContentHub.js +1 -1
- package/lib/actions/sendToContentHub.js.map +1 -1
- package/lib/actions/spotCheckMaterial.js +3 -1
- package/lib/actions/spotCheckMaterial.js.map +1 -1
- package/lib/index.js +173 -30
- package/lib/index.js.map +1 -1
- package/lib/methods/__tests__/contentHubMaterialGroup.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubMaterialGroup.test.js +97 -0
- package/lib/methods/__tests__/contentHubMaterialGroup.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubMaterialGroupRule.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js +131 -0
- package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubPush.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubPush.test.js +279 -0
- package/lib/methods/__tests__/contentHubPush.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubSyncRule.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubSyncRule.test.js +130 -0
- package/lib/methods/__tests__/contentHubSyncRule.test.js.map +1 -0
- package/lib/methods/__tests__/contentHubTagSync.test.d.ts +1 -0
- package/lib/methods/__tests__/contentHubTagSync.test.js +743 -0
- package/lib/methods/__tests__/contentHubTagSync.test.js.map +1 -0
- package/lib/methods/__tests__/tagLabel.test.d.ts +1 -0
- package/lib/methods/__tests__/tagLabel.test.js +136 -0
- package/lib/methods/__tests__/tagLabel.test.js.map +1 -0
- package/lib/methods/__tests__/voidMaterialReasonTrigger.test.d.ts +1 -0
- package/lib/methods/__tests__/voidMaterialReasonTrigger.test.js +315 -0
- package/lib/methods/__tests__/voidMaterialReasonTrigger.test.js.map +1 -0
- package/lib/methods/approval_engine.js +1 -1
- package/lib/methods/approval_engine.js.map +1 -1
- package/lib/methods/consts.d.ts +3 -0
- package/lib/methods/consts.js.map +1 -1
- package/lib/methods/content_hub.d.ts +7 -1
- package/lib/methods/content_hub.js +92 -9
- package/lib/methods/content_hub.js.map +1 -1
- package/lib/methods/content_hub_material_group.d.ts +29 -0
- package/lib/methods/content_hub_material_group.js +268 -0
- package/lib/methods/content_hub_material_group.js.map +1 -0
- package/lib/methods/content_hub_material_group_rule.d.ts +16 -0
- package/lib/methods/content_hub_material_group_rule.js +46 -0
- package/lib/methods/content_hub_material_group_rule.js.map +1 -0
- package/lib/methods/content_hub_sync_rule.d.ts +51 -0
- package/lib/methods/content_hub_sync_rule.js +122 -0
- package/lib/methods/content_hub_sync_rule.js.map +1 -0
- package/lib/methods/content_hub_tag.d.ts +57 -0
- package/lib/methods/content_hub_tag.js +830 -0
- package/lib/methods/content_hub_tag.js.map +1 -0
- package/lib/methods/pls.d.ts +1 -1
- package/lib/methods/pls.js +21 -16
- package/lib/methods/pls.js.map +1 -1
- package/lib/methods/tag_label.d.ts +19 -0
- package/lib/methods/tag_label.js +192 -0
- package/lib/methods/tag_label.js.map +1 -0
- package/main/default/applications/pepsico_content_setting.app.yml +8 -0
- package/main/default/objects/pepsico_brand_leader/fields/name.field.yml +2 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/active.field.yml +6 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/classification.field.yml +73 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/name.field.yml +9 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/orgs.field.yml +10 -0
- package/main/default/objects/pepsico_ch_material_group_rule/fields/remark.field.yml +7 -0
- package/main/default/objects/pepsico_ch_material_group_rule/listviews/all.listview.yml +18 -0
- package/main/default/objects/pepsico_ch_material_group_rule/pepsico_ch_material_group_rule.object.yml +18 -0
- package/main/default/objects/pepsico_ch_material_group_rule/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_material_group_rule/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/active.field.yml +6 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/classification.field.yml +73 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/kol_classification.field.yml +67 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/name.field.yml +9 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/need_sync.field.yml +11 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/orgs.field.yml +10 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/priority.field.yml +10 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/product.field.yml +65 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/remark.field.yml +7 -0
- package/main/default/objects/pepsico_ch_sync_rule/fields/spot_check.field.yml +12 -0
- package/main/default/objects/pepsico_ch_sync_rule/listviews/all.listview.yml +24 -0
- package/main/default/objects/pepsico_ch_sync_rule/pepsico_ch_sync_rule.object.yml +19 -0
- package/main/default/objects/pepsico_ch_sync_rule/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_sync_rule/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/action.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/changed_at.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/duration.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_code.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_msg.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/expired_date.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/name.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/parent_tag_val_id.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/request_id.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/result.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/source_ip.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/space.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_id.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_id.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_name.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/listviews/all.listview.yml +21 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/pepsico_ch_tag_sync_log.object.yml +16 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_tag_sync_log/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/changed_at.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/duration.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/expired_date.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/item_count.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/name.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/request_id.field.yml +7 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/response.field.yml +9 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/result_code.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/source_ip.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/space.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_id.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_label.field.yml +6 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/listviews/all.listview.yml +19 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/pepsico_ch_tag_sync_request.object.yml +16 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/permissions/admin.permission.yml +15 -0
- package/main/default/objects/pepsico_ch_tag_sync_request/permissions/user.permission.yml +14 -0
- package/main/default/objects/pepsico_mail_send_log/fields/product.field.yml +2 -0
- package/main/default/objects/pepsico_material/fields/material_type_label.field.yml +10 -0
- package/main/default/objects/pepsico_material/fields/product.field.yml +2 -0
- package/main/default/objects/pepsico_material/fields/supplement_materials.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/buttons/pepsico_modify_pls.button.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/available_channels_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_material_group.field.yml +56 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_material_group_path.field.yml +14 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_sync_enabled.field.yml +11 -0
- package/main/default/objects/pepsico_material_approval/fields/ch_sync_rule_check.field.yml +55 -0
- package/main/default/objects/pepsico_material_approval/fields/content_rule_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/fields/ec_check_food_name.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_ingredients.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_net_content.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_address.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_name.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_shelf_life.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_standard_code.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_check_storage_condition.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_has_detail_page.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/ec_producers.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/ec_qc_production_email.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/ec_related_approval.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/form_version.field.yml +6 -2
- package/main/default/objects/pepsico_material_approval/fields/has_nutrition_table.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/material_type_label.field.yml +10 -0
- package/main/default/objects/pepsico_material_approval/fields/pls_file.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/pls_km_files.field.yml +2 -2
- package/main/default/objects/pepsico_material_approval/fields/pls_upload_files.field.yml +1 -1
- package/main/default/objects/pepsico_material_approval/fields/product_label.field.yml +10 -0
- package/main/default/objects/picklist_options/fields/ch_changed_at.field.yml +8 -0
- package/main/default/objects/picklist_options/picklist_options.object.yml +7 -0
- package/main/default/tabs/object_pepsico_ch_material_group_rule.tab.yml +8 -0
- package/main/default/tabs/object_pepsico_ch_sync_rule.tab.yml +8 -0
- package/main/default/triggers/pepsico_material_approval_tag_label.trigger.yml +80 -0
- package/main/default/triggers/pepsico_material_tag_label.trigger.yml +77 -0
- package/package.json +1 -1
- package/scripts/audit-legacy-tags.js +246 -0
- package/scripts/probe-content-hub-tags.js +134 -0
|
@@ -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
|
package/main/default/objects/pepsico_ch_tag_sync_request/pepsico_ch_tag_sync_request.object.yml
ADDED
|
@@ -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: []
|
|
@@ -2,7 +2,7 @@ name: supplement_materials
|
|
|
2
2
|
amis:
|
|
3
3
|
id: 'u:e77e52033014'
|
|
4
4
|
description: >-
|
|
5
|
-
素材驳回后通过“上传补充素材”按钮来上传的补充(版权)文件,以及素材上线前关联其他补充文件的字段;</br>
|
|
5
|
+
素材驳回后通过“上传补充素材”按钮来上传的补充(版权)文件,以及素材上线前关联其他补充文件的字段;</br> 请勿将待审核的素材上传到该字段!</br>
|
|
6
6
|
审核驳回后,Word、PPT素材请在线修改、图片、视频素材请直接替换素材。
|
|
7
7
|
group: 通用
|
|
8
8
|
is_wide: true
|
package/main/default/objects/pepsico_material_approval/buttons/pepsico_modify_pls.button.yml
CHANGED
|
@@ -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,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
|
package/main/default/objects/pepsico_material_approval/fields/ch_material_group_path.field.yml
ADDED
|
@@ -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'
|
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_ingredients.field.yml
CHANGED
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_net_content.field.yml
CHANGED
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_address.field.yml
CHANGED
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_name.field.yml
CHANGED
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_standard_code.field.yml
CHANGED
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_check_storage_condition.field.yml
CHANGED
|
@@ -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'
|
package/main/default/objects/pepsico_material_approval/fields/ec_qc_production_email.field.yml
CHANGED
|
@@ -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: '
|
|
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')
|
|
@@ -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文件
|