| | |
| | | <li class="main-name"> |
| | | <p>{{ item.name }}</p> |
| | | <p> |
| | | <el-button @click="goPage(item)">详情</el-button> |
| | | <el-button @click="goPage(item.id)">详情</el-button> |
| | | <el-button>AI智能阅读</el-button> |
| | | </p> |
| | | </li> |
| | |
| | | <li class="main-author"> |
| | | {{ item.author }} |
| | | </li> |
| | | <li class="main-title" :title="item.abstract"> |
| | | <li class="main-title" :title="item.cleanAbstract" v-if="item.abstract"> |
| | | <span>摘要: </span> |
| | | <span class="page-main-abstract" v-html="item.abstract"></span> |
| | | </li> |
| | | <li class="main-keyword"> |
| | | <li class="main-keyword" v-if="item.keyWords && item.keyWords.length > 0"> |
| | | <span>关键词:</span> |
| | | <span |
| | | class="keyWord" |
| | |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | relatedList: [], |
| | | // 输入框的内容 |
| | | inputValue: "", |
| | | // 选择的类型 |
| | |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.getSelectContent(); |
| | | this.getLeftCheckbox(); |
| | | this.getSelectData(); |
| | | }, |
| | | |
| | |
| | | // this.onSearch(""); |
| | | }, |
| | | // 页面跳转 |
| | | goPage(key) { |
| | | console.log(key, "key"); |
| | | this.$router.push({ name: "details", params: { key: key } }); |
| | | goPage(id) { |
| | | this.$router.push({ name: "details", query: { id } }); |
| | | }, |
| | | // 收起和展示 |
| | | shrinkClick(key, name) { |
| | |
| | | this.activeBox = this.activeBox === "b" ? null : "b"; |
| | | } |
| | | }, |
| | | // 获取左侧checkbox数据 |
| | | getLeftCheckbox() {}, |
| | | |
| | | //获取下拉选择框的内容 |
| | | async getSelectData() { |
| | |
| | | .getProductTypeField(requestData) |
| | | .then((res) => { |
| | | const selestList = JSON.parse(res[0].config); |
| | | console.log(selestList, "下拉框数据"); |
| | | return selestList; |
| | | }) |
| | | .catch((error) => { |
| | |
| | | (item) => item.content !== value |
| | | ); |
| | | this.inputValue = ""; |
| | | this.getItemList(); |
| | | // 通知父组件数据已改变 |
| | | this.getItemList() |
| | | }, |
| | | |
| | | // 搜索 |
| | | handleSearch(isText) { |
| | | console.log(1234); |
| | | console.log(isText, "搜索123"); |
| | | this.associationList = [] |
| | | if (isText.text != "") { |
| | | this.inputValue = isText.text; |
| | | this.inputType = isText.type; |
| | |
| | | } |
| | | }, |
| | | |
| | | // getTtem |
| | | // 请求数据 |
| | | getItemList() { |
| | | let searchData = {}; |
| | | if (this.inputValue) { |
| | | if (this.inputType != "all") { |
| | | let searchData = {}; // 初始化一个空对象来存储搜索数据 |
| | | if (this.inputValue) { // 如果输入值存在 |
| | | if (this.inputType != "all") { // 如果输入类型不是"all" |
| | | // 将输入值与输入类型关联,并添加一个星号(*)作为后缀 |
| | | searchData[this.inputType + "*"] = this.inputValue; |
| | | } else { |
| | | } else { // 如果输入类型是"all" |
| | | // 遍历输入选项 |
| | | for (let index = 0; index < this.inputOptions.length; index++) { |
| | | const item = this.inputOptions[index]; |
| | | if (item.value !== "all") { |
| | | console.log(item.value, "987"); |
| | | if (!Object.keys(searchData).length) { |
| | | const item = this.inputOptions[index]; // 获取当前选项 |
| | | if (item.value !== "all") { // 如果当前选项的值不是"all" |
| | | if (!Object.keys(searchData).length) { // 如果searchData是空的 |
| | | // 将第一个选项的值与输入值关联,并添加一个星号(*)作为后缀 |
| | | searchData[item.value + "*"] = this.inputValue; |
| | | } else { |
| | | } else { // 如果searchData不是空的 |
| | | // 使用"||"作为前缀,将后续选项的值与输入值关联,并添加一个星号(*)作为后缀 |
| | | // 这通常用于构建一个逻辑或(OR)查询 |
| | | searchData["||" + item.value + "*"] = this.inputValue; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (this.associationList && this.associationList.length) { |
| | | this.associationList.forEach((item) => { |
| | | searchData[item.value + "*"] = item.content; |
| | | }); |
| | | } |
| | | console.log(searchData, "searchData"); |
| | | MG.resource |
| | | .getItem({ |
| | | path: "*", |
| | |
| | | }, |
| | | }) |
| | | .then((res) => { |
| | | console.log(res, "全部数据"); |
| | | console.log(res, "全部内容"); |
| | | |
| | | res.datas.forEach((item) => { |
| | | item.year = moment(item.year).format("YYYY-MM-DD"); |
| | | if (typeof item.keyWords === "string") { |
| | |
| | | // 设置一个默认值或者进行其他错误处理 |
| | | item.keyWords = []; |
| | | } |
| | | item.resourceTypeName = this.category.list.find( |
| | | (citem) => citem.value == item.cmsItemType |
| | | ).name; |
| | | }); |
| | | this.resultList = res.datas; |
| | | // item.cleanAbstract = item.abstract.replace(/<[^>]+>/g, ""); |
| | | const foundItem = this.category.list.find((citem) => citem.value == item.cmsItemType); |
| | | item.resourceTypeName = foundItem ? foundItem.name : ''; |
| | | }) |
| | | this.resultList = res.datas |
| | | this.total = res.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | |
| | | // 处理页码变化 |
| | | handleCurrentChange(newPage) { |
| | | this.paginationPage = newPage; |
| | | this.getItemList(); // 重新获取数据 |
| | | // 滚动到页面顶部 |
| | | this.$nextTick(() => { |
| | | const pageMain = document.querySelector('.page-main-father'); |
| | | if (pageMain) { |
| | | pageMain.scrollTo({ |
| | | top: 0, |
| | | behavior: 'smooth' |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | sortChange() { |
| | | this.postedSortInfo = !this.postedSortInfo; |
| | |
| | | flex: 1; |
| | | width: 100%; |
| | | height: 100%; |
| | | min-width: 1292px; |
| | | min-width: 1250px; |
| | | overflow: auto; |
| | | padding-top: 1%; |
| | | padding-bottom: 2%; |
| | |
| | | background-color: transparent; |
| | | color: #937950; |
| | | border: 1px solid #6f5a3a; |
| | | cursor: pointer; |
| | | |
| | | &:hover { |
| | | background-color: #6f5a3a; |
| | |
| | | border-radius: 5px; |
| | | border: 1px solid #cccccc; |
| | | } |
| | | </style> |
| | | </style> |