跨域搜索

This commit is contained in:
XaoLi717 2024-08-19 15:03:07 +08:00
parent 3fa86351cf
commit 6c93c38417
5 changed files with 320 additions and 206 deletions

View File

@ -1,5 +1,5 @@
<template>
<div>
<div style="margin-top: 30px;height: 100%">
<abstract-group
:checkAll="kg.checkAll"
:abstractList="kg.list"
@ -8,7 +8,7 @@
@changeCheckAll = "changeCheckAllTrue"
class="abstract-group-list"
v-loading="loading"
/>
from=""/>
</div>
</template>

View File

@ -1,12 +1,21 @@
<template>
<div class="abstract-group">
123213123123567890
<!-- v-if="props.checkbox && (props.abstractList?.length !== 0)">-->
<!-- v-if="props.checkbox && (props.abstractList?.length !== 0)"-->
<el-checkbox-group v-model="abstract" class="abstract-checkbox-group" @change="changeCheckAll"
v-if="true">
<el-checkbox class="abstract-checkbox" v-for="(item,index) of props.abstractList" :key="index" :label="item">
>
<el-checkbox style="margin-bottom: 30px;height: 150px" class="abstract-checkbox" v-for="(item,index) of pppp" :key="index" :label="item">
<abstract-item :abstract="pppp[0]" :searchSimilar="props.searchSimilar" :showCollect="props.showCollect"
@open-collect="openCollect" :from="props.from"/>
</el-checkbox>
</el-checkbox-group>
<!-- <div class="abstract-list" v-if="!props.checkbox">-->
<!-- <abstract-item class="abstract" v-for="(item,index) of props.abstractList" :key="index" :abstract="item"-->
<!-- :searchSimilar="props.searchSimilar" :checkbox="props.checkbox" :showCollect="props.showCollect"-->
<!-- @open-collect="openCollect" :from="props.from"/>-->
<!-- </div>-->
<div class="abstract-checkbox-group-empty" v-if="props.abstractList?.length===0">
<span>暂无数据</span>
</div>
</div>
</template>
@ -16,23 +25,40 @@ import { defineProps } from 'vue';
import {SearchVO} from "@/api/search/search";
defineOptions({ name: 'AbstractGroup' })
const emit = defineEmits(['changeCheckAll','openCollect'])
const pppp = [
{
title:"001",
publishDate:"123",
summary:"23456789",
},
{
title:"002",
publishDate:"123",
summary:"23456789",
},
{
title:"003",
publishDate:"123",
summary:"23456789",
},
]
const props = defineProps<{
abstractList: Array<SearchVO>,
searchSimilar: {
type:boolean,
default: false
},
// searchSimilar: {
// type:boolean,
// default: false
// },
checkAll: boolean,
indeterminate: boolean,
searchCheckList: Array<any>,
checkbox: {
type: boolean,
default: true
},
showCollect: {
type: boolean,
default: false
},
// checkbox: {
// type: boolean,
// default: true
// },
// showCollect: {
// type: boolean,
// default: false
// },
from: string
}>()
let abstract = reactive<SearchVO[]>([])
@ -64,7 +90,6 @@ onMounted(() => {
}
if (props.searchCheckList && props.searchCheckList.length > 0)
{
// abstract.value = props.searchCheckList
abstract.splice(0, abstract.length, ...props.searchCheckList);
}
})

View File

