BUG修改

This commit is contained in:
a0049873 2022-11-24 19:54:20 +08:00
parent 4ba21bd41e
commit 5e9759544d
4 changed files with 359 additions and 361 deletions

View File

@ -65,75 +65,83 @@
</template>
<script>
import { isURL } from "@/utils/validate";
import { isURL } from '@/utils/validate'
export default {
data() {
return {};
data () {
return {}
},
methods: {
// tabs, iframe
tabIsIframe(url) {
return isURL(url);
tabIsIframe (url) {
return isURL(url)
},
// tabs, tab
tabSelectedHandle(tab) {
tabSelectedHandle (tab) {
tab = this.$store.state.contentTabs.filter(
(item) => item.name === tab.name
)[0];
)[0]
if (tab) {
this.$router.push({
name: /^iframe_.+/.test(tab.name) ? "iframe" : tab.name,
name: /^iframe_.+/.test(tab.name) ? 'iframe' : tab.name,
params: { ...tab.params },
query: { ...tab.query },
});
query: { ...tab.query }
})
}
},
// tabs, tab
tabRemoveHandle(tabName) {
if (tabName === "home") {
return false;
tabRemoveHandle (tabName) {
if (tabName === 'home') {
return false
}
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
);
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName =
this.$store.state.contentTabsActiveName = "home";
return false;
console.log('删除', this.$store.state.contentTabs)
if (this.$store.state.contentTabs.length !== 1) {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
)
} else {
this.$message({
message: '必须打开一个窗口!',
type: 'warning'
})
}
// if (this.$store.state.contentTabs.length <= 0) {
// this.$store.state.sidebarMenuActiveName =
// this.$store.state.contentTabsActiveName = 'home'
// return false
// }
// tab
if (tabName === this.$store.state.contentTabsActiveName) {
let tab =
const tab =
this.$store.state.contentTabs[
this.$store.state.contentTabs.length - 1
];
]
this.$router.push({
name: /^iframe_.+/.test(tab.name) ? "iframe" : tab.name,
name: /^iframe_.+/.test(tab.name) ? 'iframe' : tab.name,
params: { ...tab.params },
query: { ...tab.query },
});
query: { ...tab.query }
})
}
},
// tabs,
tabsCloseOtherHandle() {
tabsCloseOtherHandle () {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => {
return (
item.name === "home" ||
item.name === 'home' ||
item.name === this.$store.state.contentTabsActiveName
);
)
}
);
)
},
// tabs,
tabsCloseAllHandle() {
tabsCloseAllHandle () {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name === "home"
);
this.$router.push({ name: "home" });
},
},
};
(item) => item.name === 'home'
)
this.$router.push({ name: 'home' })
}
}
}
</script>
<style scoped lang="scss">
.aui-content {
@ -152,4 +160,4 @@ export default {
}
}
}
</style>
</style>

View File

