Merge branch 'hi-ucs-dev' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
gaoyuanwei 2022-08-15 18:08:33 +08:00
commit de04c8ce33
5 changed files with 330 additions and 102 deletions

View File

@ -129,13 +129,13 @@
width="150" width="150"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button <el-button
v-if="$hasPermission('ability:bsabilityai:update')" v-if="scope.row.infoList.filter(val=>val.attrType=='组件类型')[0].attrValue == '智能算法'"
type="text" type="text"
size="small" size="small"
@click="UpdateHandle(scope.row)" @click="toppingCapacity(scope.row)"
>{{ $t("update") }}</el-button >置顶</el-button
> --> >
<el-button <el-button
v-if="$hasPermission('ability:bsabilityai:update')" v-if="$hasPermission('ability:bsabilityai:update')"
type="text" type="text"
@ -314,6 +314,23 @@ export default {
// this.fullScreen() // this.fullScreen()
}, },
methods: { methods: {
//
toppingCapacity (item) {
this.$http.put('/resource/pin_top/' + item.id).then(res => {
console.log('置顶', res.data.code)
if (res.data.code == 0) {
this.$message({
message: '置顶成功',
type: 'success'
})
} else {
this.$message({
message: '置顶失败',
type: 'warning'
})
}
})
},
reset () { reset () {
this.$http this.$http
.get( .get(

View File

@ -2,7 +2,7 @@
* @Author: hisense.wuhongjian * @Author: hisense.wuhongjian
* @Date: 2022-04-01 19:19:40 * @Date: 2022-04-01 19:19:40
* @LastEditors: hisense.liangjunhua * @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-08-09 10:37:31 * @LastEditTime: 2022-08-13 14:54:04
* @Description: 告诉大家这是什么 * @Description: 告诉大家这是什么
*/ */
import request from '@/utils/request' import request from '@/utils/request'
@ -353,6 +353,14 @@ export function getIntegrationServicesList(params) {
params, params,
}) })
} }
//
export function getCountByFuzzyQuery(params) {
return request({
url: '/resource/getCountByFuzzyQuery?keyWorld=' + params,
method: 'get',
params,
})
}
// -- // --
export function getIntegrationDetail(id) { export function getIntegrationDetail(id) {

View File

@ -9,6 +9,37 @@
<detailsPageInfrastructureTree v-show="flag != '6'" /> <detailsPageInfrastructureTree v-show="flag != '6'" />
</div> </div>
<div class="top" v-if="Cardsname != '知识库' && Cardsname != '基础设施'"> <div class="top" v-if="Cardsname != '知识库' && Cardsname != '基础设施'">
<div class="resultListSearchInput-father">
<div class="resultListSearchInput-son">
模糊搜索
<a-input-search
v-model:value="searchValue"
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@search="getAppResources2"
@change="onSearch"
class="resultListSearchInput"
/>
<button class="button-reset" @click="chongzhi()">重置</button>
<button
class="button-reset"
style="margin-left: 0.1rem"
@click="globalSearch()"
>
全局搜索
</button>
<button
v-if="Cardsname == '应用资源'"
class="button-reset"
@click="applyAll()"
style="margin-left: 0.1rem"
>
全部申请
</button>
<div class="hengxian" style="background: transparent"></div>
</div>
</div>
<div class="top-title"> <div class="top-title">
<div <div
v-for="item in titleName" v-for="item in titleName"
@ -23,31 +54,18 @@
backgroundSize: 'cover', backgroundSize: 'cover',
}" }"
></span> ></span>
<span>{{ item.name }}</span> <span v-if="globalData.data.length > 0">
</div> {{
</div> item.name +
<div class="resultListSearchInput-father"> '(' +
<div class="resultListSearchInput-son"> (globalData.data.filter((val) => val.type === item.name)[0]
模糊搜索 .count || '0') +
<a-input-search ')'
v-model:value="searchValue" }}
placeholder="请输入关键词" </span>
enter-button="搜索" <span v-else>
size="large" {{ item.name }}
@search="getAppResources" </span>
@change="onSearch"
class="resultListSearchInput"
/>
<button class="button-reset" @click="chongzhi()">重置</button>
<button
v-if="Cardsname == '应用资源'"
class="button-reset"
@click="applyAll()"
style="margin-left: 0.1rem"
>
全部申请
</button>
<div class="hengxian"></div>
</div> </div>
</div> </div>
<div class="top-content-father" :key="listKey"> <div class="top-content-father" :key="listKey">
@ -160,46 +178,7 @@
</div> </div>
</div> </div>
<div class="top" v-else-if="Cardsname === '基础设施'"> <div class="top" v-else-if="Cardsname === '基础设施'">
<div class="top-title"> <div class="resultListSearchInput-father">
<div
v-for="item in titleName"
:key="item.name"
:class="item.name === Cardsname ? 'sel' : ''"
@click="changeCards(item.name)"
>
<span
class="photo"
:style="{
backgroundImage: `url(${item.photo}) `,
backgroundSize: 'cover',
}"
></span>
<span>{{ item.name }}</span>
</div>
</div>
<div class="top-content-father">
<infrastructurePage @add="handleAdd" />
</div>
</div>
<div class="top" v-else>
<div class="top-title">
<div
v-for="item in titleName"
:key="item.name"
:class="item.name === Cardsname ? 'sel' : ''"
@click="changeCards(item.name)"
>
<span
class="photo"
:style="{
backgroundImage: `url(${item.photo}) `,
backgroundSize: 'cover',
}"
></span>
<span>{{ item.name }}</span>
</div>
</div>
<div class="resultListSearchInput-father" style="background: unset">
<div class="resultListSearchInput-son"> <div class="resultListSearchInput-son">
模糊搜索 模糊搜索
<a-input-search <a-input-search
@ -207,11 +186,107 @@
placeholder="请输入关键词" placeholder="请输入关键词"
enter-button="搜索" enter-button="搜索"
size="large" size="large"
@search="getAppResources" @search="getAppResources2"
@change="onSearch" @change="onSearch"
class="resultListSearchInput" class="resultListSearchInput"
/> />
<button class="button-reset" @click="chongzhi()">重置</button> <button class="button-reset" @click="chongzhi()">重置</button>
<button
class="button-reset"
style="margin-left: 0.1rem"
@click="globalSearch()"
>
全局搜索
</button>
<div class="hengxian" style="background: transparent"></div>
</div>
</div>
<div class="top-title">
<div
v-for="item in titleName"
:key="item.name"
:class="item.name === Cardsname ? 'sel' : ''"
@click="changeCards(item.name)"
>
<span
class="photo"
:style="{
backgroundImage: `url(${item.photo}) `,
backgroundSize: 'cover',
}"
></span>
<span v-if="globalData.data.length > 0">
{{
item.name +
'(' +
(globalData.data.filter((val) => val.type === item.name)[0]
.count || '0') +
')'
}}
</span>
<span v-else>
{{ item.name }}
</span>
</div>
</div>
<div class="top-content-father">
<infrastructurePage
ref="camera"
@add="handleAdd"
:searchValue="searchValue"
/>
</div>
</div>
<div class="top" v-else>
<div class="resultListSearchInput-father">
<div class="resultListSearchInput-son">
模糊搜索
<a-input-search
v-model:value="searchValue"
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@search="getAppResources2"
@change="onSearch"
class="resultListSearchInput"
/>
<button class="button-reset" @click="chongzhi()">重置</button>
<button
class="button-reset"
style="margin-left: 0.1rem"
@click="globalSearch()"
>
全局搜索
</button>
<div class="hengxian" style="background: transparent"></div>
</div>
</div>
<div class="top-title">
<div
v-for="item in titleName"
:key="item.name"
:class="item.name === Cardsname ? 'sel' : ''"
@click="changeCards(item.name)"
>
<span
class="photo"
:style="{
backgroundImage: `url(${item.photo}) `,
backgroundSize: 'cover',
}"
></span>
<span v-if="globalData.data.length > 0">
{{
item.name +
'(' +
(globalData.data.filter((val) => val.type === item.name)[0]
.count || '0') +
')'
}}
</span>
<span v-else>
{{ item.name }}
</span>
</div> </div>
</div> </div>
<KnowledgeBase <KnowledgeBase
@ -421,7 +496,7 @@
</div> </div>
</div> </div>
<div class="top-content-father"> <div class="top-content-father">
<infrastructurePage /> <infrastructurePage ref="camera" :searchValue="searchValue" />
</div> </div>
</div> </div>
<div class="top" v-else> <div class="top" v-else>
@ -721,6 +796,7 @@
pageWithAttrs, pageWithAttrs,
getDataResource, getDataResource,
getIntegrationServicesList, getIntegrationServicesList,
getCountByFuzzyQuery,
} from '@/api/home.js' } from '@/api/home.js'
import { getSgcList } from '@/api/personalCenter' import { getSgcList } from '@/api/personalCenter'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -767,7 +843,8 @@
const currentPageSize = ref(5) const currentPageSize = ref(5)
const pageSizeOptions = ref(['5', '10', '20', '50']) const pageSizeOptions = ref(['5', '10', '20', '50'])
const router = useRouter() const router = useRouter()
const select = router.currentRoute.value.query.select let select = router.currentRoute.value.query.select || '组件服务'
const select2 = router.currentRoute.value.query.select
const str = router.currentRoute.value.query.str const str = router.currentRoute.value.query.str
const searchValue = ref(str) const searchValue = ref(str)
let tecHnosphere = router.currentRoute.value.query.tecHnosphere let tecHnosphere = router.currentRoute.value.query.tecHnosphere
@ -791,7 +868,7 @@
type: Cardsname.value, type: Cardsname.value,
name: '', name: '',
infoList: [], infoList: [],
orderField: 'visits', // total visits 访 applyCount score collectCount orderField: '', // total visits 访 applyCount score collectCount
orderType: 'DESC', // ASC DESC orderType: 'DESC', // ASC DESC
} }
//西 //西
@ -866,10 +943,14 @@
} }
// //
const chongzhi = () => { const chongzhi = (flag) => {
loading.value = true loading.value = true
// //
searchValue.value = '' if (!flag) {
searchValue.value = ''
globalFlag.value = false
globalData.data = []
}
paramsGetResources.name = searchValue.value paramsGetResources.name = searchValue.value
// //
ListContent.records.forEach((val) => { ListContent.records.forEach((val) => {
@ -892,7 +973,7 @@
paramsGetResources.name = '' paramsGetResources.name = ''
paramsGetResources.shareCondition = '' paramsGetResources.shareCondition = ''
paramsGetResources.infoList = [] paramsGetResources.infoList = []
paramsGetResources.orderField = 'total' paramsGetResources.orderField = ''
paramsGetResources.orderType = 'DESC' paramsGetResources.orderType = 'DESC'
mybus.emit('chongzhi') mybus.emit('chongzhi')
getAppResources() getAppResources()
@ -1009,9 +1090,98 @@
const resourceList = reactive({ data: [] }) const resourceList = reactive({ data: [] })
const videoList = reactive({ data: [] }) const videoList = reactive({ data: [] })
const resourceTotal = ref('') 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 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) => { const getAppResources = (switchIndex) => {
if (!globalFlag.value) {
globalData.data = []
}
select = router.currentRoute.value.query.select
console.log(
'url中的select',
router.currentRoute.value.query.select,
select == '应用资源' &&
(paramsGetResources.orderField == '' ||
paramsGetResources.orderField == 'deptSort' ||
paramsGetResources.orderField == 'pin_top'),
paramsGetResources.infoList.filter(
(val) => val.attrType == '组件类型'
)[0] &&
paramsGetResources.infoList.filter(
(val) => val.attrType == '组件类型'
)[0].attrValue == '图层服务' &&
(paramsGetResources.orderField == '' ||
paramsGetResources.orderField == 'deptSort' ||
paramsGetResources.orderField == 'pin_top')
)
if (
(select == '应用资源' &&
(paramsGetResources.orderField == '' ||
paramsGetResources.orderField == 'deptSort' ||
paramsGetResources.orderField == 'pin_top')) ||
(paramsGetResources.infoList.filter(
(val) => val.attrType == '组件类型'
)[0] &&
paramsGetResources.infoList.filter(
(val) => val.attrType == '组件类型'
)[0].attrValue == '图层服务' &&
(paramsGetResources.orderField == '' ||
paramsGetResources.orderField == 'deptSort' ||
paramsGetResources.orderField == 'pin_top'))
) {
paramsGetResources.orderField = 'deptSort'
} else if (
paramsGetResources.infoList.filter(
(val) => val.attrType == '组件类型'
)[0] &&
paramsGetResources.infoList.filter(
(val) => val.attrType == '组件类型'
)[0].attrValue == '智能算法' &&
(paramsGetResources.orderField == '' ||
paramsGetResources.orderField == 'deptSort' ||
paramsGetResources.orderField == 'pin_top')
) {
paramsGetResources.orderField = 'pin_top'
} else if (
paramsGetResources.orderField == '' ||
paramsGetResources.orderField == 'deptSort' ||
paramsGetResources.orderField == 'pin_top'
) {
paramsGetResources.orderField = ''
}
if (searchValue.value) { if (searchValue.value) {
let str = '' let str = ''
let r = null let r = null
@ -1308,7 +1478,11 @@
getNewList() getNewList()
if (!tecHnosphere && !appLiCation) { if (!tecHnosphere && !appLiCation) {
getAppResources() if (searchValue.value && !select2) {
globalSearch()
} else {
getAppResources2()
}
} }
}) })
// //
@ -1369,7 +1543,7 @@
) )
// router.currentRoute.value.query.select // router.currentRoute.value.query.select
tagFlag.value = false tagFlag.value = false
chongzhi() chongzhi(true)
getNewList() getNewList()
}) })
} }
@ -1428,6 +1602,7 @@
Cardsname, Cardsname,
getNewList, getNewList,
getAppResources, getAppResources,
getAppResources2,
chongzhi, chongzhi,
onSearch, onSearch,
onShowSizeChange, onShowSizeChange,
@ -1460,6 +1635,9 @@
abilitySquareFunction, abilitySquareFunction,
abilitySquareFunctionData, abilitySquareFunctionData,
showAbilitySquareNum, showAbilitySquareNum,
globalData,
globalSearch,
camera,
} }
}, },
components: { components: {
@ -1761,13 +1939,13 @@
.top-title { .top-title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-around;
align-items: center; align-items: center;
font-size: 0.2rem; font-size: 0.2rem;
font-family: 'Alibaba PuHuiTi'; font-family: 'Alibaba PuHuiTi';
color: #000000; color: #000000;
line-height: 0.34rem; line-height: 0.34rem;
margin-bottom: 0.2rem;
.photo { .photo {
display: inline-block; display: inline-block;
height: 0.44rem; height: 0.44rem;
@ -1776,7 +1954,7 @@
} }
div { div {
margin: 0 0.2rem; // margin: 0 0.2rem;
padding: 0 0.1rem; padding: 0 0.1rem;
cursor: pointer; cursor: pointer;
display: flex; display: flex;

View File

@ -408,7 +408,7 @@
<!-- 右侧 --> <!-- 右侧 -->
<div class="contentRight"> <div class="contentRight">
<!-- 搜索@search="onSearch" --> <!-- 搜索@search="onSearch" -->
<div class="searchInput"> <div class="searchInput" v-if="isXiHaiAn">
<a-input-search <a-input-search
v-model:value="mapSearchParam.cameraName" v-model:value="mapSearchParam.cameraName"
placeholder="请输入关键词" placeholder="请输入关键词"
@ -619,9 +619,11 @@
ref, ref,
reactive, reactive,
onMounted, onMounted,
defineProps,
watch, watch,
defineComponent, defineComponent,
nextTick, nextTick,
defineExpose,
} from 'vue' } from 'vue'
import { import {
getCameraByParentId, getCameraByParentId,
@ -639,6 +641,10 @@
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { Form } from 'ant-design-vue' import { Form } from 'ant-design-vue'
const props = defineProps({
//
searchValue: { type: String, default: '' },
})
const current = ref(1) const current = ref(1)
const videoTotal = ref(0) const videoTotal = ref(0)
const router = useRouter() const router = useRouter()
@ -789,6 +795,13 @@
const roomModalCreateTime = ref('') const roomModalCreateTime = ref('')
const roomModalEndTime = ref('') const roomModalEndTime = ref('')
const lookData = ref({}) const lookData = ref({})
// console.log('', props.searchValue)
if (props.searchValue) {
// console.log('')
// eslint-disable-next-line vue/no-setup-props-destructure
mapSearchParam.value.cameraName = props.searchValue
}
//=========================== //===========================
onMounted(() => { onMounted(() => {
if (jcssType.value) { if (jcssType.value) {
@ -1369,7 +1382,11 @@
// console.log('') // console.log('')
// } // }
const wrjFlag = ref(false) const wrjFlag = ref(false)
const getCamera = () => { const getCamera = (flag, str) => {
if (flag) {
mapSearchParam.value.cameraName = str
console.log('赋值===============》', str, mapSearchParam.value)
}
console.log('初始化调用') console.log('初始化调用')
console.log('不选左侧树的时候不调用接口', mapSearchParam.value) console.log('不选左侧树的时候不调用接口', mapSearchParam.value)
if (!whoShow1.value.itShowXiHaiAn) { if (!whoShow1.value.itShowXiHaiAn) {
@ -1419,6 +1436,9 @@
}) })
} }
} }
defineExpose({
getCamera,
})
// //
const addShoppingCart = () => { const addShoppingCart = () => {
if (selectedList.value.length > 0) { if (selectedList.value.length > 0) {

View File

@ -157,6 +157,7 @@
import { ref } from 'vue' import { ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useStore } from 'vuex' import { useStore } from 'vuex'
import { message } from 'ant-design-vue'
const store = useStore() const store = useStore()
const router = useRouter() const router = useRouter()
const topList = ref([ const topList = ref([
@ -228,11 +229,11 @@
appLiCation: '', appLiCation: '',
}) })
const changeCard = (name) => { const changeCard = (name) => {
// if (select.value == name) { if (select.value == name) {
// select.value = '' select.value = ''
// } else { } else {
select.value = name select.value = name
// } }
snum.value.select = select.value snum.value.select = select.value
} }
function selectCard(value) { function selectCard(value) {
@ -282,13 +283,17 @@
} }
const mohuchaxun = ref('组件服务') const mohuchaxun = ref('组件服务')
function onSearch() { function onSearch() {
snum.value.str = text.value if (text.value) {
console.log('===================>', text.value) snum.value.str = text.value
store.commit('home/selectCardsData', snum.value) console.log('===================>', text.value)
router.push({ store.commit('home/selectCardsData', snum.value)
path: '/DetailsPageconetent', router.push({
query: snum.value, path: '/DetailsPageconetent',
}) query: snum.value,
})
} else {
message.warning('请输入查询内容!')
}
// router.push({ path: '/DetailsPageconetent' }) // router.push({ path: '/DetailsPageconetent' })
} }
</script> </script>
@ -502,11 +507,11 @@
both; both;
} }
/* ---------------------------------------------- /* ----------------------------------------------
* Generated by Animista on 2022-8-15 14:3:51 * Generated by Animista on 2022-8-15 14:3:51
* Licensed under FreeBSD License. * Licensed under FreeBSD License.
* See http://animista.net/license for more info. * See http://animista.net/license for more info.
* w: http://animista.net, t: @cssanimista * w: http://animista.net, t: @cssanimista
* ---------------------------------------------- */ * ---------------------------------------------- */
/** /**
* ---------------------------------------- * ----------------------------------------