feat: 成长路径页面增加岗位全选按钮,调整下方区域高度
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yuliang_guo
2026-01-30 18:12:08 +08:00
parent ceb0ae966b
commit 3dcaaaaa35

View File

@@ -150,6 +150,7 @@
<el-input v-model="editingPath.name" placeholder="请输入路径名称" /> <el-input v-model="editingPath.name" placeholder="请输入路径名称" />
</el-form-item> </el-form-item>
<el-form-item label="关联岗位" class="form-item-half"> <el-form-item label="关联岗位" class="form-item-half">
<div class="position-select-wrapper">
<el-select <el-select
v-model="editingPath.position_ids" v-model="editingPath.position_ids"
placeholder="选择关联岗位" placeholder="选择关联岗位"
@@ -166,6 +167,16 @@
:value="pos.id" :value="pos.id"
/> />
</el-select> </el-select>
<el-button
link
type="primary"
size="small"
@click="handleSelectAllPositions"
class="select-all-btn"
>
{{ isAllPositionsSelected ? '取消全选' : '全选' }}
</el-button>
</div>
</el-form-item> </el-form-item>
</div> </div>
<div class="form-row"> <div class="form-row">
@@ -529,6 +540,11 @@ const totalDuration = computed(() => {
}, 0) }, 0)
}) })
const isAllPositionsSelected = computed(() => {
if (!editingPath.value?.position_ids || positions.value.length === 0) return false
return editingPath.value.position_ids.length === positions.value.length
})
// ========== 方法 ========== // ========== 方法 ==========
/** /**
@@ -820,6 +836,20 @@ const getStageNodes = (stageName: string) => {
return editingPath.value?.nodes?.filter(n => n.stage_name === stageName) || [] return editingPath.value?.nodes?.filter(n => n.stage_name === stageName) || []
} }
/**
* 全选/取消全选岗位
*/
const handleSelectAllPositions = () => {
if (!editingPath.value) return
const allIds = positions.value.map(p => p.id)
// 如果当前已全选,则取消全选
if (editingPath.value.position_ids?.length === allIds.length) {
editingPath.value.position_ids = []
} else {
editingPath.value.position_ids = [...allIds]
}
}
/** /**
* 添加课程 * 添加课程
*/ */
@@ -1056,6 +1086,21 @@ onMounted(() => {
:deep(.el-form-item) { :deep(.el-form-item) {
margin-bottom: 0; margin-bottom: 0;
} }
.position-select-wrapper {
display: flex;
align-items: center;
gap: 8px;
.el-select {
flex: 1;
}
.select-all-btn {
white-space: nowrap;
flex-shrink: 0;
}
}
} }
.stages-section { .stages-section {
@@ -1131,10 +1176,10 @@ onMounted(() => {
// 下方区域 // 下方区域
.editor-bottom { .editor-bottom {
flex: 1; flex: 2;
display: flex; display: flex;
gap: 16px; gap: 16px;
min-height: 0; min-height: 400px;
// 左侧课程库 1/3 // 左侧课程库 1/3
.course-library-panel { .course-library-panel {