@steedos-labs/content-compliance 0.2.17 → 0.2.18

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 (137) hide show
  1. package/dist/index.js +1 -1
  2. package/lib/index.js +65 -16
  3. package/lib/index.js.map +1 -1
  4. package/lib/methods/dashboard_sync_data.js +29 -29
  5. package/lib/methods/dashboard_sync_data.js.map +1 -1
  6. package/lib/methods/index.d.ts +1 -0
  7. package/lib/methods/index.js +1 -0
  8. package/lib/methods/index.js.map +1 -1
  9. package/lib/methods/material.js +8 -1
  10. package/lib/methods/material.js.map +1 -1
  11. package/lib/methods/pls.d.ts +1 -0
  12. package/lib/methods/pls.js +171 -0
  13. package/lib/methods/pls.js.map +1 -0
  14. package/main/default/dashboards//345/256/241/346/240/270/346/265/201/347/250/213/347/234/213/346/235/277.dashboard.yml +108 -108
  15. package/main/default/functions/pepsico_km_update_adopt.function.yml +125 -0
  16. package/main/default/objects/pepsico_km_update/buttons/pepsico_pick.button.yml +44 -1
  17. package/main/default/objects/pepsico_km_update/buttons/standard_edit.button.js +12 -0
  18. package/main/default/objects/pepsico_km_update/buttons/standard_edit.button.yml +1 -0
  19. package/main/default/objects/pepsico_km_update/fields/brief_type.field.yml +1 -1
  20. package/main/default/objects/pepsico_km_update/fields/company_id.field.yml +1 -1
  21. package/main/default/objects/pepsico_km_update/fields/company_ids.field.yml +1 -1
  22. package/main/default/objects/pepsico_km_update/fields/created.field.yml +1 -1
  23. package/main/default/objects/pepsico_km_update/fields/created_by.field.yml +1 -1
  24. package/main/default/objects/pepsico_km_update/fields/decide.field.yml +1 -1
  25. package/main/default/objects/pepsico_km_update/fields/general_rule.field.yml +8 -0
  26. package/main/default/objects/pepsico_km_update/fields/instance_state.field.yml +1 -1
  27. package/main/default/objects/pepsico_km_update/fields/locked.field.yml +1 -1
  28. package/main/default/objects/pepsico_km_update/fields/modified.field.yml +1 -1
  29. package/main/default/objects/pepsico_km_update/fields/modified_by.field.yml +1 -1
  30. package/main/default/objects/pepsico_km_update/fields/new_rule.field.yml +2 -2
  31. package/main/default/objects/pepsico_km_update/fields/owner.field.yml +1 -1
  32. package/main/default/objects/pepsico_km_update/fields/pepsico_material.field.yml +1 -1
  33. package/main/default/objects/pepsico_km_update/fields/pepsico_material_approval.field.yml +1 -1
  34. package/main/default/objects/pepsico_km_update/fields/product.field.yml +2 -2
  35. package/main/default/objects/pepsico_km_update/fields/product_name.field.yml +1 -1
  36. package/main/default/objects/pepsico_km_update/fields/rule.field.yml +2 -2
  37. package/main/default/objects/pepsico_km_update/fields/tag.field.yml +1 -1
  38. package/main/default/objects/pepsico_km_update/fields/take.field.yml +1 -1
  39. package/main/default/objects/pepsico_km_update/fields/taste.field.yml +2 -2
  40. package/main/default/objects/pepsico_material/buttons/pepsico_update_material.button.yml +1 -0
  41. package/main/default/objects/pepsico_material/buttons/standard_edit.button.js +1 -1
  42. package/main/default/objects/pepsico_material_approval/buttons/approve_ai.button.yml +220 -0
  43. package/main/default/objects/pepsico_material_approval/buttons/pepsico_material_upload.button.yml +5 -2
  44. package/main/default/objects/pepsico_material_approval_data/fields/{fcfd5u.field.yml → approve_finish_time.field.yml} +2 -2
  45. package/main/default/objects/pepsico_material_approval_data/fields/{fl5z8d3.field.yml → approve_org.field.yml} +2 -2
  46. package/main/default/objects/pepsico_material_approval_data/fields/{fcs75v.field.yml → approve_status.field.yml} +2 -2
  47. package/main/default/objects/pepsico_material_approval_data/fields/{fl5z8d33.field.yml → ca_approve_times.field.yml} +2 -2
  48. package/main/default/objects/pepsico_material_approval_data/fields/{fdlr9c.field.yml → ca_pass.field.yml} +2 -2
  49. package/main/default/objects/pepsico_material_approval_data/fields/classify.field.yml +7 -0
  50. package/main/default/objects/pepsico_material_approval_data/fields/company_id.field.yml +1 -1
  51. package/main/default/objects/pepsico_material_approval_data/fields/company_ids.field.yml +1 -1
  52. package/main/default/objects/pepsico_material_approval_data/fields/created.field.yml +1 -1
  53. package/main/default/objects/pepsico_material_approval_data/fields/created_by.field.yml +1 -1
  54. package/main/default/objects/pepsico_material_approval_data/fields/{fs4pzm.field.yml → current_step.field.yml} +2 -2
  55. package/main/default/objects/pepsico_material_approval_data/fields/{ftuhbe.field.yml → end_time.field.yml} +2 -2
  56. package/main/default/objects/pepsico_material_approval_data/fields/{fl5z8d6.field.yml → guding_approve_times.field.yml} +2 -2
  57. package/main/default/objects/pepsico_material_approval_data/fields/{f0mwlz.field.yml → guding_pass.field.yml} +2 -2
  58. package/main/default/objects/pepsico_material_approval_data/fields/instance_state.field.yml +1 -1
  59. package/main/default/objects/pepsico_material_approval_data/fields/kids.field.yml +7 -0
  60. package/main/default/objects/pepsico_material_approval_data/fields/{flpuyc.field.yml → legal_pass.field.yml} +2 -2
  61. package/main/default/objects/pepsico_material_approval_data/fields/locked.field.yml +1 -1
  62. package/main/default/objects/pepsico_material_approval_data/fields/modified.field.yml +1 -1
  63. package/main/default/objects/pepsico_material_approval_data/fields/modified_by.field.yml +1 -1
  64. package/main/default/objects/pepsico_material_approval_data/fields/{fl5z8d5.field.yml → ns_approve_times.field.yml} +2 -2
  65. package/main/default/objects/pepsico_material_approval_data/fields/{frncig.field.yml → ns_pass.field.yml} +2 -2
  66. package/main/default/objects/pepsico_material_approval_data/fields/owner.field.yml +3 -1
  67. package/main/default/objects/pepsico_material_approval_data/fields/peoduct.field.yml +1 -1
  68. package/main/default/objects/pepsico_material_approval_data/fields/pepsico_material_approval.field.yml +1 -1
  69. package/main/default/objects/pepsico_material_approval_data/fields/{f4b97s.field.yml → review_time.field.yml} +2 -2
  70. package/main/default/objects/pepsico_material_approval_data/fields/{fl5z8d4.field.yml → sra_approve_times.field.yml} +2 -2
  71. package/main/default/objects/pepsico_material_approval_data/fields/{fcwan9.field.yml → sra_pass.field.yml} +2 -2
  72. package/main/default/objects/pepsico_material_approval_data/fields/{fgvkiq.field.yml → submit_org.field.yml} +2 -2
  73. package/main/default/objects/pepsico_material_approval_data/fields/submit_time.field.yml +1 -1
  74. package/main/default/objects/pepsico_material_approval_data/fields/termination.field.yml +12 -0
  75. package/main/default/objects/pepsico_material_approval_data/fields/termination_org.field.yml +18 -0
  76. package/main/default/objects/pepsico_material_approval_data/fields/type.field.yml +1 -1
  77. package/main/default/objects/pepsico_material_approval_data/pepsico_material_approval_data.object.yml +1 -0
  78. package/main/default/objects/pepsico_material_data/fields/{fwd41q.field.yml → brand.field.yml} +1 -1
  79. package/main/default/objects/pepsico_material_data/fields/{frb2ws.field.yml → ca_pass.field.yml} +2 -2
  80. package/main/default/objects/pepsico_material_data/fields/classify.field.yml +7 -0
  81. package/main/default/objects/pepsico_material_data/fields/company_id.field.yml +1 -1
  82. package/main/default/objects/pepsico_material_data/fields/company_ids.field.yml +1 -1
  83. package/main/default/objects/pepsico_material_data/fields/created.field.yml +1 -1
  84. package/main/default/objects/pepsico_material_data/fields/created_by.field.yml +1 -1
  85. package/main/default/objects/pepsico_material_data/fields/{f3vcad.field.yml → guding_pass.field.yml} +2 -2
  86. package/main/default/objects/pepsico_material_data/fields/instance_state.field.yml +1 -1
  87. package/main/default/objects/pepsico_material_data/fields/{f0klcn.field.yml → legal_pass.field.yml} +2 -2
  88. package/main/default/objects/pepsico_material_data/fields/locked.field.yml +1 -1
  89. package/main/default/objects/pepsico_material_data/fields/{fwfot5.field.yml → material_approve_org.field.yml} +2 -2
  90. package/main/default/objects/pepsico_material_data/fields/{fls30h.field.yml → material_type.field.yml} +1 -1
  91. package/main/default/objects/pepsico_material_data/fields/material_void.field.yml +8 -0
  92. package/main/default/objects/pepsico_material_data/fields/modified.field.yml +1 -1
  93. package/main/default/objects/pepsico_material_data/fields/modified_by.field.yml +1 -1
  94. package/main/default/objects/pepsico_material_data/fields/{fdlp1n.field.yml → ns_pass.field.yml} +2 -2
  95. package/main/default/objects/pepsico_material_data/fields/owner.field.yml +3 -1
  96. package/main/default/objects/pepsico_material_data/fields/{fe3y0o.field.yml → pepsico_material.field.yml} +2 -2
  97. package/main/default/objects/pepsico_material_data/fields/{fhiwc3.field.yml → pepsico_material_approval_data.field.yml} +2 -2
  98. package/main/default/objects/pepsico_material_data/fields/{f2cgk5.field.yml → sra_pass.field.yml} +2 -2
  99. package/main/default/objects/pepsico_material_data/fields/{fubg59.field.yml → submit_org.field.yml} +1 -1
  100. package/main/default/objects/pepsico_material_data/fields/{f2falr.field.yml → submit_time.field.yml} +1 -1
  101. package/main/default/objects/pepsico_material_data/listviews/all.listview.yml +1 -0
  102. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/345/217/221/350/265/267/344/272/272/347/273/210/346/255/242/357/274/210/345/220/214/346/255/245/345/207/272/347/216/260/351/227/256/351/242/230/357/274/211.question.yml +1 -1
  103. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/345/217/221/350/265/267/351/203/250/351/227/250/347/273/237/350/256/241/357/274/210/345/220/214/346/255/245/345/207/272/347/216/260/351/227/256/351/242/230/357/274/211.question.yml +10 -10
  104. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/345/223/201/347/211/214/347/273/237/350/256/241.question.yml +10 -10
  105. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/345/256/241/346/211/271/344/272/272/347/273/210/346/255/242.question.yml +1 -1
  106. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/345/256/241/346/240/270/347/212/266/346/200/201.question.yml +6 -6
  107. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/345/256/241/346/240/270/351/200/232/350/277/207/346/203/205/345/206/265/357/274/210/345/220/214/346/255/245/345/207/272/347/216/260/351/227/256/351/242/230/357/274/211.question.yml +4 -4
  108. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/346/234/200/345/244/247/345/256/241/346/240/270/346/227/266/351/225/277.question.yml +1 -1
  109. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/346/234/200/345/260/217/345/256/241/346/240/270/346/227/266/351/225/277.question.yml +1 -1
  110. package/main/default/questions//344/270/232/345/212/241/351/203/250/351/227/250-/347/264/240/346/235/220/347/261/273/345/236/213/347/273/237/350/256/241.question.yml +14 -14
  111. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-CA/345/223/201/347/211/214/346/225/260/351/207/217.question.yml +1 -1
  112. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-CA/345/256/241/346/240/270/351/200/232/350/277/207/346/265/201/347/250/213/346/225/260.question.yml +2 -2
  113. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-CA/345/256/241/346/240/270/351/200/232/350/277/207/347/216/207.question.yml +5 -5
  114. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-CA/347/264/240/346/235/220/347/261/273/345/236/213/345/256/241/346/240/270/346/203/205/345/206/265.question.yml +6 -6
  115. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-Legal/345/256/241/346/240/270/346/225/260/351/207/217.question.yml +2 -2
  116. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-Legal/345/256/241/346/240/270/351/200/232/350/277/207/346/265/201/347/250/213/346/225/260.question.yml +1 -1
  117. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-Legal/347/264/240/346/235/220/347/261/273/345/236/213/345/256/241/346/240/270/346/203/205/345/206/265.question.yml +6 -6
  118. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-NS/345/223/201/347/211/214/345/256/241/346/240/270/347/212/266/346/200/201.question.yml +1 -1
  119. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-NS/345/256/241/346/240/270/351/200/232/350/277/207/346/265/201/347/250/213/346/225/260.question.yml +1 -1
  120. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-NS/345/256/241/346/240/270/351/200/232/350/277/207/347/216/207.question.yml +5 -5
  121. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-NS/347/264/240/346/235/220/347/261/273/345/236/213/345/256/241/346/240/270/346/203/205/345/206/265.question.yml +6 -6
  122. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-SRA/345/223/201/347/211/214/345/256/241/346/240/270/347/212/266/346/200/201.question.yml +1 -1
  123. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-SRA/345/256/241/346/240/270.question.yml +5 -5
  124. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-SRA/345/256/241/346/240/270/351/200/232/347/216/207.question.yml +5 -5
  125. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-SRA/345/256/241/346/240/270/351/200/232/350/277/207/346/265/201/347/250/213/346/225/260/357/274/210/345/220/214/346/255/245/345/207/272/347/216/260/351/227/256/351/242/230/357/274/211.question.yml +1 -1
  126. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-SRA/345/256/241/346/240/270/351/200/232/350/277/207/347/216/207.question.yml +5 -5
  127. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-SRA/347/264/240/346/235/220/347/261/273/345/236/213/345/256/241/346/240/270/346/203/205/345/206/265.question.yml +6 -6
  128. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-legal/345/223/201/347/211/214/345/256/241/346/240/270/347/212/266/346/200/201.question.yml +1 -1
  129. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-legal/345/256/241/346/240/270/351/200/232/350/277/207/347/216/207.question.yml +5 -5
  130. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-/345/233/272/345/256/232/344/272/272/345/221/230/345/223/201/347/211/214/345/256/241/346/240/270/347/212/266/346/200/201.question.yml +1 -1
  131. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-/345/233/272/345/256/232/344/272/272/345/221/230/345/256/241/346/240/270/351/200/232/350/277/207/346/265/201/347/250/213/346/225/260/357/274/210/345/220/214/346/255/245/345/207/272/347/216/260/351/227/256/351/242/230/357/274/211.question.yml +1 -1
  132. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-/345/233/272/345/256/232/345/256/241/346/240/270/347/264/240/346/235/220/347/261/273/345/236/213/345/256/241/346/240/270/346/203/205/345/206/265.question.yml +6 -6
  133. package/main/default/questions//345/256/241/346/240/270/351/203/250/351/227/250-/345/233/272/345/256/232/345/256/241/346/240/270/351/200/232/350/277/207/347/216/207/357/274/210/345/220/214/346/255/245/345/207/272/347/216/260/351/227/256/351/242/230/357/274/211.question.yml +5 -5
  134. package/package.json +1 -1
  135. package/main/default/objects/pepsico_material_approval_data/fields/approve_users.field.yml +0 -11
  136. package/main/default/objects/pepsico_material_approval_data/fields/fvbadu.field.yml +0 -12
  137. package/main/default/objects/pepsico_material_data/fields/approve_users.field.yml +0 -11
