crowd-control-service.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. /**
  2. * @file 人群包管理基础服务
  3. * @author jiayufei(jiayufei@c-top.com.cn)
  4. */
  5. class AppMarketService {
  6. constructor() {}
  7. // 相关账户的table列表
  8. setAcountColumns() {
  9. return [
  10. {
  11. title: '账户名称',
  12. dataIndex: 'authName',
  13. width: '30%',
  14. align: 'center'
  15. },
  16. {
  17. title: '覆盖数量',
  18. dataIndex: 'coverNum',
  19. width: '30%',
  20. align: 'center'
  21. },
  22. {
  23. title: '人群包数量',
  24. dataIndex: 'populationCount',
  25. width: '20%',
  26. align: 'center'
  27. },
  28. {
  29. title: '状态',
  30. dataIndex: 'statusStr',
  31. width: '20%',
  32. align: 'center'
  33. }
  34. ]
  35. }
  36. // 原因的table列表
  37. setCauseColumns() {
  38. return [
  39. {
  40. title: '账户名称',
  41. dataIndex: 'authName',
  42. width: '25%',
  43. align: 'center'
  44. },
  45. {
  46. title: '推送结果',
  47. dataIndex: 'result',
  48. width: '25%',
  49. align: 'center'
  50. },
  51. {
  52. title: '失败原因',
  53. dataIndex: 'message',
  54. width: '25%',
  55. align: 'center',
  56. customRender(t) {
  57. if(t === 'OK') {
  58. return '-';
  59. }
  60. else {
  61. return t;
  62. }
  63. }
  64. },
  65. {
  66. title: '操作',
  67. dataIndex: 'action',
  68. scopedSlots: {customRender: 'action'},
  69. width: '25%',
  70. align: 'center'
  71. }
  72. ]
  73. }
  74. // 相关组的table列表
  75. setDepColumns() {
  76. return [
  77. {
  78. title: '广告组名称',
  79. dataIndex: 'unitName',
  80. width: '50%',
  81. align: 'center'
  82. },
  83. {
  84. title: '所属账户',
  85. dataIndex: 'authName',
  86. width: '50%',
  87. align: 'center'
  88. }
  89. ]
  90. }
  91. // 状态枚举
  92. setStatusTasks() {
  93. return [
  94. {
  95. label: 0,
  96. value: '计算中'
  97. },
  98. {
  99. label: 1,
  100. value: '已生效'
  101. },
  102. {
  103. label: 3,
  104. value: '推送中'
  105. },
  106. {
  107. label: 4,
  108. value: '已推送'
  109. },
  110. {
  111. label: 5,
  112. value: '计算失败'
  113. },
  114. {
  115. label: 6,
  116. value: '推送失败'
  117. },
  118. {
  119. label: 7,
  120. value: '已失效'
  121. }
  122. ]
  123. }
  124. // 上传人去报的校验规则
  125. setPersonRules() {
  126. return {
  127. name: [
  128. {required: true, message: '人群包名称不能为空', trigger: 'blur'},
  129. {min: 1, max: 20, message: '人群包名称不能超过20个字符', trigger: 'blur'}
  130. ],
  131. resource: [
  132. {required: true, message: '请选择匹配类型', trigger: 'change'}
  133. ]
  134. }
  135. }
  136. // 人群包类型枚举值
  137. setPopulationTypeTasks() {
  138. return [
  139. {
  140. label: 1,
  141. value: '上传人群'
  142. }, {
  143. label: 2,
  144. value: '广告人群'
  145. }, {
  146. label: 3,
  147. value: '主题专区'
  148. }, {
  149. label: 4,
  150. value: '逻辑规则'
  151. }, {
  152. label: 5,
  153. value: '人群扩展'
  154. }, {
  155. label: 6,
  156. value: '平台制定'
  157. }, {
  158. label: 7,
  159. value: '定制付费'
  160. }, {
  161. label: 8,
  162. value: '网红粉丝类别'
  163. }, {
  164. label: 9,
  165. value: '内容付费行为'
  166. }, {
  167. label: 10,
  168. value: '移动应用安装'
  169. }, {
  170. label: 11,
  171. value: '快手使用活跃度'
  172. }, {
  173. label: 12,
  174. value: '行业分类'
  175. }, {
  176. label: 13,
  177. value: '商业兴趣'
  178. }, {
  179. label: 14,
  180. value: '固话标签'
  181. }, {
  182. label: 15,
  183. value: '行业偏好'
  184. }, {
  185. label: 16,
  186. value: '第三方标签'
  187. }, {
  188. label: 17,
  189. value: '产品关键词'
  190. }, {
  191. label: 19,
  192. value: '应用渗透率'
  193. }, {
  194. label: 22,
  195. value: '指定网红'
  196. }, {
  197. label: 23,
  198. value: '行业分类'
  199. }
  200. ]
  201. }
  202. // 匹配类型枚举值
  203. setMateTypeTasks() {
  204. return [
  205. {
  206. label: 1,
  207. value: 'IMEI'
  208. }, {
  209. label: 2,
  210. value: 'IDFA'
  211. }, {
  212. label: 3,
  213. value: 'IMEI_MD5'
  214. }, {
  215. label: 4,
  216. value: 'IDFA_MD5'
  217. }, {
  218. label: 5,
  219. value: '手机号-MD5'
  220. }, {
  221. label: 7,
  222. value: 'OAID'
  223. }, {
  224. label: 8,
  225. value: 'OAID_MD5'
  226. }
  227. ]
  228. }
  229. }
  230. export default new AppMarketService();