@ -1,66 +1,49 @@
<template>
<div class="abstract-item" :class="checkbox ? 'abstract-checkbox-item': 'abstract-list-item'"
@click.prevent="goInfo(abstract,from)" >
<div class="abstract-item-header">
<div class="abstract-item-title">
<i class="abstract-item-icon"
v-if="isFileF(abstract.title)"
:class="fileName(abstract.title)"></i>
<span v-html="abstract.title" :title="filterTag(abstract.title).replace(/<[^>]+>/g,'')">
</span>
</div>
<div class="abstract-time">发布日期{{abstract.publishDate}}</div>
<div class="abstract-item-handle" v-if="showCollect" @click.stop="openCollect(abstract)"><i
class="ic-shoucang1"></i>收藏
</div>
</div>
<div class="abstract-item-info">
<!-- <span :title="abstract.author">作者<i>{{abstract.author}}</i></span>-->
<!-- <span v-if="abstract.type" :title="abstract.type">分类<i>{{abstract.type}}</i></span>-->
</div>
<div class="abstract-item-desc" v-html="abstract.summary"></div>
<div class="abstract-item-footer">
<div class="abstract-item-tag">
<!-- <span>标签</span>-->
<!-- <span v-for="(tag,t) of abstract.labels" :key="t" class="tag" v-html="tag"-->
<!-- :title="filterTag(abstract.labels)"></span>-->
<!-- <span v-if="!abstract.labels || abstract.labels.length===0" class="tag">暂无标签</span>-->
</div>
<div class="abstract-item-num">
<template>
<span @click="outerVisible = true">查看详细信息 *</span>
</template>
<template>
<i></i>
<span>浏览{{abstract.readCount?abstract.readCount:0}}</span>
</template>
<!-- <template v-if="!searchSimilar">-->
<!-- <i></i>-->
<!-- <span>评论{{abstract.commentCount?abstract.commentCount:0}}</span>-->
<!-- </template>-->
</div>
<div>
<div style="height: 150px;">
<el-row :gutter="10" style="height: 30px;">
<el-col :span="12">
{{abstract.title}}
</el-col>
<el-col :span="12">
发布日期{{abstract.publishDate}}
</el-col>
</el-row>
<el-row :gutter="10" style="height: 30px;">
<el-col :span="24">
作者: {{}}
</el-col>
</el-row>
<el-row :gutter="10" style="height: 30px;">
<el-col :span="24">
{{abstract.summary}}
</el-col>
</el-row>
<el-row :gutter="10" style="height: 30px;">
<el-col :span="24">
操作:
<span style="margin-top: 30px" @click="outerVisible = true">查看详细信息 </span>
</el-col>
</el-row>
</div>
<div>
<el-dialog
title="知识内容"
v-model="outerVisible"
style="height: 100%;
width: 100%"
style="height: 90%;
width: 90%"
>
<view
:list="viewLs"
/>
<ViewList :list="abstract"/>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts">
import Template from "../../../activiti/index.vue";
import View from "@/views/search/view.vue";
// import Template from "../../../activiti/index.vue";
import ViewList from "../search/view.vue"
import {computed, defineProps } from "vue";
import { useRouter } from 'vue-router';
import {SearchVO} from "@/api/search/search";
defineOptions({name:'AbstractItem'})
const router = useRouter();
@ -69,15 +52,16 @@ const outerVisible = ref(false)
const viewLs = ref<Object>({})
const disViw = ref(false)
const props = defineProps<{
abstract: SearchVO,
// abstract: SearchVO,
abstract: object,
searchSimilar: {
type: Boolean,
default: false
},
checkbox: {
type: Boolean,
default: true
},
// checkbox: {
// type: Boolean,
// default: true
// },
showCollect: {
type: Boolean,
default: false
@ -101,6 +85,7 @@ const isFileF = computed((v) => {
const addView = async () => {
viewLs.value = props.abstract
disViw.value = !disViw.value
console.log("disViw.value",props.abstract)
}
const goInfo = async (row,path) => {
let url: { href: string } | null = null;
@ -127,6 +112,7 @@ const openCollect = async (data) => {
}
//
onMounted(() => {
// console.log(props.abstract)
addView();
})
</script>

View File

@ -1,4 +1,5 @@
<template>
<div>
<section class="wrapper">
<div class="content" style="padding-top: 60px;">
<div class="mainwidth" v-show="true">
@ -18,14 +19,15 @@
</div>
<div style="clear: both;"></div>
</div>
<div style="margin: 0 auto;width: 75%;">
<el-form ref="form" :model="form" label-width="90px">
<div class="literature_index">
<div>
<div class="searchbox">
<div class="searchbox" style="margin-bottom: 20px">
<el-form-item label="检索条件">
<el-col :span="6">
<el-select v-model="searchKey2" placeholder="请选择" size="small">
<el-select v-model="searchKey2" placeholder="请选择" size="default">
<el-option
v-for="item in options"
:key="item.value"
@ -34,20 +36,18 @@
</el-select>
</el-col>
<el-col :span="13">
<!-- <el-input v-model="form.searchValue" placeholder="请输入关键字" size="small"/>-->
<el-input v-model="searchValue2" placeholder="请输入关键字2" size="small"/>
<el-input v-model="searchValue2" placeholder="请输入关键字" style="width:80%" size="default"/>
</el-col>
<el-col :span="5">
<input value="检索" class="vipsearch" type="button" @click="searchList"/>
<!-- <input type="button" onclick="alert('还未建设,你有兴趣参与吗')" class="vipsearch" value="高级检索 "/>-->
</el-col>
</el-form-item>
</div>
<div class="searchbox">
<div class="searchbox" style="margin-bottom: 20px">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="每页显示">
<el-select v-model="pageSize2" placeholder="请选择" size="small">
<el-select v-model="pageSize2" placeholder="请选择" size="default">
<el-option
v-for="item in pageOpt"
:key="item.value"
@ -58,7 +58,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="排序选项">
<el-select v-model="sortBy2" placeholder="请选择" size="small">
<el-select v-model="sortBy2" placeholder="请选择" size="default">
<el-option
v-for="item in sortByOpt"
:key="item.value"
@ -69,7 +69,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="排序方式">
<el-select v-model="sortType2" placeholder="请选择" size="small">
<el-select v-model="sortType2" placeholder="请选择" size="default">
<el-option
v-for="item in sortTypeOpt"
:key="item.value"
@ -80,10 +80,10 @@
</el-col>
</el-row>
</div>
<div class="searchbox">
<div class="searchbox" style="margin-bottom: 20px">
<el-form-item label="检索方式">
<el-col :span="6">
<el-select v-model="searchBy2" placeholder="请选择" size="small">
<el-select v-model="searchBy2" placeholder="请选择" size="default">
<el-option
v-for="item in searchByOpt"
:key="item.value"
@ -96,16 +96,18 @@
</div>
</div>
</el-form>
<div class="index_showinfo" v-if="mainList.length===0">
<div class="index_showinfo" v-if="mainList.length===0" >
<!-- <div class="index_showinfo" v-if="mainList.length!==0" >-->
<div class="MoveRight" style="border:1px solid #dbf1fb;width: 650px; padding: 10px;">
<div class="title1"><i class="t-ico1;"></i><em>热搜词&nbsp;&nbsp;</em></div>
<div class="floatTxt" id="tagscloud">
<div ref="tagcloudall">
<!-- <a ref="tagcloudall2" v-for="item in tagList" :href="item.url"-->
<!-- class="tagc1" :title="item.key"-->
<!-- style="left: 0px; top: 0px; z-index: 239; opacity: 4.80967;">-->
<!-- <font color="#1f95df">{{item.key}}({{item.recno}})</font>-->
<!-- </a>-->
<a v-for="item in tagList" :href="item.url" :key="item.key"
class="tagc1" :title="item.key"
style="left: 0px; top: 0px; z-index: 239; opacity: 4.80967;">
<font color="#1f95df">{{item.key}}({{item.recno}})</font>
</a>
</div>
</div>
</div>
@ -121,15 +123,16 @@
</div>
</div>
</div>
<!-- <list-->
<!-- :list="mainList"-->
<!-- />-->
<list :list="mainList" />
<div class="searchbox" style="height: 500px;background-color: #f3ffff">
</div>
</div>
</section>
</div>
</template>
<script setup lang="ts">
import {SearchApi,SearchVO} from "@/api/search/search";
// import List from "@/views/search/List.vue";
import List from "@/views/search/List.vue";
defineOptions({name:'Search'})
@ -219,6 +222,7 @@ const searchList = async () => {
}
const onReady = () => {
nextTick(() => {
oList.value = tagcloudall.value
if (oList.value) {
oList.value = oList.value as HTMLElement;
oA.value = Array.from(oList.value.getElementsByTagName('a'));
@ -10255,6 +10259,7 @@ const query = async () => {
}
];
tagList.value = tagListOrg.slice(0, 50);
console.log(tagList.value)
onReady();
};
const update = () => {
@ -10378,10 +10383,14 @@ onMounted(() => {
})
</script>
<style scoped>
@import "../../assets/kms/styles/style.css";
/* 机器人样式 */
.iyunwen_js_class {
top: -100px;
position: fixed !important;
}
.MoveRight {
width: 766px;
@ -10453,6 +10462,11 @@ onMounted(() => {
border-radius: 3px;
}
/* #tagscloud a.tagc1{color:#666;opacity: 0.68293; padding: 5px;}
#tagscloud a.tagc2{color:#F16E50;opacity: 0.68293; padding: 5px;}
#tagscloud a.tagc3{color:#83c325;opacity: 0.68293; padding: 5px;}
#tagscloud a.tagc4{color:#0F6098;opacity: 0.68293; padding: 5px;}
#tagscloud a.tagc5{color:#006633;opacity: 0.68293; padding: 5px;} */
#tagscloud a:hover {
background: #fff;
border: 1px solid #1f95df;
@ -10464,7 +10478,7 @@ onMounted(() => {
min-width:60px;
max-width:120px;
text-align: right;
} */
} */
.literature_index {
width: 100%;

View File

@ -11,18 +11,17 @@
<input style=" height: 40px; width: 80%" :readOnly="true" v-model="infoList.summary"/>
</el-form-item>
<el-form-item label="知识内容">
<editor style="width: 100%" :readOnly="true" v-model="infoList.mainContent"/>
<editor style="width: 80%" :readOnly="true" v-model="infoList.mainContent"/>
</el-form-item>
</el-form>
</div>
</template>
<script setup lang="ts">
import {SearchVO} from "@/api/search/search";
defineOptions({name:'View'})
defineOptions({name:'ViewList'})
const props = defineProps<{
list: SearchVO
list: object,
}>()
const infoList = reactive({
title: '',
@ -37,8 +36,8 @@ const infoListFc = () => {
infoList.publishDate = props.list.publishDate
infoList.summary = props.list.summary
infoList.mainContent = props.list.mainContent
console.log("infoList",infoList)
console.log("props.list",props.list)
// console.log("infoList",infoList)
// console.log("props.list",props.list)
}
onMounted(() => {
@ -48,6 +47,83 @@ onMounted(() => {
<style scoped>
/*@import url("http://at.alicdn.com/t/font_2602024_czfyrrtt7tk.css");*/
.iconfont{
font-family: hufont!important;
font-style: normal;
margin-right: 5px;
color: #00afff;
speak: none;
font-weight: 400;
font-variant: normal;
text-transform: none;
line-height: 1;
vertical-align: baseline;
display: inline-block;
}
.ic-xiangguanziliao-copy{
font-size: 13px;
}
.list-title{
/*border-bottom: solid 1px #eee;
padding: 0 1px 8px 1px;*/
color:#00afff ;
}
.kms-view{
background: #FFFFFF;
margin: 10px auto;
}
.kms-header{
background: #FFFFFF;
box-shadow: 0px 2px 18px 1px rgba(0, 0, 0, 0.08);
border-radius: 4px 4px 4px 4px;
margin: 15px auto;
width: 90%;
}
.kms-header-title{
text-align: center;
padding: 30px 0px;
}
.kms-header-summary{
text-align: center;
color: #5d5d5d;
padding: 5px 10px 30px;
}
.kms-header-create-info{
color: #5d5d5d;
font-size: 13px;
padding: 5px 10px 30px;
display: flex;
justify-content: space-around;
width: 30%;
margin: 0 auto;
}
.kms-content{
background: #FFFFFF;
box-shadow: 0px 2px 18px 1px rgba(0, 0, 0, 0.08);
border-radius: 4px 4px 4px 4px;
margin: 15px auto;
width: 90%;
padding: 30px;
}
.list-panel{
background: #FFFFFF;
box-shadow: 0px 2px 18px 1px rgba(0, 0, 0, 0.08);
border-radius: 4px 4px 4px 4px;
margin: 15px auto;
width: 90%;
padding: 15px 20px 30px;
}
.preview-ul{
list-style: none;
width: 95%;
}
.preview-ul li{
padding: 5px 10px;
cursor: pointer;
@ -57,6 +133,10 @@ onMounted(() => {
color:#409eff;
}
.version-ul{
list-style: none;
width: 95%;
}
.version-ul li{
display: flex;
height: 50px;
@ -72,4 +152,13 @@ onMounted(() => {
margin: 0 15px 0 35px;
color: #ddd;
}
.label{
}
.time{
color:#bbb;
font-size: 12px;
padding-top: 5px;
}
</style>