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

This commit is contained in:
a0049873 2022-10-21 17:32:59 +08:00
commit a296f5a0d6
4 changed files with 91 additions and 73 deletions

View File

@ -161,14 +161,14 @@ instance.interceptors.response.use(
console.log('接口error', error) console.log('接口error', error)
if (loadingInstance) loadingInstance.close() if (loadingInstance) loadingInstance.close()
const { response, message } = error const { response, myMessage } = error
if (error.response) { if (error.response) {
console.log('接口返回', response) console.log('接口返回', response)
console.log('接口返回headers', response.headers) console.log('接口返回headers', response.headers)
console.log('接口返回REDIRECT', response.headers.redirect) console.log('接口返回REDIRECT', response.headers.redirect)
const { status, data } = response const { status, data } = response
handleCode(status, data.msg || message, response.headers.redirect) handleCode(status, data.msg || myMessage, response.headers.redirect)
if (response.headers.token) { if (response.headers.token) {
setAccessToken(response.headers.token) setAccessToken(response.headers.token)
} }
@ -179,18 +179,18 @@ instance.interceptors.response.use(
return Promise.reject(error) return Promise.reject(error)
} else { } else {
let { message } = error // let { message } = error
if (message === 'Network Error') { if (error.message === 'Network Error') {
message = '后端接口连接异常' error.message = '后端接口连接异常'
} }
if (message.includes('timeout')) { if (error.message.includes('timeout')) {
message = '后端接口请求超时' error.message = '后端接口请求超时'
} }
if (message.includes('Request failed with status code')) { if (error.message.includes('Request failed with status code')) {
const code = message.substr(message.length - 3) const code = error.message.substr(error.message.length - 3)
message = '后端接口' + code + '异常' error.message = '后端接口' + code + '异常'
} }
message.error(message || `后端接口未知异常`) message.error(error.message || `后端接口未知异常`)
return Promise.reject(error) return Promise.reject(error)
} }
} }

View File

@ -126,7 +126,13 @@
title="已申请摄像头列表" title="已申请摄像头列表"
@ok="videoVisible = false" @ok="videoVisible = false"
> >
<a-select placeholder="请选择归属部门" v-model:value="deptName" :getPopupContainer="(triggerNode) => triggerNode.parentNode" show-search option-filter-prop="children" :filterOption="filterOption" @change="deptIdChangeFunction"> <a-select placeholder="请选择归属部门"
style="width: 200px"
v-model:value="deptName"
:getPopupContainer="(triggerNode) => triggerNode.parentNode"
show-search
:filterOption="true"
@change="deptIdChangeFunction">
<a-select-option v-for="(item, index) in deptNameAll" :key="`${index}-${item}`" :value="item.name"> <a-select-option v-for="(item, index) in deptNameAll" :key="`${index}-${item}`" :value="item.name">
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
@ -204,6 +210,7 @@
const showItem = (id, type, delFlag, note1) => { const showItem = (id, type, delFlag, note1) => {
if (type == '基础设施') { if (type == '基础设施') {
let arr = JSON.parse(note1); let arr = JSON.parse(note1);
//console.log('arrarr====',arr);
xVideoList.value = [] xVideoList.value = []
arr.map((val) => { arr.map((val) => {
xVideoList.value.push({ xVideoList.value.push({
@ -244,10 +251,6 @@
}) })
} }
getDeptAllData(); getDeptAllData();
//select
const filterOption = (input, option) => {
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

View File

@ -262,7 +262,7 @@
</div> </div>
</div> </div>
<div class="top-content-father"> <div class="top-content-father">
<infrastructurePage ref="camera" :searchValue="searchValue" :searchType="searchType" /> <infrastructurePage ref="camera" :searchValue="searchValue" :searchType="searchType" />
</div> </div>
</div> </div>
<div class="top" v-else> <div class="top" v-else>
@ -320,6 +320,7 @@
</div> </div>
</div> </div>
<div class="top-content-father" :key="listKey"> <div class="top-content-father" :key="listKey">
<!-- todo -->
<template v-if=" <template v-if="
Cardsname == '组件服务' || Cardsname == '组件服务' ||
Cardsname == '应用资源' || Cardsname == '应用资源' ||
@ -409,7 +410,7 @@
<div class="resultListSearchInput-father" style="background: unset"> <div class="resultListSearchInput-father" style="background: unset">
<div class="resultListSearchInput-son"> <div class="resultListSearchInput-son">
模糊搜索 模糊搜索
<a-input-search v-model:value="searchValue" placeholder="请输入关键词" enter-button="搜索" size="large" <a-input-search v-model:value="searchValue" placeholder="请输入关键词" enter-button="搜索" size="large"
@search="getAppResources" @change="onSearch" class="resultListSearchInput" /> @search="getAppResources" @change="onSearch" class="resultListSearchInput" />
<button class="button-reset" @click="chongzhi()">重置</button> <button class="button-reset" @click="chongzhi()">重置</button>
</div> </div>
@ -493,12 +494,13 @@ export default defineComponent({
const pageSizeOptions = ref(['5', '10', '20', '50']) const pageSizeOptions = ref(['5', '10', '20', '50'])
const router = useRouter() const router = useRouter()
let select = router.currentRoute.value.query.select || DETAIL_PAGE_CONTENT_DEFAULT_TAB let select = router.currentRoute.value.query.select || DETAIL_PAGE_CONTENT_DEFAULT_TAB
const select2 = router.currentRoute.value.query.select console.log('select------------>', select);
const type2 = router.currentRoute.value.query.type // selectSubType...
const queryName=ref('') const selectSubType = router.currentRoute.value.query.type || ''
const queryName = ref('')
const str = router.currentRoute.value.query.str const str = router.currentRoute.value.query.str
const searchValue = ref(str) const searchValue = ref(str)
const searchType= ref(str) const searchType = ref(str)
let tecHnosphere = router.currentRoute.value.query.tecHnosphere let tecHnosphere = router.currentRoute.value.query.tecHnosphere
let appLiCation = router.currentRoute.value.query.appLiCation let appLiCation = router.currentRoute.value.query.appLiCation
const Cardsname = ref(select) const Cardsname = ref(select)
@ -588,7 +590,7 @@ export default defineComponent({
const tagFlag = ref('') const tagFlag = ref('')
const current = ref(5) const current = ref(5)
const chagneTag = (name) => { const chagneTag = (name) => {
console.log('name------------>', name) console.log('name----chagneTag-------->', name)
paramsGetResources.pageNum = 1 paramsGetResources.pageNum = 1
currentPage.value = 1 currentPage.value = 1
if (tagFlag.value == name) { if (tagFlag.value == name) {
@ -685,7 +687,7 @@ export default defineComponent({
} }
ListContent.records.forEach((val) => { ListContent.records.forEach((val) => {
if (!val) { if (!val) {
return return
} }
@ -693,7 +695,7 @@ export default defineComponent({
paramsGetResources.infoList = paramsGetResources.infoList.filter( paramsGetResources.infoList = paramsGetResources.infoList.filter(
(item) => item.attrType !== name (item) => item.attrType !== name
) )
if ( if (
val.selectedTags && val.selectedTags &&
val.selectedTags.indexOf(tag.dict_label) == -1 val.selectedTags.indexOf(tag.dict_label) == -1
@ -803,34 +805,35 @@ export default defineComponent({
ListContentCopy.value = JSON.parse(JSON.stringify(dataCopy)) ListContentCopy.value = JSON.parse(JSON.stringify(dataCopy))
ListContent.records = [] ListContent.records = []
ListContent.records = JSON.parse(JSON.stringify(dataCopy)) ListContent.records = JSON.parse(JSON.stringify(dataCopy))
if(select2=='组件服务'){ if (select == '组件服务') {
queryName.value='组件类型' queryName.value = '组件类型'
}else if(select2=='应用资源'){ } else if (select == '应用资源') {
queryName.value='应用领域' queryName.value = '应用领域'
}else{ } else {
queryName.value='' queryName.value = ''
} }
ListContent.records.forEach((val) => { ListContent.records.forEach((val) => {
if (!val) { if (!val) {
return return
} }
if (val.name === queryName.value ) { // todo
if ( if (val.name === queryName.value) {
val.selectedTags && if (
val.selectedTags.indexOf(type2) == -1 val.selectedTags &&
) { val.selectedTags.indexOf(selectSubType) == -1
val.selectedTags = [type2] ) {
} else { val.selectedTags = [selectSubType]
val.selectedTags && // changeShrink(queryName.value)
val.selectedTags.splice( } else {
val.selectedTags.indexOf(type2), val.selectedTags &&
1 val.selectedTags.splice(
) val.selectedTags.indexOf(selectSubType),
} 1
)
} }
}) }
})
// - // -
if (whoShow1.value.itShowXiHaiAn) { if (whoShow1.value.itShowXiHaiAn) {
if (!storageSearchInfo) { if (!storageSearchInfo) {
@ -891,7 +894,7 @@ export default defineComponent({
// //
const re = /^[0-9\u4E00-\u9FA5]*$/ const re = /^[0-9\u4E00-\u9FA5]*$/
const getAppResources2 = () => { const getAppResources2 = () => {
globalFlag.value = false globalFlag.value = false
if ( if (
whoShow1.value.itShowQingDao && whoShow1.value.itShowQingDao &&
@ -1258,6 +1261,29 @@ export default defineComponent({
) )
} }
// --
const judgeHasSubSelectType = () => {
if (selectSubType) {
paramsGetResources.infoList = []
if (select == '组件服务') {
queryName.value = '组件类型'
} else if (select == '应用资源') {
queryName.value = '应用领域'
} else if (select == '基础设施') {
searchType.value = selectSubType
} else {
queryName.value = selectSubType
searchType.value = ''
}
let info = { attrType: queryName.value, attrValue: selectSubType }
paramsGetResources.infoList.push(info)
}
// changeShrink(queryName.value)
paramsGetResources.type = select
console.log('paramsGetResources---onMounted--------->', paramsGetResources);
}
onMounted(() => { onMounted(() => {
// //
handleSetSearchData() handleSetSearchData()
@ -1266,27 +1292,12 @@ export default defineComponent({
// //
getNewList() getNewList()
if (!tecHnosphere && !appLiCation) { if (!tecHnosphere && !appLiCation) {
if (searchValue.value && !select2) { if (searchValue.value && !select) {
globalSearch() globalSearch()
} else { } else {
paramsGetResources.infoList=[] judgeHasSubSelectType()
if(select2=='组件服务'){
queryName.value='组件类型'
}else if(select2=='应用资源'){
queryName.value='应用领域'
}else if(select2=='基础设施'){
searchType.value=type2
}else{
queryName.value=type2
searchType.value=''
}
let info={attrType:queryName.value, attrValue: type2}
paramsGetResources.infoList.push(info)
paramsGetResources.type=select2
getAppResources2() getAppResources2()
listKey.value++
listKey.value++
} }
} }
}) })
@ -1316,6 +1327,7 @@ export default defineComponent({
}) })
const changeShrink = (name) => { const changeShrink = (name) => {
console.log('name---changeShrink--------->', name);
ListContent.records.forEach((val) => { ListContent.records.forEach((val) => {
if (val.name === name) { if (val.name === name) {
console.log(val) console.log(val)
@ -1325,8 +1337,8 @@ export default defineComponent({
} }
const changeCards = (name) => { const changeCards = (name) => {
// 西- // 西-
if(whoShow1.value.itShowXiHaiAn) { if (whoShow1.value.itShowXiHaiAn) {
if(name !== '基础设施' && !xhaHasPermissionUser.list.includes(user.value.username)) { if (name !== '基础设施' && !xhaHasPermissionUser.list.includes(user.value.username)) {
return message.warn('暂无权限') return message.warn('暂无权限')
} }
} }

View File

@ -88,6 +88,9 @@
v-else v-else
placeholder="请选择归属部门" placeholder="请选择归属部门"
v-model:value="formName.unit" v-model:value="formName.unit"
:getPopupContainer="(triggerNode) => triggerNode.parentNode"
show-search
:filterOption="true"
@change="deptIdChangeFunction" @change="deptIdChangeFunction"
> >
<a-select-option <a-select-option