跨域搜索
This commit is contained in:
parent
6c93c38417
commit
b77fc2276c
@ -29,7 +29,6 @@ export interface SearchVO {
|
|||||||
export const SearchApi = {
|
export const SearchApi = {
|
||||||
// 查询【请填写功能名称】分页
|
// 查询【请填写功能名称】分页
|
||||||
getSearchPage: async (params: any) => {
|
getSearchPage: async (params: any) => {
|
||||||
console.log("getSearchPage",params)
|
|
||||||
return await request.get({ url: `/bpm/knowledge/listForEs`, params })
|
return await request.get({ url: `/bpm/knowledge/listForEs`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div style="margin-top: 30px;height: 100%">
|
<div style="margin-top: 30px;height: 100%">
|
||||||
<abstract-group
|
<abstract-group
|
||||||
:checkAll="kg.checkAll"
|
:checkAll="kg.checkAll"
|
||||||
:abstractList="kg.list"
|
:abstractList="kg.list[0]"
|
||||||
:indeterminate="kg.indeterminate"
|
:indeterminate="kg.indeterminate"
|
||||||
:searchCheckList="kg.checkKg"
|
:searchCheckList="kg.checkKg"
|
||||||
@changeCheckAll = "changeCheckAllTrue"
|
@changeCheckAll = "changeCheckAllTrue"
|
||||||
@ -31,13 +31,16 @@ watch(
|
|||||||
() => props.list,
|
() => props.list,
|
||||||
(newList) => {
|
(newList) => {
|
||||||
kg.list = [newList];
|
kg.list = [newList];
|
||||||
console.log('kg.list', kg);
|
// console.log('kg.list', kg.list[0]);
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
const changeCheckAllTrue = (val,data) => {
|
const changeCheckAllTrue = (val,data) => {
|
||||||
kg.indeterminate = true
|
kg.indeterminate = true
|
||||||
kg.checkAll = val
|
kg.checkAll = val
|
||||||
kg.checkKg = data
|
kg.checkKg = data
|
||||||
}
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
// console.log("props.list",props.list)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="abstract-group">
|
<div class="abstract-group">
|
||||||
<!-- v-if="props.checkbox && (props.abstractList?.length !== 0)"-->
|
|
||||||
<el-checkbox-group v-model="abstract" class="abstract-checkbox-group" @change="changeCheckAll"
|
<el-checkbox-group v-model="abstract" class="abstract-checkbox-group" @change="changeCheckAll"
|
||||||
|
v-if="(props.abstractList?.length !== 0)"
|
||||||
>
|
>
|
||||||
<el-checkbox style="margin-bottom: 30px;height: 150px" class="abstract-checkbox" v-for="(item,index) of pppp" :key="index" :label="item">
|
<el-checkbox style="margin-bottom: 30px;height: 100px" class="abstract-checkbox" v-for="(item,index) of abstractList" :key="index" :label="item">
|
||||||
<abstract-item :abstract="pppp[0]" :searchSimilar="props.searchSimilar" :showCollect="props.showCollect"
|
<abstract-item style="margin-left: 50px" :abstract="item" :searchSimilar="props.searchSimilar" :showCollect="props.showCollect"
|
||||||
@open-collect="openCollect" :from="props.from"/>
|
@open-collect="openCollect" :from="props.from"/>
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
|
|
||||||
<!-- <div class="abstract-list" v-if="!props.checkbox">-->
|
<!-- <div class="abstract-list" v-if="!props.checkbox">-->
|
||||||
<!-- <abstract-item class="abstract" v-for="(item,index) of props.abstractList" :key="index" :abstract="item"-->
|
<!-- <abstract-item class="abstract" v-for="(item,index) of props.abstractList" :key="index" :abstract="item"-->
|
||||||
<!-- :searchSimilar="props.searchSimilar" :checkbox="props.checkbox" :showCollect="props.showCollect"-->
|
<!-- :searchSimilar="props.searchSimilar" :checkbox="props.checkbox" :showCollect="props.showCollect"-->
|
||||||
<!-- @open-collect="openCollect" :from="props.from"/>-->
|
<!-- @open-collect="openCollect" :from="props.from"/>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div class="abstract-checkbox-group-empty" v-if="props.abstractList?.length===0">
|
<!-- <div class="abstract-checkbox-group-empty" v-if="props.abstractList.length===0">-->
|
||||||
|
<div class="abstract-checkbox-group-empty" v-if="props.abstractList.length===0">
|
||||||
<span>暂无数据</span>
|
<span>暂无数据</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -25,23 +27,6 @@ import { defineProps } from 'vue';
|
|||||||
import {SearchVO} from "@/api/search/search";
|
import {SearchVO} from "@/api/search/search";
|
||||||
defineOptions({ name: 'AbstractGroup' })
|
defineOptions({ name: 'AbstractGroup' })
|
||||||
const emit = defineEmits(['changeCheckAll','openCollect'])
|
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<{
|
const props = defineProps<{
|
||||||
abstractList: Array<SearchVO>,
|
abstractList: Array<SearchVO>,
|
||||||
// searchSimilar: {
|
// searchSimilar: {
|
||||||
@ -85,11 +70,13 @@ const openCollect = (data) => {
|
|||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// console.log("props.abstractList",props.abstractList)
|
||||||
if (true) {
|
if (true) {
|
||||||
abstract.splice(0, abstract.length, ...props.abstractList);
|
abstract.splice(0, abstract.length, ...props.abstractList);
|
||||||
}
|
}
|
||||||
if (props.searchCheckList && props.searchCheckList.length > 0)
|
if (props.searchCheckList && props.searchCheckList.length > 0)
|
||||||
{
|
{
|
||||||
|
// console.log("props.searchCheckList",props.searchCheckList)
|
||||||
abstract.splice(0, abstract.length, ...props.searchCheckList);
|
abstract.splice(0, abstract.length, ...props.searchCheckList);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -2,27 +2,24 @@
|
|||||||
<div>
|
<div>
|
||||||
<div style="height: 150px;">
|
<div style="height: 150px;">
|
||||||
<el-row :gutter="10" style="height: 30px;">
|
<el-row :gutter="10" style="height: 30px;">
|
||||||
<el-col :span="12">
|
<el-col :span="24">
|
||||||
{{abstract.title}}
|
标题: {{abstract.knowTitle}}
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
发布日期:{{abstract.publishDate}}
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" style="height: 30px;">
|
<el-row :gutter="10" style="height: 30px;">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
作者: {{}}
|
作者: {{abstract.userName}}
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" style="height: 30px;">
|
<el-row :gutter="10" style="height: 30px;">
|
||||||
<el-col :span="24" >
|
<el-col :span="24" >
|
||||||
{{abstract.summary}}
|
发布日期: {{timenew}}
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" style="height: 30px;">
|
<el-row :gutter="10" style="height: 30px;">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
操作:
|
操作:
|
||||||
<span style="margin-top: 30px" @click="outerVisible = true">查看详细信息 </span>
|
<span @click="outerVisible = true">查看详细信息 </span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@ -30,7 +27,7 @@
|
|||||||
<el-dialog
|
<el-dialog
|
||||||
title="知识内容"
|
title="知识内容"
|
||||||
v-model="outerVisible"
|
v-model="outerVisible"
|
||||||
style="height: 90%;
|
style="height: auto;
|
||||||
width: 90%"
|
width: 90%"
|
||||||
>
|
>
|
||||||
<ViewList :list="abstract"/>
|
<ViewList :list="abstract"/>
|
||||||
@ -46,7 +43,7 @@ import {computed, defineProps } from "vue";
|
|||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
defineOptions({name:'AbstractItem'})
|
defineOptions({name:'AbstractItem'})
|
||||||
const router = useRouter();
|
// const router = useRouter();
|
||||||
const emit = defineEmits(['open-collect'])
|
const emit = defineEmits(['open-collect'])
|
||||||
const outerVisible = ref(false)
|
const outerVisible = ref(false)
|
||||||
const viewLs = ref<Object>({})
|
const viewLs = ref<Object>({})
|
||||||
@ -68,51 +65,64 @@ const props = defineProps<{
|
|||||||
},
|
},
|
||||||
from: String
|
from: String
|
||||||
}>()
|
}>()
|
||||||
const filterTag = (val) =>{
|
const formatdate = ref(props.abstract.createTime)
|
||||||
return val.join(' ').replace(/<[^>]+>/g, '')
|
const timenew = computed(() =>{
|
||||||
}
|
const date = new Date(formatdate.value);
|
||||||
const fileName = (file) => {
|
const year = date.getFullYear();
|
||||||
return file
|
const month = String(date.getMonth() + 1).padStart(2,"0")
|
||||||
}
|
const day = String(date.getDate()).padStart(2,"0")
|
||||||
const isFileF = computed((v) => {
|
const hours = String(date.getHours()).padStart(2, '0');
|
||||||
console.log(v)
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||||
return (v) => {
|
|
||||||
console.log(v)
|
|
||||||
return false
|
return `${year}年${month}月${day}日 ${hours}:${minutes}`;
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
// 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 () => {
|
const addView = async () => {
|
||||||
viewLs.value = props.abstract
|
viewLs.value = props.abstract
|
||||||
disViw.value = !disViw.value
|
disViw.value = !disViw.value
|
||||||
console.log("disViw.value",props.abstract)
|
// console.log("disViw.value",props.abstract)
|
||||||
}
|
// console.log("disViw.value",viewLs.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 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) => {
|
// const openCollect = async (data) => {
|
||||||
emit('open-collect', data)
|
// emit('open-collect', data)
|
||||||
}
|
// }
|
||||||
//初始化
|
//初始化
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// console.log(props.abstract)
|
// console.log("props.abstract",props.abstract)
|
||||||
addView();
|
addView();
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="overflow:scroll;height: 100%">
|
||||||
<section class="wrapper">
|
<section class="wrapper">
|
||||||
<div class="content" style="padding-top: 60px;">
|
<div class="content" style="padding-top: 60px;">
|
||||||
<div class="mainwidth" v-show="true">
|
<div class="mainwidth" v-show="true">
|
||||||
@ -35,8 +35,8 @@
|
|||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="13">
|
<el-col :span="13" style="margin-top: 5px">
|
||||||
<el-input v-model="searchValue2" placeholder="请输入关键字" style="width:80%" size="default"/>
|
<el-input v-model="searchValue2" placeholder="请输入关键字" style="width:90%" size="default"/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<input value="检索" class="vipsearch" type="button" @click="searchList"/>
|
<input value="检索" class="vipsearch" type="button" @click="searchList"/>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="searchbox" style="margin-bottom: 20px">
|
<div class="searchbox" style="margin-bottom: 20px">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="8">
|
<el-col :span="12">
|
||||||
<el-form-item label="每页显示">
|
<el-form-item label="每页显示">
|
||||||
<el-select v-model="pageSize2" placeholder="请选择" size="default">
|
<el-select v-model="pageSize2" placeholder="请选择" size="default">
|
||||||
<el-option
|
<el-option
|
||||||
@ -56,7 +56,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="12">
|
||||||
<el-form-item label="排序选项">
|
<el-form-item label="排序选项">
|
||||||
<el-select v-model="sortBy2" placeholder="请选择" size="default">
|
<el-select v-model="sortBy2" placeholder="请选择" size="default">
|
||||||
<el-option
|
<el-option
|
||||||
@ -67,7 +67,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
</el-row>
|
||||||
|
</div>
|
||||||
|
<div class="searchbox" style="margin-bottom: 20px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
<el-form-item label="排序方式">
|
<el-form-item label="排序方式">
|
||||||
<el-select v-model="sortType2" placeholder="请选择" size="default">
|
<el-select v-model="sortType2" placeholder="请选择" size="default">
|
||||||
<el-option
|
<el-option
|
||||||
@ -78,11 +82,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
<el-col :span="12">
|
||||||
</div>
|
|
||||||
<div class="searchbox" style="margin-bottom: 20px">
|
|
||||||
<el-form-item label="检索方式">
|
<el-form-item label="检索方式">
|
||||||
<el-col :span="6">
|
|
||||||
<el-select v-model="searchBy2" placeholder="请选择" size="default">
|
<el-select v-model="searchBy2" placeholder="请选择" size="default">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in searchByOpt"
|
v-for="item in searchByOpt"
|
||||||
@ -90,15 +91,15 @@
|
|||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</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="MoveRight" style="border:1px solid #dbf1fb;width: 650px; padding: 10px;">
|
||||||
<div class="title1"><i class="t-ico1;"></i><em>热搜词 </em></div>
|
<div class="title1"><i class="t-ico1;"></i><em>热搜词 </em></div>
|
||||||
<div class="floatTxt" id="tagscloud">
|
<div class="floatTxt" id="tagscloud">
|
||||||
@ -177,6 +178,8 @@ const options = ref([
|
|||||||
{ value: 'author', label: '作者' }
|
{ value: 'author', label: '作者' }
|
||||||
])
|
])
|
||||||
const pageOpt = ref([
|
const pageOpt = ref([
|
||||||
|
{ value: 3, label: '3' },
|
||||||
|
{ value: 5, label: '5' },
|
||||||
{ value: 10, label: '10' },
|
{ value: 10, label: '10' },
|
||||||
{ value: 20, label: '20' },
|
{ value: 20, label: '20' },
|
||||||
{ value: 30, label: '30' },
|
{ value: 30, label: '30' },
|
||||||
@ -210,11 +213,10 @@ const searchList = async () => {
|
|||||||
form.sortBy = sortBy2.value
|
form.sortBy = sortBy2.value
|
||||||
form.sortType = sortType2.value
|
form.sortType = sortType2.value
|
||||||
form.searchBy = searchBy2.value
|
form.searchBy = searchBy2.value
|
||||||
console.log("form.value",form)
|
|
||||||
const data = await SearchApi.getSearchPage(form)
|
const data = await SearchApi.getSearchPage(form)
|
||||||
mainList.value = data.rows;
|
mainList.value = data;
|
||||||
console.log("data",data)
|
// console.log("data",data)
|
||||||
console.log("mainList.value",mainList.value)
|
// console.log("mainList.value",mainList.value)
|
||||||
total.value = data.total;
|
total.value = data.total;
|
||||||
}finally{
|
}finally{
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@ -10258,8 +10260,8 @@ const query = async () => {
|
|||||||
"rdrrecno": 0
|
"rdrrecno": 0
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
tagList.value = tagListOrg.slice(0, 50);
|
tagList.value = tagListOrg.slice(0, 40);
|
||||||
console.log(tagList.value)
|
// console.log(tagList.value)
|
||||||
onReady();
|
onReady();
|
||||||
};
|
};
|
||||||
const update = () => {
|
const update = () => {
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
<input style=" height: 40px; width: 80%" :readOnly="true" v-model="infoList.summary"/>
|
<input style=" height: 40px; width: 80%" :readOnly="true" v-model="infoList.summary"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="知识内容">
|
<el-form-item label="知识内容">
|
||||||
<editor style="width: 80%" :readOnly="true" v-model="infoList.mainContent"/>
|
<!-- <editor style="width: 80%" :readOnly="true" v-model="infoList.mainContent"/>-->
|
||||||
|
<span style="width: 80%;border: 1px solid black;padding: 4px;display: inline-block;" v-html="infoList.mainContent" ></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@ -19,6 +20,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
|
||||||
defineOptions({name:'ViewList'})
|
defineOptions({name:'ViewList'})
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
list: object,
|
list: object,
|
||||||
@ -27,15 +29,16 @@ const infoList = reactive({
|
|||||||
title: '',
|
title: '',
|
||||||
publishDate: '',
|
publishDate: '',
|
||||||
summary: '',
|
summary: '',
|
||||||
mainContent: ''
|
mainContent: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
const infoListFc = () => {
|
const infoListFc = () => {
|
||||||
|
// console.log("props.list123",props.list.knowTitle)
|
||||||
Object.assign(infoList, props.list);
|
Object.assign(infoList, props.list);
|
||||||
infoList.title = props.list.title
|
infoList.title = props.list.knowTitle
|
||||||
infoList.publishDate = props.list.publishDate
|
infoList.publishDate = props.list.deptId
|
||||||
infoList.summary = props.list.summary
|
infoList.summary = props.list.userName
|
||||||
infoList.mainContent = props.list.mainContent
|
infoList.mainContent = props.list.content
|
||||||
// console.log("infoList",infoList)
|
// console.log("infoList",infoList)
|
||||||
// console.log("props.list",props.list)
|
// console.log("props.list",props.list)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user