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
}
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
);
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName =
this.$store.state.contentTabsActiveName = "home";
return false;
)
} 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 {

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

@ -118,23 +118,22 @@
{{ 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({
export default defineComponent({
setup() {
const biaoqianList = ref([])
const bumenImg = require('@/assets/newHome/bumen.png')
@ -148,38 +147,34 @@ export default defineComponent({
//tab
const btnClick = (index) => {
itemIndex.value = index
if(index===2){
if(chooseId.value !==''){
let placeTypeCode =[]
if (index === 2) {
if (chooseId.value !== '') {
let placeTypeCode = []
placeTypeCode.push(chooseId.value)
mybus.emit('CameraConditionPlaceType', placeTypeCode)
}else{
} else {
mybus.emit('clearLeftSelect')
}
}else{
if(selectId.value!==''){
} else {
if (selectId.value !== '') {
mybus.emit('getCameraByParentId', selectId.value)
}else{
} else {
mybus.emit('clearLeftSelect')
}
}
}
//
const tabClick = (id) => {
if(chooseId.value === id){
if (chooseId.value === id) {
chooseId.value = ''
mybus.emit('clearLeftSelect')
}else{
// mybus.emit('clearLeftSelect')
mybus.emit('CameraConditionPlaceType', [])
} else {
chooseId.value = id
let placeTypeCode =[]
let placeTypeCode = []
placeTypeCode.push(id)
mybus.emit('CameraConditionPlaceType', placeTypeCode)
}
}
//
const init = async () => {
@ -191,17 +186,16 @@ export default defineComponent({
select = ''
}
if (select == '基础设施') {
let res = {}
res = await getCameraInfoByAreaId({
areaId: '70be8c5b664f4bcf869d82f2e8335051',
})
treeData.value = (res.data && res.data.data) || []
let tabs={}
let tabs = {}
tabs = await getPlaceType()
//=========
biaoqianList.value =(tabs.data && tabs.data.data) || []
biaoqianList.value = (tabs.data && tabs.data.data) || []
//
if (res.data && res.data.data.length == 1) {
showBottom(treeData.value[0])
@ -212,12 +206,12 @@ export default defineComponent({
init()
})
mybus.on('clearChoose', () => {
selectId.value=''
chooseId.value=''
selectId.value = ''
chooseId.value = ''
})
const onSelect = async (item, val, child) => {
let res = {}  
let res = {}
console.log('点击', item, val, child)
res = await getCameraInfoByAreaId({ areaId: val.id })
treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) {
@ -230,21 +224,18 @@ export default defineComponent({
}
})
if (child) {
if(selectId.value===child.id){
selectId.value=''
}else{
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')
mybus.emit('getCameraByParentId', '70be8c5b664f4bcf869d82f2e8335051')
}
})
@ -261,7 +252,6 @@ export default defineComponent({
})
}
const showDown = (item, val) => {
selectId.value = val.id
//mybus.emit('getCameraByParentId', val.id)
if (item.children) {
@ -270,7 +260,7 @@ export default defineComponent({
if (!val.show) {
selectId.value = ''
// mybus.emit('clearLeftSelect')
}else{
} else {
mybus.emit('getCameraByParentId', val.id)
}
}
@ -299,18 +289,18 @@ export default defineComponent({
UpOutlined,
DownOutlined,
},
})
})
</script>
<style lang="less" scoped>
.titleName {
.titleName {
font-size: 18px;
color: #7e7676;
margin-bottom: 10px;
padding-left: 6px;
border-left: 6px solid #1296db;
margin-left: 10px;
}
.glgkmk {
}
.glgkmk {
cursor: pointer;
text-align: left;
position: relative;
@ -333,12 +323,12 @@ export default defineComponent({
color: #0058e1;
font-weight: bold;
}
}
}
.glgkmk :hover {
.glgkmk :hover {
color: #0058e1;
}
.nav {
}
.nav {
display: flex;
justify-content: space-between;
margin-right: 20px;
@ -372,9 +362,9 @@ export default defineComponent({
color: #1296db;
border-bottom: 0.02rem solid #1296db;
}
}
}
.primaryNode {
.primaryNode {
.top {
width: 100%;
height: 0.4rem;
@ -521,5 +511,5 @@ export default defineComponent({
}
}
}
}
}
</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;