|
|
|
@ -135,8 +135,8 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button v-if="!form.id" @click="save(0)">保存</el-button> |
|
|
|
|
<el-button type="primary" @click="save(1)">发布</el-button> |
|
|
|
|
<el-button type="danger" @click="preview">预览</el-button> |
|
|
|
|
<el-button type="primary" @click="save(1)" v-auth="'/match:管理:大赛详情:发布'">发布</el-button> |
|
|
|
|
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
@ -214,9 +214,12 @@ export default { |
|
|
|
|
checkStrictly: true, |
|
|
|
|
lazy: true, |
|
|
|
|
lazyLoad (node, resolve) { |
|
|
|
|
// 如果是在模糊搜索中,则不再用懒加载请求数据 |
|
|
|
|
const input = document.querySelector('.el-cascader__search-input') |
|
|
|
|
if (input && input.value) return false |
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 219 ~ lazyLoad ~ input", input, node) |
|
|
|
|
if (input && input.value) return resolve([]) |
|
|
|
|
const { level, value } = node |
|
|
|
|
// console.log("🚀 ~ file: index.vue ~ line 221 ~ lazyLoad ~ level", node) |
|
|
|
|
// 省份 |
|
|
|
|
if (!level) { |
|
|
|
|
that.$get(that.api.queryProvince).then(({ list }) => { |
|
|
|
@ -365,8 +368,15 @@ export default { |
|
|
|
|
// 获取学校列表 |
|
|
|
|
getSchool() { |
|
|
|
|
this.$get(this.api.querySchoolData).then(({ list }) => { |
|
|
|
|
list.map(e => e.label = e.schoolName) |
|
|
|
|
this.schools = list |
|
|
|
|
const result = [] |
|
|
|
|
list.map(e => { |
|
|
|
|
result.push({ |
|
|
|
|
value: e.schoolId, |
|
|
|
|
label: e.schoolName, |
|
|
|
|
leaf: true |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.schools = result |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 范围模糊查询前置钩子 |
|
|
|
@ -378,7 +388,7 @@ export default { |
|
|
|
|
clearTimeout(this.rangeTimer) |
|
|
|
|
this.rangeTimer = setTimeout(() => { |
|
|
|
|
const val = el.target.value |
|
|
|
|
let result = this.schools.filter(e => e.schoolName.includes(val)) // 用学校列表做比对 |
|
|
|
|
let result = this.schools.filter(e => e.label.includes(val)) // 用学校列表做比对 |
|
|
|
|
this.rangeList = val ? result : [] |
|
|
|
|
}, 500) |
|
|
|
|
}, |
|
|
|
@ -425,10 +435,15 @@ export default { |
|
|
|
|
// 附件上传成功 |
|
|
|
|
uploadAnnexSuccess(res) { |
|
|
|
|
const file = res.data.filesResult |
|
|
|
|
this.form.contestAnnexList.push({ |
|
|
|
|
const { id } = this.form |
|
|
|
|
const data = { |
|
|
|
|
contestId: id || '', |
|
|
|
|
fileName: this.fileName, |
|
|
|
|
filePath: file.fileUrl || file.fileId |
|
|
|
|
}) |
|
|
|
|
filePath: file.fileUrl |
|
|
|
|
} |
|
|
|
|
this.form.contestAnnexList.push(data) |
|
|
|
|
// 编辑的时候需要调新增附件接口 |
|
|
|
|
id && this.$post(this.api.saveAnnex, data).then(res => {}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 附件上传前 |
|
|
|
|
beforeUpload(file) { |
|
|
|
|