diff --git a/src/setting.js b/src/setting.js index f555548..8e05d17 100644 --- a/src/setting.js +++ b/src/setting.js @@ -43,7 +43,7 @@ const Setting = { isDev, isPro, // 是否使用动态路由 - dynamicRoute: false, + dynamicRoute: true, /** * @description 默认密码 */ diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue index e5c6646..8329570 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -135,8 +135,8 @@ 保存 - 发布 - 预览 + 发布 + 预览 @@ -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) { diff --git a/src/views/match/list/index.vue b/src/views/match/list/index.vue index 81258c6..b2555c4 100644 --- a/src/views/match/list/index.vue +++ b/src/views/match/list/index.vue @@ -40,7 +40,7 @@
- 创建竞赛 + 创建竞赛
@@ -76,10 +76,10 @@