Commit a5d3b2f4 authored by zhengke's avatar zhengke

优化 内容匹配数据

parent b770fc2e
......@@ -9,9 +9,9 @@
<IconSearch class="cusor-pointer" @click.stop="searchData"></IconSearch>
</template>
</el-input>
<div v-loading="loading" style="height: calc(100%-40px);overflow: auto;">
<div v-loading="loading" style="height: calc(100%-40px);min-height:400px;overflow: auto;">
<div class="symbol-item NormalDataCenter cursor-pointer"
:class="[current==item.Feature?'active':'']"
:class="[current==item.Id?'active':'']"
v-for="(item,index) in dataList" @click="setElText(item,index)">
<div class="title fz14 text-weight-bold text-ellipsis">
<el-tooltip
......@@ -78,7 +78,7 @@
const slidesStore = useSlidesStore()
const dataList = ref([])
const dataListAll = ref([])
const loading = ref(false)
const loading = ref(true)
const { userInfo } = storeToRefs(useUserStore());
......@@ -94,7 +94,7 @@
currentImg.value = index
}
const setElText = (item:any,index:Number) => {
current.value = item.Feature
current.value = item.Id
const contentStr = handleElement.value.contentStr
if(contentStr!=item.Feature&&item.Feature) {
const content = handleElement.value.content.replace(getHtmlPlainText(handleElement.value.content),item.Feature)
......@@ -112,10 +112,10 @@
const searchData = () => {
if(!keywords.value) return
params.kw = keywords.value
loading.value = true
getDatas()
}
const getDatas = async () => {
loading.value = true
const response = await MatchingData.ScenicSearch(params)
if (response.data.resultCode == 1) {
dataListAll.value = dataList.value = checkPoiCoverImg(response.data.data)
......@@ -125,7 +125,8 @@
const checkPoiCoverImg = (array:any[])=>{
if(array.length==0) return
array.forEach((x,index)=>{
if(x.Feature==handleElement.value.contentStr) current.value = x.Feature
x.Id = index+1
if(x.Feature==handleElement.value.contentStr) current.value = index+1
if((!x.PicPath||x.PicPath=='') && x.ImgArray && x.ImgArray.length>0){
x.PicPath=x.ImgArray[0]
}else if(x.PicPath && x.PicPath!=''){
......@@ -140,6 +141,8 @@
getDatas()
watch(()=>handleElementId.value, () => {
loading.value = true
keywords.value = ''
params.kw = HtmlUtil.htmlEncodeByRegExp(handleElement.value.contentStr)
getDatas()
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment