Compare commits
3 Commits
c1919cea59
...
cada3b3877
| Author | SHA1 | Date |
|---|---|---|
|
|
cada3b3877 | |
|
|
b2b8533074 | |
|
|
34dd3668fb |
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"method":"feixian",
|
||||
"feixian":{
|
||||
"name":"费县",
|
||||
"map":{
|
||||
"center":[],
|
||||
"zoom":10,
|
||||
"xianjieLayer":"http://175.27.168.120:8080/geoserver/feixian/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=feixian%3Axianjie&maxFeatures=50&outputFormat=application%2Fjson",
|
||||
"yingxiangLayer":"http://60.213.14.14:8060/geoserver/feixian/wms?service=WMS&version=1.1.0&request=GetMap&layers=feixian:yingxiang&styles=&bbox={bbox-epsg-3857}&width=256&height=256&srs=EPSG:3857&format=image/png&TRANSPARENT=TRUE"
|
||||
}
|
||||
},
|
||||
"pingyixian":{
|
||||
"name":"平邑县",
|
||||
"map":{
|
||||
"center":[117.7075,35.43222222],
|
||||
"zoom":9.7,
|
||||
"xianjieLayer":"http://175.27.168.120:8080/geoserver/linyishi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=linyishi%3Axianjie&cql_filter=xzqdm%20like%20%27%25371326%25%27&maxFeatures=50&outputFormat=application%2Fjson",
|
||||
"yingxiangLayer":"http://175.27.168.120:8080/geoserver/pingyixian/wms?service=WMS&version=1.1.0&request=GetMap&layers=pingyixian:yingxiang&styles=&bbox={bbox-epsg-3857}&width=256&height=256&srs=EPSG:3857&format=image/png&TRANSPARENT=TRUE"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
.flex{
|
||||
display: flex;
|
||||
}
|
||||
.flex-1{
|
||||
flex: 1;
|
||||
}
|
||||
.wrap{
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.nowrap{
|
||||
flex-wrap: nowrap;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.row{
|
||||
flex-direction: row;
|
||||
}
|
||||
.column{
|
||||
flex-direction: column;
|
||||
}
|
||||
.hidden{
|
||||
overflow: hidden;
|
||||
}
|
||||
.auto{
|
||||
overflow: auto;
|
||||
}
|
||||
.ai-c{
|
||||
align-items: center;
|
||||
}
|
||||
.ai-e{
|
||||
align-items: end;
|
||||
}
|
||||
.jc-se{
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.jc-sa{
|
||||
justify-content: space-around;
|
||||
}
|
||||
.jc-sb{
|
||||
justify-content: space-between;
|
||||
}
|
||||
.jc-c{
|
||||
justify-content: center;
|
||||
}
|
||||
.jc-e{
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.mt-1{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.mt-2{
|
||||
margin-top: 20px;
|
||||
}
|
||||
.mt-3{
|
||||
margin-top: 30px;
|
||||
}
|
||||
.ml-1{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.ml-2{
|
||||
margin-left: 20px;
|
||||
}
|
||||
.ml-3{
|
||||
margin-left: 30px;
|
||||
}
|
||||
.mb-1{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.mb-2{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.mb-3{
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.mr-1{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.mr-2{
|
||||
margin-right: 20px;
|
||||
}
|
||||
.mr-3{
|
||||
margin-right: 30px;
|
||||
}
|
||||
.ta-c{
|
||||
text-align: center;
|
||||
}
|
||||
.ta-l{
|
||||
text-align: left;
|
||||
}
|
||||
.cursor{
|
||||
cursor: pointer;
|
||||
}
|
||||
.pos-r{
|
||||
position: relative;
|
||||
}
|
||||
.pos-a{
|
||||
position: absolute;
|
||||
}
|
||||
.pos-f{
|
||||
position: fixed;
|
||||
}
|
||||
.max-w{
|
||||
width: 100%;
|
||||
}
|
||||
.max-h{
|
||||
height: 100%;
|
||||
}
|
||||
.fz-12{
|
||||
font-size: 12px;
|
||||
}
|
||||
.fz-14{
|
||||
font-size: 14px;
|
||||
}
|
||||
.fz-16{
|
||||
font-size: 16px;
|
||||
}
|
||||
.fz-18{
|
||||
font-size: 18px;
|
||||
}
|
||||
.fz-20{
|
||||
font-size: 20px;
|
||||
}
|
||||
.fz-22{
|
||||
font-size: 22px;
|
||||
}
|
||||
.fz-24{
|
||||
font-size: 24px;
|
||||
}
|
||||
.fz-26{
|
||||
font-size: 26px;
|
||||
}
|
||||
.fz-28{
|
||||
font-size: 28px;
|
||||
}
|
||||
.fc-w{
|
||||
color: white;
|
||||
}
|
||||
.fc-b{
|
||||
color: black;
|
||||
}
|
||||
.fc-r{
|
||||
color: red;
|
||||
}
|
||||
.fw-b{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
@ -0,0 +1,365 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>preview_demo</title>
|
||||
<link href="./common.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.camera-dia{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0,0,0,0);
|
||||
position:relative;
|
||||
}
|
||||
.camera-box{
|
||||
width: 720px;
|
||||
height: 360px;
|
||||
border-radius: 5px;
|
||||
position: fixed;
|
||||
left:100%;
|
||||
top:100%;
|
||||
transform:translate(-50%,-50%);
|
||||
z-index: 9999;
|
||||
}
|
||||
.camera-header{
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
}
|
||||
.camera-header img{
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
}
|
||||
.camera-body{
|
||||
|
||||
width: 90%;
|
||||
height: 230px;
|
||||
/* border: 1px solid #fff; */
|
||||
margin-left: 5%;
|
||||
}
|
||||
.camera-footer{
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
color: #4371ec;
|
||||
text-align: left;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.camera-footer span{
|
||||
margin-left: 5px;
|
||||
}
|
||||
.playWnd {
|
||||
width: 360px; /*播放容器的宽和高设定*/
|
||||
height: 230px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="camera-dia">
|
||||
<div class="camera-box">
|
||||
<div class="camera-header ">
|
||||
<span class="fz-16" id="carmerName"></span>
|
||||
<img src="../img/close.png" class="cursor" id="closeBtn" />
|
||||
</div>
|
||||
<div class="camera-body">
|
||||
<!--视频窗口展示-->
|
||||
<div id="playWnd" class="playWnd"></div>
|
||||
</div>
|
||||
<div class="camera-footer mt-1" style="display: none;">
|
||||
设备编号:<span id="carmerCard"></span>
|
||||
</div>
|
||||
<div style="display: none;" id="carmerAppKey"></div>
|
||||
<div style="display: none;" id="carmerIp"></div>
|
||||
<div style="display: none;" id="carmerPort"></div>
|
||||
<div style="display: none;" id="appSecret"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<!--三个必要的js文件引入-->
|
||||
<script src="jquery-1.12.4.min.js"></script>
|
||||
<script src="jsencrypt.min.js"></script> <!-- 用于RSA加密 -->
|
||||
<script src="jsWebControl-1.0.0.min.js"></script> <!-- 用于前端与插件交互 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onload = () => {
|
||||
// 子页面接收消息
|
||||
window.addEventListener('message', function (e) {
|
||||
if (e.data) {
|
||||
console.log("play-data",e.data);
|
||||
$("#carmerName").text(e.data[0])
|
||||
$("#carmerCard").text(e.data[1])
|
||||
$("#carmerAppKey").text(e.data[2])
|
||||
$("#carmerIp").text(e.data[3])
|
||||
$("#carmerPort").text(e.data[4])
|
||||
$("#appSecret").text(e.data[5])
|
||||
}
|
||||
}, false)
|
||||
|
||||
initPlugin();
|
||||
}
|
||||
$("#closeBtn").click(function(){
|
||||
window.parent.postMessage(
|
||||
{
|
||||
cmd: 'close'
|
||||
}
|
||||
)
|
||||
})
|
||||
//页面加载时创建播放实例初始化
|
||||
$(window).load(function () {
|
||||
// initPlugin();
|
||||
});
|
||||
|
||||
//声明公用变量
|
||||
var initCount = 0;
|
||||
var pubKey = '';
|
||||
|
||||
// 创建播放实例
|
||||
function initPlugin () {
|
||||
oWebControl = new WebControl({
|
||||
szPluginContainer: "playWnd", // 指定容器id
|
||||
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
||||
iServicePortEnd: 15909,
|
||||
szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
||||
cbConnectSuccess: function () { // 创建WebControl实例成功
|
||||
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
|
||||
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
|
||||
}).then(function () { // 启动插件服务成功
|
||||
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
|
||||
oWebControl.JS_CreateWnd("playWnd", 400, 265).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
||||
init(); // 创建播放实例成功后初始化
|
||||
});
|
||||
}, function () { // 启动插件服务失败
|
||||
});
|
||||
},
|
||||
cbConnectError: function () { // 创建WebControl实例失败
|
||||
oWebControl = null;
|
||||
$("#playWnd").html("插件未启动,正在尝试启动,请稍候...");
|
||||
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数,采用wakeup来启动程序
|
||||
initCount ++;
|
||||
if (initCount < 3) {
|
||||
setTimeout(function () {
|
||||
initPlugin();
|
||||
}, 3000)
|
||||
} else {
|
||||
window.parent.alertInstallVideoPlayer();
|
||||
$("#playWnd").html("插件启动失败,请检查插件是否安装!");
|
||||
}
|
||||
},
|
||||
cbConnectClose: function (bNormalClose) {
|
||||
// 异常断开:bNormalClose = false
|
||||
// JS_Disconnect正常断开:bNormalClose = true
|
||||
oWebControl = null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 设置窗口控制回调
|
||||
function setCallbacks() {
|
||||
oWebControl.JS_SetWindowControlCallback({
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
}
|
||||
|
||||
// 推送消息
|
||||
function cbIntegrationCallBack(oData) {
|
||||
// showCBInfo(JSON.stringify(oData.responseMsg));
|
||||
}
|
||||
|
||||
//初始化
|
||||
function init()
|
||||
{
|
||||
getPubKey(function () {
|
||||
|
||||
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
||||
// var appkey = "21274765"; //综合安防管理平台提供的appkey,必填
|
||||
// var ip = "223.99.16.253"; //综合安防管理平台IP地址,必填
|
||||
// var port = 1443; //综合安防管理平台端口,若启用HTTPS协议,默认443
|
||||
|
||||
var appkey = $("#carmerAppKey").text(); //综合安防管理平台提供的appkey,必填
|
||||
var ip = $("#carmerIp").text(); //综合安防管理平台IP地址,必填
|
||||
var port = Number($("#carmerPort").text());
|
||||
var appSecret = $("#appSecret").text();
|
||||
console.log(appkey,ip,port,appSecret)
|
||||
// var secret = setEncrypt("tGJdjmKxKxVWtzp1M6px"); //综合安防管理平台提供的secret,必填
|
||||
var secret = setEncrypt(appSecret); //综合安防管理平台提供的secret,必填
|
||||
|
||||
var playMode = 0; //初始播放模式:0-预览,1-回放
|
||||
var snapDir = "D:\\SnapDir"; //抓图存储路径
|
||||
var videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
|
||||
var layout = "1x1"; //playMode指定模式的布局
|
||||
var enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
||||
var encryptedFields = 'secret'; //加密字段,默认加密领域为secret
|
||||
var showToolbar = 1; //是否显示工具栏,0-不显示,非0-显示
|
||||
var showSmart = 1; //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
|
||||
var buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //自定义工具条按钮
|
||||
////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "init",
|
||||
argument: JSON.stringify({
|
||||
appkey: appkey, //API网关提供的appkey
|
||||
secret: secret, //API网关提供的secret
|
||||
ip: ip, //API网关IP地址
|
||||
playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
||||
port: port, //端口
|
||||
snapDir: snapDir, //抓图存储路径
|
||||
videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
||||
layout: layout, //布局
|
||||
enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
||||
encryptedFields: encryptedFields, //加密字段
|
||||
showToolbar: showToolbar, //是否显示工具栏
|
||||
showSmart: showSmart, //是否显示智能信息
|
||||
buttonIDs: buttonIDs //自定义工具条按钮
|
||||
})
|
||||
}).then(function (oData) {
|
||||
oWebControl.JS_Resize(400, 265); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
||||
setWndCover();
|
||||
});
|
||||
// var cameraIndexCode = 'bbe9c64699174953828ce4fa8bb41b8f'; //获取输入的监控点编号值,必填
|
||||
var cameraIndexCode = $("#carmerCard").text()
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
//获取公钥
|
||||
function getPubKey (callback) {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "getRSAPubKey",
|
||||
argument: JSON.stringify({
|
||||
keyLength: 1024
|
||||
})
|
||||
}).then(function (oData) {
|
||||
if (oData.responseMsg.data) {
|
||||
pubKey = oData.responseMsg.data;
|
||||
callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//RSA加密
|
||||
function setEncrypt (value) {
|
||||
var encrypt = new JSEncrypt();
|
||||
encrypt.setPublicKey(pubKey);
|
||||
return encrypt.encrypt(value);
|
||||
}
|
||||
|
||||
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
|
||||
$(window).resize(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(400, 265);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
|
||||
$(window).scroll(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(400, 265);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
||||
function setWndCover() {
|
||||
var iWidth = $(window).width();
|
||||
var iHeight = $(window).height();
|
||||
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
||||
|
||||
var iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left): 0;
|
||||
var iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top): 0;
|
||||
var iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;
|
||||
var iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;
|
||||
|
||||
iCoverLeft = (iCoverLeft > 360) ? 360 : iCoverLeft;
|
||||
iCoverTop = (iCoverTop > 230) ? 230 : iCoverTop;
|
||||
iCoverRight = (iCoverRight > 360) ? 360 : iCoverRight;
|
||||
iCoverBottom = (iCoverBottom > 230) ? 230 : iCoverBottom;
|
||||
|
||||
oWebControl.JS_RepairPartWindow(0, 0, 1001, 230); // 多1个像素点防止还原后边界缺失一个像素条
|
||||
if (iCoverLeft != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 230);
|
||||
}
|
||||
if (iCoverTop != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, 1001, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
||||
}
|
||||
if (iCoverRight != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(360 - iCoverRight, 0, iCoverRight, 230);
|
||||
}
|
||||
if (iCoverBottom != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 230 - iCoverBottom, 360, iCoverBottom);
|
||||
}
|
||||
}
|
||||
|
||||
//视频预览功能
|
||||
$("#startPreview").click(function () {
|
||||
var cameraIndexCode = 'bbe9c64699174953828ce4fa8bb41b8f'; //获取输入的监控点编号值,必填
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
//停止全部预览
|
||||
$("#stopAllPreview").click(function () {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "stopAllPreview"
|
||||
});
|
||||
});
|
||||
|
||||
// 标签关闭
|
||||
$(window).unload(function () {
|
||||
if (oWebControl != null){
|
||||
oWebControl.JS_HideWnd(); // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
||||
oWebControl.JS_Disconnect().then(function(){ // 断开与插件服务连接成功
|
||||
},
|
||||
function() { // 断开与插件服务连接失败
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,318 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>preview_demo</title>
|
||||
<link href="../../common.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.camera-dia{
|
||||
/* width: 100vw;
|
||||
height: 100vh; */
|
||||
}
|
||||
.camera-box{
|
||||
width: 180px;
|
||||
height: 115px;
|
||||
background: rgba(19,21,35,.9);
|
||||
box-shadow: 0 0 0.0625rem 0.3125rem hsl(0deg 0% 100% / 10%);
|
||||
border: 1px solid #386df5;
|
||||
border-radius: 5px;
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
bottom: 130px;
|
||||
z-index: 999;
|
||||
padding: 10px;
|
||||
}
|
||||
.camera-body{
|
||||
width: 100%;
|
||||
height: 115px;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
.playWnd {
|
||||
width: 180px; /*播放容器的宽和高设定*/
|
||||
height: 115px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="camera-dia">
|
||||
<div class="camera-box fc-w fz-14">
|
||||
<div class="camera-body pos-r">
|
||||
<!--视频窗口展示-->
|
||||
<div id="playWnd" class="playWnd"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="carmerCard" style="display: none;"></div>
|
||||
</body>
|
||||
|
||||
<!--三个必要的js文件引入-->
|
||||
<script src="jquery-1.12.4.min.js"></script>
|
||||
<script src="jsencrypt.min.js"></script> <!-- 用于RSA加密 -->
|
||||
<script src="jsWebControl-1.0.0.min.js"></script> <!-- 用于前端与插件交互 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onload = () => {
|
||||
// 子页面接收消息
|
||||
window.addEventListener('message', function (e) {
|
||||
if (e.data) {
|
||||
$("#carmerCard").text(e.data[0])
|
||||
}
|
||||
}, false)
|
||||
}
|
||||
$("#closeBtn").click(function(){
|
||||
window.parent.postMessage(
|
||||
{
|
||||
cmd: 'close'
|
||||
}
|
||||
)
|
||||
})
|
||||
//页面加载时创建播放实例初始化
|
||||
$(window).load(function () {
|
||||
initPlugin();
|
||||
});
|
||||
|
||||
//声明公用变量
|
||||
var initCount = 0;
|
||||
var pubKey = '';
|
||||
|
||||
// 创建播放实例
|
||||
function initPlugin () {
|
||||
oWebControl = new WebControl({
|
||||
szPluginContainer: "playWnd", // 指定容器id
|
||||
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
||||
iServicePortEnd: 15909,
|
||||
szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
||||
cbConnectSuccess: function () { // 创建WebControl实例成功
|
||||
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
|
||||
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
|
||||
}).then(function () { // 启动插件服务成功
|
||||
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
|
||||
oWebControl.JS_CreateWnd("playWnd", 180, 115).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
||||
init(); // 创建播放实例成功后初始化
|
||||
});
|
||||
}, function () { // 启动插件服务失败
|
||||
});
|
||||
},
|
||||
cbConnectError: function () { // 创建WebControl实例失败
|
||||
oWebControl = null;
|
||||
$("#playWnd").html("插件未启动,正在尝试启动,请稍候...");
|
||||
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数,采用wakeup来启动程序
|
||||
initCount ++;
|
||||
if (initCount < 3) {
|
||||
setTimeout(function () {
|
||||
initPlugin();
|
||||
}, 3000)
|
||||
} else {
|
||||
$("#playWnd").html("插件启动失败,请检查插件是否安装!");
|
||||
}
|
||||
},
|
||||
cbConnectClose: function (bNormalClose) {
|
||||
// 异常断开:bNormalClose = false
|
||||
// JS_Disconnect正常断开:bNormalClose = true
|
||||
oWebControl = null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 设置窗口控制回调
|
||||
function setCallbacks() {
|
||||
oWebControl.JS_SetWindowControlCallback({
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
}
|
||||
|
||||
// 推送消息
|
||||
function cbIntegrationCallBack(oData) {
|
||||
// showCBInfo(JSON.stringify(oData.responseMsg));
|
||||
}
|
||||
|
||||
//初始化
|
||||
function init()
|
||||
{
|
||||
getPubKey(function () {
|
||||
|
||||
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
||||
var appkey = "21274765"; //综合安防管理平台提供的appkey,必填
|
||||
var secret = setEncrypt("CraRtGvpNB2xOcYSFTov"); //综合安防管理平台提供的secret,必填
|
||||
var ip = "223.99.16.253"; //综合安防管理平台IP地址,必填
|
||||
var playMode = 0; //初始播放模式:0-预览,1-回放
|
||||
var port = 1443; //综合安防管理平台端口,若启用HTTPS协议,默认443
|
||||
var snapDir = "D:\\SnapDir"; //抓图存储路径
|
||||
var videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
|
||||
var layout = "1x1"; //playMode指定模式的布局
|
||||
var enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
||||
var encryptedFields = 'secret'; //加密字段,默认加密领域为secret
|
||||
var showToolbar = 1; //是否显示工具栏,0-不显示,非0-显示
|
||||
var showSmart = 1; //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
|
||||
var buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //自定义工具条按钮
|
||||
////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "init",
|
||||
argument: JSON.stringify({
|
||||
appkey: appkey, //API网关提供的appkey
|
||||
secret: secret, //API网关提供的secret
|
||||
ip: ip, //API网关IP地址
|
||||
playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
||||
port: port, //端口
|
||||
snapDir: snapDir, //抓图存储路径
|
||||
videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
||||
layout: layout, //布局
|
||||
enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
||||
encryptedFields: encryptedFields, //加密字段
|
||||
showToolbar: showToolbar, //是否显示工具栏
|
||||
showSmart: showSmart, //是否显示智能信息
|
||||
buttonIDs: buttonIDs //自定义工具条按钮
|
||||
})
|
||||
}).then(function (oData) {
|
||||
oWebControl.JS_Resize(180, 115); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
||||
setWndCover();
|
||||
});
|
||||
// var cameraIndexCode = 'bbe9c64699174953828ce4fa8bb41b8f'; //获取输入的监控点编号值,必填
|
||||
var cameraIndexCode = $("#carmerCard").text()
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
//获取公钥
|
||||
function getPubKey (callback) {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "getRSAPubKey",
|
||||
argument: JSON.stringify({
|
||||
keyLength: 1024
|
||||
})
|
||||
}).then(function (oData) {
|
||||
if (oData.responseMsg.data) {
|
||||
pubKey = oData.responseMsg.data;
|
||||
callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//RSA加密
|
||||
function setEncrypt (value) {
|
||||
var encrypt = new JSEncrypt();
|
||||
encrypt.setPublicKey(pubKey);
|
||||
return encrypt.encrypt(value);
|
||||
}
|
||||
|
||||
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
|
||||
$(window).resize(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(180, 115);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
|
||||
$(window).scroll(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(180, 115);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
||||
function setWndCover() {
|
||||
var iWidth = $(window).width();
|
||||
var iHeight = $(window).height();
|
||||
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
||||
|
||||
var iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left): 0;
|
||||
var iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top): 0;
|
||||
var iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;
|
||||
var iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;
|
||||
|
||||
iCoverLeft = (iCoverLeft > 180) ? 180 : iCoverLeft;
|
||||
iCoverTop = (iCoverTop > 115) ? 115 : iCoverTop;
|
||||
iCoverRight = (iCoverRight > 180) ? 180 : iCoverRight;
|
||||
iCoverBottom = (iCoverBottom > 115) ? 115 : iCoverBottom;
|
||||
|
||||
oWebControl.JS_RepairPartWindow(0, 0, 1001, 115); // 多1个像素点防止还原后边界缺失一个像素条
|
||||
if (iCoverLeft != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 115);
|
||||
}
|
||||
if (iCoverTop != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, 1001, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
||||
}
|
||||
if (iCoverRight != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(180 - iCoverRight, 0, iCoverRight, 115);
|
||||
}
|
||||
if (iCoverBottom != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 115 - iCoverBottom, 180, iCoverBottom);
|
||||
}
|
||||
}
|
||||
|
||||
//视频预览功能
|
||||
$("#startPreview").click(function () {
|
||||
var cameraIndexCode = 'bbe9c64699174953828ce4fa8bb41b8f'; //获取输入的监控点编号值,必填
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
//停止全部预览
|
||||
$("#stopAllPreview").click(function () {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "stopAllPreview"
|
||||
});
|
||||
});
|
||||
|
||||
// 标签关闭
|
||||
$(window).unload(function () {
|
||||
if (oWebControl != null){
|
||||
oWebControl.JS_HideWnd(); // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
||||
oWebControl.JS_Disconnect().then(function(){ // 断开与插件服务连接成功
|
||||
},
|
||||
function() { // 断开与插件服务连接失败
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,318 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>preview_demo</title>
|
||||
<link href="../../common.css" rel="stylesheet">
|
||||
</head>
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.camera-dia{
|
||||
/* width: 100vw;
|
||||
height: 100vh; */
|
||||
}
|
||||
.camera-box{
|
||||
width: 180px;
|
||||
height: 115px;
|
||||
background: rgba(19,21,35,.9);
|
||||
box-shadow: 0 0 0.0625rem 0.3125rem hsl(0deg 0% 100% / 10%);
|
||||
border: 1px solid #386df5;
|
||||
border-radius: 5px;
|
||||
position: fixed;
|
||||
right: 20px;
|
||||
bottom: 10px;
|
||||
z-index: 999;
|
||||
padding: 10px;
|
||||
}
|
||||
.camera-body{
|
||||
width: 100%;
|
||||
height: 115px;
|
||||
border: 1px solid #fff;
|
||||
}
|
||||
|
||||
.playWnd {
|
||||
width: 180px; /*播放容器的宽和高设定*/
|
||||
height: 115px;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
<div class="camera-dia">
|
||||
<div class="camera-box fc-w fz-14">
|
||||
<div class="camera-body pos-r">
|
||||
<!--视频窗口展示-->
|
||||
<div id="playWnd" class="playWnd"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="carmerCard" style="display: none;"></div>
|
||||
</body>
|
||||
|
||||
<!--三个必要的js文件引入-->
|
||||
<script src="jquery-1.12.4.min.js"></script>
|
||||
<script src="jsencrypt.min.js"></script> <!-- 用于RSA加密 -->
|
||||
<script src="jsWebControl-1.0.0.min.js"></script> <!-- 用于前端与插件交互 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onload = () => {
|
||||
// 子页面接收消息
|
||||
window.addEventListener('message', function (e) {
|
||||
if (e.data) {
|
||||
$("#carmerCard").text(e.data[0])
|
||||
}
|
||||
}, false)
|
||||
}
|
||||
$("#closeBtn").click(function(){
|
||||
window.parent.postMessage(
|
||||
{
|
||||
cmd: 'close'
|
||||
}
|
||||
)
|
||||
})
|
||||
//页面加载时创建播放实例初始化
|
||||
$(window).load(function () {
|
||||
initPlugin();
|
||||
});
|
||||
|
||||
//声明公用变量
|
||||
var initCount = 0;
|
||||
var pubKey = '';
|
||||
|
||||
// 创建播放实例
|
||||
function initPlugin () {
|
||||
oWebControl = new WebControl({
|
||||
szPluginContainer: "playWnd", // 指定容器id
|
||||
iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
||||
iServicePortEnd: 15909,
|
||||
szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11", // 用于IE10使用ActiveX的clsid
|
||||
cbConnectSuccess: function () { // 创建WebControl实例成功
|
||||
oWebControl.JS_StartService("window", { // WebControl实例创建成功后需要启动服务
|
||||
dllPath: "./VideoPluginConnect.dll" // 值"./VideoPluginConnect.dll"写死
|
||||
}).then(function () { // 启动插件服务成功
|
||||
oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
|
||||
oWebControl.JS_CreateWnd("playWnd", 180, 115).then(function () { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
||||
init(); // 创建播放实例成功后初始化
|
||||
});
|
||||
}, function () { // 启动插件服务失败
|
||||
});
|
||||
},
|
||||
cbConnectError: function () { // 创建WebControl实例失败
|
||||
oWebControl = null;
|
||||
$("#playWnd").html("插件未启动,正在尝试启动,请稍候...");
|
||||
WebControl.JS_WakeUp("VideoWebPlugin://"); // 程序未启动时执行error函数,采用wakeup来启动程序
|
||||
initCount ++;
|
||||
if (initCount < 3) {
|
||||
setTimeout(function () {
|
||||
initPlugin();
|
||||
}, 3000)
|
||||
} else {
|
||||
$("#playWnd").html("插件启动失败,请检查插件是否安装!");
|
||||
}
|
||||
},
|
||||
cbConnectClose: function (bNormalClose) {
|
||||
// 异常断开:bNormalClose = false
|
||||
// JS_Disconnect正常断开:bNormalClose = true
|
||||
oWebControl = null;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 设置窗口控制回调
|
||||
function setCallbacks() {
|
||||
oWebControl.JS_SetWindowControlCallback({
|
||||
cbIntegrationCallBack: cbIntegrationCallBack
|
||||
});
|
||||
}
|
||||
|
||||
// 推送消息
|
||||
function cbIntegrationCallBack(oData) {
|
||||
// showCBInfo(JSON.stringify(oData.responseMsg));
|
||||
}
|
||||
|
||||
//初始化
|
||||
function init()
|
||||
{
|
||||
getPubKey(function () {
|
||||
|
||||
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
||||
var appkey = "21274765"; //综合安防管理平台提供的appkey,必填
|
||||
var secret = setEncrypt("CraRtGvpNB2xOcYSFTov"); //综合安防管理平台提供的secret,必填
|
||||
var ip = "223.99.16.253"; //综合安防管理平台IP地址,必填
|
||||
var playMode = 0; //初始播放模式:0-预览,1-回放
|
||||
var port = 1443; //综合安防管理平台端口,若启用HTTPS协议,默认443
|
||||
var snapDir = "D:\\SnapDir"; //抓图存储路径
|
||||
var videoDir = "D:\\VideoDir"; //紧急录像或录像剪辑存储路径
|
||||
var layout = "1x1"; //playMode指定模式的布局
|
||||
var enableHTTPS = 1; //是否启用HTTPS协议与综合安防管理平台交互,这里总是填1
|
||||
var encryptedFields = 'secret'; //加密字段,默认加密领域为secret
|
||||
var showToolbar = 1; //是否显示工具栏,0-不显示,非0-显示
|
||||
var showSmart = 1; //是否显示智能信息(如配置移动侦测后画面上的线框),0-不显示,非0-显示
|
||||
var buttonIDs = "0,16,256,257,258,259,260,512,513,514,515,516,517,768,769"; //自定义工具条按钮
|
||||
////////////////////////////////// 请自行修改以上变量值 ////////////////////////////////////
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "init",
|
||||
argument: JSON.stringify({
|
||||
appkey: appkey, //API网关提供的appkey
|
||||
secret: secret, //API网关提供的secret
|
||||
ip: ip, //API网关IP地址
|
||||
playMode: playMode, //播放模式(决定显示预览还是回放界面)
|
||||
port: port, //端口
|
||||
snapDir: snapDir, //抓图存储路径
|
||||
videoDir: videoDir, //紧急录像或录像剪辑存储路径
|
||||
layout: layout, //布局
|
||||
enableHTTPS: enableHTTPS, //是否启用HTTPS协议
|
||||
encryptedFields: encryptedFields, //加密字段
|
||||
showToolbar: showToolbar, //是否显示工具栏
|
||||
showSmart: showSmart, //是否显示智能信息
|
||||
buttonIDs: buttonIDs //自定义工具条按钮
|
||||
})
|
||||
}).then(function (oData) {
|
||||
oWebControl.JS_Resize(180, 115); // 初始化后resize一次,规避firefox下首次显示窗口后插件窗口未与DIV窗口重合问题
|
||||
setWndCover();
|
||||
});
|
||||
// var cameraIndexCode = 'bbe9c64699174953828ce4fa8bb41b8f'; //获取输入的监控点编号值,必填
|
||||
var cameraIndexCode = $("#carmerCard").text()
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
//获取公钥
|
||||
function getPubKey (callback) {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "getRSAPubKey",
|
||||
argument: JSON.stringify({
|
||||
keyLength: 1024
|
||||
})
|
||||
}).then(function (oData) {
|
||||
if (oData.responseMsg.data) {
|
||||
pubKey = oData.responseMsg.data;
|
||||
callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//RSA加密
|
||||
function setEncrypt (value) {
|
||||
var encrypt = new JSEncrypt();
|
||||
encrypt.setPublicKey(pubKey);
|
||||
return encrypt.encrypt(value);
|
||||
}
|
||||
|
||||
// 监听resize事件,使插件窗口尺寸跟随DIV窗口变化
|
||||
$(window).resize(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(180, 115);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
// 监听滚动条scroll事件,使插件窗口跟随浏览器滚动而移动
|
||||
$(window).scroll(function () {
|
||||
if (oWebControl != null) {
|
||||
oWebControl.JS_Resize(180, 115);
|
||||
setWndCover();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 设置窗口裁剪,当因滚动条滚动导致窗口需要被遮住的情况下需要JS_CuttingPartWindow部分窗口
|
||||
function setWndCover() {
|
||||
var iWidth = $(window).width();
|
||||
var iHeight = $(window).height();
|
||||
var oDivRect = $("#playWnd").get(0).getBoundingClientRect();
|
||||
|
||||
var iCoverLeft = (oDivRect.left < 0) ? Math.abs(oDivRect.left): 0;
|
||||
var iCoverTop = (oDivRect.top < 0) ? Math.abs(oDivRect.top): 0;
|
||||
var iCoverRight = (oDivRect.right - iWidth > 0) ? Math.round(oDivRect.right - iWidth) : 0;
|
||||
var iCoverBottom = (oDivRect.bottom - iHeight > 0) ? Math.round(oDivRect.bottom - iHeight) : 0;
|
||||
|
||||
iCoverLeft = (iCoverLeft > 180) ? 180 : iCoverLeft;
|
||||
iCoverTop = (iCoverTop > 115) ? 115 : iCoverTop;
|
||||
iCoverRight = (iCoverRight > 180) ? 180 : iCoverRight;
|
||||
iCoverBottom = (iCoverBottom > 115) ? 115 : iCoverBottom;
|
||||
|
||||
oWebControl.JS_RepairPartWindow(0, 0, 1001, 115); // 多1个像素点防止还原后边界缺失一个像素条
|
||||
if (iCoverLeft != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, iCoverLeft, 115);
|
||||
}
|
||||
if (iCoverTop != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 0, 1001, iCoverTop); // 多剪掉一个像素条,防止出现剪掉一部分窗口后出现一个像素条
|
||||
}
|
||||
if (iCoverRight != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(180 - iCoverRight, 0, iCoverRight, 115);
|
||||
}
|
||||
if (iCoverBottom != 0) {
|
||||
oWebControl.JS_CuttingPartWindow(0, 115 - iCoverBottom, 180, iCoverBottom);
|
||||
}
|
||||
}
|
||||
|
||||
//视频预览功能
|
||||
$("#startPreview").click(function () {
|
||||
var cameraIndexCode = 'bbe9c64699174953828ce4fa8bb41b8f'; //获取输入的监控点编号值,必填
|
||||
var streamMode = 0; //主子码流标识:0-主码流,1-子码流
|
||||
var transMode = 1; //传输协议:0-UDP,1-TCP
|
||||
var gpuMode = 0; //是否启用GPU硬解,0-不启用,1-启用
|
||||
var wndId = -1; //播放窗口序号(在2x2以上布局下可指定播放窗口)
|
||||
|
||||
cameraIndexCode = cameraIndexCode.replace(/(^\s*)/g, "");
|
||||
cameraIndexCode = cameraIndexCode.replace(/(\s*$)/g, "");
|
||||
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "startPreview",
|
||||
argument: JSON.stringify({
|
||||
cameraIndexCode:cameraIndexCode, //监控点编号
|
||||
streamMode: streamMode, //主子码流标识
|
||||
transMode: transMode, //传输协议
|
||||
gpuMode: gpuMode, //是否开启GPU硬解
|
||||
wndId:wndId //可指定播放窗口
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
//停止全部预览
|
||||
$("#stopAllPreview").click(function () {
|
||||
oWebControl.JS_RequestInterface({
|
||||
funcName: "stopAllPreview"
|
||||
});
|
||||
});
|
||||
|
||||
// 标签关闭
|
||||
$(window).unload(function () {
|
||||
if (oWebControl != null){
|
||||
oWebControl.JS_HideWnd(); // 先让窗口隐藏,规避可能的插件窗口滞后于浏览器消失问题
|
||||
oWebControl.JS_Disconnect().then(function(){ // 断开与插件服务连接成功
|
||||
},
|
||||
function() { // 断开与插件服务连接失败
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -20,7 +20,7 @@
|
|||
<script type="text/javascript" src="./lib/mars3d/mars3d.js"></script>
|
||||
<link rel='stylesheet' type='text/css' href="./lib/mars3d/mars3d.css" />
|
||||
<link rel='stylesheet' type='text/css' href="./lib/Cesium/Widgets/widgets.css" />
|
||||
<title>费县森林防灭火数据管理系统</title>
|
||||
<title>平邑县森林防灭火数据管理系统</title>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/shp.min.js"></script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
const CONFIG = {
|
||||
// TITLE: (localStorage.getItem("areaCNName") || '费县') + "森林防灭火数据管理系统",
|
||||
TITLE:"费县森林防灭火数据管理系统",
|
||||
// TITLE: (localStorage.getItem("areaCNName") || '平邑县') + "森林防灭火数据管理系统",
|
||||
TITLE:"平邑县森林防灭火数据管理系统",
|
||||
LOGO_URL: "/images/img25.png",
|
||||
BASE_API: "127.0.0.1",
|
||||
MAPBOX_OPTIONS: {
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -37,3 +37,18 @@ export const getGeomData = (tableValue) => {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
export const addLayer = (data) => {
|
||||
return request({
|
||||
url: '/geoserver/createDataStore',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
// 下载shp
|
||||
export const downLoadShpZip = (tableValue) => {
|
||||
return request({
|
||||
url: '/geoserver/downLoadShpZip/'+ tableValue,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export const getLayerStyle = () => {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 样式编辑
|
||||
// 样式添加
|
||||
export const saveLayerStyle = (params) => {
|
||||
return request({
|
||||
url: '/geoserver/saveLayerStyle',
|
||||
|
|
@ -50,6 +50,36 @@ export const saveLayerStyle = (params) => {
|
|||
data: params
|
||||
})
|
||||
}
|
||||
// 样式编辑
|
||||
export const updateLayerStyle = (params) => {
|
||||
return request({
|
||||
url: '/geoserver/updateLayerStyle',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// 删除样式
|
||||
export const deleteLayerStyle = (tableName) => {
|
||||
return request({
|
||||
url: '/geoserver/deleteLayerStyle/' + tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 发布样式
|
||||
export const publishLayerPost = (params) => {
|
||||
return request({
|
||||
url: '/geoserver/publishLayer',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// 获取样式列表
|
||||
export const getLayerStyleAndType = () => {
|
||||
return request({
|
||||
url: '/geoserver/getLayerStyleAndType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 服务名校验
|
||||
export const checkServerName = (name) => {
|
||||
return request({
|
||||
|
|
@ -57,6 +87,16 @@ export const checkServerName = (name) => {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 表名效验
|
||||
export const checkTableName = (name) => {
|
||||
return request({
|
||||
url: '/geoserver/checkTableName/' + name,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 文件上传
|
||||
export const uploadFile = (formData) => {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export const createApplication = (data) => {
|
|||
// 获取树结构
|
||||
export const getApplicationInfo = () => {
|
||||
return request({
|
||||
url: '/applicationMars/getApplicationInfo',
|
||||
url: '/applicationMars/getApplicationInfo/'+localStorage.getItem('areaENName') ,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ export const applicationdelete = (id) => {
|
|||
//获取所有分类
|
||||
export const getProjectName = (id) => {
|
||||
return request({
|
||||
url: '/applicationMars/getProjectName',
|
||||
url: '/applicationMars/getProjectName/'+localStorage.getItem('areaENName'),
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
@ -100,4 +100,19 @@ export const getGeomData = (tableValue) => {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获取
|
||||
export const getShpRelation = (tableName) => {
|
||||
return request({
|
||||
url: '/geoserver/getShpRelation/'+ tableName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 获取字段值
|
||||
export const getColumnByName = (data) => {
|
||||
return request({
|
||||
url: '/geoserver/getColumnByName',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,34 @@ export const addGrid = (data) =>{
|
|||
data: data
|
||||
})
|
||||
}
|
||||
export const editGrid = (data) =>{
|
||||
return request({
|
||||
url: '/api/Grid/EditGrid',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export const DeleteGrid = (data)=>{
|
||||
return request({
|
||||
url: '/api/Grid/DeleteGrid',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
export const getGridUserInfo = (data)=>{
|
||||
return request({
|
||||
url: '/api/Grid/LoadGridById',
|
||||
method: 'post',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
export const getWGYTypes = (data)=>{
|
||||
return request({
|
||||
url: '/api/Grid/GetWGYTypes',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,28 @@
|
|||
export const globalApi = {
|
||||
// 本地测试
|
||||
// BASE_URL: "http://192.168.10.136:8909", //测试 卢国栋
|
||||
// GEOSERVER_URL: "http://192.168.10.136:8180",
|
||||
// netBASE_URL: "http://123.132.248.154:9111", //测试.net
|
||||
// BASE_URL: "http://192.168.10.116:8909", //测试 卢国栋
|
||||
// GEOSERVER_URL: "http://192.168.10.116:8909",
|
||||
// netBASE_URL: "https://py.hopetrytech.com:7001", //测试.net
|
||||
|
||||
// 测试服务器
|
||||
BASE_URL: "http://123.132.248.154:9217", //测试 服务器
|
||||
GEOSERVER_URL:"http://123.132.248.154:9205",
|
||||
netBASE_URL: "http://123.132.248.154:9224", //测试.net
|
||||
// BASE_URL: "http://123.132.248.154:9217", //测试 服务器
|
||||
// GEOSERVER_URL:"http://123.132.248.154:9205",
|
||||
// netBASE_URL: "http://123.132.248.154:9224", //测试.net
|
||||
|
||||
|
||||
// 1240 测试服务器
|
||||
BASE_URL: "http://123.132.248.154:9236", //测试 服务器
|
||||
GEOSERVER_URL:"http://123.132.248.154:9235",
|
||||
netBASE_URL: "http://123.132.248.154:9231", //测试.net
|
||||
|
||||
|
||||
//正式环境
|
||||
// BASE_URL: "http://223.99.16.253:9006", // java
|
||||
// GEOSERVER_URL:"http://223.99.16.253:9007", // geoserver
|
||||
// netBASE_URL: "http://223.99.16.253:9001", //.net
|
||||
|
||||
// BASE_URL: "https://fx.hopetrytech.com:7006/", // java
|
||||
// GEOSERVER_URL:"https://fx.hopetrytech.com:7005", // geoserver
|
||||
// netBASE_URL: "https://py.hopetrytech.com:7001", //.net
|
||||
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -57,7 +57,7 @@ export const constantRoutes = [
|
|||
},{
|
||||
path: "/monitor",
|
||||
name: "monitor",
|
||||
show: true,//在导航栏是否显示
|
||||
show: false,//在导航栏是否显示
|
||||
component: () => import('@/views/monitor/index'),
|
||||
meta: { name: "监控中心", iconfont: "/images/img7.png" },
|
||||
},{
|
||||
|
|
@ -73,13 +73,13 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/data_manage/yangshi'),
|
||||
meta: { name: "样式配置", iconfont: "/images/img6.png" },
|
||||
},
|
||||
// {
|
||||
// path: "/grid",
|
||||
// name: "Grid",
|
||||
// show: true,//在导航栏是否显示
|
||||
// component: () => import('@/views/grid'),
|
||||
// meta: { name: "网格员管理", iconfont: "/images/img9.png" },
|
||||
// },
|
||||
{
|
||||
path: "/grid",
|
||||
name: "Grid",
|
||||
show: true,//在导航栏是否显示
|
||||
component: () => import('@/views/grid'),
|
||||
meta: { name: "网格员管理", iconfont: "/images/img9.png" },
|
||||
},
|
||||
{
|
||||
path: "/burst-upload",
|
||||
name: "NewBurstUpload",
|
||||
|
|
@ -108,6 +108,13 @@ export const constantRoutes = [
|
|||
show: true,//在导航栏是否显示
|
||||
meta: { name: "应用管理", iconfont: "/images/img9.png" },
|
||||
},
|
||||
{
|
||||
path: "/layer_style",
|
||||
name: "layer_style",
|
||||
component: () => import('@/views/layer_style/layer'),
|
||||
show: true,//在导航栏是否显示
|
||||
meta: { name: "图层样式", iconfont: "/images/img10.png" },
|
||||
},
|
||||
{
|
||||
path: "/mars3dcopy",
|
||||
name: "mars3dcopy",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,565 @@
|
|||
<template>
|
||||
<div class="form-container">
|
||||
<div
|
||||
style="height:50px;margin-bottom:40px;font-size:18px;color:#fff;font-weight:bold;border-bottom:1px solid rgba(255,255,255,0.1);">
|
||||
<span style="font-weight:1000;font-size:20px;cursor:pointer;"
|
||||
@click="$router.push({'path':'/upload_type_selected'})"><i class="el-icon el-icon-back"></i></span>
|
||||
导入Excel数据
|
||||
</div>
|
||||
<div class="title">
|
||||
<el-steps :active="currentStep" align-center>
|
||||
<el-step title="文件上传" description="选择Excel格式模板文件并配置服务基础信息"></el-step>
|
||||
<el-step title="信息配置" description="根据中文字段名称配置英文注释用于服务发布"></el-step>
|
||||
<el-step title="创建完成" description="服务创建完成在服务列表中查看服务"></el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div class="first-step" v-if="currentStep == 1">
|
||||
<div class="upload-iocn-box">
|
||||
<div class="upload-icon-bg2"></div>
|
||||
<div class="upload-icon-bg">
|
||||
<p class="upload-iocn">
|
||||
<img src="/images/upload.png" alt="">
|
||||
</p>
|
||||
<p class="upload-icon-text">只能选择后缀(.xlsx)格式模板文件<br />(文件大小不能超过100MB)</p>
|
||||
<p>
|
||||
<el-upload class="upload-demo" :action="''" :on-preview="handlePreview"
|
||||
:before-upload="beforeUpload" multiple :limit="3" :on-exceed="handleExceed"
|
||||
:file-list="fileList">
|
||||
<el-button size="small" type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</p>
|
||||
<p style="margin-top:10px;color:#ccc;">{{file ? file.name : null}}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-box">
|
||||
<el-form ref="forms" :model="form" :rules="rules" label-width="120px" size="small">
|
||||
<el-form-item label="服务名称" prop="serverName">
|
||||
<el-input placeholder="请输入服务名称" style="width: 360px" v-model="form.serverName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间参考" label-width="" prop="spaceType">
|
||||
<el-select style="width: 360px;" v-model="form.spaceType" placeholder="请选择空间参考">
|
||||
<el-option v-for="(item, index) in getDictone" :key="index" :label="item.dictlabel"
|
||||
:value="item.dictlabel"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top:165px;text-align:right;">
|
||||
<el-button type="default" @click="$router.push({'path':'/upload_type_selected'})">取消</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-check" @click.native="onSubmit('form')">创建
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="second-step" v-if="currentStep == 2">
|
||||
<div class="btn-container">
|
||||
<el-button type="primary" size="large" icon="el-icon-download" @click.native="downloadTemplate"
|
||||
style="margin-right: 10px;">模板下载
|
||||
</el-button>
|
||||
<el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/"
|
||||
:file-list="fileListImport" :show-file-list="false" :before-upload="beforeUploadImport">
|
||||
<el-button type="primary" size="large" icon="el-icon-upload">导入
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<el-table :data="tableHeader" height="320" border size="mini" style="width: 100%">
|
||||
|
||||
<el-table-column prop="name" label="原始字段名称" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="数据类型" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="length" label="数据长度">
|
||||
</el-table-column>
|
||||
<el-table-column label="英文名称">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.en_name" size="mini"></el-input>
|
||||
<p style="color:#ff0000;font-size:12px;" v-if="!regExp.test(scope.row.en_name)">
|
||||
使用小写字母、数字、下划线的组合</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="中文注释">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.cn_name" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="删除">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-delete" type="warning" @click="delColumn(scope)">
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div style="text-align:right;position:absolute;bottom:20px;width: calc( 100% - 160px);">
|
||||
<el-button type="default" size="large" @click="$router.push({'path':'/upload_type_selected'})">取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="large" icon="el-icon-check" @click.native="createService">创建
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="third-step" v-if="currentStep == 3">
|
||||
<el-result icon="success" title="服务创建成功" subTitle="服务创建成功,请在服务列表中心查看服务">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="medium" @click="$router.push({'path':'/ServiceList'})">服务列表
|
||||
</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios';
|
||||
import { getMethodCommon, postMethodCommon } from '../../api/Api';
|
||||
import { globalApi } from '../../api/urlPatterns.js';
|
||||
export default {
|
||||
name: 'data_upload',
|
||||
data() {
|
||||
return {
|
||||
headers: {
|
||||
Authorization: localStorage.getItem("X-Token") || "",
|
||||
},
|
||||
form: {
|
||||
serverName: null,
|
||||
|
||||
},
|
||||
getDictone: [
|
||||
{
|
||||
"dictvalue": "1",
|
||||
"dictlabel": "EPSG:4326"
|
||||
},
|
||||
{
|
||||
"dictvalue": "2",
|
||||
"dictlabel": "EPSG:3857"
|
||||
}
|
||||
],
|
||||
rules: {
|
||||
serverName: [
|
||||
{ required: true, message: '请输入服务名称', trigger: 'blur' },
|
||||
],
|
||||
spaceType: [
|
||||
{ required: true, message: '请选择参考系', trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
fileList: [],
|
||||
file: null,
|
||||
currentStep: 1,
|
||||
tableHeader: [],
|
||||
regExp: /^[a-z0-9_]+$/,
|
||||
fileListImport: [],
|
||||
fileImport: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 下载模板
|
||||
downloadTemplate() {
|
||||
window.location.href = globalApi.BASE_URL + '/geoserver/downloadColumn/' + this.tableName
|
||||
},
|
||||
delColumn(scope) {
|
||||
this.tableHeader.splice(scope.$index, 1);
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log("file222", file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
console.log("files", files);
|
||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`);
|
||||
},
|
||||
beforeUploadImport(file) {
|
||||
console.log(file)
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
let _this = this;
|
||||
axios.post(globalApi.BASE_URL + '/geoserver/uploadModelData', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
'Authorization': localStorage.getItem("X-Token") || "",
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
console.log(res)
|
||||
var list = res.data.data.data
|
||||
console.log(list)
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
for (var j = 0; j < _this.tableHeader.length; j++) {
|
||||
if (list[i].name0 == _this.tableHeader[j].name) {
|
||||
_this.tableHeader[j].en_name = list[i].name1
|
||||
_this.tableHeader[j].cn_name = list[i].name2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
beforeUpload(file) {
|
||||
console.log(file);
|
||||
this.file = file;
|
||||
let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
|
||||
let size = file.size / 1024 / 1024;
|
||||
if (extension !== 'xlsx') {
|
||||
this.$message.warning('只能上传后缀是.xlsx的文件')
|
||||
return false
|
||||
}
|
||||
if (size > 100) {
|
||||
this.$message.warning('文件大小不得超过100M')
|
||||
return false
|
||||
}
|
||||
return false
|
||||
},
|
||||
handleFileChange(file, fileList) {
|
||||
let f = { ...file }
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
if (this.file == null) {
|
||||
this.$message({ type: "warning", message: "请选择文件!" })
|
||||
return false;
|
||||
}
|
||||
|
||||
this.$refs['forms'].validate((valid) => {
|
||||
if (valid) {
|
||||
let formData = new FormData();
|
||||
formData.append("file", this.file);
|
||||
formData.append("serverName", this.form.serverName)
|
||||
formData.append("spaceType", this.form.spaceType)
|
||||
let _this = this;
|
||||
axios.post(globalApi.BASE_URL + '/geoserver/uploadExcelFile', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
'Authorization': localStorage.getItem("X-Token") || "",
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
|
||||
_this.tableName = res.data.data.tableName;
|
||||
let arr = res.data.data.heads;
|
||||
_this.tableHeader = [];
|
||||
var relation = res.data.data.relation
|
||||
arr.forEach((item, index) => {
|
||||
|
||||
let obj = {
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
length: item.length,
|
||||
en_name: item.name.toLowerCase(),
|
||||
cn_name: relation[item.name]
|
||||
}
|
||||
_this.tableHeader.push(obj);
|
||||
})
|
||||
_this.currentStep = 2;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
createService() {
|
||||
// 英文字段验证
|
||||
let valid = [];
|
||||
this.tableHeader.forEach((item, index) => {
|
||||
let isEn = this.regExp.test(item.en_name);
|
||||
valid.push(isEn);
|
||||
})
|
||||
let isEn = valid.find((item, index) => {
|
||||
return item != true;
|
||||
})
|
||||
|
||||
if (isEn == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
let _this = this;
|
||||
let headerJsonString = {};
|
||||
let newHeader = [];
|
||||
this.tableHeader.forEach((item, index) => {
|
||||
|
||||
|
||||
headerJsonString[item.en_name] = item.cn_name;
|
||||
let obj = {
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
length: item.length,
|
||||
refName: item.en_name,
|
||||
initName:item.cn_name
|
||||
}
|
||||
newHeader.push(obj);
|
||||
|
||||
})
|
||||
let formData = {
|
||||
dataType: "点",
|
||||
severType: "矢量",
|
||||
spaceType: this.form.spaceType,
|
||||
tableName: this.tableName,
|
||||
newHeads: newHeader,
|
||||
styleName: null,
|
||||
serverName: this.form.serverName,
|
||||
refRelation: JSON.stringify(headerJsonString),
|
||||
areaName: localStorage.getItem("areaName"),
|
||||
}
|
||||
|
||||
|
||||
postMethodCommon("/geoserver/saveData", formData).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
getMethodCommon("/geoserver/publishLayer/" + _this.tableName).then(response => {
|
||||
_this.$message({
|
||||
type: "success",
|
||||
message: "上传服务成功"
|
||||
})
|
||||
_this.currentStep = 3;
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
console.log("response", response);
|
||||
this.tableName = response.msg;
|
||||
},
|
||||
deleateColumn(scope) {
|
||||
console.log(scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
width: 1200px;
|
||||
padding: 20px 20px;
|
||||
height: 700px;
|
||||
background: #162258;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 140px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
text-indent: 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-dragger {
|
||||
background: none;
|
||||
border: 1px solid #108eff;
|
||||
color: #fff;
|
||||
margin: 20px auto;
|
||||
width: 400px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-dragger .el-upload__text {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-list__item-name {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
::v-deep .el-input__inner {
|
||||
background: none;
|
||||
border-radius: 0px;
|
||||
border-color: #108eff;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.form-box {
|
||||
width: calc(50% - 100px);
|
||||
height: calc(100% - 280px);
|
||||
float: left;
|
||||
margin-left: 100px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 1040px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.btn-container {
|
||||
width: 1040px;
|
||||
margin: 0px auto;
|
||||
text-align: right;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.upload-iocn-box {
|
||||
width: calc(50% - 280px);
|
||||
height: calc(100% - 380px);
|
||||
float: left;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
background: #162258;
|
||||
margin-top: 25px;
|
||||
margin-left: 120px;
|
||||
}
|
||||
|
||||
.upload-icon-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background: #162258;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.upload-iocn-box::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: -3px;
|
||||
z-index: 1;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.upload-iocn-box::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-icon-bg2::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-icon-bg2::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-iocn-box img {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.upload-iocn {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.upload-icon-text {
|
||||
font-size: 12px;
|
||||
color: #ccc;
|
||||
margin: 20px 0px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.upload-iocn-file-name {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
::v-deep .el-button {
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-step__icon-inner {
|
||||
text-align: center;
|
||||
text-indent: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-step__title.is-process {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-step__description.is-process {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-table {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {}
|
||||
|
||||
::v-deep .el-form-item {
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
::v-deep .el-result__title p {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-result__subtitle p {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-table td.el-table__cell,
|
||||
.el-table th.el-table__cell.is-leaf {}
|
||||
|
||||
::v-deep .el-table th.el-table__cell {
|
||||
background: #162258;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-table tr {
|
||||
background: #162258;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-table .el-table__body tr:hover>td {
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table .el-table__body tr.current-row>td {
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,625 @@
|
|||
<template>
|
||||
<div class="form-container" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)">
|
||||
<div style="
|
||||
height: 50px;
|
||||
margin-bottom: 40px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
">
|
||||
<span style="font-weight: 1000; font-size: 20px; cursor: pointer"
|
||||
@click="$router.push({ path: '/upload_type_selected' })"><i class="el-icon el-icon-back"></i></span>
|
||||
导入ShpFile数据
|
||||
</div>
|
||||
<div class="title">
|
||||
<el-steps :active="currentStep" align-center>
|
||||
<el-step title="文件上传" description="选择ShpFile格式模板文件并配置服务基础信息"></el-step>
|
||||
<el-step title="信息配置" description="根据中文字段名称配置英文注释用于服务发布"></el-step>
|
||||
<el-step title="创建完成" description="服务创建完成在服务列表中查看服务"></el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
<div class="first-step" v-if="currentStep == 1">
|
||||
<div class="upload-iocn-box">
|
||||
<div class="upload-icon-bg2"></div>
|
||||
<div class="upload-icon-bg">
|
||||
<p class="upload-iocn">
|
||||
<img src="/images/upload.png" alt="" />
|
||||
</p>
|
||||
<p class="upload-icon-text">
|
||||
只能选择后缀(.zip)格式压缩文件<br />(文件大小不能超过50MB)
|
||||
</p>
|
||||
<p>
|
||||
<el-upload class="upload-demo" :action="''" :on-preview="handlePreview" :before-upload="beforeUpload"
|
||||
multiple :limit="3" :on-exceed="handleExceed" :file-list="fileList">
|
||||
<el-button size="small" type="primary">选择文件</el-button>
|
||||
</el-upload>
|
||||
</p>
|
||||
<p style="margin-top: 10px; color: #ccc">
|
||||
{{ file ? file.name : null }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-box">
|
||||
<el-form ref="forms" :model="form" :rules="rules" label-width="120px" size="small">
|
||||
<el-form-item label="服务名称" prop="serverName">
|
||||
<el-input placeholder="请输入服务名称" style="width: 360px" v-model="form.serverName" @change="servernameChange">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间参考" prop="spaceType">
|
||||
<el-select style="width: 360px" v-model="form.spaceType" placeholder="请选择空间参考">
|
||||
<el-option v-for="(item, index) in getDictone" :key="index" :label="item.dictlabel"
|
||||
:value="item.dictlabel"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务类型" prop="severType">
|
||||
<el-select style="width: 360px" v-model="form.severType" placeholder="请选择服务类型">
|
||||
<el-option v-for="(item, index) in getDicttwo" :key="index" :label="item.dictlabel"
|
||||
:value="item.dictlabel"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="图层样式">
|
||||
<el-select v-model="form.styleName" style="width: 280px" placeholder="请选择图层样式">
|
||||
<el-option v-for="(value, key) in getDictthree" :key="key" :label="value" :value="value"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="createStyle">创建样式</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item style="margin-top: 60px; text-align: right">
|
||||
<el-button type="default" @click="$router.push({ path: '/upload_type_selected' })">取消</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-check" @click.native="onSubmit('form')">创建</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-step" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
|
||||
element-loading-background="rgba(0, 0, 0, 0.8)" v-if="currentStep == 2">
|
||||
<div class="btn-container">
|
||||
<el-button type="primary" size="large" icon="el-icon-download" @click.native="downloadTemplate" style="margin-right: 10px;">模板下载</el-button>
|
||||
<el-upload class="upload-demo" action="https://jsonplaceholder.typicode.com/posts/" :file-list="fileListImport"
|
||||
:show-file-list="false" :before-upload="beforeUploadImport">
|
||||
<el-button type="primary" size="large" icon="el-icon-upload">导入
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div class="table-container">
|
||||
<el-table :data="tableHeader" height="320" border size="mini" style="width: 100%">
|
||||
<el-table-column prop="name" label="原始字段名称" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="数据类型" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="length" label="数据长度"> </el-table-column>
|
||||
<el-table-column label="英文名称">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.en_name" size="mini"></el-input>
|
||||
<p style="color: #ff0000; font-size: 12px" v-if="!regExp.test(scope.row.en_name)">
|
||||
使用小写字母、数字、下划线的组合
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="中文注释">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.cn_name" size="mini"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="删除">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" icon="el-icon-delete" type="warning" @click="delColumn(scope)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div style="
|
||||
text-align: right;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
width: calc(100% - 160px);
|
||||
">
|
||||
<el-button type="default" size="large" @click="$router.push({ path: '/upload_type_selected' })">取消</el-button>
|
||||
<el-button type="primary" size="large" icon="el-icon-check" @click.native="createService">创建</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="third-step" v-if="currentStep == 3">
|
||||
<el-result icon="success" title="服务创建成功" subTitle="服务创建成功,请在服务列表中心查看服务">
|
||||
<template slot="extra">
|
||||
<el-button type="primary" size="medium" @click="$router.push({ path: '/ServiceList' })">服务列表</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
</div>
|
||||
|
||||
<StyleConfig @yschange="styleUpdate" v-if="StyleConfigShow"></StyleConfig>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { getMethodCommon, postMethodCommon } from "../../api/Api";
|
||||
import { globalApi } from "../../api/urlPatterns.js";
|
||||
import StyleConfig from "../data_manage/yangshi";
|
||||
import {
|
||||
getDictone,
|
||||
getDicttwo,
|
||||
getLayerStyle,
|
||||
checkServerName,
|
||||
uploadFile,
|
||||
} from "../../api/datamange";
|
||||
|
||||
export default {
|
||||
name: "data_upload",
|
||||
components: {
|
||||
StyleConfig,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
StyleConfigShow: false,
|
||||
headers: {
|
||||
Authorization: localStorage.getItem("X-Token") || "",
|
||||
},
|
||||
form: {
|
||||
serverName: null,
|
||||
},
|
||||
rules: {
|
||||
serverName: [
|
||||
{ required: true, message: "请输入服务名称", trigger: "blur" },
|
||||
],
|
||||
spaceType: [
|
||||
{ required: true, message: "请选择参考系", trigger: "blur" },
|
||||
],
|
||||
severType: [
|
||||
{ required: true, message: "请输选择服务类型", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
getDictone: [],
|
||||
getDicttwo: [],
|
||||
getDictthree: [],
|
||||
fileList: [],
|
||||
file: null,
|
||||
currentStep: 1,
|
||||
tableHeader: [],
|
||||
regExp: /^[a-z0-9_]+$/,
|
||||
fileListImport: [],
|
||||
fileImport: null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
getDictone().then((res) => {
|
||||
this.getDictone = res.data.data;
|
||||
});
|
||||
getDicttwo().then((res) => {
|
||||
this.getDicttwo = res.data.data;
|
||||
});
|
||||
getLayerStyle().then((res) => {
|
||||
this.getDictthree = res.data.data.style.names;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 下载模板
|
||||
downloadTemplate() {
|
||||
window.location.href = globalApi.BASE_URL + '/geoserver/downloadColumn/' + this.tableName
|
||||
},
|
||||
//校验服务名
|
||||
servernameChange() {
|
||||
checkServerName(this.form.serverName).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (res.data.data > 0) {
|
||||
this.$message.error("服务名称已存在,请重新输入");
|
||||
this.form.serverName = "";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
delColumn(scope) {
|
||||
this.tableHeader.splice(scope.$index, 1);
|
||||
},
|
||||
styleUpdate() {
|
||||
getLayerStyle().then((res) => {
|
||||
this.getDictthree = res.data.data.style.names;
|
||||
});
|
||||
|
||||
this.StyleConfigShow = false;
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(
|
||||
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length
|
||||
} 个文件`
|
||||
);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`);
|
||||
},
|
||||
beforeUploadImport(file) {
|
||||
console.log(file)
|
||||
let formData = new FormData();
|
||||
formData.append("file", file);
|
||||
let _this = this;
|
||||
axios.post(globalApi.BASE_URL + '/geoserver/uploadModelData', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
'Authorization': localStorage.getItem("X-Token") || "",
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
console.log(res)
|
||||
var list = res.data.data.data
|
||||
console.log(list)
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
for (var j = 0; j < _this.tableHeader.length; j++) {
|
||||
if (list[i].name0 == _this.tableHeader[j].name) {
|
||||
_this.tableHeader[j].en_name = list[i].name1
|
||||
_this.tableHeader[j].cn_name = list[i].name2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeUpload(file) {
|
||||
console.log(file);
|
||||
this.file = file;
|
||||
let extension = file.name.substring(file.name.lastIndexOf(".") + 1);
|
||||
let size = file.size / 1024 / 1024;
|
||||
if (extension !== "zip") {
|
||||
this.$message.warning("只能上传后缀是.zip的文件");
|
||||
return false;
|
||||
}
|
||||
if (size > 100) {
|
||||
this.$message.warning("文件大小不得超过100M");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
handleFileChange(file, fileList) {
|
||||
let f = { ...file };
|
||||
},
|
||||
|
||||
onSubmit() {
|
||||
this.loading = true;
|
||||
if (this.file == null) {
|
||||
this.$message({ type: "warning", message: "请选择文件!" });
|
||||
return false;
|
||||
}
|
||||
this.$refs["forms"].validate((valid) => {
|
||||
if (valid) {
|
||||
let formData = new FormData();
|
||||
formData.append("file", this.file);
|
||||
formData.append("serverName", this.form.serverName);
|
||||
formData.append("spaceType", this.form.spaceType);
|
||||
formData.append("severType", this.form.severType);
|
||||
let _this = this;
|
||||
// axios
|
||||
// .post(globalApi.BASE_URL + "/geoserver/uploadFile", formData, {
|
||||
// headers: {
|
||||
// "Content-Type": "multipart/form-data",
|
||||
// Authorization: localStorage.getItem("X-Token") || "",
|
||||
// },
|
||||
// })
|
||||
uploadFile(formData)
|
||||
.then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.loading = false;
|
||||
_this.tableName = res.data.data.tableName;
|
||||
_this.form.dataType = res.data.data.dataType;
|
||||
let arr = res.data.data.heads;
|
||||
_this.tableHeader = [];
|
||||
arr.forEach((item, index) => {
|
||||
let obj = {
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
length: item.length,
|
||||
en_name: item.name.toLowerCase(),
|
||||
cn_name: item.name,
|
||||
};
|
||||
_this.tableHeader.push(obj);
|
||||
});
|
||||
_this.currentStep = 2;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
// 报错
|
||||
this.loading = false;
|
||||
// console.log(err);
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
createService() {
|
||||
this.loading = true;
|
||||
let valid = [];
|
||||
this.tableHeader.forEach((item, index) => {
|
||||
let isEn = this.regExp.test(item.en_name);
|
||||
valid.push(isEn);
|
||||
});
|
||||
let isEn = valid.find((item, index) => {
|
||||
return item != true;
|
||||
});
|
||||
|
||||
if (isEn == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
let _this = this;
|
||||
let headerJsonString = {};
|
||||
let newHeader = [];
|
||||
this.tableHeader.forEach((item, index) => {
|
||||
headerJsonString[item.en_name.toLowerCase()] = item.cn_name;
|
||||
let obj = {
|
||||
name: item.name,
|
||||
type: item.type,
|
||||
length: item.length,
|
||||
refName: item.en_name,
|
||||
initName:item.cn_name
|
||||
};
|
||||
newHeader.push(obj);
|
||||
});
|
||||
|
||||
let formData = {
|
||||
dataType: this.form.dataType,
|
||||
severType: this.form.severType,
|
||||
spaceType: this.form.spaceType,
|
||||
tableName: this.tableName,
|
||||
newHeads: newHeader,
|
||||
styleName: this.form.styleName,
|
||||
serverName: this.form.serverName,
|
||||
refRelation: JSON.stringify(headerJsonString),
|
||||
areaName: localStorage.getItem('areaName')
|
||||
};
|
||||
|
||||
postMethodCommon("/geoserver/saveData", formData)
|
||||
.then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
getMethodCommon("/geoserver/publishLayer/" + _this.tableName).then(
|
||||
(response) => {
|
||||
this.loading = false;
|
||||
_this.$message({
|
||||
type: "success",
|
||||
message: "上传服务成功",
|
||||
});
|
||||
_this.currentStep = 3;
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
// console.log(err);
|
||||
// this.$message.error(err);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
console.log("response", response);
|
||||
this.tableName = response.msg;
|
||||
},
|
||||
createStyle() {
|
||||
this.StyleConfigShow = true;
|
||||
// this.$router.push({'path':'/layer_style_config'})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.form-container {
|
||||
width: 1200px;
|
||||
padding: 20px 20px;
|
||||
height: 700px;
|
||||
background: #162258;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 160px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
text-indent: 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-dragger {
|
||||
background: none;
|
||||
border: 1px solid #108eff;
|
||||
color: #fff;
|
||||
margin: 20px auto;
|
||||
width: 400px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-dragger .el-upload__text {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-upload-list__item-name {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
::v-deep .el-input__inner {
|
||||
background: none;
|
||||
border-radius: 0px;
|
||||
border-color: #108eff;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.form-box {
|
||||
width: calc(50% - 100px);
|
||||
height: calc(100% - 280px);
|
||||
float: left;
|
||||
margin-left: 100px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
width: 1040px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.btn-container {
|
||||
width: 1040px;
|
||||
margin: 0px auto;
|
||||
text-align: right;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.upload-iocn-box {
|
||||
width: calc(50% - 280px);
|
||||
height: calc(100% - 380px);
|
||||
float: left;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
background: #162258;
|
||||
margin-top: 25px;
|
||||
margin-left: 120px;
|
||||
}
|
||||
|
||||
.upload-icon-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background: #162258;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.upload-iocn-box::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: -3px;
|
||||
z-index: 1;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.upload-iocn-box::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-icon-bg2::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-icon-bg2::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #108eff;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-iocn-box img {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.upload-iocn {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.upload-icon-text {
|
||||
font-size: 14px;
|
||||
color: #ccc;
|
||||
margin: 20px 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-button {
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-step__icon-inner {
|
||||
text-align: center;
|
||||
text-indent: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-step__title.is-process {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-step__description.is-process {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-table {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {}
|
||||
|
||||
::v-deep .el-form-item {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
::v-deep .el-result__title p {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-result__subtitle p {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-table td.el-table__cell,
|
||||
.el-table th.el-table__cell.is-leaf {}
|
||||
|
||||
::v-deep .el-table th.el-table__cell {
|
||||
background: #162258;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-table tr {
|
||||
background: #162258;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-table .el-table__body tr:hover>td {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table .el-table__body tr.current-row>td {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -25,7 +25,7 @@
|
|||
<div class="layer-container">
|
||||
<div class="layer-button" @click="toggleLayer('tiandituzhuji')" :style="{'background':layerShow['tiandituzhuji'] == 'visible'?'#108eff':'none','color':layerShow['tiandituzhuji'] == 'visible'?'#fff':'#108eff'}"> <i class="el-icon el-icon-circle-check"></i> 电子底图</div>
|
||||
<div class="layer-button" @click="toggleLayer('gaoqingyingxiang')" :style="{'background':layerShow['gaoqingyingxiang'] == 'visible'?'#108eff':'none','color':layerShow['gaoqingyingxiang'] == 'visible'?'#fff':'#108eff'}"> <i class="el-icon el-icon-circle-check"></i> 高清影像</div>
|
||||
<div class="layer-button" @click="toggleLayer('xianjie')" :style="{'background':layerShow['xianjie'] == 'visible'?'#108eff':'none','color':layerShow['xianjie'] == 'visible'?'#fff':'#108eff'}"> <i class="el-icon el-icon-circle-check"></i> 费县县界</div>
|
||||
<div class="layer-button" @click="toggleLayer('xianjie')" :style="{'background':layerShow['xianjie'] == 'visible'?'#108eff':'none','color':layerShow['xianjie'] == 'visible'?'#fff':'#108eff'}"> <i class="el-icon el-icon-circle-check"></i> 平邑县县界</div>
|
||||
</div>
|
||||
<div id="mapEditorContainer" class="map-container">
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
|||
const validateMobile = function (rule, value, callback) {
|
||||
let newValue = value.replace(/[^0-9]/gi, '')
|
||||
if (value !== newValue) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else if (newValue.length !== 11) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const validID = function(rule, value, callback) {
|
||||
// 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
|
||||
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正确的身份证号码"));
|
||||
}
|
||||
}
|
||||
var validateStock = (rule, value, callback) => {
|
||||
if (!value || value == 0) {
|
||||
callback(new Error("不能为空"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
export { validateMobile ,validID,validateStock}
|
||||
|
|
@ -0,0 +1,696 @@
|
|||
<template>
|
||||
<div class="grid-container">
|
||||
<div class="operate-container">
|
||||
<!-- <el-input type="text" size="mini" style="width:300px;margin-right:14px;" placeholder='请输入搜索关键字'></el-input> -->
|
||||
<!-- <el-button icon="el-icon-search" size="mini" type="default">查询</el-button> -->
|
||||
<el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialog">添加</el-button>
|
||||
<el-button icon="el-icon-edit" size="mini" type="primary" @click="createDialog">编辑</el-button>
|
||||
<el-button icon="el-icon-delete" size="mini" type="danger" @click="deleteWg">删除</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData" size="mini" height=" " border style="width: 100%;height: 65%; background: rgb(26, 39, 75);;"
|
||||
@selection-change="handleSelectionChange">
|
||||
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="styleName" label="样式名称">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="typeName" label="数据格式">
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!-- <div class="page-container">
|
||||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||
:current-page="listQuery.pageNum" :page-sizes="[20,50,100, 200, 300, 400]"
|
||||
:page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||
</el-pagination>
|
||||
</div> -->
|
||||
<el-dialog :title="titleStr" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
||||
<!-- ------------------------------------------- -- 配置页------------------------------------------------------------------------------- -->
|
||||
<div class="tuceng_ys">
|
||||
<div class="tuceng_ys_son">
|
||||
<el-form ref="forms" :model="form" label-width="80px" size="mini">
|
||||
<template v-if="typeName == 'add'">
|
||||
<el-form-item label="样式名称">
|
||||
<el-input style="width: 300px" v-model="form.styleName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式">
|
||||
<el-select style="width: 300px" v-model="form.type" placeholder="请选择数据格式">
|
||||
<el-option label="线" value="1"></el-option>
|
||||
<el-option label="面" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-form-item label="样式名称">
|
||||
<el-input style="width: 300px" v-model="form.styleName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据格式">
|
||||
<el-input style="width: 300px" v-model="form.typeName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
|
||||
<el-form-item v-show="form.type == 2" label="填充颜色">
|
||||
<el-color-picker v-model="form.fillColor"></el-color-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type == 2" label="透明度">
|
||||
<el-input style="width: 300px" v-model="form.fillOpacity"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type == 2 || form.type == 1" label="线条颜色">
|
||||
<el-color-picker v-model="form.strokeColor"></el-color-picker>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type == 2 || form.type == 1" label="线条宽度">
|
||||
<el-input style="width: 300px" v-model="form.strokeWidth"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit" v-if="typeName == 'add'">创建</el-button>
|
||||
<el-button type="primary" @click="onCreate" v-else>编辑</el-button>
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMethodCommon } from '../../api/Api'
|
||||
import { saveLayerStyle,getLayerStyleAndType ,deleteLayerStyle,updateLayerStyle} from "../../api/datamange";
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
data() {
|
||||
return {
|
||||
titleStr: '添加',
|
||||
rules: {
|
||||
|
||||
},
|
||||
dialogVisible: false,
|
||||
total: 100,
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
},
|
||||
data: null,
|
||||
defaultProps: {
|
||||
children: 'child',
|
||||
label: 'areaName'
|
||||
},
|
||||
tableData: [
|
||||
{
|
||||
name: "样式一",
|
||||
geshi: '面',
|
||||
toumingdu: '0.1',
|
||||
tianchong: '0.1',
|
||||
kuandu: '0.1',
|
||||
yanse: '0.1',
|
||||
}
|
||||
],
|
||||
checkTreeId: null,
|
||||
selectIdList: [],
|
||||
WGYTypesList: [],
|
||||
typeName: 'add',
|
||||
form: {
|
||||
type: "1",
|
||||
styleName: "",
|
||||
fillColor: "",
|
||||
fillOpacity: "",
|
||||
strokeColor: "",
|
||||
strokeWidth: "",
|
||||
},
|
||||
selectItem:[]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
getLayerStyleAndType().then((res) => {
|
||||
console.log(res)
|
||||
var list = res.data.data.data
|
||||
list.forEach(element => {
|
||||
element.typeName = element.type == 1 ? '线' : '面'
|
||||
});
|
||||
this.tableData= list;
|
||||
});
|
||||
},
|
||||
onSubmit() {
|
||||
// console.log(this.form);
|
||||
var _this = this
|
||||
if (!/[\u4E00-\u9FA5]/g.test(this.form.styleName)) {
|
||||
saveLayerStyle(this.form).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success("创建成功");
|
||||
this.dialogVisible = false
|
||||
_this.getList()
|
||||
} else {
|
||||
this.$message.error("创建失败");
|
||||
}
|
||||
// console.log(res);
|
||||
});
|
||||
} else {
|
||||
this.$message.error('不能输入中文')
|
||||
}
|
||||
},
|
||||
handleSizeChange(e) {
|
||||
this.listQuery.pageSize = e;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(e) {
|
||||
this.listQuery.pageNum = e;
|
||||
this.getList();
|
||||
},
|
||||
submitForm() {
|
||||
var _this = this
|
||||
console.log(this.ruleForm)
|
||||
this.ruleForm.pId = this.checkTreeId
|
||||
this.ruleForm.households = Number(this.ruleForm.households)
|
||||
this.ruleForm.peopleNum = Number(this.ruleForm.peopleNum)
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
addGrid(_this.ruleForm).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
_this.dialogVisible = false
|
||||
_this.getUserList({ id: _this.checkTreeId });
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
createForm() {
|
||||
var _this = this
|
||||
console.log(this.ruleForm)
|
||||
this.ruleForm.areaId = this.selectIdList[0]
|
||||
this.ruleForm.pId = this.checkTreeId
|
||||
this.ruleForm.households = Number(this.ruleForm.households)
|
||||
this.ruleForm.peopleNum = Number(this.ruleForm.peopleNum)
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
editGrid(_this.ruleForm).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
_this.dialogVisible = false
|
||||
_this.getUserList({ id: _this.checkTreeId });
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSelectionChange(e) {
|
||||
this.selectItem = e
|
||||
console.log("handleSelectionChange",e);
|
||||
this.selectIdList = []
|
||||
e.forEach(item => {
|
||||
this.selectIdList.push(item.styleName)
|
||||
})
|
||||
},
|
||||
// 关闭弹窗
|
||||
handleClose(done) {
|
||||
done();
|
||||
},
|
||||
addDialog() {
|
||||
this.dialogVisible = true;
|
||||
this.titleStr = '添加'
|
||||
this.typeName = 'add'
|
||||
this.form = {
|
||||
type: "1",
|
||||
styleName: "",
|
||||
fillColor: "",
|
||||
fillOpacity: "",
|
||||
strokeColor: "",
|
||||
strokeWidth: "",
|
||||
}
|
||||
|
||||
},
|
||||
createDialog() {
|
||||
if (this.selectIdList.length == 0) {
|
||||
this.$message.warning('至少选中一个进行编辑');
|
||||
return
|
||||
} else if (this.selectIdList.length > 1) {
|
||||
this.$message.warning('只能选中一个进行编辑');
|
||||
return
|
||||
}
|
||||
|
||||
var _this = this
|
||||
this.dialogVisible = true;
|
||||
this.titleStr = '编辑'
|
||||
this.typeName = 'create'
|
||||
this.form = this.selectItem[0]
|
||||
this.form.type = this.form.type.toString()
|
||||
|
||||
},
|
||||
deleteWg() {
|
||||
var _this = this
|
||||
if (this.selectIdList.length == 0) {
|
||||
this.$message.warning('至少选中一个进行删除');
|
||||
return
|
||||
} else if (this.selectIdList.length > 1) {
|
||||
this.$message.warning('只能选中一个进行删除');
|
||||
return
|
||||
}
|
||||
this.$confirm("确认删除?")
|
||||
.then(() => {
|
||||
console.log("selectIdList",this.selectIdList);
|
||||
deleteLayerStyle(this.selectIdList[0]).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
_this.dialogVisible = false
|
||||
_this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch((_) => { });
|
||||
|
||||
},
|
||||
onCreate(){
|
||||
updateLayerStyle(this.form).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success("编辑成功");
|
||||
this.dialogVisible = false
|
||||
_this.getList()
|
||||
} else {
|
||||
this.$message.error("编辑失败");
|
||||
}
|
||||
// console.log(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-container {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__total {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__jump {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination button:disabled {
|
||||
background: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.tuceng_ys ::v-deep.tuceng_ys_son .el-input__inner {
|
||||
background-color: transparent;
|
||||
border: 1px solid #10a2e1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tuceng_ys ::v-deep.tuceng_ys_son .el-form-item__label {
|
||||
color: #10a2e1;
|
||||
}
|
||||
|
||||
.tuceng_ys ::v-deep.tuceng_ys_son .el-color-picker__trigger {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
::v-deep .el-checkbox {
|
||||
margin-top: 4px !important;
|
||||
}
|
||||
|
||||
::v-deep .el-checkbox__inner {
|
||||
background-color: transparent;
|
||||
border: 0.0625rem solid #00b2ff;
|
||||
color: #fff;
|
||||
border-radius: 0px
|
||||
}
|
||||
|
||||
::v-deep .el-dialog__title {
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog {
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.operate-container {
|
||||
text-align: right;
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
border-bottom: 1px solid #108eff;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.grid-container {
|
||||
width: calc(100% - 0px);
|
||||
min-height: 500px;
|
||||
padding: 40px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
/* */
|
||||
::v-deep .el-tree {
|
||||
|
||||
color: #ffffff;
|
||||
/* // 整体背景透明 */
|
||||
background: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
::v-deep .el-checkbox__inner {
|
||||
/*// checkbox 背景透明 */
|
||||
background: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
::v-deep .el-tree-node__content:hover {
|
||||
/* // hover 节点背景色,否则是白色 */
|
||||
background: rgba(104, 147, 215, 0.4);
|
||||
}
|
||||
|
||||
::v-deep .el-tree-node:focus>.el-tree-node__content {
|
||||
/* // focus 节点背景透明,否则是白色 */
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-table {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
/* padding:0px; */
|
||||
}
|
||||
|
||||
::v-deep .el-form-item {
|
||||
/* margin-bottom:5px; */
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-table__fixed-right::before,
|
||||
.el-table__fixed::before {
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-table::before {
|
||||
height: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-form--inline {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
::v-deep .mapboxgl-ctrl {
|
||||
display: block;
|
||||
}
|
||||
|
||||
::v-deep .el-table td.el-table__cell,
|
||||
.el-table th.el-table__cell.is-leaf {
|
||||
border-bottom: 1px solid hsl(240, 100%, 37%, 0.2);
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-input__inner {
|
||||
background-color: transparent;
|
||||
border: 0.0625rem solid #00b2ff;
|
||||
color: #fff;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-button {
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #00b2ff;
|
||||
/* line-height: 2.1875rem; */
|
||||
}
|
||||
|
||||
::v-deep .el-button--small {
|
||||
padding: 0.625rem 2.1875rem;
|
||||
}
|
||||
|
||||
::v-deep .el-form--inline .el-form-item {
|
||||
/* margin-left: 1.875rem; */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* “表格内背景颜色“ */
|
||||
::v-deep.el-table th,
|
||||
::v-deep.el-table tr,
|
||||
::v-deep.el-table td {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
/* 按钮样式修改 */
|
||||
::v-deep .el-button--success {
|
||||
background: #266a94;
|
||||
color: #00f261;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
::v-deep .el-button--info {
|
||||
background: #482c27;
|
||||
color: #8ac2da;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
::v-deep.el-button--primary {
|
||||
background: #266a94;
|
||||
color: #8ac2da;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
::v-deep.el-button--primary {
|
||||
background: #578ef0;
|
||||
color: #fff;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/*修改element-ui的table 在鼠标悬停hover时的高亮颜色*/
|
||||
::v-deep.el-table tbody tr:hover>td {
|
||||
background-color: black !important;
|
||||
}
|
||||
|
||||
/* 第一个 dialog修改 */
|
||||
::v-deep.dialog_one .el-dialog {
|
||||
background: #266a94 !important;
|
||||
border: 1px solid #10a2e1;
|
||||
}
|
||||
|
||||
::v-deep.dialog_one .el-dialog__title {
|
||||
color: #00b2ff;
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
::v-deep.dialog_one .el-dialog__header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* 第二个 dialog 修改 */
|
||||
::v-deep.dialog_two .el-dialog {
|
||||
background: rgba(37, 61, 75, 0.7) !important;
|
||||
border: 1px solid #797979;
|
||||
}
|
||||
|
||||
::v-deep.dialog_two .el-dialog__body {
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
::v-deep.dialog_two .el-dialog__header {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-table__cell {
|
||||
background: none;
|
||||
padding: 0px;
|
||||
font-size: 14px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .cell {
|
||||
padding: 0px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
/* background:hsl(212, 43%, 49%,0.5); */
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
::v-deep .number {
|
||||
background: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .btn-next {
|
||||
background: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .btn-prev {
|
||||
background: none;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__total {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__jump {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination button:disabled {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .disabled {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .el-descriptions__body {
|
||||
background: none;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
::v-deep .el-descriptions-row {
|
||||
background: none;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-descriptions-item__label {
|
||||
background: hsl(212, 43%, 49%, 0.5);
|
||||
color: #eee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
|
||||
border-color: hsl(212, 43%, 49%, 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
::v-deep .el-checkbox {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
::v-deep .el-table--scrollable-y .el-table__body-wrapper {
|
||||
overflow-x: auto;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
::v-deep .el-table--scrollable-x .el-table__body-wrapper {}
|
||||
|
||||
::v-deep .el-table--scrollable-x .el-table__body-wrapper::-webkit-scrollbar {
|
||||
display: block !important;
|
||||
z-index: 99999999999999;
|
||||
}
|
||||
|
||||
/* 滑道样式 */
|
||||
::v-deep .el-table--scrollable-x .el-table__body-wrapper::-webkit-scrollbar {
|
||||
width: 0px;
|
||||
height: 10px;
|
||||
background: #304156;
|
||||
border-radius: 6px;
|
||||
z-index: 99999999999999;
|
||||
}
|
||||
|
||||
/* 定义滑块的样式 */
|
||||
::v-deep .el-table--scrollable-x .el-table__body-wrapper::-webkit-scrollbar-thumb {
|
||||
border-radius: 0px;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
z-index: 99999999999999;
|
||||
}
|
||||
|
||||
/* 定义滑块鼠标移入时的样式 */
|
||||
::v-deep .el-table--scrollable-x .el-table__body-wrapper .el-table__body-wrapper .is-scrolling-left::-webkit-scrollbar-thumb:hover {
|
||||
border-radius: 10px;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
z-index: 99999999999999;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__jump {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-pagination .el-select {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
::v-deep .el-pager li {
|
||||
width: 10px !important;
|
||||
}
|
||||
|
||||
::v-deep .el-pager .number {
|
||||
padding: 0px;
|
||||
width: 10px !important;
|
||||
}
|
||||
|
||||
::v-deep .el-pagination .el-input__inner {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
::v-deep .mapboxgl-ctrl {
|
||||
/* display:none; */
|
||||
}
|
||||
|
||||
::v-deep .mapboxgl-ctrl-attrib-inner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__content .is-disabled .el-input__inner {
|
||||
background-color: none !important;
|
||||
}
|
||||
|
||||
::v-deep .mapboxgl-map canvas {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
::v-deep .el-pager li {
|
||||
min-width: 25px !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table--border::after,
|
||||
.el-table--group::after,
|
||||
.el-table::before {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .el-table--border,
|
||||
.el-table--group {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-table--border th.el-table__cell,
|
||||
.el-table__fixed-right-patch {
|
||||
/* border:0px; */
|
||||
}
|
||||
|
||||
::v-deep .el-table--border .el-table__cell,
|
||||
.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
padding: 15px 0px;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -40,6 +40,7 @@ export default {
|
|||
// console.log(res);
|
||||
// localStorage.setItem("X-Token", res.data.msg);
|
||||
localStorage.setItem("areaName",res.data.userInfo.areaENName);
|
||||
localStorage.setItem("areaENName",res.data.userInfo.areaENName);
|
||||
localStorage.setItem("X-Token", res.data.token);
|
||||
this.$message.success("登录成功");
|
||||
this.loading = false
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -136,7 +136,7 @@ import monitor from './monitor'
|
|||
monitorShow:false,
|
||||
formInline:{},
|
||||
listQuery:{
|
||||
areaname: localStorage.getItem("areaENName"),
|
||||
areaname: localStorage.getItem("areaName"),
|
||||
querystr:null,
|
||||
pageIndex:1,
|
||||
pageSize:20,
|
||||
|
|
@ -170,7 +170,7 @@ import monitor from './monitor'
|
|||
this.$mapboxgl.accessToken = "pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg";
|
||||
this.globalMap = new this.$mapboxgl.Map({
|
||||
container:"mapContainer",
|
||||
center:[118.0075,35.42222222],
|
||||
center:[117.7075,35.43222222],
|
||||
zoom:12,
|
||||
maxZoom:20,
|
||||
minZoom:5,
|
||||
|
|
@ -301,7 +301,7 @@ import monitor from './monitor'
|
|||
'type': 'raster',
|
||||
'source': {
|
||||
'type': 'raster',
|
||||
'tiles': ["http://60.213.14.14:8060/geoserver/feixian/wms?service=WMS&version=1.1.0&request=GetMap&layers=feixian:yingxiang&styles=&bbox={bbox-epsg-3857}&width=256&height=256&srs=EPSG:3857&format=image/png&TRANSPARENT=TRUE"],
|
||||
'tiles': ["http://175.27.168.120:8080/geoserver/pingyixian/wms?service=WMS&version=1.1.0&request=GetMap&layers=pingyixian:yingxiang&styles=&bbox={bbox-epsg-3857}&width=256&height=256&srs=EPSG:3857&format=image/png&TRANSPARENT=TRUE"],
|
||||
'tileSize': 256
|
||||
},
|
||||
'layout':{
|
||||
|
|
@ -313,7 +313,7 @@ import monitor from './monitor'
|
|||
});
|
||||
},
|
||||
loadXianJieLayer(){
|
||||
let sourceData = "http://175.27.168.120:8080/geoserver/feixian/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=feixian%3Axianjie&maxFeatures=50&outputFormat=application%2Fjson"
|
||||
let sourceData = "http://175.27.168.120:8080/geoserver/linyishi/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=linyishi%3Axianjie&cql_filter=xzqdm%20like%20%27%25371326%25%27&maxFeatures=50&outputFormat=application%2Fjson"
|
||||
if(localStorage.getItem("areaENName") == 'pingyi'){
|
||||
sourceData = PingYiXianJieGeoJson
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,14 +23,26 @@
|
|||
}
|
||||
},
|
||||
mounted(){
|
||||
let arr = [
|
||||
this.monitorInfo.cameraindexcode,
|
||||
this.monitorInfo.cameraindexcode,
|
||||
"23604396",
|
||||
"221.2.83.54",
|
||||
1443,
|
||||
"NZJ8L3bxCOOV6rtTFjsx"
|
||||
]
|
||||
let arr = [];
|
||||
if(localStorage.getItem("areaName")=='feixian'){
|
||||
arr = [
|
||||
this.monitorInfo.cameraindexcode,
|
||||
this.monitorInfo.cameraindexcode,
|
||||
"23604396",
|
||||
"221.2.83.54",
|
||||
1443,
|
||||
"NZJ8L3bxCOOV6rtTFjsx"
|
||||
]
|
||||
}else{
|
||||
arr = [
|
||||
this.monitorInfo.cameraindexcode,
|
||||
this.monitorInfo.cameraindexcode,
|
||||
"21274765",
|
||||
"223.99.16.253",
|
||||
1443,
|
||||
"CraRtGvpNB2xOcYSFTov"
|
||||
]
|
||||
}
|
||||
|
||||
let _this = this;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue