设备管理

This commit is contained in:
2025-10-17 15:17:55 +08:00
parent b41443c978
commit de9815e154
39 changed files with 736 additions and 54 deletions

View File

@ -1,8 +1,8 @@
import {app, shell, BrowserWindow, ipcMain, globalShortcut, dialog} from 'electron'
import path, {join} from 'path'
import {electronApp, optimizer, is} from '@electron-toolkit/utils'
import { app, shell, BrowserWindow, ipcMain, globalShortcut, dialog } from 'electron'
import path, { join } from 'path'
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import icon from '../../resources/earth.png?asset'
import {Recorder} from "../preload/recorder";
import { Recorder } from "../preload/recorder";
import fs from 'fs'
import { exec, spawn } from 'child_process'
import dayjs from 'dayjs'
@ -105,7 +105,7 @@ function createWindow(): void {
useContentSize: true, // 窗口尺寸包含内容区域而非边框
simpleFullscreen: true, // 使用简单全屏模式(仅macOS有效)
backgroundColor: '#00000000', // 添加这行设置透明背景
...(process.platform === 'linux' ? {icon} : {}),
...(process.platform === 'linux' ? { icon } : {}),
webPreferences: {
preload: join(__dirname, '../preload/index.js'),
sandbox: false,
@ -124,7 +124,7 @@ function createWindow(): void {
const ymlContent = yaml.load(fs.readFileSync(ymlPath, 'utf8'));
if(option) {
if (option) {
ymlContent.server.port = option.port
fs.writeFileSync(ymlPath, yaml.dump(ymlContent));
}
@ -180,7 +180,7 @@ function createWindow(): void {
event.sender.send("selectedItem", arr);
});
});
ipcMain.on("saveFile", (event, {title, filename, filters}) => {
ipcMain.on("saveFile", (event, { title, filename, filters }) => {
dialog
.showSaveDialog({
title,
@ -195,6 +195,63 @@ function createWindow(): void {
event.sender.send("selectedFileItem", path);
});
});
ipcMain.on("saveNetFile", (event, { title, filename, filters, url }) => {
dialog
.showSaveDialog({
title,
defaultPath: filename,
filters,
})
.then((files) => {
let path = "";
if (!files.canceled) {
path = files.filePath.replace(/\\/g, "/");
function callBack(key) {
console.log("下载完成");
event.sender.send("saveNetFileRes", key);
}
function downloadFile(url, path) {
/*request(
url,
{ headers: { Accept: "application/octet-stream" } },
(err, res, body) => {
if (!err && res.statusCode === 200) {
const filePath = path;
fs.writeFileSync(filePath, body);
console.log(url);
console.log(`文件已保存到: ${filePath}`);
} else {
console.error("下载文件失败:", err);
}
}
);*/
http
.get(url, (response) => {
let contentLength = parseInt(
response.headers["content-length"]
);
let downloadedLength = 0;
response.pipe(fs.createWriteStream(path));
response.on("end", () => {
callBack("success");
// Message.success('下载成功')
// dialog.showMessageBox(null,{type:'info',message:"下载完成"})
});
})
.on("error", (err) => {
console.log("完成");
callBack("error");
});
}
downloadFile(url, path);
}
/* filePaths = path;
webContents.downloadURL(url);*/
//
});
});
ipcMain.handle('getIsFullScreen', () => {
return mainWindow.isFullScreen()
});
@ -231,7 +288,7 @@ function createWindow(): void {
let path = dialog.showSaveDialogSync({
title: "保存视频文件",
defaultPath: dayjs().format("YYYYMMDDHHmmss") + "视频录制.mp4",
filters: [{name: "文件类型", extensions: ["mp4"]}],
filters: [{ name: "文件类型", extensions: ["mp4"] }],
});
if (path != undefined) {
recorder.move(path, () => {
@ -348,7 +405,7 @@ function createWindow(): void {
// 设置窗口标题和图标
mainWindow.webContents.setWindowOpenHandler((details) => {
shell.openExternal(details.url)
return {action: 'deny'}
return { action: 'deny' }
})
// 注册 F5 快捷键刷新
globalShortcut.register('CommandOrControl+F5', () => {
@ -514,7 +571,7 @@ function forceQuit() {
function closeAllWindows() {
// 1. 获取所有已打开的窗口
const allWindows = BrowserWindow.getAllWindows();
// 2. 遍历关闭每个窗口
allWindows.forEach(window => {
if (!window.isDestroyed()) { // 避免操作已销毁的窗口(防止报错)

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><link rel=icon href=favicon.ico><title>后台管理</title><script src=./reconnecting-websocket.js></script><link href=static/css/app.58b4d6f6.css rel=preload as=style><link href=static/css/chunk-elementUI.68c70ad5.css rel=preload as=style><link href=static/css/chunk-libs.3dfb7769.css rel=preload as=style><link href=static/js/app.d6ce393b.js rel=preload as=script><link href=static/js/chunk-elementUI.a9f82b5b.js rel=preload as=script><link href=static/js/chunk-libs.6f32783a.js rel=preload as=script><link href=static/css/chunk-elementUI.68c70ad5.css rel=stylesheet><link href=static/css/chunk-libs.3dfb7769.css rel=stylesheet><link href=static/css/app.58b4d6f6.css rel=stylesheet></head><body><noscript><strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script>(function(e){function t(t){for(var r,c,a=t[0],i=t[1],d=t[2],f=0,l=[];f<a.length;f++)c=a[f],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&l.push(o[c][0]),o[c]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);s&&s(t);while(l.length)l.shift()();return u.push.apply(u,d||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],r=!0,c=1;c<n.length;c++){var a=n[c];0!==o[a]&&(r=!1)}r&&(u.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},c={runtime:0},o={runtime:0},u=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-1c69c3ec":"995023d8","chunk-3de9e838":"74ca766e","chunk-727b7771":"dbc59d72","chunk-77d26b2a":"6df8a588","chunk-7a11d744":"cb84f686","chunk-94d3c3c4":"d33d7335","chunk-9e388570":"129f6588","chunk-a2a11b4c":"b1d368ff"}[e]+".js"}function i(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.e=function(e){var t=[],n={"chunk-1c69c3ec":1,"chunk-77d26b2a":1,"chunk-94d3c3c4":1};c[e]?t.push(c[e]):0!==c[e]&&n[e]&&t.push(c[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-1c69c3ec":"61fcde52","chunk-3de9e838":"31d6cfe0","chunk-727b7771":"31d6cfe0","chunk-77d26b2a":"2363f4f0","chunk-7a11d744":"31d6cfe0","chunk-94d3c3c4":"3c7f5ad9","chunk-9e388570":"31d6cfe0","chunk-a2a11b4c":"31d6cfe0"}[e]+".css",o=i.p+r,u=document.getElementsByTagName("link"),a=0;a<u.length;a++){var d=u[a],f=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(f===r||f===o))return t()}var l=document.getElementsByTagName("style");for(a=0;a<l.length;a++){d=l[a],f=d.getAttribute("data-href");if(f===r||f===o)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var r=t&&t.target&&t.target.src||o,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=r,delete c[e],s.parentNode.removeChild(s),n(u)},s.href=o;var h=document.getElementsByTagName("head")[0];h.appendChild(s)})).then((function(){c[e]=0})));var r=o[e];if(0!==r)if(r)t.push(r[2]);else{var u=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=u);var d,f=document.createElement("script");f.charset="utf-8",f.timeout=120,i.nc&&f.setAttribute("nonce",i.nc),f.src=a(e);var l=new Error;d=function(t){f.onerror=f.onload=null,clearTimeout(s);var n=o[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",l.name="ChunkLoadError",l.type=r,l.request=c,n[1](l)}o[e]=void 0}};var s=setTimeout((function(){d({type:"timeout",target:f})}),12e4);f.onerror=f.onload=d,document.head.appendChild(f)}return Promise.all(t)},i.m=e,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var d=window["webpackJsonp"]=window["webpackJsonp"]||[],f=d.push.bind(d);d.push=t,d=d.slice();for(var l=0;l<d.length;l++)t(d[l]);var s=f;n()})([]);</script><script src=static/js/chunk-elementUI.a9f82b5b.js></script><script src=static/js/chunk-libs.6f32783a.js></script><script src=static/js/app.d6ce393b.js></script></body><script src=./echarts.min.js></script></html>

View File

@ -0,0 +1,382 @@
// MIT License:
//
// Copyright (c) 2010-2012, Joe Walnes
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
/**
* This behaves like a WebSocket in every way, except if it fails to connect,
* or it gets disconnected, it will repeatedly poll until it successfully connects
* again.
*
* It is API compatible, so when you have:
* ws = new WebSocket('ws://....');
* you can replace with:
* ws = new ReconnectingWebSocket('ws://....');
*
* The event stream will typically look like:
* onconnecting
* onopen
* onmessage
* onmessage
* onclose // lost connection
* onconnecting
* onopen // sometime later...
* onmessage
* onmessage
* etc...
*
* It is API compatible with the standard WebSocket API, apart from the following members:
*
* - `bufferedAmount`
* - `extensions`
* - `binaryType`
*
* Latest version: https://github.com/joewalnes/reconnecting-websocket/
* - Joe Walnes
*
* Syntax
* ======
* var socket = new ReconnectingWebSocket(url, protocols, options);
*
* Parameters
* ==========
* url - The url you are connecting to.
* protocols - Optional string or array of protocols.
* options - See below
*
* Options
* =======
* Options can either be passed upon instantiation or set after instantiation:
*
* var socket = new ReconnectingWebSocket(url, null, { debug: true, reconnectInterval: 4000 });
*
* or
*
* var socket = new ReconnectingWebSocket(url);
* socket.debug = true;
* socket.reconnectInterval = 4000;
*
* debug
* - Whether this instance should log debug messages. Accepts true or false. Default: false.
*
* automaticOpen
* - Whether or not the websocket should attempt to connect immediately upon instantiation. The socket can be manually opened or closed at any time using ws.open() and ws.close().
*
* reconnectInterval
* - The number of milliseconds to delay before attempting to reconnect. Accepts integer. Default: 1000.
*
* maxReconnectInterval
* - The maximum number of milliseconds to delay a reconnection attempt. Accepts integer. Default: 30000.
*
* reconnectDecay
* - The rate of increase of the reconnect delay. Allows reconnect attempts to back off when problems persist. Accepts integer or float. Default: 1.5.
*
* timeoutInterval
* - The maximum time in milliseconds to wait for a connection to succeed before closing and retrying. Accepts integer. Default: 2000.
*
*/
(function(global, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory)
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = factory()
} else {
global.ReconnectingWebSocket = factory()
}
})(this, function() {
if (!('WebSocket' in window)) {
return
}
function ReconnectingWebSocket(url, protocols, options) {
// Default settings
var settings = {
/** Whether this instance should log debug messages. */
debug: false,
/** Whether or not the websocket should attempt to connect immediately upon instantiation. */
automaticOpen: true,
/** The number of milliseconds to delay before attempting to reconnect. */
reconnectInterval: 1000,
/** The maximum number of milliseconds to delay a reconnection attempt. */
maxReconnectInterval: 30000,
/** The rate of increase of the reconnect delay. Allows reconnect attempts to back off when problems persist. */
reconnectDecay: 1.5,
/** The maximum time in milliseconds to wait for a connection to succeed before closing and retrying. */
timeoutInterval: 2000,
/** The maximum number of reconnection attempts to make. Unlimited if null. */
maxReconnectAttempts: null,
/** The binary type, possible values 'blob' or 'arraybuffer', default 'blob'. */
binaryType: 'blob'
}
if (!options) {
options = {}
}
// Overwrite and define settings with options if they exist.
for (var key in settings) {
if (typeof options[key] !== 'undefined') {
this[key] = options[key]
} else {
this[key] = settings[key]
}
}
// These should be treated as read-only properties
/** The URL as resolved by the constructor. This is always an absolute URL. Read only. */
this.url = url
/** The number of attempted reconnects since starting, or the last successful connection. Read only. */
this.reconnectAttempts = 0
/**
* The current state of the connection.
* Can be one of: WebSocket.CONNECTING, WebSocket.OPEN, WebSocket.CLOSING, WebSocket.CLOSED
* Read only.
*/
this.readyState = WebSocket.CONNECTING
/**
* A string indicating the name of the sub-protocol the server selected; this will be one of
* the strings specified in the protocols parameter when creating the WebSocket object.
* Read only.
*/
this.protocol = null
// Private state variables
var self = this
var ws
var forcedClose = false
var timedOut = false
var eventTarget = document.createElement('div')
// Wire up "on*" properties as event handlers
eventTarget.addEventListener('open', function(event) {
self.onopen(event)
})
eventTarget.addEventListener('close', function(event) {
self.onclose(event)
})
eventTarget.addEventListener('connecting', function(event) {
self.onconnecting(event)
})
eventTarget.addEventListener('message', function(event) {
self.onmessage(event)
})
eventTarget.addEventListener('error', function(event) {
self.onerror(event)
})
// Expose the API required by EventTarget
this.addEventListener = eventTarget.addEventListener.bind(eventTarget)
this.removeEventListener = eventTarget.removeEventListener.bind(eventTarget)
this.dispatchEvent = eventTarget.dispatchEvent.bind(eventTarget)
/**
* This function generates an event that is compatible with standard
* compliant browsers and IE9 - IE11
*
* This will prevent the error:
* Object doesn't support this action
*
* http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563
* @param s String The name that the event should use
* @param args Object an optional object that the event will use
*/
function generateEvent(s, args) {
var evt = document.createEvent('CustomEvent')
evt.initCustomEvent(s, false, false, args)
return evt
}
this.open = function(reconnectAttempt) {
ws = new WebSocket(self.url, protocols || [])
ws.binaryType = this.binaryType
if (reconnectAttempt) {
if (this.maxReconnectAttempts && this.reconnectAttempts > this.maxReconnectAttempts) {
return
}
} else {
eventTarget.dispatchEvent(generateEvent('connecting'))
this.reconnectAttempts = 0
}
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'attempt-connect', self.url)
}
var localWs = ws
var timeout = setTimeout(function() {
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'connection-timeout', self.url)
}
timedOut = true
localWs.close()
timedOut = false
}, self.timeoutInterval)
ws.onopen = function(event) {
clearTimeout(timeout)
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'onopen', self.url)
}
self.protocol = ws.protocol
self.readyState = WebSocket.OPEN
self.reconnectAttempts = 0
var e = generateEvent('open')
e.isReconnect = reconnectAttempt
reconnectAttempt = false
eventTarget.dispatchEvent(e)
}
ws.onclose = function(event) {
clearTimeout(timeout)
ws = null
if (forcedClose) {
self.readyState = WebSocket.CLOSED
eventTarget.dispatchEvent(generateEvent('close'))
} else {
self.readyState = WebSocket.CONNECTING
var e = generateEvent('connecting')
e.code = event.code
e.reason = event.reason
e.wasClean = event.wasClean
eventTarget.dispatchEvent(e)
if (!reconnectAttempt && !timedOut) {
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'onclose', self.url)
}
eventTarget.dispatchEvent(generateEvent('close'))
}
var timeout = self.reconnectInterval * Math.pow(self.reconnectDecay, self.reconnectAttempts)
setTimeout(function() {
self.reconnectAttempts++
self.open(true)
}, timeout > self.maxReconnectInterval ? self.maxReconnectInterval : timeout)
}
}
ws.onmessage = function(event) {
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'onmessage', self.url, event.data)
}
var e = generateEvent('message')
e.data = event.data
eventTarget.dispatchEvent(e)
}
ws.onerror = function(event) {
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'onerror', self.url, event)
}
eventTarget.dispatchEvent(generateEvent('error'))
}
}
// Whether or not to create a websocket upon instantiation
if (this.automaticOpen == true) {
this.open(false)
}
/**
* Transmits data to the server over the WebSocket connection.
*
* @param data a text string, ArrayBuffer or Blob to send to the server.
*/
this.send = function(data) {
if (ws) {
if (self.debug || ReconnectingWebSocket.debugAll) {
console.debug('ReconnectingWebSocket', 'send', self.url, data)
}
return ws.send(data)
} else {
throw 'INVALID_STATE_ERR : Pausing to reconnect websocket'
}
}
/**
* Closes the WebSocket connection or connection attempt, if any.
* If the connection is already CLOSED, this method does nothing.
*/
this.close = function(code, reason) {
// Default CLOSE_NORMAL code
if (typeof code == 'undefined') {
code = 1000
}
forcedClose = true
if (ws) {
ws.close(code, reason)
}
}
/**
* Additional public API method to refresh the connection if still open (close, re-open).
* For example, if the app suspects bad data / missed heart beats, it can try to refresh.
*/
this.refresh = function() {
if (ws) {
ws.close()
}
}
}
/**
* An event listener to be called when the WebSocket connection's readyState changes to OPEN;
* this indicates that the connection is ready to send and receive data.
*/
ReconnectingWebSocket.prototype.onopen = function(event) {
}
/** An event listener to be called when the WebSocket connection's readyState changes to CLOSED. */
ReconnectingWebSocket.prototype.onclose = function(event) {
}
/** An event listener to be called when a connection begins being attempted. */
ReconnectingWebSocket.prototype.onconnecting = function(event) {
}
/** An event listener to be called when a message is received from the server. */
ReconnectingWebSocket.prototype.onmessage = function(event) {
}
/** An event listener to be called when an error occurs. */
ReconnectingWebSocket.prototype.onerror = function(event) {
}
/**
* Whether all instances of ReconnectingWebSocket should log debug messages.
* Setting this to true is the equivalent of setting all instances of ReconnectingWebSocket.debug to true.
*/
ReconnectingWebSocket.debugAll = false
ReconnectingWebSocket.CONNECTING = WebSocket.CONNECTING
ReconnectingWebSocket.OPEN = WebSocket.OPEN
ReconnectingWebSocket.CLOSING = WebSocket.CLOSING
ReconnectingWebSocket.CLOSED = WebSocket.CLOSED
return ReconnectingWebSocket
})

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
@supports(-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-1280a792]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-1280a792]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-1280a792]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-1280a792]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-1280a792]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-1280a792]{position:relative}.login-container .title-container .title[data-v-1280a792]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-1280a792]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}

