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

View File

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

View File

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

View File

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