Commit 2d6459fb by 潘建波

添加经纬度地图重置

1 parent 5dad5317
No preview for this file type
......@@ -2,26 +2,26 @@ import axios from "axios";
import store from "../store/index.js";
import router from "../router/index";
import {Message,Loading} from 'element-ui'
import { Message, Loading } from "element-ui";
let loading;
//内存中正在请求的数量
let loadingNum=0;
let loadingNum = 0;
function startLoading() {
if(loadingNum==0){
if (loadingNum == 0) {
loading = Loading.service({
lock: true,
text: '拼命加载中...',
background:'rgba(255,255,255,0.5)',
})
text: "拼命加载中...",
background: "rgba(255,255,255,0.5)"
});
}
//请求数量加1
loadingNum++;
}
function endLoading() {
//请求数量减1
loadingNum--
if(loadingNum<=0){
loading.close()
loadingNum--;
if (loadingNum <= 0) {
loading.close();
}
}
// 创建 axios 实例
......@@ -32,64 +32,65 @@ let service = axios.create({
// 添加请求拦截器
service.interceptors.request.use(
(config) => {
startLoading();
if (store.state.users.atoken) { // 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers.authorization = store.state.users.atoken;
}else{
config => {
// startLoading();
let atoken = localStorage.getItem("atoken");
if (atoken) {
// 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers.authorization = atoken;
} else {
router.push("/login");
endLoading();
// endLoading();
}
if (config.method == 'get') {
if (config.method == "get") {
config.params = {
_t: Date.parse(new Date()) / 1000,
...config.params
};
}
}
return config
return config;
},
(err) => {
err => {
// 请求错误处理
return Promise.reject(err)
// config => {
// let token = localStorage.getItem("atoken");
// if (token) {
// // 判断是否存在token,如果存在的话,则每个http header都加上token
// config.headers.authorization = token;
// } else {
// router.push("/login");
// }
// if (config.method == "get") {
// config.params = {
// _t: Date.parse(new Date()) / 1000,
// ...config.params
// };
// }
// return config;
// },
// error => {
// // 请求错误处理
// return Promise.reject(error);
return Promise.reject(err);
// config => {
// let token = localStorage.getItem("atoken");
// if (token) {
// // 判断是否存在token,如果存在的话,则每个http header都加上token
// config.headers.authorization = token;
// } else {
// router.push("/login");
// }
// if (config.method == "get") {
// config.params = {
// _t: Date.parse(new Date()) / 1000,
// ...config.params
// };
// }
// return config;
// },
// error => {
// // 请求错误处理
// return Promise.reject(error);
}
);
// 添加响应拦截器
service.interceptors.response.use(
(response) => {
endLoading();
let { data } = response
return data
response => {
// endLoading();
let { data } = response;
return data;
},
(err) => {
endLoading();
err => {
// endLoading();
if (err && err.response) {
Message.error({message: err.response.data.enote});
}else{
Message.error({message: '连接服务器失败!'});
Message.error({ message: err.response.data.enote });
} else {
Message.error({ message: "连接服务器失败!" });
}
return Promise.reject(err)
return Promise.reject(err);
}
);
......
......@@ -5,6 +5,12 @@ html,body{
padding: 0;
margin: 0;
}
body{
background: #fff!important;
}
.el-main{
background: #f5f7f9;
}
.home,.home-box{
height: 100%;
}
......@@ -158,6 +164,10 @@ html,body{
right: .5em;
top:auto!important;
}
.rotate-north {
right: .5em;
bottom: 3.8em;
}
.nav-tag-box {
line-height: 40px;
height: 40px;
......@@ -217,6 +227,9 @@ html,body{
}
/* 菜单 */
.el-menu-vertical-dem:not(.el-menu--collapse){
min-height: 900px;
}
.el-menu .is-opened{
background:rgba(239,239,239,1);
}
......
......@@ -20,8 +20,8 @@ Vue.prototype.$buildCode = buildCode;
Vue.prototype.oParse = new XML.ObjTree();
Vue.prototype.axios = axios;
import VueParticles from "vue-particles";
Vue.use(VueParticles);
// import VueParticles from "vue-particles";
// Vue.use(VueParticles);
Vue.use(api);
Vue.use(ElementUI, { size: "small", zIndex: 3000 });
......
......@@ -15,9 +15,9 @@
<el-menu-item index="/trficcshow">
<i class="submenuicon"></i>交通展示
</el-menu-item>
<el-menu-item index="/behaviorshow">
<!-- <el-menu-item index="/behaviorshow">
<i class="submenuicon"></i>综治展示
</el-menu-item>
</el-menu-item> -->
</el-submenu>
<el-submenu v-for="(fristmenu,index) in permission_routers" :index="fristmenu.path" :key="index" class="menu-icon">
<template slot="title">
......
<template>
<div id="login" :style="{ height: innerHeight + 'px' }">
<!-- ie空白解决方法https://blog.csdn.net/heyNewbie/article/details/99623550 -->
<vue-particles
<!-- <vue-particles
color="#dedede"
:particleOpacity="0.7"
:particlesNumber="80"
......@@ -18,7 +18,7 @@
:clickEffect="true"
clickMode="push"
>
</vue-particles>
</vue-particles> -->
<div class="box">
<h1>视频分析综合管理平台</h1>
<div style="width: 60%;margin: 0 auto;">
......@@ -224,7 +224,7 @@ export default {
},
getDev() {
this.$api.resource.devs().then(res => {
sessionStorage.setItem('dev_unid',res[0].dev_unid);
localStorage.setItem('dev_unid',res[0].dev_unid);
this.getDevsName(res[0].dev_unid);
})
},
......
......@@ -349,7 +349,7 @@ export default {
}
.left-box {
overflow: auto;
width: 63vw;
width: 73vw;
position: relative;
height: 100%;
margin: 0 0 12vh 0;
......
<template>
<div class="contentBox minHeight">
<el-col :span="12">
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
<el-form-item label="视频1">
<el-input v-model="formLabelAlign.video1"></el-input>
</el-form-item>
<el-form-item label="视频2">
<el-input v-model="formLabelAlign.video2"></el-input>
</el-form-item>
<el-form-item label="视频3">
<el-input v-model="formLabelAlign.video3"></el-input>
</el-form-item>
<el-form-item label="视频4">
<el-input v-model="formLabelAlign.video4"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">提交</el-button>
</el-form-item>
</el-form>
</el-col>
</div>
</template>
<script>
export default {
data(){
return{
activeName: 'first',
height:'',
formLabelAlign:{
video1:"",
video2:"",
video3:"",
video4:"",
}
}
},
mounted(){
},
methods:{
handleClick(tab, event) {
},
onSubmit(){
}
},
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
......@@ -8,6 +8,9 @@
<el-tab-pane label="系统维护" name="second">
<sytemset></sytemset>
</el-tab-pane>
<el-tab-pane label="展示设置" name="third">
<showset></showset>
</el-tab-pane>
</el-tabs>
</div>
......@@ -16,7 +19,7 @@
<script>
import proofreadtime from './systemComponents/proofreadtime'
import sytemset from './systemComponents/sytemSet'
import showset from './systemComponents/showSet'
export default {
data(){
return{
......@@ -25,7 +28,7 @@
}
},
components:{
proofreadtime,sytemset
proofreadtime,sytemset,showset
},
mounted(){
this.height=document.body.clientHeight - 140 + 'px'
......
......@@ -30,7 +30,7 @@ export default {
props: ["playersrc", "vnum"],
methods: {
initocx(){
VionVideo.Init(0, 'Null', 4);
VionVideo.Init(2, 'Null', 4);
},
downloadOCx() {
if (navigator.userAgent.indexOf('Trident') > -1) {
......@@ -61,7 +61,7 @@ export default {
},
mounted() {
var testStr = 'Null';
nvrTotalOcx.Init(0, testStr, 4);
nvrTotalOcx.Init(2, testStr, 4);
nvrTotalOcx.SetSingleWindow(true);
nvrTotalOcx.SetParam("SetLanguage", "Chinese");
nvrTotalOcx.SetParam("VideoSize", 0);
......@@ -79,9 +79,7 @@ export default {
},1000)
console.log('shipin'+a)
},
watch: {
},
watch: {},
beforeDestroy: function () {
// if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
// this.videoplayer.pause();
......
......@@ -47,6 +47,9 @@
:formatter="cateFormatter"
>
</el-table-column>
<el-table-column align="center" prop="active" label="状态"
:formatter="activeFormatter">
</el-table-column>
<el-table-column align="center" prop="operation" label="操作">
<template slot-scope="scope">
<el-tooltip
......@@ -126,7 +129,20 @@
>
<el-input v-model="codeData.name"></el-input>
</el-form-item>
<el-form-item
label="启用"
prop="active"
:rules="[
{ required: true, message: '名称不能为空!', trigger: 'blur' }
]"
>
<el-select v-model="codeData.active" placeholder="请选择">
<el-option label="开启" :value="1"></el-option>
<el-option label="关闭" :value="0"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="detailVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="saveCode"
......@@ -151,7 +167,8 @@ export default {
codeData: {
name: "",
code: "",
catename: ""
catename: "",
active:1
},
editStatus: 0,
event_type_unid: ""
......@@ -190,6 +207,15 @@ export default {
cateFormatter(row) {
return this.getCateName(row.event_cate_unid);
},
activeFormatter(row){
let text = "开启"
if(row.active && row.active == 0) {
text = "关闭"
} else {
text = "开启"
}
return text
},
editCode(index, row) {
this.event_type_unid = row.event_type_unid;
this.detailVisible = true;
......@@ -198,7 +224,8 @@ export default {
name: row.name,
code: row.code,
catename: this.getCateName(this.curcate),
event_cate_unid: row.event_cate_unid
event_cate_unid: row.event_cate_unid,
active: row.active
};
},
deleteCode(index, row) {
......
......@@ -51,6 +51,12 @@
<el-form-item label="密码">
<el-input v-model="addVideoParam.password"></el-input>
</el-form-item>
<el-form-item label="经度">
<el-input v-model="addVideoParam.longitude"></el-input>
</el-form-item>
<el-form-item label="纬度">
<el-input v-model="addVideoParam.latitude"></el-input>
</el-form-item>
<el-form-item label="扩展字段1">
<el-input v-model="addVideoParam.extend_1"></el-input>
</el-form-item>
......@@ -85,7 +91,9 @@
extend_1:'',
extend_2:'',
is_dome:false,
vchan_type:'camera'
vchan_type:'camera',
longitude:'',
latitude:''
},
initParam:{
},
......@@ -143,6 +151,8 @@
this.addVideoParam.password=node.password;
this.addVideoParam.extend_1=node.extend_1;
this.addVideoParam.extend_2=node.extend_2;
this.addVideoParam.longitude=node.longitude;
this.addVideoParam.latitude=node.latitude;
}else if(type == 'detail'){
this.type = 'detail';
this.addVideoParam.addr_unid = node.addrNode.unid;
......@@ -164,6 +174,8 @@
this.addVideoParam.password=node.password;
this.addVideoParam.extend_1=node.extend_1;
this.addVideoParam.extend_2=node.extend_2;
this.addVideoParam.longitude=node.longitude;
this.addVideoParam.latitude=node.latitude;
}
},
save(){
......
......@@ -129,7 +129,7 @@
{ min: 2, max: 9, message: '长度在 2 到 9 个字符', trigger: 'blur' }
],
},
dev_unid: sessionStorage.getItem('dev_unid'),
dev_unid: localStorage.getItem('dev_unid'),
}
},
components:{
......
......@@ -308,7 +308,6 @@ export default {
},
changeCanvasState: function() {
alert(1);
if (this.canvasState) {
this.cancleSelectedGroup();
}
......
......@@ -67,7 +67,7 @@
</div>
<div style="padding: 0 23px 20px 23px;width:98%">
<el-table
height="50vh"
height="59vh"
:data="tableData"
stripe
border
......@@ -584,20 +584,4 @@ export default {
color: #f2365a;
font-size: 16px;
}
.subtask-info:nth-child(2) {
width: 8vw;
}
.subtask-info:nth-child(4) {
width: 6vw;
}
.subtask-info:nth-child(6) {
width: 4.5vw;
}
.subtask-info:nth-child(8) {
width: 4vw;
}
.subtask-info:nth-child(10) {
width: 12vw;
}
</style>
......@@ -99,20 +99,20 @@ export default {
height: 40px;
line-height: 40px;
}
.subtask-info:nth-child(2) {
.subtask-info:nth-child(3) {
width: 9vw;
overflow: hidden;
}
.subtask-info:nth-child(4) {
.subtask-info:nth-child(5) {
width: 6vw;
}
.subtask-info:nth-child(6) {
.subtask-info:nth-child(7) {
width: 4.5vw;
}
.subtask-info:nth-child(8) {
.subtask-info:nth-child(9) {
width: 4vw;
}
.subtask-info:nth-child(10) {
.subtask-info:nth-child(11) {
width: 12vw;
}
.sub-btn {
......
<template>
<el-row :gutter="10" style="padding: 10px 0 10px 10px;width: 100%;overflow:hidden">
<el-col :span="15">
<el-col :span="17">
<div id="map" class="maps">
<showmap ref="map"></showmap>
<div class="eventlist-box">
......@@ -18,7 +18,7 @@
</div>
<div style="clear: both;"></div>
</el-col>
<el-col :span="9">
<el-col :span="7">
<el-row>
<div class="collect-box">
<div class="header-title">今日抓拍量</div>
......@@ -113,6 +113,7 @@ import eventTypedis from "./eventTypedis";
import eventList from "./eventList";
import alarmEvent from "./alarmEvent";
import devInfo from "../behaviorShow/devInfo";
export default {
data() {
return {
......
......@@ -34,6 +34,7 @@ import Feature from "ol/Feature"; //元素
import Overlay from "ol/Overlay"; //弹出框
import { toStringHDMS } from "ol/coordinate";
import { fromLonLat, toLonLat } from "ol/proj";
import {defaults as defaultControls, Control} from 'ol/control.js';
import {
Tile as TileLayer,
Vector as VectorLayer,
......@@ -71,6 +72,40 @@ var content = "";
var voideocontent = "";
var closer = "";
var overlay = "";
var RotateNorthControl = (function (Control) {
function RotateNorthControl(opt_options) {
var options = opt_options || {};
var button = document.createElement('button');
button.className = 'el-icon-aim';
var element = document.createElement('div');
element.className = 'rotate-north ol-unselectable ol-control';
element.appendChild(button);
Control.call(this, {
element: element,
target: options.target
});
button.addEventListener('click', this.handleRotateNorth.bind(this), false);
}
if ( Control ) RotateNorthControl.__proto__ = Control;
RotateNorthControl.prototype = Object.create( Control && Control.prototype );
RotateNorthControl.prototype.constructor = RotateNorthControl;
RotateNorthControl.prototype.handleRotateNorth = function handleRotateNorth () {
let pos = [120.324447, 36.074594];
Views.animate({
center: pos,
duration: 400,
zoom: 14
});
};
return RotateNorthControl;
}(Control));
export default {
data() {
return {
......@@ -142,6 +177,9 @@ export default {
center: [120.324447, 36.064594]
});
map = new Map({
controls: defaultControls().extend([
new RotateNorthControl()
]),
// 设置地图图层
layers: [
// 创建一个使用Open Street Map地图源的瓦片图层
......@@ -177,8 +215,8 @@ export default {
let that = this;
map.on("click", e => {
console.log('经纬度',e.coordinate);
var pixel = map.getEventPixel(e.originalEvent);
console.log(pixel);
//点击相机标注点
map.forEachFeatureAtPixel(pixel, function(feature) {
// var coodinate = e.coordinate;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!