提交西海岸左側

This commit is contained in:
gongjiale 2022-11-22 10:00:29 +08:00
parent 089716c2a8
commit beb51f9b51
2 changed files with 31 additions and 25 deletions

View File

@ -117,7 +117,7 @@ export function getPlaceType() {
//西 //西
export function CameraConditionPlaceType(params) { export function CameraConditionPlaceType(params) {
return axios.post( return axios.post(
'http://10.134.135.92:9537/data_service/getCamera/CameraConditionPlaceType' + 'http://10.134.135.92:9537/data_service/getCamera/CameraConditionPlaceType' ,
params, params,
config2 config2
) )

View File

@ -140,7 +140,6 @@ export default defineComponent({
const bumenImg = require('@/assets/newHome/bumen.png') const bumenImg = require('@/assets/newHome/bumen.png')
const biaoqianImg = require('@/assets/newHome/biaoqian.png') const biaoqianImg = require('@/assets/newHome/biaoqian.png')
const router = useRouter() const router = useRouter()
const whoShow1 = ref(whoShow)
const showKey = ref(0) const showKey = ref(0)
const treeData = ref([]) const treeData = ref([])
const selectId = ref('') const selectId = ref('')
@ -149,6 +148,24 @@ export default defineComponent({
//tab //tab
const btnClick = (index) => { const btnClick = (index) => {
itemIndex.value = 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) => { const tabClick = (id) => {
@ -156,6 +173,7 @@ export default defineComponent({
chooseId.value = '' chooseId.value = ''
mybus.emit('clearLeftSelect') mybus.emit('clearLeftSelect')
}else{ }else{
chooseId.value = id chooseId.value = id
let placeTypeCode =[] let placeTypeCode =[]
placeTypeCode.push(id) placeTypeCode.push(id)
@ -175,14 +193,10 @@ export default defineComponent({
if (select == '基础设施') { if (select == '基础设施') {
let res = {} let res = {}
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
res = await getCameraAllOrgan({ parentId: 'S4NbecfYB1DBH8HNULGS34' })
} else {
// 西
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()
@ -202,14 +216,9 @@ export default defineComponent({
chooseId.value='' chooseId.value=''
}) })
const onSelect = async (item, val, child) => { const onSelect = async (item, val, child) => {
// if(selectId.value===val.id){
// selectId.value=''
//   mybus.emit('clearLeftSelect')
// }else{
let res = {} let res = {}
 mybus.emit('getCameraByParentId', val.id)  mybus.emit('getCameraByParentId', val.id)
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) {
@ -222,36 +231,33 @@ export default defineComponent({
} }
}) })
if (child) { if (child) {
if(selectId.value===child.id){ if(selectId.value===child.id){
selectId.value='' selectId.value=''
  mybus.emit('clearLeftSelect')
}else{ }else{
selectId.value = child.id selectId.value = child.id
} }
} }
// }
} }
watch(selectId, (newVal) => { watch(selectId, (newVal) => {
if (newVal == '') { if (newVal == '') {
mybus.emit('getCameraByParentId', '')   mybus.emit('clearLeftSelect')
mybus.emit('getListByParentId', '') // mybus.emit('getCameraByParentId', '')
// mybus.emit('getListByParentId', '')
} }
}) })
const showBottom = async (item) => { const showBottom = async (item) => {
item.show = !item.show item.show = !item.show
let res = {} let res = {}
if (whoShow1.value && !whoShow1.value.itShowXiHaiAn) {
res = await getCameraAllOrgan({ parentId: item.id })
} else {
// 西 // 西
res = await getCameraInfoByAreaId({ areaId: item.id }) res = await getCameraInfoByAreaId({ areaId: item.id })
}
treeData.value.map((treeDataItem, index) => { treeData.value.map((treeDataItem, index) => {
if (item.id == treeDataItem.id) { if (item.id == treeDataItem.id) {
treeData.value[index].children = (res.data && res.data.data) || [] treeData.value[index].children = (res.data && res.data.data) || []
@ -268,7 +274,7 @@ export default defineComponent({
// //
if (!val.show) { if (!val.show) {
selectId.value = '' selectId.value = ''
mybus.emit('clearLeftSelect') // mybus.emit('clearLeftSelect')
} }
} }
} }