Commit 1ca725b5 authored by 黄奎's avatar 黄奎

页面修改

parent 721eae4a
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
opacity: 0.75 opacity: 0.75
}, },
defaultChapterId: 0, defaultChapterId: 0,
defaultExpandedKeys:[],//默认展开数组 defaultExpandedKeys: [], //默认展开数组
splitterModel: 30, //左侧默认占据多大 splitterModel: 30, //左侧默认占据多大
isShowChapter: false, //是否显示导入 isShowChapter: false, //是否显示导入
chapterObj: {}, chapterObj: {},
...@@ -313,14 +313,16 @@ ...@@ -313,14 +313,16 @@
position: 'top' position: 'top'
}) })
this.questionData = res.Data; this.questionData = res.Data;
this.getAllWords(); this.refreshWordsPage();
} }
}) })
}, },
//导入成功获取所有 //导入成功获取所有
getAllWords(ChapterId) { getAllWords(ChapterId) {
this.wordMsg.CourseId = this.courseId; this.wordMsg.CourseId = this.courseId;
this.wordMsg.ChapterId = ChapterId; if (ChapterId) {
this.wordMsg.ChapterId = ChapterId;
}
GetCourseWordsPage(this.wordMsg).then(res => { GetCourseWordsPage(this.wordMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
this.WordData = res.Data.PageData; this.WordData = res.Data.PageData;
...@@ -328,6 +330,11 @@ ...@@ -328,6 +330,11 @@
} }
}) })
}, },
//刷新单词
refreshWordsPage(ChapterId) {
this.wordMsg.PageIndex = 1;
this.getAllWords(ChapterId);
},
changePage(val) { changePage(val) {
this.wordMsg.PageIndex = val; this.wordMsg.PageIndex = val;
this.getAllWords(); this.getAllWords();
...@@ -354,7 +361,7 @@ ...@@ -354,7 +361,7 @@
message: '删除成功!', message: '删除成功!',
position: 'top' position: 'top'
}) })
this.getAllWords(); this.refreshWordsPage();
} }
}) })
}).onCancel(() => { }).onCancel(() => {
...@@ -390,7 +397,7 @@ ...@@ -390,7 +397,7 @@
this.chapter.CourseRateName = this.defauRateObj.Name this.chapter.CourseRateName = this.defauRateObj.Name
} }
if (!compareObject(this.bakObj, this.chapter, false)) { if (!compareObject(this.bakObj, this.chapter, false)) {
this.saveChapterUpdate(1) this.saveChapterUpdate(1);
if (this.bakObj.CourseRate != this.chapter.CourseRate) { if (this.bakObj.CourseRate != this.chapter.CourseRate) {
if (this.chapter.ChildList && this.chapter.ChildList.length > 0) { if (this.chapter.ChildList && this.chapter.ChildList.length > 0) {
this.updateRate() this.updateRate()
...@@ -425,8 +432,7 @@ ...@@ -425,8 +432,7 @@
}) })
this.addObj.CourseId = data.CourseId; this.addObj.CourseId = data.CourseId;
this.addObj.ChapterId = data.ChapterId; this.addObj.ChapterId = data.ChapterId;
//点击调用章节下的单词
this.getAllWords(data.ChapterNo);
}, },
updateRate() { updateRate() {
setChaptersRate({ setChaptersRate({
...@@ -434,7 +440,7 @@ ...@@ -434,7 +440,7 @@
CourseId: this.courseId, CourseId: this.courseId,
ChapterNo: this.chapter.ChapterNo + "." ChapterNo: this.chapter.ChapterNo + "."
}).then(r => { }).then(r => {
//this.initTree()
}) })
}, },
updateRateNode(arr) { updateRateNode(arr) {
...@@ -500,19 +506,23 @@ ...@@ -500,19 +506,23 @@
msg.Requirement = encodeURIComponent(msg.Requirement) msg.Requirement = encodeURIComponent(msg.Requirement)
saveChapter(msg).then(r => { saveChapter(msg).then(r => {
this.submiting = false this.submiting = false
let msg = ''; let tipMsg = '';
if (type == 1) { if (type == 1) {
msg = '自动保存成功!' tipMsg = '自动保存成功!'
} else { } else {
msg = '数据保存成功!' tipMsg = '数据保存成功!'
} }
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
color: 'accent', color: 'accent',
timeout: 2000, timeout: 2000,
message: msg, message: tipMsg,
position: 'top' position: 'top'
}) })
//点击调用章节下的单词
if (this.chapter && this.chapter.ParentId == 0) {
this.refreshWordsPage(this.chapter.ChapterNo);
}
if (this.bakObj.CourseRate != this.defauRateObj.Id) { if (this.bakObj.CourseRate != this.defauRateObj.Id) {
if (this.chapter.ChildList && this.chapter.ChildList.length > 0) { if (this.chapter.ChildList && this.chapter.ChildList.length > 0) {
this.updateRate() this.updateRate()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment