|
@@ -41,15 +41,12 @@
|
|
|
</ul> -->
|
|
|
<ul v-if="gradeList && gradeList.length > 0" class="gradelist">
|
|
|
<li
|
|
|
- :class="[
|
|
|
- 'gradeitem',
|
|
|
- itemG.study_phase === gradeIndex ? 'active' : '',
|
|
|
- ]"
|
|
|
+ :class="['gradeitem', itemG.id === gradeIndex ? 'active' : '']"
|
|
|
v-for="(itemG, indeG) in gradeList"
|
|
|
:key="indeG"
|
|
|
- @click="handleTypeIndex('gradeIndex', itemG.study_phase)"
|
|
|
+ @click="handleTypeIndex('gradeIndex', itemG.id)"
|
|
|
>
|
|
|
- {{ itemG.study_phase_name }}
|
|
|
+ {{ itemG.name }}
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul v-if="yearList && yearList.length > 0" class="gradelist">
|
|
@@ -166,7 +163,12 @@ export default {
|
|
|
? this.$route.query.selectIndex * 1
|
|
|
: 0,
|
|
|
typeIndex: 0,
|
|
|
- gradeList: [],
|
|
|
+ gradeList: [
|
|
|
+ {
|
|
|
+ name: "全部",
|
|
|
+ id: null,
|
|
|
+ },
|
|
|
+ ],
|
|
|
yearList: [
|
|
|
{
|
|
|
label: "全部",
|
|
@@ -262,50 +264,7 @@ export default {
|
|
|
this.currentPage = val;
|
|
|
this.searchArticle();
|
|
|
},
|
|
|
- // 学段列表
|
|
|
- getStudyList() {
|
|
|
- let MethodName = "/OrgServer/DictManager/GetStudyPhaseList";
|
|
|
- getLogin(MethodName, {})
|
|
|
- .then((res) => {
|
|
|
- if (res.status === 1) {
|
|
|
- let gradeList = [
|
|
|
- {
|
|
|
- study_phase: null,
|
|
|
- study_phase_name: "全部",
|
|
|
- },
|
|
|
- ];
|
|
|
- this.gradeList = gradeList.concat(res.study_phase_list);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
- // 获取年份列表
|
|
|
- getYearList() {
|
|
|
- this.yearList = [
|
|
|
- {
|
|
|
- value: null,
|
|
|
- label: "全部",
|
|
|
- },
|
|
|
- ];
|
|
|
- let yearList = [];
|
|
|
- let MethodName = "/ShopServer/Client/ShopHomeQuery/GetIssueYearLabelList";
|
|
|
- getLogin(MethodName, {
|
|
|
- goods_type: 2,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- if (res.status === 1) {
|
|
|
- res.year_label_list.forEach((nowYear) => {
|
|
|
- let obj = {
|
|
|
- value: nowYear,
|
|
|
- label: nowYear,
|
|
|
- };
|
|
|
- yearList.push(obj);
|
|
|
- });
|
|
|
- this.yearList = this.yearList.concat(yearList);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
+
|
|
|
// 查询搜索内容
|
|
|
searchArticle() {
|
|
|
this.loading = true;
|
|
@@ -337,6 +296,32 @@ export default {
|
|
|
if (res.status === 1) {
|
|
|
this.courseTotal = res.data.total;
|
|
|
this.searchList = res.data.results;
|
|
|
+ this.yearList = [
|
|
|
+ {
|
|
|
+ value: null,
|
|
|
+ label: "全部",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ let yearList = [];
|
|
|
+ if (res.data.exData && res.data.exData.years) {
|
|
|
+ res.data.exData.years.forEach((nowYear) => {
|
|
|
+ let obj = {
|
|
|
+ value: nowYear,
|
|
|
+ label: nowYear,
|
|
|
+ };
|
|
|
+ yearList.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.yearList = this.yearList.concat(yearList);
|
|
|
+ if (res.data.exData && res.data.exData.studyPhases) {
|
|
|
+ let gradeList = [
|
|
|
+ {
|
|
|
+ id: null,
|
|
|
+ name: "全部",
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.gradeList = gradeList.concat(res.study_phase_list);
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
@@ -357,8 +342,6 @@ export default {
|
|
|
this.headerBorder = arr[2];
|
|
|
this.headerBg = arr[3];
|
|
|
}
|
|
|
- this.getStudyList();
|
|
|
- this.getYearList();
|
|
|
this.searchArticle();
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|