@@ -0,0 +1,125 @@
1
+ name: pepsico_km_update_adopt
2
+ objectApiName: pepsico_km_update
3
+ isEnabled: true
4
+ is_rest: true
5
+ script: |-
6
+ // global: {_:lodash, moment, validator, filters}
7
+ // objects
8
+ // ctx: {input, params, broker, getObject, getUser}
9
+
10
+
11
+ const { input } = ctx;
12
+
13
+ const { _ } = global;
14
+
15
+ const km = await objects.pepsico_km_update.findOne(input.id);
16
+
17
+ if (!km) {
18
+ throw new Error('无效的参数「id」')
19
+ }
20
+
21
+
22
+
23
+ if (km.type === 'Brief') {
24
+ // brief规则:类似通用规则,只是需要“品牌”+“类型”+“规则原文”去匹配;
25
+ const briefRecord = await objects.pepsico_km_brief.find({
26
+ filters: [['product', '=', km.product], ['type', '=', km.brief_type], ['rule', '=', km.rule]]
27
+ })
28
+ if (briefRecord.length > 0) {
29
+ if (_.isEmpty(_.trim(km.new_rule))) {
30
+ await objects.pepsico_km_brief.directUpdate(briefRecord[0]._id, {
31
+ rule: km.new_rule,
32
+ enable: true
33
+ })
34
+ } else {
35
+ await objects.pepsico_km_brief.directUpdate(briefRecord[0]._id, {
36
+ enable: false
37
+ })
38
+ }
39
+ } else {
40
+ if (_.isEmpty(_.trim(km.new_rule))) {
41
+
42
+ } else {
43
+ await objects.pepsico_km_brief.directInsert({
44
+ product: km.product,
45
+ type: km.brief_type,
46
+ rule: km.new_rule,
47
+ enable: true,
48
+ space: km.space,
49
+ created: new Date()
50
+ })
51
+ }
52
+ }
53
+
54
+ } else if (km.type === 'PLS') {
55
+ // PLS规则:类似通用规则,只是需要“品牌”+“口味”+“PLS标签”+“规则原文”去匹配;
56
+ const plsRecord = await objects.pepsico_km_pls.find({
57
+ filters: [['product', '=', km.product], ['taste', '=', km.taste], ['tag', '=', km.tag], ['content', '=', km.rule]]
58
+ })
59
+ if (plsRecord.length > 0) {
60
+ if (_.isEmpty(_.trim(km.new_rule))) {
61
+ await objects.pepsico_km_pls.directUpdate(plsRecord[0]._id, {
62
+ content: km.new_rule,
63
+ enable: true
64
+ })
65
+ } else {
66
+ await objects.pepsico_km_pls.directUpdate(plsRecord[0]._id, {
67
+ enable: false
68
+ })
69
+ }
70
+ } else {
71
+ if (_.isEmpty(_.trim(km.new_rule))) {
72
+
73
+ } else {
74
+ await objects.pepsico_km_pls.directInsert({
75
+ product: km.product,
76
+ taste: km.taste,
77
+ tag: km.tag,
78
+ content: km.new_rule,
79
+ enable: true,
80
+ space: km.space,
81
+ created: new Date()
82
+ })
83
+ }
84
+ }
85
+ } else {
86
+ // 通用规则
87
+ const kmRecord = await pepsico_km_general.find({
88
+ filters: [['rule_content', '=', km.rule], ['name', '=', km.general_rule]]
89
+ })
90
+ if (kmRecord.length > 0) {
91
+ // 匹配的上:“建议的新规则”字段无值,则将原规则状态设置为“无效”;若“建议的新规则”字段有值,则更新匹配上的记录,“规则内容”为“建议的新规则”字段的值;
92
+ if (_.isEmpty(_.trim(km.new_rule))) {
93
+ await objects.pepsico_km_general.directUpdate(kmRecord[0]._id, {
94
+ rule_content: km.new_rule,
95
+ enable: true
96
+ })
97
+ } else {
98
+ await objects.pepsico_km_general.directUpdate(kmRecord[0]._id, {
99
+ enable: false
100
+ })
101
+ }
102
+ } else {
103
+ // 匹配不上:“建议的新规则”字段无值,则无需处理;若“建议的新规则”字段有值,则新增一条通用规则,“规则内容”为“建议的新规则”字段的值;
104
+ if (_.isEmpty(_.trim(km.new_rule))) {
105
+
106
+ } else {
107
+ await objects.pepsico_km_general.directInsert({
108
+ name: km.general_rule,
109
+ enable: true,
110
+ rule_content: km.new_rule,
111
+ space: km.space,
112
+ created: new Date()
113
+ })
114
+ }
115
+ }
116
+
117
+ }
118
+
119
+ await objects.pepsico_km_update.directUpdate(km._id, {
120
+ take: 'v2'
121
+ })
122
+
123
+ return {}
124
+ description: 采纳
125
+ locked: false
@@ -8,7 +8,50 @@ amis_schema: |-
8
8
  "label": "采纳",
