赛事范围

dev_2022-06-14
yujialong 2 years ago
parent 08ae3a52f6
commit d5cec48e52
  1. 27
      src/pages/match/add/index.vue

@ -233,6 +233,7 @@ export default {
lazyLoad (node, resolve) {
//
const input = document.querySelector('.el-cascader__search-input')
const checked = that.rangeChecked
if (input && input.value.trim()) {
const val = input.value.trim()
@ -248,6 +249,7 @@ export default {
e.value = e.provinceId
e.label = e.provinceName
e.children = []
e.disabled = !!checked.find(n => n.provinceId == e.provinceId)
data.push(e)
})
resolve(data)
@ -262,6 +264,7 @@ export default {
e.value = e.cityId
e.label = e.cityName
e.children = []
e.disabled = !!checked.find(n => n.cityId == e.cityId)
data.push(e)
})
resolve(data)
@ -278,6 +281,7 @@ export default {
e.value = e.schoolId
e.label = e.schoolName
e.leaf = true
e.disabled = !!checked.find(n => n.schoolId == e.schoolId)
data.push(e)
})
resolve(data)
@ -386,7 +390,7 @@ export default {
checked.map(e => {
rangeChecked.find(n => n.value === e.value) || name.push(e.data)
})
this.rangeChecked = checked
this.rangeChecked.push(...name)
},
//
getSchool() {
@ -408,13 +412,19 @@ export default {
//
rangeSearch(el) {
const val = el.target.value.trim()
const checked = this.rangeChecked
if (!val) {
this.rangeList = []
return false
}
clearTimeout(this.rangeTimer)
this.rangeTimer = setTimeout(() => {
let result = this.schools.filter(e => e.label.includes(val)) //
let result = this.schools.filter(e => {
if (e.label.includes(val)) {
e.disabled = !!checked.find(n => n.schoolId == e.schoolId)
return e
}
}) //
this.rangeList = result
}, 100)
},
@ -425,18 +435,19 @@ export default {
rangeSubmit() {
// id
const data = []
this.range.map(e => {
const isSearch = this.rangeList.length // schoolId
const checked = this.rangeChecked
checked.map(e => {
data.push({
provinceId: e[0] || '',
cityId: e[1] || '',
schoolId: e[2] || '',
type: e.length > 2 ? 0 : 1
provinceId: e.provinceId || '',
cityId: e.cityId || '',
schoolId: e.schoolId || '',
type: e.schoolId ? 0 : 1
})
})
this.form.contestRangeList = data
// name
const checked = this.$refs.range.getCheckedNodes()
const name = []
checked.map(e => {
name.push(e.label)

Loading…
Cancel
Save