View File

@ -0,0 +1 @@
.el-row[data-v-0baf41f2]{margin-bottom:20px}.el-row[data-v-0baf41f2]:last-child{margin-bottom:0}.el-col[data-v-0baf41f2]{border-radius:4px}.grid-content[data-v-0baf41f2]{background:#fff;border:1px solid #f3f4f6;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05),0 0 0 transparent,0 0 0 transparent;box-shadow:0 1px 2px rgba(0,0,0,.05),0 0 0 transparent,0 0 0 transparent;border-radius:8px}.userNum[data-v-0baf41f2]{height:10vh;line-height:10vh;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:10px}.userNum .img[data-v-0baf41f2]{width:48px;height:48px;margin-left:15px}.userNum .img .svg-icon[data-v-0baf41f2]{width:100%;height:100%;vertical-align:baseline!important}.userNum .numCon[data-v-0baf41f2]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;line-height:1}.userNum .numCon div[data-v-0baf41f2]:first-child{width:100px;height:20px;line-height:20px;font-size:14px;font-weight:400;color:#6b7280;text-align:left;margin-top:5px}.userNum .numCon div[data-v-0baf41f2]:last-child{width:100px;height:32px;font-size:24px;font-weight:400;color:#1d2129;margin-top:5px}.search[data-v-0baf41f2]{height:8vh;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:10px}.search .el-input[data-v-0baf41f2]{width:250px;margin-left:20px}.search .addUser[data-v-0baf41f2]{position:absolute;right:30px}.table[data-v-0baf41f2]{height:65vh}.table .title[data-v-0baf41f2]{width:100%;height:50px;padding:0 20px;line-height:50px;color:#1d2129;font-size:16px;font-weight:400;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;border-bottom:1px solid #f3f4f6}.table .title .totalNum[data-v-0baf41f2]{color:#6b7280;font-size:14px;font-weight:400}.table .tabCon[data-v-0baf41f2]{width:100%;padding:20px 20px 0 20px;height:100%}.table .tabCon .state[data-v-0baf41f2]{width:40px;height:24px;display:inline-block;opacity:1;border-radius:12px;background:rgba(0,180,42,.1);color:#00b42a;font-size:12px;font-weight:400}.table .tabCon .puase[data-v-0baf41f2]{background:rgba(245,63,63,.1);color:#f53f3f}.el-table thead tr[data-v-0baf41f2],[data-v-0baf41f2] .el-table thead th{background-color:#f9fafb!important}[data-v-0baf41f2] .el-table--border td,[data-v-0baf41f2] .el-table--border th,[data-v-0baf41f2] .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:unset!important}.el-table--border[data-v-0baf41f2],.el-table--group[data-v-0baf41f2]{border:unset!important}.el-table[data-v-0baf41f2]:before,[data-v-0baf41f2] .el-table--border:after,[data-v-0baf41f2] .el-table--group:after{background-color:unset!important}[data-v-0baf41f2] .el-table .el-table__body-wrapper td,[data-v-0baf41f2] .el-table .el-table__body-wrapper th.is-leaf{border-bottom:unset!important}.el-pagination[data-v-0baf41f2]{position:absolute;right:30px;margin-top:10px}

View File

@ -0,0 +1 @@
.wscn-http404-container[data-v-c095f994]{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);position:absolute;top:40%;left:50%}.wscn-http404[data-v-c095f994]{position:relative;width:1200px;padding:0 50px;overflow:hidden}.wscn-http404 .pic-404[data-v-c095f994]{position:relative;float:left;width:600px;overflow:hidden}.wscn-http404 .pic-404__parent[data-v-c095f994]{width:100%}.wscn-http404 .pic-404__child[data-v-c095f994]{position:absolute}.wscn-http404 .pic-404__child.left[data-v-c095f994]{width:80px;top:17px;left:220px;opacity:0;-webkit-animation-name:cloudLeft-data-v-c095f994;animation-name:cloudLeft-data-v-c095f994;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s}.wscn-http404 .pic-404__child.mid[data-v-c095f994]{width:46px;top:10px;left:420px;opacity:0;-webkit-animation-name:cloudMid-data-v-c095f994;animation-name:cloudMid-data-v-c095f994;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1.2s;animation-delay:1.2s}.wscn-http404 .pic-404__child.right[data-v-c095f994]{width:62px;top:100px;left:500px;opacity:0;-webkit-animation-name:cloudRight-data-v-c095f994;animation-name:cloudRight-data-v-c095f994;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s}@-webkit-keyframes cloudLeft-data-v-c095f994{0%{top:17px;left:220px;opacity:0}20%{top:33px;left:188px;opacity:1}80%{top:81px;left:92px;opacity:1}to{top:97px;left:60px;opacity:0}}@keyframes cloudLeft-data-v-c095f994{0%{top:17px;left:220px;opacity:0}20%{top:33px;left:188px;opacity:1}80%{top:81px;left:92px;opacity:1}to{top:97px;left:60px;opacity:0}}@-webkit-keyframes cloudMid-data-v-c095f994{0%{top:10px;left:420px;opacity:0}20%{top:40px;left:360px;opacity:1}70%{top:130px;left:180px;opacity:1}to{top:160px;left:120px;opacity:0}}@keyframes cloudMid-data-v-c095f994{0%{top:10px;left:420px;opacity:0}20%{top:40px;left:360px;opacity:1}70%{top:130px;left:180px;opacity:1}to{top:160px;left:120px;opacity:0}}@-webkit-keyframes cloudRight-data-v-c095f994{0%{top:100px;left:500px;opacity:0}20%{top:120px;left:460px;opacity:1}80%{top:180px;left:340px;opacity:1}to{top:200px;left:300px;opacity:0}}@keyframes cloudRight-data-v-c095f994{0%{top:100px;left:500px;opacity:0}20%{top:120px;left:460px;opacity:1}80%{top:180px;left:340px;opacity:1}to{top:200px;left:300px;opacity:0}}.wscn-http404 .bullshit[data-v-c095f994]{position:relative;float:left;width:300px;padding:30px 0;overflow:hidden}.wscn-http404 .bullshit__oops[data-v-c095f994]{font-size:32px;line-height:40px;color:#1482f0;margin-bottom:20px;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__headline[data-v-c095f994],.wscn-http404 .bullshit__oops[data-v-c095f994]{font-weight:700;opacity:0;-webkit-animation-name:slideUp-data-v-c095f994;animation-name:slideUp-data-v-c095f994;-webkit-animation-duration:.5s;animation-duration:.5s}.wscn-http404 .bullshit__headline[data-v-c095f994]{font-size:20px;line-height:24px;color:#222;margin-bottom:10px;-webkit-animation-delay:.1s;animation-delay:.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__info[data-v-c095f994]{font-size:13px;line-height:21px;color:grey;margin-bottom:30px;-webkit-animation-delay:.2s;animation-delay:.2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__info[data-v-c095f994],.wscn-http404 .bullshit__return-home[data-v-c095f994]{opacity:0;-webkit-animation-name:slideUp-data-v-c095f994;animation-name:slideUp-data-v-c095f994;-webkit-animation-duration:.5s;animation-duration:.5s}.wscn-http404 .bullshit__return-home[data-v-c095f994]{display:block;float:left;width:110px;height:36px;background:#1482f0;border-radius:100px;text-align:center;color:#fff;font-size:14px;line-height:36px;cursor:pointer;-webkit-animation-delay:.3s;animation-delay:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes slideUp-data-v-c095f994{0%{-webkit-transform:translateY(60px);transform:translateY(60px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes slideUp-data-v-c095f994{0%{-webkit-transform:translateY(60px);transform:translateY(60px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}[hidden],template{display:none}#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;-webkit-box-shadow:0 0 10px #29d,0 0 5px #29d;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translateY(-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;-webkit-box-sizing:border-box;box-sizing:border-box;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

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

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-727b7771"],{ad8f:function(t,e,n){"use strict";n.d(e,"e",(function(){return l})),n.d(e,"f",(function(){return o})),n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return c}));var a=n("b775");function l(t){return Object(a["a"])({url:"/source/list",method:"post",data:t})}function o(t){return Object(a["a"])({url:"/source/tongbu",method:"post",data:t})}function u(t){return Object(a["a"])({url:"/source/del",method:"post",data:t})}function r(){return Object(a["a"])({url:"/auth/check",method:"post"})}function s(){return Object(a["a"])({url:"/ini/info",method:"get"})}function c(t){return Object(a["a"])({url:"/ini/update",method:"post",data:t})}},cc09:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{label:"授权码",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",{staticStyle:{color:"#20a0ff"}},[t._v(t._s(e.row.license_code))])]}}])}),n("el-table-column",{attrs:{label:"授权类型",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.auth_type))])]}}])}),n("el-table-column",{attrs:{label:"授权信息",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.message))])]}}])}),n("el-table-column",{attrs:{label:"开始时间",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.start_at)+" ")]}}])}),n("el-table-column",{attrs:{label:"结束时间",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.end_at)+" ")]}}])}),n("el-table-column",{attrs:{label:"模型授权数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.tileset_num)+" ")]}}])}),n("el-table-column",{attrs:{label:"模型解析数量",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.cur_tileset)+" ")]}}])}),n("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{accept:".lic",action:"/yjearth4.0/api/v1/auth/import","on-success":t.onSuccess,headers:t.headers}},[n("i",{staticClass:"el-icon-upload"}),n("div",{staticClass:"el-upload__text"},[t._v("点击上传")])])]}}])})],1)],1)},l=[],o=n("ad8f"),u=n("5f87"),r={filters:{statusFilter:function(t){var e={published:"success",draft:"gray",deleted:"danger"};return e[t]}},data:function(){return{headers:{token:Object(u["a"])()},list:null,listLoading:!0,dialogVisible:!1}},created:function(){this.fetchData()},mounted:function(){},methods:{onSuccess:function(){this.fetchData()},fetchData:function(){var t=this;this.listLoading=!0,Object(o["a"])().then((function(e){console.log(e.data),t.list=[e.data],t.listLoading=!1,t.$refs.upload.clearFiles()}))}}},s=r,c=n("2877"),i=Object(c["a"])(s,a,l,!1,null,null,null);e["default"]=i.exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-94d3c3c4"],{"0870":function(t,s,a){},"0a5f":function(t,s,a){"use strict";a("0870")},"26fc":function(t,s,a){t.exports=a.p+"static/img/404_cloud.0f4bc32b.png"},"8cdb":function(t,s,a){"use strict";a.r(s);var c=function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"wscn-http404-container"},[a("div",{staticClass:"wscn-http404"},[t._m(0),a("div",{staticClass:"bullshit"},[a("div",{staticClass:"bullshit__oops"},[t._v("OOPS!")]),t._m(1),a("div",{staticClass:"bullshit__headline"},[t._v(t._s(t.message))]),a("div",{staticClass:"bullshit__info"},[t._v("Please check that the URL you entered is correct, or click the button below to return to the homepage.")]),a("a",{staticClass:"bullshit__return-home",attrs:{href:""}},[t._v("Back to home")])])])])},e=[function(){var t=this,s=t.$createElement,c=t._self._c||s;return c("div",{staticClass:"pic-404"},[c("img",{staticClass:"pic-404__parent",attrs:{src:a("a36b"),alt:"404"}}),c("img",{staticClass:"pic-404__child left",attrs:{src:a("26fc"),alt:"404"}}),c("img",{staticClass:"pic-404__child mid",attrs:{src:a("26fc"),alt:"404"}}),c("img",{staticClass:"pic-404__child right",attrs:{src:a("26fc"),alt:"404"}})])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"bullshit__info"},[t._v("All rights reserved "),a("a",{staticStyle:{color:"#20a0ff"},attrs:{href:"https://wallstreetcn.com",target:"_blank"}},[t._v("wallstreetcn")])])}],i={name:"Page404",computed:{message:function(){return"The webmaster said that you can not enter this page..."}}},l=i,n=(a("0a5f"),a("2877")),r=Object(n["a"])(l,c,e,!1,null,"c095f994",null);s["default"]=r.exports},a36b:function(t,s,a){t.exports=a.p+"static/img/404.a57b6f31.png"}}]);

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

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -31,4 +31,9 @@ export const deviceApi = {
params: data,
})
},
downloadTemp: async () => {
return await request.get({
url: `/device/import/template`
})
},
}

