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