@ -1,8 +1,8 @@
/*
* @Author: hisense.wuhongjian
* @Date: 2022-04-20 17:16:35
* @LastEditors: hisense.wuhongjian
* @LastEditTime: 2022-11-24 14:32:50
* @LastEditors: Light
* @LastEditTime: 2022-11-24 18:04:45
* @Description: 告诉大家这是什么
*/
import request from '@/utils/request'
@ -117,7 +117,7 @@ export function getPlaceType() {
//西
export function CameraConditionPlaceType(params) {
return axios.post(
`http://${_cameraUrl}/data_service/getCamera/CameraConditionPlaceType'`,
`http://${_cameraUrl}/data_service/getCamera/CameraConditionPlaceType`,
params,
config2
)

View File

@ -109,373 +109,306 @@
<div class="titleName">{{ item.placeTypeName }}</div>
<div class="glgkmk" v-for="(child, index) in item.children">
<a-tooltip placement="topLeft">
<template #title>{{ child.placeTypeName }}</template>
<div
class="glgknum"
:class="{ active: child.placeTypeCode == chooseId }"
@click="tabClick(child.placeTypeCode)"
>
{{ child.placeTypeName }}
</div>
</a-tooltip>
<template #title>{{ child.placeTypeName }}</template>
<div
class="glgknum"
:class="{ active: child.placeTypeCode == chooseId }"
@click="tabClick(child.placeTypeCode)"
>
{{ child.placeTypeName }}
</div>
</a-tooltip>
</div>
</div>
</div>
</div>
</template>
<script>
import { defineComponent, ref, watch } from 'vue'
import { getCameraAllOrgan } from '@/api/videoSurveillance'
import { defineComponent, ref, watch } from 'vue'
import { getCameraAllOrgan } from '@/api/videoSurveillance'
import { getCameraInfoByAreaId ,getPlaceType} from '@/api/file'
import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router'
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
import { getCameraInfoByAreaId, getPlaceType } from '@/api/file'
import mybus from '@/myplugins/mybus'
import { useRouter } from 'vue-router'
import { UpOutlined, DownOutlined } from '@ant-design/icons-vue'
import { DETAIL_PAGE_CONTENT_DEFAULT_TAB } from '@/global/GlobalConfig.js'
export default defineComponent({
setup() {
const biaoqianList = ref([])
const bumenImg = require('@/assets/newHome/bumen.png')
const biaoqianImg = require('@/assets/newHome/biaoqian.png')
const router = useRouter()
const showKey = ref(0)
const treeData = ref([])
const selectId = ref('')
let itemIndex = ref(1)
let chooseId = ref('')
//tab
const btnClick = (index) => {
itemIndex.value = index
if(index===2){
if(chooseId.value !==''){
let placeTypeCode =[]
placeTypeCode.push(chooseId.value)
mybus.emit('CameraConditionPlaceType', placeTypeCode)
}else{
mybus.emit('clearLeftSelect')
}
}else{
if(selectId.value!==''){
mybus.emit('getCameraByParentId', selectId.value)
}else{
mybus.emit('clearLeftSelect')
export default defineComponent({
setup() {
const biaoqianList = ref([])
const bumenImg = require('@/assets/newHome/bumen.png')
const biaoqianImg = require('@/assets/newHome/biaoqian.png')
const router = useRouter()
const showKey = ref(0)
const treeData = ref([])
const selectId = ref('')
let itemIndex = ref(1)
let chooseId = ref('')
//tab
const btnClick = (index) => {
itemIndex.value = index
if (index === 2) {
if (chooseId.value !== '') {
let placeTypeCode = []
placeTypeCode.push(chooseId.value)
mybus.emit('CameraConditionPlaceType', placeTypeCode)
} else {
mybus.emit('clearLeftSelect')
}
} else {
if (selectId.value !== '') {
mybus.emit('getCameraByParentId', selectId.value)
} else {
mybus.emit('clearLeftSelect')
}
}
}
}
}
//
const tabClick = (id) => {
if(chooseId.value === id){
chooseId.value = ''
mybus.emit('clearLeftSelect')
}else{
chooseId.value = id
let placeTypeCode =[]
placeTypeCode.push(id)
mybus.emit('CameraConditionPlaceType', placeTypeCode)
//
const tabClick = (id) => {
if (chooseId.value === id) {
chooseId.value = ''
// mybus.emit('clearLeftSelect')
mybus.emit('CameraConditionPlaceType', [])
} else {
chooseId.value = id
let placeTypeCode = []
placeTypeCode.push(id)
mybus.emit('CameraConditionPlaceType', placeTypeCode)
}
}
}
//
const init = async () => {
treeData.value = []
let select =
router.currentRoute.value.query.select ||
DETAIL_PAGE_CONTENT_DEFAULT_TAB
if (select === '123') {
select = ''
}
if (select == '基础设施') {
let res = {}
//
const init = async () => {
treeData.value = []
let select =
router.currentRoute.value.query.select ||
DETAIL_PAGE_CONTENT_DEFAULT_TAB
if (select === '123') {
select = ''
}
if (select == '基础设施') {
let res = {}
res = await getCameraInfoByAreaId({
areaId: '70be8c5b664f4bcf869d82f2e8335051',
})
treeData.value = (res.data && res.data.data) || []
let tabs={}
tabs = await getPlaceType()
//=========
biaoqianList.value =(tabs.data && tabs.data.data) || []
//
if (res.data && res.data.data.length == 1) {
showBottom(treeData.value[0])
treeData.value = (res.data && res.data.data) || []
let tabs = {}
tabs = await getPlaceType()
//=========
biaoqianList.value = (tabs.data && tabs.data.data) || []
//
if (res.data && res.data.data.length == 1) {
showBottom(treeData.value[0])
}
}
}
}
mybus.on('getDeptList', () => {
init()
})
mybus.on('clearChoose', () => {
selectId.value=''
chooseId.value=''
})
const onSelect = async (item, val, child) => {
let res = {}  
mybus.on('getDeptList', () => {
init()
})
mybus.on('clearChoose', () => {
selectId.value = ''
chooseId.value = ''
})
const onSelect = async (item, val, child) => {
let res = {}
console.log('点击', item, val, child)
res = await getCameraInfoByAreaId({ areaId: val.id })
treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) {
treeData.value[index].children.map((childItem, childIndex) => {
if (childItem.id == val.id) {
treeData.value[index].children[childIndex].children =
res.data.data
}
})
treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) {
treeData.value[index].children.map((childItem, childIndex) => {
if (childItem.id == val.id) {
treeData.value[index].children[childIndex].children =
res.data.data
}
})
}
})
if (child) {
if (selectId.value === child.id) {
selectId.value = ''
} else {
selectId.value = child.id
mybus.emit('getCameraByParentId', val.id)
}
}
}
watch(selectId, (newVal) => {
if (newVal == '') {
mybus.emit('getCameraByParentId', '70be8c5b664f4bcf869d82f2e8335051')
}
})
if (child) {
if(selectId.value===child.id){
selectId.value=''
}else{
selectId.value = child.id
mybus.emit('getCameraByParentId', val.id)
}
}
}
watch(selectId, (newVal) => {
if (newVal == '') {
  mybus.emit('clearLeftSelect')
}
})
const showBottom = async (item) => {
item.show = !item.show
let res = {}
const showBottom = async (item) => {
item.show = !item.show
let res = {}
// 西
res = await getCameraInfoByAreaId({ areaId: item.id })
treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) {
treeData.value[index].children = (res.data && res.data.data) || []
console.log('treeData.value.[index]', treeData.value[index])
}
})
}
const showDown = (item, val) => {
selectId.value = val.id
//mybus.emit('getCameraByParentId', val.id)
if (item.children) {
val.show = !val.show
//
if (!val.show) {
selectId.value = ''
// mybus.emit('clearLeftSelect')
}else{
mybus.emit('getCameraByParentId', val.id)
treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) {
treeData.value[index].children = (res.data && res.data.data) || []
console.log('treeData.value.[index]', treeData.value[index])
}
})
}
const showDown = (item, val) => {
selectId.value = val.id
//mybus.emit('getCameraByParentId', val.id)
if (item.children) {
val.show = !val.show
//
if (!val.show) {
selectId.value = ''
// mybus.emit('clearLeftSelect')
} else {
mybus.emit('getCameraByParentId', val.id)
}
}
}
}
return {
btnClick,
tabClick,
treeData,
showKey,
onSelect,
showBottom,
showDown,
selectId,
itemIndex,
bumenImg,
biaoqianImg,
biaoqianList,
chooseId,
}
},
beforeUnmount() {
mybus.off('getDeptList')
mybus.off('clearChoose')
},
components: {
UpOutlined,
DownOutlined,
},
})
return {
btnClick,
tabClick,
treeData,
showKey,
onSelect,
showBottom,
showDown,
selectId,
itemIndex,
bumenImg,
biaoqianImg,
biaoqianList,
chooseId,
}
},
beforeUnmount() {
mybus.off('getDeptList')
mybus.off('clearChoose')
},
components: {
UpOutlined,
DownOutlined,
},
})
</script>
<style lang="less" scoped>
.titleName {
font-size: 18px;
.titleName {
font-size: 18px;
color: #7e7676;
margin-bottom: 10px;
padding-left: 6px;
border-left: 6px solid #1296db;
margin-left: 10px;
}
.glgkmk {
cursor: pointer;
text-align: left;
position: relative;
display: inline-block;
width: 45%;
margin-bottom: 10px;
margin-left: 10px;
.glgknum {
// width: 100px;
// color: #000000;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.active {
color: #0058e1;
font-weight: bold;
}
}
.glgkmk :hover {
color: #0058e1;
}
.nav {
display: flex;
justify-content: space-between;
margin-right: 20px;
align-items: center;
font-size: 18px;
font-family: 'Alibaba PuHuiTi';
color: #000000;
line-height: 0.32rem;
margin-bottom: 24px;
.photo {
display: inline-block;
height: 0.3rem;
width: 0.3rem;
margin-right: 0.1rem;
}
div {
padding: 0 0.1rem;
.glgkmk {
cursor: pointer;
display: flex;
align-items: center;
text-align: left;
position: relative;
display: inline-block;
width: 45%;
margin-bottom: 10px;
margin-left: 10px;
.glgknum {
// width: 100px;
// color: #000000;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
.active {
color: #0058e1;
font-weight: bold;
}
}
div:hover {
color: #1296db;
.glgkmk :hover {
color: #0058e1;
}
.active {
font-weight: 600;
color: #1296db;
border-bottom: 0.02rem solid #1296db;
}
}
.primaryNode {
.top {
width: 100%;
height: 0.4rem;
background: rgba(0, 135, 225, 0.1);
.nav {
display: flex;
justify-content: space-between;
margin-right: 20px;
align-items: center;
padding: 0 0.1rem;
margin-top: 0.08rem;
}
font-size: 18px;
font-family: 'Alibaba PuHuiTi';
color: #000000;
line-height: 0.32rem;
margin-bottom: 24px;
.top:hover {
cursor: pointer;
// 0058e1 0.5
background: rgba(0, 88, 225, 0.8);
color: white;
:deep(.anticon) {
color: white;
.photo {
display: inline-block;
height: 0.3rem;
width: 0.3rem;
margin-right: 0.1rem;
}
}
.topSelect {
background: #0058e1;
color: white;
:deep(.anticon) {
color: white;
}
}
.bottom {
width: 100%;
background: rgba(244, 245, 248, 0.8);
padding: 0 0.1rem;
// margin-bottom: .08rem;
.up {
div {
padding: 0 0.1rem;
cursor: pointer;
display: flex;
align-items: center;
}
div:hover {
color: #1296db;
}
.active {
font-weight: 600;
color: #1296db;
border-bottom: 0.02rem solid #1296db;
}
}
.primaryNode {
.top {
width: 100%;
height: 0.4rem;
background: rgba(0, 135, 225, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
border-top: 0.01rem solid #ccc;
padding: 0 0.1rem;
margin-top: 0.08rem;
}
.top:hover {
cursor: pointer;
// 0058e1 0.5
background: rgba(0, 88, 225, 0.8);
color: white;
:deep(.anticon) {
color: white;
}
}
.topSelect {
background: #0058e1;
color: white;
:deep(.anticon) {
color: white;
}
}
.bottom {
width: 100%;
background: rgba(244, 245, 248, 0.8);
padding: 0 0.1rem;
& > div {
display: flex;
justify-content: flex-start;
}
.name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
}
.up:hover {
.name {
color: #0058e1;
font-weight: 600;
}
span {
color: #0058e1;
font-weight: 600;
}
}
.select {
padding: 0 0.1rem 0 0;
.name {
width: 1.7rem;
color: #0058e1 !important;
font-weight: 600;
}
span {
color: #0058e1;
font-weight: 600;
}
}
.item:nth-of-type(1) .up {
border-top: none;
}
.down {
width: 100%;
.child {
// margin-bottom: .08rem;
.up {
cursor: pointer;
height: 0.4rem;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 0.01rem solid #ccc;
padding: 0 0.1rem;
& > div {
@ -493,7 +426,7 @@ export default defineComponent({
}
}
.child:hover {
.up:hover {
.name {
color: #0058e1;
font-weight: 600;
@ -505,10 +438,12 @@ export default defineComponent({
}
}
.select2 {
.select {
padding: 0 0.1rem 0 0;
.name {
width: 1.7rem;
color: #0058e1;
color: #0058e1 !important;
font-weight: 600;
}
@ -516,10 +451,65 @@ export default defineComponent({
color: #0058e1;
font-weight: 600;
}
}
padding: 0 0.1rem 0 0;
.item:nth-of-type(1) .up {
border-top: none;
}
.down {
width: 100%;
.child {
cursor: pointer;
height: 0.4rem;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 0.1rem;
& > div {
display: flex;
justify-content: flex-start;
}
.name {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
}
.child:hover {
.name {
color: #0058e1;
font-weight: 600;
}
span {
color: #0058e1;
font-weight: 600;
}
}
.select2 {
.name {
width: 1.7rem;
color: #0058e1;
font-weight: 600;
}
span {
color: #0058e1;
font-weight: 600;
}
padding: 0 0.1rem 0 0;
}
}
}
}
}
</style>

View File

@ -2,7 +2,7 @@
* @Author: Light
* @Date: 2022-11-18 11:53:43
* @LastEditors: Light
* @LastEditTime: 2022-11-24 15:56:51
* @LastEditTime: 2022-11-24 18:12:43
* @Description: 告诉大家这是什么
-->
<template>
@ -386,7 +386,7 @@
<style lang="less" scoped>
.infrastructureApplication {
background: #fff;
position: fixed;
position: absolute;
top: 50%;
right: 0.16rem;
margin-top: -3.9rem;