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