9
9
  "id": "u:pepsico_pick",
10
10
  "editorState": "default",
11
- "level": "default"
11
+ "level": "default",
12
+ "visibleOn": "${take != 'v2' && formFactor != 'SMALL'}",
13
+ "actionType": "ajax",
14
+ "confirmText": "确认要采纳吗?",
15
+ "confirmTitle": "提交人修改",
16
+ "onEvent": {
17
+ "click": {
18
+ "weight": 0,
19
+ "actions": [
20
+ {
21
+ "ignoreError": false,
22
+ "actionType": "disabled",
23
+ "componentId": "u:pepsico_pick"
24
+ },
25
+ {
26
+ "actionType": "ajax",
27
+ "ignoreError": false,
28
+ "outputVar": "responseResult",
29
+ "options": {},
30
+ "api": {
31
+ "url": "/api/v1/pepsico_km_update/functions/adopt",
32
+ "method": "post",
33
+ "requestAdaptor": "api.data = {id: context._id}; return api;",
34
+ "adaptor": "",
35
+ "messages": {}
36
+ }
37
+ },
38
+ {
39
+ "actionType": "broadcast",
40
+ "args": {
41
+ "eventName": "@data.changed.pepsico_km_update"
42
+ },
43
+ "data": {
44
+ "objectName": "pepsico_km_update"
45
+ }
46
+ },
47
+ {
48
+ "ignoreError": false,
49
+ "actionType": "enabled",
50
+ "componentId": "u:pepsico_pick"
51
+ }
52
+ ]
53
+ }
54
+ }
12
55
  }
