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,22 +150,33 @@
|
|||||||
<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">
|
||||||
<el-select
|
<div class="position-select-wrapper">
|
||||||
v-model="editingPath.position_ids"
|
<el-select
|
||||||
placeholder="选择关联岗位"
|
v-model="editingPath.position_ids"
|
||||||
multiple
|
placeholder="选择关联岗位"
|
||||||
collapse-tags
|
multiple
|
||||||
collapse-tags-tooltip
|
collapse-tags
|
||||||
clearable
|
collapse-tags-tooltip
|
||||||
style="width: 100%"
|
clearable
|
||||||
>
|
style="width: 100%"
|
||||||
<el-option
|
>
|
||||||
v-for="pos in positions"
|
<el-option
|
||||||
:key="pos.id"
|
v-for="pos in positions"
|
||||||
:label="pos.name"
|
:key="pos.id"
|
||||||
:value="pos.id"
|
:label="pos.name"
|
||||||
/>
|
: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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user