Compare commits

...

2 Commits

4 changed files with 52 additions and 96 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')
} }
} }
} }

View File

@ -25,12 +25,12 @@
</a-carousel> </a-carousel>
<div class="operation-content" style="position:ab"> <div class="operation-content" style="position:ab">
<div class="video-content"> <div class="video-content">
<h5-player :video-url="videoUrl"></h5-player> <h5-player :video-url="videoUrl"></h5-player>
</div> </div>
<div class="text-label"> <div class="text-label">
<span>{{defaultIndex+1}}</span>/<span>{{cameraDataList.length}}</span> <span>{{defaultIndex+1}}</span>/<span>{{cameraDataList.length}}</span>
</div> </div>
<div class="footer-button"> <div class="footer-button">
<a-button type="primary" @click="applyNow(cameraDataList[defaultIndex])">立即申请</a-button> <a-button type="primary" @click="applyNow(cameraDataList[defaultIndex])">立即申请</a-button>
<a-button type="primary" style="margin-left:20px" @click="addIntoCart(cameraDataList[defaultIndex])">加入申购车</a-button> <a-button type="primary" style="margin-left:20px" @click="addIntoCart(cameraDataList[defaultIndex])">加入申购车</a-button>
</div> </div>
@ -46,15 +46,11 @@
LeftCircleOutlined, LeftCircleOutlined,
RightCircleOutlined, RightCircleOutlined,
} from '@ant-design/icons-vue' } from '@ant-design/icons-vue'
// import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import H5Player from '@/views/home/components/H5Player.vue' import H5Player from '@/views/home/components/H5Player.vue'
import mybus from '@/myplugins/mybus' import mybus from '@/myplugins/mybus'
import { message } from 'ant-design-vue'
import { getStreamByChannelCode } from '@/api/videoSurveillance' import { getStreamByChannelCode } from '@/api/videoSurveillance'
import {getCameraLiveStream} from '@/api/file' import {getCameraLiveStream} from '@/api/file'
import {willApplyCameraSelect,
getApplyCameraListXha,
} from '@/api/home'
export default { export default {
name: '', name: '',
components: { components: {
@ -82,10 +78,10 @@
data() { data() {
return { return {
openVideo: false, openVideo: false,
videoStream: '', videoStream: '',
videoUrl:'', //url videoUrl:'', //url
defaultIndex:0,// defaultIndex:0,//
// router:useRouter() router:useRouter()
} }
}, },
methods: { methods: {
@ -98,59 +94,13 @@
}, },
// //
applyNow(item){ applyNow(item){
getApplyCameraListXha().then(res => { console.log('applyNowapplyNow',item);
let flag = true //
if (res.data.code == 0) { this.router.push({
res.data.data.map((val) => { path: '/apply',
val.cameraInfo = JSON.parse(val.cameraInfo) query: {
console.log('applyNowapplyNow',val.cameraInfo);
if(flag && val.cameraInfo.channelId == item.channelId){ },
flag = false
}
})
if(flag){
willApplyCameraSelect().then(res => {
if (res.data.code == 0) {
res.data.data.map(val => {
if(item.channelId == val.channelId){
item.id = val.id
}
})
}
let obj = {
arr: [
{
checked: true,
delFlag: 0,
id: '1593084734789996545',
idtCameraChannel: '790582098133127168',
loading: false,
note1: '',
resourceId: '1522550195055828996',
resourceName: '摄像头列表',
type: '基础设施',
},
],
deptName: '西海岸新区工业和信息化局',
deptId: '732560225344761856',
}
item.type = '基础设施'
item.delFlag = 0
item.resourceId = item.channelId
item.resourceName = item.channelName
obj.arr[0].note1 = JSON.stringify([item])
if (obj.arr.length > 0) {
localStorage.setItem('applyList', JSON.stringify([obj]))
console.log('applyNowapplyNowobj',obj);
this.$router.push({
path: '/apply',
})
}
})
}else{
message.warning('该摄像头已申请!')
}
}
}) })
}, },
// //
@ -186,7 +136,7 @@
console.log('uyutyuyopopopop',this.cameraDataList[this.defaultIndex]); console.log('uyutyuyopopopop',this.cameraDataList[this.defaultIndex]);
this.getVideoUrl(this.cameraDataList[this.defaultIndex]); this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
} }
}, },
// //
handleNext(){ handleNext(){
@ -196,10 +146,10 @@
this.getVideoUrl(this.cameraDataList[0]); this.getVideoUrl(this.cameraDataList[0]);
}else{ }else{
this.defaultIndex = this.defaultIndex + 1; this.defaultIndex = this.defaultIndex + 1;
console.log('opopopop',this.cameraDataList[this.defaultIndex]); console.log('opopopop',this.cameraDataList[this.defaultIndex]);
this.getVideoUrl(this.cameraDataList[this.defaultIndex]); this.getVideoUrl(this.cameraDataList[this.defaultIndex]);
} }
} }
}, },
} }
@ -279,14 +229,14 @@
} }
.video-content{ .video-content{
width: 750px; width: 750px;
height:600px; height:600px;
text-align: left; text-align: left;
padding: 5px; padding: 5px;
} }
.footer-button{ .footer-button{
width: 750px; width: 750px;
//height:50px; //height:50px;
text-align: center; text-align: center;
padding-top:5px; padding-top:5px;
} }
} }
@ -339,7 +289,7 @@
.ant-carousel :deep(.slick-dots) { .ant-carousel :deep(.slick-dots) {
display: none !important; display: none !important;
} }
} }
// .current-video { // .current-video {
// width: 320px; // width: 320px;

View File

@ -523,7 +523,7 @@ import { ElMessage } from 'element-plus'
if(queryString){ if(queryString){
getCameraByCondition({ getCameraByCondition({
pageNum: 1, pageNum: 1,
pageSize: 30000, pageSize: 10,
regionId: "70be8c5b664f4bcf869d82f2e8335051", regionId: "70be8c5b664f4bcf869d82f2e8335051",
type: "0", type: "0",
name:queryString, name:queryString,