rules-page.component.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <section class="plain-view">
  2. <header class="page-hero">
  3. <div class="page-hero-copy">
  4. <p class="eyebrow">规则库</p>
  5. <h2>把商务和媒介经验沉淀成可复用规则</h2>
  6. <small>规则不会神秘生效,所有临时规则、AI 提炼规则都能看到来源和影响。</small>
  7. <div class="page-guide">
  8. <span><b>目标</b>管理提号判断依据</span>
  9. <span><b>操作</b>启停规则、试算影响、补临时规则</span>
  10. <span><b>产出</b>本次规则组合</span>
  11. </div>
  12. </div>
  13. <div class="page-actions">
  14. <button type="button" class="primary-button compact" (click)="state.addTemporaryRule()">+ 新增临时规则</button>
  15. </div>
  16. </header>
  17. <div class="temp-rule-box full">
  18. <label>
  19. 规则标题
  20. <input [(ngModel)]="state.tempRuleTitle" />
  21. </label>
  22. <label>
  23. 影响预估
  24. <input [(ngModel)]="state.tempRuleImpact" />
  25. </label>
  26. </div>
  27. <section class="rule-layer-grid">
  28. <article>
  29. <span>硬性剔除</span>
  30. <strong>黑名单、合作禁区、低活跃</strong>
  31. <small>命中后直接剔除或进入需复核池</small>
  32. </article>
  33. <article>
  34. <span>加权排序</span>
  35. <strong>风格、预算、粉丝画像</strong>
  36. <small>影响综合分和强推荐排序</small>
  37. </article>
  38. <article>
  39. <span>组合均衡</span>
  40. <strong>平台、价格带、头腰尾</strong>
  41. <small>保证整份名单不重复、不偏科</small>
  42. </article>
  43. <article>
  44. <span>客户偏好</span>
  45. <strong>反馈沉淀和临时需求</strong>
  46. <small>先人工确认,再决定生效范围</small>
  47. </article>
  48. </section>
  49. <section class="rule-ops-panel">
  50. <article>
  51. <span>当前启用</span>
  52. <strong>{{ state.selectedRulesCount }} 条规则</strong>
  53. <small>影响召回、评分、预算保护和客户版字段展示</small>
  54. </article>
  55. <article>
  56. <span>待复核账号</span>
  57. <strong>{{ state.reviewQueueCandidates.length }} 个</strong>
  58. <small>可用沙盘试算后批量转为备选或剔除</small>
  59. </article>
  60. <article>
  61. <span>选中规则</span>
  62. <strong>{{ state.selectedRule.category }}</strong>
  63. <small>{{ state.selectedRule.impact }}</small>
  64. </article>
  65. </section>
  66. <section class="rule-conflict-strip">
  67. <article *ngFor="let conflict of state.ruleConflicts">
  68. <em>{{ conflict.level }}</em>
  69. <div>
  70. <strong>{{ conflict.title }}</strong>
  71. <p>{{ conflict.detail }}</p>
  72. </div>
  73. </article>
  74. </section>
  75. <section class="rule-sandbox">
  76. <div class="section-mini-head">
  77. <div>
  78. <strong>规则沙盘试算</strong>
  79. <small>选中一条规则,模拟客户临时要求对名单的影响</small>
  80. </div>
  81. <button type="button" class="primary-button compact" (click)="state.runRuleSandbox()">运行试算</button>
  82. </div>
  83. <div class="sandbox-grid">
  84. <article class="sandbox-main">
  85. <span>当前规则</span>
  86. <h4>{{ state.selectedRule.title }}</h4>
  87. <p>{{ state.selectedRule.description }}</p>
  88. <label>
  89. 客户要求样例
  90. <textarea [(ngModel)]="state.ruleSandboxText" aria-label="规则沙盘客户要求"></textarea>
  91. </label>
  92. <label>
  93. 本次权重
  94. <input type="range" min="20" max="100" step="5" [(ngModel)]="state.ruleSandboxWeight" />
  95. <strong>{{ state.ruleSandboxWeight }}%</strong>
  96. </label>
  97. <em>{{ state.ruleSimulationState }}</em>
  98. </article>
  99. <article class="sandbox-tests">
  100. <strong>测试用例</strong>
  101. <label *ngFor="let item of state.ruleTestCases" [class.active]="item.enabled">
  102. <input type="checkbox" [checked]="item.enabled" (change)="state.toggleRuleTestCase(item)" />
  103. <div>
  104. <span>{{ item.label }}</span>
  105. <small>{{ item.condition }}</small>
  106. <p>{{ item.action }}</p>
  107. </div>
  108. </label>
  109. </article>
  110. </div>
  111. </section>
  112. <div class="rule-management">
  113. <article
  114. *ngFor="let rule of state.rules"
  115. [class.active]="state.selectedRule.id === rule.id"
  116. (click)="state.selectRule(rule)"
  117. >
  118. <span>{{ rule.id }}</span>
  119. <div>
  120. <strong>{{ rule.title }}</strong>
  121. <p>{{ rule.description }}</p>
  122. <small>{{ rule.source }} · {{ rule.impact }} · 命中 {{ rule.selected ? '12-48' : '0' }} 个账号</small>
  123. </div>
  124. <em>{{ rule.category }}</em>
  125. <button type="button" class="text-button" (click)="$event.stopPropagation(); state.toggleRule(rule)">
  126. {{ rule.selected ? '停用' : '启用' }}
  127. </button>
  128. </article>
  129. </div>
  130. </section>