跨域搜索
This commit is contained in:
parent
4653eb2c02
commit
3fa86351cf
File diff suppressed because it is too large
Load Diff
@ -1,134 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="abstract-group">
|
|
||||||
<el-checkbox-group v-model="abstract" class="abstract-checkbox-group" @change="changeCheckAll"
|
|
||||||
v-if="props.checkbox && (props.abstractList?.length !== 0)" >
|
|
||||||
<el-checkbox class="abstract-checkbox" v-for="(item,index) of props.abstractList" :key="index" :label="item">
|
|
||||||
<abstract-item :abstract="item" :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>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import AbstractItem from './abxtract-item.vue'
|
|
||||||
import { defineProps } from 'vue';
|
|
||||||
import {SearchVO} from "@/api/search/main";
|
|
||||||
defineOptions({ name: 'AbstractGroup' })
|
|
||||||
const emit = defineEmits(['changeCheckAll','openCollect'])
|
|
||||||
const props = defineProps<{
|
|
||||||
abstractList: Array<SearchVO>,
|
|
||||||
searchSimilar: Boolean,
|
|
||||||
checkAll: Boolean,
|
|
||||||
indeterminate: Boolean,
|
|
||||||
searchCheckList: Array<any>,
|
|
||||||
checkbox: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
showCollect: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
from: String
|
|
||||||
}>()
|
|
||||||
let abstract = reactive<any[]>([])
|
|
||||||
watch(
|
|
||||||
() => props.checkAll,
|
|
||||||
() => {
|
|
||||||
if (props.checkAll) {
|
|
||||||
abstract.splice(0,abstract.length,...props.abstractList)
|
|
||||||
} else if (!props.indeterminate) {
|
|
||||||
abstract.splice(0,abstract.length)
|
|
||||||
}
|
|
||||||
}, { immediate: true }
|
|
||||||
)
|
|
||||||
const changeCheckAll = (val) => {
|
|
||||||
if (abstract.length === props.abstractList?.length){
|
|
||||||
emit('changeCheckAll',true,val)
|
|
||||||
}else{
|
|
||||||
emit('changeCheckAll',false,val)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const openCollect = (data) => {
|
|
||||||
emit('openCollect', data);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (true) {
|
|
||||||
abstract.splice(0, abstract.length, ...props.abstractList);
|
|
||||||
}
|
|
||||||
if (props.searchCheckList && props.searchCheckList.length > 0)
|
|
||||||
{
|
|
||||||
// abstract.value = props.searchCheckList
|
|
||||||
abstract.splice(0, abstract.length, ...props.searchCheckList);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.abstract-group {
|
|
||||||
.abstract-checkbox-group {
|
|
||||||
/*padding: 0 4px;*/
|
|
||||||
|
|
||||||
.abstract-checkbox {
|
|
||||||
width: 100%;
|
|
||||||
border-bottom: 1px solid #ECEEF5;
|
|
||||||
/*cursor: auto;*/
|
|
||||||
transition: background-color .3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: #e1f3fb;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .el-checkbox__input {
|
|
||||||
position: absolute;
|
|
||||||
top: 26px;
|
|
||||||
left: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .el-checkbox__label {
|
|
||||||
padding: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-list {
|
|
||||||
.abstract {
|
|
||||||
width: 100%;
|
|
||||||
border-bottom: 1px solid #ECEEF5;
|
|
||||||
/*cursor: auto;*/
|
|
||||||
transition: background-color .3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background: #f5f7fa;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-checkbox-group-empty {
|
|
||||||
text-align: center;
|
|
||||||
border-bottom: 1px solid #ECEEF5;
|
|
||||||
border-right: 1px solid #ECEEF5;
|
|
||||||
border-left: 1px solid #ECEEF5;
|
|
||||||
|
|
||||||
> span {
|
|
||||||
color: #909399;
|
|
||||||
line-height: 120px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,280 +0,0 @@
|
|||||||
<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">发布日期:{{timeFilter(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>
|
|
||||||
<el-dialog
|
|
||||||
title="知识内容"
|
|
||||||
v-model="outerVisible"
|
|
||||||
style="height: 100%;
|
|
||||||
width: 100%"
|
|
||||||
>
|
|
||||||
<view
|
|
||||||
:list="viewLs"
|
|
||||||
/>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import Template from "../../../activiti/index.vue";
|
|
||||||
import View from "@/views/search/view.vue";
|
|
||||||
import {computed, defineProps } from "vue";
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import {SearchVO} from "@/api/search/main";
|
|
||||||
|
|
||||||
defineOptions({name:'AbstractItem'})
|
|
||||||
const router = useRouter();
|
|
||||||
const emit = defineEmits(['open-collect'])
|
|
||||||
const outerVisible = ref(false)
|
|
||||||
const viewLs = ref<Object>({})
|
|
||||||
const disViw = ref(false)
|
|
||||||
const props = defineProps<{
|
|
||||||
abstract: SearchVO,
|
|
||||||
searchSimilar: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
checkbox: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
showCollect: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
from: String
|
|
||||||
}>()
|
|
||||||
const filterTag = (val) =>{
|
|
||||||
return val.join(' ').replace(/<[^>]+>/g, '')
|
|
||||||
}
|
|
||||||
const fileName = (file) => {
|
|
||||||
return file
|
|
||||||
}
|
|
||||||
const isFileF = computed((v) => {
|
|
||||||
console.log(v)
|
|
||||||
return (v) => {
|
|
||||||
console.log(v)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
//方法
|
|
||||||
const addView = async () => {
|
|
||||||
viewLs.value = props.abstract
|
|
||||||
disViw.value = !disViw.value
|
|
||||||
}
|
|
||||||
const goInfo = async (row,path) => {
|
|
||||||
let url: { href: string } | null = null;
|
|
||||||
if (path === 'document'){
|
|
||||||
url = router.resolve({
|
|
||||||
name: 'dmInfo',
|
|
||||||
query: {
|
|
||||||
id: row.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (row.library.id === '1'){
|
|
||||||
url = router.resolve({
|
|
||||||
name: 'atomicView',
|
|
||||||
query: {
|
|
||||||
id: row.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
window.open(url?.href,'-blank')
|
|
||||||
}
|
|
||||||
|
|
||||||
const openCollect = async (data) => {
|
|
||||||
emit('open-collect', data)
|
|
||||||
}
|
|
||||||
//初始化
|
|
||||||
onMounted(() => {
|
|
||||||
addView();
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
$--color-primary: #1890ff;
|
|
||||||
|
|
||||||
.abstract-checkbox-item {
|
|
||||||
margin: 19px 9px 0 45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-list-item {
|
|
||||||
padding: 19px 9px 0 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item {
|
|
||||||
/*height: 153px;*/
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
.abstract-item-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
|
|
||||||
.abstract-item-title {
|
|
||||||
font-size: 16px;
|
|
||||||
color: #303133;
|
|
||||||
height: 24px;
|
|
||||||
line-height: 24px;
|
|
||||||
font-weight: 400;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 1;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
> .abstract-item-icon {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-time {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #909399;
|
|
||||||
margin-left: 20px;
|
|
||||||
|
|
||||||
> i {
|
|
||||||
font-style: normal;
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item-search {
|
|
||||||
width: 88px;
|
|
||||||
height: 22px;
|
|
||||||
border: 1px solid $--color-primary;
|
|
||||||
border-radius: 2px;
|
|
||||||
color: $--color-primary;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 22px;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
margin-left: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item-handle {
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 16px;
|
|
||||||
height: 16px;
|
|
||||||
color: $--color-primary;
|
|
||||||
margin-left: 15px;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
> i {
|
|
||||||
margin-right: 3px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item-info {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
font-size: 12px;
|
|
||||||
height: 15px;
|
|
||||||
line-height: 15px;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 1;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
> span {
|
|
||||||
color: #909399;
|
|
||||||
margin-right: 30px;
|
|
||||||
|
|
||||||
> i {
|
|
||||||
font-style: normal;
|
|
||||||
color: #303133;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item-desc {
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #606266;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
margin-bottom: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item-footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-size: 12px;
|
|
||||||
height: 15px;
|
|
||||||
line-height: 15px;
|
|
||||||
color: #909399;
|
|
||||||
margin-bottom: 19px;
|
|
||||||
|
|
||||||
.abstract-item-tag {
|
|
||||||
white-space: pre-wrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
> span.tag {
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.abstract-item-num {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
> i {
|
|
||||||
display: inline-block;
|
|
||||||
width: 1px;
|
|
||||||
height: 12px;
|
|
||||||
background-color: #C0C4CC;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,162 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-form ref="form" :model="list">
|
|
||||||
<el-form-item label="知识标题">
|
|
||||||
<input style=" height: 40px; width: 80%" :readOnly="true" v-model="infoList.title"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="创建时间">
|
|
||||||
<input style=" height: 40px; width: 80%" :readOnly="true" v-model="infoList.publishDate"/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="知识简介">
|
|
||||||
<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"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import {SearchVO} from "@/api/search/main";
|
|
||||||
|
|
||||||
defineOptions({name:'View'})
|
|
||||||
const props = defineProps<{
|
|
||||||
list: {
|
|
||||||
type: SearchVO,
|
|
||||||
default: () => ({})
|
|
||||||
}
|
|
||||||
}>()
|
|
||||||
const infoList = reactive({
|
|
||||||
title: '',
|
|
||||||
publishDate: '',
|
|
||||||
summary: '',
|
|
||||||
mainContent: ''
|
|
||||||
});
|
|
||||||
const infoListFc = async () => {
|
|
||||||
Object.assign(infoList, props.list);
|
|
||||||
console.log("infoList",infoList)
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
infoListFc()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<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;
|
|
||||||
font-size: 15px;
|
|
||||||
}
|
|
||||||
.preview-ul li:hover{
|
|
||||||
color:#409eff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.version-ul{
|
|
||||||
list-style: none;
|
|
||||||
width: 95%;
|
|
||||||
}
|
|
||||||
.version-ul li{
|
|
||||||
display: flex;
|
|
||||||
height: 50px;
|
|
||||||
align-items: center;
|
|
||||||
border-bottom: solid 1px #eee;
|
|
||||||
padding-left: 15px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.version-ul li:hover{
|
|
||||||
color:#409eff;
|
|
||||||
}
|
|
||||||
.version-ul li span{
|
|
||||||
margin: 0 15px 0 35px;
|
|
||||||
color: #ddd;
|
|
||||||
}
|
|
||||||
.label{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.time{
|
|
||||||
color:#bbb;
|
|
||||||
font-size: 12px;
|
|
||||||
padding-top: 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue
Block a user