Commit c862ab59 authored by xinzhedeai's avatar xinzhedeai

内页菜单公共处理

parent b70f0529
......@@ -66,17 +66,13 @@
</div>
<div class="menuInfo">
<ul>
<li @click="changeMenu('video')" :class="{active: bigScreenDetailMenu==='video'}">视频监控</li>
<li @click="changeMenu('shape')" :class="{active: bigScreenDetailMenu==='shape'}">变形监测</li>
<li @click="changeMenu('temprate')" :class="{active: bigScreenDetailMenu==='temprate'}">温度监测
</li>
<li @click="changeMenu('wind')" :class="{active: bigScreenDetailMenu==='wind'}">风速监测</li>
<li @click="changeMenu('water')" :class="{active: bigScreenDetailMenu==='water'}">降水监测</li>
<li @click="changeMenu('people')" :class="{active: bigScreenDetailMenu==='people'}">人员定位
<li v-for="(item, index) in menuObj.emergency.menuList" @click="changeMenu(item)" :class="{active: bigScreenDetailMenu===item.name}">
{{item.name}}
</li>
</ul>
</div>
</div>
<!-- 视频监控列表 -->
......@@ -142,7 +138,7 @@
<script src="../js/js.cookie.js"></script>
<!-- 详情内页公用js -->
<!-- <script src="./static/js/public-detail.js"></script> -->
<script src="./static/js/public-detail.js"></script>
<script>
let jessibucaPlayer = {};
//const host = location.protocol + '//' + window.location.host;
......@@ -182,7 +178,7 @@
const host = location.protocol + '//' + (location.hostname === '192.168.3.38' ? '192.168.3.37' : '192.168.13.200') + ':8013';
const selfHost = location.hostname === '192.168.3.38' ? 'http://192.168.3.226:8057' : location.protocol + '//' + window.location.host;
const selfHost = location.hostname === '192.168.3.38' ? 'http://192.168.3.38:8057' : location.protocol + '//' + window.location.host;
// 请求 token 用
......@@ -191,24 +187,14 @@
var map; // 地图
new Vue({
el: '#app',
mixins: [gemhoUtil.detailPageMixin],
data() {
return {
// 公共信息
selectedMine: {},
// 菜单折叠显隐
showMenu4bianpo: true,
sensorLIst: [],
currentSensorId: '',
showMenu4weikuangku: true,
showMenu4chenjiang: true,
showMenu4diya: true,
// 菜单折叠显隐 - 结束
createTime: ['2024-01-01', '2024-09-30'],
bigScreenDetailMenu: '',
selectedMine: {},
isReady: false, // 页面是否准备好 请求完接口变为true
// 表格数据
tableList: []
......@@ -283,16 +269,6 @@
console.log('sdfsdf', res)
});
},
menuChange(type) {
['showMenu4bianpo', 'showMenu4weikuangku', 'showMenu4chenjiang', 'showMenu4diya'].forEach((item) => {
if (item === type) {
this[type] = !this[type]
} else {
this[item] = false
}
})
},
getChartsData() {
const yAxisOption = {
......@@ -397,25 +373,6 @@
loading && loading.close();
this.isReady = true
},
changeMenu(menuName) {
localStorage.setItem('bigScreenDetailMenu', menuName)
this.bigScreenDetailMenu = menuName
},
getAccessToken(appKey, appSecret) {
var dataJson = 'appKey=' + appKey + '&appSecret=' + appSecret;
return request.post("/ys7com", dataJson).then(res => {
var data = res.data || {};
if (data['code'] == '200') {
return data['data']['accessToken']
} else {
return null
}
}).catch(err => {
console.log(err);
return err
})
},
},
})
</script>
......
This diff is collapsed.
......@@ -49,22 +49,11 @@
<div class="f20 color-theme ml10">返回</div>
</div>
<div class="fixed flex-text maxIndex pointer" style="right: 30px;top: 45px;" @click="gotoManagement()">
<img style="width: 24px;height: 24px;" src="../static/backstage.png" alt="">
<div class="f20 color-theme ml10">后台管理</div>
</div>
<div class="flex-text ml10 mr10 mt15">
<div style="width: 490px;height: calc(100vh - 110px);">
<!-- 通知公告 -->
<div style="background: linear-gradient(to bottom, rgba(13,27,48,.7), rgba(13,27,48,0));">
<!-- <div class="h50 flex-text pointer"
style="background: linear-gradient(to bottom, rgba(171,238,255,0), rgba(171,238,255,.2));border-bottom: 1px solid rgba(171,238,255,.5);">
<div class="flex-1" v-if="isReady">
<van-notice-bar background="none" left-icon="volume-o" color="#ffffff" :speed="80"
:text="notice.title" @click="noticeMask = true" />
</div>
</div> -->
<div class="mineInfo">
<p>矿山名称: {{selectedMine.name}}</p>
<p>矿山地址:{{selectedMine.address}}</p>
......@@ -73,13 +62,8 @@
</div>
<div class="menuInfo">
<ul>
<li @click="changeMenu('video')" :class="{active: bigScreenDetailMenu==='video'}">视频监控</li>
<li @click="changeMenu('shape')" :class="{active: bigScreenDetailMenu==='shape'}">变形监测</li>
<li @click="changeMenu('temprate')" :class="{active: bigScreenDetailMenu==='temprate'}">温度监测
</li>
<li @click="changeMenu('wind')" :class="{active: bigScreenDetailMenu==='wind'}">风速监测</li>
<li @click="changeMenu('water')" :class="{active: bigScreenDetailMenu==='water'}">降水监测</li>
<li @click="changeMenu('people')" :class="{active: bigScreenDetailMenu==='people'}">人员定位
<li v-for="(item, index) in menuObj.emergency.menuList" @click="changeMenu(item)" :class="{active: bigScreenDetailMenu===item.name}">
{{item.name}}
</li>
</ul>
</div>
......@@ -193,7 +177,7 @@
<script src="../js/js.cookie.js"></script>
<!-- 详情内页公用js -->
<!-- <script src="./static/js/public-detail.js"></script> -->
<script src="./static/js/public-detail.js"></script>
<script>
let jessibucaPlayer = {};
//const host = location.protocol + '//' + window.location.host;
......@@ -242,11 +226,9 @@
var map; // 地图
new Vue({
el: '#app',
mixins: [gemhoUtil.detailPageMixin],
data() {
return {
// 公共信息
selectedMine: {},
// 菜单折叠显隐
showMenu4bianpo: true,
sensorLIst: [],
......@@ -255,10 +237,6 @@
showMenu4chenjiang: true,
showMenu4diya: true,
// 菜单折叠显隐 - 结束
createTime: ['2024-01-01', '2024-09-30'],
bigScreenDetailMenu: '',
selectedMine: {},
isReady: false, // 页面是否准备好 请求完接口变为true
// 表格数据
tableList: []
......@@ -266,13 +244,6 @@
}
},
mounted() {
for (var i = 0; i < 10; i++) {
this.tableList.push({
videoName: 'sdfksdfxxxxx',
warnTypeName: '扣税的交流方',
warnDatetime: 'ksdlfsdf'
})
}
if (!token) {
window.open(host + '/#/login', '_self')
return
......@@ -465,25 +436,6 @@
loading && loading.close();
this.isReady = true
},
changeMenu(menuName) {
localStorage.setItem('bigScreenDetailMenu', menuName)
this.bigScreenDetailMenu = menuName
},
getAccessToken(appKey, appSecret) {
var dataJson = 'appKey=' + appKey + '&appSecret=' + appSecret;
return request.post("/ys7com", dataJson).then(res => {
var data = res.data || {};
if (data['code'] == '200') {
return data['data']['accessToken']
} else {
return null
}
}).catch(err => {
console.log(err);
return err
})
},
},
})
</script>
......
let jessibucaPlayer = {};
//const host = location.protocol + '//' + window.location.host;
window.detail_token = Cookies.get('ELADMIN-TOEKN');
console.log('axios',axios)
window.detail_axios = axios.create({
headers: { 'Authorization': window.detail_token }
});
window.detail_axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
console.log('window.detail_axios',window.detail_axios)
window.detail_axios.interceptors.response.use(
response => {
return response
}, error => {
console.error(error)
let code = 0
try {
code = error.response.data.status
} catch (e) {
if (error.toString().indexOf('Error: timeout') !== -1) {
console.error('当前网络不佳')
return
}
}
if (!code) {
console.error('当前网络不佳')
return
}
if (code === 401) {
alert('登录信息失效,请重新登录')
window.open(host + '/#/login', '_self')
return
}
if (code === 400 && message === '不允许访问') {
alert('您没有权限使用此功能,请联系管理员开通')
return
}
}
);
// let jessibucaPlayer = {};
// //const host = location.protocol + '//' + window.location.host;
// window.detail_token = Cookies.get('ELADMIN-TOEKN');
// console.log('axios',axios)
// window.detail_axios = axios.create({
// headers: { 'Authorization': window.detail_token }
// });
// window.detail_axios.defaults.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
const host = location.protocol + '//' + (location.hostname === '192.168.3.38' ? '192.168.3.37' : '192.168.13.200') + ':8013';
// console.log('window.detail_axios',window.detail_axios)
// window.detail_axios.interceptors.response.use(
// response => {
// return response
// }, error => {
// console.error(error)
// let code = 0
// try {
// code = error.response.data.status
// } catch (e) {
// if (error.toString().indexOf('Error: timeout') !== -1) {
// console.error('当前网络不佳')
// return
// }
// }
// if (!code) {
// console.error('当前网络不佳')
// return
// }
// if (code === 401) {
// alert('登录信息失效,请重新登录')
// window.open(host + '/#/login', '_self')
// return
// }
// if (code === 400 && message === '不允许访问') {
// alert('您没有权限使用此功能,请联系管理员开通')
// return
// }
// }
// );
const selfHost = location.hostname === '192.168.3.38' ? 'http://192.168.3.226:8057' : location.protocol + '//' + window.location.host;
// const host = location.protocol + '//' + (location.hostname === '192.168.3.38' ? '192.168.3.37' : '192.168.13.200') + ':8013';
// const selfHost = location.hostname === '192.168.3.38' ? 'http://192.168.3.226:8057' : location.protocol + '//' + window.location.host;
if (!window.detail_token) {
window.open(host + '/#/login', '_self')
return
}
// if (this.selectedMine.mineType != 2) {
// alert('您当前选择的不是露天矿山,请先选择露天矿山,再查看此大屏')
// window.history.go(-1)
// if (!window.detail_token) {
// window.open(host + '/#/login', '_self')
// return
// }
\ No newline at end of file
// }
// // if (this.selectedMine.mineType != 2) {
// // alert('您当前选择的不是露天矿山,请先选择露天矿山,再查看此大屏')
// // window.history.go(-1)
// // return
// // }
var gemhoUtil = {
goToPage: function(url){
window.open(url)
},
detailPageMixin: {
data: function() {
return {
// 公共信息
selectedMine: {},
menuObj: menuObj,
bigScreenDetailMenu: '',
createTime: ['2024-01-01', '2024-09-30'],
isReady: false, // 页面是否准备好 请求完接口变为true
};
},
methods: {
changeMenu(item) {
localStorage.setItem('bigScreenDetailMenu', item.name)
this.bigScreenDetailMenu = item.name
// 跳转页面
window.open(item.url)
},
}
}
}
var menuObj = {
emergency: {
menuList: [{
name: '视频监控',
url: '/datav/detail/video-monitor.html'
},{
name: '变形监控',
url: '/datav/detail/shape-monitor.html'
},{
name: '温度监控',
url: '/datav/detail/temperature-monitor.html'
},{
name: '湿度监控',
url: '/datav/detail/humidity-monitor.html'
},{
name: '风速监控',
url: '/datav/detail/wind-monitor.html'
},{
name: '降水监控',
url: '/datav/detail/water-monitor.html'
},{
name: '人员定位',
url: '/datav/detail/people-monitor.html',
subMenu: [{
name: '人员数据统计',
url: '/datav/detail/people-monitor.html'
},{
name: '人员定位图',
url: '/datav/detail/people-monitor.html'
}]
}],
},
natural: {
menuList: [{
name: '视频监控',
url: '/datav/detail/video-monitor.html'
},{
name: '矿山全景',
url: '/datav/detail/shape-monitor.html'
},{
name: '资源储备',
url: '/datav/detail/temperature-monitor.html'
},{
name: '水检测',
url: '/datav/detail/humidity-monitor.html'
},{
name: '土监测',
url: '/datav/detail/wind-monitor.html'
},{
name: '地质环境',
url: '/datav/detail/water-monitor.html'
},{
name: '绿色矿山',
url: '/datav/detail/shape-monitor.html',
},{
name: '开发利用',
url: '/datav/detail/shape-monitor.html',
},{
name: '变形监测',
url: '/datav/detail/shape-monitor.html',
}],
},
water: {
menuList: [{
name: '视频监控',
url: '/datav/detail/video-monitor.html'
},{
name: '水土流失',
url: '/datav/detail/shape-monitor.html'
},{
name: '降水监测',
url: '/datav/detail/water-monitor.html'
},{
name: '温度监测',
url: '/datav/detail/humidity-monitor.html'
},{
name: '湿度监控',
url: '/datav/detail/wind-monitor.html'
},{
name: '风速监测',
url: '/datav/detail/water-monitor.html'
}],
},
shengtai: {
menuList: [{
name: '视频监控',
url: '/datav/detail/video-monitor.html'
},{
name: '水土流失',
url: '/datav/detail/shape-monitor.html'
},{
name: '土壤监测',
url: '/datav/detail/water-monitor.html'
},{
name: '噪声监测',
url: '/datav/detail/humidity-monitor.html'
},{
name: '大气监测',
url: '/datav/detail/wind-monitor.html'
},{
name: '烟道监测',
url: '/datav/detail/water-monitor.html'
}],
},
}
......@@ -49,11 +49,6 @@
<div class="f20 color-theme ml10">返回</div>
</div>
<div class="fixed flex-text maxIndex pointer" style="right: 30px;top: 45px;" @click="gotoManagement()">
<img style="width: 24px;height: 24px;" src="../static/backstage.png" alt="">
<div class="f20 color-theme ml10">后台管理</div>
</div>
<div class="flex-text ml10 mr10 mt15">
<div style="width: 490px;height: calc(100vh - 110px);">
<div style="background: linear-gradient(to bottom, rgba(13,27,48,.7), rgba(13,27,48,0));">
......@@ -66,13 +61,8 @@
</div>
<div class="menuInfo">
<ul>
<li @click="changeMenu('video')" :class="{active: bigScreenDetailMenu==='video'}">视频监控</li>
<li @click="changeMenu('shape')" :class="{active: bigScreenDetailMenu==='shape'}">变形监测</li>
<li @click="changeMenu('temprate')" :class="{active: bigScreenDetailMenu==='temprate'}">温度监测
</li>
<li @click="changeMenu('wind')" :class="{active: bigScreenDetailMenu==='wind'}">风速监测</li>
<li @click="changeMenu('water')" :class="{active: bigScreenDetailMenu==='water'}">降水监测</li>
<li @click="changeMenu('people')" :class="{active: bigScreenDetailMenu==='people'}">人员定位
<li v-for="(item, index) in menuObj.emergency.menuList" @click="changeMenu(item)" :class="{active: bigScreenDetailMenu===item.name}">
{{item.name}}
</li>
</ul>
</div>
......@@ -142,7 +132,7 @@
<script src="../js/js.cookie.js"></script>
<!-- 详情内页公用js -->
<!-- <script src="./static/js/public-detail.js"></script> -->
<script src="./static/js/public-detail.js"></script>
<script>
let jessibucaPlayer = {};
//const host = location.protocol + '//' + window.location.host;
......@@ -191,27 +181,15 @@
var map; // 地图
new Vue({
el: '#app',
mixins: [gemhoUtil.detailPageMixin],
data() {
return {
// 公共信息
selectedMine: {},
// 菜单折叠显隐
showMenu4bianpo: true,
sensorLIst: [],
currentSensorId: '',
showMenu4weikuangku: true,
showMenu4chenjiang: true,
showMenu4diya: true,
// 菜单折叠显隐 - 结束
createTime: ['2024-01-01', '2024-09-30'],
bigScreenDetailMenu: '',
selectedMine: {},
isReady: false, // 页面是否准备好 请求完接口变为true
// 表格数据
tableList: []
}
},
mounted() {
......@@ -283,16 +261,6 @@
console.log('sdfsdf', res)
});
},
menuChange(type) {
['showMenu4bianpo', 'showMenu4weikuangku', 'showMenu4chenjiang', 'showMenu4diya'].forEach((item) => {
if (item === type) {
this[type] = !this[type]
} else {
this[item] = false
}
})
},
getChartsData() {
const yAxisOption = {
......@@ -397,25 +365,6 @@
loading && loading.close();
this.isReady = true
},
changeMenu(menuName) {
localStorage.setItem('bigScreenDetailMenu', menuName)
this.bigScreenDetailMenu = menuName
},
getAccessToken(appKey, appSecret) {
var dataJson = 'appKey=' + appKey + '&appSecret=' + appSecret;
return request.post("/ys7com", dataJson).then(res => {
var data = res.data || {};
if (data['code'] == '200') {
return data['data']['accessToken']
} else {
return null
}
}).catch(err => {
console.log(err);
return err
})
},
},
})
</script>
......
This diff is collapsed.
......@@ -59,13 +59,8 @@
</div>
<div class="menuInfo">
<ul>
<li @click="changeMenu('video')" :class="{active: bigScreenDetailMenu==='video'}">视频监控</li>
<li @click="changeMenu('shape')" :class="{active: bigScreenDetailMenu==='shape'}">变形监测</li>
<li @click="changeMenu('temprate')" :class="{active: bigScreenDetailMenu==='temprate'}">温度监测
</li>
<li @click="changeMenu('wind')" :class="{active: bigScreenDetailMenu==='wind'}">风速监测</li>
<li @click="changeMenu('water')" :class="{active: bigScreenDetailMenu==='water'}">降水监测</li>
<li @click="changeMenu('people')" :class="{active: bigScreenDetailMenu==='people'}">人员定位
<li v-for="(item, index) in menuObj.emergency.menuList" @click="changeMenu(item)" :class="{active: bigScreenDetailMenu===item.name}">
{{item.name}}
</li>
</ul>
</div>
......@@ -149,6 +144,8 @@
<script src="../js/axios.min.js"></script>
<!-- cookie -->
<script src="../js/js.cookie.js"></script>
<!-- 详情内页公用js -->
<script src="./static/js/public-detail.js"></script>
<script>
let jessibucaPlayer = {};
......@@ -199,24 +196,14 @@
var map; // 地图
new Vue({
el: '#app',
mixins: [gemhoUtil.detailPageMixin],
data() {
return {
// 公共信息
selectedMine: {},
// 菜单折叠显隐
showMenu4bianpo: true,
sensorLIst: [],
currentSensorId: '',
showMenu4weikuangku: true,
showMenu4chenjiang: true,
showMenu4diya: true,
// 菜单折叠显隐 - 结束
createTime: ['2024-01-01', '2024-09-30'],
bigScreenDetailMenu: '',
selectedMine: {},
isReady: false, // 页面是否准备好 请求完接口变为true
// 表格数据
tableList: []
}
......@@ -437,21 +424,6 @@
loading && loading.close();
this.isReady = true
},
changeMenu(menuName) {
localStorage.setItem('bigScreenDetailMenu', menuName)
this.bigScreenDetailMenu = menuName
},
menuChange(type) {
['showMenu4bianpo', 'showMenu4weikuangku', 'showMenu4chenjiang', 'showMenu4diya'].forEach((item) => {
if (item === type) {
this[type] = !this[type]
} else {
this[item] = false
}
})
},
async getData(e) {
var loading
if (!e) {
......@@ -568,11 +540,7 @@
this.isReady = true
}, 800);
}
},
})
</script>
......
......@@ -49,11 +49,6 @@
<div class="f20 color-theme ml10">返回</div>
</div>
<div class="fixed flex-text maxIndex pointer" style="right: 30px;top: 45px;" @click="gotoManagement()">
<img style="width: 24px;height: 24px;" src="../static/backstage.png" alt="">
<div class="f20 color-theme ml10">后台管理</div>
</div>
<div class="flex-text ml10 mr10 mt15">
<div style="width: 490px;height: calc(100vh - 110px);">
<div style="background: linear-gradient(to bottom, rgba(13,27,48,.7), rgba(13,27,48,0));">
......@@ -66,13 +61,8 @@
</div>
<div class="menuInfo">
<ul>
<li @click="changeMenu('video')" :class="{active: bigScreenDetailMenu==='video'}">视频监控</li>
<li @click="changeMenu('shape')" :class="{active: bigScreenDetailMenu==='shape'}">变形监测</li>
<li @click="changeMenu('temprate')" :class="{active: bigScreenDetailMenu==='temprate'}">温度监测
</li>
<li @click="changeMenu('wind')" :class="{active: bigScreenDetailMenu==='wind'}">风速监测</li>
<li @click="changeMenu('water')" :class="{active: bigScreenDetailMenu==='water'}">降水监测</li>
<li @click="changeMenu('people')" :class="{active: bigScreenDetailMenu==='people'}">人员定位
<li v-for="(item, index) in menuObj.emergency.menuList" @click="changeMenu(item)" :class="{active: bigScreenDetailMenu===item.name}">
{{item.name}}
</li>
</ul>
</div>
......@@ -142,7 +132,7 @@
<script src="../js/js.cookie.js"></script>
<!-- 详情内页公用js -->
<!-- <script src="./static/js/public-detail.js"></script> -->
<script src="./static/js/public-detail.js"></script>
<script>
let jessibucaPlayer = {};
//const host = location.protocol + '//' + window.location.host;
......@@ -191,23 +181,13 @@
var map; // 地图
new Vue({
el: '#app',
mixins: [gemhoUtil.detailPageMixin],
data() {
return {
// 公共信息
selectedMine: {},
// 菜单折叠显隐
showMenu4bianpo: true,
sensorLIst: [],
currentSensorId: '',
showMenu4weikuangku: true,
showMenu4chenjiang: true,
showMenu4diya: true,
// 菜单折叠显隐 - 结束
createTime: ['2024-01-01', '2024-09-30'],
bigScreenDetailMenu: '',
selectedMine: {},
isReady: false, // 页面是否准备好 请求完接口变为true
// 表格数据
tableList: []
......@@ -241,6 +221,8 @@
});
this.getTableList();
console.log('menuList', menuList)
// this.getChartsData();
},
......@@ -283,16 +265,6 @@
console.log('sdfsdf', res)
});
},
menuChange(type) {
['showMenu4bianpo', 'showMenu4weikuangku', 'showMenu4chenjiang', 'showMenu4diya'].forEach((item) => {
if (item === type) {
this[type] = !this[type]
} else {
this[item] = false
}
})
},
getChartsData() {
const yAxisOption = {
......@@ -397,25 +369,6 @@
loading && loading.close();
this.isReady = true
},
changeMenu(menuName) {
localStorage.setItem('bigScreenDetailMenu', menuName)
this.bigScreenDetailMenu = menuName
},
getAccessToken(appKey, appSecret) {
var dataJson = 'appKey=' + appKey + '&appSecret=' + appSecret;
return request.post("/ys7com", dataJson).then(res => {
var data = res.data || {};
if (data['code'] == '200') {
return data['data']['accessToken']
} else {
return null
}
}).catch(err => {
console.log(err);
return err
})
},
},
})
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment