权限隔离+2D蓝图修复: isAssignee按钮显隐+只读提示+分支标签(badge-main/sub)+并行同Y确认
This commit is contained in:
@ -24,7 +24,7 @@
|
||||
@tap="node.records && node.records.length && $emit('viewRecords', node)">
|
||||
|
||||
<view class="cn-header">
|
||||
<text class="cn-name">{{ node.task_name }}</text>
|
||||
<text :class="node.parent_task_id ? 'badge-sub' : 'badge-main'">{{ node.parent_task_id ? branchLabelMap[node.id] || '分支' : '主分支' }}</text>
|
||||
<text :class="['cn-badge', statusColor(node.status)]">{{ statusLabel(node.status) }}</text>
|
||||
</view>
|
||||
|
||||
@ -106,6 +106,23 @@ export default {
|
||||
if (this.product) walk(this.product.task_tree);
|
||||
return map;
|
||||
},
|
||||
branchLabelMap() {
|
||||
const map = {};
|
||||
const traverse = (tasks, prefix) => {
|
||||
if (!tasks) return;
|
||||
tasks.forEach((t, i) => {
|
||||
map[t.id] = prefix ? `分支 ${prefix}${i + 1}` : '分支 1';
|
||||
traverse(t.child_tasks, prefix ? `${prefix}${i + 1}.` : `${i + 1}.`);
|
||||
});
|
||||
};
|
||||
if (this.product && this.product.task_tree) {
|
||||
this.product.task_tree.forEach((t, i) => {
|
||||
map[t.id] = '主分支';
|
||||
traverse(t.child_tasks, `${i + 1}.`);
|
||||
});
|
||||
}
|
||||
return map;
|
||||
},
|
||||
canvasWidth() { if (!this.treeNodes.length) return 400; return Math.max(800, Math.max(...this.treeNodes.map(n => n.x)) + 300); },
|
||||
canvasHeight() { if (!this.treeNodes.length) return 400; return Math.max(800, Math.max(...this.treeNodes.map(n => n.y)) + 300); }
|
||||
},
|
||||
@ -145,6 +162,8 @@ export default {
|
||||
.canvas-node.s-green { border-left-color: #22c55e; }
|
||||
.canvas-node.s-red { border-left-color: #ef4444; }
|
||||
.cn-header { display: flex; align-items: center; justify-content: space-between; }
|
||||
.badge-main { font-size: 10px; padding: 2px 8px; border-radius: 6px; background: #2563eb; color: #fff; font-weight: 700; }
|
||||
.badge-sub { font-size: 10px; padding: 2px 8px; border-radius: 6px; background: #ede9fe; color: #7c3aed; font-weight: 700; }
|
||||
.cn-name { font-size: 24px; font-weight: 800; color: #1f2937; }
|
||||
.cn-badge { font-size: 14px; padding: 4px 12px; border-radius: 8px; font-weight: 700; }
|
||||
.cn-badge.s-yellow { background: #fef3c7; color: #b45309; }
|
||||
|
||||
Reference in New Issue
Block a user