OnePsycho 3 роки тому
батько
коміт
493bb83b7e

+ 24 - 11
TEAMModelOS/ClientApp/src/view/homework/ManageHomeWork.vue

@@ -464,18 +464,31 @@
 			async handleTabClick(){
 			async handleTabClick(){
 				if(this.$route.params.ac){
 				if(this.$route.params.ac){
 					let item = this.$route.params.ac
 					let item = this.$route.params.ac
-					let fullItem = item.id ? await this.getVoteDetails(item) : item
-					if(!fullItem.id) return
-					this.currentVote = fullItem
-					this.activeVoteIndex = 0
-					this.voteList = [fullItem]
-					this.isAddActivity = false
-					/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
-					if (item.id && item.progress !== 'pending') {
-						this.getVoteStudents(fullItem, fullItem.classes)
+					try{
+						let fullItem = item.id ? await this.getVoteDetails(item) : item
+						if(!fullItem.id) return
+						this.currentVote = fullItem
+						this.activeVoteIndex = 0
+						this.voteList = [fullItem]
+						this.isAddActivity = false
+						/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
+						if (item.id && item.progress !== 'pending') {
+							this.getVoteStudents(fullItem, fullItem.classes)
+						}
+						this.hasNewAdd = false
+						this.isOptionView = true
+					}catch(e){
+						this.$Modal.confirm({
+							title: this.$t('survey.questionaire.confirmTitle'),
+							content: this.$t('survey.noFoundAc'),
+							cancelText: ' ',
+							onOk: () => {
+								this.goBackRecord(item.id)
+							},
+							onCancel: () => {}
+						});
 					}
 					}
-					this.hasNewAdd = false
-					this.isOptionView = true
+					
 				}else{
 				}else{
 					this.getVoteList()
 					this.getVoteList()
 				}
 				}

+ 30 - 17
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -365,24 +365,37 @@
 				setTimeout(async () => {
 				setTimeout(async () => {
 					if(this.$route.params.ac){
 					if(this.$route.params.ac){
 						let item = this.routerAc
 						let item = this.routerAc
-						this.currentQn = await this.getQnDetails(item);
-						this.currentQn.progress = item.progress;
-						this.qnList = [this.currentQn]
-						if (this.currentQn.targetType === 'research') {
-							this.getSurveyTchList(this.currentQn)
-						} else {
-							this.getSurveyStusByClassId(this.currentQn)
-						}
-						if (item.progress === 'pending') {
-							this.onChangeResultTab('result')
-						} else {
-							this.onChangeResultTab('progress')
+						try{
+							this.currentQn = await this.getQnDetails(item);
+							this.currentQn.progress = item.progress;
+							this.qnList = [this.currentQn]
+							if (this.currentQn.targetType === 'research') {
+								this.getSurveyTchList(this.currentQn)
+							} else {
+								this.getSurveyStusByClassId(this.currentQn)
+							}
+							if (item.progress === 'pending') {
+								this.onChangeResultTab('result')
+							} else {
+								this.onChangeResultTab('progress')
+							}
+							this.activeQnIndex = 0;
+							this.$refs.qnForm.qnFormEdit = false;
+							this.editable = false;
+							this.hasModify = false
+							this.isEmptyData = false;
+						}catch(e){
+							this.$Modal.confirm({
+								title: this.$t('survey.questionaire.confirmTitle'),
+								content: this.$t('survey.noFoundAc'),
+								cancelText: ' ',
+								onOk: () => {
+									this.goBackRecord(item.id)
+								},
+								onCancel: () => {}
+							});
 						}
 						}
-						this.activeQnIndex = 0;
-						this.$refs.qnForm.qnFormEdit = false;
-						this.editable = false;
-						this.hasModify = false
-						this.isEmptyData = false;
+						
 					}else{
 					}else{
 						this.getQnList(index === 0 ? "school" : "private");
 						this.getQnList(index === 0 ? "school" : "private");
 					}
 					}

+ 41 - 29
TEAMModelOS/ClientApp/src/view/vote/ManageVote.vue

@@ -341,36 +341,48 @@
 				setTimeout(async () => {
 				setTimeout(async () => {
 					if(this.$route.params.ac){
 					if(this.$route.params.ac){
 						let item = this.$route.params.ac
 						let item = this.$route.params.ac
-						let fullItem = item.id ? await this.getVoteDetails(item) : item
-						this.currentVote = fullItem
-						this.activeVoteIndex = 0
-						this.voteList = [fullItem]
-						/* 如果是区级的活动 则需要根据recordUrl去换取区级活动的作答数据 */
-						if (this.isAreaVote && item.id) {
-							this.areaVoteTeachers = []
-							this.areaSchIndex = 0
-							this.areaSchList = this.areaRecord.map(i => i.name)
-							this.areaRecord.length && this.getAreaRecord(0)
-						}else{
-							/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
-							if (item.id && item.progress !== 'pending'){
-								if(fullItem.targetType === 'research'){
-									this.getVoteTeachers(fullItem, fullItem.tchLists)
-								}else{
-									this.getVoteStudents(fullItem, fullItem.classes)
-								}
-							} 
+						try{
+							let fullItem = item.id ? await this.getVoteDetails(item) : item
+							this.currentVote = fullItem
+							this.activeVoteIndex = 0
+							this.voteList = [fullItem]
+							/* 如果是区级的活动 则需要根据recordUrl去换取区级活动的作答数据 */
+							if (this.isAreaVote && item.id) {
+								this.areaVoteTeachers = []
+								this.areaSchIndex = 0
+								this.areaSchList = this.areaRecord.map(i => i.name)
+								this.areaRecord.length && this.getAreaRecord(0)
+							}else{
+								/* 其余类型活动则需要去根据发布对象获取对应的作答数据 */
+								if (item.id && item.progress !== 'pending'){
+									if(fullItem.targetType === 'research'){
+										this.getVoteTeachers(fullItem, fullItem.tchLists)
+									}else{
+										this.getVoteStudents(fullItem, fullItem.classes)
+									}
+								} 
+							}
+							this.$refs.voteForm && (this.$refs.voteForm.voteFormEdit = false)
+							this.$refs.voteFormScroll.scrollTo({
+									y: 0,
+								},
+								200,
+								"easeInQuad"
+							);
+							this.hasNewAdd = false
+							this.isOptionView = true
+							this.isAddActivity = false
+						}catch(e){
+							this.$Modal.confirm({
+								title: this.$t('survey.questionaire.confirmTitle'),
+								content: this.$t('survey.noFoundAc'),
+								cancelText: ' ',
+								onOk: () => {
+									this.goBackRecord(item.id)
+								},
+								onCancel: () => {}
+							});
 						}
 						}
-						this.$refs.voteForm && (this.$refs.voteForm.voteFormEdit = false)
-						this.$refs.voteFormScroll.scrollTo({
-								y: 0,
-							},
-							200,
-							"easeInQuad"
-						);
-						this.hasNewAdd = false
-						this.isOptionView = true
-						this.isAddActivity = false
 					}else{
 					}else{
 						this.getVoteList(index === 0 ? 'school' : 'private')
 						this.getVoteList(index === 0 ? 'school' : 'private')
 					}
 					}