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"
>
<template slot-scope="scope">
<!-- <el-button
v-if="$hasPermission('ability:bsabilityai:update')"
<el-button
v-if="scope.row.infoList.filter(val=>val.attrType=='组件类型')[0].attrValue == '智能算法'"
type="text"
size="small"
@click="UpdateHandle(scope.row)"
>{{ $t("update") }}</el-button
> -->
@click="toppingCapacity(scope.row)"
>置顶</el-button
>
<el-button
v-if="$hasPermission('ability:bsabilityai:update')"
type="text"
@ -314,6 +314,23 @@ export default {
// this.fullScreen()
},
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 () {
this.$http
.get(

View File

@ -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) {

View File

@ -9,6 +9,37 @@
<detailsPageInfrastructureTree v-show="flag != '6'" />
</div>
<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
v-for="item in titleName"
@ -23,31 +54,18 @@
backgroundSize: 'cover',
}"
></span>
<span>{{ item.name }}</span>
</div>
</div>
<div class="resultListSearchInput-father">
<div class="resultListSearchInput-son">
模糊搜索
<a-input-search
v-model:value="searchValue"
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@search="getAppResources"
@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>
<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" :key="listKey">
@ -160,46 +178,7 @@
</div>
</div>
<div class="top" v-else-if="Cardsname === '基础设施'">
<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="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-father">
<div class="resultListSearchInput-son">
模糊搜索
<a-input-search
@ -207,11 +186,107 @@
placeholder="请输入关键词"
enter-button="搜索"
size="large"
@search="getAppResources"
@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 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>
<KnowledgeBase
@ -421,7 +496,7 @@
</div>
</div>
<div class="top-content-father">
<infrastructurePage />
<infrastructurePage ref="camera" :searchValue="searchValue" />
</div>
</div>
<div class="top" v-else>
@ -721,6 +796,7 @@
pageWithAttrs,
getDataResource,
getIntegrationServicesList,
getCountByFuzzyQuery,
} from '@/api/home.js'
import { getSgcList } from '@/api/personalCenter'
import { useRouter } from 'vue-router'
@ -767,7 +843,8 @@
const currentPageSize = ref(5)
const pageSizeOptions = ref(['5', '10', '20', '50'])
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 searchValue = ref(str)
let tecHnosphere = router.currentRoute.value.query.tecHnosphere
@ -791,7 +868,7 @@
type: Cardsname.value,
name: '',
infoList: [],
orderField: 'visits', // total visits 访 applyCount score collectCount
orderField: '', // total visits 访 applyCount score collectCount
orderType: 'DESC', // ASC DESC
}
//西
@ -866,10 +943,14 @@
}
//
const chongzhi = () => {
const chongzhi = (flag) => {
loading.value = true
//
if (!flag) {
searchValue.value = ''
globalFlag.value = false
globalData.data = []
}
paramsGetResources.name = searchValue.value
//
ListContent.records.forEach((val) => {
@ -892,7 +973,7 @@
paramsGetResources.name = ''
paramsGetResources.shareCondition = ''
paramsGetResources.infoList = []
paramsGetResources.orderField = 'total'
paramsGetResources.orderField = ''
paramsGetResources.orderType = 'DESC'
mybus.emit('chongzhi')
getAppResources()
@ -1009,9 +1090,98 @@
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 = []
}
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) {
let str = ''
let r = null
@ -1308,7 +1478,11 @@
getNewList()
if (!tecHnosphere && !appLiCation) {
getAppResources()
if (searchValue.value && !select2) {
globalSearch()
} else {
getAppResources2()
}
}
})
//
@ -1369,7 +1543,7 @@
)
// router.currentRoute.value.query.select
tagFlag.value = false
chongzhi()
chongzhi(true)
getNewList()
})
}
@ -1428,6 +1602,7 @@
Cardsname,
getNewList,
getAppResources,
getAppResources2,
chongzhi,
onSearch,
onShowSizeChange,
@ -1460,6 +1635,9 @@
abilitySquareFunction,
abilitySquareFunctionData,
showAbilitySquareNum,
globalData,
globalSearch,
camera,
}
},
components: {
@ -1761,13 +1939,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 +1954,7 @@
}
div {
margin: 0 0.2rem;
// margin: 0 0.2rem;
padding: 0 0.1rem;
cursor: pointer;
display: flex;

View File

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

View File

@ -157,6 +157,7 @@
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { useStore } from 'vuex'
import { message } from 'ant-design-vue'
const store = useStore()
const router = useRouter()
const topList = ref([
@ -228,11 +229,11 @@
appLiCation: '',
})
const changeCard = (name) => {
// if (select.value == name) {
// select.value = ''
// } else {
if (select.value == name) {
select.value = ''
} else {
select.value = name
// }
}
snum.value.select = select.value
}
function selectCard(value) {
@ -282,6 +283,7 @@
}
const mohuchaxun = ref('组件服务')
function onSearch() {
if (text.value) {
snum.value.str = text.value
console.log('===================>', text.value)
store.commit('home/selectCardsData', snum.value)
@ -289,6 +291,9 @@
path: '/DetailsPageconetent',
query: snum.value,
})
} else {
message.warning('请输入查询内容!')
}
// router.push({ path: '/DetailsPageconetent' })
}
</script>