From 5f3c8d3556ab038752d303807d84f0f04cf3d49a Mon Sep 17 00:00:00 2001
From: a0049873 <79py69t9wb@privaterelay.appleid.com>
Date: Mon, 15 Aug 2022 14:48:53 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=90=9C=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
front/src/api/home.js | 10 +-
front/src/views/home/DetailsPageconetent.vue | 272 +++++++++++++-----
front/src/views/home/infrastructurePage.vue | 24 +-
.../views/newHome/components/Navigation.vue | 25 +-
4 files changed, 244 insertions(+), 87 deletions(-)
diff --git a/front/src/api/home.js b/front/src/api/home.js
index fdf6774b..5f8e986a 100644
--- a/front/src/api/home.js
+++ b/front/src/api/home.js
@@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian
* @Date: 2022-04-01 19:19:40
* @LastEditors: hisense.liangjunhua
- * @LastEditTime: 2022-08-09 10:37:31
+ * @LastEditTime: 2022-08-13 14:54:04
* @Description: 告诉大家这是什么
*/
import request from '@/utils/request'
@@ -353,6 +353,14 @@ export function getIntegrationServicesList(params) {
params,
})
}
+// 全局搜索
+export function getCountByFuzzyQuery(params) {
+ return request({
+ url: '/resource/getCountByFuzzyQuery?keyWorld=' + params,
+ method: 'get',
+ params,
+ })
+}
// 融合服务--详情
export function getIntegrationDetail(id) {
diff --git a/front/src/views/home/DetailsPageconetent.vue b/front/src/views/home/DetailsPageconetent.vue
index 9b7ec2b5..47244ec0 100644
--- a/front/src/views/home/DetailsPageconetent.vue
+++ b/front/src/views/home/DetailsPageconetent.vue
@@ -9,6 +9,37 @@
@@ -721,6 +796,7 @@
pageWithAttrs,
getDataResource,
getIntegrationServicesList,
+ getCountByFuzzyQuery,
} from '@/api/home.js'
import { getSgcList } from '@/api/personalCenter'
import { useRouter } from 'vue-router'
@@ -866,10 +942,14 @@
}
// 重置数据
- const chongzhi = () => {
+ const chongzhi = (flag) => {
loading.value = true
// 重置模糊查字段
- searchValue.value = ''
+ if (!flag) {
+ searchValue.value = ''
+ globalFlag.value = false
+ globalData.data = []
+ }
paramsGetResources.name = searchValue.value
// 重置筛选条件
ListContent.records.forEach((val) => {
@@ -1009,9 +1089,45 @@
const resourceList = reactive({ data: [] })
const videoList = reactive({ data: [] })
const resourceTotal = ref('')
+ // 全局搜索
+ const camera = ref(null)
+ const globalData = reactive({ data: [] })
+ const globalFlag = ref(false)
+ const globalSearch = () => {
+ if (searchValue.value) {
+ globalFlag.value = true
+ getCountByFuzzyQuery(searchValue.value || '').then((res) => {
+ console.log('全局搜索==========》', res.data.data)
+ globalData.data = res.data.data
+ if (paramsGetResources.type == '基础设施') {
+ console.log('camera1', camera.value)
+ camera.value.getCamera(true, searchValue.value)
+ } else {
+ getAppResources()
+ }
+ })
+ } else {
+ message.warning('全局搜索必须输入关键词!')
+ }
+ }
// 校验
const re = /^[0-9\u4E00-\u9FA5]*$/
+ const getAppResources2 = () => {
+ globalFlag.value = false
+ if (
+ whoShow1.value.itShowQingDao &&
+ paramsGetResources.type == '基础设施'
+ ) {
+ console.log('camera2', camera)
+ camera.value.getCamera(true, searchValue.value)
+ } else {
+ getAppResources()
+ }
+ }
const getAppResources = (switchIndex) => {
+ if (!globalFlag.value) {
+ globalData.data = []
+ }
if (searchValue.value) {
let str = ''
let r = null
@@ -1308,7 +1424,11 @@
getNewList()
if (!tecHnosphere && !appLiCation) {
- getAppResources()
+ if (searchValue.value) {
+ globalSearch()
+ } else {
+ getAppResources2()
+ }
}
})
// 全部申请
@@ -1369,7 +1489,7 @@
)
// router.currentRoute.value.query.select
tagFlag.value = false
- chongzhi()
+ chongzhi(true)
getNewList()
})
}
@@ -1428,6 +1548,7 @@
Cardsname,
getNewList,
getAppResources,
+ getAppResources2,
chongzhi,
onSearch,
onShowSizeChange,
@@ -1460,6 +1581,9 @@
abilitySquareFunction,
abilitySquareFunctionData,
showAbilitySquareNum,
+ globalData,
+ globalSearch,
+ camera,
}
},
components: {
@@ -1761,13 +1885,13 @@
.top-title {
display: flex;
- justify-content: space-between;
+ justify-content: space-around;
align-items: center;
font-size: 0.2rem;
font-family: 'Alibaba PuHuiTi';
color: #000000;
line-height: 0.34rem;
-
+ margin-bottom: 0.2rem;
.photo {
display: inline-block;
height: 0.44rem;
@@ -1776,7 +1900,7 @@
}
div {
- margin: 0 0.2rem;
+ // margin: 0 0.2rem;
padding: 0 0.1rem;
cursor: pointer;
display: flex;
diff --git a/front/src/views/home/infrastructurePage.vue b/front/src/views/home/infrastructurePage.vue
index 909bbf12..a2d7392e 100644
--- a/front/src/views/home/infrastructurePage.vue
+++ b/front/src/views/home/infrastructurePage.vue
@@ -408,7 +408,7 @@