|
@@ -242,7 +242,15 @@ import { mapGetters } from 'vuex';
|
|
|
this.$api.studentWeb.getSurveyInfo(params).then(async res => {
|
|
|
if (res) {
|
|
|
if(res.status == 404) {
|
|
|
- this.delActivity()
|
|
|
+ this.isLoad = false
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "问卷已被删除,是否删除此条记录?",
|
|
|
+ okText: "删除",
|
|
|
+ cancelText: "取消",
|
|
|
+ onOk: () => {
|
|
|
+ this.delActivity()
|
|
|
+ }
|
|
|
+ })
|
|
|
} else if(res.status == 200) {
|
|
|
this.surveyInfo = res.survey
|
|
|
this.surveyInfo.items = await this.getBlobItems(res.survey)
|
|
@@ -263,15 +271,23 @@ import { mapGetters } from 'vuex';
|
|
|
},
|
|
|
// 删除不存在的问卷
|
|
|
delActivity() {
|
|
|
+ let roles = ""
|
|
|
+ if(this.$store.state.userInfo.roles.indexOf('student') > -1) {
|
|
|
+ roles = 'student'
|
|
|
+ } else {
|
|
|
+ roles = 'taecher'
|
|
|
+ }
|
|
|
let param = {
|
|
|
'id': this.getItemTitle.id,
|
|
|
'code': this.getItemTitle.code,
|
|
|
- "role": "teacher"
|
|
|
+ "role": roles
|
|
|
}
|
|
|
this.$api.studentWeb.delActivity(param).then(res => {
|
|
|
if(res) {
|
|
|
- if(res.status == 500) {
|
|
|
- this.$Message.warning('问卷已删除!')
|
|
|
+ if(res.status == 200) {
|
|
|
+ this.$Message.success('问卷已删除!')
|
|
|
+ this.$EventBus.$emit('delNotFound', this.getItemTitle.id)
|
|
|
+ this.$store.commit("ChangeItemName", {})
|
|
|
}
|
|
|
}
|
|
|
}).finally(()=>{
|