13
56
  ],
14
57
  "regions": [
@@ -0,0 +1,12 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2024-12-15 13:24:38
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2025-02-27 17:19:49
6
+ * @Description:
7
+ */
8
+ module.exports = {
9
+ standard_editVisible: function (object_name, record_id, record_permissions, record) {
10
+ return record.take != 'v2'
11
+ }
12
+ }
@@ -11,6 +11,6 @@ options:
11
11
  - label: 产品信息
12
12
  value: CPXX
13
13
  required: true
14
- sort_no: 350
14
+ sort_no: 400
15
15
  type: select
16
16
  visible_on: 'type == ''Brief'' '
@@ -8,7 +8,7 @@ index: true
8
8
  inlineHelpText: ''
9
9
  label: 主分部
10
10
  reference_to: company
11
- sort_no: 800
11
+ sort_no: 850
12
12
  sortable: true
13
13
  type: lookup
14
14
  visible_on: '{{false}}'
@@ -10,7 +10,7 @@ inlineHelpText: ''
10
10
  label: 所属分部
11
11
  multiple: true
12
12
  reference_to: company
13
- sort_no: 850
13
+ sort_no: 900
14
14
  sortable: true
15
15
  type: lookup
16
16
  visible_on: '{{false}}'
@@ -5,6 +5,6 @@ disabled: true
5
5
  group: 通用
6
6
  label: 创建时间
7
7
  readonly: true
8
- sort_no: 950
8
+ sort_no: 1000
9
9
  sortable: true
10
10
  type: datetime
@@ -5,5 +5,5 @@ group: 通用
5
5
  label: 创建人
6
6
  readonly: true
7
7
  reference_to: users
8
- sort_no: 1000
8
+ sort_no: 1050
9
9
  type: lookup
@@ -9,5 +9,5 @@ options:
9
9
  value: delete
10
10
  - label: 建议新增
11
11
  value: create
12
- sort_no: 300
12
+ sort_no: 350
13
13
  type: select
@@ -0,0 +1,8 @@
1
+ name: general_rule
2
+ amis:
3
+ id: 'u:199b6063b8ac'
4
+ group: 通用
5
+ label: 通用规则分类
6
+ sort_no: 150
7
+ type: text
8
+ visible_on: type == '通用规则'
@@ -20,6 +20,6 @@ options:
20
20
  - label: 已取消
21
21
  value: terminated
22
22
  readonly: true
23
- sort_no: 900
23
+ sort_no: 950
24
24
  type: select
25
25
  visible_on: '{{false}}'
@@ -7,6 +7,6 @@ group: 通用
7
7
  hidden: false
8
8
  inlineHelpText: ''
9
9
  label: 已锁定
10
- sort_no: 750
10
+ sort_no: 800
11
11
  type: boolean
12
12
  visible_on: '{{false}}'
@@ -5,6 +5,6 @@ disabled: true
5
5
  group: 通用
6
6
  label: 修改时间
7
7
  readonly: true
8
- sort_no: 1050
8
+ sort_no: 1100
9
9
  sortable: true
10
10
  type: datetime
@@ -5,5 +5,5 @@ group: 通用
5
5
  label: 修改人
6
6
  readonly: true
7
7
  reference_to: users
8
- sort_no: 1100
8
+ sort_no: 1150
9
9
  type: lookup
@@ -1,10 +1,10 @@
1
1
  name: new_rule
2
2
  amis:
3
3
  id: 'u:3c28037fe49b'
4
- description: 仅调整类型为建议删除时不填写该字段
4
+ description: ''
5
5
  group: 通用
6
6
  is_wide: true
7
7
  label: 建议的新规则
8
8
  rows: 3
9
- sort_no: 500
9
+ sort_no: 550
10
10
  type: textarea
@@ -7,6 +7,6 @@ group: 通用
7
7
  index: true
8
8
  inlineHelpText: ''
9
9
  label: 所有者
10
- sort_no: 700
10
+ sort_no: 750
11
11
  sortable: true
12
12
  visible_on: '{{false}}'
@@ -4,5 +4,5 @@ amis:
4
4
  group: 通用
5
5
  label: 原始素材
6
6
  reference_to: pepsico_material
7
- sort_no: 600
7
+ sort_no: 650
8
8
  type: lookup
@@ -6,5 +6,5 @@ is_wide: false
6
6
  label: 原始审批单
7
7
  reference_to: pepsico_material_approval
8
8
  required: false
9
- sort_no: 550
9
+ sort_no: 600
10
10
  type: lookup
@@ -60,7 +60,7 @@ amis:
60
60
  weight: 0
61
61
  actions: []
62
62
  data_type: text
63
- description: 仅Brief和PLS有值时填写该字段。
63
+ description: ''
64
64
  group: 通用
65
65
  inlineHelpText: ''
66
66
  is_wide: false
@@ -69,6 +69,6 @@ options:
69
69
  - label: '1'
70
70
  value: '1'
71
71
  required: true
72
- sort_no: 150
72
+ sort_no: 200
73
73
  type: select
74
74
  visible_on: 'type == ''PLS'' ||type == ''Brief'' '
@@ -4,6 +4,6 @@ amis:
4
4
  filters: []
5
5
  group: 通用
6
6
  label: 品牌/产品
7
- sort_no: 650
7
+ sort_no: 700
8
8
  type: text
9
9
  visible_on: '{{false}}'
@@ -1,7 +1,7 @@
1
1
  name: rule
2
2
  amis:
3
3
  id: 'u:569cbec571a6'
4
- description: 仅调整类型有值时填写该字段
4
+ description: ''
5
5
  filterable: true
6
6
  group: 通用
7
7
  index: true
@@ -10,5 +10,5 @@ label: 规则原文
10
10
  required: false
11
11
  rows: 2
12
12
  searchable: true
13
- sort_no: 450
13
+ sort_no: 500
14
14
  type: textarea
@@ -3,6 +3,6 @@ amis:
3
3
  id: 'u:828b3ad00bc9'
4
4
  group: 通用
5
5
  label: PLS标签
6
- sort_no: 250
6
+ sort_no: 300
7
7
  type: text
8
8
  visible_on: type == 'PLS'
@@ -10,5 +10,5 @@ options:
10
10
  value: v1
11
11
  - label: 已采纳
12
12
  value: v2
13
- sort_no: 400
13
+ sort_no: 450
14
14
  type: select
@@ -2,7 +2,7 @@ name: taste
2
2
  amis:
3
3
  id: 'u:32c842dd913a'
4
4
  data_type: text
5
- description: 仅PLS有值时填写该字段
5
+ description: ''
6
6
  group: 通用
7
7
  label: 口味
8
8
  options:
@@ -11,6 +11,6 @@ options:
11
11
  - label: 选项2
12
12
  value: v2
13
13
  required: true
14
- sort_no: 200
14
+ sort_no: 250
15
15
  type: text
16
16
  visible_on: type == 'PLS'
@@ -32,6 +32,7 @@ amis_schema: |-
32
32
  "name": "file",
33
33
  "id": "u:353a3c44dde9",
34
34
  "btnLabel": "文件上传",
35
+ "maxSize": 1073741824,
35
36
  "multiple": false,
36
37
  "useChunk": false,
37
38
  "accept": ".jpg, .jpeg, .png, .pptx, .mp4, .avi, .mov, .doc, .docx",
@@ -7,6 +7,6 @@
7
7
  */
8
8
  module.exports = {
9
9
  standard_editVisible: function (object_name, record_id, record_permissions, record) {
10
- return record.void_material !== true && (record.current_step === 'draft') && record.owner === context.userId && Steedos.isMobile() != true
10
+ return false
11
11
  }
12
12
  }
@@ -0,0 +1,220 @@
1
+ name: approve_ai
2
+ amis_schema: |-
3
+ {
4
+ "type": "service",
5
+ "body": [
6
+ {
7
+ "type": "button",
8
+ "label": "跳过AI",
9
+ "id": "u:pepsico_approval_ai",
10
+ "themeCss": {
11
+ "className": {
12
+ "background:default": "var(--private)",
13
+ "font:default": {
14
+ "color": "#ffffff"
15
+ },
16
+ "border:default": {
17
+ "top-border-color": "#ffffff",
18
+ "left-border-style": "solid",
19
+ "left-border-color": "#ffffff",
20
+ "right-border-style": "solid",
21
+ "right-border-color": "#ffffff",
22
+ "top-border-style": "solid",
23
+ "bottom-border-style": "solid",
24
+ "bottom-border-color": "#ffffff"
25
+ }
26
+ }
27
+ },
28
+ "onEvent": {
29
+ "click": {
30
+ "weight": 0,
31
+ "actions": [
32
+ {
33
+ "ignoreError": false,
34
+ "actionType": "dialog",
35
+ "dialog": {
36
+ "type": "dialog",
37
+ "title": "",
38
+ "body": [
39
+ {
40
+ "id": "u:38a25f93eed1",
41
+ "type": "form",
42
+ "title": "表单",
43
+ "mode": "normal",
44
+ "dsType": "api",
45
+ "feat": "Insert",
46
+ "body": [
47
+ {
48
+ "type": "textarea",
49
+ "label": "意见",
50
+ "name": "textarea",
51
+ "id": "u:ef10eb75016a",
52
+ "minRows": 3,
53
+ "maxRows": 20
54
+ },
55
+ {
56
+ "type": "select",
57
+ "label": "Approval Status",
58
+ "name": "approvalStatus",
59
+ "options": [
60
+ {
61
+ "label": "核准",
62
+ "value": "approved"
63
+ },
64
+ {
65
+ "label": "驳回",
66
+ "value": "rejected"
67
+ }
68
+ ],
69
+ "id": "u:78a0b96f7ef6",
70
+ "multiple": false,
71
+ "selectFirst": true
72
+ }
73
+ ],
74
+ "actions": [
75
+ {
76
+ "type": "button",
77
+ "label": "提交",
78
+ "onEvent": {
79
+ "click": {
80
+ "actions": [
81
+ {
82
+ "actionType": "submit",
83
+ "componentId": "u:38a25f93eed1"
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ "level": "primary"
89
+ }
90
+ ],
91
+ "resetAfterSubmit": true,
92
+ "onEvent": {
93
+ "submitSucc": {
94
+ "weight": 0,
95
+ "actions": [
96
+ {
97
+ "ignoreError": false,
98
+ "actionType": "closeDialog"
99
+ },
100
+ {
101
+ "actionType": "broadcast",
102
+ "args": {
103
+ "eventName": "@data.changed.pepsico_material_approval"
104
+ },
105
+ "data": {
106
+ "objectName": "pepsico_material_approval"
107
+ }
108
+ }
109
+ ]
110
+ }
111
+ },
112
+ "api": {
113
+ "url": "/api/pepsico-content/approve/submit/${recordId}",
114
+ "method": "post",
115
+ "requestAdaptor": "api.data = {\n approvalStatus: context.approvalStatus\n}\n\nreturn api;",
116
+ "adaptor": "",
117
+ "messages": {}
118
+ }
119
+ }
120
+ ],
121
+ "id": "u:50d5b179b219",
122
+ "showCloseButton": true,
123
+ "closeOnOutside": false,
124
+ "closeOnEsc": false,
125
+ "showErrorMsg": true,
126
+ "showLoading": true,
127
+ "draggable": false,
128
+ "actions": [
129
+ {
130
+ "type": "button",
131
+ "label": "驳回",
132
+ "id": "u:8bac1ddd43f1",
133
+ "editorState": "default",
134
+ "onEvent": {
135
+ "click": {
136
+ "weight": 0,
137
+ "actions": [
138
+ {
139
+ "componentId": "u:78a0b96f7ef6",
140
+ "ignoreError": false,
141
+ "actionType": "setValue",
142
+ "args": {
143
+ "value": "rejected"
144
+ }
145
+ },
146
+ {
147
+ "componentId": "u:38a25f93eed1",
148
+ "ignoreError": false,
149
+ "actionType": "submit",
150
+ "outputVar": "submitResult"
151
+ }
152
+ ]
153
+ }
154
+ }
155
+ },
156
+ {
157
+ "type": "button",
158
+ "label": "核准",
159
+ "primary": true,
160
+ "id": "u:adc7dd843581",
161
+ "onEvent": {
162
+ "click": {
163
+ "weight": 0,
164
+ "actions": [
165
+ {
166
+ "componentId": "u:78a0b96f7ef6",
167
+ "ignoreError": false,
168
+ "actionType": "setValue",
169
+ "args": {
170
+ "value": "approved"
171
+ }
172
+ },
173
+ {
174
+ "componentId": "u:38a25f93eed1",
175
+ "ignoreError": false,
176
+ "actionType": "submit",
177
+ "outputVar": "submitResult"
178
+ }
179
+ ]
180
+ }
181
+ },
182
+ "editorState": "default"
183
+ }
184
+ ],
185
+ "actionType": "dialog",
186
+ "size": "md"
187
+ }
188
+ }
189
+ ]
190
+ }
191
+ },
192
+ "editorState": "default",
193
+ "visibleOn": "${current_step == 'ai_review'&& context.user.profile == 'admin'}"
194
+ }
195
+ ],
196
+ "regions": [
197
+ "body"
198
+ ],
199
+ "data": {
200
+ "context": {},
201
+ "dataComponentId": "",
202
+ "record_id": "",
203
+ "record": {},
204
+ "permissions": {}
205
+ },
206
+ "id": "u:c1a5ca639fda",
207
+ "bodyClassName": "p-0",
208
+ "dsType": "api",
209
+ "asideResizor": false,
210
+ "pullRefresh": {
211
+ "disabled": true
212
+ },
213
+ "definitions": {}
214
+ }
215
+ is_enable: true
216
+ label: 跳过AI
217
+ locked: false
218
+ 'on': record_only
219
+ type: amis_button
220
+ visible: true