|
|
@ -135,8 +135,8 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button v-if="!form.id" @click="save(0)">保存</el-button> |
|
|
|
<el-button v-if="!form.id" @click="save(0)">保存</el-button> |
|
|
|
<el-button type="primary" @click="save(1)" v-auth="'/match:管理:大赛详情:发布'">发布</el-button> |
|
|
|
<el-button type="primary" @click="save(1)">发布</el-button> |
|
|
|
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button> |
|
|
|
<el-button type="danger" @click="preview">预览</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -149,10 +149,7 @@ |
|
|
|
:props="props" |
|
|
|
:props="props" |
|
|
|
:show-all-levels="false" |
|
|
|
:show-all-levels="false" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
filterable |
|
|
|
filterable></el-cascader> |
|
|
|
:before-filter="beforeFilter" |
|
|
|
|
|
|
|
:options="rangeList" |
|
|
|
|
|
|
|
@input.native="rangeSearch"></el-cascader> |
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button size="small" @click="rangeVisible = false">取 消</el-button> |
|
|
|
<el-button size="small" @click="rangeVisible = false">取 消</el-button> |
|
|
|
<el-button size="small" type="primary" @click="rangeSubmit">确 定</el-button> |
|
|
|
<el-button size="small" type="primary" @click="rangeSubmit">确 定</el-button> |
|
|
@ -214,13 +211,9 @@ export default { |
|
|
|
checkStrictly: true, |
|
|
|
checkStrictly: true, |
|
|
|
lazy: true, |
|
|
|
lazy: true, |
|
|
|
lazyLoad (node, resolve) { |
|
|
|
lazyLoad (node, resolve) { |
|
|
|
// 如果是在模糊搜索中,则不再用懒加载请求数据 |
|
|
|
|
|
|
|
const input = document.querySelector('.el-cascader__search-input') |
|
|
|
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 219 ~ lazyLoad ~ input", input, node) |
|
|
|
|
|
|
|
if (input && input.value) return resolve([]) |
|
|
|
|
|
|
|
const { level, value } = node |
|
|
|
const { level, value } = node |
|
|
|
// console.log("🚀 ~ file: index.vue ~ line 221 ~ lazyLoad ~ level", node) |
|
|
|
|
|
|
|
// 省份 |
|
|
|
// 省份 |
|
|
|
|
|
|
|
console.log('lazy', node, that.range) |
|
|
|
if (!level) { |
|
|
|
if (!level) { |
|
|
|
that.$get(that.api.queryProvince).then(({ list }) => { |
|
|
|
that.$get(that.api.queryProvince).then(({ list }) => { |
|
|
|
const data = [] |
|
|
|
const data = [] |
|
|
@ -272,9 +265,6 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
submiting: false, |
|
|
|
submiting: false, |
|
|
|
updateTime: 0, |
|
|
|
updateTime: 0, |
|
|
|
rangeTimer: null, |
|
|
|
|
|
|
|
schools: [], |
|
|
|
|
|
|
|
rangeList: [] |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
@ -311,7 +301,6 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
this.getSchool() |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData() { |
|
|
@ -347,6 +336,7 @@ export default { |
|
|
|
range.push(item) |
|
|
|
range.push(item) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.range = range |
|
|
|
this.range = range |
|
|
|
|
|
|
|
console.log("🚀 ~ file: matchDetail.vue ~ line 327 ~ this.$post ~ this.range", this.range) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 选择范围name |
|
|
|
// 选择范围name |
|
|
@ -364,33 +354,13 @@ export default { |
|
|
|
// 选择范围 |
|
|
|
// 选择范围 |
|
|
|
showRange() { |
|
|
|
showRange() { |
|
|
|
this.rangeVisible = true |
|
|
|
this.rangeVisible = true |
|
|
|
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 384 ~ showRange ~ rangeVisible", this.range) |
|
|
|
|
|
|
|
// this.range = this.rangeInit |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取学校列表 |
|
|
|
// 范围模糊查询 |
|
|
|
getSchool() { |
|
|
|
rangeFilter(node, keyword) { |
|
|
|
this.$get(this.api.querySchoolData).then(({ list }) => { |
|
|
|
console.log("🚀 ~ file: index.vue ~ line 363 ~ rangeFilter ~ node, keyword", node, keyword) |
|
|
|
const result = [] |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
result.push({ |
|
|
|
|
|
|
|
value: e.schoolId, |
|
|
|
|
|
|
|
label: e.schoolName, |
|
|
|
|
|
|
|
leaf: true |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.schools = result |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 范围模糊查询前置钩子 |
|
|
|
|
|
|
|
beforeFilter() { |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 范围筛选 |
|
|
|
|
|
|
|
rangeSearch(el) { |
|
|
|
|
|
|
|
clearTimeout(this.rangeTimer) |
|
|
|
|
|
|
|
this.rangeTimer = setTimeout(() => { |
|
|
|
|
|
|
|
const val = el.target.value |
|
|
|
|
|
|
|
let result = this.schools.filter(e => e.label.includes(val)) // 用学校列表做比对 |
|
|
|
|
|
|
|
this.rangeList = val ? result : [] |
|
|
|
|
|
|
|
}, 500) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 范围确定 |
|
|
|
// 范围确定 |
|
|
|
rangeSubmit() { |
|
|
|
rangeSubmit() { |
|
|
@ -439,7 +409,7 @@ export default { |
|
|
|
const data = { |
|
|
|
const data = { |
|
|
|
contestId: id || '', |
|
|
|
contestId: id || '', |
|
|
|
fileName: this.fileName, |
|
|
|
fileName: this.fileName, |
|
|
|
filePath: file.fileUrl |
|
|
|
filePath: file.fileUrl || file.fileId |
|
|
|
} |
|
|
|
} |
|
|
|
this.form.contestAnnexList.push(data) |
|
|
|
this.form.contestAnnexList.push(data) |
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|