校工会文化活动-体育比赛活动:修复编辑活动信息页面组件异步加载时执行顺序异常导致的初始化异常(此异常触发后,修改页面不会回显活动信息);页面内容未加载完毕时禁止点击保存、提交相关按钮;浏览器强制刷新会导致修改页空白一小段时间才恢复,线上测试时须注意;
This commit is contained in:
@@ -159,12 +159,13 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template #edit_func>
|
||||
<el-button @click="doSave" type="primary">保 存</el-button>
|
||||
<el-button @click="doOperate" type="primary">提 交</el-button>
|
||||
<el-button :disabled="!activityReady" @click="doSave" type="primary">保 存</el-button>
|
||||
<el-button :disabled="!activityReady" @click="doOperate" type="primary">提 交</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<add-activity
|
||||
v-if="showActivity"
|
||||
:form="formData"
|
||||
:is_a06="is_A06"
|
||||
:is_club="is_club"
|
||||
@@ -174,12 +175,13 @@ layout("/layouts/platform.html"){
|
||||
:unionid="'${@shiro.getPrincipalProperty('unit').getUnionid()}'"
|
||||
@flip="flip"
|
||||
@flush="flush"
|
||||
@hook:mounted="activityMounted"
|
||||
ref="activity"
|
||||
></add-activity>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
<info v-if="showInfo" @hook:mounted="infoMounted" ref="info"></info>
|
||||
</template>
|
||||
|
||||
<send-msg :url="url" ref="sendMsg"></send-msg>
|
||||
@@ -203,6 +205,11 @@ layout("/layouts/platform.html"){
|
||||
is_A06: false,
|
||||
is_h10: false,
|
||||
activities: [],
|
||||
showActivity: false,
|
||||
activityReady: false,
|
||||
activityAction: null,
|
||||
showInfo: false,
|
||||
infoId: null,
|
||||
unitOptions: [],
|
||||
activityTypeList: [],
|
||||
planList: [],
|
||||
@@ -317,27 +324,57 @@ layout("/layouts/platform.html"){
|
||||
this.url = `<a href="` + (APP_DOMAIN + "/mobile/activity/Sports/list/activityList") + `">点击参与</a>`
|
||||
this.$refs.sendMsg.openDialog(row.activityGroupId)
|
||||
},
|
||||
infoMounted() {
|
||||
this.loadInfo()
|
||||
},
|
||||
loadInfo(id) {
|
||||
if (id) {
|
||||
this.infoId = id
|
||||
}
|
||||
if (this.$refs.info && this.infoId) {
|
||||
const infoId = this.infoId
|
||||
this.infoId = null
|
||||
this.$refs.info.getInfo(infoId)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const { id } = row
|
||||
this.infoId = id
|
||||
this.showInfo = true
|
||||
this.$refs.guava.view()
|
||||
setTimeout(() => {
|
||||
this.$refs.info.getInfo(id)
|
||||
}, 500)
|
||||
this.$nextTick(() => this.loadInfo())
|
||||
},
|
||||
activityMounted() {
|
||||
this.activityReady = true
|
||||
this.handleActivityAction()
|
||||
},
|
||||
handleActivityAction(action) {
|
||||
if (action) {
|
||||
this.activityAction = action
|
||||
}
|
||||
if (!this.$refs.activity || !this.activityAction) {
|
||||
return
|
||||
}
|
||||
const { type, row } = this.activityAction
|
||||
this.activityAction = null
|
||||
if (type === "add") {
|
||||
this.$refs.activity.openAdd()
|
||||
} else if (type === "edit") {
|
||||
this.$refs.activity.openEdit(row, true)
|
||||
}
|
||||
},
|
||||
async openAdd() {
|
||||
this.showActivity = true
|
||||
this.$refs.guava.edit()
|
||||
setTimeout(() => {
|
||||
this.$refs.activity.openAdd()
|
||||
}, 500)
|
||||
this.handleActivityAction({ type: "add" })
|
||||
},
|
||||
async openEdit(row) {
|
||||
const { id, applyStartTime, isSave } = row
|
||||
this.formData.id = id
|
||||
const now = moment().valueOf()
|
||||
this.showActivity = true
|
||||
this.$refs.guava.edit()
|
||||
setTimeout(() => {
|
||||
this.$refs.activity.openEdit(row, true)
|
||||
}, 500)
|
||||
this.handleActivityAction({ type: "edit", row })
|
||||
},
|
||||
doDelete(row) {
|
||||
const { id } = row
|
||||
|
||||
Reference in New Issue
Block a user