View File

@ -8,6 +8,7 @@ export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']

View File

@ -27,5 +27,8 @@ export const $recvElectronChanel = (chanel: any, cb: any) => {
console.log('接收来自electron', chanel);
ipcRenderer.once(chanel, cb);
};
export const $removeElectronChanel = (chanel: any, cb: any) => {
ipcRenderer.removeListener(chanel, cb);
};

View File

@ -11,7 +11,11 @@
</template>
<span>添加设备</span>
</el-button>
<el-button color="#004b4b" style="border: 1px solid rgba(0, 255, 255, 0.5)">
<el-button
color="#004b4b"
style="border: 1px solid rgba(0, 255, 255, 0.5)"
@click="downloadTemp"
>
<template #icon>
<svg-icon name="loadTemp" />
</template>
@ -39,12 +43,13 @@
<el-table-column prop="deviceType" label="设备类型" width="120">
<template #default="scope">
<span class="deviceType"></span>
{{ statusTrans(scope.row.type) }}
<!-- {{ statusTrans(scope.row.type) }} -->
{{ scope.row.type }}
</template>
</el-table-column>
<el-table-column prop="ip" label="设备IP" width="120" />
<el-table-column prop="port" label="设备端口" width="120" />
<el-table-column prop="userName" label="用户名" width="120" />
<el-table-column prop="username" label="用户名" width="120" />
<el-table-column prop="password" label="密码" width="120" />
<el-table-column prop="channel" label="通道号" width="120" />
<el-table-column prop="flvUrl" label="flv地址" width="300" />
@ -74,6 +79,11 @@ import { Search } from '@element-plus/icons-vue'
import { deviceApi } from '@/api/deviceManage/index'
import Dialog from '@/components/dialog/baseDialog.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
$sendElectronChanel,
$recvElectronChanel,
$removeElectronChanel
} from '@/utils/communication'
const eventBus: any = inject('bus')
@ -135,7 +145,7 @@ const peopleRules: any = reactive({
cameraName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
ip: [{ required: true, message: '请输入ip', trigger: 'blur' }],
port: [{ required: true, message: '请输入设备端口号', trigger: 'blur' }],
userName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
type: [{ required: true, message: '请选择设备类型', trigger: 'blur' }]
})
@ -201,6 +211,35 @@ var delFun = (row) => {
})
.catch(() => {})
}
const downloadTemp = () => {
let serve = localStorage.getItem('ip')
let p = 'xlsx'
if (process.platform == 'linux') {
p = 'et'
} else {
p = 'xlsx'
}
let url = serve + '/static/excel/%E8%AE%BE%E5%A4%87%E6%A8%A1%E6%9D%BF.' + p
$sendElectronChanel('saveNetFile', {
title: '保存文件',
filename: '模板',
filters: [{ name: '保存文件', extensions: [p] }],
url
})
$recvElectronChanel('saveNetFileRes', (e, key) => {
ElMessage({
message: '下载结束',
type: 'success'
})
$removeElectronChanel('saveNetFileRes', (res) => {
console.log(res)
})
})
deviceApi.downloadTemp().then((res) => {})
}
</script>
<style lang="scss">
::v-deep .addDevice {

View File

@ -20,10 +20,11 @@
</el-select>
</div>
<!-- 主题色 -->
<div class="detailSkin"></div>
<div class="detailSkin">
<span>{{ t('systemSetting.theme') }}</span>
<el-select
style="width: 100px"
style="width: 175px"
v-model="systemSetting.skinInfo"
@change="sysChange"
placeholder="请选择"
@ -62,7 +63,7 @@
>
</el-option>
</el-select> -->
<el-select v-model="systemSetting.coordinate" @change="sysChange">
<el-select style="width: 175px" v-model="systemSetting.coordinate" @change="sysChange">
<div
class="group-header"
:class="isHotGroupOpen ? 'arrowActive' : ''"
@ -123,6 +124,7 @@
</div>
</el-select>
</div>
<div class="detailSkin"></div>
<div class="detailSkin" v-show="showPosiType">
<span>{{ t('systemSetting.latitude') }}</span>
<el-select
@ -165,6 +167,7 @@
</el-option>
</el-select>
</div>
<div class="detailSkin1"></div>
<div class="detailSkin1">
<span>{{ t('systemSetting.areaUnit') }}</span>
<el-select
@ -199,6 +202,7 @@
</el-option>
</el-select>
</div>
<div class="detailSkin1"></div>
<div class="detailSkin1">
<span>{{ t('systemSetting.speedUnit') }}</span>
<el-select
@ -240,7 +244,7 @@
</div>
<div class="detailSkin2">
<span>{{ t('systemSetting.management') }}</span>
<el-button color="#005c5c"
<el-button color="#005c5c" @click="intoBack"
><svg-icon name="out_login" :size="12" style="margin-right: 5px"></svg-icon
>{{ t('systemSetting.intoBack') }}</el-button
>
@ -250,7 +254,7 @@
<div class="detailSkin1">
<span>{{ t('searchWay.title') }}</span>
<el-select
style="width: 175px"
style="width: 150px"
v-model="searchWay"
@change="searchWayChange"
placeholder="请选择"
@ -264,11 +268,11 @@
</el-option>
</el-select>
</div>
<div class="detailSkin1"></div>
<div class="detailSkin1">
<span>{{ t('ConcurrencyControl') }}</span>
<el-select
style="width: 100px"
style="width: 150px"
v-model="concurrentcode"
@change="concurrentWorkloadChange"
placeholder="请选择"
@ -493,7 +497,7 @@ name_map1.value = name_map.value.splice(0, 2)
const sysChange = async () => {
locale.value = systemSetting.value.language
document.title = t('title');
document.title = t('title')
const obj = {
compass: systemSetting.value.showCompass, //罗盘
legend: systemSetting.value.showDistanceLegend, //比例尺
@ -578,6 +582,54 @@ const toggleGroup = (type: string) => {
if (type === 'hot') isHotGroupOpen.value = !isHotGroupOpen.value
if (type === 'ty') isHotGroupOpen2.value = !isHotGroupOpen2.value
}
const intoBack = async () => {
let id = new YJ.Tools().randomString()
const electron = require('electron')
const { ipcRenderer } = require('electron')
let availablePort = await ipcRenderer.invoke('get-available-port')
let baseURL = localStorage.getItem('ip')
let _winMap = await ipcRenderer.invoke('get-_winMap')
if (!_winMap.has(id)) {
try {
const windowId = await ipcRenderer.invoke(
'create-new-window',
{
title: '后台管理',
width: 1300,
height: 700,
minWidth: 600,
minHeight: 400,
frame: true, //是否显示边缘框
// simpleFullscreen: true,
resizable: true,
useContentSize: true,
// icon: icon,
// transparent: true,
// fullScreen: true,
// backgroundColor: '#00000000',
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
// devTools: true,
// fullScreen: true,
devTools: true
}
},
`http://localhost:${availablePort}/backManage/index.html`,
{},
id
)
} catch (error) {
console.error('创建窗口失败:', error)
}
return
} else {
ipcRenderer.invoke('show-window-by-id', _winMap.get(id))
}
}
const management = () => {}
const batteryChange = () => {}
onMounted(() => {
@ -625,7 +677,7 @@ onMounted(() => {
width: 100%;
padding: 15px 0 0 22px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(3, 1fr);
.detailSkin {
width: 100%;
display: flex;
@ -635,6 +687,9 @@ onMounted(() => {
> span {
font-size: 0.9rem;
color: #c8cfcf;
display: block;
width: 86px;
text-align: right;
}
}
}
@ -642,7 +697,7 @@ onMounted(() => {
width: 100%;
padding: 15px 0 0 22px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-columns: repeat(3, 1fr);
.detailSkin1 {
width: 100%;
display: flex;
@ -652,6 +707,9 @@ onMounted(() => {
> span {
font-size: 0.9rem;
color: #c8cfcf;
display: inline-block;
width: 86px;
text-align: right;
}
}
}
@ -672,6 +730,9 @@ onMounted(() => {
> span {
font-size: 0.9rem;
color: #c8cfcf;
display: inline-block;
width: 86px;
text-align: right;
}
}
}

View File

@ -17,16 +17,16 @@
<el-form-item label="设备端口" prop="port">
<el-input v-model="addForm.port" clearable></el-input>
</el-form-item>
<el-form-item label="用户名" prop="userName">
<el-input v-model="addForm.userName" clearable></el-input>
<el-form-item label="用户名" prop="username">
<el-input v-model="addForm.username" clearable></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="addForm.password" clearable></el-input>
</el-form-item>
<el-form-item label="设备类型" prop="type">
<el-select v-model="addForm.type" filterable placeholder="请选择">
<el-option label="海康" value="1"> </el-option>
<el-option label="大华" value="2"> </el-option>
<el-option label="海康" value="海康"> </el-option>
<el-option label="大华" value="大华"> </el-option>
<!-- <el-option label="手动录入" value="3"> </el-option> -->
</el-select>
</el-form-item>
@ -63,22 +63,21 @@ const eventBus: any = inject('bus')
var addTitle = ref('')
var peopleFormRef: any = ref('')
var addForm: any = reactive({
var addForm: any = ref({
cameraName: '',
ip: '',
port: '',
userName: '',
username: '',
password: '',
type: '',
channel: '',
flvUrl: ''
channel: ''
})
const peopleRules: any = reactive({
cameraName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
ip: [{ required: true, message: '请输入ip', trigger: 'blur' }],
port: [{ required: true, message: '请输入设备端口号', trigger: 'blur' }],
userName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
type: [{ required: true, message: '请选择设备类型', trigger: 'blur' }]
})
@ -87,35 +86,40 @@ var cancel = () => {
// pDialogVisible.value = false
baseDialog.value?.close()
addForm = {
addForm.value = {
cameraName: '',
ip: '',
port: '',
userName: '',
username: '',
password: '',
type: '',
channel: '',
flvUrl: ''
channel: ''
}
}
var submitProtal = () => {
peopleFormRef.value.validate(async (valid) => {
if (valid) {
if (addForm.channel === undefined || addForm.channel === '' || addForm.channel === null) {
addForm.channel = 1
if (
addForm.value.channel === undefined ||
addForm.value.channel === '' ||
addForm.value.channel === null
) {
addForm.value.channel = 1
}
if (addTitle.value == '添加设备') {
const res = await deviceApi.addDevice(addForm)
const res = await deviceApi.addDevice(addForm.value)
if (res.code === 200) {
ElMessage.success('操作成功')
eventBus.emit('addOptionResuit')
}
} else {
delete addForm.updatedAt
delete addForm.areaId
delete addForm.createdAt
const res = await deviceApi.updateDevice(addForm)
delete addForm.value.updatedAt
delete addForm.value.areaId
delete addForm.value.createdAt
delete addForm.value.status
delete addForm.value.flvUrl
const res = await deviceApi.updateDevice(addForm.value)
if (res.code === 200) {
ElMessage.success('操作成功')
eventBus.emit('addOptionResuit')
@ -131,17 +135,16 @@ var submitProtal = () => {
eventBus.on('openAddDevice', (params) => {
addTitle.value = params.title
if (addTitle.value != '添加设备') {
addForm = params.data
addForm.value = params.data
} else {
addForm = {
addForm.value = {
cameraName: '',
ip: '',
port: '',
userName: '',
username: '',
password: '',
type: '',
channel: '',
flvUrl: ''
channel: ''
}
}
baseDialog.value?.open()