fix: 需求池操作矩阵微调 + 来源管理 bug 修复
需求池:
- 已采纳状态去掉「删除」操作(推进后不应直接删除,要走拒绝路径)
来源管理:
- 清空预设 mock 数据(海底捞/西贝/喜茶/奈雪等 17 条),用户自己维护
- 修复新建需求选「新建的来源对象」时显示数字 ID bug:
原因是 RequirementModal 里 <option value={t.id}> 存了 ID,但 mock
和详情页直接读 sourceTarget 当名字展示,导致新建的对象只显示 ID。
改为 <option value={t.name}> 与 mock 数据格式对齐
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -390,8 +390,8 @@ function RequirementsPageContent() {
|
||||
关闭
|
||||
</button>
|
||||
)}
|
||||
{/* 删除:待评审/已采纳/已拒绝/已关闭 */}
|
||||
{(['pending_review', 'adopted', 'rejected', 'closed'] as const).includes(req.status as any) && (
|
||||
{/* 删除:待评审/已拒绝/已关闭(已采纳后不能直接删,需走拒绝) */}
|
||||
{(['pending_review', 'rejected', 'closed'] as const).includes(req.status as any) && (
|
||||
<button
|
||||
onClick={() => deleteRequirement(req.id)}
|
||||
className="h-6 px-2 rounded text-[11px] font-medium text-red-500 hover:bg-red-50 transition-colors"
|
||||
|
||||
@@ -232,7 +232,7 @@ export function RequirementModal({
|
||||
>
|
||||
<option value="">请选择</option>
|
||||
{filteredTargets.map((t) => (
|
||||
<option key={t.id} value={t.id}>
|
||||
<option key={t.id} value={t.name}>
|
||||
{t.name}
|
||||
</option>
|
||||
))}
|
||||
|
||||
@@ -27,32 +27,7 @@ interface RequirementState {
|
||||
|
||||
// --- Preset dictionaries ---
|
||||
|
||||
const PRESET_SOURCE_TARGETS: SourceTarget[] = [
|
||||
// customer type
|
||||
{ id: 'st-1', name: '海底捞', sourceType: 'customer', createdAt: '2024-01-01' },
|
||||
{ id: 'st-2', name: '西贝', sourceType: 'customer', createdAt: '2024-01-01' },
|
||||
{ id: 'st-3', name: '喜茶', sourceType: 'customer', createdAt: '2024-01-01' },
|
||||
{ id: 'st-4', name: '奈雪的茶', sourceType: 'customer', createdAt: '2024-01-01' },
|
||||
{ id: 'st-5', name: '麦当劳', sourceType: 'customer', createdAt: '2024-01-01' },
|
||||
// operation type
|
||||
{ id: 'st-6', name: '运营部', sourceType: 'operation', createdAt: '2024-01-01' },
|
||||
{ id: 'st-7', name: '销售部', sourceType: 'operation', createdAt: '2024-01-01' },
|
||||
{ id: 'st-8', name: '客服部', sourceType: 'operation', createdAt: '2024-01-01' },
|
||||
// internal
|
||||
{ id: 'st-9', name: '产品部', sourceType: 'internal', createdAt: '2024-01-01' },
|
||||
{ id: 'st-10', name: '技术部', sourceType: 'internal', createdAt: '2024-01-01' },
|
||||
// management
|
||||
{ id: 'st-11', name: '张总', sourceType: 'management', createdAt: '2024-01-01' },
|
||||
{ id: 'st-12', name: '李总', sourceType: 'management', createdAt: '2024-01-01' },
|
||||
// aftersale
|
||||
{ id: 'st-13', name: '实施部', sourceType: 'aftersale', createdAt: '2024-01-01' },
|
||||
{ id: 'st-14', name: '客服部', sourceType: 'aftersale', createdAt: '2024-01-01' },
|
||||
// market
|
||||
{ id: 'st-15', name: '市场部', sourceType: 'market', createdAt: '2024-01-01' },
|
||||
// competitor
|
||||
{ id: 'st-16', name: '美团收银', sourceType: 'competitor', createdAt: '2024-01-01' },
|
||||
{ id: 'st-17', name: '客如云', sourceType: 'competitor', createdAt: '2024-01-01' },
|
||||
];
|
||||
const PRESET_SOURCE_TARGETS: SourceTarget[] = [];
|
||||
|
||||
const PRESET_TYPES: DictItem[] = [
|
||||
{ id: 'type-1', name: '新功能', createdAt: '2024-01-01' },
|
||||
|
||||
Reference in New Issue
Block a user