|
@@ -16,7 +16,9 @@ import {
|
|
|
closeToast,
|
|
|
Picker,
|
|
|
Popup,
|
|
|
- CountDown
|
|
|
+ CountDown,
|
|
|
+ CheckboxGroup,
|
|
|
+ Sticky
|
|
|
} from 'vant'
|
|
|
import { defineComponent, onMounted, reactive, ref } from 'vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
@@ -51,6 +53,7 @@ export default defineComponent({
|
|
|
pattern: /^1(3|4|5|6|7|8|9)\d{9}$/,
|
|
|
columns: [] as any,
|
|
|
pickerType: null, // 下拉类型
|
|
|
+ popupSelectSubjects: [] as any,
|
|
|
selectSubjects: [] as any, // 选中的声部
|
|
|
forms: {
|
|
|
realName: '',
|
|
@@ -123,6 +126,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const onSubjectRemove = (item: any, index: any) => {
|
|
|
+ console.log(item)
|
|
|
showDialog({
|
|
|
title: '提示',
|
|
|
message: '您是否删除选中的声部',
|
|
@@ -130,36 +134,31 @@ export default defineComponent({
|
|
|
showCancelButton: true
|
|
|
}).then(() => {
|
|
|
state.selectSubjects.splice(index, 1)
|
|
|
- const tempSubjectIds: any = []
|
|
|
- state.selectSubjects.forEach((subject: any) => {
|
|
|
- tempSubjectIds.push(subject.value)
|
|
|
- })
|
|
|
- state.forms.subjectIds = tempSubjectIds
|
|
|
- state.forms.showSubjectIds = tempSubjectIds.join(',')
|
|
|
+
|
|
|
+ const tIndex = state.popupSelectSubjects.findIndex((s: any) => s === item.value)
|
|
|
+ state.popupSelectSubjects.splice(tIndex, 1)
|
|
|
+
|
|
|
+ // const tempSubjectIds: any = []
|
|
|
+ // state.selectSubjects.forEach((subject: any) => {
|
|
|
+ // tempSubjectIds.push(subject.value)
|
|
|
+ // })
|
|
|
+ state.forms.subjectIds = state.popupSelectSubjects
|
|
|
+ state.forms.showSubjectIds = state.popupSelectSubjects.join(',')
|
|
|
})
|
|
|
}
|
|
|
// 选择声部
|
|
|
- const onConfirmSubject = (val: any) => {
|
|
|
- const selected = val.selectedOptions[0]
|
|
|
- let isCheck = false
|
|
|
- state.selectSubjects.forEach((subject: any) => {
|
|
|
- if (subject.value === selected.value) {
|
|
|
- isCheck = true
|
|
|
+ const onConfirmSubject = () => {
|
|
|
+ const tempSubjects: any = []
|
|
|
+ state.columnSubject.forEach((item: any) => {
|
|
|
+ if (state.popupSelectSubjects.includes(item.value)) {
|
|
|
+ tempSubjects.push(item)
|
|
|
}
|
|
|
})
|
|
|
- // 判断是否有选择一样的数据
|
|
|
- if (isCheck) {
|
|
|
- state.showSubject = false
|
|
|
- return
|
|
|
- }
|
|
|
|
|
|
- state.selectSubjects.push(val.selectedOptions[0])
|
|
|
- const tempSubjectIds: any = []
|
|
|
- state.selectSubjects.forEach((subject: any) => {
|
|
|
- tempSubjectIds.push(subject.value)
|
|
|
- })
|
|
|
- state.forms.subjectIds = tempSubjectIds
|
|
|
- state.forms.showSubjectIds = tempSubjectIds.join(',')
|
|
|
+ state.selectSubjects = tempSubjects
|
|
|
+ state.forms.subjectIds = state.popupSelectSubjects || []
|
|
|
+ state.forms.showSubjectIds = state.popupSelectSubjects.join(',')
|
|
|
+
|
|
|
state.showSubject = false
|
|
|
}
|
|
|
|
|
@@ -363,6 +362,7 @@ export default defineComponent({
|
|
|
const subjects = data.subjectId
|
|
|
? data.subjectId.split(',').map((subject: any) => Number(subject))
|
|
|
: []
|
|
|
+ state.popupSelectSubjects = subjects || []
|
|
|
// 显示声部
|
|
|
subjects.forEach((subject: any) => {
|
|
|
const item = state.columnSubject.find((item: any) => item.value === subject)
|
|
@@ -700,13 +700,50 @@ export default defineComponent({
|
|
|
columnsFieldNames={{ text: 'name', value: 'code', children: 'areas' }}
|
|
|
/>
|
|
|
</Popup>
|
|
|
- <Popup v-model:show={state.showSubject} position="bottom" round>
|
|
|
- <Picker
|
|
|
+ <Popup
|
|
|
+ v-model:show={state.showSubject}
|
|
|
+ position="bottom"
|
|
|
+ round
|
|
|
+ safeAreaInsetBottom
|
|
|
+ closeable
|
|
|
+ >
|
|
|
+ {/* <Picker
|
|
|
showToolbar
|
|
|
columns={state.columnSubject}
|
|
|
onCancel={() => (state.showSubject = false)}
|
|
|
onConfirm={onConfirmSubject}
|
|
|
- />
|
|
|
+ /> */}
|
|
|
+ <div class={styles.filterTitle}>全部声部</div>
|
|
|
+ <div class={styles.searchResult} style={{ maxHeight: '45vh', overflowY: 'auto' }}>
|
|
|
+ <CheckboxGroup
|
|
|
+ class={[styles.childContent, styles['radio-group']]}
|
|
|
+ modelValue={state.popupSelectSubjects}
|
|
|
+ onUpdate:modelValue={(val) => {
|
|
|
+ console.log(val)
|
|
|
+ state.popupSelectSubjects = val
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {state.columnSubject.map((item: any) => (
|
|
|
+ <Checkbox key={item.value} name={item.value} class={styles.radio}>
|
|
|
+ <Tag
|
|
|
+ class={[styles.item, 'van-ellipsis']}
|
|
|
+ plain={state.popupSelectSubjects.includes(item.value)}
|
|
|
+ type="primary"
|
|
|
+ size="large"
|
|
|
+ >
|
|
|
+ {item.text}
|
|
|
+ </Tag>
|
|
|
+ </Checkbox>
|
|
|
+ ))}
|
|
|
+ </CheckboxGroup>
|
|
|
+ <Sticky position="bottom" offsetBottom={0}>
|
|
|
+ <div class={['btnGroup']}>
|
|
|
+ <Button type="primary" round block onClick={onConfirmSubject}>
|
|
|
+ 确 认
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </Sticky>
|
|
|
+ </div>
|
|
|
</Popup>
|
|
|
{/* 学历 */}
|
|
|
{/* 学历分为专科、本科、硕士、博士、其他 */}
|