| | |
| | | repositoryInfo, |
| | | coverSize, |
| | | }); |
| | | return { datas, total: data.totalCount }; |
| | | return { datas, total: data.totalCount, groups: data.groups}; |
| | | } |
| | | return { datas: [], total: 0 }; |
| | | }); |
| | |
| | | <!-- 类型 --> |
| | | <ul> |
| | | <li class="left-title"> |
| | | <span>{{ category.title }}</span> |
| | | <p @click="category.isDisplay = !category.isDisplay"> |
| | | <span>{{ categoryOBJ.title }}</span> |
| | | <p @click="categoryOBJ.isDisplay = !categoryOBJ.isDisplay"> |
| | | <img |
| | | :src="[category.isDisplay ? topIcon : bottomIcon]" |
| | | :src="[categoryOBJ.isDisplay ? topIcon : bottomIcon]" |
| | | alt="" |
| | | /> |
| | | </p> |
| | | </li> |
| | | <li class="left-main" v-if="category.isDisplay"> |
| | | <li class="left-main" v-if="categoryOBJ.isDisplay"> |
| | | <div |
| | | class="category-main" |
| | | v-for="(item, index) in category.list" |
| | | v-for="(item, index) in categoryOBJ.list" |
| | | :key="index" |
| | | > |
| | | <el-checkbox |
| | | class="el-checkbox" |
| | | v-model="item.checked" |
| | | :title="item.name" |
| | | @change="categoryChange(item)" |
| | | @change="categoryChange(categoryOBJ.title, item)" |
| | | style="display: inline-block; vertical-align: middle" |
| | | >{{ item.name }}</el-checkbox |
| | | >{{ item.valueName }}</el-checkbox |
| | | > |
| | | <span |
| | | class="" |
| | |
| | | class="el-checkbox" |
| | | v-model="item.checked" |
| | | :title="item.years" |
| | | >{{ item.years }}</el-checkbox |
| | | > |
| | | @change="categoryChange(annual.title, item)" |
| | | >{{ item.name }} |
| | | </el-checkbox> |
| | | <span class="">{{ item.num }}</span> |
| | | </div> |
| | | <p |
| | |
| | | class="el-checkbox" |
| | | :title="item.name" |
| | | v-model="item.checked" |
| | | @change="categoryChange(sources.title, item)" |
| | | >{{ item.name }}</el-checkbox |
| | | > |
| | | <span class="">{{ item.num }}</span> |
| | |
| | | isDisplay: true, |
| | | id: "", |
| | | index: "", |
| | | list: [ |
| | | { |
| | | name: "期刊", |
| | | num: 190, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "图书", |
| | | num: 190, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "视频", |
| | | num: 190, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "音频", |
| | | num: 190, |
| | | check: false, |
| | | }, |
| | | ], |
| | | list: [], |
| | | }, |
| | | |
| | | // 类型 |
| | | categoryOBJ: { |
| | | title: "类型", |
| | | isDisplay: true, |
| | | id: "", |
| | | index: "", |
| | | list: [], |
| | | }, |
| | | categoryChecList: [], |
| | | subjectCheckList: [], |
| | |
| | | isDisplay: true, |
| | | id: "", |
| | | index: "", |
| | | list: [ |
| | | { |
| | | years: "2025", |
| | | num: 10, |
| | | check: false, |
| | | }, |
| | | { |
| | | years: "2024", |
| | | num: 18, |
| | | check: false, |
| | | }, |
| | | { |
| | | years: "2023", |
| | | num: 21, |
| | | check: false, |
| | | }, |
| | | { |
| | | years: "2022", |
| | | num: 19, |
| | | check: false, |
| | | }, |
| | | { |
| | | years: "2021", |
| | | num: 22, |
| | | check: false, |
| | | }, |
| | | { |
| | | years: "2020", |
| | | num: 24, |
| | | check: false, |
| | | }, |
| | | ], |
| | | list: [], |
| | | }, |
| | | // 文献来源 |
| | | sources: { |
| | |
| | | isDisplay: true, |
| | | id: "", |
| | | index: "", |
| | | list: [ |
| | | { |
| | | name: "北京中医药大学大学学报", |
| | | num: 190, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "北京师范大学", |
| | | num: 19, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "中国中医科学院", |
| | | num: 22, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "北京中医药大学大学学报", |
| | | num: 31, |
| | | check: false, |
| | | }, |
| | | { |
| | | name: "广州中医药大学", |
| | | num: 25, |
| | | check: false, |
| | | }, |
| | | ], |
| | | list: [], |
| | | }, |
| | | // 学科 |
| | | subject: { |
| | |
| | | this.inputType = this.$route.query.type; |
| | | this.inputValue = this.$route.query.value; |
| | | this.getSelectData(); |
| | | this.getSidebarData(); |
| | | }, |
| | | |
| | | methods: { |
| | | categoryChange(val) { |
| | | categoryChange(typeName, val) { |
| | | if (val.checked) { |
| | | this.categoryChecList.push(val.value); |
| | | this.associationList.push({ |
| | | type: "类型", |
| | | type: typeName, |
| | | content: val.name, |
| | | value: val.value, |
| | | }); |
| | | } else { |
| | | const index = this.categoryChecList.findIndex( |
| | |
| | | this.getItemList(); |
| | | } |
| | | }, |
| | | //获取侧边栏数据 |
| | | getSidebarData() { |
| | | MG.resource |
| | | .getItem({ |
| | | path: "*", |
| | | queryType: "*", |
| | | fields: { |
| | | GroupBy: [["particularYear"], ["sourceFrom"], ["resourceType"]], |
| | | "subjectAffiliation*": this.subjectCheckList, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | // 处理group的数据 |
| | | console.log(res, "res009"); |
| | | |
| | | res.groups.forEach((item) => { |
| | | if ( |
| | | item.key == "particularYear" && |
| | | item.datas && |
| | | item.datas.length |
| | | ) { |
| | | item.datas.forEach((citem) => { |
| | | this.annual.list.push({ |
| | | name: citem.groupKey, |
| | | num: citem.count, |
| | | value: item.key, |
| | | check: false, |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | if (item.key == "sourceFrom" && item.datas && item.datas.length) { |
| | | item.datas.forEach((citem) => { |
| | | this.sources.list.push({ |
| | | name: citem.groupKey, |
| | | num: citem.count, |
| | | value: item.key, |
| | | check: false, |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | if (item.key == "resourceType" && item.datas && item.datas.length) { |
| | | item.datas.forEach((citem) => { |
| | | this.categoryOBJ.list.push({ |
| | | name: citem.groupKey, |
| | | valueName: this.getGroupKey(citem.groupKey), |
| | | value: item.key, |
| | | num: citem.count, |
| | | check: false, |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 请求数据 |
| | | getItemList() { |
| | | this.loading = true; |
| | | console.log(this.inputValue, " inputValue"); |
| | | console.log(this.inputType, " inputType"); |
| | | |
| | | let searchData = {}; // 初始化一个空对象来存储搜索数据 |
| | | debugger; |
| | | if (this.inputValue) { |
| | | // 如果输入值存在 |
| | | if (this.inputType != "all") { |
| | |
| | | } |
| | | |
| | | console.log(this.associationList, "searchData11111"); |
| | | |
| | | if (this.associationList && this.associationList.length) { |
| | | this.associationList.forEach((item) => { |
| | | if (item.value !== "all") { |
| | |
| | | searchData[item.value + ">="] = startDate; |
| | | searchData[item.value + "<="] = endDate; |
| | | } else if (item.value) { |
| | | searchData[item.value + "*"] = item.content; |
| | | // searchData[item.value + "*"] = item.content; |
| | | const key = |
| | | item.value === "resourceType" ? "resourceType*" : item.value; |
| | | if (!searchData[key]) { |
| | | searchData[key] = []; // 如果属性不存在,初始化为数组 |
| | | } |
| | | searchData[key].push(item.content); |
| | | } else { |
| | | searchData["||" + item.value + "*"] = item.content; |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | // for (let key in searchData) { |
| | | // if (searchData[key].length === 1) { |
| | | // searchData[key] = searchData[key][0]; |
| | | // } |
| | | // } |
| | | |
| | | console.log(searchData, "searchData"); |
| | | MG.resource |
| | |
| | | source: [], |
| | | isbn: [], |
| | | year: [], |
| | | particularYear: [], |
| | | contributor: [], |
| | | abstract: [], |
| | | keyWords: [], |
| | | author: [], |
| | |
| | | AIReading: [], |
| | | file: [], |
| | | IssueNumber: [], |
| | | GroupBy: [["particularYear"], ["sourceFrom"], ["resourceType"]], |
| | | "subjectAffiliation*": this.subjectCheckList, |
| | | ...searchData, |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | console.log(res, "全部内容"); |
| | | |
| | | console.log(res, "res"); |
| | | res.datas.forEach((item) => { |
| | | item.year = moment(item.year).format("YYYY-MM-DD"); |
| | | if (typeof item.keyWords === "string") { |
| | |
| | | } |
| | | }, |
| | | |
| | | getGroupKey(typeName) { |
| | | switch (typeName) { |
| | | case "journal": |
| | | return "期刊"; |
| | | case "books": |
| | | return "图书"; |
| | | case "video": |
| | | return "视频"; |
| | | case "audio": |
| | | return "音频"; |
| | | case "newspaper": |
| | | return "newspaper-color"; |
| | | default: |
| | | return "other-color"; |
| | | } |
| | | }, |
| | | |
| | | openAiReading(text, name) { |
| | | this.AIReading = text; |
| | | this.aIName = name; |