feat: 成长路径页面增加岗位全选按钮,调整下方区域高度
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -150,6 +150,7 @@
|
||||
<el-input v-model="editingPath.name" placeholder="请输入路径名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联岗位" class="form-item-half">
|
||||
<div class="position-select-wrapper">
|
||||
<el-select
|
||||
v-model="editingPath.position_ids"
|
||||
placeholder="选择关联岗位"
|
||||
@@ -166,6 +167,16 @@
|
||||
:value="pos.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleSelectAllPositions"
|
||||
class="select-all-btn"
|
||||
>
|
||||
{{ isAllPositionsSelected ? '取消全选' : '全选' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@@ -529,6 +540,11 @@ const totalDuration = computed(() => {
|
||||
}, 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) || []
|
||||
}
|
||||
|
||||
/**
|
||||
* 全选/取消全选岗位
|
||||
*/
|
||||
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) {
|
||||
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 {
|
||||
@@ -1131,10 +1176,10 @@ onMounted(() => {
|
||||
|
||||
// 下方区域
|
||||
.editor-bottom {
|
||||
flex: 1;
|
||||
flex: 2;
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
min-height: 0;
|
||||
min-height: 400px;
|
||||
|
||||
// 左侧课程库 1/3
|
||||
.course-library-panel {
|
||||
|
||||
Reference in New Issue
Block a user