style: 暗黑模式

This commit is contained in:
zhanghao 2026-10-15 16:36:24 +08:00
parent 8982ff3108
commit 2cb0c779de
14 changed files with 66 additions and 56 deletions

View File

@ -39,8 +39,8 @@ const satisfiedCount = computed(() => conditions.value.filter(condition => condi
function brief(value: string | null) { return value ? localTime(value, 'Asia/Shanghai').slice(5, 16).replace('T', ' ') : '未设置' }
</script>
<style scoped>
.flow-item{box-sizing:border-box;display:flex;flex-direction:column;gap:3px;padding:8px 10px;border:1px solid #dfe6f1;border-radius:9px;background:#fff;box-shadow:0 3px 9px #26395109;color:#293b56}.flow-item.blocked{border-left:3px solid #e9b15b}.flow-item.done{border-left:3px solid #63b38d}.item-drag{display:flex;gap:6px;align-items:center;min-height:20px;cursor:grab}.item-type{font-size:11px;color:#66799b}.priority{margin-left:auto;font-size:11px;color:#9b789e}.item-title{display:block;width:100%;min-height:18px;margin:0;padding:0;border:0;text-align:left;background:transparent;font-size:13px;line-height:18px;font-weight:600;color:#2f4465;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.item-meta,.item-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:18px;font-size:11px;line-height:16px;color:#7b8aa0}.item-meta>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item-meta :deep(.el-button),.item-footer :deep(.el-button){height:18px;min-height:0;padding:0}.item-footer{margin-top:auto}.item-dates{font-size:10px;line-height:16px;color:#8b96a8}.blocked-text{color:#bf8d3f}.predecessors{margin-top:1px;padding-top:4px;border-top:1px solid #edf1f7}.predecessor-heading{font-size:11px;color:#8190a7;line-height:14px;margin-bottom:2px}.predecessor-row{display:flex;align-items:center;gap:7px;min-height:19px}.condition-state{font-size:10px;white-space:nowrap;color:#bc8c3f;background:#fff5e4;padding:1px 4px;border-radius:3px}.condition-state[class~="satisfied"]{color:#439875;background:#edf8f2}.predecessor-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;background:transparent;padding:0;text-align:left;font-size:11px;color:#5a7cad;cursor:pointer}.predecessor-name.unavailable{color:#929baa;cursor:default}.predecessor-more{display:block;height:20px;border:0;background:transparent;padding:0;color:#7390bf;font-size:11px;cursor:pointer}.all-predecessors{max-height:320px;overflow:auto}
.child-list{box-sizing:border-box;flex:none;display:flex;flex-direction:column;gap:2px;min-height:0;margin-top:1px;padding-top:5px;border-top:1px solid #edf1f7;overflow-y:auto;overscroll-behavior:contain}.child-row{box-sizing:border-box;display:flex;align-items:center;gap:6px;width:100%;height:22px;min-height:22px;border:0;background:transparent;padding:0;text-align:left;cursor:pointer}.child-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:#5a7cad}
.flow-item{box-sizing:border-box;display:flex;flex-direction:column;gap:3px;padding:8px 10px;border:1px solid var(--el-border-color-light);border-radius:9px;background:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-lighter);color:var(--el-text-color-primary)}.flow-item.blocked{border-left:3px solid var(--el-color-warning)}.flow-item.done{border-left:3px solid var(--el-color-success)}.item-drag{display:flex;gap:6px;align-items:center;min-height:20px;cursor:grab}.item-type{font-size:11px;color:var(--el-text-color-secondary)}.priority{margin-left:auto;font-size:11px;color:var(--el-text-color-secondary)}.item-title{display:block;width:100%;min-height:18px;margin:0;padding:0;border:0;text-align:left;background:transparent;font-size:13px;line-height:18px;font-weight:600;color:var(--el-text-color-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.item-meta,.item-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:18px;font-size:11px;line-height:16px;color:var(--el-text-color-secondary)}.item-meta>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item-meta :deep(.el-button),.item-footer :deep(.el-button){height:18px;min-height:0;padding:0}.item-footer{margin-top:auto}.item-dates{font-size:10px;line-height:16px;color:var(--el-text-color-secondary)}.blocked-text{color:var(--el-color-warning)}.predecessors{margin-top:1px;padding-top:4px;border-top:1px solid var(--el-border-color-lighter)}.predecessor-heading{font-size:11px;color:var(--el-text-color-secondary);line-height:14px;margin-bottom:2px}.predecessor-row{display:flex;align-items:center;gap:7px;min-height:19px}.condition-state{font-size:10px;white-space:nowrap;color:var(--el-color-warning);background:var(--el-color-warning-light-9);padding:1px 4px;border-radius:3px}.condition-state[class~="satisfied"]{color:var(--el-color-success);background:var(--el-color-success-light-9)}.predecessor-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;background:transparent;padding:0;text-align:left;font-size:11px;color:var(--el-color-primary);cursor:pointer}.predecessor-name.unavailable{color:var(--el-text-color-disabled);cursor:default}.predecessor-more{display:block;height:20px;border:0;background:transparent;padding:0;color:var(--el-color-primary);font-size:11px;cursor:pointer}.all-predecessors{max-height:320px;overflow:auto}
.child-list{box-sizing:border-box;flex:none;display:flex;flex-direction:column;gap:2px;min-height:0;margin-top:1px;padding-top:5px;border-top:1px solid var(--el-border-color-lighter);overflow-y:auto;overscroll-behavior:contain}.child-row{box-sizing:border-box;display:flex;align-items:center;gap:6px;width:100%;height:22px;min-height:22px;border:0;background:transparent;padding:0;text-align:left;cursor:pointer}.child-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--el-color-primary)}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.child-row :deep([class~="el-tag"]){flex:none}
</style>

View File

@ -15,8 +15,8 @@ defineProps<{ data: FlowNodeData }>()
const emit = defineEmits<{ view: [id: number]; create: [id: number]; rework: [id: number]; history: [id: number] }>()
</script>
<style scoped>
.phase-group{width:100%;height:100%;background:#f3f6fc;border:1px solid #dce4f1;border-radius:11px;color:#405777;cursor:pointer;box-sizing:border-box}.stage-drag{display:flex;align-items:center;gap:8px;padding:13px 14px 4px;cursor:grab}.stage-drag strong{font-size:13px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-version{font-size:11px;color:#8092af}.phase-dot{width:8px;height:8px;border-radius:50%;background:#6582c4;flex:none}.phase-dot.IN_PROGRESS{background:#e3a039}.phase-dot.COMPLETED{background:#35a66b}
.phase-group{width:100%;height:100%;background:var(--el-fill-color-light);border:1px solid var(--el-border-color-light);border-radius:11px;color:var(--el-text-color-primary);cursor:pointer;box-sizing:border-box}.stage-drag{display:flex;align-items:center;gap:8px;padding:13px 14px 4px;cursor:grab}.stage-drag strong{font-size:13px;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-version{font-size:11px;color:var(--el-text-color-secondary)}.phase-dot{width:8px;height:8px;border-radius:50%;background:var(--el-text-color-placeholder);flex:none}.phase-dot.IN_PROGRESS{background:var(--el-color-warning)}.phase-dot.COMPLETED{background:var(--el-color-success)}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.phase-dot[class~="LEGACY_PASSED"]{background:#d69b38}.phase-body{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:1px 14px 0}.stage-items{font-size:12px;font-weight:600;color:#426eae}.stage-status{font-size:11px;color:#8190a5;white-space:nowrap}.phase-actions{display:flex;align-items:center;gap:11px;padding:5px 14px}.stage-items,.phase-actions button{border:0;background:transparent;padding:0;cursor:pointer}.phase-actions button{color:#4c7fd0;font-size:11px;white-space:nowrap}
.phase-group :deep([class~="vue-flow__handle"]){width:10px;height:10px;background:#5d82c9;border:2px solid #fff}
.phase-dot[class~="LEGACY_PASSED"]{background:var(--el-color-warning)}.phase-body{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:1px 14px 0}.stage-items{font-size:12px;font-weight:600;color:var(--el-color-primary)}.stage-status{font-size:11px;color:var(--el-text-color-secondary);white-space:nowrap}.phase-actions{display:flex;align-items:center;gap:11px;padding:5px 14px}.stage-items,.phase-actions button{border:0;background:transparent;padding:0;cursor:pointer}.phase-actions button{color:var(--el-color-primary);font-size:11px;white-space:nowrap}
.phase-group :deep([class~="vue-flow__handle"]){width:10px;height:10px;background:var(--el-color-primary);border:2px solid var(--el-bg-color-overlay)}
</style>

View File

@ -161,6 +161,6 @@ function historyText(raw: string): string {
return '工作项信息已更新'
}
</script>
<style scoped>.detail-title{display:flex;align-items:center;gap:12px}.detail-title h2{font-size:23px;line-height:1.5;margin:0}.detail-tags,.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}.description{white-space:pre-wrap;color:#68788e;line-height:1.8;margin:22px 0}.failure{white-space:pre-line;margin:14px 0}section{border-top:1px solid #e9edf4;margin-top:28px;padding-top:12px}.section-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.section-heading span{font-size:13px;color:#8090a5}.section-heading .el-button{margin-left:auto}.condition{border:1px solid #e6ebf3;border-radius:8px;padding:14px;margin-bottom:12px}.condition>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.condition p{font-size:13px;color:#76879d;line-height:1.7;margin:8px 0}.muted{color:#8c99ab;font-size:13px;line-height:1.8;margin:8px 0 16px}.comment{background:#f7f9fc;padding:14px;border-radius:8px;margin-bottom:12px}.comment p{white-space:pre-wrap;line-height:1.7}.comment-submit{margin-top:12px}.upload-link{font-size:13px;color:#6275ed;cursor:pointer}.upload-link input{display:none}.attachment{display:flex;justify-content:space-between;padding:9px 0;font-size:12px;color:#8491a3}.history{padding:10px 0;border-bottom:1px solid #eef1f5;font-size:12px}.history span{margin-left:14px;color:#8796a9}.history pre{white-space:pre-wrap;overflow-wrap:anywhere;color:#8290a4}
<style scoped>.detail-title{display:flex;align-items:center;gap:12px}.detail-title h2{font-size:23px;line-height:1.5;margin:0}.detail-tags,.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}.description{white-space:pre-wrap;color:var(--el-text-color-regular);line-height:1.8;margin:22px 0}.failure{white-space:pre-line;margin:14px 0}section{border-top:1px solid var(--el-border-color-lighter);margin-top:28px;padding-top:12px}.section-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.section-heading span{font-size:13px;color:var(--el-text-color-secondary)}.section-heading .el-button{margin-left:auto}.condition{border:1px solid var(--el-border-color-light);border-radius:8px;padding:14px;margin-bottom:12px}.condition>div{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.condition p{font-size:13px;color:var(--el-text-color-regular);line-height:1.7;margin:8px 0}.muted{color:var(--el-text-color-secondary);font-size:13px;line-height:1.8;margin:8px 0 16px}.comment{background:var(--el-fill-color-light);padding:14px;border-radius:8px;margin-bottom:12px}.comment p{white-space:pre-wrap;line-height:1.7}.comment-submit{margin-top:12px}.upload-link{font-size:13px;color:var(--el-color-primary);cursor:pointer}.upload-link input{display:none}.attachment{display:flex;justify-content:space-between;padding:9px 0;font-size:12px;color:var(--el-text-color-secondary)}.history{padding:10px 0;border-bottom:1px solid var(--el-border-color-lighter);font-size:12px}.history span{margin-left:14px;color:var(--el-text-color-secondary)}.history pre{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--el-text-color-secondary)}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
:deep([class~="el-select"]){width:100%}</style>

View File

@ -74,7 +74,7 @@ defineExpose({ isEditing: computed(() => editorOpen.value || previewOpen.value |
</script>
<style scoped>.iteration-controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.iteration-controls>[class~="el-select"]{width:250px}.iteration-note{font-size:12px;color:#8492a6}
.iteration-controls>[class~="el-select"]{width:250px}.iteration-note{font-size:12px;color:var(--el-text-color-secondary)}
.el-form [class~="el-select"]{width:100%}
.el-dialog [class~="el-checkbox"]{display:block;height:auto;white-space:normal;margin:10px 0}
[class~="el-textarea"]{margin-top:12px}</style>

View File

@ -83,6 +83,6 @@ async function commit() {
</script>
<style scoped>.rework-form{margin-top:14px}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.rework-form :deep([class~="el-select"]){width:100%}.rework-alert{margin:10px 0}.rework-note{font-size:12px;color:#78879c;line-height:1.6}.rework-blocker{margin:8px 0}.addition-section{margin:12px 0;padding:10px;border:1px solid #e5eaf1;border-radius:6px}.addition-section strong{font-size:12px;color:#435472}.addition-row{display:flex;gap:8px;margin:7px 0}
.rework-form :deep([class~="el-select"]){width:100%}.rework-alert{margin:10px 0}.rework-note{font-size:12px;color:var(--el-text-color-secondary);line-height:1.6}.rework-blocker{margin:8px 0}.addition-section{margin:12px 0;padding:10px;border:1px solid var(--el-border-color-light);border-radius:6px}.addition-section strong{font-size:12px;color:var(--el-text-color-regular)}.addition-row{display:flex;gap:8px;margin:7px 0}
.addition-row [class~="el-select"]{width:130px;flex:none}
.addition-row [class~="el-input"]{flex:1}</style>

View File

@ -94,7 +94,7 @@ async function openRevision(row: StageRevision, reset = true) {
/** 历史时间统一按北京时间展示,未设置的排期和开始时间保留空值语义。 */
function readable(value: string | null | undefined): string { return value ? localTime(value, 'Asia/Shanghai').replace('T', ' ').slice(0, 16) : '未设置' }
</script>
<style scoped>.drawer-intro,.drawer-filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 12px}.drawer-intro{font-size:12px;color:#77879d}.drawer-intro .el-button{margin-left:auto}
<style scoped>.drawer-intro,.drawer-filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 12px}.drawer-intro{font-size:12px;color:var(--el-text-color-secondary)}.drawer-intro .el-button{margin-left:auto}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.drawer-filters [class~="el-input"]{width:220px}
.drawer-filters [class~="el-select"]{width:130px}.drawer-count,.history-muted{font-size:12px;color:#8492a6}.history-message,.history-table{margin-top:12px}h3{font-size:14px;margin:20px 0 9px}.history-edges{display:flex;flex-wrap:wrap;gap:6px}</style>
.drawer-filters [class~="el-select"]{width:130px}.drawer-count,.history-muted{font-size:12px;color:var(--el-text-color-secondary)}.history-message,.history-table{margin-top:12px}h3{font-size:14px;margin:20px 0 9px}.history-edges{display:flex;flex-wrap:wrap;gap:6px}</style>

View File

@ -22,6 +22,6 @@ function pick(value: string | null) {
catch { invalid.value = '请输入有效的日期时间'; emit('invalid', true) }
}
</script>
<style scoped>.time-hint{font-size:12px;color:#7c8799;margin-top:6px}.time-error{font-size:12px;color:#c45656;margin-top:6px}
<style scoped>.time-hint{font-size:12px;color:var(--el-text-color-secondary);margin-top:6px}.time-error{font-size:12px;color:var(--el-color-danger);margin-top:6px}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
:deep([class~="el-date-editor"]){max-width:100%;width:100%}</style>

View File

@ -54,22 +54,22 @@ async function drop(state: Lifecycle) {
</script>
<style scoped>
.board{display:grid;grid-template-columns:repeat(5,minmax(224px,1fr));grid-template-rows:minmax(0,1fr);gap:10px;min-width:0;overflow-x:auto;overflow-y:hidden;padding-bottom:6px;box-sizing:border-box}
.lane{display:flex;flex-direction:column;min-width:0;min-height:0;background:#f4f6fa;border-radius:9px;padding:10px 5px 8px 9px;overflow:hidden}
.lane header{flex:none;font-size:13px;font-weight:600;line-height:20px;margin:0 5px 8px 1px}.lane header span{margin-left:6px;color:#8390a1;font-size:12px;font-weight:400}
.lane{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--el-fill-color-light);border-radius:9px;padding:10px 5px 8px 9px;overflow:hidden}
.lane header{flex:none;font-size:13px;font-weight:600;line-height:20px;margin:0 5px 8px 1px}.lane header span{margin-left:6px;color:var(--el-text-color-secondary);font-size:12px;font-weight:400}
/* 始终保留滚动区域与槽位,仅改变滚动条颜色,悬停显隐不会导致卡片宽度跳动。 */
.lane-content{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:transparent transparent;padding-right:4px}
.lane:hover .lane-content,.lane-content:focus-visible{scrollbar-color:#b8c5d8 transparent}.lane-content:focus-visible{outline:1px solid #a8bee2;outline-offset:-1px;border-radius:5px}
.lane:hover .lane-content,.lane-content:focus-visible{scrollbar-color:var(--el-fill-color-darker) transparent}.lane-content:focus-visible{outline:1px solid var(--el-color-primary);outline-offset:-1px;border-radius:5px}
.lane-content::-webkit-scrollbar{width:6px}.lane-content::-webkit-scrollbar-track{background:transparent}.lane-content::-webkit-scrollbar-thumb{background:transparent;border-radius:5px}
.lane:hover .lane-content::-webkit-scrollbar-thumb,.lane-content:focus-visible::-webkit-scrollbar-thumb{background:#b8c5d8}
.work-card{background:#fff;border:1px solid #e5e9f1;border-radius:6px;padding:8px 9px;margin-bottom:7px;cursor:pointer;transition:border-color .15s}.work-card:hover{border-color:#bbcee9}.work-card[draggable=true]{cursor:grab}.work-card:last-child{margin-bottom:0}
.card-meta{display:flex;align-items:center;gap:6px;color:#8a97aa;font-size:10px;line-height:17px;margin-bottom:3px}.card-id{flex:none}
.lane:hover .lane-content::-webkit-scrollbar-thumb,.lane-content:focus-visible::-webkit-scrollbar-thumb{background:var(--el-fill-color-darker)}
.work-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);border-radius:6px;padding:8px 9px;margin-bottom:7px;cursor:pointer;transition:border-color .15s}.work-card:hover{border-color:var(--el-color-primary-light-5)}.work-card[draggable=true]{cursor:grab}.work-card:last-child{margin-bottom:0}
.card-meta{display:flex;align-items:center;gap:6px;color:var(--el-text-color-secondary);font-size:10px;line-height:17px;margin-bottom:3px}.card-id{flex:none}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.card-meta>[class~="el-tag"]{margin-left:auto;flex:none}
.stage-version{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#8a98ab}
.card-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:13px;font-weight:600;line-height:18px;color:#34465f}
.card-family{font-size:10px;line-height:16px;color:#8593a8;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-footer{display:flex;align-items:center;justify-content:space-between;gap:4px 6px;flex-wrap:wrap;margin-top:5px}.card-tags{display:flex;flex-wrap:wrap;gap:3px}.card-tags:empty{display:none}.card-deadline{color:#8a97aa;font-size:10px;line-height:16px;white-space:nowrap}
.stage-version{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:var(--el-text-color-secondary)}
.card-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:13px;font-weight:600;line-height:18px;color:var(--el-text-color-primary)}
.card-family{font-size:10px;line-height:16px;color:var(--el-text-color-secondary);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card-footer{display:flex;align-items:center;justify-content:space-between;gap:4px 6px;flex-wrap:wrap;margin-top:5px}.card-tags{display:flex;flex-wrap:wrap;gap:3px}.card-tags:empty{display:none}.card-deadline{color:var(--el-text-color-secondary);font-size:10px;line-height:16px;white-space:nowrap}
.work-card :deep([class~="el-tag"]){font-size:10px;line-height:16px;height:18px;padding:0 4px}
.empty-lane{text-align:center;padding:24px 4px;font-size:12px;color:#9aa6b8}
@media(hover:none){.lane-content{scrollbar-color:#cbd4e2 transparent}.lane-content::-webkit-scrollbar-thumb{background:#cbd4e2}}
.empty-lane{text-align:center;padding:24px 4px;font-size:12px;color:var(--el-text-color-secondary)}
@media(hover:none){.lane-content{scrollbar-color:var(--el-fill-color-darker) transparent}.lane-content::-webkit-scrollbar-thumb{background:var(--el-fill-color-darker)}}
</style>

View File

@ -7,8 +7,8 @@
<el-alert v-if="failure" type="error" :title="failure" :closable="false" class="flow-failure" />
<div class="flow-canvas" :class="{ inactive: !active }" @dragover.prevent @drop.prevent="dropStage">
<VueFlow v-if="active" :id="flowId" v-model:nodes="nodes" :edges="edges" :delete-key-code="null" :min-zoom="0.1" :max-zoom="4" :nodes-connectable="canManage && !busy" :edges-updatable="false" :nodes-draggable="!busy" @connect="connectStages" @edge-click="edgeClicked" @node-click="selectNode" @node-drag-start="dragging = true" @node-drag-stop="dragStopped" @move-end="viewportMoved" @nodes-initialized="restoreViewport">
<Background :gap="22" :size="1" pattern-color="#d4dfef" />
<MiniMap pannable zoomable :node-color="minimapColor" />
<Background :gap="22" :size="1" pattern-color="var(--el-border-color)" />
<MiniMap pannable zoomable :node-color="minimapColor" node-stroke-color="var(--el-color-primary-light-3)" mask-color="var(--el-mask-color-extra-light)" />
<Controls :show-interactive="false" />
<template #node-stage="{ data }"><FlowStageNode :data="data" @view="openDrawer($event, 'current')" @create="createInStage" @rework="openRework" @history="openDrawer($event, 'history')" /></template>
</VueFlow>
@ -106,8 +106,8 @@ function createFromDrawer(stageId: number | null) { drawerStageId.value = null;
function createInStage(stageId: number) { if (!props.canCreate || stageId !== 0 && !props.view.stages.some(stage => stage.id === stageId)) return; emit('create', stageId || null) }
/** 回退入口只供项目管理者操作已执行阶段,影响范围以服务端预览为准。 */
function openRework(stageId: number) { if (props.canManage && props.view.stages.some(stage => stage.id === stageId && ['IN_PROGRESS', 'COMPLETED'].includes(stage.executionStatus || ''))) reworkSourceId.value = stageId }
/** 小地图只显示阶段节点,不编码抽屉内工作项的实际开始权限。 */
function minimapColor(_node: GraphNode) { return '#e8eef9' }
/** 小地图只显示阶段节点;SVG 填色直接引用主题变量,使已打开的画布即时响应系统明暗切换。 */
function minimapColor(_node: GraphNode) { return 'var(--el-color-primary-light-5)' }
/** 阶段素材只发出拖放标记,普通阶段点击不会误创建新阶段。 */
function dragPalette(event: DragEvent) { if (!props.canManage || !event.dataTransfer) return; event.dataTransfer.setData('application/x-pm-stage', 'new-stage'); event.dataTransfer.effectAllowed = 'copy' }
/** 将画布落点转为坐标后先命名,确认前不写项目共享阶段。 */
@ -141,8 +141,13 @@ async function edgeClicked(event: { edge: Edge<FlowEdgeData> }) {
}
</script>
<style scoped>
.flow-toolbar,.flow-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.flow-toolbar{justify-content:space-between;margin-bottom:10px}.flow-tools :deep(.el-button+.el-button){margin-left:0}.flow-help{font-size:11px;color:#8a97ab}.flow-canvas{height:max(470px,calc(100vh - 315px));position:relative;overflow:hidden;border:1px solid #e0e7f2;border-radius:10px;background:#fbfcff}.flow-canvas.inactive{height:0}
.flow-toolbar,.flow-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.flow-toolbar{justify-content:space-between;margin-bottom:10px}.flow-tools :deep(.el-button+.el-button){margin-left:0}.flow-help{font-size:11px;color:var(--el-text-color-secondary)}.flow-canvas{--vf-connection-path:var(--el-color-primary);height:max(470px,calc(100vh - 315px));position:relative;overflow:hidden;border:1px solid var(--el-border-color-light);border-radius:10px;background:var(--el-fill-color-extra-light)}.flow-canvas.inactive{height:0}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.flow-canvas :deep([class~="vue-flow"]){height:100%}
.flow-canvas :deep([class~="vue-flow__node-stage"]){padding:0;border:0;background:transparent}.canvas-legend{position:absolute;left:16px;bottom:12px;display:flex;align-items:center;gap:8px;font-size:11px;color:#8897af;pointer-events:none}.legend-line{width:24px;border-top:2px solid #93a4bf}.legend-line.green{border-color:#35a66b}.legend-line.legacy{border-color:#d69b38;border-top-style:dashed}.canvas-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:#8e9bb0;pointer-events:none}.flow-failure{margin-bottom:10px;white-space:pre-line}.stage-palette{border:1px dashed #7195d3;border-radius:6px;background:#eef5ff;color:#3f69ad;padding:6px 11px;font-size:12px;cursor:grab}.stage-palette:active{cursor:grabbing}@media(max-width:900px){.flow-canvas{height:560px}}
.flow-canvas :deep([class~="vue-flow__node-stage"]){padding:0;border:0;background:transparent}.canvas-legend{position:absolute;left:16px;bottom:12px;display:flex;align-items:center;gap:8px;font-size:11px;color:var(--el-text-color-secondary);pointer-events:none}.legend-line{width:24px;border-top:2px solid var(--el-text-color-placeholder)}.legend-line.green{border-color:var(--el-color-success)}.legend-line.legacy{border-color:var(--el-color-warning);border-top-style:dashed}.canvas-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);pointer-events:none}.flow-failure{margin-bottom:10px;white-space:pre-line}.stage-palette{border:1px dashed var(--el-color-primary-light-3);border-radius:6px;background:var(--el-color-primary-light-9);color:var(--el-color-primary);padding:6px 11px;font-size:12px;cursor:grab}.stage-palette:active{cursor:grabbing}@media(max-width:900px){.flow-canvas{height:560px}}
/* Vue Flow 自带控件和小地图有独立浅色默认值,限定在协作画布内覆盖,避免影响系统其他页面。 */
.flow-canvas :deep([class~="vue-flow__controls"]){box-shadow:var(--el-box-shadow-lighter)}
.flow-canvas :deep([class~="vue-flow__controls-button"]){background:var(--el-bg-color-overlay);color:var(--el-text-color-primary);fill:currentColor;border-bottom-color:var(--el-border-color-light)}
.flow-canvas :deep([class~="vue-flow__controls-button"]:hover){background:var(--el-fill-color)}
.flow-canvas :deep([class~="vue-flow__minimap"]){background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-lighter)}
</style>

View File

@ -70,4 +70,4 @@ async function end() {
function cleanup() { window.removeEventListener('pointermove', track); window.removeEventListener('pointerup', end); gesture.value = null }
onBeforeUnmount(cleanup)
</script>
<style scoped>.gantt-note{font-size:13px;color:#78869a;margin:0 0 16px}.unscheduled{padding:12px;background:#fff7e6;margin-bottom:12px;border-radius:6px}.gantt-scroll{overflow:auto;border:1px solid #e4e9f1;border-radius:9px}.gantt-head,.gantt-row{display:flex;height:48px;align-items:center;border-bottom:1px solid #edf0f5}.gantt-head{background:#f6f8fb}.item-label{width:220px;flex-shrink:0;position:sticky;left:0;background:#fff;z-index:2;padding:12px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.stage-version{color:#8a98aa}.review-label{margin-left:5px;color:#bf8636;font-size:11px}.day{flex-shrink:0;text-align:center;color:#8b98a9;font-size:11px}.timeline{overflow:hidden;position:relative;height:100%;background:repeating-linear-gradient(to right,transparent 0,transparent 33px,#edf0f5 33px,#edf0f5 34px)}.bar{position:absolute;top:10px;height:28px;border-radius:5px;background:#6275ed;color:white;font-size:11px;min-width:20px;text-align:center;line-height:28px;cursor:grab;user-select:none;touch-action:none}.bar.blocked{background:#d6a54e}.bar.busy{opacity:.55}.handle{position:absolute;width:7px;top:0;height:100%;cursor:ew-resize;background:#ffffff40}.handle.left{left:0}.handle.right{right:0}.blocked-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#d6a54e;margin-right:7px}</style>
<style scoped>.gantt-note{font-size:13px;color:var(--el-text-color-secondary);margin:0 0 16px}.unscheduled{padding:12px;background:var(--el-color-warning-light-9);margin-bottom:12px;border-radius:6px}.gantt-scroll{overflow:auto;border:1px solid var(--el-border-color-light);border-radius:9px}.gantt-head,.gantt-row{display:flex;height:48px;align-items:center;border-bottom:1px solid var(--el-border-color-lighter)}.gantt-head{background:var(--el-fill-color-light)}.item-label{width:220px;flex-shrink:0;position:sticky;left:0;background:var(--el-bg-color-overlay);z-index:2;padding:12px;font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.stage-version{color:var(--el-text-color-secondary)}.review-label{margin-left:5px;color:var(--el-color-warning);font-size:11px}.day{flex-shrink:0;text-align:center;color:var(--el-text-color-secondary);font-size:11px}.timeline{overflow:hidden;position:relative;height:100%;background:repeating-linear-gradient(to right,transparent 0,transparent 33px,var(--el-border-color-lighter) 33px,var(--el-border-color-lighter) 34px)}.bar{position:absolute;top:10px;height:28px;border-radius:5px;background:var(--el-color-primary-light-8);color:var(--el-text-color-primary);font-size:11px;min-width:20px;text-align:center;line-height:28px;cursor:grab;user-select:none;touch-action:none}.bar.blocked{background:var(--el-color-warning-light-8)}.bar.busy{opacity:.55}.handle{position:absolute;width:7px;top:0;height:100%;cursor:ew-resize;background:var(--el-color-primary-light-5)}.bar.blocked .handle{background:var(--el-color-warning-light-5)}.handle.left{left:0}.handle.right{right:0}.blocked-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--el-color-warning);margin-right:7px}</style>

View File

@ -47,7 +47,7 @@ defineExpose({ openSpace, openProject, isEditing })
<style scoped>
.workspace-select{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
/* 组件 DOM 和状态类由运行时生成;按 class token 匹配保持原选择器的含义和优先级,避免 IDE 静态模板匹配误报。 */
.workspace-select>[class~="el-select"]{width:220px}.creator-info{font-size:12px;color:#8191a7}.option-creator{float:right;margin-left:18px;color:#8191a7;font-size:12px}
.workspace-select>[class~="el-select"]{width:220px}.creator-info{font-size:12px;color:var(--el-text-color-secondary)}.option-creator{float:right;margin-left:18px;color:var(--el-text-color-secondary);font-size:12px}
.el-form [class~="el-select"]{width:100%}@media(max-width:600px){
.workspace-select>[class~="el-select"]{width:100%}}
</style>

View File

@ -61,13 +61,17 @@ export function buildFlowGraph(view: FlowView, positions: Record<string, Point>)
nextY.set(group.level, Math.max(nextY.get(group.level) || 40, position.y + FLOW_STAGE_HEIGHT + 56))
return { id: 's:' + group.id, type: 'stage', position, style: { width: FLOW_STAGE_WIDTH + 'px', height: FLOW_STAGE_HEIGHT + 'px' }, data: { stageId: group.id, title: group.title, stage: group.stage, itemCount: group.itemCount }, connectable: !!group.stage, dragHandle: '.stage-drag' }
})
const edges: Edge<FlowEdgeData>[] = links.map(link => ({
id: 'stage:' + link.id, source: 's:' + link.predecessorStageId, target: 's:' + link.successorStageId, sourceHandle: 'out', targetHandle: 'in',
// 颜色只编码后端当前执行事实,迁移放行与真正完成必须有不同视觉语义。
type: 'smoothstep', updatable: false, selectable: false, markerEnd: MarkerType.ArrowClosed,
style: { stroke: link.legacyPassed ? '#d69b38' : link.satisfied ? '#35a66b' : '#93a7cc', strokeWidth: link.satisfied ? 2.4 : 1.8, strokeDasharray: link.legacyPassed ? '6 4' : undefined },
data: { linkId: link.id, version: link.version },
}))
const edges: Edge<FlowEdgeData>[] = links.map(link => {
// SVG 连线与箭头共用主题变量,无需重新请求或重建节点即可响应明暗切换。
const color = link.legacyPassed ? 'var(--el-color-warning)' : link.satisfied ? 'var(--el-color-success)' : 'var(--el-text-color-placeholder)'
return {
id: 'stage:' + link.id, source: 's:' + link.predecessorStageId, target: 's:' + link.successorStageId, sourceHandle: 'out', targetHandle: 'in',
// 颜色只编码后端当前执行事实,迁移放行与真正完成必须有不同视觉语义。
type: 'smoothstep', updatable: false, selectable: false, markerEnd: { type: MarkerType.ArrowClosed, color },
style: { stroke: color, strokeWidth: link.satisfied ? 2.4 : 1.8, strokeDasharray: link.legacyPassed ? '6 4' : undefined },
data: { linkId: link.id, version: link.version },
}
})
return { nodes, edges }
}

View File

@ -148,16 +148,17 @@ onMounted(async () => { try { await loadWorkspace(); if (requestedIteration) inc
onBeforeUnmount(() => { if (timer) clearInterval(timer); refreshSequence++; workspaceSequence++ })
</script>
<style scoped>
.pm-app{padding:16px;background:#f6f8fc;min-height:calc(100vh - 84px);color:#25354b}
/* 复用系统主题变量,明暗切换由 html.dark 统一控制;抽屉、弹窗中的样式也直接取全局变量,避免 Teleport 后丢失主题。 */
.pm-app{padding:16px;background:var(--el-bg-color-page);min-height:calc(100vh - 84px);color:var(--el-text-color-primary)}
.pm-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.pm-header>div:first-child{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;min-width:0}
.pm-header h1{font-size:24px;line-height:32px;letter-spacing:1px;margin:0;font-weight:650;white-space:nowrap}
.pm-header p{font-size:12px;line-height:18px;color:#8492a6;margin:0}
.pm-header p{font-size:12px;line-height:18px;color:var(--el-text-color-secondary);margin:0}
.header-actions{display:flex;gap:8px;flex-shrink:0}
/* 数值与标签并排,保持顶部紧凑,剩余视口用于工作项。 */
.stats{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;margin-bottom:10px}
.stats>div{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;background:#fff;border:1px solid #e9edf4;border-radius:8px;padding:8px 14px}
.stats span{color:#8593a6;font-size:12px;line-height:18px}
.stats>div{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-lighter);border-radius:8px;padding:8px 14px}
.stats span{color:var(--el-text-color-secondary);font-size:12px;line-height:18px}
.stats strong{font-size:22px;line-height:28px;font-weight:600;flex-shrink:0}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}
.toolbar .view-tabs{min-width:400px;flex:1}
@ -168,29 +169,29 @@ onBeforeUnmount(() => { if (timer) clearInterval(timer); refreshSequence++; work
.filters{display:flex;gap:12px;align-items:center;margin:0 0 8px;flex-wrap:wrap}
.filters .keyword-filter{width:260px}
.filters .type-filter{width:160px}
.filters>span{font-size:12px;color:#8492a6}
.work-surface{background:#fff;padding:10px;border-radius:10px;border:1px solid #e8edf5;min-height:0}
.filters>span{font-size:12px;color:var(--el-text-color-secondary)}
.work-surface{background:var(--el-bg-color-overlay);padding:10px;border-radius:10px;border:1px solid var(--el-border-color-light);min-height:0}
/* 表格单元格来自 Element Plus 渲染,当前模板没有对应的原生 DOM 声明。 */
.work-surface :deep([class~="el-table__cell"]){padding:6px 0}
.work-surface :deep(.el-table [class~="cell"]){line-height:22px}
.item-cell{display:inline-flex;align-items:center;gap:7px;vertical-align:middle;position:relative;max-width:calc(100% - 24px)}
.item-cell .item-title{min-width:0;text-align:left}
.item-cell.is-child::before{content:'';position:absolute;left:-14px;top:-7px;width:8px;height:18px;border-left:1px solid #b8c9e2;border-bottom:1px solid #b8c9e2;border-bottom-left-radius:3px}
.item-cell.is-child::before{content:'';position:absolute;left:-14px;top:-7px;width:8px;height:18px;border-left:1px solid var(--el-border-color);border-bottom:1px solid var(--el-border-color);border-bottom-left-radius:3px}
/* 父子行类由 workItemRowClass 动态返回,不能按静态模板匹配结果删除。 */
.work-surface :deep([class~="parent-task-row"]){--el-table-tr-bg-color:#f3f7ff}
.work-surface :deep([class~="parent-task-row"]){--el-table-tr-bg-color:var(--el-color-primary-light-9)}
.work-surface :deep([class~="parent-task-row"] .item-title){font-weight:600}
.work-surface :deep([class~="subtask-row"]){--el-table-tr-bg-color:#fbfcff}
.subtask-progress{flex:none;font-size:10px;line-height:18px;padding:0 6px;border-radius:9px;color:#6382b1;background:#e7eefb;white-space:nowrap}
.type-badge{font-size:10px;background:#f0f3fb;color:#788bad;border-radius:4px;padding:3px 6px;white-space:nowrap}
.type-badge.child-badge{background:#edf1fb;color:#637dad}
.count{margin-left:9px;color:#94a0b3;font-size:11px}
.muted{color:#8c99ad;font-size:12px;line-height:1.8}
.warning-text{color:#bd9143;font-size:12px}
.work-surface :deep([class~="subtask-row"]){--el-table-tr-bg-color:var(--el-fill-color-extra-light)}
.subtask-progress{flex:none;font-size:10px;line-height:18px;padding:0 6px;border-radius:9px;color:var(--el-color-primary);background:var(--el-color-primary-light-9);white-space:nowrap}
.type-badge{font-size:10px;background:var(--el-fill-color-light);color:var(--el-text-color-secondary);border-radius:4px;padding:3px 6px;white-space:nowrap}
.type-badge.child-badge{background:var(--el-color-primary-light-9);color:var(--el-color-primary)}
.count{margin-left:9px;color:var(--el-text-color-secondary);font-size:11px}
.muted{color:var(--el-text-color-secondary);font-size:12px;line-height:1.8}
.warning-text{color:var(--el-color-warning);font-size:12px}
.failure{white-space:pre-line;margin:10px 0}
.bulk-start{margin-bottom:8px}
.invite{display:flex;gap:8px;margin-bottom:16px}
.invite .invite-select{min-width:120px}
.notice{display:flex;justify-content:space-between;padding:14px;border-bottom:1px solid #edf1f7;font-size:13px}
.notice{display:flex;justify-content:space-between;padding:14px;border-bottom:1px solid var(--el-border-color-lighter);font-size:13px}
.work-pagination{margin-top:10px}
@media(max-width:1000px){.pm-app{padding:12px}.stats{gap:8px}.stats>div{padding:8px 10px}}
@media(max-width:760px){.toolbar{flex-wrap:wrap}.toolbar .view-tabs{min-width:0;flex-basis:100%}.toolbar-actions{margin-left:auto}.pm-header p{display:none}.stats{grid-template-columns:repeat(3,minmax(0,1fr))}}

View File

@ -53,9 +53,9 @@ describe('流程画布阶段摘要', () => {
it('只按服务端边状态着色,不从阶段顺序或任务依赖推导连线', () => {
const view = fixture()
view.stageEdges[0]!.satisfied = true
expect(buildFlowGraph(view, {}).edges[0]?.style).toMatchObject({ stroke: '#35a66b', strokeDasharray: undefined })
expect(buildFlowGraph(view, {}).edges[0]?.style).toMatchObject({ stroke: 'var(--el-color-success)', strokeDasharray: undefined })
view.stageEdges[0]!.legacyPassed = true
expect(buildFlowGraph(view, {}).edges[0]?.style).toMatchObject({ stroke: '#d69b38', strokeDasharray: '6 4' })
expect(buildFlowGraph(view, {}).edges[0]?.style).toMatchObject({ stroke: 'var(--el-color-warning)', strokeDasharray: '6 4' })
view.stageEdges = []
expect(buildFlowGraph(view, {}).edges).toHaveLength(0)
})