Merge branch 'zyl' of http://xny.yj-3d.com:3000/zhouyulong/electron-4 into zyl
This commit is contained in:
60
electron.vite.config.1763690275653.mjs
Normal file
60
electron.vite.config.1763690275653.mjs
Normal file
@ -0,0 +1,60 @@
|
||||
// electron.vite.config.ts
|
||||
import { resolve } from "path";
|
||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import AutoImport from "unplugin-auto-import/vite";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||
import path from "path";
|
||||
var electron_vite_config_default = defineConfig({
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
renderer: {
|
||||
resolve: {
|
||||
alias: {
|
||||
"@renderer": resolve("src/renderer/src"),
|
||||
"@": resolve("src/renderer/src")
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
imports: ["vue"],
|
||||
dts: "src/auto-imports.d.ts",
|
||||
// 自动生成类型声明文件
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
// SVG图标插件配置
|
||||
// 配置SVG图标插件
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
|
||||
symbolId: "icon-[name]",
|
||||
// 自动清除 SVG 中的 fill 和 stroke 属性
|
||||
svgoOptions: {
|
||||
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
|
||||
}
|
||||
})
|
||||
]
|
||||
/*server: {
|
||||
port: 8848,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
export {
|
||||
electron_vite_config_default as default
|
||||
};
|
||||
60
electron.vite.config.1763722141233.mjs
Normal file
60
electron.vite.config.1763722141233.mjs
Normal file
@ -0,0 +1,60 @@
|
||||
// electron.vite.config.ts
|
||||
import { resolve } from "path";
|
||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import AutoImport from "unplugin-auto-import/vite";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||
import path from "path";
|
||||
var electron_vite_config_default = defineConfig({
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
renderer: {
|
||||
resolve: {
|
||||
alias: {
|
||||
"@renderer": resolve("src/renderer/src"),
|
||||
"@": resolve("src/renderer/src")
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
imports: ["vue"],
|
||||
dts: "src/auto-imports.d.ts",
|
||||
// 自动生成类型声明文件
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
// SVG图标插件配置
|
||||
// 配置SVG图标插件
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
|
||||
symbolId: "icon-[name]",
|
||||
// 自动清除 SVG 中的 fill 和 stroke 属性
|
||||
svgoOptions: {
|
||||
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
|
||||
}
|
||||
})
|
||||
]
|
||||
/*server: {
|
||||
port: 8848,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
export {
|
||||
electron_vite_config_default as default
|
||||
};
|
||||
60
electron.vite.config.1764295754509.mjs
Normal file
60
electron.vite.config.1764295754509.mjs
Normal file
@ -0,0 +1,60 @@
|
||||
// electron.vite.config.ts
|
||||
import { resolve } from "path";
|
||||
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import AutoImport from "unplugin-auto-import/vite";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
|
||||
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
|
||||
import path from "path";
|
||||
var electron_vite_config_default = defineConfig({
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()]
|
||||
},
|
||||
renderer: {
|
||||
resolve: {
|
||||
alias: {
|
||||
"@renderer": resolve("src/renderer/src"),
|
||||
"@": resolve("src/renderer/src")
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
imports: ["vue"],
|
||||
dts: "src/auto-imports.d.ts",
|
||||
// 自动生成类型声明文件
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
Components({
|
||||
resolvers: [ElementPlusResolver()]
|
||||
}),
|
||||
// SVG图标插件配置
|
||||
// 配置SVG图标插件
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [path.resolve(process.cwd(), "src/renderer/src/icons/svg")],
|
||||
symbolId: "icon-[name]",
|
||||
// 自动清除 SVG 中的 fill 和 stroke 属性
|
||||
svgoOptions: {
|
||||
plugins: [{ name: "removeAttrs", params: { attrs: ["fill", "stroke", "stroke-width"] } }]
|
||||
}
|
||||
})
|
||||
]
|
||||
/*server: {
|
||||
port: 8848,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: localStorage.getItem('ip') || 'http://127.0.0.1:8848',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
export {
|
||||
electron_vite_config_default as default
|
||||
};
|
||||
1
resources/java/app/license/yjearth.YJ
Normal file
1
resources/java/app/license/yjearth.YJ
Normal file
@ -0,0 +1 @@
|
||||
41b/ujShRZRf9Aa433FD3uyIZuxWSSqXWXlc2dyQfJ75ED0HNbadcdsPF5CaMuJ624E+iLBfS14muki3Kp1qv3N0KPVdc0TjJDyrO+AVfwE3xW3RZy00SBFwUgG/tIU6bBTw4XijzGn57R1nl7djDeP1sx04fzNeWSLujfPS4hzwLryTr1ScTPGegLiv1C+rXsbkAxFf47uMIGGK0M2VBZTA9+UoajQ1PHwDUdI7Sfo2JRzkCFW8v6WI1jCNPaFyLypkZtybW+yeNEhnp/jeYw==
|
||||
@ -1 +1 @@
|
||||
41b/ujShRZRf9Aa433FD3uyIZuxWSSqXWXlc2dyQfJ75ED0HNbadcdsPF5CaMuJ624E+iLBfS14muki3Kp1qv3N0KPVdc0TjJDyrO+AVfwE2pkhuoGoZ8sNGSUSrom2NhRIwJNl4SNhqGkxKvDJhRhWfxw6LHS3T/4NDVmw/KlXwLryTr1ScTPGegLiv1C+r0BN58Qcbdy/IN4J0/xuadZTA9+UoajQ1PHwDUdI7SfpTyz/mXYghVpbQcW8OYTHqLypkZtybW+yeNEhnp/jeYw==
|
||||
41b/ujShRZRf9Aa433FD3uyIZuxWSSqXWXlc2dyQfJ75ED0HNbadcdsPF5CaMuJ624E+iLBfS14muki3Kp1qv3N0KPVdc0TjJDyrO+AVfwE3xW3RZy00SBFwUgG/tIU6bBTw4XijzGn57R1nl7djDeP1sx04fzNeWSLujfPS4hzwLryTr1ScTPGegLiv1C+rXsbkAxFf47uMIGGK0M2VBZTA9+UoajQ1PHwDUdI7Sfo2JRzkCFW8v6WI1jCNPaFyLypkZtybW+yeNEhnp/jeYw==1
|
||||
1
resources/java/app/license/yjearth.yj
Normal file
1
resources/java/app/license/yjearth.yj
Normal file
@ -0,0 +1 @@
|
||||
41b/ujShRZRf9Aa433FD3uyIZuxWSSqXWXlc2dyQfJ75ED0HNbadcdsPF5CaMuJ624E+iLBfS14muki3Kp1qv3N0KPVdc0TjJDyrO+AVfwE3xW3RZy00SBFwUgG/tIU6bBTw4XijzGn57R1nl7djDeP1sx04fzNeWSLujfPS4hzwLryTr1ScTPGegLiv1C+rXsbkAxFf47uMIGGK0M2VBZTA9+UoajQ1PHwDUdI7Sfo2JRzkCFW8v6WI1jCNPaFyLypkZtybW+yeNEhnp/jeYw==
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +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.46ef1c6b.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.7782b1e9.js rel=preload as=script><link href=static/js/chunk-elementUI.a9f82b5b.js rel=preload as=script><link href=static/js/chunk-libs.8de98ba2.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.46ef1c6b.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,o,a=t[0],i=t[1],d=t[2],l=0,f=[];l<a.length;l++)o=a[l],Object.prototype.hasOwnProperty.call(c,o)&&c[o]&&f.push(c[o][0]),c[o]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);s&&s(t);while(f.length)f.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,o=1;o<n.length;o++){var a=n[o];0!==c[a]&&(r=!1)}r&&(u.splice(t--,1),e=i(i.s=n[0]))}return e}var r={},o={runtime:0},c={runtime:0},u=[];function a(e){return i.p+"static/js/"+({}[e]||e)+"."+{"chunk-0e163d56":"264fd37b","chunk-6337fcfc":"ce706d4d","chunk-213dd466":"f0e897b9","chunk-626cc720":"42d599ab","chunk-69ab8e14":"e2ed086d","chunk-94d3c3c4":"d08f8612"}[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-0e163d56":1,"chunk-213dd466":1,"chunk-626cc720":1,"chunk-69ab8e14":1,"chunk-94d3c3c4":1};o[e]?t.push(o[e]):0!==o[e]&&n[e]&&t.push(o[e]=new Promise((function(t,n){for(var r="static/css/"+({}[e]||e)+"."+{"chunk-0e163d56":"f278854e","chunk-6337fcfc":"31d6cfe0","chunk-213dd466":"ee4aa5be","chunk-626cc720":"61ca7dbd","chunk-69ab8e14":"e18a06cd","chunk-94d3c3c4":"3c7f5ad9"}[e]+".css",c=i.p+r,u=document.getElementsByTagName("link"),a=0;a<u.length;a++){var d=u[a],l=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(l===r||l===c))return t()}var f=document.getElementsByTagName("style");for(a=0;a<f.length;a++){d=f[a],l=d.getAttribute("data-href");if(l===r||l===c)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||c,u=new Error("Loading CSS chunk "+e+" failed.\n("+r+")");u.code="CSS_CHUNK_LOAD_FAILED",u.request=r,delete o[e],s.parentNode.removeChild(s),n(u)},s.href=c;var h=document.getElementsByTagName("head")[0];h.appendChild(s)})).then((function(){o[e]=0})));var r=c[e];if(0!==r)if(r)t.push(r[2]);else{var u=new Promise((function(t,n){r=c[e]=[t,n]}));t.push(r[2]=u);var d,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=a(e);var f=new Error;d=function(t){l.onerror=l.onload=null,clearTimeout(s);var n=c[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;f.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",f.name="ChunkLoadError",f.type=r,f.request=o,n[1](f)}c[e]=void 0}};var s=setTimeout((function(){d({type:"timeout",target:l})}),12e4);l.onerror=l.onload=d,document.head.appendChild(l)}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"]||[],l=d.push.bind(d);d.push=t,d=d.slice();for(var f=0;f<d.length;f++)t(d[f]);var s=l;n()})([]);</script><script src=static/js/chunk-elementUI.a9f82b5b.js></script><script src=static/js/chunk-libs.8de98ba2.js></script><script src=static/js/app.7782b1e9.js></script></body><script src=./echarts.min.js></script></html>
|
||||
<!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.425905c8.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.a42dddd9.js rel=preload as=script><link href=static/js/chunk-elementUI.a9f82b5b.js rel=preload as=script><link href=static/js/chunk-libs.8de98ba2.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.425905c8.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],f=t[1],i=t[2],l=0,d=[];l<a.length;l++)c=a[l],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&d.push(o[c][0]),o[c]=0;for(r in f)Object.prototype.hasOwnProperty.call(f,r)&&(e[r]=f[r]);s&&s(t);while(d.length)d.shift()();return u.push.apply(u,i||[]),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=f(f.s=n[0]))}return e}var r={},c={runtime:0},o={runtime:0},u=[];function a(e){return f.p+"static/js/"+({}[e]||e)+"."+{"chunk-4f9321d9":"807bff37","chunk-6337fcfc":"ce706d4d","chunk-0efffb9c":"d572da12","chunk-4b70cc7c":"232e9b3d","chunk-69ab8e14":"e2ed086d","chunk-94d3c3c4":"d08f8612"}[e]+".js"}function f(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,f),n.l=!0,n.exports}f.e=function(e){var t=[],n={"chunk-4f9321d9":1,"chunk-0efffb9c":1,"chunk-4b70cc7c":1,"chunk-69ab8e14":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-4f9321d9":"f84b7bf2","chunk-6337fcfc":"31d6cfe0","chunk-0efffb9c":"83e65de7","chunk-4b70cc7c":"55335688","chunk-69ab8e14":"e18a06cd","chunk-94d3c3c4":"3c7f5ad9"}[e]+".css",o=f.p+r,u=document.getElementsByTagName("link"),a=0;a<u.length;a++){var i=u[a],l=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(l===r||l===o))return t()}var d=document.getElementsByTagName("style");for(a=0;a<d.length;a++){i=d[a],l=i.getAttribute("data-href");if(l===r||l===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 i,l=document.createElement("script");l.charset="utf-8",l.timeout=120,f.nc&&l.setAttribute("nonce",f.nc),l.src=a(e);var d=new Error;i=function(t){l.onerror=l.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;d.message="Loading chunk "+e+" failed.\n("+r+": "+c+")",d.name="ChunkLoadError",d.type=r,d.request=c,n[1](d)}o[e]=void 0}};var s=setTimeout((function(){i({type:"timeout",target:l})}),12e4);l.onerror=l.onload=i,document.head.appendChild(l)}return Promise.all(t)},f.m=e,f.c=r,f.d=function(e,t,n){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(f.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)f.d(n,r,function(t){return e[t]}.bind(null,r));return n},f.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="",f.oe=function(e){throw console.error(e),e};var i=window["webpackJsonp"]=window["webpackJsonp"]||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var d=0;d<i.length;d++)t(i[d]);var s=l;n()})([]);</script><script src=static/js/chunk-elementUI.a9f82b5b.js></script><script src=static/js/chunk-libs.8de98ba2.js></script><script src=static/js/app.a42dddd9.js></script></body><script src=./echarts.min.js></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
@ -0,0 +1 @@
|
||||
.el-row[data-v-5b88bfa4]{margin-bottom:20px}.el-row[data-v-5b88bfa4]:last-child{margin-bottom:0}.el-col[data-v-5b88bfa4]{border-radius:4px}.grid-content[data-v-5b88bfa4]{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-5b88bfa4]{height:10vh;line-height:10vh;min-height:60px;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-5b88bfa4]{width:48px;height:48px;margin-left:15px;line-height:100%}.userNum .img .svg-icon[data-v-5b88bfa4]{width:100%;height:100%;vertical-align:baseline!important}.userNum .numCon[data-v-5b88bfa4]{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-5b88bfa4]:first-child{width:100px;height:20px;line-height:20px;font-size:14px;font-weight:400;color:#6b7280;text-align:left;margin-top:2vh}.userNum .numCon div[data-v-5b88bfa4]:last-child{width:100px;height:32px;font-size:24px;font-weight:400;color:#1d2129;margin-top:5px}.search[data-v-5b88bfa4]{height:8vh;min-height:45px;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-5b88bfa4]{width:15vw;margin-left:20px;min-width:170px}.search .el-select[data-v-5b88bfa4]{width:16vw;min-width:160px}.search .addUser[data-v-5b88bfa4]{position:absolute;right:160px}.search .delUser[data-v-5b88bfa4]{position:absolute;right:30px}.table[data-v-5b88bfa4]{height:65vh}.table .title[data-v-5b88bfa4]{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-5b88bfa4]{color:#6b7280;font-size:14px;font-weight:400}.table .tabCon[data-v-5b88bfa4]{width:100%;padding:20px 20px 0 20px;height:100%}.table .tabCon .state[data-v-5b88bfa4]{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-5b88bfa4]{background:rgba(245,63,63,.1);color:#f53f3f}.table .tabCon .el-table[data-v-5b88bfa4]{height:calc(100% - 100px)!important}.el-table thead tr[data-v-5b88bfa4],[data-v-5b88bfa4] .el-table thead th{background-color:#f9fafb!important}[data-v-5b88bfa4] .el-table--border td,[data-v-5b88bfa4] .el-table--border th,[data-v-5b88bfa4] .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:unset!important}.el-table--border[data-v-5b88bfa4],.el-table--group[data-v-5b88bfa4]{border:unset!important}.el-table[data-v-5b88bfa4]:before,[data-v-5b88bfa4] .el-table--border:after,[data-v-5b88bfa4] .el-table--group:after{background-color:unset!important}[data-v-5b88bfa4] .el-table .el-table__body-wrapper td,[data-v-5b88bfa4] .el-table .el-table__body-wrapper th.is-leaf{border-bottom:unset!important}.el-pagination[data-v-5b88bfa4]{position:absolute;right:30px;margin-top:10px}[data-v-5b88bfa4] .el-pager li{border:1px solid #d1d5db;border-radius:4px}[data-v-5b88bfa4] .el-pager li.active{background:#165dff!important;color:#fff!important;border:unset!important}[data-v-5b88bfa4] .el-dialog__title{padding:2px 10px;border-left:3px solid #165dff;font-size:16px;font-weight:400;color:#1d2129}[data-v-5b88bfa4] .avatar-uploader .el-upload{border:1px dashed #dcdfe6;border-radius:6px;cursor:pointer;position:relative;overflow:hidden;width:100px;height:100px}[data-v-5b88bfa4] .avatar-uploader .el-upload:hover{border-color:#409eff}[data-v-5b88bfa4] .avatar-uploader-icon{font-size:28px;color:#8c939d;width:100px;height:100px;line-height:100px;text-align:center}[data-v-5b88bfa4] .avatar{width:100px;height:100px;display:block}[data-v-5b88bfa4] .el-dialog__body{padding:10px 20px 0 20px}[data-v-5b88bfa4] .el-upload__tip{height:25px;line-height:25px}.show-pwd[data-v-5b88bfa4]{position:absolute;right:10px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[data-v-5b88bfa4] .no-status-icon .el-input__icon:after,[data-v-5b88bfa4] .no-status-icon .el-input__icon:before{display:none!important}[data-v-5b88bfa4] .el-table__body-wrapper{max-height:calc(100% - 45px)!important;overflow-y:auto!important}[data-v-5b88bfa4] .userImg{width:32px;height:32px;border-radius:16px}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
1
src/renderer/public/backManage/static/js/app.a42dddd9.js
Normal file
1
src/renderer/public/backManage/static/js/app.a42dddd9.js
Normal file
File diff suppressed because one or more lines are too long
1
src/renderer/public/backManage/static/js/app.af31a9f8.js
Normal file
1
src/renderer/public/backManage/static/js/app.af31a9f8.js
Normal file
File diff suppressed because one or more lines are too long
1
src/renderer/public/backManage/static/js/app.dbb4a339.js
Normal file
1
src/renderer/public/backManage/static/js/app.dbb4a339.js
Normal file
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
@ -1,2 +1,5 @@
|
||||
1,Ψһ<EFBFBD><EFBFBD>ʶ,id
|
||||
2,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,name
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>,<EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD><EFBFBD>,
|
||||
1,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,code,"<EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߸<EFBFBD>ʽ<EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѽ<EFBFBD><EFBFBD>ܴ<EFBFBD><EFBFBD>Ŷ<EFBFBD>Ӧ<EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܴʣ<EFBFBD>"
|
||||
2,<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,dzxiang,
|
||||
3,...,,
|
||||
|
||||
|
2
src/renderer/public/excel/header_old.csv
Normal file
2
src/renderer/public/excel/header_old.csv
Normal file
@ -0,0 +1,2 @@
|
||||
1,Ψһ<EFBFBD><EFBFBD>ʶ,id
|
||||
2,<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,name
|
||||
|
6
src/renderer/public/sdk/YJEarth.min.js
vendored
6
src/renderer/public/sdk/YJEarth.min.js
vendored
File diff suppressed because one or more lines are too long
@ -526,7 +526,6 @@
|
||||
overflow-y: auto;
|
||||
scrollbar-gutter: stable;
|
||||
width: calc(100% + 1px);
|
||||
height: 194px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table .align-center,
|
||||
|
||||
@ -44,9 +44,13 @@ export const GraphApi = {
|
||||
})
|
||||
},
|
||||
//军标类型列表
|
||||
modelTypeList: async () => {
|
||||
modelTypeList: async (data: any) => {
|
||||
return await request.get({
|
||||
url: `/militaryLibrary/militaryTypeTree`
|
||||
url: `/militaryLibrary/militaryTypeTree`,
|
||||
params: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加军标文件
|
||||
|
||||
@ -27,5 +27,12 @@ export const MaterialApi = {
|
||||
url: `/matter/deletes`,
|
||||
data,
|
||||
})
|
||||
},
|
||||
//启用路网数据
|
||||
statistics: async (data: any) => {
|
||||
return await request.post({
|
||||
url: `/matter/statistics`,
|
||||
data,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,9 +44,14 @@ export const ModelApi = {
|
||||
})
|
||||
},
|
||||
//模型类型列表
|
||||
modelTypeList: async () => {
|
||||
modelTypeList: async (data: any) => {
|
||||
|
||||
return await request.get({
|
||||
url: `/modelLibrary/modelTypeList`
|
||||
url: `/modelLibrary/modelTypeList`,
|
||||
params: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加模型文件
|
||||
|
||||
@ -44,9 +44,13 @@ export const PhotoApi = {
|
||||
})
|
||||
},
|
||||
//图标类型列表
|
||||
modelTypeList: async () => {
|
||||
modelTypeList: async (data: any) => {
|
||||
return await request.get({
|
||||
url: `/iconLibrary/iconTypeTree`
|
||||
url: `/iconLibrary/iconTypeTree`,
|
||||
params: data,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
},
|
||||
//添加图标文件
|
||||
|
||||
@ -39,6 +39,12 @@ export const TsApi = {
|
||||
data
|
||||
})
|
||||
},
|
||||
updateTsSource: async (data: any) => {
|
||||
return await request.post({
|
||||
url: '/tsSource/update',
|
||||
data
|
||||
})
|
||||
},
|
||||
///tsSource/addModelSource
|
||||
addTsModelSource: async (data: any) => {
|
||||
return await request.post({
|
||||
|
||||
BIN
src/renderer/src/assets/img/defaultMouse.png
Normal file
BIN
src/renderer/src/assets/img/defaultMouse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 364 B |
@ -602,6 +602,35 @@ img {
|
||||
position: relative;
|
||||
top: 6px;
|
||||
}
|
||||
.mousePosiWords {
|
||||
/* right: 245px !important;
|
||||
bottom: 72px !important; */
|
||||
font-size: 12px !important;
|
||||
flex-direction: column !important;
|
||||
padding-bottom: 10px !important;
|
||||
padding-left: 10px!important;
|
||||
border-radius: 0 !important;
|
||||
border: 1px solid rgba(var(--color-base1), 0.5);
|
||||
background: linear-gradient(180deg, rgba(var(--color-base1), 0.2) 0%, rgba(var(--color-base1), 0) 100%), rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
.mousePosiWords>p:nth-child(1)::before {
|
||||
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAABkSURBVDiN7dBBCoAwDETRjxczN8vR6s3GTZFKm1jElXSgmxIeycDKCgCSTJJ/gRT18Wk8QUqFRrhFyAhSu00yc+EbsANW3yjt/5EcaNW6bepJb1EV1p0d9OlBb/PIA/4eWPlZToLnA8jkPBbrAAAAAElFTkSuQmCC");
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 6px;
|
||||
}
|
||||
.mousePosiWords>p:nth-child(2)::before {
|
||||
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAACkSURBVDiNrZNRDsMgDEPJ1HstN0M7Gd3JvA/CSlsWDMw/larwZJsQAiEACiAys5QAJABgZh+DYF0GGqSAniMGfgETDqXevBDAU3ci4p5xI7c66912r8P/rUoIOa4p1l3OwvR6EQaGF9uLXFZkr/6pfd+zLr/rUrmbi2zAiLvcXRx6eqbXpL+shkNdBUY2LgvUEXfdDkVkX3Z1VXkpzOxGMulF/gCoY8eTaDSlggAAAABJRU5ErkJggg==");
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 6px;
|
||||
}
|
||||
.mousePosiWords>p:nth-child(3)::before {
|
||||
content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAECSURBVDiN1ZQxTsQwEEWfCRUlQuIQNNwgOQANh9hDbAUNHIEWcQQK6hUSNZRLgfYENEiIDj0KHOQNdjZe0fArO+N8/ZkXB/5YAUA9+FUI4XVrV3Wmvqj36p16Mqh36lmt6bV6VKgtVKf47CTrQ2CmzquSjBgCrIBl5lwHMKXt3WT9BjwCz2oTQviMJt22CfeAC+BmcKYdJp2kEpQeSK+ahPtEKGpTSpWOIDeOUSiF+bVJbTEElUL5IELJmOQ0Tly9TW5KE5+tzS9Rt3GuOSgjhk+D/U/aTTelKzR0XOq0CKXygz5fM4y/r/6mPMR9m321oD5AT/mU7zYugXfgqsbsf+kLw8LzMSWqfwIAAAAASUVORK5CYII=");
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 6px;
|
||||
}
|
||||
|
||||
#mapxDiv {
|
||||
bottom: 126px !important;
|
||||
@ -848,3 +877,6 @@ img {
|
||||
.el-popup-parent--hidden {
|
||||
width: 100% !important;
|
||||
}
|
||||
.ts-zyl svg:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@ -10,18 +10,19 @@
|
||||
class="simple-upload"
|
||||
>
|
||||
<el-button class="clickBut" color="#005c5c" :loading="isUploading">
|
||||
<UploadFilled class="mr-2" />
|
||||
<UploadFilled class="mr-2"/>
|
||||
{{ t('auths.upload') }}
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { UploadFilled } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import {UploadFilled} from '@element-plus/icons-vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
const { t } = useI18n()
|
||||
const {t} = useI18n()
|
||||
|
||||
// 组件属性
|
||||
const props = defineProps({
|
||||
@ -52,7 +53,7 @@ const isUploading = ref(false)
|
||||
const uploadUrl = () => {
|
||||
//process.env.BASE_API +
|
||||
console.log(process.env.BASE_API, 'yyyyy')
|
||||
let url = 'http://127.0.0.1:8848' + '/auth/import'
|
||||
let url = (localStorage.getItem("ip") || 'http://127.0.0.1:8848') + '/auth/import'
|
||||
return url
|
||||
}
|
||||
// 上传前处理
|
||||
@ -69,9 +70,14 @@ const handleBeforeUpload = (file: File) => {
|
||||
|
||||
// 上传成功处理
|
||||
const handleSuccess = (response: any) => {
|
||||
isUploading.value = false
|
||||
ElMessage.success('文件上传成功')
|
||||
eventBus.emit('upload', true)
|
||||
if (response.code != 200) {
|
||||
ElMessage.error(response.message)
|
||||
isUploading.value = false
|
||||
} else {
|
||||
isUploading.value = false
|
||||
ElMessage.success('文件授权成功')
|
||||
eventBus.emit('upload', true)
|
||||
}
|
||||
// 可以在这里添加成功后的其他逻辑
|
||||
}
|
||||
|
||||
@ -87,6 +93,7 @@ const handleError = (error: Error) => {
|
||||
.simple-upload {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
::v-deep .clickBut:hover {
|
||||
color: rgba(0, 255, 255, 1) !important;
|
||||
}
|
||||
|
||||
1
src/renderer/src/icons/svg/addEventTs.svg
Normal file
1
src/renderer/src/icons/svg/addEventTs.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M5.25 0L5.25 2.25L4.5 2.25L4.5 3.75L10.5 3.75L10.5 9.75001L4.5 9.75001L4.5 12L3.75 12L3.75 9.75001L1.5 9.75001L1.5 3.75L3.75 3.75L3.75 2.25L3 2.25L3 0L5.25 0ZM3.75 4.5L2.25 4.5L2.25 9.00001L3.75 9.00001L3.75 4.5ZM9.75 4.5L4.5 4.5L4.5 9.00001L9.75 9.00001L9.75 4.5ZM0.75 4.5L0.75 9.00001L0 9.00001L0 4.5L0.75 4.5ZM12 4.5L12 9.00001L11.25 9.00001L11.25 4.5L12 4.5ZM5.625 5.5965L7.125 6.7215L5.625 7.8465L5.625 5.5965ZM4.5 0.75L3.75 0.75L3.75 1.5L4.5 1.5L4.5 0.75Z" fill="#00FFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 641 B |
1
src/renderer/src/icons/svg/importjb.svg
Normal file
1
src/renderer/src/icons/svg/importjb.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M11.9945 3.16658L11.9945 1.72069L11.8696 1.76315C11.7546 1.80224 11.6333 1.82206 11.5089 1.82206C10.8828 1.82206 10.3734 1.31252 10.3734 0.686229C10.3734 0.496399 10.4217 0.307378 10.5131 0.139709L10.5893 0L1.35472 0L1.43096 0.139709C1.52365 0.309763 1.57068 0.493652 1.57068 0.686229C1.57068 1.31252 1.06127 1.82206 0.435165 1.82206C0.32984 1.82206 0.223893 1.80708 0.120231 1.77772L0 1.74355L0 3.98349L0.0024578 4.07801L0.00456869 4.07801C0.0895516 7.30379 1.34444 9.2099 2.38795 10.2433C3.61319 11.4568 5.08176 12 5.99355 12C6.9027 12 8.36882 11.4519 9.59474 10.2273C10.6411 9.18205 11.9068 7.25086 11.9945 3.98491C12.0018 3.72074 12.0018 3.44537 11.9945 3.16658ZM11.0184 3.9475L11.0184 3.94887L11.0184 3.95882C10.9843 5.22756 10.7554 6.37681 10.3381 7.3747C9.98613 8.21526 9.50502 8.94481 8.90823 9.54304C8.42305 10.0295 7.84866 10.4312 7.24719 10.7049C6.64016 10.9811 6.20122 11.0224 5.99355 11.0224C5.73833 11.0224 5.31265 10.9679 4.73454 10.7083C4.14061 10.4421 3.56674 10.0433 3.07487 9.55492C2.47425 8.95903 1.99204 8.23172 1.64167 7.39326C1.22518 6.39326 1.00174 5.24011 0.97739 3.96583L0.974875 2.72766C1.79865 2.51 2.4087 1.8204 2.52529 0.976346L9.41639 0.976346C9.5352 1.83046 10.1786 2.5396 11.0184 2.74058L11.0185 3.19018C11.0258 3.44636 11.0258 3.70115 11.0184 3.9475ZM6.02183 2.0696L4.93329 4.27731L2.49784 4.63114L4.25987 6.34914L3.84349 8.77481L6.02183 7.62984L8.20017 8.77481L7.78392 6.34915L9.54589 4.63115L7.11044 4.27732L6.02183 2.0696ZM6.90338 6.98983L6.02177 6.52686L5.13988 6.99109L5.30783 6.0088L4.59395 5.31303L5.58032 5.16978L6.02065 4.27601L6.46091 5.16978L7.44733 5.31303L6.73327 6.00892L6.90338 6.98983Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
1
src/renderer/src/icons/svg/importtb.svg
Normal file
1
src/renderer/src/icons/svg/importtb.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" height="12.00048828125" viewBox="0 0 12 12.00048828125" fill="none"><path d="M1.19473 4.35774L1.19473 1.80664C1.19473 1.4693 1.46881 1.19522 1.80615 1.19522L10.1939 1.19522C10.5312 1.19522 10.8053 1.4693 10.8053 1.80664L10.8053 10.1943C10.8053 10.5317 10.5312 10.8058 10.1939 10.8058L7.64275 10.8058C7.31245 10.8058 7.04539 11.0728 7.04539 11.4031C7.04539 11.7334 7.31245 12.0005 7.64275 12.0005L10.7859 12.0005C11.4571 12.0005 12 11.4558 12 10.7864L12 1.21454C12 0.543388 11.4553 0.000488281 10.7859 0.000488281L1.21406 0.000488281C0.542899 0.000488281 0 0.545144 0 1.21454L0 4.35774C0 4.68805 0.267057 4.9551 0.597365 4.9551C0.927672 4.9551 1.19473 4.68805 1.19473 4.35774Z" fill="#FFFFFF" ></path><path d="M6.20029 8.62372L6.19854 8.62196L3.84949 6.27291C3.61581 6.03924 3.23807 6.03924 3.00439 6.27291C2.77072 6.50659 2.77072 6.88433 3.00439 7.11801L4.33792 8.45154L0.597365 8.45154C0.267057 8.45154 0 8.7186 0 9.0489C0 9.37921 0.267057 9.64627 0.597365 9.64627L4.33441 9.64627L3.00439 10.9763C2.77072 11.21 2.77072 11.5877 3.00439 11.8214C3.23807 12.0551 3.61581 12.0551 3.84949 11.8214L6.16164 9.50922C6.29341 9.40029 6.37775 9.23514 6.37775 9.05066C6.37775 8.88199 6.30923 8.73265 6.20029 8.62372Z" fill="#FFFFFF" ></path></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -33,7 +33,7 @@
|
||||
>搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="treeBox">
|
||||
<div class="treeBox custom_scroll_bar_ts">
|
||||
<ul id="treeDemos" class="ztree"></ul>
|
||||
<rightMenuTs ref="rightMenuRef" class="absolute zIndex99"></rightMenuTs>
|
||||
</div>
|
||||
@ -50,6 +50,7 @@ import {useTreeNode} from "../components/tree/hooks/treeNode";
|
||||
import {$changeComponentShow} from "../../utils/communication";
|
||||
import {debounce} from '@/utils'
|
||||
|
||||
let canCheckType: Array<any> = ['directory', 'gdslImagery', 'terrain', 'tileset', 'arcgisWximagery', 'arcgisBlueImagery', 'gdlwImagery']
|
||||
const {getSelectedNodes, cusSelectNode, getSameLevel, cusNodeIcon, nodeType} = useTreeNode()
|
||||
import {showRightMenuTs} from "./tree"
|
||||
import {TsApi} from "../../api/ts";
|
||||
@ -144,13 +145,21 @@ const initTreeCallBack = () => {
|
||||
}
|
||||
let detail = typeof arr[i].detail == 'string' ? JSON.parse(arr[i].detail || '{}') : arr[i].detail
|
||||
let params = typeof arr[i].params == 'string' ? JSON.parse(arr[i].params || '{}') : arr[i].params
|
||||
if (!detail.name) {
|
||||
detail.name = arr[i].sourceName
|
||||
}
|
||||
if (!detail.id) {
|
||||
detail.id = arr[i].id
|
||||
if (detail) {
|
||||
if (!detail.name) {
|
||||
detail.name = arr[i].sourceName
|
||||
}
|
||||
if (!detail.id) {
|
||||
detail.id = arr[i].id
|
||||
}
|
||||
}
|
||||
if (layerTypes.includes(arr[i].sourceType)) {
|
||||
if (!detail && !params) {
|
||||
detail = {
|
||||
id: arr[i].id,
|
||||
name: arr[i].sourceName
|
||||
}
|
||||
}
|
||||
layers.push(
|
||||
{
|
||||
sourceType: arr[i].sourceType,
|
||||
@ -186,7 +195,7 @@ const initTreeCallBack = () => {
|
||||
});
|
||||
if ((window as any).earth_ts) {
|
||||
for (let i = 0; i < layers.length; i++) {
|
||||
// initMapData(layers[i].sourceType, layers[i].detail, null)
|
||||
initMapData(layers[i].sourceType, layers[i].detail, null)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -217,6 +226,89 @@ const onClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
// YJ.Global.splitScreen.setActiveId(source_ids);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 捕获 checkbox / radio 被勾选 或 取消勾选的事件回调函数
|
||||
* @param event
|
||||
* @param treeId
|
||||
* @param treeNode
|
||||
*/
|
||||
const onCheck = (event: any, treeId: any, treeNode: any) => {
|
||||
console.log(treeNode, 'treeNode')
|
||||
let p_ids: any = []
|
||||
let parentNode = treeNode.getParentNode();
|
||||
if (parentNode) {
|
||||
checkChildNodes(parentNode);
|
||||
}
|
||||
|
||||
|
||||
// 检查子节点状态,更新父节点
|
||||
function checkChildNodes(parentNode) {
|
||||
var children = parentNode.children;
|
||||
if (!children || children.length === 0) return;
|
||||
|
||||
// 检查是否所有子节点都未被选中
|
||||
var allUnchecked = true;
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var childNode = children[i];
|
||||
// 如果有任何一个子节点被选中,则父节点不应被取消
|
||||
if (childNode.isShow) {
|
||||
allUnchecked = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果所有子节点都未被选中,且父节点当前是选中状态,则取消父节点选择
|
||||
if (allUnchecked && parentNode.isShow) {
|
||||
p_ids.push(
|
||||
{
|
||||
id: parentNode.id,
|
||||
isShow: 0
|
||||
}
|
||||
)
|
||||
window['treeObj'].checkNode(parentNode, false, true);
|
||||
} else {
|
||||
p_ids.push(
|
||||
{
|
||||
id: parentNode.id,
|
||||
isShow: 1
|
||||
}
|
||||
)
|
||||
}
|
||||
// 递归检查上一级父节点
|
||||
var grandParent = parentNode.getParentNode();
|
||||
if (grandParent) {
|
||||
checkChildNodes(grandParent);
|
||||
}
|
||||
}
|
||||
|
||||
let ids = [...p_ids]
|
||||
|
||||
|
||||
function sourceStatus(node) {
|
||||
if (canCheckType.includes(node.sourceType)) {
|
||||
ids.push({id: node.id, isShow: node.isShow ? 1 : 0})
|
||||
console.log(node)
|
||||
let entityObject
|
||||
entityObject = (window as any)._entityMap.get(node.id)
|
||||
if (entityObject) {
|
||||
entityObject.show = node.isShow;
|
||||
|
||||
// cusUpdateNode({id: node.id, sourceName: node.sourceName, params: JSON.stringify(params)})
|
||||
}
|
||||
}
|
||||
|
||||
if (node.sourceType === 'directory') {
|
||||
if (node.children && node.children.length > 0) {
|
||||
node.children.forEach((item) => {
|
||||
sourceStatus(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceStatus(treeNode)
|
||||
console.log("ids", ids)
|
||||
}
|
||||
const onMouseDown = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
console.log("onMouseDown")
|
||||
let isShift = event.shiftKey
|
||||
@ -244,6 +336,10 @@ const onMouseDown = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
}
|
||||
}
|
||||
let rightClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
if (window['tsObj']._Clock._status == 'play') {
|
||||
ElMessage({message: "态势推演中,暂停或停止后再试"})
|
||||
return;
|
||||
}
|
||||
let selectNodes = getSelectedNodes(treeObj.value)
|
||||
let isnewSelect = true //是否为新选中
|
||||
selectNodes.forEach((item: any) => {
|
||||
@ -251,7 +347,14 @@ let rightClick = (event: MouseEvent, treeId: string, treeNode: any) => {
|
||||
})
|
||||
if (!event.ctrlKey && (selectNodes.length < 2 || isnewSelect))
|
||||
cusSelectNode(treeObj.value, treeNode)
|
||||
const menus = showRightMenuTs(event, treeObj.value, getSelectedNodes(treeObj.value), nodeType)
|
||||
let menus = showRightMenuTs(event, treeObj.value, getSelectedNodes(treeObj.value), nodeType)
|
||||
if (canCheckType.includes(treeNode.sourceType) && treeNode.sourceType != 'directory') {
|
||||
let customView
|
||||
let entity = window['_entityMap'].get(treeNode.id)
|
||||
customView = Boolean(entity.customView && entity.customView.orientation)
|
||||
|
||||
menus = [...menus, customView ? 'resetView' : 'setView']
|
||||
}
|
||||
console.log('menus', menus)
|
||||
if (menus.length == 0) {
|
||||
// $changeComponentShow('.rightMenu', false)
|
||||
@ -299,6 +402,7 @@ const setting = {
|
||||
onMouseDown: onMouseDown,
|
||||
onRightClick: rightClick,
|
||||
onClick: onClick,
|
||||
onCheck: onCheck,
|
||||
onDblClick: onDblClick
|
||||
/*
|
||||
onClick: this.onClick,
|
||||
@ -362,6 +466,7 @@ defineExpose({
|
||||
.treeBox {
|
||||
//border: 1px solid red;
|
||||
flex: auto;
|
||||
overflow-y: auto;
|
||||
|
||||
.ztree {
|
||||
height: 100%;
|
||||
|
||||
112
src/renderer/src/views/TS/components/MouseRight.vue
Normal file
112
src/renderer/src/views/TS/components/MouseRight.vue
Normal file
@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div class="MouseRight">
|
||||
<div v-for="item in menus" class="item" @click="item.fun">
|
||||
<svg-icon :name="item.key" :size="14"></svg-icon>
|
||||
{{ item.name }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue'
|
||||
import {TsApi} from "../../../api/ts";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {useRightOperate} from './rightOperate'
|
||||
|
||||
let {delNode, addEvent} = useRightOperate()
|
||||
|
||||
const eventBus: any = inject("bus");
|
||||
let setOrReset = ref(1)
|
||||
let setView = (flag) => {
|
||||
// let cusView = window['YJ'].Global.getCurrentView(window['earth_ts'])
|
||||
let node = window['treeObj'].getNodeByParam("id", window['selectedIdTs'], null);
|
||||
let {
|
||||
id,
|
||||
sourceName,
|
||||
sourceType,
|
||||
sourcePath,
|
||||
parentId,
|
||||
isShow,
|
||||
detail,
|
||||
params,
|
||||
planId,
|
||||
} = node
|
||||
let entity = window['_entityMap'].get(id)
|
||||
if (flag)
|
||||
entity.setCustomView()
|
||||
|
||||
else
|
||||
entity.resetCustomView()
|
||||
const detailobj = {...JSON.parse(detail ?? '{}'), customView: flag ? entity.customView : null};
|
||||
let obj = {
|
||||
id,
|
||||
sourceName,
|
||||
sourceType,
|
||||
sourcePath,
|
||||
parentId,
|
||||
treeIndex: node.getIndex(),
|
||||
isShow: isShow ? 1 : 0,
|
||||
detail: JSON.stringify(detailobj),
|
||||
params,
|
||||
planId
|
||||
}
|
||||
TsApi.updateTsSource(obj).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({type: "success", message: "操作成功"})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let deleteNode = () => {
|
||||
let node = window['treeObj'].getNodeByParam("id", window['selectedIdTs'], null);
|
||||
delNode(node, eventBus)
|
||||
}
|
||||
let addEventTs = () => {
|
||||
let node = window['treeObj'].getNodeByParam("id", window['selectedIdTs'], null);
|
||||
addEvent(node, eventBus)
|
||||
}
|
||||
let menus = ref([
|
||||
{name: "添加态势事件", key: "addEventTs", fun: addEventTs},
|
||||
{},
|
||||
{
|
||||
name: '删除', key: "delModel", fun: deleteNode
|
||||
}
|
||||
])
|
||||
|
||||
eventBus.on("initMenus", () => {
|
||||
let customView
|
||||
let entity = window['_entityMap'].get(window['selectedIdTs'])
|
||||
customView = Boolean(entity.customView && entity.customView.orientation)
|
||||
setOrReset.value = customView ? 0 : 1
|
||||
menus.value[1] =
|
||||
{
|
||||
name: setOrReset.value ? "视角设定" : "重置视角", key: setOrReset.value ? "setView" : "resetView", fun: () => {
|
||||
setView(setOrReset.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.MouseRight {
|
||||
position: absolute;
|
||||
z-index: 999;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
//width: 110px;
|
||||
padding: 5px;
|
||||
display: none;
|
||||
|
||||
.item {
|
||||
padding: 0 5px;
|
||||
font-size: 15px;
|
||||
|
||||
&:hover {
|
||||
color: #0ff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -5,14 +5,14 @@
|
||||
<span class="title">{{ eventObj.name }}</span>
|
||||
<div class="eventDetail">
|
||||
<template v-if="eventObj.callback&&eventObj.callback=='flicker'">
|
||||
<div>
|
||||
闪烁间隔
|
||||
<el-input v-model="detail.times" style="width: 50%" placeholder="Please input"/>
|
||||
秒
|
||||
</div>
|
||||
<!-- <div>
|
||||
闪烁间隔
|
||||
<el-input v-model="detail.times" style="width: 50%" placeholder="Please input"/>
|
||||
秒
|
||||
</div>-->
|
||||
<div>
|
||||
闪烁次数
|
||||
<el-input v-model="detail.numbers" style="width: 50%" placeholder="Please input"/>
|
||||
<el-input v-model="detail.numbers" style="width: 50%" placeholder="请输入闪烁次数"/>
|
||||
次
|
||||
</div>
|
||||
</template>
|
||||
@ -35,11 +35,12 @@
|
||||
<script lang="ts" setup>
|
||||
import {inject, ref} from 'vue'
|
||||
import {TsApi} from "../../../api/ts";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const times = ref(0)
|
||||
const numbers = ref(0)
|
||||
|
||||
const detail:any = ref({})
|
||||
const detail: any = ref({})
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
let eventObj: any = ref(null)
|
||||
@ -63,6 +64,14 @@ eventBus.on('click-event-show-plane', (params) => {
|
||||
const updateEvent = () => {
|
||||
// console.log(detail.value)
|
||||
let obj = eventObj.value
|
||||
let durationS = eventObj.value.duration_time
|
||||
if (!durationS)
|
||||
durationS = (eventObj.value.endTime - eventObj.value.startTime) / 1000
|
||||
switch (eventObj.value.callback) {
|
||||
case "flicker":
|
||||
detail.value.times = Number((durationS / detail.value.numbers).toFixed(2))
|
||||
break
|
||||
}
|
||||
obj.detail = JSON.stringify(detail.value)
|
||||
console.log(obj)
|
||||
delete obj.createdAt
|
||||
@ -70,6 +79,10 @@ const updateEvent = () => {
|
||||
delete obj.duration_time
|
||||
TsApi.updateTsEvent(obj).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({type: "success", message: "操作成功"})
|
||||
cancel()
|
||||
}
|
||||
})
|
||||
}
|
||||
const cancel = () => {
|
||||
@ -77,6 +90,9 @@ const cancel = () => {
|
||||
detail.value = {}
|
||||
eventBus.emit('click-cancel-hide-plane',)
|
||||
}
|
||||
eventBus.on('delete-event', () => {
|
||||
cancel()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
format(item.key, event[item.key])
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div :style="style">
|
||||
<!--aa-->
|
||||
</div>
|
||||
@ -52,6 +53,7 @@
|
||||
import {computed, onMounted, ref, nextTick} from "vue"
|
||||
import {TsApi} from "../../../api/ts";
|
||||
import {ElMessage} from "element-plus";
|
||||
import * as electron from "electron";
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
const props = defineProps(['eventList',])
|
||||
@ -61,6 +63,16 @@ const menus = ref([
|
||||
fun:
|
||||
() => {
|
||||
delEvent([rightClickEvent.value.id], () => {
|
||||
switch (rightClickEvent.value.callback) {
|
||||
case 'move':
|
||||
let entityId = rightClickEvent.value.id + 'move' + rightClickEvent.value.sourceId
|
||||
let entity = window['_entityMap'].get(entityId)
|
||||
if (entity) {
|
||||
entity.setMovePositionByTime(0)
|
||||
window['_entityMap'].delete(entityId)
|
||||
}
|
||||
break;
|
||||
}
|
||||
ElMessage({message: "操作成功", type: "success"})
|
||||
rightClickEvent.value = null
|
||||
|
||||
@ -80,6 +92,7 @@ const delEvent = (ids, cb) => {
|
||||
if (res.code == 200) {
|
||||
eventBus.emit('delete-event', ids)
|
||||
cb()
|
||||
hideRightMenu({target: {innerHTML: "sss"}})
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -114,16 +127,28 @@ let getStyle = computed(() => {
|
||||
})
|
||||
const rightClick = (e, eventObj) => {
|
||||
console.log("右键点击", e)
|
||||
rightClickEvent.value = eventObj
|
||||
nextTick(() => {
|
||||
$(".gridRightMenu")[0].style.top = e.layerY + "px"
|
||||
$(".gridRightMenu")[0].style.left = e.layerX + "px"
|
||||
})
|
||||
|
||||
if (window['tsObj']._Clock._status !== 'play') {
|
||||
rightClickEvent.value = eventObj
|
||||
|
||||
|
||||
nextTick(() => {
|
||||
let parentHeight = parseInt(window.getComputedStyle($(".grid-body")[0]).height)//203
|
||||
let height = parseInt(window.getComputedStyle($(".gridRightMenu")[0]).height)//65
|
||||
let maxTop = parentHeight - height//138
|
||||
let offset = e.layerY > maxTop ? maxTop : e.layerY
|
||||
$(".gridRightMenu")[0].style.top = offset + "px"
|
||||
$(".gridRightMenu")[0].style.left = e.layerX + "px"
|
||||
})
|
||||
} else {
|
||||
ElMessage({message: "请先暂定或者停止播放"})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const hideRightMenu = (e) => {
|
||||
console.log("hideRightMenu", e)
|
||||
if (e.target.innerHTML != "删除")
|
||||
if (e && e.target.innerHTML != "删除")
|
||||
rightClickEvent.value = null
|
||||
}
|
||||
eventBus.on('click-event-show-plane', (params) => {
|
||||
@ -137,7 +162,10 @@ onMounted(() => {
|
||||
for (let i = 0; i < doms.length; i++) {
|
||||
doms[i].style.lineHeight = "19px"
|
||||
}*/
|
||||
let panelHeight = window['tsObj']._Store.getDomElement(".chart", 0).getBoundingClientRect().height
|
||||
let panel = window['tsObj']._Store.getDomElement(".chart", 0)
|
||||
if (!panel)
|
||||
return
|
||||
let panelHeight = panel.getBoundingClientRect().height
|
||||
|
||||
// 转为字符串并按 "." 分割
|
||||
const [whole, decimalStr] = String(panelHeight).split('.');
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
@click="itemClicks(item)"
|
||||
>
|
||||
<div class="itemIcon">
|
||||
<svg-icon :name="item.key" :size="14"></svg-icon>
|
||||
<svg-icon :name="item.icon||item.key" :size="14"></svg-icon>
|
||||
</div>
|
||||
<div class="itemText">
|
||||
{{ t(`rightMenu.${item.key}`) }}
|
||||
@ -48,6 +48,7 @@ const itemClicks = (item) => {
|
||||
const initMenus = (arr: any, treeNode: any) => {
|
||||
let rightMenu: any = []
|
||||
console.log('rightMenu2222', rightMenu)
|
||||
console.log('arr', arr)
|
||||
if (treeNode) {
|
||||
rightClickTreeNode.value = treeNode
|
||||
arr.forEach((menuId: any) => {
|
||||
|
||||
@ -66,27 +66,27 @@ export const useRightOperate = () => {
|
||||
// @ts-ignore
|
||||
let name = getLastPathComponent(item, ['clt', 'json', 'pak', 'kml', 'kmz', 'shp', 'geojson', 'geoJson', 'czml', 'jct', 'mif', 'tab', 'csv']);
|
||||
let sourceType = "layer";
|
||||
if (item.endsWith(".clt") || item.endsWith(".json")) {
|
||||
sourceType = "tileset";
|
||||
} else if (item.endsWith(".pak")) {
|
||||
sourceType = "Terrain";
|
||||
} else if (item.endsWith(".kml") || item.endsWith(".kmz")) {
|
||||
sourceType = "kml";
|
||||
} else if (item.endsWith(".shp")) {
|
||||
sourceType = "shp";
|
||||
} else if (item.endsWith(".geojson") || item.endsWith(".geoJson")) {
|
||||
sourceType = "geojson";
|
||||
} else if (item.endsWith(".czml")) {
|
||||
sourceType = "czml";
|
||||
} else if (item.endsWith(".jct")) {
|
||||
sourceType = "bim";
|
||||
} else if (item.endsWith(".mif")) {
|
||||
sourceType = "shp";
|
||||
} else if (item.endsWith(".tab")) {
|
||||
sourceType = "shp";
|
||||
} else if (item.endsWith(".csv")) {
|
||||
sourceType = "csv";
|
||||
}
|
||||
/* if (item.endsWith(".clt") || item.endsWith(".json")) {
|
||||
sourceType = "tileset";
|
||||
} else if (item.endsWith(".pak")) {
|
||||
sourceType = "terrain";
|
||||
} else if (item.endsWith(".kml") || item.endsWith(".kmz")) {
|
||||
sourceType = "kml";
|
||||
} else if (item.endsWith(".shp")) {
|
||||
sourceType = "shp";
|
||||
} else if (item.endsWith(".geojson") || item.endsWith(".geoJson")) {
|
||||
sourceType = "geojson";
|
||||
} else if (item.endsWith(".czml")) {
|
||||
sourceType = "czml";
|
||||
} else if (item.endsWith(".jct")) {
|
||||
sourceType = "bim";
|
||||
} else if (item.endsWith(".mif")) {
|
||||
sourceType = "shp";
|
||||
} else if (item.endsWith(".tab")) {
|
||||
sourceType = "shp";
|
||||
} else if (item.endsWith(".csv")) {
|
||||
sourceType = "csv";
|
||||
}*/
|
||||
// 获取最后一个点的位置
|
||||
const lastDotIndex = filePaths[0].lastIndexOf('.');
|
||||
|
||||
@ -128,11 +128,14 @@ export const useRightOperate = () => {
|
||||
}
|
||||
let detail = JSON.parse(res.data.detail)
|
||||
let mapParams = {...detail, ...res.data.params}
|
||||
if (res.data.sourceType)
|
||||
sourceType = res.data.sourceType
|
||||
initMapData(sourceType, mapParams, entity => {
|
||||
entity.flyTo()
|
||||
|
||||
let selectedNode = window.treeObj.getNodeByParam('id', parentId)
|
||||
//
|
||||
console.log("添加到树上")
|
||||
cusAddNodes(window.treeObj, selectedNode, [res.data], true)
|
||||
})
|
||||
}
|
||||
@ -186,6 +189,49 @@ export const useRightOperate = () => {
|
||||
const addEvent = (node, eventBus) => {
|
||||
eventBus.emit('openAddEvent', node)
|
||||
}
|
||||
|
||||
|
||||
let setOrResetView = (setOrReset, node) => {
|
||||
let {
|
||||
id,
|
||||
sourceName,
|
||||
sourceType,
|
||||
sourcePath,
|
||||
parentId,
|
||||
isShow,
|
||||
detail,
|
||||
params,
|
||||
planId,
|
||||
} = node
|
||||
let entity = window['_entityMap'].get(id)
|
||||
if (setOrReset)
|
||||
entity.setCustomView()
|
||||
else entity.resetCustomView()
|
||||
const detailobj = {...JSON.parse(detail ?? '{}'), customView: setOrReset ? entity.customView : null};
|
||||
let obj = {
|
||||
id,
|
||||
sourceName,
|
||||
sourceType,
|
||||
sourcePath,
|
||||
parentId,
|
||||
treeIndex: node.getIndex(),
|
||||
isShow: isShow ? 1 : 0,
|
||||
detail: JSON.stringify(detailobj),
|
||||
params,
|
||||
planId
|
||||
}
|
||||
TsApi.updateTsSource(obj).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({type: "success", message: "操作成功"})
|
||||
}
|
||||
})
|
||||
}
|
||||
const setView = (node) => {
|
||||
setOrResetView(true, node)
|
||||
}
|
||||
const resetView = (node) => {
|
||||
setOrResetView(false, node)
|
||||
}
|
||||
const rightMenus: any = reactive({
|
||||
addDirectory: {
|
||||
key: 'addDirectory',
|
||||
@ -205,11 +251,22 @@ export const useRightOperate = () => {
|
||||
},
|
||||
addEvent: {
|
||||
key: 'addEvent',
|
||||
icon: 'addEventTs',
|
||||
callback: addEvent
|
||||
},
|
||||
setView: {
|
||||
key: 'setView',
|
||||
icon: 'setView',
|
||||
callback: setView
|
||||
},
|
||||
resetView: {
|
||||
key: 'resetView',
|
||||
icon: 'resetView',
|
||||
callback: resetView
|
||||
}
|
||||
|
||||
})
|
||||
return {
|
||||
rightMenus
|
||||
rightMenus, delNode, addEvent
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,16 +18,18 @@
|
||||
<el-icon :size="20" @click="stopCallBack('stop')">
|
||||
<RefreshLeft/>
|
||||
</el-icon>
|
||||
<!--:before-show="handleBeforeShow"-->
|
||||
<el-popover
|
||||
ref="multiplierPopover"
|
||||
placement="top"
|
||||
:width="92"
|
||||
trigger="click"
|
||||
trigger="manual"
|
||||
:teleported="false"
|
||||
v-model:visible="isPopoverShow"
|
||||
popper-style="background: transparent !important;color:#fff;padding:0;min-width:50px"
|
||||
>
|
||||
<template #reference>
|
||||
<span class="el-icon">{{ TSOBJ._Store._multiplier }}×</span>
|
||||
<span class="" @click="handleReferenceClick">{{ TSOBJ._Store._multiplier }}×</span>
|
||||
</template>
|
||||
<div class="multiplierBox">
|
||||
<span v-for="item in multipliers"
|
||||
@ -56,7 +58,7 @@
|
||||
<!-- 左侧事件列表 -->
|
||||
<grid :eventList="TSOBJ._Store._tasks"></grid>
|
||||
<!--右侧时间轴容器-->
|
||||
<div class="TLContainer" id="custom-container">
|
||||
<div class="TLContainer " id="custom-container">
|
||||
<div class="timelineCursorBox" :style="{ left: `${cursorLeft || 0}px` }">
|
||||
<!--@mousedown="mousedown" :style="cursorStyle"-->
|
||||
<!--@mouseup="mouseup"-->
|
||||
@ -69,7 +71,8 @@
|
||||
:originMainOffset="originMainOffset">
|
||||
</timeScale>
|
||||
<!-- 事件色块 -->
|
||||
<chart :eventList="TSOBJ._Store._tasks" :hr="hr" :originHrOffset="originHrOffset" :scrollLeft="scrollLeft">
|
||||
<chart :eventList="TSOBJ._Store._tasks" :hr="hr" :originHrOffset="originHrOffset" :scrollLeft="scrollLeft"
|
||||
class="custom_scroll_bar_ts">
|
||||
</chart>
|
||||
</div>
|
||||
</div>
|
||||
@ -88,7 +91,7 @@ import Grid from "./components/grid.vue"
|
||||
import TimeScale from "./components/timeScale.vue"
|
||||
import Chart from "./components/chart.vue"
|
||||
import {ref, onBeforeUnmount, getCurrentInstance} from "vue"
|
||||
import {ElPopover} from 'element-plus'; // 确保导入ElPopover(按需导入时)
|
||||
import {ElMessage, ElPopover} from 'element-plus'; // 确保导入ElPopover(按需导入时)
|
||||
// import {dragElement} from "./util/drag.js";
|
||||
import dragLeftRight from './util/dragLeftRight.js';
|
||||
|
||||
@ -102,7 +105,10 @@ if (instance) {
|
||||
}
|
||||
// 注册拖拽指令
|
||||
// 1. 创建ref引用,绑定到el-popover组件
|
||||
const multiplierPopover = ref<InstanceType<typeof ElPopover> | null>(null);
|
||||
// const multiplierPopover = ref<InstanceType<typeof ElPopover> | null>(null);
|
||||
const multiplierPopover = ref(null);
|
||||
// 控制 popover 显示/隐藏的核心变量(替代实例方法)
|
||||
const isPopoverShow = ref(false);
|
||||
let multipliers = [16, 8, 4, 2, 1, 0.5, 0.25]
|
||||
let currentStamp = ref(window['tsObj']._Store._startTimestamp)
|
||||
let maxLevel = ref(24)
|
||||
@ -147,6 +153,21 @@ let handleMultiplierChange = (multiplier) => {
|
||||
props.TSOBJ._Store._multiplier = multiplier
|
||||
multiplierPopover.value?.hide();
|
||||
}
|
||||
|
||||
const handleReferenceClick = async () => {
|
||||
// 执行校验逻辑(支持同步/异步)
|
||||
const canShow = window['tsObj']._Clock._status !== 'play';
|
||||
console.log(multiplierPopover.value)
|
||||
if (canShow) {
|
||||
// 校验通过:手动显示 popover
|
||||
isPopoverShow.value = true; // 校验通过:显示
|
||||
} else {
|
||||
// 校验不通过:提示或不操作
|
||||
ElMessage.warning("态势推演中,暂停或停止后再试");
|
||||
// 可选:如果之前显示了,手动隐藏
|
||||
isPopoverShow.value = false; // 校验通过:显示
|
||||
}
|
||||
};
|
||||
let formatTime = (timeStamp) => {
|
||||
return props.TSOBJ.parseTime(timeStamp)
|
||||
}
|
||||
@ -275,6 +296,8 @@ let eventCallback = () => {
|
||||
taskIds.push(keys[i]);
|
||||
}
|
||||
}
|
||||
console.log("taskIds", taskIds)
|
||||
console.log("timeId", timeId)
|
||||
taskIds.forEach((item) => {
|
||||
let res = map.get(item);
|
||||
todoEvent(timeId, res, isEnd);
|
||||
@ -334,7 +357,10 @@ const handleDrag = (newLeft: number) => {
|
||||
};
|
||||
let add = (num) => {
|
||||
// 大格12个取值,小格间距3个取值,level,8-1
|
||||
|
||||
if (window['tsObj']._Clock._status == 'play') {
|
||||
ElMessage({message: "态势推演中,暂停或停止后再试"})
|
||||
return;
|
||||
}
|
||||
let res = level.value + num
|
||||
if (res <= maxLevel.value && res >= minLevel.value) {
|
||||
level.value += num
|
||||
@ -349,6 +375,7 @@ let add = (num) => {
|
||||
onBeforeUnmount(() => {
|
||||
// props.TSOBJ._Clock.stopAnimation()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -474,5 +501,24 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.custom_scroll_bar_ts {
|
||||
&::-webkit-scrollbar {
|
||||
width: 8px; /* 竖滚动条宽度(横滚动条用 height) */
|
||||
height: 8px; /* 横滚动条高度(不需要可设为0) */
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
border-radius: 1em;
|
||||
background-color: rgba(0, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
content="推演描述"
|
||||
placement="top"
|
||||
>
|
||||
<svg-icon @click="isShowPup = true" :size="20" class="icon-svg-item" name="des_detail"/>
|
||||
<svg-icon @click="showInfo" :size="20" class="icon-svg-item" name="des_detail"/>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
<div class="titles">实景三维态势推演系统</div>
|
||||
@ -39,6 +39,7 @@
|
||||
<deduction :TSOBJ="tsOBJ"></deduction>
|
||||
<newEvent></newEvent>
|
||||
<addDirectory class="adddirectoryBox absolute zIndex999"></addDirectory>
|
||||
<mouseRight></mouseRight>
|
||||
|
||||
<!-- 方案描述编辑框 -->
|
||||
<!--<div class="dialogBox">-->
|
||||
@ -110,19 +111,22 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
//@ts-nocheck
|
||||
import {ref, reactive, onMounted, nextTick, onUnmounted} from "vue";
|
||||
import {ref, reactive, onMounted, nextTick, onUnmounted,} from "vue";
|
||||
import {useRouter, useRoute} from "vue-router";
|
||||
import Cabin from "./cabin.vue"
|
||||
import Element from "./element.vue"
|
||||
import NewEvent from "./newEvent.vue"
|
||||
import Deduction from "./deduction.vue";
|
||||
import AddDirectory from './components/tsdirectory.vue'
|
||||
import MouseRight from './components/MouseRight.vue'
|
||||
import {TS} from "./sdk";
|
||||
import * as domain from "domain";
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {addMapSource} from "../../common/addMapSource";
|
||||
import {$changeComponentShow} from "../../utils/communication";
|
||||
|
||||
const planInfo = ref({})
|
||||
const isShowPup = ref(false)
|
||||
const des_detail = ref("")
|
||||
const stamp = ref("")
|
||||
@ -174,11 +178,14 @@ let data = new FormData()
|
||||
data.append("id", planId)
|
||||
TsApi.queryPlan(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
des_detail.value = res.data.desc
|
||||
planInfo.value = res.data
|
||||
}
|
||||
})
|
||||
const eventBus: any = inject('bus')
|
||||
|
||||
const showInfo = () => {
|
||||
isShowPup.value = true
|
||||
des_detail.value = planInfo.value.desc
|
||||
}
|
||||
let submit = () => {
|
||||
let obj = {
|
||||
id: params.id,
|
||||
@ -188,6 +195,7 @@ let submit = () => {
|
||||
TsApi.updatePlan(obj).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({type: 'success', message: "操作成功"})
|
||||
planInfo.value.desc = des_detail.value
|
||||
}
|
||||
isShowPup.value = false
|
||||
})
|
||||
@ -220,6 +228,7 @@ let getEventList = () => {
|
||||
eventBus.on('delete-event', (ids) => {
|
||||
console.log(ids)
|
||||
tsOBJ.value._Store._tasks = tsOBJ.value._Store._tasks.filter(item => !ids.includes(item.id))
|
||||
|
||||
})
|
||||
eventBus.on('add-event', (task) => {
|
||||
tsOBJ.value._Store._tasks = [...tsOBJ.value._Store._tasks, task]
|
||||
@ -246,6 +255,8 @@ onMounted(async () => {
|
||||
// getAuthInfo()
|
||||
await YJ.on({host: baseURL})
|
||||
createEarth()
|
||||
window.addEventListener('click', handleClick)
|
||||
// window.addEventListener('contextmenu', handleClick)
|
||||
})
|
||||
const createEarth = async () => {
|
||||
(window as any).earth_ts = await new YJ.YJEarth('earthContainer', {navigationHelpButton: false})
|
||||
@ -296,10 +307,22 @@ const timer = setInterval(() => {
|
||||
}).replace(/\//g, '-');
|
||||
stamp.value = formattedDate
|
||||
}, 1000)
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(timer)
|
||||
window.removeEventListener('click', handleClick)
|
||||
// window.removeEventListener('contextmenu', handleClick)
|
||||
})
|
||||
|
||||
// 定义可复用的回调函数
|
||||
const handleClick = (e) => {
|
||||
console.log('点击事件触发', e)
|
||||
let dom = $('.MouseRight')[0]
|
||||
if (dom) dom.style.display = "none"
|
||||
|
||||
$changeComponentShow('.rightMenuTs', false)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@ -372,6 +395,10 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-slider__bar) {
|
||||
background-color: #0ff;
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
.leftTimeDesc {
|
||||
@ -449,3 +476,4 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="treeOrList" :style="currentTypeId!=''?'height: calc(100% - 300px);':''">
|
||||
<div class="treeOrList custom_scroll_bar_ts" :style="currentTypeId!=''?'height: calc(100% - 300px);':''">
|
||||
<template v-if="dataType=='tree'">
|
||||
<el-tree
|
||||
:data="treeData"
|
||||
@ -44,7 +44,7 @@
|
||||
</template>
|
||||
|
||||
</div>
|
||||
<div class="list" v-if="currentTypeId!=''">
|
||||
<div class="list custom_scroll_bar_ts" v-if="currentTypeId!=''">
|
||||
<div v-for="item in elementList" class="itemBox" @click="addMarker(item)">
|
||||
<div class="imgbg">
|
||||
<img :src="service + (item.posterDataUrl||item.militaryDataUrl)"/>
|
||||
@ -72,6 +72,7 @@ import {GraphApi} from "../../api/graphLabel";
|
||||
|
||||
import {addMapSource} from "./entity";
|
||||
import {useTreeNode} from "../components/tree/hooks/treeNode";
|
||||
import {ElMessage} from "element-plus";
|
||||
|
||||
const {getSelectedNodes} = useTreeNode()
|
||||
const service = ref(localStorage.getItem('ip'))
|
||||
@ -163,6 +164,8 @@ const getModelListByType = (id) => {
|
||||
GraphApi.showModelByType(formData).then((res) => {
|
||||
res.data.forEach(item => {
|
||||
item.funName = 'DrawPoint'
|
||||
item.type = 'military'
|
||||
|
||||
})
|
||||
elementList.value = res.data
|
||||
})
|
||||
@ -183,6 +186,10 @@ let getGraphTypeList = async () => {
|
||||
}
|
||||
// 添加标绘
|
||||
let addMarker = (item) => {
|
||||
if (window['tsObj']._Clock._status == 'play') {
|
||||
ElMessage({message: "态势推演中,暂停或停止后再试"})
|
||||
return;
|
||||
}
|
||||
let nodes = getSelectedNodes(window['treeObj'])
|
||||
console.log("绘制", item)
|
||||
console.log("获取选中的节点", nodes)
|
||||
@ -202,6 +209,10 @@ let addMarker = (item) => {
|
||||
obj.modelDataUrl = item.modelDataUrl
|
||||
obj.name = item.modelName
|
||||
break
|
||||
case 'military':
|
||||
obj.militaryDataUrl = item.militaryDataUrl
|
||||
obj.name = item.militaryName
|
||||
break
|
||||
case 'line':
|
||||
case 'panel':
|
||||
case 'attackArrow':
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {TsApi} from "../../api/ts";
|
||||
import {useTreeNode} from '@/views/components/tree/hooks/treeNode'
|
||||
import {rightClick} from "../components/tree/entityClick";
|
||||
import {bus} from "../../utils/bus"
|
||||
|
||||
const {cusAddNodes, getSelectedNode} = useTreeNode()
|
||||
|
||||
@ -18,6 +18,12 @@ export function initMapData(type, data, cb: any = null) {
|
||||
|
||||
entityObject = new YJ.Obj.Model(window['earth_ts'], data)
|
||||
break
|
||||
case 'military':
|
||||
data.url = baseURL + data.militaryDataUrl
|
||||
entityObject = new YJ.Obj.GroundSvg(window['earth_ts'], data)
|
||||
entityObject.load(() => {
|
||||
})
|
||||
break
|
||||
case 'line':
|
||||
entityObject = new YJ.Obj.PolylineObject(window['earth_ts'], data)
|
||||
break
|
||||
@ -33,6 +39,11 @@ export function initMapData(type, data, cb: any = null) {
|
||||
case 'pincerArrow':
|
||||
entityObject = new YJ.Obj.PincerArrowObject(window['earth_ts'], data)
|
||||
break
|
||||
case 'terrain':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.Terrain(window['earth_ts'], data)
|
||||
cb && cb(entityObject)
|
||||
break
|
||||
case 'tileset':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.Tileset(window['earth_ts'], data)
|
||||
@ -40,6 +51,27 @@ export function initMapData(type, data, cb: any = null) {
|
||||
cb && cb(entityObject)
|
||||
})
|
||||
|
||||
break
|
||||
case 'layer':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.Layer(window['earth_ts'], data)
|
||||
cb && cb(entityObject)
|
||||
break
|
||||
case 'gdslImagery':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.GDSLImagery(window['earth_ts'], data)
|
||||
break
|
||||
case 'gdlwImagery':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.GDLWImagery(window['earth_ts'], data)
|
||||
break
|
||||
case 'arcgisBlueImagery':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.ArcgisBLUEImagery(window['earth_ts'], data)
|
||||
break
|
||||
case 'arcgisWximagery':
|
||||
data.host = baseURL
|
||||
entityObject = new YJ.Obj.ArcgisWXImagery(window['earth_ts'], data)
|
||||
break
|
||||
case "guiji":
|
||||
entityObject = new YJ.Obj.TrajectoryMotionObject(
|
||||
@ -69,13 +101,20 @@ export function initMapData(type, data, cb: any = null) {
|
||||
|
||||
}
|
||||
//鼠标右键点击事件
|
||||
entityObject.onRightClick = () => {
|
||||
entityObject.onRightClick = (event) => {
|
||||
// rightClick(getOptions());
|
||||
console.log("鼠标右键点击事件")
|
||||
console.log("鼠标右键点击事件", options.id, event)
|
||||
let id = options.id;
|
||||
|
||||
let node = window.treeObj.getNodeByParam("id", id, null);
|
||||
if (node) window.treeObj.selectNode(node);
|
||||
YJ.Global.splitScreen.setActiveId([id]);
|
||||
window['selectedIdTs'] = id
|
||||
// YJ.Global.splitScreen.setActiveId([id]);
|
||||
$('.MouseRight')[0].style.display = "block"
|
||||
$('.MouseRight')[0].style.top = event.position.y + "px"
|
||||
$('.MouseRight')[0].style.left = event.position.x + "px"
|
||||
|
||||
bus.emit("initMenus")
|
||||
};
|
||||
return options
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="index">
|
||||
<div class="index ts-zyl">
|
||||
<!--<span @click="back">态势</span>-->
|
||||
<div class="dateTime">
|
||||
<span>{{ date.hms }}</span>
|
||||
@ -35,23 +35,24 @@
|
||||
placeholder="请输入创建人姓名"
|
||||
clearable
|
||||
/></span>
|
||||
<span>创建时间 <el-date-picker
|
||||
:teleported="false"
|
||||
class="dark-time-picker"
|
||||
v-model="searchParams.datetime"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
date-format="YYYY-MM-DD ddd"
|
||||
time-format="A hh:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/></span>
|
||||
<span>创建时间
|
||||
<el-date-picker
|
||||
:teleported="false"
|
||||
class="dark-time-picker"
|
||||
v-model="searchParams.datetime"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
date-format="YYYY-MM-DD"
|
||||
time-format="HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
/></span>
|
||||
<el-button @click="search">搜索</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
</div>
|
||||
<div class="option">
|
||||
<el-button :icon="CirclePlus" @click="addPlan">新建推演</el-button>
|
||||
<el-button :icon="CirclePlus" @click="()=>{addPlan()}">新建推演</el-button>
|
||||
<el-button :icon="Download">导入</el-button>
|
||||
<el-button :icon="Upload">导出</el-button>
|
||||
</div>
|
||||
@ -89,9 +90,33 @@
|
||||
</el-popconfirm>-->
|
||||
|
||||
<div style="display: flex;justify-content: space-evenly">
|
||||
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
||||
<Warning style="width: 16px; height: 16px; cursor:pointer; "></Warning>
|
||||
<Delete style="width: 16px; height: 16px; cursor:pointer;" @click="delPlanBtn(scope.row.id)"/>
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
content="编辑推演"
|
||||
placement="top"
|
||||
>
|
||||
<Edit style="width: 16px; height: 16px; cursor:pointer;" @click="toTSEdit(scope.row)"></Edit>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
content="详情"
|
||||
placement="top"
|
||||
>
|
||||
<Warning style="width: 16px; height: 16px; cursor:pointer; "
|
||||
@click="()=>{addPlan(scope.row)}"></Warning>
|
||||
</el-tooltip>
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
content="删除"
|
||||
placement="top"
|
||||
>
|
||||
<Delete style="width: 16px; height: 16px; cursor:pointer;" @click="delPlanBtn(scope.row.id)"/>
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -145,7 +170,13 @@ let searchParams: any = ref({
|
||||
createdBy: "",
|
||||
datetime: "",
|
||||
})
|
||||
|
||||
/**
|
||||
* Moment 格式化:日期 + 英文星期缩写
|
||||
*/
|
||||
const formatDateWithWeek = (date) => {
|
||||
// moment('2025-11-28').format('ddd') → "Fri"
|
||||
return moment(date).format('YYYY-MM-DD ddd');
|
||||
};
|
||||
let pageSize: any = ref(10)
|
||||
let pageNum: any = ref(1)
|
||||
let total: any = ref(0)
|
||||
@ -167,7 +198,7 @@ const getList = (params: any = null) => {
|
||||
formData.append('pageSize', pageSize.value)
|
||||
formData.append('pageNum', pageNum.value)
|
||||
if (params) {
|
||||
for (const paramsKey in params) {
|
||||
/*for (const paramsKey in params) {
|
||||
if (params[paramsKey]) {
|
||||
if (paramsKey == 'datetime') {
|
||||
formData.append('startTime', params[paramsKey][0])
|
||||
@ -177,7 +208,7 @@ const getList = (params: any = null) => {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
formData.append('username', params["createdBy"])
|
||||
|
||||
}
|
||||
@ -207,11 +238,12 @@ const toTSEdit = (row) => {
|
||||
query: {id: row.id, name: row.name, desc: row.desc, start_time: new Date(row.simulationStartTime).getTime(),}
|
||||
})
|
||||
}
|
||||
|
||||
const delPlanBtn = (id) => {
|
||||
ElMessageBox.confirm('确定要永久删除此推演方案吗?此操作不可撤销', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
cancelButtonText: '取消',
|
||||
}).then(() => {
|
||||
delPlan(id)
|
||||
}).catch(() => {
|
||||
@ -231,10 +263,11 @@ const delPlan = (id) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const addPlan = () => {
|
||||
const addPlan = (row = null) => {
|
||||
console.log("row", row)
|
||||
// $(".newPlan")[0].style.display = 'block'
|
||||
// $(".el-overlay")[0].style.display = 'block'
|
||||
eventBus.emit('openAddPlan', true)
|
||||
eventBus.emit('openAddPlan', true, row)
|
||||
}
|
||||
/*
|
||||
const generateData = (
|
||||
@ -440,6 +473,12 @@ onUnmounted(() => {
|
||||
.tableBox {
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.pageBox {
|
||||
width: auto;
|
||||
margin: unset;
|
||||
align-self: end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -518,8 +557,7 @@ background-color: transparent;
|
||||
background-color: rgba(0, 255, 255, 0.2);
|
||||
}*/
|
||||
|
||||
</style>
|
||||
<style scoped>
|
||||
|
||||
:deep(.el-picker-panel) {
|
||||
color: var(--el-text-color-regular);
|
||||
background: var(--el-bg-color-overlay);
|
||||
@ -546,4 +584,14 @@ background-color: transparent;
|
||||
--el-border-color-extra-light: #2B2B2C;
|
||||
|
||||
}
|
||||
|
||||
:deep(.el-pagination ) {
|
||||
--el-fill-color-blank: #00000000;
|
||||
--el-text-color-regular: #fff;
|
||||
}
|
||||
|
||||
.el-message-box {
|
||||
background: linear-gradient(180deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0) 100%), rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间">
|
||||
<el-date-picker
|
||||
:show-now="false"
|
||||
popper-class="ts_dark_theme"
|
||||
v-model="form.datetime"
|
||||
type="datetime"
|
||||
@ -72,11 +73,12 @@
|
||||
|
||||
|
||||
</el-form>
|
||||
<div class="optionbtn">
|
||||
<el-button @click="addEvent">确定</el-button>
|
||||
<el-button @click="()=>{isShowPup=false,reset()}">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<div class="optionbtn">
|
||||
<el-button @click="addEvent">确定</el-button>
|
||||
<el-button @click="isShowPup=false">取消</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="placeholder"></div>
|
||||
@ -99,6 +101,8 @@ const currentKey = ref<number | string | null>("flicker");
|
||||
interface Tree {
|
||||
label: string
|
||||
children?: Tree[]
|
||||
id: any
|
||||
name: any
|
||||
}
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
@ -119,7 +123,8 @@ const positions = ref([])//机动事件的轨迹点
|
||||
|
||||
form['datetime'] = new Date(window['tsObj']._Store._currentTimestamp)
|
||||
const isShowPup = ref(false)
|
||||
const eventTree: { children: ({ label: string } | { label: string })[]; id: string; label: string }[] = [
|
||||
// : { children: ({ label: string } | { label: string })[]; id: string; label: string }[]
|
||||
const eventTree = ref([
|
||||
{
|
||||
id: "normal",
|
||||
label: '常用推演事件',
|
||||
@ -134,25 +139,18 @@ const eventTree: { children: ({ label: string } | { label: string })[]; id: stri
|
||||
label: '隐藏事件',
|
||||
name: '隐藏'
|
||||
},
|
||||
{
|
||||
id: "flicker",
|
||||
label: '闪烁事件',
|
||||
name: '闪烁'
|
||||
},
|
||||
{
|
||||
id: "move",
|
||||
label: '机动事件',
|
||||
name: '机动'
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
}
|
||||
const handleNodeClick = (data: Tree, node, TreeNode, event) => {
|
||||
console.log(data)
|
||||
reset(true)
|
||||
currentKey.value = data.id; // data.id 为节点的唯一 key(需与 tree 的 node-key 对应)
|
||||
form.name = data.name + '-' + zNode.value.sourceName
|
||||
}
|
||||
@ -165,19 +163,34 @@ const drawLine = () => {
|
||||
const addEvent = () => {
|
||||
console.log(zNode.value)
|
||||
let startTime = form.datetime.getTime()
|
||||
let obj = {}
|
||||
let obj: any = {}
|
||||
let duration_S = (hour.value * 3600 + minute.value * 60 + second.value) * 1
|
||||
// 数据是否合法有效
|
||||
let isRight = true
|
||||
let errorFields = []//数据错误的字段
|
||||
let minPositionLength = 2
|
||||
switch (currentKey.value) {
|
||||
case 'flicker':
|
||||
obj = {
|
||||
times: times.value,
|
||||
numbers: numbers.value
|
||||
|
||||
if (duration_S == 0) {
|
||||
isRight = false
|
||||
errorFields.push("持续时间")
|
||||
}
|
||||
if (obj.numbers == 0) {
|
||||
isRight = false
|
||||
errorFields.push("闪烁次数")
|
||||
}
|
||||
if (isRight) {
|
||||
obj.numbers = numbers.value
|
||||
obj.times = Number((duration_S / obj.numbers).toFixed(2))
|
||||
}
|
||||
break
|
||||
case 'move':
|
||||
let detail = typeof zNode.value.detail == 'string' ? JSON.parse(zNode.value.detail) : JSON.parse(JSON.stringify(zNode.value.detail))
|
||||
let position = [...positions.value]
|
||||
if (isContainModelPosition.value) {
|
||||
position.unshift(detail.positions || detail.position)
|
||||
position.unshift(detail.positions || detail.position || detail.center)
|
||||
minPositionLength = 3
|
||||
}
|
||||
positions.value = position;
|
||||
obj = {
|
||||
@ -192,14 +205,28 @@ const addEvent = () => {
|
||||
},
|
||||
isContainModelPosition: isContainModelPosition.value
|
||||
}
|
||||
if (!obj.line['positions'] || (obj.line['positions'] && obj.line['positions'].length < minPositionLength)) {
|
||||
// ElMessage({message: "机动事件的路径不合法", type: "warning"})
|
||||
isRight = false
|
||||
errorFields.push("路径点位")
|
||||
}
|
||||
if (duration_S == 0) {
|
||||
isRight = false
|
||||
errorFields.push("持续时间")
|
||||
}
|
||||
break
|
||||
}
|
||||
// 当事件为机动事件且轨迹点的长度为0时,终止
|
||||
if (obj['positions'] && obj['positions'].length == 0) {
|
||||
ElMessage({message: "机动事件的路径不合法", type: "warning"})
|
||||
return
|
||||
|
||||
|
||||
if (!isRight) {
|
||||
// ElMessage({message: "机动事件的路径不合法", type: "warning"})
|
||||
let eventType = form.name.split("-")[0] + "事件"
|
||||
|
||||
ElMessage({message: eventType + errorFields.join("、") + "数据不合法", type: "warning"})
|
||||
return;
|
||||
}
|
||||
let duration_S = hour.value * 3600 + minute.value * 60 + second.value
|
||||
// console.log("数据校验通过")
|
||||
|
||||
let dbParams = {
|
||||
id: new YJ.Tools().randomString(),
|
||||
planId: window.planId,
|
||||
@ -211,6 +238,7 @@ const addEvent = () => {
|
||||
"detail": JSON.stringify(obj)
|
||||
}
|
||||
console.log("dbParams", dbParams)
|
||||
// return;
|
||||
TsApi.addTsEvent(dbParams).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
@ -238,27 +266,60 @@ const addEvent = () => {
|
||||
})
|
||||
console.log(dbParams)
|
||||
}
|
||||
const reset = () => {
|
||||
const reset = (changeEventType = false) => {
|
||||
hour.value = 0
|
||||
minute.value = 0
|
||||
second.value = 0
|
||||
numbers.value = 0
|
||||
times.value = 1
|
||||
form = {
|
||||
name: '闪烁-',
|
||||
// datetime: '',
|
||||
}
|
||||
form.name = '闪烁-'
|
||||
// datetime: '',
|
||||
|
||||
form['datetime'] = new Date(window['tsObj']._Store._currentTimestamp)
|
||||
currentKey.value = "flicker"
|
||||
console.log("changeEventType", changeEventType)
|
||||
if (!changeEventType)
|
||||
eventTree.value = [
|
||||
{
|
||||
id: "normal",
|
||||
label: '常用推演事件',
|
||||
children: [
|
||||
{
|
||||
id: "display",
|
||||
label: '显示事件',
|
||||
name: '显示'
|
||||
},
|
||||
{
|
||||
id: "hide",
|
||||
label: '隐藏事件',
|
||||
name: '隐藏'
|
||||
},
|
||||
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
eventBus.on('openAddEvent', (data, cb, type) => {
|
||||
console.log("openAddEvent", data)
|
||||
if (['point', "model", "military"].includes(data.sourceType))
|
||||
eventTree.value[0].children = [...eventTree.value[0].children, {
|
||||
id: "flicker",
|
||||
label: '闪烁事件',
|
||||
name: '闪烁'
|
||||
},
|
||||
{
|
||||
id: "move",
|
||||
label: '机动事件',
|
||||
name: '机动'
|
||||
},]
|
||||
// console.log("openAddEvent", data)
|
||||
// console.log("openAddEvent", eventTree.value[0].children[0])
|
||||
// selectCallback = cb
|
||||
// addType.value = type
|
||||
zNode.value = data
|
||||
isShowPup.value = true
|
||||
form.name = '闪烁-' + data.sourceName
|
||||
form.name = eventTree.value[0].children[0].name + '-' + data.sourceName
|
||||
currentKey.value = eventTree.value[0].children[0].id
|
||||
|
||||
// if (data) {
|
||||
// getModelList()
|
||||
// getSetting()
|
||||
|
||||
@ -2,12 +2,21 @@
|
||||
<div class="newPlan">
|
||||
<el-dialog v-model="isShowPup" draggable :close-on-click-modal="false" :modal="true">
|
||||
<template #header>
|
||||
<div class="set_pup_header">
|
||||
<div class="system_title">
|
||||
<!--{{ t('model.title') }}-->
|
||||
新建推演
|
||||
<template v-if="!currentPlanId">
|
||||
<div class="set_pup_header">
|
||||
<div class="system_title">
|
||||
<!--{{ t('model.title') }}-->
|
||||
新建推演
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="detailTitle">
|
||||
推演详情
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</template>
|
||||
<div class="set_detail">
|
||||
<el-form
|
||||
@ -23,7 +32,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="仿真开始时间" prop="simulationStartTime" required>
|
||||
<el-date-picker
|
||||
:readonly="Boolean(currentPlanId)"
|
||||
v-model="sizeForm.simulationStartTime"
|
||||
popper-class="ts-zyl"
|
||||
type="datetime"
|
||||
timezone="Asia/Shanghai"
|
||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
||||
@ -55,7 +66,7 @@ import {TsApi} from "../../api/ts";
|
||||
const eventBus: any = inject('bus')
|
||||
const emit = defineEmits(['addCallback']);
|
||||
const isShowPup = ref(false)
|
||||
|
||||
let currentPlanId = ref('')
|
||||
|
||||
interface RuleForm {
|
||||
name: string,
|
||||
@ -64,7 +75,7 @@ interface RuleForm {
|
||||
}
|
||||
|
||||
const ruleFormRef = ref<FormInstance>()
|
||||
const sizeForm = reactive<RuleForm>({
|
||||
let sizeForm = reactive<RuleForm>({
|
||||
name: '',
|
||||
simulationStartTime: '',
|
||||
desc: '',
|
||||
@ -72,13 +83,46 @@ const sizeForm = reactive<RuleForm>({
|
||||
|
||||
const rules = reactive<FormRules<RuleForm>>({
|
||||
name: [
|
||||
{required: true, message: '推演名称不能为空', trigger: 'blur'},
|
||||
// {required: true, message: '推演名称不能为空', trigger: 'blur'},
|
||||
{
|
||||
// 自定义验证器
|
||||
validator: (rule, value, callback) => {
|
||||
// 关键:trim 后判断是否为空
|
||||
const trimmedVal = value.trim();
|
||||
if (!trimmedVal) {
|
||||
// 验证失败,返回错误提示
|
||||
callback(new Error('推演名称不能为空(不能仅输入空格)'));
|
||||
} else {
|
||||
// 验证通过,调用 callback() 无参
|
||||
callback();
|
||||
}
|
||||
},
|
||||
// 触发时机:失去焦点 + 表单提交(可按需调整)
|
||||
trigger: ['blur', 'submit']
|
||||
}
|
||||
],
|
||||
desc: [
|
||||
{required: true, message: '推演描述不能为空', trigger: 'blur'},
|
||||
// {required: true, message: '推演描述不能为空', trigger: 'blur'},
|
||||
{
|
||||
// 自定义验证器
|
||||
validator: (rule, value, callback) => {
|
||||
// 关键:trim 后判断是否为空
|
||||
const trimmedVal = value.trim();
|
||||
if (!trimmedVal) {
|
||||
// 验证失败,返回错误提示
|
||||
callback(new Error('推演描述不能为空(不能仅输入空格)'));
|
||||
} else {
|
||||
// 验证通过,调用 callback() 无参
|
||||
callback();
|
||||
}
|
||||
},
|
||||
// 触发时机:失去焦点 + 表单提交(可按需调整)
|
||||
trigger: ['blur', 'submit']
|
||||
}
|
||||
],
|
||||
simulationStartTime: [
|
||||
{required: true, message: '仿真开始时间不能为空', trigger: 'blur'},
|
||||
|
||||
],
|
||||
})
|
||||
const submitForm = async (formEl: FormInstance | undefined) => {
|
||||
@ -95,33 +139,66 @@ const addPlan = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return
|
||||
await formEl.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
TsApi.addPlan(sizeForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
isShowPup.value = false
|
||||
formEl.resetFields()
|
||||
// $(".newPlan")[0].style.display = "none"
|
||||
})
|
||||
if (currentPlanId.value == '') {
|
||||
TsApi.addPlan(sizeForm).then(res => {
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
isShowPup.value = false
|
||||
formEl.resetFields()
|
||||
// $(".newPlan")[0].style.display = "none"
|
||||
})
|
||||
} else {
|
||||
let params = sizeForm
|
||||
params['id'] = currentPlanId
|
||||
delete params['simulationStartTime']
|
||||
TsApi.updatePlan(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
emit('addCallback');
|
||||
}
|
||||
isShowPup.value = false
|
||||
formEl.resetFields()
|
||||
})
|
||||
console.log("更新接口")
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('提交失败', fields)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
eventBus.on('openAddPlan', (data, cb, type) => {
|
||||
// selectCallback = cb
|
||||
// addType.value = type
|
||||
eventBus.on('openAddPlan', (data, plan) => {
|
||||
console.log("plan", plan)
|
||||
|
||||
Object.assign(sizeForm, {
|
||||
name: '',
|
||||
simulationStartTime: '',
|
||||
desc: ''
|
||||
})
|
||||
currentPlanId.value = ''
|
||||
isShowPup.value = data
|
||||
// if (data) {
|
||||
// getModelList()
|
||||
// getSetting()
|
||||
// }
|
||||
// 存在方案,显示详情做修改,或者做新建
|
||||
if (plan) {
|
||||
currentPlanId.value = plan.id
|
||||
Object.assign(sizeForm, {
|
||||
name: plan.name,
|
||||
simulationStartTime: plan.simulationStartTime,
|
||||
desc: plan.desc,
|
||||
})
|
||||
}
|
||||
console.log("currentPlanId.value", currentPlanId.value)
|
||||
|
||||
|
||||
})
|
||||
const close = () => {
|
||||
|
||||
@ -229,6 +306,18 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
|
||||
.detailTitle {
|
||||
text-shadow: 0px 0px 9px rgba(20, 118, 255, 1);
|
||||
/** 文本1 */
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0px;
|
||||
line-height: 32px;
|
||||
color: rgba(255, 255, 255, 1);
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.optionbtn {
|
||||
margin: 0 auto;
|
||||
}
|
||||
@ -256,5 +345,32 @@ defineExpose({
|
||||
|
||||
:deep(.el-textarea__inner) {
|
||||
height: 150px;
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.ts-zyl {
|
||||
.el-date-picker {
|
||||
color-scheme: dark;
|
||||
|
||||
--el-bg-color-page: #0a0a0a;
|
||||
--el-bg-color: #141414;
|
||||
--el-bg-color-overlay: #1d1e1f;
|
||||
--el-text-color-primary: #E5EAF3;
|
||||
--el-text-color-regular: #CFD3DC;
|
||||
--el-text-color-secondary: #A3A6AD;
|
||||
--el-text-color-placeholder: #8D9095;
|
||||
--el-text-color-disabled: #6C6E72;
|
||||
--el-border-color-darker: #636466;
|
||||
--el-border-color-dark: #58585B;
|
||||
--el-border-color: #4C4D4F;
|
||||
--el-border-color-light: #414243;
|
||||
--el-border-color-lighter: #363637;
|
||||
--el-border-color-extra-light: #2B2B2C;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -41,7 +41,8 @@ export const showRightMenuTs = (event: any, treeObj: any, selectedNodes, nodeTyp
|
||||
try {
|
||||
arr = [...nodeType[selectedNodes[0].sourceType].rightMenus]
|
||||
console.log("rightMenus", nodeType[selectedNodes[0].sourceType].rightMenus)
|
||||
arr.push('addEvent')
|
||||
if (!['tileset', 'directory', 'layer', 'terrain',].includes(selectedNodes[0].sourceType))
|
||||
arr.push('addEvent')
|
||||
} catch (e) {
|
||||
console.log('e', e, selectedNodes[0].sourceType)
|
||||
arr = []
|
||||
|
||||
@ -2,8 +2,22 @@
|
||||
<div class="rightBox" v-if="isDesktop">
|
||||
<el-button size="small" :icon="Setting" @click="serviceDialog = true"> </el-button>
|
||||
</div>
|
||||
<video key="second-video" autoplay loop muted src="../../assets/video/author_video.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover;z-index: -1;"></video>
|
||||
<video
|
||||
key="second-video"
|
||||
autoplay
|
||||
loop
|
||||
muted
|
||||
src="../../assets/video/author_video.mp4"
|
||||
style="
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
left: 0;
|
||||
top: 0;
|
||||
object-fit: cover;
|
||||
z-index: -1;
|
||||
"
|
||||
></video>
|
||||
<Dialog ref="baseDialog" class="graffiti" title="系统授权" :closeCallback="closeCallBack">
|
||||
<template #content>
|
||||
<div class="auth_info custom_scroll_bar content_h">
|
||||
@ -12,7 +26,12 @@
|
||||
<span class="fankuai"></span>
|
||||
{{ t('auths.authCode') }}
|
||||
</div>
|
||||
<div class="auth_info_text" @click="copy(authInfo.license_code)" style="cursor: pointer" title="点击可复制">
|
||||
<div
|
||||
class="auth_info_text"
|
||||
@click="copy(authInfo.license_code)"
|
||||
style="cursor: pointer"
|
||||
title="点击可复制"
|
||||
>
|
||||
{{ authInfo.license_code || '' }}
|
||||
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
|
||||
</div>
|
||||
@ -35,8 +54,12 @@
|
||||
<span class="fankuai"></span>
|
||||
{{ t('auths.authType') }}
|
||||
</div>
|
||||
<div v-if="authInfo.status != null" class="auth_info_text" style="font-size: 16px"
|
||||
:style="{ color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)' }">
|
||||
<div
|
||||
v-if="authInfo.status != null"
|
||||
class="auth_info_text"
|
||||
style="font-size: 16px"
|
||||
:style="{ color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)' }"
|
||||
>
|
||||
{{ authInfo.status ? t('auths.authTempExpire') : t('auths.authexpire') }}
|
||||
</div>
|
||||
<!-- <div v-else class="auth_info_text">{{ authInfo.message || '无' }}</div> -->
|
||||
@ -48,65 +71,70 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<uploadFiles accept=".lic" :maxSize="1"></uploadFiles>
|
||||
<uploadFiles accept=".YJ" :maxSize="1"></uploadFiles>
|
||||
<button @click="close">退出系统</button>
|
||||
</template>
|
||||
</Dialog>
|
||||
<div class="service" v-if="serviceDialog">
|
||||
<div class="contentBox">
|
||||
<div class="titleBox">
|
||||
<span class="title"></span>
|
||||
<span class="closeBox">
|
||||
<span @click="cancel">✕</span>
|
||||
</span>
|
||||
</div>
|
||||
<h1 class="hello">Hello!</h1>
|
||||
<h2 class="greet"><span>欢迎您使用</span>实景三维电子沙盘系统</h2>
|
||||
<div class="serviceContent">
|
||||
<el-tabs v-model="selectedService" class="demo-tabs">
|
||||
<el-tab-pane label="接口服务" name="接口服务"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="tabPanel">
|
||||
<div class="item">
|
||||
<span class="itemLabel">服务选择</span>
|
||||
<el-select class="select" popper-class="login-select-popper" v-model="servVal">
|
||||
<el-option size="mini" v-for="item in servOptions" :key="item.value" :label="item.name"
|
||||
:value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item prototype" v-if="servVal == '网络'">
|
||||
<span class="itemLabel">协议</span><el-input v-model="prototype"></el-input>
|
||||
</div>
|
||||
<div class="item ip">
|
||||
<template v-if="servVal == '单机'">
|
||||
<span class="itemLabel">IP</span>
|
||||
<el-input v-model="localip" disabled></el-input>
|
||||
</template>
|
||||
<template v-if="servVal == '网络'">
|
||||
<span class="itemLabel">IP</span>
|
||||
<el-input v-model="ip"></el-input>
|
||||
</template>
|
||||
</div>
|
||||
<div class="item port">
|
||||
<template v-if="servVal == '单机'">
|
||||
<span class="itemLabel">端口</span>
|
||||
<el-input v-model="localport"></el-input>
|
||||
</template>
|
||||
<template v-if="servVal == '网络'">
|
||||
<span class="itemLabel">端口</span>
|
||||
<el-input v-model="port"></el-input>
|
||||
</template>
|
||||
</div>
|
||||
<div class="contentBox">
|
||||
<div class="titleBox">
|
||||
<span class="title"></span>
|
||||
<span class="closeBox">
|
||||
<span @click="cancel">✕</span>
|
||||
</span>
|
||||
</div>
|
||||
<h1 class="hello">Hello!</h1>
|
||||
<h2 class="greet"><span>欢迎您使用</span>实景三维电子沙盘系统</h2>
|
||||
<div class="serviceContent">
|
||||
<el-tabs v-model="selectedService" class="demo-tabs">
|
||||
<el-tab-pane label="接口服务" name="接口服务"></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="tabPanel">
|
||||
<div class="item">
|
||||
<span class="itemLabel">服务选择</span>
|
||||
<el-select class="select" popper-class="login-select-popper" v-model="servVal">
|
||||
<el-option
|
||||
size="mini"
|
||||
v-for="item in servOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="item prototype" v-if="servVal == '网络'">
|
||||
<span class="itemLabel">协议</span><el-input v-model="prototype"></el-input>
|
||||
</div>
|
||||
<div class="item ip">
|
||||
<template v-if="servVal == '单机'">
|
||||
<span class="itemLabel">IP</span>
|
||||
<el-input v-model="localip" disabled></el-input>
|
||||
</template>
|
||||
<template v-if="servVal == '网络'">
|
||||
<span class="itemLabel">IP</span>
|
||||
<el-input v-model="ip"></el-input>
|
||||
</template>
|
||||
</div>
|
||||
<div class="item port">
|
||||
<template v-if="servVal == '单机'">
|
||||
<span class="itemLabel">端口</span>
|
||||
<el-input v-model="localport"></el-input>
|
||||
</template>
|
||||
<template v-if="servVal == '网络'">
|
||||
<span class="itemLabel">端口</span>
|
||||
<el-input v-model="port"></el-input>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn">
|
||||
<el-button style="margin: 5px 0" size="mini" @click="submit">确定</el-button>
|
||||
<el-button size="mini" @click="cancel">关闭</el-button>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button style="margin: 5px 0" size="mini" @click="submit">确定</el-button>
|
||||
<el-button size="mini" @click="cancel">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -172,7 +200,7 @@ const getAuthInfo = async () => {
|
||||
}
|
||||
} catch (error) {
|
||||
// 统一处理错误
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用?', '提示', {
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用!', '提示', {
|
||||
confirmButtonText: '去授权',
|
||||
cancelButtonText: '退出系统',
|
||||
type: 'warning',
|
||||
@ -201,7 +229,7 @@ const getStatus = (date) => {
|
||||
if (timestamp > currentTimestamp) {
|
||||
router.push({ path: '/login' })
|
||||
} else {
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用?', '提示', {
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用!', '提示', {
|
||||
confirmButtonText: '去授权',
|
||||
cancelButtonText: '退出系统',
|
||||
type: 'warning',
|
||||
@ -222,7 +250,7 @@ const getStatus = (date) => {
|
||||
}
|
||||
setTimeout(() => {
|
||||
getAuthInfo()
|
||||
}, 5000);
|
||||
}, 5000)
|
||||
|
||||
//授权页面
|
||||
|
||||
@ -254,7 +282,7 @@ const authInfo = ref({
|
||||
status: null
|
||||
})
|
||||
//上传授权文件成功
|
||||
eventBus.on('upload', (data) => {
|
||||
let func = (data) => {
|
||||
if (data) {
|
||||
getAuthInfo2()
|
||||
setTimeout(() => {
|
||||
@ -267,7 +295,29 @@ eventBus.on('upload', (data) => {
|
||||
$sendElectronChanel('restart')
|
||||
}, 3000)
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.off('upload', func)
|
||||
eventBus.on('upload', func)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('upload', func)
|
||||
})
|
||||
|
||||
// eventBus.on('upload', (data) => {
|
||||
// if (data) {
|
||||
// getAuthInfo2()
|
||||
// setTimeout(() => {
|
||||
// ElMessage({
|
||||
// message: '载入成功,将在2s后自动重启',
|
||||
// type: 'success'
|
||||
// })
|
||||
// }, 1000)
|
||||
// setTimeout(() => {
|
||||
// $sendElectronChanel('restart')
|
||||
// }, 3000)
|
||||
// }
|
||||
// })
|
||||
|
||||
const { toClipboard } = useClipboard()
|
||||
|
||||
@ -298,7 +348,7 @@ const getAuthCode = async () => {
|
||||
}
|
||||
setTimeout(() => {
|
||||
getAuthCode()
|
||||
}, 5000);
|
||||
}, 5000)
|
||||
//复制
|
||||
|
||||
const copy = async (text) => {
|
||||
@ -374,7 +424,8 @@ const copy = async (text) => {
|
||||
z-index: 99;
|
||||
background: linear-gradient(0deg, #00ffff33 0%, #00ffff00 100%), rgba(0, 0, 0, 0.6);
|
||||
border: 1.5px solid;
|
||||
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%) 1;
|
||||
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%)
|
||||
1;
|
||||
text-align: left;
|
||||
font-family: 'sy-boldface';
|
||||
}
|
||||
@ -420,11 +471,11 @@ const copy = async (text) => {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
::v-deep .title-box>.close-box {
|
||||
::v-deep .title-box > .close-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .title-box>.title {
|
||||
::v-deep .title-box > .title {
|
||||
font-family: 'Ali-mother-counts-bold';
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
@ -447,7 +498,7 @@ const copy = async (text) => {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
::v-deep .foot>button {
|
||||
::v-deep .foot > button {
|
||||
margin-left: 10px;
|
||||
border-radius: 4px;
|
||||
background: rgba(var(--color-base1), 0.2);
|
||||
@ -459,12 +510,12 @@ const copy = async (text) => {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::v-deep .foot>button:hover {
|
||||
::v-deep .foot > button:hover {
|
||||
border: 1px solid rgba(var(--color-base1), 1);
|
||||
color: rgba(var(--color-base1), 1);
|
||||
}
|
||||
|
||||
::v-deep .foot>.show>.label {
|
||||
::v-deep .foot > .show > .label {
|
||||
margin: 0px 10px;
|
||||
}
|
||||
|
||||
@ -539,7 +590,7 @@ const copy = async (text) => {
|
||||
border-radius: 0 0 0 90%;
|
||||
background: rgba(var(--color-base1), 1);
|
||||
|
||||
&>span {
|
||||
& > span {
|
||||
font-size: 1rem;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
@ -636,7 +687,8 @@ const copy = async (text) => {
|
||||
align-items: center;
|
||||
margin: 15px 0;
|
||||
|
||||
.select {}
|
||||
.select {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
{{ t('auths.noAuthexpire') }}
|
||||
</div>
|
||||
</div>
|
||||
<uploadFiles accept=".lic" :maxSize="1"></uploadFiles>
|
||||
<uploadFiles accept=".YJ" :maxSize="1"></uploadFiles>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -68,11 +68,24 @@ const authInfo: any = ref({
|
||||
status: null
|
||||
})
|
||||
//上传授权文件成功
|
||||
eventBus.on('upload', (data) => {
|
||||
let func = (data) => {
|
||||
if (data) {
|
||||
getAuthInfo()
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.off('upload', func)
|
||||
eventBus.on('upload', func)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('upload', func)
|
||||
})
|
||||
|
||||
// eventBus.on('upload', (data) => {
|
||||
// if (data) {
|
||||
// getAuthInfo()
|
||||
// }
|
||||
// })
|
||||
|
||||
const { toClipboard } = useClipboard()
|
||||
|
||||
|
||||
@ -66,7 +66,11 @@ const handleClick = (command: string) => {
|
||||
z-index: 9999;
|
||||
border: 1.5px solid;
|
||||
box-sizing: border-box;
|
||||
border-image: linear-gradient(137.95deg, rgba(var(--color-base1), 1) 6.25%, var(--color-border1) 100%)
|
||||
border-image: linear-gradient(
|
||||
137.95deg,
|
||||
rgba(var(--color-base1), 1) 6.25%,
|
||||
var(--color-border1) 100%
|
||||
)
|
||||
1.5;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@ -220,11 +220,32 @@ const routeImport = () => {
|
||||
path: path[0]
|
||||
}).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success'
|
||||
RouteApi.getRouteList().then((list) => {
|
||||
routeList.splice(0, routeList.length, ...list.data)
|
||||
routeList.map((item) => {
|
||||
let arr = item.path.split('/')
|
||||
item.name = arr[arr.length - 1]
|
||||
})
|
||||
//只有一个route时默认启用
|
||||
if (routeList.length == 1) {
|
||||
let formData = new FormData()
|
||||
formData.append('id', routeList[0].id)
|
||||
RouteApi.enableRoute(formData).then((res) => {
|
||||
if (res.code === 200) {
|
||||
ElMessage({
|
||||
message: '上传并启用成功',
|
||||
type: 'success'
|
||||
})
|
||||
getList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ElMessage({
|
||||
message: '上传成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
})
|
||||
getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -620,72 +641,70 @@ function unzip_file(srcZipFile, dst) {
|
||||
//工程导出
|
||||
let exportWin = false
|
||||
function derive() {
|
||||
if (!exportWin) {
|
||||
exportWin = !exportWin
|
||||
const date = new Date()
|
||||
const formattedDate = format(date, 'yyyyMMdd HHmmss')
|
||||
// if (!exportWin) {
|
||||
// exportWin = !exportWin
|
||||
const date = new Date()
|
||||
const formattedDate = format(date, 'yyyyMMdd HHmmss')
|
||||
|
||||
let option = {
|
||||
title: '请选择要保存的文件名',
|
||||
buttonLabel: '保存',
|
||||
filename: `工程${formattedDate}.zip`,
|
||||
filters: [{ name: '文件类型', extensions: ['zip'] }]
|
||||
}
|
||||
$sendElectronChanel('saveFile', option)
|
||||
$recvElectronChanel('selectedFileItem', (e, path) => {
|
||||
if (path) {
|
||||
// if (result.canceled) {
|
||||
// this.exportWin = !this.exportWin
|
||||
// return
|
||||
// }
|
||||
// let loadingInstance = this.$openLoading('拼命导出中...')
|
||||
exportWin = !exportWin
|
||||
console.log('111111')
|
||||
let arr = getElectronPath().replaceAll('\\', '/').split('/')
|
||||
console.log(arr, '222222')
|
||||
arr.pop()
|
||||
arr[arr.length - 1] = 'yjearth/app.db'
|
||||
let db_path: any = arr.join('/')
|
||||
// let db_path: any = 'C:/Users/Administrator/AppData/Roaming/yjearth/app.db'
|
||||
zip_file([db_path], path, () => {
|
||||
// loadingInstance.close()
|
||||
ElMessage({
|
||||
message: '导出完成',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// dialog
|
||||
// .showSaveDialog({
|
||||
// title: '请选择要保存的文件名',
|
||||
// buttonLabel: '保存',
|
||||
// defaultPath: `工程${formattedDate}.zip`,
|
||||
// filters: [{ name: '文件类型', extensions: ['zip'] }]
|
||||
// })
|
||||
// .then((result) => {
|
||||
// if (result.canceled) {
|
||||
// exportWin = !exportWin
|
||||
// return
|
||||
// }
|
||||
// // let loadingInstance = this.$openLoading('拼命导出中...')
|
||||
// exportWin = !exportWin
|
||||
// let arr = getElectronPath().replaceAll('\\', '/').split('/')
|
||||
// arr[arr.length - 1] = 'database.ydb'
|
||||
// let db_path: any = arr.join('/')
|
||||
// zip_file([db_path], result.filePath, () => {
|
||||
// // loadingInstance.close()
|
||||
// ElMessage({
|
||||
// message: '导出完成',
|
||||
// type: 'success'
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err)
|
||||
// })
|
||||
let option = {
|
||||
title: '请选择要保存的文件名',
|
||||
buttonLabel: '保存',
|
||||
filename: `工程${formattedDate}.zip`,
|
||||
filters: [{ name: '文件类型', extensions: ['zip'] }]
|
||||
}
|
||||
$sendElectronChanel('saveFile', option)
|
||||
$recvElectronChanel('selectedFileItem', (e, path) => {
|
||||
if (path) {
|
||||
// if (result.canceled) {
|
||||
// this.exportWin = !this.exportWin
|
||||
// return
|
||||
// }
|
||||
// let loadingInstance = this.$openLoading('拼命导出中...')
|
||||
// exportWin = !exportWin
|
||||
let arr = getElectronPath().replaceAll('\\', '/').split('/')
|
||||
arr.pop()
|
||||
arr[arr.length - 1] = 'yjearth/app.db'
|
||||
let db_path: any = arr.join('/')
|
||||
// let db_path: any = 'C:/Users/Administrator/AppData/Roaming/yjearth/app.db'
|
||||
zip_file([db_path], path, () => {
|
||||
// loadingInstance.close()
|
||||
ElMessage({
|
||||
message: '导出完成',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// dialog
|
||||
// .showSaveDialog({
|
||||
// title: '请选择要保存的文件名',
|
||||
// buttonLabel: '保存',
|
||||
// defaultPath: `工程${formattedDate}.zip`,
|
||||
// filters: [{ name: '文件类型', extensions: ['zip'] }]
|
||||
// })
|
||||
// .then((result) => {
|
||||
// if (result.canceled) {
|
||||
// exportWin = !exportWin
|
||||
// return
|
||||
// }
|
||||
// // let loadingInstance = this.$openLoading('拼命导出中...')
|
||||
// exportWin = !exportWin
|
||||
// let arr = getElectronPath().replaceAll('\\', '/').split('/')
|
||||
// arr[arr.length - 1] = 'database.ydb'
|
||||
// let db_path: any = arr.join('/')
|
||||
// zip_file([db_path], result.filePath, () => {
|
||||
// // loadingInstance.close()
|
||||
// ElMessage({
|
||||
// message: '导出完成',
|
||||
// type: 'success'
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log(err)
|
||||
// })
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -43,12 +43,22 @@
|
||||
</div>
|
||||
|
||||
<div class="nav_table">
|
||||
<el-table :data="tableData" height="40vh" style="width: 100%">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }"
|
||||
height="40vh"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="cameraName" label="设备名称" width="150" />
|
||||
<el-table-column prop="deviceType" label="设备类型" width="120">
|
||||
<template #default="scope">
|
||||
<span class="deviceType"></span>
|
||||
<!-- {{ statusTrans(scope.row.type) }} -->
|
||||
<span
|
||||
class="deviceType"
|
||||
:style="{
|
||||
background: scope.row.status ? 'rgba(0, 194, 142, 1)' : 'rgba(241, 108, 85, 1)'
|
||||
}"
|
||||
></span>
|
||||
{{ scope.row.type }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
|
||||
<el-input
|
||||
v-model="photoName"
|
||||
style="max-width: 150px"
|
||||
placeholder="请输入图标名称进行搜索"
|
||||
style="max-width: 200px; width: 13vw"
|
||||
placeholder="请输入军标名称进行搜索"
|
||||
class="input-with-select"
|
||||
:suffix-icon="Search"
|
||||
>
|
||||
@ -92,10 +92,17 @@
|
||||
<!-- 右侧模型列表 -->
|
||||
<el-col :span="18">
|
||||
<el-card shadow="hover">
|
||||
<el-table :data="modelList" border style="width: 100%">
|
||||
<el-table
|
||||
:data="modelList"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
border
|
||||
style="width: 100%"
|
||||
ref="tableRef"
|
||||
@header-dragend="handleHeaderDragend"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="militaryName" label="名称" />
|
||||
<el-table-column prop="militaryDataUrl" label="缩略图" width="100">
|
||||
<el-table-column prop="militaryName" label="名称" width="139" />
|
||||
<el-table-column prop="militaryDataUrl" label="缩略图" width="140">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-image
|
||||
style="width: 80px; height: 60px"
|
||||
@ -104,7 +111,7 @@
|
||||
<el-image style="width: 80px; height: 60px" :src="service + row.militaryDataUrl" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" width="210">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small">编辑军标</el-button>
|
||||
<el-button size="small" @click="handleDelete(row)">删除</el-button>
|
||||
@ -131,12 +138,18 @@
|
||||
/>
|
||||
|
||||
<!-- 添加类型弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30%" :before-close="handleClose">
|
||||
<el-input v-model="modelType" placeholder="请输入数据" />
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="30%"
|
||||
style="padding: 10px"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-input v-model="modelType" style="width: calc(100% - 60px)" placeholder="请输入数据" />
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<span class="dialog-footer" style="display: block; text-align: center">
|
||||
<el-button type="primary" @click="addType"> 确定 </el-button>
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -200,13 +213,32 @@ const treeRef = ref()
|
||||
// @ts-ignore
|
||||
var sortableInstance: any = reactive(null)
|
||||
|
||||
const tableRef = ref()
|
||||
|
||||
const handleHeaderDragend = (newWidth, oldWidth, column, event) => {
|
||||
const columns = tableRef.value?.$refs.tableHeaderRef.columnRows[0]
|
||||
let widthDiff = newWidth - oldWidth
|
||||
let otherColumn = columns.filter((item) => {
|
||||
return item.property != column.property || item.label != column.label
|
||||
})
|
||||
let sum = 0
|
||||
otherColumn.forEach((item) => {
|
||||
sum += item.width
|
||||
})
|
||||
otherColumn.forEach((item) => {
|
||||
item.width = item.width - (item.width / sum) * widthDiff
|
||||
})
|
||||
}
|
||||
|
||||
//搜索
|
||||
var photoName = ref(null)
|
||||
var photoName = ref('')
|
||||
|
||||
watch(photoName, (val) => {
|
||||
if (treeRef.value && treeRef.value !== '') {
|
||||
treeRef.value!.filter(val)
|
||||
}
|
||||
// if (treeRef.value && treeRef.value !== '') {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
modelList.value = []
|
||||
getModelList()
|
||||
})
|
||||
const filterNode: any = (value, data) => {
|
||||
if (!value) return true
|
||||
@ -282,7 +314,9 @@ eventBus.on('settingPop', (data) => {
|
||||
})
|
||||
|
||||
const getModelList = async () => {
|
||||
const res: any = await GraphApi.modelTypeList()
|
||||
const params = new URLSearchParams()
|
||||
params.append('militaryName', photoName.value)
|
||||
const res: any = await GraphApi.modelTypeList(params)
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
let data = transformNestedJson(res.data, 'name', 'label')
|
||||
typeTreeData.value = data
|
||||
@ -401,19 +435,50 @@ const handleDragEnd = (
|
||||
ev: DragEvents
|
||||
) => {
|
||||
console.log('tree drag end:', dropNode, dropType, ev, draggingNode)
|
||||
let nodeList = dropNode.childNodes.map((item, index) => {
|
||||
return {
|
||||
id: item.data.id,
|
||||
parentId: dropNode.data.id,
|
||||
treeIndex: index
|
||||
|
||||
if (dropType != 'none') {
|
||||
let nodeList = []
|
||||
switch (dropType) {
|
||||
case 'before':
|
||||
case 'after':
|
||||
if (dropNode.parent?.key) {
|
||||
nodeList = dropNode.parent?.childNodes.map((item, index) => {
|
||||
return {
|
||||
id: item.key,
|
||||
parentId: dropNode.parent?.key,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
nodeList = dropNode.parent?.data.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: null,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
}
|
||||
break
|
||||
case 'inner':
|
||||
nodeList = dropNode.data.children.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: dropNode.data.id,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
})
|
||||
GraphApi.dragModelType(nodeList).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('拖拽成功')
|
||||
getModelList()
|
||||
}
|
||||
})
|
||||
|
||||
GraphApi.dragModelType(nodeList).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('拖拽成功')
|
||||
getModelList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const handleDrop = (draggingNode: Node, dropNode: Node, dropType: NodeDropType, ev: DragEvents) => {
|
||||
console.log('tree drop:', dropNode.label, dropType)
|
||||
@ -442,15 +507,20 @@ const showImage = (row: any) => {
|
||||
const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
|
||||
if (document.getElementsByClassName('settingPop')[0]?.style.transform.length) {
|
||||
let rect = document.getElementsByClassName('settingPop')[0].getBoundingClientRect()
|
||||
contextMenu.x = event.clientX - rect.left
|
||||
contextMenu.y = event.clientY - rect.top
|
||||
} else {
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
}
|
||||
contextMenu.currentRow = row
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
|
||||
if (row.parentId) {
|
||||
// 二级分类菜单
|
||||
contextMenu.items = [
|
||||
{ command: 'import', label: '导入军标', icon: 'importModel' },
|
||||
{ command: 'import', label: '导入军标', icon: 'importjb' },
|
||||
{ command: 'rename', label: '重命名', icon: 'rename' },
|
||||
{ command: 'delete', label: '删除', icon: 'delModel' }
|
||||
]
|
||||
@ -458,7 +528,7 @@ const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
// 一级分类菜单
|
||||
contextMenu.items = [
|
||||
{ command: 'add-child', label: '添加子类型', icon: 'add' },
|
||||
{ command: 'import', label: '导入军标', icon: 'importModel' },
|
||||
{ command: 'import', label: '导入军标', icon: 'importjb' },
|
||||
{ command: 'rename', label: '重命名', icon: 'rename' },
|
||||
{ command: 'delete', label: '删除', icon: 'delModel' }
|
||||
]
|
||||
@ -466,6 +536,14 @@ const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
clickTreeNode = row
|
||||
|
||||
contextMenu.visible = true
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
document.getElementsByClassName('settingPop')[0].addEventListener('mousedown', func)
|
||||
}
|
||||
let func = () => {
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
setTimeout(() => {
|
||||
contextMenu.visible = false
|
||||
}, 200)
|
||||
}
|
||||
const toggleExpand = (row: any) => {
|
||||
if (row.childNodes.length != 0) {
|
||||
@ -494,18 +572,27 @@ const toggleExpand = (row: any) => {
|
||||
const getModelListByType = (id) => {
|
||||
let formData = new FormData()
|
||||
formData.append('militaryTypeId', id)
|
||||
formData.append('name', photoName.value)
|
||||
GraphApi.showModelByType(formData).then((res) => {
|
||||
modelList.value = res.data
|
||||
})
|
||||
}
|
||||
const divContextMenu = (event: MouseEvent) => {
|
||||
event.preventDefault()
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
if (document.getElementsByClassName('settingPop')[0]?.style.transform.length) {
|
||||
let rect = document.getElementsByClassName('settingPop')[0].getBoundingClientRect()
|
||||
contextMenu.x = event.clientX - rect.left
|
||||
contextMenu.y = event.clientY - rect.top
|
||||
} else {
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
}
|
||||
clickTreeNode = null
|
||||
contextMenu.items = [{ command: 'addType', label: '添加类型', icon: 'add' }]
|
||||
contextMenu.items = [{ command: 'addType', label: '添加军标类型', icon: 'add' }]
|
||||
|
||||
contextMenu.visible = true
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
document.getElementsByClassName('settingPop')[0].addEventListener('mousedown', func)
|
||||
}
|
||||
|
||||
const handleMenuCommand = (command: string) => {
|
||||
@ -575,12 +662,57 @@ const handleAddChildType = (row: TypeNode) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// const handleImportModel = (row: TypeNode) => {
|
||||
// triggerUpload()
|
||||
// }
|
||||
const handleImportModel = (row: TypeNode) => {
|
||||
triggerUpload()
|
||||
let option = {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{
|
||||
name: '军标',
|
||||
extensions: ['svg']
|
||||
}
|
||||
]
|
||||
}
|
||||
let imgArr = []
|
||||
$sendElectronChanel('open-directory-dialog', option)
|
||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
||||
if (paths.length) {
|
||||
const formData = new FormData()
|
||||
formData.append('filePaths', paths)
|
||||
formData.append('militaryTypeId', clickTreeNode.id)
|
||||
GraphApi.addGraph(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('导入成功')
|
||||
getModelListByType(clickTreeNode.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const getBase64Image = (src) => {
|
||||
return new Promise((resolve) => {
|
||||
let xhr = new XMLHttpRequest()
|
||||
xhr.open('get', src, true)
|
||||
xhr.responseType = 'blob'
|
||||
xhr.onload = function () {
|
||||
if (this.status == 200) {
|
||||
let blob = this.response
|
||||
let oFileReader = new FileReader()
|
||||
oFileReader.onloadend = function (e) {
|
||||
const base64 = e.target.result
|
||||
resolve(base64)
|
||||
}
|
||||
oFileReader.readAsDataURL(blob)
|
||||
}
|
||||
}
|
||||
xhr.send()
|
||||
})
|
||||
}
|
||||
|
||||
const handleRenameType = (row: TypeNode) => {
|
||||
dialogTitle.value = '军标类型重命名'
|
||||
dialogTitle.value = '修改军标类型'
|
||||
modelType.value = row.label
|
||||
dialogVisible.value = true
|
||||
}
|
||||
@ -702,6 +834,8 @@ const getNamefromPath = (path) => {
|
||||
return name
|
||||
}
|
||||
|
||||
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
|
||||
const { cusUpdateNode, getSelectedNodes, cusRemoveNode } = useTreeNode()
|
||||
const handleDelete = (row: any) => {
|
||||
ElMessageBox.confirm(
|
||||
'删除军标将在系统中永久消失,且军标库和添加到场景展示区的数据也将删除,您确定要执行删除操作吗?',
|
||||
@ -717,8 +851,17 @@ const handleDelete = (row: any) => {
|
||||
formData.append('militaryId', row.id)
|
||||
GraphApi.delModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('删除成功')
|
||||
getModelListByType(row.militaryTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
if (res.data?.length) {
|
||||
//删除对应的树数据和地图数据
|
||||
res.data.forEach((item) => {
|
||||
let node = window.treeObj.getNodeByParam('id', item, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
;(window as any).earth.entityMap.get(source_ids[0]).remove()
|
||||
;(window as any)._entityMap.delete(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -902,14 +1045,18 @@ onMounted(() => {
|
||||
color: rgba(230, 247, 255, 1) !important;
|
||||
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
|
||||
letter-spacing: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.el-message-box {
|
||||
--el-messagebox-title-color: #fff !important;
|
||||
--el-messagebox-content-color: #fff !important;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(var(--color-base1), 0) 0%,
|
||||
rgba(var(--color-base1), 0.2) 100%
|
||||
),
|
||||
rgba(0, 0, 0, 0.6) !important;
|
||||
.el-message-box__btns {
|
||||
.el-button {
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }"
|
||||
height="40vh"
|
||||
style="width: 100%"
|
||||
>
|
||||
|
||||
@ -3,17 +3,7 @@
|
||||
<div class="equipment_title">
|
||||
<div>
|
||||
<el-button
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="importModelDB"
|
||||
>
|
||||
<template #icon>
|
||||
<svg-icon name="select" />
|
||||
</template>
|
||||
<span>选择模型库</span>
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
class="topBut"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="createModelDB"
|
||||
@ -23,16 +13,27 @@
|
||||
</template>
|
||||
<span>创建模型库</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
class="topBut"
|
||||
color="#004b4b"
|
||||
style="border: 1px solid rgba(var(--color-base1), 0.5)"
|
||||
@click="importModelDB"
|
||||
>
|
||||
<template #icon>
|
||||
<svg-icon name="select" />
|
||||
</template>
|
||||
<span>选择模型库</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<el-input
|
||||
v-model.trim="photoName"
|
||||
style="max-width: 150px"
|
||||
style="max-width: 200px; width: 13vw"
|
||||
placeholder="请输入模型名称进行搜索"
|
||||
class="input-with-select"
|
||||
:suffix-icon="Search"
|
||||
/>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-row :gutter="20" class="modelTreeRowCon">
|
||||
<!-- 左侧分类树 -->
|
||||
<el-col :span="6" class="tree">
|
||||
<el-card shadow="hover">
|
||||
@ -45,6 +46,7 @@
|
||||
:data="typeTreeData"
|
||||
:default-expanded-keys="expandedKeys"
|
||||
draggable
|
||||
class="modelTree"
|
||||
ref="treeRef"
|
||||
node-key="id"
|
||||
empty-text=""
|
||||
@ -90,10 +92,17 @@
|
||||
<!-- 右侧模型列表 -->
|
||||
<el-col :span="18">
|
||||
<el-card shadow="hover">
|
||||
<el-table :data="modelList" border style="width: 100%">
|
||||
<el-table
|
||||
ref="tableRef"
|
||||
:data="modelList"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
border
|
||||
style="width: 100%"
|
||||
@header-dragend="handleHeaderDragend"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="modelName" label="模型名称" />
|
||||
<el-table-column prop="thumbnail" label="缩略图" width="100">
|
||||
<el-table-column prop="modelName" label="模型名称" width="139" />
|
||||
<el-table-column prop="thumbnail" label="缩略图" width="140">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
style="width: 80px; height: 60px"
|
||||
@ -102,7 +111,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" width="210">
|
||||
<template #default="{ row }">
|
||||
<!-- <el-button size="small" @click="handleEdit(row)">编辑</el-button> -->
|
||||
<el-button size="small" @click="showImage(row)">预览</el-button>
|
||||
@ -131,12 +140,22 @@
|
||||
/>
|
||||
|
||||
<!-- 添加类型弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30%" :before-close="handleClose">
|
||||
<el-input v-model.trim="modelType" placeholder="请输入模型类型名称" />
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="30%"
|
||||
style="padding: 10px"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-input
|
||||
v-model.trim="modelType"
|
||||
style="width: calc(100% - 60px)"
|
||||
placeholder="请输入模型类型名称"
|
||||
/>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<span class="dialog-footer" style="display: block; text-align: center">
|
||||
<el-button type="primary" @click="addType"> 确定 </el-button>
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -203,6 +222,24 @@ const contextMenu = reactive({
|
||||
})
|
||||
|
||||
const treeRef = ref()
|
||||
//表头拖拽
|
||||
const tableRef = ref(null)
|
||||
|
||||
const handleHeaderDragend = (newWidth, oldWidth, column, event) => {
|
||||
const columns = tableRef.value.$refs.tableHeaderRef.columnRows[0]
|
||||
let widthDiff = newWidth - oldWidth
|
||||
let otherColumn = columns.filter((item) => {
|
||||
return item.property != column.property || item.label != column.label
|
||||
})
|
||||
let sum = 0
|
||||
otherColumn.forEach((item) => {
|
||||
sum += item.width
|
||||
})
|
||||
otherColumn.forEach((item) => {
|
||||
item.width = item.width - (item.width / sum) * widthDiff
|
||||
})
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
var sortableInstance: any = reactive(null)
|
||||
|
||||
@ -220,12 +257,14 @@ const closeDialog = () => {
|
||||
}
|
||||
|
||||
//搜索
|
||||
var photoName = ref(null)
|
||||
var photoName = ref('')
|
||||
|
||||
watch(photoName, (val) => {
|
||||
if (treeRef.value && treeRef.value !== '') {
|
||||
treeRef.value!.filter(val)
|
||||
}
|
||||
// if (treeRef.value && treeRef.value !== '') {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
getModelList()
|
||||
modelList.value = []
|
||||
})
|
||||
const filterNode: any = (value, data) => {
|
||||
if (!value) return true
|
||||
@ -264,16 +303,32 @@ const addType = () => {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
//获取模型列表
|
||||
eventBus.on('settingPop', (data) => {
|
||||
let setFunc = (data) => {
|
||||
if (data) {
|
||||
//关闭弹框时更新模型列表
|
||||
// getModelList()
|
||||
getModelList()
|
||||
|
||||
// getModelListByType(showImageRow.modelTypeId)
|
||||
showImageRow = null
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.off('settingPop', setFunc)
|
||||
eventBus.on('settingPop', setFunc)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('settingPop', setFunc)
|
||||
})
|
||||
//获取模型列表
|
||||
// eventBus.on('settingPop', (data) => {
|
||||
// if (data) {
|
||||
// //关闭弹框时更新模型列表
|
||||
// getModelList()
|
||||
|
||||
// // getModelListByType(showImageRow.modelTypeId)
|
||||
// showImageRow = null
|
||||
// }
|
||||
// })
|
||||
|
||||
var expandedKeys: any = ref([])
|
||||
// 获取当前所有展开节点的key
|
||||
@ -290,7 +345,9 @@ const updateExpandedState = () => {
|
||||
expandedKeys.value = keys
|
||||
}
|
||||
const getModelList = async () => {
|
||||
const res: any = await ModelApi.modelTypeList()
|
||||
const params = new URLSearchParams()
|
||||
params.append('modelName', photoName.value)
|
||||
const res: any = await ModelApi.modelTypeList(params)
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
let data = transformNestedJson(res.data, 'name', 'label')
|
||||
typeTreeData.value = data
|
||||
@ -355,7 +412,6 @@ const handleFileChange = (e: Event) => {
|
||||
//创建模型库
|
||||
const createModelDB = async () => {
|
||||
let date = new Date().toISOString().split('T')[0]
|
||||
console.log(date, 'datedatedatedate')
|
||||
let option = {
|
||||
title: '创建模型库',
|
||||
// filename: 'YJEarth.model',
|
||||
@ -364,7 +420,6 @@ const createModelDB = async () => {
|
||||
}
|
||||
$sendElectronChanel('saveFile', option)
|
||||
$recvElectronChanel('selectedFileItem', (e, path) => {
|
||||
console.log(path, 'klklkllllk')
|
||||
if (path) {
|
||||
let index = path.lastIndexOf('/')
|
||||
let model_lib_path = path.slice(0, index)
|
||||
@ -429,20 +484,74 @@ const handleDragEnd = (
|
||||
dropType: NodeDropType,
|
||||
ev: DragEvents
|
||||
) => {
|
||||
console.log('tree drag end:', dropNode, dropType, ev, draggingNode)
|
||||
let nodeList = dropNode.childNodes.map((item, index) => {
|
||||
return {
|
||||
id: item.data.id,
|
||||
parentId: dropNode.data.id,
|
||||
treeIndex: index
|
||||
console.log('tree drag end:', dropNode, dropType, ev, draggingNode, draggingNode.parent)
|
||||
if (dropType != 'none') {
|
||||
let nodeList = []
|
||||
switch (dropType) {
|
||||
case 'before':
|
||||
case 'after':
|
||||
if (dropNode.parent?.key) {
|
||||
nodeList = dropNode.parent?.childNodes.map((item, index) => {
|
||||
return {
|
||||
id: item.key,
|
||||
parentId: dropNode.parent?.key,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
nodeList = dropNode.parent?.data.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: null,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
}
|
||||
break
|
||||
case 'inner':
|
||||
nodeList = dropNode.data.children.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: dropNode.data.id,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
})
|
||||
ModelApi.dragModelType(nodeList).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('拖拽成功')
|
||||
getModelList()
|
||||
}
|
||||
})
|
||||
ModelApi.dragModelType(nodeList).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('拖拽成功')
|
||||
getModelList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const isEqual = (obj1, obj2) => {
|
||||
// 基本类型直接比较
|
||||
if (obj1 === obj2) return true
|
||||
|
||||
// 类型不同或有一个为 null
|
||||
if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) {
|
||||
return false
|
||||
}
|
||||
|
||||
const keys1 = Object.keys(obj1)
|
||||
const keys2 = Object.keys(obj2)
|
||||
|
||||
// 键数量不同
|
||||
if (keys1.length !== keys2.length) return false
|
||||
|
||||
for (let key of keys1) {
|
||||
// 键不存在
|
||||
if (!obj2.hasOwnProperty(key)) return false
|
||||
|
||||
// 递归比较值
|
||||
if (!isEqual(obj1[key], obj2[key])) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
const handleDrop = (draggingNode: Node, dropNode: Node, dropType: NodeDropType, ev: DragEvents) => {
|
||||
console.log('tree drop:', dropNode.label, dropType)
|
||||
@ -473,19 +582,17 @@ const showImage = (row: any) => {
|
||||
const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
|
||||
contextMenu.currentRow = row
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
// 计算相对于文档的坐标
|
||||
if (document.getElementsByClassName('settingPop')[0]?.style.transform.length) {
|
||||
let rect = document.getElementsByClassName('settingPop')[0].getBoundingClientRect()
|
||||
contextMenu.x = event.clientX - rect.left
|
||||
contextMenu.y = event.clientY - rect.top
|
||||
} else {
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
}
|
||||
|
||||
// if (row.parentId) {
|
||||
// // 二级分类菜单
|
||||
// contextMenu.items = [
|
||||
// { command: 'import', label: '导入模型', icon: 'importModel' },
|
||||
// { command: 'rename', label: '重命名', icon: 'rename' },
|
||||
// { command: 'delete', label: '删除', icon: 'delModel' }
|
||||
// ]
|
||||
// } else {
|
||||
// 一级分类菜单
|
||||
contextMenu.items = [
|
||||
{ command: 'add-child', label: '添加子类型', icon: 'add' },
|
||||
@ -497,6 +604,14 @@ const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
clickTreeNode = row
|
||||
|
||||
contextMenu.visible = true
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
document.getElementsByClassName('settingPop')[0].addEventListener('mousedown', func)
|
||||
}
|
||||
let func = () => {
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
setTimeout(() => {
|
||||
contextMenu.visible = false
|
||||
}, 200)
|
||||
}
|
||||
const toggleExpand = (row: any) => {
|
||||
if (row.childNodes.length != 0) {
|
||||
@ -527,18 +642,28 @@ const getModelListByType = (id) => {
|
||||
clickTypeId = id
|
||||
let formData = new FormData()
|
||||
formData.append('modelTypeId', id)
|
||||
formData.append('name', photoName.value)
|
||||
ModelApi.showModelByType(formData).then((res) => {
|
||||
modelList.value = res.data
|
||||
})
|
||||
}
|
||||
const divContextMenu = (event: MouseEvent) => {
|
||||
event.preventDefault()
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
if (document.getElementsByClassName('settingPop')[0]?.style.transform.length) {
|
||||
let rect = document.getElementsByClassName('settingPop')[0].getBoundingClientRect()
|
||||
contextMenu.x = event.clientX - rect.left
|
||||
contextMenu.y = event.clientY - rect.top
|
||||
} else {
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
}
|
||||
|
||||
clickTreeNode = null
|
||||
contextMenu.items = [{ command: 'addType', label: '添加类型', icon: 'add' }]
|
||||
contextMenu.items = [{ command: 'addType', label: '添加模型类型', icon: 'add' }]
|
||||
|
||||
contextMenu.visible = true
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
document.getElementsByClassName('settingPop')[0].addEventListener('mousedown', func)
|
||||
}
|
||||
|
||||
const handleMenuCommand = (command: string) => {
|
||||
@ -608,12 +733,37 @@ const handleAddChildType = (row: TypeNode) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// const handleImportModel = (row: TypeNode) => {
|
||||
// triggerUpload()
|
||||
// }
|
||||
const handleImportModel = (row: TypeNode) => {
|
||||
triggerUpload()
|
||||
let option = {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{
|
||||
name: '人工模型',
|
||||
extensions: ['glb', 'gltf']
|
||||
}
|
||||
]
|
||||
}
|
||||
$sendElectronChanel('open-directory-dialog', option)
|
||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
||||
if (paths.length) {
|
||||
const formData = new FormData()
|
||||
formData.append('filePaths', paths)
|
||||
formData.append('modelTypeId', clickTreeNode.id)
|
||||
ModelApi.addModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('导入成功')
|
||||
getModelListByType(clickTreeNode.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleRenameType = (row: TypeNode) => {
|
||||
dialogTitle.value = '模型类型重命名'
|
||||
dialogTitle.value = '修改模型类型'
|
||||
modelType.value = row.label
|
||||
dialogVisible.value = true
|
||||
}
|
||||
@ -740,6 +890,9 @@ const getNamefromPath = (path) => {
|
||||
return name
|
||||
}
|
||||
|
||||
import { useTreeNode } from '@/views/components/tree/hooks/treeNode'
|
||||
const { cusUpdateNode, getSelectedNodes, cusRemoveNode } = useTreeNode()
|
||||
|
||||
const handleDelete = (row: ModelItem) => {
|
||||
ElMessageBox.confirm(
|
||||
'删除模型将在系统中永久消失,且模型库和添加到场景展示区的数据也将删除,您确定要执行删除操作吗?',
|
||||
@ -755,9 +908,19 @@ const handleDelete = (row: ModelItem) => {
|
||||
formData.append('modelId', row.id)
|
||||
ModelApi.delModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('删除成功')
|
||||
// @ts-ignore
|
||||
getModelListByType(row.modelTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
|
||||
if (res.data?.length) {
|
||||
//删除对应的树数据和地图数据
|
||||
res.data.forEach((item) => {
|
||||
let node = window.treeObj.getNodeByParam('id', item, null)
|
||||
let source_ids = cusRemoveNode(window.treeObj, [node])
|
||||
;(window as any).earth.entityMap.get(source_ids[0]).remove()
|
||||
;(window as any)._entityMap.delete(item)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -936,10 +1099,14 @@ onMounted(() => {
|
||||
color: rgba(230, 247, 255, 1) !important;
|
||||
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
|
||||
letter-spacing: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
.equipment_title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 0px -10px 10px -10px;
|
||||
}
|
||||
.topBut:hover {
|
||||
color: 1px solid rgba(var(--color-base1), 1) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<el-input
|
||||
v-model="photoName"
|
||||
style="max-width: 150px"
|
||||
style="max-width: 200px; width: 13vw"
|
||||
placeholder="请输入图标名称进行搜索"
|
||||
class="input-with-select"
|
||||
:suffix-icon="Search"
|
||||
@ -42,7 +42,7 @@
|
||||
>
|
||||
</div> -->
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-row :gutter="20" class="photoTreeRowCon">
|
||||
<!-- 左侧分类树 -->
|
||||
<el-col :span="6" class="tree">
|
||||
<el-card shadow="hover">
|
||||
@ -100,10 +100,17 @@
|
||||
<!-- 右侧模型列表 -->
|
||||
<el-col :span="18">
|
||||
<el-card shadow="hover">
|
||||
<el-table :data="modelList" border style="width: 100%">
|
||||
<el-table
|
||||
:data="modelList"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
border
|
||||
style="width: 100%"
|
||||
ref="tableRef"
|
||||
@header-dragend="handleHeaderDragend"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="60" align="center" />
|
||||
<el-table-column prop="iconName" label="名称" />
|
||||
<el-table-column prop="iconDataUrl" label="缩略图" width="100">
|
||||
<el-table-column prop="iconName" label="名称" width="139" />
|
||||
<el-table-column prop="iconDataUrl" label="缩略图" width="140">
|
||||
<template #default="{ row, $index }" v-if="activeIndex === 2">
|
||||
<el-image
|
||||
ref="imageRef"
|
||||
@ -131,7 +138,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" width="210">
|
||||
<template #default="{ row, $index }">
|
||||
<el-button size="small" @click="reviewPhoto($index)">预览</el-button>
|
||||
<el-button size="small" v-if="activeIndex === 2" @click="editPhotoName(row)"
|
||||
@ -163,12 +170,18 @@
|
||||
/>
|
||||
|
||||
<!-- 添加类型弹窗 -->
|
||||
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="30%" :before-close="handleClose">
|
||||
<el-input v-model="modelType" placeholder="请输入名称" />
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="30%"
|
||||
style="padding: 10px"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-input v-model="modelType" style="width: calc(100% - 60px)" placeholder="请输入名称" />
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<span class="dialog-footer" style="display: block; text-align: center">
|
||||
<el-button type="primary" @click="addType"> 确定 </el-button>
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@ -243,6 +256,24 @@ const typeClick = (index) => {
|
||||
getModelList()
|
||||
}
|
||||
|
||||
//表头拖拽
|
||||
const tableRef = ref()
|
||||
|
||||
const handleHeaderDragend = (newWidth, oldWidth, column, event) => {
|
||||
const columns = tableRef.value.$refs.tableHeaderRef.columnRows[0]
|
||||
let widthDiff = newWidth - oldWidth
|
||||
let otherColumn = columns.filter((item) => {
|
||||
return item.property != column.property || item.label != column.label
|
||||
})
|
||||
let sum = 0
|
||||
otherColumn.forEach((item) => {
|
||||
sum += item.width
|
||||
})
|
||||
otherColumn.forEach((item) => {
|
||||
item.width = item.width - (item.width / sum) * widthDiff
|
||||
})
|
||||
}
|
||||
|
||||
var expandedKeys: any = ref([])
|
||||
// 获取当前所有展开节点的key
|
||||
const getExpandedKeys = () => {
|
||||
@ -252,12 +283,14 @@ const getExpandedKeys = () => {
|
||||
.map((node: any) => node.key)
|
||||
}
|
||||
|
||||
var photoName = ref(null)
|
||||
var photoName = ref('')
|
||||
|
||||
watch(photoName, (val) => {
|
||||
if (treeRef.value && treeRef.value !== '') {
|
||||
treeRef.value!.filter(val)
|
||||
}
|
||||
// if (treeRef.value && treeRef.value !== '') {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
getModelList()
|
||||
modelList.value = []
|
||||
})
|
||||
const filterNode: any = (value, data) => {
|
||||
if (!value) return true
|
||||
@ -362,7 +395,9 @@ const getModelList = async () => {
|
||||
]
|
||||
} else {
|
||||
//自定义类型
|
||||
const res: any = await PhotoApi.modelTypeList()
|
||||
const params = new URLSearchParams()
|
||||
params.append('iconName', photoName.value)
|
||||
const res: any = await PhotoApi.modelTypeList(params)
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
let data = transformNestedJson(res.data, 'name', 'label')
|
||||
typeTreeData.value = data
|
||||
@ -481,19 +516,48 @@ const handleDragEnd = (
|
||||
ev: DragEvents
|
||||
) => {
|
||||
console.log('tree drag end:', dropNode, dropType, ev, draggingNode)
|
||||
let nodeList = dropNode.childNodes.map((item, index) => {
|
||||
return {
|
||||
id: item.data.id,
|
||||
parentId: dropNode.data.id,
|
||||
treeIndex: index
|
||||
if (dropType != 'none') {
|
||||
let nodeList = []
|
||||
switch (dropType) {
|
||||
case 'before':
|
||||
case 'after':
|
||||
if (dropNode.parent?.key) {
|
||||
nodeList = dropNode.parent?.childNodes.map((item, index) => {
|
||||
return {
|
||||
id: item.key,
|
||||
parentId: dropNode.parent?.key,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
} else {
|
||||
nodeList = dropNode.parent?.data.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: null,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
}
|
||||
break
|
||||
case 'inner':
|
||||
nodeList = dropNode.data.children.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
parentId: dropNode.data.id,
|
||||
treeIndex: index
|
||||
}
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
})
|
||||
PhotoApi.dragModelType(nodeList).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('拖拽成功')
|
||||
getModelList()
|
||||
}
|
||||
})
|
||||
PhotoApi.dragModelType(nodeList).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('拖拽成功')
|
||||
getModelList()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const handleDrop = (draggingNode: Node, dropNode: Node, dropType: NodeDropType, ev: DragEvents) => {
|
||||
console.log('tree drop:', dropNode.label, dropType)
|
||||
@ -527,13 +591,19 @@ const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
}
|
||||
|
||||
contextMenu.currentRow = row
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
if (document.getElementsByClassName('settingPop')[0]?.style.transform.length) {
|
||||
let rect = document.getElementsByClassName('settingPop')[0].getBoundingClientRect()
|
||||
contextMenu.x = event.clientX - rect.left
|
||||
contextMenu.y = event.clientY - rect.top
|
||||
} else {
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
}
|
||||
|
||||
if (row.parentId) {
|
||||
// 二级分类菜单
|
||||
contextMenu.items = [
|
||||
{ command: 'import', label: '导入图标', icon: 'importModel' },
|
||||
{ command: 'import', label: '导入图标', icon: 'importtb' },
|
||||
{ command: 'rename', label: '重命名', icon: 'rename' },
|
||||
{ command: 'delete', label: '删除', icon: 'delModel' }
|
||||
]
|
||||
@ -541,7 +611,7 @@ const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
// 一级分类菜单
|
||||
contextMenu.items = [
|
||||
{ command: 'add-child', label: '添加子类型', icon: 'add' },
|
||||
{ command: 'import', label: '导入图标', icon: 'importModel' },
|
||||
{ command: 'import', label: '导入图标', icon: 'importtb' },
|
||||
{ command: 'rename', label: '重命名', icon: 'rename' },
|
||||
{ command: 'delete', label: '删除', icon: 'delModel' }
|
||||
]
|
||||
@ -549,6 +619,14 @@ const handleContextMenu = (event: MouseEvent, row: TypeNode) => {
|
||||
clickTreeNode = row
|
||||
|
||||
contextMenu.visible = true
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
document.getElementsByClassName('settingPop')[0].addEventListener('mousedown', func)
|
||||
}
|
||||
let func = () => {
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
setTimeout(() => {
|
||||
contextMenu.visible = false
|
||||
}, 200)
|
||||
}
|
||||
const toggleExpand = (row: any) => {
|
||||
if (row.childNodes.length != 0) {
|
||||
@ -582,6 +660,7 @@ const getModelListByType = async (id) => {
|
||||
} else {
|
||||
let formData = new FormData()
|
||||
formData.append('iconTypeId', id)
|
||||
formData.append('name', photoName.value)
|
||||
PhotoApi.showModelByType(formData).then((res) => {
|
||||
modelList.value = res.data
|
||||
})
|
||||
@ -592,12 +671,20 @@ const divContextMenu = (event: MouseEvent) => {
|
||||
return
|
||||
}
|
||||
event.preventDefault()
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
if (document.getElementsByClassName('settingPop')[0]?.style.transform.length) {
|
||||
let rect = document.getElementsByClassName('settingPop')[0].getBoundingClientRect()
|
||||
contextMenu.x = event.clientX - rect.left
|
||||
contextMenu.y = event.clientY - rect.top
|
||||
} else {
|
||||
contextMenu.x = event.clientX
|
||||
contextMenu.y = event.clientY
|
||||
}
|
||||
clickTreeNode = null
|
||||
contextMenu.items = [{ command: 'addType', label: '添加类型', icon: 'add' }]
|
||||
contextMenu.items = [{ command: 'addType', label: '添加图标类型', icon: 'add' }]
|
||||
|
||||
contextMenu.visible = true
|
||||
document.getElementsByClassName('settingPop')[0].removeEventListener('mousedown', func)
|
||||
document.getElementsByClassName('settingPop')[0].addEventListener('mousedown', func)
|
||||
}
|
||||
|
||||
const handleMenuCommand = (command: string) => {
|
||||
@ -668,12 +755,37 @@ const handleAddChildType = (row: TypeNode) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// const handleImportModel = (row: TypeNode) => {
|
||||
// triggerUpload()
|
||||
// }
|
||||
const handleImportModel = (row: TypeNode) => {
|
||||
triggerUpload()
|
||||
let option = {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{
|
||||
name: '图标',
|
||||
extensions: ['jpg', 'jpeg', 'png', 'gif']
|
||||
}
|
||||
]
|
||||
}
|
||||
$sendElectronChanel('open-directory-dialog', option)
|
||||
$recvElectronChanel('selectedItem', (e, paths) => {
|
||||
if (paths.length) {
|
||||
const formData = new FormData()
|
||||
formData.append('filePaths', paths)
|
||||
formData.append('iconTypeId', clickTreeNode.id)
|
||||
PhotoApi.addGraph(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('导入成功')
|
||||
getModelListByType(clickTreeNode.id)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleRenameType = (row: TypeNode) => {
|
||||
dialogTitle.value = '图标类型重命名'
|
||||
dialogTitle.value = '修改图标类型'
|
||||
modelType.value = row.label
|
||||
dialogVisible.value = true
|
||||
}
|
||||
@ -818,8 +930,8 @@ const handleDelete = (row: any) => {
|
||||
formData.append('iconId', row.id)
|
||||
PhotoApi.delModel(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('删除成功')
|
||||
getModelListByType(row.iconTypeId)
|
||||
ElMessage.success('删除成功')
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -835,7 +947,6 @@ const setPhotoList = () => {
|
||||
dirName1s: 'GEMarker1s'
|
||||
})
|
||||
$recvElectronChanel('dirFiles', (e, res) => {
|
||||
console.log('dirFiles', res)
|
||||
res.GEMarker1s.forEach((item) => {
|
||||
let name = item.split('.')[0]
|
||||
name = name.split('/')[1]
|
||||
@ -1034,10 +1145,7 @@ onMounted(() => {
|
||||
width: 90px;
|
||||
height: 32px;
|
||||
opacity: 1;
|
||||
border-radius:
|
||||
0px 4px,
|
||||
4px,
|
||||
0px;
|
||||
border-radius: 0px 4px, 4px, 0px;
|
||||
background: rgba(var(--color-base1), 0.2);
|
||||
border: 1px solid rgba(var(--color-base1), 0.1);
|
||||
display: flex;
|
||||
@ -1066,6 +1174,7 @@ onMounted(() => {
|
||||
color: rgba(230, 247, 255, 1) !important;
|
||||
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
|
||||
letter-spacing: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
.clickButClass {
|
||||
color: rgba(var(--color-base1), 1);
|
||||
|
||||
@ -634,7 +634,7 @@ const setData = () => {
|
||||
TreeApi.getTreeDefault().then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage({
|
||||
message: '添加完成,2秒后,将重启系统',
|
||||
message: '添加完成,2秒后将重启系统',
|
||||
type: 'success'
|
||||
})
|
||||
setTimeout(() => {
|
||||
@ -683,7 +683,7 @@ const intoBack = async () => {
|
||||
devTools: true
|
||||
}
|
||||
},
|
||||
`http://localhost:${availablePort}/backManage/index.html`,
|
||||
`http://localhost:${availablePort}/backManage/index.html#/login`,
|
||||
{},
|
||||
id
|
||||
)
|
||||
|
||||
@ -2,10 +2,11 @@
|
||||
<div class="set_pup">
|
||||
<el-dialog
|
||||
v-model="isShowPup"
|
||||
:modal="false"
|
||||
:modal="true"
|
||||
draggable
|
||||
:close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
class="settingPop"
|
||||
>
|
||||
<template #header>
|
||||
<div class="set_pup_header">
|
||||
@ -86,7 +87,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<div class="set_detail">
|
||||
<el-tabs :tab-position="tabPosition" v-model="activeName">
|
||||
<el-tabs :tab-position="tabPosition" :before-leave="changeTab" v-model="activeName">
|
||||
<el-tab-pane :label="t('system.authorize')" name="authorize">
|
||||
<authorize></authorize>
|
||||
</el-tab-pane>
|
||||
@ -132,6 +133,8 @@ import graphLabelManage from './components/graphLabelManage.vue'
|
||||
import photoManage from './components/photoManage.vue'
|
||||
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const eventBus: any = inject('bus')
|
||||
const { t } = useI18n()
|
||||
const tabPosition = ref('left')
|
||||
const activeName = ref('authorize')
|
||||
@ -144,6 +147,20 @@ const open = (data) => {
|
||||
activeName.value = 'authorize'
|
||||
}
|
||||
}
|
||||
|
||||
const changeTab = (x, j) => {
|
||||
switch (j) {
|
||||
case 'device':
|
||||
eventBus.emit('closeAddDevice')
|
||||
break
|
||||
case 'materials':
|
||||
eventBus.emit('closeAddMaterial')
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
console.log(x, j, 'activeName.value')
|
||||
}
|
||||
const close = () => {
|
||||
isShowPup.value = false
|
||||
}
|
||||
@ -160,11 +177,14 @@ defineExpose({
|
||||
height: 50vh;
|
||||
|
||||
:deep(.el-dialog) {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(var(--color-base1), 0.2) 0%, rgba(var(--color-base1), 0) 100%),
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(var(--color-base1), 0.2) 0%,
|
||||
rgba(var(--color-base1), 0) 100%
|
||||
),
|
||||
rgba(0, 0, 0, 0.6);
|
||||
border: 1px solid var(--color-border1);
|
||||
padding-left: 0 !important;
|
||||
// padding-left: 0 !important;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
@ -229,22 +249,22 @@ defineExpose({
|
||||
|
||||
// height: 50vh;
|
||||
:deep(
|
||||
.el-tabs--left .el-tabs__active-bar.is-left,
|
||||
.el-tabs--left .el-tabs__active-bar.is-right,
|
||||
.el-tabs--right .el-tabs__active-bar.is-left,
|
||||
.el-tabs--right .el-tabs__active-bar.is-right
|
||||
) {
|
||||
.el-tabs--left .el-tabs__active-bar.is-left,
|
||||
.el-tabs--left .el-tabs__active-bar.is-right,
|
||||
.el-tabs--right .el-tabs__active-bar.is-left,
|
||||
.el-tabs--right .el-tabs__active-bar.is-right
|
||||
) {
|
||||
width: 3px;
|
||||
background: rgba(var(--color-base1), 1);
|
||||
height: 40px !important;
|
||||
}
|
||||
|
||||
:deep(
|
||||
.el-tabs--left .el-tabs__nav-wrap.is-left::after,
|
||||
.el-tabs--left .el-tabs__nav-wrap.is-right::after,
|
||||
.el-tabs--right .el-tabs__nav-wrap.is-left::after,
|
||||
.el-tabs--right .el-tabs__nav-wrap.is-right::after
|
||||
) {
|
||||
.el-tabs--left .el-tabs__nav-wrap.is-left::after,
|
||||
.el-tabs--left .el-tabs__nav-wrap.is-right::after,
|
||||
.el-tabs--right .el-tabs__nav-wrap.is-left::after,
|
||||
.el-tabs--right .el-tabs__nav-wrap.is-right::after
|
||||
) {
|
||||
width: 3px;
|
||||
}
|
||||
|
||||
|
||||
@ -255,16 +255,19 @@ onMounted(() => {
|
||||
if (window.sunshine) {
|
||||
let data = JSON.parse(localStorage.getItem('shineSetting'))
|
||||
// weatherData.currWeather = data.currWeather
|
||||
//是否是实时光照
|
||||
if (!data.currWeather) {
|
||||
weatherData.time = data.time
|
||||
if (data) {
|
||||
//判断是否有数据
|
||||
//是否是实时光照
|
||||
if (!data?.currWeather) {
|
||||
weatherData.time = data.time
|
||||
}
|
||||
weatherData.softShadow = data.softShadow
|
||||
weatherData.darkness = data.darkness
|
||||
weatherData.speed = data.speed
|
||||
data?.wearther.forEach((item, index) => {
|
||||
list[index].status = item.status
|
||||
})
|
||||
}
|
||||
weatherData.softShadow = data.softShadow
|
||||
weatherData.darkness = data.darkness
|
||||
weatherData.speed = data.speed
|
||||
data.wearther.forEach((item, index) => {
|
||||
list[index].status = item.status
|
||||
})
|
||||
// list = data.wearther
|
||||
switchStatus.value = true
|
||||
sunshine = window.sunshine
|
||||
@ -278,7 +281,7 @@ onMounted(() => {
|
||||
// sunshine = new YJ.Global.efflect.Sunshine(window.earth, { id: 123 })
|
||||
timeline.moveComplay((item) => {
|
||||
weatherData.currWeather = false
|
||||
sunshine.timeBar = item
|
||||
sunshine && (sunshine.timeBar = item)
|
||||
})
|
||||
|
||||
// timeline.setTime(myData)
|
||||
@ -561,8 +564,11 @@ var shadowChange = () => {
|
||||
width: 250px;
|
||||
height: auto;
|
||||
z-index: 30;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(var(--color-base1), 0) 0%,
|
||||
rgba(var(--color-base1), 0.2) 100%
|
||||
),
|
||||
rgba(0, 0, 0, 0.6);
|
||||
padding: 10px;
|
||||
border: 1.5px solid rgba(var(--color-base1), 1);
|
||||
|
||||
@ -46,14 +46,14 @@ export default class TimeLine {
|
||||
that.timeline.addEventListener('mousedown', (e) => {
|
||||
|
||||
if (e.srcElement.className === 'handle') {
|
||||
if (!that.sunShine) {
|
||||
ElMessage({
|
||||
message: '请开启光照功能',
|
||||
type: 'warning'
|
||||
})
|
||||
} else {
|
||||
that.isDragging = true;
|
||||
}
|
||||
// if (!that.sunShine) {
|
||||
// ElMessage({
|
||||
// message: '请开启光照功能',
|
||||
// type: 'warning'
|
||||
// })
|
||||
// } else {
|
||||
that.isDragging = true;
|
||||
// }
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
@ -88,7 +88,7 @@ export default class TimeLine {
|
||||
that.sdk.viewer && (that.sdk.viewer.clock.shouldAnimate = false)
|
||||
|
||||
//判断当没有开启光照时,点击停止播放时关闭实时光照按钮
|
||||
if (document.getElementById('weatherSwitch').style.color == 'rgb(255, 255, 255)') {
|
||||
if (document.getElementById('weatherSwitch').style.color == 'rgba(var(--color-base1), 1)') {
|
||||
callback(false)
|
||||
}
|
||||
} else {//播放
|
||||
|
||||
@ -687,6 +687,7 @@ const methodMap = {
|
||||
})
|
||||
dom?.classList.remove('default-cursor')
|
||||
dom?.classList.add('custom-cursor')
|
||||
console.log(document.getElementsByClassName('custom-cursor')[0].style, 'llllll')
|
||||
} else {
|
||||
dom?.classList.remove('custom-cursor')
|
||||
dom?.classList.add('default-cursor')
|
||||
@ -1044,7 +1045,7 @@ defineExpose({
|
||||
}
|
||||
.custom-cursor {
|
||||
cursor:
|
||||
url('@/assets/img/mouse.png') 16 16,
|
||||
url('@/assets/img/defaultMouse.png') 2 11,
|
||||
auto;
|
||||
}
|
||||
.default-cursor {
|
||||
@ -1059,6 +1060,7 @@ defineExpose({
|
||||
position: relative;
|
||||
background: unset !important;
|
||||
z-index: 2;
|
||||
line-height: 150px;
|
||||
/* background: url('@/assets/img/timerBg.png') !important;
|
||||
animation: rotate-bg 5s infinite linear; */
|
||||
|
||||
|
||||
@ -127,7 +127,10 @@
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
<button class="add-point" style="margin-left: 10px">
|
||||
<svg class="icon-add"><use xlink:href="#yj-icon-add"></use></svg>增加视点
|
||||
<svg class="icon-add">
|
||||
<use xlink:href="#yj-icon-add"></use>
|
||||
</svg>
|
||||
增加视点
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -192,22 +195,28 @@
|
||||
<template #footer>
|
||||
<div style="position: absolute; left: 24px; display: flex">
|
||||
<button class="afreshPlay">
|
||||
<svg class="icon-play"><use xlink:href="#yj-icon-play"></use></svg>播放
|
||||
<svg class="icon-play">
|
||||
<use xlink:href="#yj-icon-play"></use>
|
||||
</svg>
|
||||
播放
|
||||
</button>
|
||||
<button class="cease" style="margin-left: 10px">
|
||||
<svg-icon name="stop" :size="12" color="rgba(255, 255, 255, 1)"></svg-icon>结束
|
||||
<svg-icon name="stop" :size="12" color="rgba(255, 255, 255, 1)"></svg-icon>
|
||||
结束
|
||||
</button>
|
||||
<button class="video" style="margin-left: 10px" @click="startVideo">
|
||||
<svg-icon name="video" :size="12"></svg-icon>录制
|
||||
<svg-icon name="video" :size="12"></svg-icon>
|
||||
录制
|
||||
</button>
|
||||
</div>
|
||||
<button class="saveRoam" @click="draw">保存</button>
|
||||
<button class="saveRoam" @click="save">保存</button>
|
||||
<button @click="close">取消</button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
//@ts-nocheck
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@ -219,7 +228,7 @@ import { ElMessage } from 'element-plus'
|
||||
import { $sendElectronChanel } from '@/utils/communication'
|
||||
|
||||
const { t } = useI18n()
|
||||
const { cusAddNodes } = useTreeNode()
|
||||
const { cusAddNodes, cusUpdateNode } = useTreeNode()
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
@ -234,15 +243,32 @@ eventBus.on('flyRoamDialog', () => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
})
|
||||
const open = () => {
|
||||
let beforeData = []
|
||||
const open = (data) => {
|
||||
beforeData = data
|
||||
show.value = true
|
||||
baseDialog.value?.open()
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
if (data) {
|
||||
let roamData = JSON.parse(data.params)
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, roamData, {}, draw)
|
||||
}, 100)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
flyRoam = YJ.Global.FlyRoam.open(window.earth, { repeat: Infinity }, {}, draw)
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
const draw = (data) => {
|
||||
if (data.points.length != 0) {
|
||||
|
||||
let allData: any = reactive({
|
||||
name: '',
|
||||
points: [],
|
||||
repeat: '',
|
||||
defaultTime: 0,
|
||||
totalTime: 0
|
||||
})
|
||||
const save = () => {
|
||||
if (allData.points.length != 0) {
|
||||
let selectedNodes = window.treeObj.getSelectedNodes()
|
||||
let node = selectedNodes && selectedNodes[selectedNodes.length - 1]
|
||||
let parentId
|
||||
@ -253,19 +279,39 @@ const draw = (data) => {
|
||||
parentId = node.parentId
|
||||
}
|
||||
}
|
||||
let id = new YJ.Tools().randomString()
|
||||
let id = (beforeData && beforeData.id) || new YJ.Tools().randomString()
|
||||
let paramsData: any = {
|
||||
params: data,
|
||||
params: allData,
|
||||
id,
|
||||
sourceName: t(`default.roam`),
|
||||
sourceName: allData.name || t(`default.roam`),
|
||||
sourceType: 'roam',
|
||||
parentId: parentId
|
||||
}
|
||||
|
||||
TreeApi.addOtherSource(paramsData)
|
||||
paramsData.isShow = true
|
||||
paramsData.params = JSON.stringify(paramsData.params)
|
||||
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
|
||||
if (beforeData && beforeData.id) {
|
||||
// let params2 = {
|
||||
// "id": params.id,
|
||||
// "sourceName": params.name,
|
||||
// "params": params,
|
||||
// "isShow": params.show ? 1 : 0,
|
||||
// }
|
||||
// TreeApi.updateDirectoryInfo(params2)
|
||||
delete paramsData.sourceType
|
||||
delete paramsData.parentId
|
||||
paramsData.isShow = allData.isShow
|
||||
TreeApi.updateDirectoryInfo(paramsData)
|
||||
cusUpdateNode({
|
||||
id: paramsData.id,
|
||||
sourceName: paramsData.sourceName,
|
||||
params: JSON.stringify(paramsData.params)
|
||||
})
|
||||
} else {
|
||||
TreeApi.addOtherSource(paramsData)
|
||||
paramsData.isShow = true
|
||||
paramsData.params = JSON.stringify(paramsData.params)
|
||||
cusAddNodes(window.treeObj, paramsData.parentId, [paramsData])
|
||||
}
|
||||
|
||||
baseDialog.value?.close()
|
||||
} else {
|
||||
ElMessage({
|
||||
@ -274,6 +320,9 @@ const draw = (data) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
const draw = (data) => {
|
||||
allData = data
|
||||
}
|
||||
|
||||
const startVideo = () => {
|
||||
//@ts-ignore
|
||||
@ -331,20 +380,24 @@ defineExpose({
|
||||
linear-gradient(180deg, rgba(27, 248, 195, 0.2) 0%, rgba(27, 248, 195, 0) 100%) !important;
|
||||
border: 1px solid rgba(27, 248, 195, 1) !important;
|
||||
color: rgba(27, 248, 195, 1) !important;
|
||||
|
||||
svg {
|
||||
fill: rgba(27, 248, 195, 1) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.cease {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(241, 108, 85, 0.2) 0%, rgba(241, 108, 85, 0) 100%),
|
||||
rgba(0, 0, 0, 0.5) !important;
|
||||
border: 1px solid rgba(241, 108, 85, 1) !important;
|
||||
color: rgba(241, 108, 85, 1) !important;
|
||||
|
||||
svg {
|
||||
fill: rgba(241, 108, 85, 1) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.video {
|
||||
background:
|
||||
linear-gradient(
|
||||
@ -357,10 +410,12 @@ defineExpose({
|
||||
border: 1px solid rgba(255, 165, 92, 1) !important;
|
||||
color: rgba(255, 165, 92, 1) !important;
|
||||
}
|
||||
|
||||
::v-deep .content input.YJ-custom-checkbox[type='checkbox'] {
|
||||
border: 1px solid rgba(var(--color-base1), 1) !important;
|
||||
background-color: unset !important;
|
||||
}
|
||||
|
||||
::v-deep .iconBut {
|
||||
background: unset !important;
|
||||
border: unset !important;
|
||||
|
||||
@ -159,50 +159,60 @@ function booleanOverlaps(positions1, flag = 'circle') {
|
||||
break
|
||||
}
|
||||
}
|
||||
console.log(itemInArea, 'itemInArea')
|
||||
return itemInArea
|
||||
}
|
||||
function renderCanvas(nodes) {
|
||||
async function renderCanvas(nodes) {
|
||||
let x: any = []
|
||||
let y: any = []
|
||||
nodes.forEach((item) => {
|
||||
// shp物资统计
|
||||
if (item.sourceType == 'Feature') {
|
||||
let obj = JSON.parse(JSON.stringify(item.detail.properties))
|
||||
for (const key in obj) {
|
||||
let name = key
|
||||
// if (shpTotalDict[key]) {
|
||||
// name = shpTotalDict[key]
|
||||
if (shpTotalDict.indexOf(key) != -1) {
|
||||
name = key
|
||||
// 把相同名称的物资数量相加,名称相同时,累加数据
|
||||
let index = x.findIndex((item) => item === name)
|
||||
if (index !== -1) {
|
||||
y[index] = y[index] + Number(obj[key])
|
||||
} else {
|
||||
x.push(name)
|
||||
y.push(Number(obj[key]))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let params = JSON.parse(item.params)
|
||||
if (params.attribute && params.attribute.goods) {
|
||||
let goods = params.attribute.goods.content
|
||||
if (goods.length) {
|
||||
// $root_home_index.goodSearchDialog = false;
|
||||
goods.forEach((good) => {
|
||||
// 把相同名称的物资数量相加,名称相同时,累加数据
|
||||
let index = x.findIndex((item) => item === good.name)
|
||||
if (index !== -1) {
|
||||
y[index] = y[index] + Number(good.cnt)
|
||||
} else {
|
||||
x.push(good.name)
|
||||
y.push(Number(good.cnt))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// nodes.forEach((item) => {
|
||||
// // shp物资统计
|
||||
// if (item.sourceType == 'Feature') {
|
||||
// let obj = JSON.parse(JSON.stringify(item.detail.properties))
|
||||
// for (const key in obj) {
|
||||
// let name = key
|
||||
// // if (shpTotalDict[key]) {
|
||||
// // name = shpTotalDict[key]
|
||||
// if (shpTotalDict.indexOf(key) != -1) {
|
||||
// name = key
|
||||
// // 把相同名称的物资数量相加,名称相同时,累加数据
|
||||
// let index = x.findIndex((item) => item === name)
|
||||
// if (index !== -1) {
|
||||
// y[index] = y[index] + Number(obj[key])
|
||||
// } else {
|
||||
// x.push(name)
|
||||
// y.push(Number(obj[key]))
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// let params = JSON.parse(item.params)
|
||||
// if (params.attribute && params.attribute.goods) {
|
||||
// let goods = params.attribute.goods.content
|
||||
// if (goods.length) {
|
||||
// // $root_home_index.goodSearchDialog = false;
|
||||
// goods.forEach((good) => {
|
||||
// // 把相同名称的物资数量相加,名称相同时,累加数据
|
||||
// let index = x.findIndex((item) => item === good.name)
|
||||
// if (index !== -1) {
|
||||
// y[index] = y[index] + Number(good.cnt)
|
||||
// } else {
|
||||
// x.push(good.name)
|
||||
// y.push(Number(good.cnt))
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
let pointIds = nodes.map((item) => {
|
||||
return item.id
|
||||
})
|
||||
console.log(pointIds, 'pointIds')
|
||||
let res = await MaterialApi.statistics(pointIds)
|
||||
console.log(res, 'resssssssssss')
|
||||
y = Object.values(res.data)
|
||||
x = Object.keys(res.data)
|
||||
console.log(x, y, 'x')
|
||||
|
||||
let notZeroX: any = []
|
||||
let notZeroY: any = []
|
||||
|
||||
@ -122,10 +122,16 @@
|
||||
</template>
|
||||
<template #footer>
|
||||
<button id="routeQuery" @clik="routeQuery">
|
||||
<svg class="icon-query"><use xlink:href="#yj-icon-query"></use></svg>查询
|
||||
<svg class="icon-query">
|
||||
<use xlink:href="#yj-icon-query"></use>
|
||||
</svg>
|
||||
查询
|
||||
</button>
|
||||
<button id="clearRoute" @click="clearRoute">
|
||||
<svg class="icon-route"><use xlink:href="#yj-icon-route"></use></svg>清除路线
|
||||
<svg class="icon-route">
|
||||
<use xlink:href="#yj-icon-route"></use>
|
||||
</svg>
|
||||
清除路线
|
||||
</button>
|
||||
<button @click="close">取消</button>
|
||||
</template>
|
||||
@ -133,10 +139,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onBeforeUnmount } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
//@ts-nocheck
|
||||
import {ref, reactive, onBeforeUnmount} from 'vue'
|
||||
import {inject} from 'vue'
|
||||
import Dialog from '@/components/dialog/baseDialog.vue'
|
||||
import { RouteApi } from '@/api/route/index'
|
||||
import {RouteApi} from '@/api/route/index'
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
@ -216,7 +223,7 @@ const open = () => {
|
||||
//加载路网数据
|
||||
|
||||
const addRoute = async (fileId) => {
|
||||
let res = await RouteApi.loadRoute({ fileId })
|
||||
let res = await RouteApi.loadRoute({fileId})
|
||||
}
|
||||
const getList = async () => {
|
||||
let list = await RouteApi.getRouteList()
|
||||
@ -244,7 +251,8 @@ const routeQuery = async (e) => {
|
||||
waypoints: []
|
||||
})
|
||||
}
|
||||
const clearRoute = (e) => {}
|
||||
const clearRoute = (e) => {
|
||||
}
|
||||
const pickStartPos = () => {
|
||||
routePlanning.pickStartPos((position) => {
|
||||
startLng.value = position.lng
|
||||
@ -317,14 +325,17 @@ defineExpose({
|
||||
left: 10px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#clearRoute {
|
||||
position: absolute;
|
||||
left: 95px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog > .content .row > .col {
|
||||
margin: 0 5px !important;
|
||||
}
|
||||
|
||||
.crossPoint:hover {
|
||||
color: rgba(var(--color-base1), 1);
|
||||
}
|
||||
|
||||
@ -57,23 +57,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">最高水位</span>
|
||||
<div class="input-number input-number-unit-3">
|
||||
<input
|
||||
class="input"
|
||||
id="maxWaterLevel"
|
||||
type="number"
|
||||
title=""
|
||||
min="0"
|
||||
max="9999999"
|
||||
v-model="maxWaterLevel"
|
||||
@input="maxWaterLevelInput"
|
||||
/>
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">最低水位</span>
|
||||
<div class="input-number input-number-unit-3">
|
||||
@ -91,6 +74,23 @@
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<span class="label">最高水位</span>
|
||||
<div class="input-number input-number-unit-3">
|
||||
<input
|
||||
class="input"
|
||||
id="maxWaterLevel"
|
||||
type="number"
|
||||
title=""
|
||||
min="0"
|
||||
max="9999999"
|
||||
v-model="maxWaterLevel"
|
||||
@input="maxWaterLevelInput"
|
||||
/>
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <span class="custom-divider"></span> -->
|
||||
|
||||
@ -44,8 +44,8 @@
|
||||
</el-form>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitProtal"> 确定 </el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
@ -71,11 +71,11 @@ var peopleFormRef: any = ref('')
|
||||
var addForm: any = ref({
|
||||
cameraName: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
port: 554,
|
||||
username: '',
|
||||
password: '',
|
||||
type: '',
|
||||
channel: ''
|
||||
channel: 1
|
||||
})
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
@ -124,11 +124,11 @@ var cancel = () => {
|
||||
addForm.value = {
|
||||
cameraName: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
port: 554,
|
||||
username: '',
|
||||
password: '',
|
||||
type: '',
|
||||
channel: ''
|
||||
channel: 1
|
||||
}
|
||||
}
|
||||
var submitProtal = () => {
|
||||
@ -169,7 +169,8 @@ var submitProtal = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
eventBus.on('openAddDevice', (params) => {
|
||||
|
||||
let func = (params) => {
|
||||
addTitle.value = params.title
|
||||
if (addTitle.value != '添加设备') {
|
||||
addForm.value = params.data
|
||||
@ -177,14 +178,25 @@ eventBus.on('openAddDevice', (params) => {
|
||||
addForm.value = {
|
||||
cameraName: '',
|
||||
ip: '',
|
||||
port: '',
|
||||
port: 554,
|
||||
username: '',
|
||||
password: '',
|
||||
type: '',
|
||||
channel: ''
|
||||
channel: 1
|
||||
}
|
||||
}
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
let closeFunc = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.on('openAddDevice', func)
|
||||
eventBus.on('closeAddDevice', closeFunc)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('openAddDevice', func)
|
||||
eventBus.off('closeAddDevice', closeFunc)
|
||||
})
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
</el-form>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="submitProtal"> 确定 </el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
@ -92,7 +92,7 @@ var submitProtal = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
eventBus.on('openAddMaterial', (params) => {
|
||||
let func = (params) => {
|
||||
console.log(params, 'iuiuuiuiu')
|
||||
addTitle.value = params.title == 'add' ? '添加物资' : '修改物资'
|
||||
if (params.title == 'edit') {
|
||||
@ -106,15 +106,32 @@ eventBus.on('openAddMaterial', (params) => {
|
||||
}
|
||||
}
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
|
||||
let closeFunc = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.on('openAddMaterial', func)
|
||||
eventBus.on('closeAddMaterial', closeFunc)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('openAddMaterial', func)
|
||||
eventBus.off('closeAddMaterial', closeFunc)
|
||||
})
|
||||
|
||||
const open = () => {
|
||||
baseDialog.value?.open()
|
||||
}
|
||||
const close = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
const confirm = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
open,
|
||||
close
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
<div class="col attribute-select-box">
|
||||
<span class="label" style="line-height: 32px">{{ t('general.内容类型') }}</span>
|
||||
<el-select style="width: 175px" v-model="attributeType" @change="attributeChange" placeholder="请选择">
|
||||
<el-option v-for="item in attributeSelect" :key="item.key" :label="t('general.' + item.name)" :value="item.key">
|
||||
<el-option v-for="item in attributeSelect" :key="item.key" :label="t('general.' + item.name)"
|
||||
:value="item.key">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -21,7 +22,7 @@
|
||||
<div class="col">
|
||||
<span class="label">{{ t('general.添加链接') }}</span>
|
||||
<div style="flex: 1; position: relative">
|
||||
<input class="input link_add" type="text" v-model="addlinkInput" />
|
||||
<input class="input link_add" type="text" v-model="addlinkInput"/>
|
||||
<i class="link_add_btn" @click="_addLink"></i>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,7 +39,7 @@
|
||||
<div class="table-body" v-if="attribute.link && attribute.link.content && attribute.link.content.length > 0">
|
||||
<div class="tr" v-for="(item, index) in attribute.link.content">
|
||||
<div class="td" v-if="linkEditActive.index === index">
|
||||
<input class="input" type="text" v-model="linkEditActive.name" />
|
||||
<input class="input" type="text" v-model="linkEditActive.name"/>
|
||||
</div>
|
||||
<div class="td" v-else>{{ item.name }}</div>
|
||||
<div class="td" v-if="linkEditActive.index === index">
|
||||
@ -46,7 +47,10 @@
|
||||
</div>
|
||||
<div class="td" v-else>{{ item.url }}</div>
|
||||
<div class="td operation" v-if="linkEditActive.index === index">
|
||||
<button style="width: 76px;flex: 0 0 76px" @click="linkConfirmEdit(index)">{{ t('general.确认') }}</button>
|
||||
<button style="width: 76px;flex: 0 0 76px" @click="linkConfirmEdit(index)">{{
|
||||
t('general.确认')
|
||||
}}
|
||||
</button>
|
||||
<button style="width: 76px;flex: 0 0 76px" @click="linkCancelEdit">{{ t('general.取消') }}</button>
|
||||
</div>
|
||||
<div class="td operation" v-else>
|
||||
@ -65,8 +69,10 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<span class="label">{{ t('general.编辑内容') }}</span>
|
||||
<input class="input" type="text" v-model="cameraParams.keyWord" style="width: 180px;margin-right: 10px;" />
|
||||
<button class="select btn" @click="cameraSelect({page: 1, limit: cameraParams.pageSize })">{{ t('general.搜索') }}</button>
|
||||
<input class="input" type="text" v-model="cameraParams.keyWord" style="width: 180px;margin-right: 10px;"/>
|
||||
<button class="select btn" @click="cameraSelect({page: 1, limit: cameraParams.pageSize })">
|
||||
{{ t('general.搜索') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@ -86,7 +92,7 @@
|
||||
<div class="tr" v-for="(item, index) in cameraList">
|
||||
<div class="td">
|
||||
<input type="checkbox" :value="item.id" v-model="item.checked"
|
||||
@change="changeAttributeCamera(item)" />
|
||||
@change="changeAttributeCamera(item)"/>
|
||||
<span>{{ t('general.绑定') }}</span>
|
||||
</div>
|
||||
<div class="td">{{ item.cameraName }}</div>
|
||||
@ -104,7 +110,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Pagination :total="cameraParams.total" v-model:page="cameraParams.page" v-model:limit="cameraParams.pageSize" :pageSizes="false" @pagination="cameraSelect" />
|
||||
<Pagination :total="cameraParams.total" v-model:page="cameraParams.page" v-model:limit="cameraParams.pageSize"
|
||||
:pageSizes="false" @pagination="cameraSelect"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="attribute-content attribute-content-isc" v-show="attributeType === 'isc'">
|
||||
@ -127,7 +134,7 @@
|
||||
<div class="table-body" style="display: none">
|
||||
<div class="tr">
|
||||
<div class="td">
|
||||
<input type="checkbox" value="2" />
|
||||
<input type="checkbox" value="2"/>
|
||||
<span>绑定</span>
|
||||
</div>
|
||||
<div class="td">设备名称</div>
|
||||
@ -148,7 +155,7 @@
|
||||
<div class="col">
|
||||
<span class="label">{{ t('general.添加链接') }}</span>
|
||||
<div style="flex: 1; position: relative">
|
||||
<input class="input vr_add" type="text" v-model="addvrInput" />
|
||||
<input class="input vr_add" type="text" v-model="addvrInput"/>
|
||||
<i class="vr_add_btn" @click="_addRr"></i>
|
||||
</div>
|
||||
</div>
|
||||
@ -165,7 +172,7 @@
|
||||
<div class="table-body" v-if="attribute.vr && attribute.vr.content && attribute.vr.content.length > 0">
|
||||
<div class="tr" v-for="(item, index) in attribute.vr.content">
|
||||
<div class="td" v-if="vrEditActive.index === index">
|
||||
<input class="input" type="text" v-model="vrEditActive.name" />
|
||||
<input class="input" type="text" v-model="vrEditActive.name"/>
|
||||
</div>
|
||||
<div class="td" v-else>{{ item.name }}</div>
|
||||
<div class="td" v-if="vrEditActive.index === index">
|
||||
@ -192,7 +199,7 @@
|
||||
<div class="col">
|
||||
<span class="label">{{ t('general.添加链接') }}</span>
|
||||
<div style="flex: 1; position: relative">
|
||||
<input class="input rtmp_add" type="text" v-model="addRtmpInput" />
|
||||
<input class="input rtmp_add" type="text" v-model="addRtmpInput"/>
|
||||
<i class="rtmp_add_btn" @click="_addRtmp"></i>
|
||||
</div>
|
||||
</div>
|
||||
@ -209,7 +216,7 @@
|
||||
<div class="table-body" v-if="attribute.rtmp && attribute.rtmp.content && attribute.rtmp.content.length > 0">
|
||||
<div class="tr" v-for="(item, index) in attribute.rtmp.content">
|
||||
<div class="td" v-if="rtmpEditActive.index === index">
|
||||
<input class="input" type="text" v-model="rtmpEditActive.name" />
|
||||
<input class="input" type="text" v-model="rtmpEditActive.name"/>
|
||||
</div>
|
||||
<div class="td" v-else>{{ item.name }}</div>
|
||||
<div class="td" v-if="rtmpEditActive.index === index">
|
||||
@ -255,7 +262,7 @@
|
||||
<div class="td" style="width: 60px; flex: 0 60px;min-width: 60px;">{{ index + 1 }}</div>
|
||||
<div class="td" style="flex: 0 0 280px;">{{ item.name }}</div>
|
||||
<div class="td"><input class="input" type="number" title="" min="0" max="999999999" v-model="item.cnt"
|
||||
@blur="changeAttributeGoods(item)" @input="$handleInputLimit">
|
||||
@blur="changeAttributeGoods(item)" @input="$handleInputLimit">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -270,12 +277,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { inject } from 'vue'
|
||||
import { deviceApi } from '@/api/deviceManage'
|
||||
import { MaterialApi } from '@/api/material'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
const { t } = useI18n()
|
||||
import {ref} from 'vue'
|
||||
import {inject} from 'vue'
|
||||
import {deviceApi} from '@/api/deviceManage'
|
||||
import {MaterialApi} from '@/api/material'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
|
||||
const {t} = useI18n()
|
||||
|
||||
let ipcRenderer;
|
||||
if (window && window.process && window.process.type === 'renderer') {
|
||||
@ -292,7 +300,7 @@ const cameraParams = ref({
|
||||
page: 1,
|
||||
total: 0
|
||||
})
|
||||
const cameraList:any = ref([])
|
||||
const cameraList: any = ref([])
|
||||
|
||||
const props = defineProps({
|
||||
entityOptions: {
|
||||
@ -353,11 +361,10 @@ const goodsSelect = async (page) => {
|
||||
goodsFilter()
|
||||
console.log('props.entityOptions.attributeGoods', props.entityOptions.attributeGoods)
|
||||
}
|
||||
const cameraSelect = ({ page, limit }) => {
|
||||
const cameraSelect = ({page, limit}) => {
|
||||
if (!props.entityOptions.attributeSelect) {
|
||||
return
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
let flag = false
|
||||
for (let i = 0; i < props.entityOptions.attributeSelect.length; i++) {
|
||||
if (props.entityOptions.attributeSelect[i].key === 'camera') {
|
||||
@ -372,7 +379,7 @@ const cameraSelect = ({ page, limit }) => {
|
||||
cameraParams.value.page = page
|
||||
cameraParams.value.pageSize = limit
|
||||
let url = ""
|
||||
const params:any = {
|
||||
const params: any = {
|
||||
cameraName: cameraParams.value.keyWord,
|
||||
pageNum: cameraParams.value.page,
|
||||
pageSize: cameraParams.value.pageSize
|
||||
@ -446,7 +453,7 @@ if (props.entityOptions.type === 'BillboardObject') {
|
||||
},
|
||||
)
|
||||
goodsSelect(1) // 物资
|
||||
cameraSelect({page: cameraParams.value.page, limit: cameraParams.value.pageSize }) // ip摄像头
|
||||
cameraSelect({page: cameraParams.value.page, limit: cameraParams.value.pageSize}) // ip摄像头
|
||||
}
|
||||
|
||||
|
||||
@ -475,9 +482,9 @@ const _addLink = async () => {
|
||||
const options = {
|
||||
properties: ['openFile', 'multiSelections'], // 允许选择多个文件
|
||||
filters: [
|
||||
{ name: '图片', extensions: ['jpg', 'jpeg', 'png', 'webp', 'svg', 'bmp'] },
|
||||
{ name: '音视频', extensions: ['mp4', 'mp3'] },
|
||||
{ name: 'pdf', extensions: ['pdf'] },
|
||||
{name: '图片', extensions: ['jpg', 'jpeg', 'png', 'webp', 'svg', 'bmp']},
|
||||
{name: '音视频', extensions: ['mp4', 'mp3']},
|
||||
{name: 'pdf', extensions: ['pdf']},
|
||||
]
|
||||
};
|
||||
if (ipcRenderer) {
|
||||
@ -493,8 +500,7 @@ const _addLink = async () => {
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// const pickerOpts = {
|
||||
// types: [
|
||||
// {
|
||||
@ -575,7 +581,7 @@ const _addRr = () => {
|
||||
const options = {
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{ name: '全景图', extensions: ['jpg'] },
|
||||
{name: '全景图', extensions: ['jpg']},
|
||||
]
|
||||
};
|
||||
ipcRenderer.send('open-directory-dialog', options);
|
||||
@ -653,7 +659,8 @@ const rtmpCancelEdit = () => {
|
||||
rtmpEditActive.value = {}
|
||||
}
|
||||
|
||||
const attributeChange = () => { }
|
||||
const attributeChange = () => {
|
||||
}
|
||||
|
||||
const changeAttributeGoods = (item) => {
|
||||
let flag = false
|
||||
@ -663,8 +670,7 @@ const changeAttributeGoods = (item) => {
|
||||
flag = true
|
||||
if (item.cnt) {
|
||||
props.entityOptions.attributeGoods[m].cnt = item.cnt
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
props.entityOptions.attributeGoods.splice(m, 1)
|
||||
}
|
||||
break
|
||||
@ -680,12 +686,12 @@ const changeAttributeGoods = (item) => {
|
||||
name: item.name,
|
||||
cnt: item.cnt,
|
||||
}
|
||||
props.entityOptions.attributeGoods.push({ ...data })
|
||||
props.entityOptions.attributeGoods.push({...data})
|
||||
}
|
||||
}
|
||||
const changeAttributeCamera = (e) => {
|
||||
console.log(e)
|
||||
props.entityOptions.attributeCamera = [{ ...e }]
|
||||
props.entityOptions.attributeCamera = [{...e}]
|
||||
for (let i = 0; i < cameraList.value.length; i++) {
|
||||
if (cameraList.value[i].id !== e.id) {
|
||||
cameraList.value[i].checked = false
|
||||
@ -712,140 +718,145 @@ const changeAttributeCamera = (e) => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(1),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(1),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td:nth-child(1) {
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .td:nth-child(1),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td:nth-child(1),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .td:nth-child(1) {
|
||||
width: 164px;
|
||||
flex: 0 0 164px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(2),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(2),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(2),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(2),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .th:nth-child(2),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td:nth-child(2) {
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .th:nth-child(2),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .td:nth-child(2),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .th:nth-child(2),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td:nth-child(2),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .th:nth-child(2),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .td:nth-child(2) {
|
||||
width: 226px;
|
||||
flex: 0 0 226px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
flex: 0 0 150px;
|
||||
width: 150px;
|
||||
justify-content: center;
|
||||
}
|
||||
.YJ-custom-base-dialog.dialog-en>.content .attribute-content-link .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .attribute-content-link .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .attribute-content-vr .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
|
||||
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-link .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-vr .table .tr .td:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-rtmp .table .tr .th:nth-child(3),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .attribute-content-rtmp .table .tr .td:nth-child(3) {
|
||||
flex: 0 0 190px;
|
||||
width: 190px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .attribute-content-link .table .tr .td .input-group .input,
|
||||
.YJ-custom-base-dialog>.content .attribute-content-vr .table .tr .td .input-group .input,
|
||||
.YJ-custom-base-dialog>.content .attribute-content-rtmp .table .tr .td .input-group .input {
|
||||
.YJ-custom-base-dialog > .content .attribute-content-link .table .tr .td .input-group .input,
|
||||
.YJ-custom-base-dialog > .content .attribute-content-vr .table .tr .td .input-group .input,
|
||||
.YJ-custom-base-dialog > .content .attribute-content-rtmp .table .tr .td .input-group .input {
|
||||
border-radius: 5px 0 0 5px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .attribute-content-materials .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog>.content .attribute-content-materials .table .tr .td:nth-child(1) {
|
||||
.YJ-custom-base-dialog > .content .attribute-content-materials .table .tr .th:nth-child(1),
|
||||
.YJ-custom-base-dialog > .content .attribute-content-materials .table .tr .td:nth-child(1) {
|
||||
flex: 0 0 60px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.isc-table {
|
||||
.YJ-custom-base-dialog > .content .table.isc-table {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr {
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr:last-child,
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr:last-child {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr:last-child,
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr:last-child {
|
||||
border-bottom: 1px solid rgba(var(--color-base1), 0.5);
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr .td span,
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr .td span {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr .td span,
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr .td span {
|
||||
white-space: nowrap;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr .td input[type=checkbox],
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr .td input[type=checkbox] {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr .td input[type=checkbox],
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr .td input[type=checkbox] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .table-body,
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .table-body {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .table-body,
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .table-body {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
height: 186px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr .th,
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr .td {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr .th,
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr .td {
|
||||
flex: 0 0 100px;
|
||||
width: 100px;
|
||||
min-width: 100px;
|
||||
}
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .th,
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .td {
|
||||
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th,
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td {
|
||||
flex: 0 0 110px;
|
||||
width: 110px;
|
||||
min-width: 110px;
|
||||
}
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .th:nth-of-type(3),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .td:nth-of-type(3) {
|
||||
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(3),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(3) {
|
||||
flex: 0 0 110px !important;
|
||||
width: 110px !important;
|
||||
min-width: 110px !important;
|
||||
}
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .th:nth-of-type(5),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .td:nth-of-type(5) {
|
||||
flex: 0 0 95px !important;
|
||||
width: 95px !important;
|
||||
min-width: 95px !important;
|
||||
}
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .th:nth-of-type(6),
|
||||
.YJ-custom-base-dialog.dialog-en>.content .table.camera-table .tr .td:nth-of-type(6) {
|
||||
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(5),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(5) {
|
||||
flex: 0 0 95px !important;
|
||||
width: 95px !important;
|
||||
min-width: 95px !important;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr .th,
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr .td {
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .th:nth-of-type(6),
|
||||
.YJ-custom-base-dialog.dialog-en > .content .table.camera-table .tr .td:nth-of-type(6) {
|
||||
flex: 0 0 95px !important;
|
||||
width: 95px !important;
|
||||
min-width: 95px !important;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr .th,
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr .td {
|
||||
flex: 1;
|
||||
width: auto;
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr .th:first-child,
|
||||
.YJ-custom-base-dialog>.content .table.camera-table .tr .td:first-child,
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr .th:first-child,
|
||||
.YJ-custom-base-dialog>.content .table.isc-table .tr .td:first-child {
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr .th:first-child,
|
||||
.YJ-custom-base-dialog > .content .table.camera-table .tr .td:first-child,
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr .th:first-child,
|
||||
.YJ-custom-base-dialog > .content .table.isc-table .tr .td:first-child {
|
||||
flex: 0 74px;
|
||||
min-width: 74px;
|
||||
}
|
||||
|
||||
@ -29,8 +29,29 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" v-show="showDis">
|
||||
<span class="label">间距</span>
|
||||
<div class="col" style="padding-top: 20px" v-show="showDis">
|
||||
<el-form label-width="100px" :model="addForm" :rules="peopleRules" ref="peopleFormRef">
|
||||
<el-form-item label="间距" prop="distance">
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input
|
||||
id="modelDistance"
|
||||
type="number"
|
||||
title=""
|
||||
min="0"
|
||||
max="999999"
|
||||
step="0.1"
|
||||
placeholder="请输入数值"
|
||||
v-model="addForm.distance"
|
||||
@input="viewPointHeightInput"
|
||||
@change="clangeViewPointHeight"
|
||||
/>
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <span class="label">间距</span>
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input
|
||||
id="modelDistance"
|
||||
@ -46,7 +67,7 @@
|
||||
/>
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -70,8 +91,17 @@ const eventBus: any = inject('bus')
|
||||
const viewPointHeight: any = ref(1.8)
|
||||
var visibility: any = reactive([])
|
||||
var showDis: any = ref(false)
|
||||
var peopleFormRef: any = ref('')
|
||||
|
||||
var type: any = ref('point')
|
||||
|
||||
var addForm: any = ref({
|
||||
distance: null
|
||||
})
|
||||
const peopleRules: any = reactive({
|
||||
distance: [{ required: true, message: '请输入间距', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
var distance: any = ref(null)
|
||||
|
||||
const options = [
|
||||
@ -91,7 +121,8 @@ const options = [
|
||||
eventBus.on('openGraphSetting', (show, data) => {
|
||||
baseDialog.value?.open()
|
||||
show && (type.value = show.key)
|
||||
show && (distance.value = show.value * 1)
|
||||
// show && (distance.value = show.value * 1)
|
||||
show && (addForm.value.distance = show.value * 1)
|
||||
typeChange()
|
||||
})
|
||||
|
||||
@ -120,22 +151,41 @@ const viewPointHeightInput = () => {
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
type.value = 'point'
|
||||
distance.value = null
|
||||
// distance.value = null
|
||||
addForm.value.distance = null
|
||||
eventBus.emit('closeModelSetGraph', true)
|
||||
}
|
||||
const close = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
const save = () => {
|
||||
ModelApi.modelSetting({
|
||||
key: type.value,
|
||||
value: showDis.value ? distance.value : ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
})
|
||||
if (showDis.value) {
|
||||
peopleFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
ModelApi.modelSetting({
|
||||
key: type.value,
|
||||
// value: showDis.value ? distance.value : ''
|
||||
value: showDis.value ? addForm.value.distance : ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ModelApi.modelSetting({
|
||||
key: type.value,
|
||||
// value: showDis.value ? distance.value : ''
|
||||
value: showDis.value ? addForm.value.distance : ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -154,4 +204,7 @@ const save = () => {
|
||||
::v-deep .el-select__placeholder {
|
||||
color: rgba(204, 204, 204, 1) !important;
|
||||
}
|
||||
::v-deep .el-form-item__label {
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<template #content>
|
||||
<div class="content">
|
||||
<span class="custom-divider"></span>
|
||||
<div class="imageCon" ref="threeCanvas">
|
||||
<div class="imageCon" ref="threeCanvas" id="threeCanvas">
|
||||
<!-- <img class="image" :src="rowData.thumbnail" alt="" /> -->
|
||||
</div>
|
||||
<span
|
||||
@ -47,6 +47,7 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js'
|
||||
import { debounce } from '@/utils'
|
||||
import { ModelApi } from '@/api/model/index'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { viewGlb, viewGlbByEarth } from './viewGlb'
|
||||
|
||||
const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
@ -57,7 +58,7 @@ const service = ref(localStorage.getItem('ip'))
|
||||
// var newData: any = reactive({
|
||||
// name: ''
|
||||
// })
|
||||
eventBus.on('imagePopDialog', (data) => {
|
||||
let func = (data) => {
|
||||
rowData = data
|
||||
rowData.name = data.modelName
|
||||
baseDialog.value?.open()
|
||||
@ -66,7 +67,25 @@ eventBus.on('imagePopDialog', (data) => {
|
||||
loadModel()
|
||||
animate()
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.off('imagePopDialog', func)
|
||||
eventBus.on('imagePopDialog', func)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('imagePopDialog', func)
|
||||
})
|
||||
|
||||
// eventBus.on('imagePopDialog', (data) => {
|
||||
// rowData = data
|
||||
// rowData.name = data.modelName
|
||||
// baseDialog.value?.open()
|
||||
// setTimeout(() => {
|
||||
// initThreeJS()
|
||||
// loadModel()
|
||||
// animate()
|
||||
// })
|
||||
// })
|
||||
//----------------模型预览---------------
|
||||
const threeCanvas: any = ref(null)
|
||||
let scene, camera, renderer, model, controls
|
||||
@ -82,7 +101,7 @@ const initThreeJS = () => {
|
||||
75,
|
||||
threeCanvas.value.clientWidth / threeCanvas.value.clientHeight,
|
||||
0.1,
|
||||
1000
|
||||
100000
|
||||
)
|
||||
camera.position.set(0, 1, 5)
|
||||
camera.lookAt(0, 0, 0)
|
||||
@ -101,8 +120,8 @@ const initThreeJS = () => {
|
||||
controls.enableDamping = true // 启用阻尼,增加平滑度
|
||||
controls.dampingFactor = 0.05 // 阻尼系数,默认为0.25
|
||||
controls.screenSpacePanning = false // 平移时是否在屏幕空间中移动,默认false,即在世界空间中移动
|
||||
controls.minDistance = 1 // 最小距离,默认无限制
|
||||
controls.maxDistance = 500 // 最大距离,默认无限制
|
||||
// controls.minDistance = 1 // 最小距离,默认无限制
|
||||
// controls.maxDistance = 500 // 最大距离,默认无限制
|
||||
controls.enableZoom = true // 是否可以缩放,默认true
|
||||
controls.zoomSpeed = 1.0 // 缩放速度,默认1.0
|
||||
controls.rotateSpeed = 1.0 // 旋转速度,默认1.0
|
||||
@ -129,6 +148,7 @@ const loadModel = () => {
|
||||
model = gltf.scene
|
||||
model.position.set(0, 0, 0)
|
||||
scene.add(model) // 将模型添加到场景中
|
||||
adjustCameraToModel(model, camera)
|
||||
},
|
||||
undefined, // onProgress回调函数,可选参数,用于处理加载进度等,这里不使用所以设置为undefined或提供具体实现函数。
|
||||
function (error) {
|
||||
@ -146,6 +166,26 @@ const animate = () => {
|
||||
controls.update() // 更新控制器状态
|
||||
renderer.render(scene, camera) // 渲染场景和相机。
|
||||
}
|
||||
const adjustCameraToModel = (model, camera) => {
|
||||
// 计算模型包围盒
|
||||
const box = new THREE.Box3().setFromObject(model)
|
||||
const center = new THREE.Vector3()
|
||||
box.getCenter(center)
|
||||
|
||||
// 计算包围盒尺寸
|
||||
const boxSize = box.getSize(new THREE.Vector3()).length()
|
||||
|
||||
// 根据视场角计算相机距离
|
||||
const fov = camera.fov * (Math.PI / 180)
|
||||
const cameraZ = boxSize / 2 / Math.tan(fov / 2)
|
||||
|
||||
// 设置相机位置并指向模型中心
|
||||
camera.position.set(center.x, center.y, center.z + cameraZ)
|
||||
camera.lookAt(center)
|
||||
|
||||
// 更新相机矩阵
|
||||
camera.updateProjectionMatrix()
|
||||
}
|
||||
|
||||
const clangeViewPointHeight = () => {}
|
||||
const viewPointHeightInput = () => {
|
||||
@ -172,8 +212,29 @@ const setImage = (e) => {
|
||||
canvas.toBlob((blob) => {
|
||||
const file = new File([blob], 'filename.png', { type: 'image/png' })
|
||||
imageData.value = file
|
||||
ElMessage.warning('点击保存是会应用当前图片')
|
||||
|
||||
const formData = new FormData()
|
||||
formData.append('modelId', rowData.id)
|
||||
// rowData.name && formData.append('modelName', rowData.name)
|
||||
imageData.value && formData.append('file', imageData.value)
|
||||
ModelApi.updatePoster(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
}
|
||||
})
|
||||
|
||||
// ElMessage.warning('设置成功')
|
||||
}, 'image/png')
|
||||
|
||||
// const formData = new FormData()
|
||||
// formData.append('modelId', rowData.id)
|
||||
// rowData.name && formData.append('modelName', rowData.name)
|
||||
// imageData.value && formData.append('file', imageData.value)
|
||||
// ModelApi.updatePoster(formData).then((res) => {
|
||||
// if (res.code == 0 || res.code == 200) {
|
||||
// ElMessage.success('设置成功')
|
||||
// }
|
||||
// })
|
||||
}
|
||||
const close = (e) => {
|
||||
baseDialog.value?.close()
|
||||
@ -182,7 +243,7 @@ const save = (e) => {
|
||||
const formData = new FormData()
|
||||
formData.append('modelId', rowData.id)
|
||||
rowData.name && formData.append('modelName', rowData.name)
|
||||
imageData.value && formData.append('file', imageData.value)
|
||||
// imageData.value && formData.append('file', imageData.value)
|
||||
ModelApi.updatePoster(formData).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
|
||||
@ -311,9 +311,11 @@ let observer: IntersectionObserver | null = null
|
||||
const treeRef: any = ref('')
|
||||
|
||||
watch(modelName, (val) => {
|
||||
if (treeRef.value && treeRef.value !== '') {
|
||||
treeRef.value!.filter(val)
|
||||
}
|
||||
// if (treeRef.value && treeRef.value !== '') {
|
||||
// treeRef.value!.filter(val)
|
||||
// }
|
||||
categories.value = []
|
||||
getModelList()
|
||||
})
|
||||
|
||||
watch(isShowPup, (val) => {
|
||||
@ -561,13 +563,16 @@ const renderModel = async (data, model) => {
|
||||
const getModelListByType = (id) => {
|
||||
let formData = new FormData()
|
||||
formData.append('modelTypeId', id)
|
||||
formData.append('name', modelName.value)
|
||||
ModelApi.showModelByType(formData).then((res) => {
|
||||
categories.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
const getModelList = async () => {
|
||||
const res: any = await ModelApi.modelTypeList()
|
||||
const params = new URLSearchParams()
|
||||
params.append('modelName', modelName.value)
|
||||
const res: any = await ModelApi.modelTypeList(params)
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
let data = transformNestedJson(res.data, 'name', 'label')
|
||||
typeTreeData.value = data
|
||||
@ -598,8 +603,7 @@ onBeforeUnmount(() => {
|
||||
observer?.disconnect()
|
||||
})
|
||||
//end
|
||||
|
||||
eventBus.on('openModel', (data, cb, type) => {
|
||||
let func = (data, cb, type) => {
|
||||
selectCallback = cb
|
||||
addType.value = type
|
||||
isShowPup.value = data
|
||||
@ -607,8 +611,9 @@ eventBus.on('openModel', (data, cb, type) => {
|
||||
getModelList()
|
||||
getSetting()
|
||||
}
|
||||
})
|
||||
eventBus.on('closeModelSet', (data) => {
|
||||
}
|
||||
|
||||
let func2 = (data) => {
|
||||
addType.value = ''
|
||||
selectCallback = null
|
||||
isShowPup.value = data
|
||||
@ -616,6 +621,14 @@ eventBus.on('closeModelSet', (data) => {
|
||||
getSetting()
|
||||
clickTreeNode.value && getModelListByType(clickTreeNode.value)
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.on('openModel', func)
|
||||
eventBus.on('closeModelSet', func2)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('openModel', func)
|
||||
eventBus.off('closeModelSet', func2)
|
||||
})
|
||||
|
||||
//查看是否有设置模型设置
|
||||
|
||||
@ -29,8 +29,29 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col" v-show="showDis">
|
||||
<span class="label">间距</span>
|
||||
<div class="col" style="margin-top: 20px" v-show="showDis">
|
||||
<el-form label-width="100px" :model="addForm" :rules="peopleRules" ref="peopleFormRef">
|
||||
<el-form-item label="间距" prop="distance">
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input
|
||||
id="modelDistance"
|
||||
type="number"
|
||||
title=""
|
||||
min="0"
|
||||
max="999999"
|
||||
step="0.1"
|
||||
placeholder="请输入数值"
|
||||
v-model="addForm.distance"
|
||||
@input="viewPointHeightInput"
|
||||
@change="clangeViewPointHeight"
|
||||
/>
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <span class="label">间距</span>
|
||||
<div class="input-number input-number-unit-1">
|
||||
<input
|
||||
id="modelDistance"
|
||||
@ -46,7 +67,7 @@
|
||||
/>
|
||||
<span class="unit">m</span>
|
||||
<span class="arrow"></span>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -70,6 +91,15 @@ const eventBus: any = inject('bus')
|
||||
const viewPointHeight: any = ref(1.8)
|
||||
var visibility: any = reactive([])
|
||||
var showDis: any = ref(false)
|
||||
var peopleFormRef: any = ref('')
|
||||
|
||||
var addForm: any = ref({
|
||||
distance: null
|
||||
})
|
||||
|
||||
const peopleRules: any = reactive({
|
||||
distance: [{ required: true, message: '请输入间距', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
var type: any = ref('point')
|
||||
var distance: any = ref(null)
|
||||
@ -91,7 +121,8 @@ const options = [
|
||||
eventBus.on('openModelSetting', (show, data) => {
|
||||
baseDialog.value?.open()
|
||||
show && (type.value = show.key)
|
||||
show && (distance.value = show.value * 1)
|
||||
// show && (distance.value = show.value * 1)
|
||||
show && (addForm.value.distance = show.value * 1)
|
||||
typeChange()
|
||||
})
|
||||
|
||||
@ -120,22 +151,41 @@ const viewPointHeightInput = () => {
|
||||
}
|
||||
const closeCallBack = (e) => {
|
||||
type.value = 'point'
|
||||
distance.value = null
|
||||
// distance.value = null
|
||||
addForm.value.distance = null
|
||||
eventBus.emit('closeModelSet', true)
|
||||
}
|
||||
const close = () => {
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
const save = () => {
|
||||
ModelApi.modelSetting({
|
||||
key: type.value,
|
||||
value: showDis.value ? distance.value : ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
})
|
||||
if (showDis.value) {
|
||||
peopleFormRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
ModelApi.modelSetting({
|
||||
key: type.value,
|
||||
// value: showDis.value ? distance.value : ''
|
||||
value: showDis.value ? addForm.value.distance : ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ModelApi.modelSetting({
|
||||
key: type.value,
|
||||
// value: showDis.value ? distance.value : ''
|
||||
value: showDis.value ? addForm.value.distance : ''
|
||||
}).then((res) => {
|
||||
if (res.code == 0 || res.code == 200) {
|
||||
ElMessage.success('设置成功')
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -154,4 +204,7 @@ const save = () => {
|
||||
::v-deep .el-select__placeholder {
|
||||
color: rgba(204, 204, 204, 1) !important;
|
||||
}
|
||||
::v-deep .el-form-item__label {
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,31 +1,37 @@
|
||||
<template>
|
||||
<Dialog ref="baseDialog" :title="title" width="900px" left="calc(50% - 450px)" top="calc(50% - 360px)"
|
||||
:closeCallback="closeCallback">
|
||||
<Dialog
|
||||
ref="baseDialog"
|
||||
:title="title"
|
||||
width="900px"
|
||||
left="calc(50% - 450px)"
|
||||
top="calc(50% - 360px)"
|
||||
:closeCallback="closeCallback"
|
||||
>
|
||||
<template #content>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item" style="display: flex;">
|
||||
<button @click="importHeader" style="margin-right: 15px;">
|
||||
<div class="div-item" style="display: flex">
|
||||
<button @click="importHeader" style="margin-right: 15px">
|
||||
<svg class="icon-updateheigh">
|
||||
<use xlink:href="#icon-importHeader"></use>
|
||||
</svg>{{ t('vector.导入表头') }}
|
||||
<use xlink:href="#icon-importHeader"></use></svg
|
||||
>{{ t('vector.导入表头') }}
|
||||
</button>
|
||||
<button @click="downloadHeader">
|
||||
<svg>
|
||||
<use xlink:href="#icon-download"></use>
|
||||
</svg>{{ t('vector.下载字典模板') }}
|
||||
<use xlink:href="#icon-download"></use></svg
|
||||
>{{ t('vector.下载字典模板') }}
|
||||
</button>
|
||||
<button @click="exportExcel" style="position: absolute; right: 25px;">
|
||||
<button @click="exportExcel" style="position: absolute; right: 25px">
|
||||
<svg>
|
||||
<use xlink:href="#icon-export"></use>
|
||||
</svg>{{ t('vector.导出') }}
|
||||
<use xlink:href="#icon-export"></use></svg
|
||||
>{{ t('vector.导出') }}
|
||||
</button>
|
||||
</div>
|
||||
<span class="custom-divider"></span>
|
||||
<div class="div-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<input type="text" placeholder="输入关键字搜索" v-model="keyword" @input="search">
|
||||
<svg style="position: relative;left: -22px;width: 14px;height: 14px;">
|
||||
<input type="text" placeholder="输入关键字搜索" v-model="keyword" @input="search" />
|
||||
<svg style="position: relative; left: -22px; width: 14px; height: 14px">
|
||||
<use xlink:href="#icon-search"></use>
|
||||
</svg>
|
||||
</div>
|
||||
@ -58,7 +64,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Pagination :total="total" v-model:page="pageNum" v-model:limit="pageSize" :pageSizes="pageSizes" @pagination="getTableList" />
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="pageNum"
|
||||
v-model:limit="pageSize"
|
||||
:pageSizes="pageSizes"
|
||||
@pagination="getTableList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -89,7 +101,7 @@ const baseDialog: any = ref(null)
|
||||
const eventBus: any = inject('bus')
|
||||
const keyData: any = ref([])
|
||||
const keyword: any = ref('')
|
||||
const entityOptions: any = ref({});
|
||||
const entityOptions: any = ref({})
|
||||
let originalOptions: any
|
||||
let that: any
|
||||
const tableData: any = ref([])
|
||||
@ -103,7 +115,7 @@ const title = ref('')
|
||||
const closeCallback = () => {
|
||||
entityOptions.value.originalOptions = structuredClone(originalOptions)
|
||||
entityOptions.value.reset()
|
||||
eventBus.emit("destroyComponent")
|
||||
eventBus.emit('destroyComponent')
|
||||
}
|
||||
const getKeys = () => {
|
||||
keyData.value = []
|
||||
@ -120,18 +132,20 @@ const getKeys = () => {
|
||||
key: key
|
||||
})
|
||||
}
|
||||
console.log(keyData.value, 'keyDatakeyDatakeyData')
|
||||
}
|
||||
let node
|
||||
let parentNode
|
||||
let features
|
||||
const open = async (id: any) => {
|
||||
// that = window.earth.entityMap.get(id)
|
||||
node = window.treeObj.getNodeByParam("id", id, null);
|
||||
node = window.treeObj.getNodeByParam('id', id, null)
|
||||
entityOptions.value.field = JSON.parse(node.params).field
|
||||
that = getThat(node)
|
||||
console.log(node, that, entityOptions.field, 'yyyyyyyyyyyyyy')
|
||||
if (that.options.id === id) {
|
||||
features = that.geojson.features
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
features = [node.params]
|
||||
}
|
||||
console.log(features, that, id)
|
||||
@ -139,6 +153,7 @@ const open = async (id: any) => {
|
||||
let arr = JSON.parse(JSON.stringify(features))
|
||||
filterData.value = JSON.parse(JSON.stringify(arr))
|
||||
total.value = filterData.value.length
|
||||
console.log(arr, 'arrarrarrarrarrarr')
|
||||
let spliceData = arrSplice(arr, pageSize.value)
|
||||
maxPageNum.value = spliceData.length
|
||||
tableData.value = spliceData[pageNum.value - 1]
|
||||
@ -155,10 +170,9 @@ const getThat = (n) => {
|
||||
if (t) {
|
||||
parentNode = n
|
||||
return t
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (n.parentId) {
|
||||
return getThat(window.treeObj.getNodeByParam("id", n.parentId, null))
|
||||
return getThat(window.treeObj.getNodeByParam('id', n.parentId, null))
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -212,30 +226,46 @@ const getTableList = ({ page, limit }) => {
|
||||
maxPageNum.value = spliceData.length
|
||||
tableData.value = spliceData[pageNum.value - 1]
|
||||
}
|
||||
const changeFieId = () => {
|
||||
const changeFieId = async (e) => {
|
||||
console.log(e, 'eeeeeeeee')
|
||||
let data = JSON.parse(node.params)
|
||||
data.field = e
|
||||
let params2 = {
|
||||
id: data.id,
|
||||
sourceName: data.name,
|
||||
params: data,
|
||||
isShow: data.show ? 1 : 0
|
||||
}
|
||||
await TreeApi.updateDirectoryInfo(params2)
|
||||
updateNode(parentNode.children, entityOptions.value.field)
|
||||
}
|
||||
const updateNode = (children, field) => {
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
if (children[i].children) {
|
||||
updateNode(children[i].children, field)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (children[i].params) {
|
||||
cusUpdateNode({ "id": children[i].id, "sourceName": children[i].params.properties[field], "params": children[i].params })
|
||||
cusUpdateNode({
|
||||
id: children[i].id,
|
||||
sourceName:
|
||||
children[i].params.properties[field] === undefined
|
||||
? ''
|
||||
: children[i].params.properties[field],
|
||||
params: children[i].params
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const exportExcel = () => {
|
||||
const exportExcel = async () => {
|
||||
let prepareData: any = [[]]
|
||||
for (let m = 0; m < keyData.value.length; m++) {
|
||||
prepareData[0].push(keyData.value[m].label)
|
||||
}
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
for (let i = 0; i < filterData.value.length; i++) {
|
||||
let array: any = []
|
||||
for (let m = 0; m < keyData.value.length; m++) {
|
||||
array.push(tableData.value[i].properties[keyData.value[m].key])
|
||||
array.push(filterData.value[i].properties[keyData.value[m].key])
|
||||
}
|
||||
prepareData.push(array)
|
||||
}
|
||||
@ -248,23 +278,23 @@ const exportExcel = () => {
|
||||
}
|
||||
const importHeader = () => {
|
||||
let node
|
||||
let selectNodes = getSelectedNodes(window.treeObj);
|
||||
let selectNodes = getSelectedNodes(window.treeObj)
|
||||
if (selectNodes && selectNodes[selectNodes.length - 1]) {
|
||||
node = selectNodes[selectNodes.length - 1]
|
||||
}
|
||||
const dialogParams = {
|
||||
properties: ["openFile", "multiSelections"],
|
||||
properties: ['openFile', 'multiSelections'],
|
||||
filters: [
|
||||
{
|
||||
name: "excel",
|
||||
extensions: ["csv"],
|
||||
},
|
||||
],
|
||||
};
|
||||
name: 'excel',
|
||||
extensions: ['csv']
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
openDirectoryDialog(dialogParams, (paths) => {
|
||||
if (!paths.length) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
let entity = (window as any)._entityMap.get(node.id)
|
||||
if (!entity) {
|
||||
@ -276,17 +306,21 @@ const importHeader = () => {
|
||||
params.headTables = res.data
|
||||
entity.options.headTables = [...params.headTables]
|
||||
let params2 = {
|
||||
"id": node.id,
|
||||
"sourceName": node.sourceName,
|
||||
"params": params,
|
||||
"isShow": node.isShow ? 1 : 0,
|
||||
id: node.id,
|
||||
sourceName: node.sourceName,
|
||||
params: params,
|
||||
isShow: node.isShow ? 1 : 0
|
||||
}
|
||||
TreeApi.updateDirectoryInfo(params2)
|
||||
cusUpdateNode({ "id": params2.id, "sourceName": params2.sourceName, "params": JSON.stringify(params) })
|
||||
cusUpdateNode({
|
||||
id: params2.id,
|
||||
sourceName: params2.sourceName,
|
||||
params: JSON.stringify(params)
|
||||
})
|
||||
getKeys()
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
}
|
||||
const downloadHeader = async () => {
|
||||
let p = 'csv'
|
||||
@ -319,10 +353,10 @@ const close = () => {
|
||||
|
||||
function openDirectoryDialog(option, cb) {
|
||||
const { ipcRenderer } = require('electron')
|
||||
ipcRenderer.send("open-directory-dialog", option);
|
||||
ipcRenderer.once("selectedItem", (e, paths) => {
|
||||
cb(paths);
|
||||
});
|
||||
ipcRenderer.send('open-directory-dialog', option)
|
||||
ipcRenderer.once('selectedItem', (e, paths) => {
|
||||
cb(paths)
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
open,
|
||||
@ -370,4 +404,4 @@ defineExpose({
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
279
src/renderer/src/views/components/propertyBox/viewGlb.js
Normal file
279
src/renderer/src/views/components/propertyBox/viewGlb.js
Normal file
@ -0,0 +1,279 @@
|
||||
import * as THREE from "three";
|
||||
//导入轨道控制器
|
||||
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
||||
//导入GLTF模型加载器
|
||||
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader";
|
||||
|
||||
class viewGlb {
|
||||
constructor(selector) {
|
||||
this.canvasWidth = 900;
|
||||
this.canvasHeight = 650;
|
||||
this.container = document.querySelector(selector); //获取容器
|
||||
this.modelInfo = {};
|
||||
this.scene = null;
|
||||
this.camera = null;
|
||||
this.renderer = null;
|
||||
this.controls = null;
|
||||
this.init(); //初始化
|
||||
this.animate(); //循环函数
|
||||
}
|
||||
|
||||
init() {
|
||||
// 初始化场景
|
||||
this.initScene();
|
||||
// 初始化辅助轴
|
||||
this.initAxesHelper();
|
||||
// 初始化灯光
|
||||
this.initLight();
|
||||
// 初始化相机
|
||||
this.initCamera();
|
||||
// 初始化渲染器
|
||||
this.initRender();
|
||||
// 初始化轨道控制器
|
||||
this.initControls();
|
||||
// 监听场景大小改变,重新渲染尺寸
|
||||
window.addEventListener("resize", this.onWindowResize.bind(this));
|
||||
// this.addGLTFModel()
|
||||
}
|
||||
|
||||
initScene() {
|
||||
this.scene = new THREE.Scene();
|
||||
// this.scene.background = new THREE.Color(0xffffff)
|
||||
}
|
||||
|
||||
initAxesHelper() {
|
||||
const axesHelper = new THREE.AxesHelper(5);
|
||||
this.scene.add(axesHelper);
|
||||
}
|
||||
|
||||
initLight() {
|
||||
const hesLight = new THREE.HemisphereLight(0xffffff, 0x444444);
|
||||
hesLight.intensity = 0.6;
|
||||
this.scene.add(hesLight);
|
||||
|
||||
const dirLight = new THREE.DirectionalLight();
|
||||
dirLight.position.set(5, 5, 5);
|
||||
this.scene.add(dirLight);
|
||||
}
|
||||
|
||||
initCamera() {
|
||||
this.camera = new THREE.PerspectiveCamera(
|
||||
75,
|
||||
this.canvasWidth / this.canvasHeight,
|
||||
0.1,
|
||||
100
|
||||
);
|
||||
// this.camera.position.set(1.5, 1.5, 1.5)
|
||||
this.camera.position.set(2, 2, 2);
|
||||
}
|
||||
|
||||
initRender() {
|
||||
this.renderer = new THREE.WebGLRenderer({
|
||||
antialias: true,
|
||||
alpha: true,
|
||||
// preserveDrawingBuffer: true
|
||||
}); //设置抗锯齿
|
||||
//设置屏幕像素比
|
||||
this.renderer.setPixelRatio(window.devicePixelRatio);
|
||||
//渲染的尺寸大小
|
||||
this.renderer.setSize(this.canvasWidth, this.canvasHeight);
|
||||
//gltf格式模型纹理贴图
|
||||
this.renderer.outputEncoding = THREE.sRGBEncoding;
|
||||
// 设置背景颜色
|
||||
this.renderer.setClearColor(0x000000, 0);
|
||||
// 添加到容器
|
||||
this.container.appendChild(this.renderer.domElement);
|
||||
}
|
||||
|
||||
render() {
|
||||
this.renderer.render(this.scene, this.camera);
|
||||
}
|
||||
|
||||
animate() {
|
||||
this.renderer.setAnimationLoop(this.render.bind(this));
|
||||
}
|
||||
|
||||
initControls() {
|
||||
this.controls = new OrbitControls(this.camera, this.renderer.domElement);
|
||||
}
|
||||
|
||||
onWindowResize() {
|
||||
this.camera.aspect = this.canvasWidth / this.canvasHeight;
|
||||
this.camera.updateProjectionMatrix(); //更新矩阵,将3d内容投射到2d画面上转换
|
||||
this.renderer.setSize(this.canvasWidth, this.canvasHeight);
|
||||
}
|
||||
|
||||
addGLTFModel(obj) {
|
||||
this.modelInfo = obj;
|
||||
return new Promise((resolve, reject) => {
|
||||
const loader = new GLTFLoader(); //.setPath('3dModels/')
|
||||
loader.load(obj.model_url, (gltf) => {
|
||||
console.log(gltf);
|
||||
this.scene.add(gltf.scene);
|
||||
resolve("模型添加成功");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
canvasToBase(cb) {
|
||||
this.renderer.render(this.scene, this.camera);
|
||||
let imgData = this.renderer.domElement.toDataURL("image/png");
|
||||
console.log(imgData);
|
||||
let base64 = imgData.replace(/^data:image\/\w+;base64,/, "");
|
||||
let dataBuffer = new Buffer(base64, "base64");
|
||||
base64ToFile(base64, "image/png", "poster.png");
|
||||
console.log(process.cwd());
|
||||
$root_home_index.$sendElectronChanel("newDir", {
|
||||
name: this.modelInfo.model_name,
|
||||
paths: [process.cwd(), "model_thumb"],
|
||||
buffer: dataBuffer,
|
||||
});
|
||||
$root_home_index.$recvElectronChanel("newDirRes", (e, res) => {
|
||||
// $root_home_index.$message.info(res)
|
||||
cb(res);
|
||||
});
|
||||
|
||||
/*;*/
|
||||
}
|
||||
|
||||
clearScene() {
|
||||
this.scene.traverse((child) => {
|
||||
if (child.material) {
|
||||
child.material.dispose();
|
||||
}
|
||||
if (child.geometry) {
|
||||
child.geometry.dispose();
|
||||
}
|
||||
child = null;
|
||||
});
|
||||
this.container.childNodes[1].remove();
|
||||
this.renderer.forceContextLoss();
|
||||
this.renderer.dispose();
|
||||
this.scene.clear();
|
||||
this.modelInfo = {};
|
||||
this.scene = null;
|
||||
this.camera = null;
|
||||
this.controls = null;
|
||||
this.renderer.domElement = null;
|
||||
this.renderer = null;
|
||||
this.container = null;
|
||||
}
|
||||
}
|
||||
|
||||
class viewGlbByEarth {
|
||||
constructor(selector) {
|
||||
this.viewer = null;
|
||||
this.modelInfo = null;
|
||||
this.selector = selector;
|
||||
this.init(selector);
|
||||
}
|
||||
|
||||
init(selector) {
|
||||
this.viewer = new Cesium.Viewer(selector, {
|
||||
skyBox: false,
|
||||
timeline: false,
|
||||
navigationHelpButton: false,
|
||||
homeButton: false,
|
||||
baseLayerPicker: false,
|
||||
sceneModePicker: false,
|
||||
animation: false,
|
||||
});
|
||||
const scene = this.viewer.scene;
|
||||
/*this.viewer.scene.screenSpaceCameraController.tiltEventTypes = [
|
||||
Cesium.CameraEventType.PINCH,
|
||||
Cesium.CameraEventType.RIGHT_DRAG,
|
||||
]*/
|
||||
scene.screenSpaceCameraController.zoomEventTypes = [
|
||||
Cesium.CameraEventType.WHEEL,
|
||||
Cesium.CameraEventType.PINCH,
|
||||
];
|
||||
scene.screenSpaceCameraController.tiltEventTypes = [
|
||||
Cesium.CameraEventType.PINCH,
|
||||
Cesium.CameraEventType.RIGHT_DRAG,
|
||||
];
|
||||
this.viewer._cesiumWidget._creditContainer.style.display = "none";
|
||||
scene.globe.depthTestAgainstTerrain = true;
|
||||
// scene.globe.show = false;
|
||||
// scene.sun.show = false;
|
||||
// scene.moon.show = false;
|
||||
// scene.skyBox.show = false;
|
||||
// scene.fog.enabled = false;
|
||||
}
|
||||
|
||||
addGltf(obj) {
|
||||
this.modelInfo = obj;
|
||||
|
||||
const czml = [
|
||||
{
|
||||
id: "aircraft model",
|
||||
name: "Cesium Air",
|
||||
position: {
|
||||
cartographicDegrees: [-77, 37, 10000],
|
||||
},
|
||||
model: {
|
||||
gltf: obj.model_url,
|
||||
scale: 2.0,
|
||||
minimumPixelSize: 128,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
let entity = this.viewer.entities.add({
|
||||
position: Cesium.Cartesian3.fromRadians(
|
||||
106.31593773128115,
|
||||
29.625102082951624
|
||||
),
|
||||
model: {
|
||||
uri: obj.model_url,
|
||||
},
|
||||
});
|
||||
|
||||
this.viewer.trackedEntity = entity;
|
||||
}
|
||||
|
||||
canvasToBase(cb) {
|
||||
// let imgData = $(`#${this.selector}`).find("canvas")[0].toDataURL("image/png");
|
||||
// console.log(imgData)
|
||||
this.viewer.render();
|
||||
let imgData = this.viewer.scene.canvas.toDataURL("image/png");
|
||||
let base64 = imgData.replace(/^data:image\/\w+;base64,/, "");
|
||||
let dataBuffer = new Buffer(base64, "base64");
|
||||
let file = this.base64ToFile(base64, "image/png", "poster.png");
|
||||
// console.log("ddddddddddddd", file);
|
||||
cb(file);
|
||||
// $root_home_index.$sendElectronChanel("newDir", {
|
||||
// name: this.modelInfo.model_name, //+ "_" + new Date().getTime(),
|
||||
// paths: [process.cwd(), "model_thumb"],
|
||||
// buffer: dataBuffer,
|
||||
// });
|
||||
// $root_home_index.$recvElectronChanel("newDirRes", (e, res) => {
|
||||
// // $root_home_index.$message.info(res)
|
||||
// cb(res);
|
||||
// });
|
||||
|
||||
/*;*/
|
||||
}
|
||||
base64ToFile(base64, mime, filename) {
|
||||
// let arr = base64.split(",");
|
||||
let type = mime || arr[0].match(/:(.*?);/)[1];
|
||||
// let suffix = mine.split("/")[1];
|
||||
// let fileName = filename || `未命名.${suffix}`;
|
||||
let fileName = filename || `未命名.png`;
|
||||
let bstr = atob(base64);
|
||||
let n = bstr.length;
|
||||
let u8arr = new Uint8Array(n);
|
||||
while (n--) {
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
}
|
||||
return new File([u8arr], fileName, { type });
|
||||
}
|
||||
|
||||
clearScene() {
|
||||
this.viewer.destroy();
|
||||
this.viewer = null;
|
||||
this.modelInfo = null;
|
||||
this.selector = "";
|
||||
}
|
||||
}
|
||||
|
||||
export { viewGlb, viewGlbByEarth };
|
||||
@ -331,12 +331,14 @@ export const useRightOperate = () => {
|
||||
}
|
||||
//编辑
|
||||
const editNode = (eventBus, node) => {
|
||||
console.log(node, 'nnodenodenodenodeode')
|
||||
if (!node) {
|
||||
let selectNodes = getSelectedNodes(window.treeObj);
|
||||
if (selectNodes && selectNodes[selectNodes.length - 1]) {
|
||||
node = selectNodes[selectNodes.length - 1]
|
||||
}
|
||||
}
|
||||
console.log(node.id, 'nnodenodenodenodeode')
|
||||
if (node) {
|
||||
if (node.sourceType == 'pressModel' || node.sourceType == 'roam') {
|
||||
eventBus.emit("openDialog", node.sourceType, node);
|
||||
|
||||
@ -38,8 +38,8 @@
|
||||
y2="-6.678619384765625"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/>
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linear_border_2442_491_0"
|
||||
@ -49,8 +49,8 @@
|
||||
y2="29.435516357421875"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))"/>
|
||||
<stop offset="1" stop-color="var(--color-border1)"/>
|
||||
</linearGradient>
|
||||
<filter
|
||||
id="filter_2442_492"
|
||||
@ -61,21 +61,21 @@
|
||||
filterUnits="userSpaceOnUse"
|
||||
color-interpolation-filters="sRGB"
|
||||
>
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_492" />
|
||||
<feFlood flood-opacity="0" result="feFloodId_2442_492"/>
|
||||
<feColorMatrix
|
||||
in="SourceAlpha"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
||||
result="hardAlpha_2442_492"
|
||||
/>
|
||||
<feOffset dx="0" dy="0" />
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feComposite in2="hardAlpha_2442_492" operator="out" />
|
||||
<feOffset dx="0" dy="0"/>
|
||||
<feGaussianBlur stdDeviation="2"/>
|
||||
<feComposite in2="hardAlpha_2442_492" operator="out"/>
|
||||
<feColorMatrix
|
||||
type="matrix"
|
||||
values="0 0 0 0 0.1450980392156863 0 0 0 0 0.7686274509803922 0 0 0 0 0.7686274509803922 0 0 0 1 0"
|
||||
/>
|
||||
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492" />
|
||||
<feBlend mode="normal" in2="feFloodId_2442_492" result="dropShadow_1_2442_492"/>
|
||||
<feBlend
|
||||
mode="normal"
|
||||
in="SourceGraphic"
|
||||
@ -132,8 +132,8 @@
|
||||
y2="-131.6942138671875"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2" />
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0" />
|
||||
<stop offset="0" stop-color="rgb(var(--color-base1))" stop-opacity="0.2"/>
|
||||
<stop offset="1" stop-color="rgb(var(--color-base1))" stop-opacity="0"/>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linear_border_2409_300_0"
|
||||
@ -143,8 +143,8 @@
|
||||
y2="580.431640625"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
<stop offset="0.0625" stop-color="rgb(var(--color-base1))"/>
|
||||
<stop offset="1" stop-color="var(--color-border1)"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
@ -177,7 +177,7 @@
|
||||
</div>
|
||||
<div class="search_title" id="search">
|
||||
<div class="searchUp">
|
||||
<el-select v-model="select" @change="selectChange" style="width: 4vw" size="small" popper-class="custom-dropdown2">
|
||||
<el-select v-model="select" @change="selectChange" style="width: 4vw" size="small">
|
||||
<el-option value="tree" :label="t('tree.layer')"></el-option>
|
||||
<el-option value="poi" :label="t('tree.location')"></el-option>
|
||||
</el-select>
|
||||
@ -196,7 +196,7 @@
|
||||
size="small"
|
||||
@click="searchPlace"
|
||||
:loading="loading"
|
||||
>{{ t('btn.search') }}
|
||||
>{{ t('btn.search') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div id="selectorBox">
|
||||
@ -209,6 +209,15 @@
|
||||
:no-data-text="t('btn.selectNoText')"
|
||||
popper-class="custom-dropdown"
|
||||
>
|
||||
<template #empty>
|
||||
<div
|
||||
class="treeSearchEmpty"
|
||||
style="padding: 10px; text-align: center; color: #909399"
|
||||
>
|
||||
<i class="el-icon-warning-outline"></i>
|
||||
<div>暂无数据</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-option
|
||||
v-for="(item, index) in poiOptions"
|
||||
:key="item.search_key + index"
|
||||
@ -238,22 +247,22 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// @ts-nocheck
|
||||
import { debounce } from '@/utils'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useTree } from './hooks/tree'
|
||||
import {debounce} from '@/utils'
|
||||
import {useI18n} from 'vue-i18n'
|
||||
import {useTree} from './hooks/tree'
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
import rightMenu from './components/rightMenu.vue'
|
||||
import { $changeComponentShow } from '@/utils/communication'
|
||||
import { ref, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { bus } from '@/utils/bus'
|
||||
import { TreeApi } from '@/api/tree'
|
||||
import { PoiApi } from '@/api/poi'
|
||||
import { get } from 'jquery'
|
||||
import {$changeComponentShow} from '@/utils/communication'
|
||||
import {ref, nextTick} from 'vue'
|
||||
import {ElMessage} from 'element-plus'
|
||||
import {bus} from '@/utils/bus'
|
||||
import {TreeApi} from '@/api/tree'
|
||||
import {PoiApi} from '@/api/poi'
|
||||
import {get} from 'jquery'
|
||||
|
||||
const { initTree, rightMenuRef, initTreeCallBack } = useTree()
|
||||
const {initTree, rightMenuRef, initTreeCallBack} = useTree()
|
||||
|
||||
const { t } = useI18n()
|
||||
const {t} = useI18n()
|
||||
const isShow = ref(false)
|
||||
const select = ref('poi')
|
||||
const searchKey: any = ref('')
|
||||
@ -363,7 +372,8 @@ var key =
|
||||
(localStorage.getItem('AMapKey') && localStorage.getItem('AMapKey').split('|')[0]) ||
|
||||
'd88fcc689d1aa99866b2d0d83fd36677'
|
||||
var isOnline = false
|
||||
var loadAmp = (cb = () => {}) => {
|
||||
var loadAmp = (cb = () => {
|
||||
}) => {
|
||||
AMapLoader.reset()
|
||||
AMapLoader.load({
|
||||
key: key, // 申请好的Web端开发者Key,首次调用 load 时必填
|
||||
@ -463,7 +473,7 @@ const searchPlace = debounce(function () {
|
||||
let string = searchKey.value.trim()
|
||||
if (string) {
|
||||
// TreeApi.queryPOI({ name: string, pageNum: 1, pageSize: 1000 }).then((res) => {
|
||||
PoiApi.searchPoi({ name: string, pageNum: 1, pageSize: 1000 }).then((res) => {
|
||||
PoiApi.searchPoi({name: string, pageNum: 1, pageSize: 1000}).then((res) => {
|
||||
console.log(res, 'resres')
|
||||
poiOptions.value = res.data
|
||||
if (poiOptions.value.length) {
|
||||
@ -516,7 +526,7 @@ const locationChange = () => {
|
||||
// let sg84 = YJ.Global.CoordTransform.GCJ02ToWGS84(item.lng, item.lat);
|
||||
let params = {
|
||||
id,
|
||||
position: { lng: item.lng, lat: item.lat, alt: item.alt ? item.alt : 0 },
|
||||
position: {lng: item.lng, lat: item.lat, alt: item.alt ? item.alt : 0},
|
||||
billboard: {
|
||||
show: true,
|
||||
image: 'http://localhost:' + availablePort.value + '/' + 'GEMarker1/A-ablu-blank.png',
|
||||
@ -647,11 +657,12 @@ defineExpose({
|
||||
text-shadow: 0px 0px 9px var(--color-text-shadow);
|
||||
font-weight: 700;
|
||||
background: linear-gradient(
|
||||
90deg,
|
||||
rgba(var(--color-base1), 0) 0%,
|
||||
rgba(var(--color-base1), 0.5) 55.55%,
|
||||
rgba(var(--color-base1), 0) 100%
|
||||
90deg,
|
||||
rgba(var(--color-base1), 0) 0%,
|
||||
rgba(var(--color-base1), 0.5) 55.55%,
|
||||
rgba(var(--color-base1), 0) 100%
|
||||
);
|
||||
|
||||
> svg {
|
||||
margin-right: 10px;
|
||||
}
|
||||
@ -792,10 +803,28 @@ defineExpose({
|
||||
.el-select-dropdown__wrap {
|
||||
max-height: 260px !important;
|
||||
}
|
||||
|
||||
.custom-dropdown {
|
||||
margin-top: 75px;
|
||||
}
|
||||
.custom-dropdown2 {
|
||||
margin-right: 10px;
|
||||
width: 380px !important;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.is-hovering {
|
||||
background-color: unset !important;
|
||||
color: rgba(var(--color-base1), 1) !important;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.is-selected {
|
||||
background-color: unset !important;
|
||||
color: rgba(var(--color-base1), 1) !important;
|
||||
}
|
||||
|
||||
// .custom-dropdown2 {
|
||||
// width: 380px !important;
|
||||
// }
|
||||
.el-select-dropdown__empty,
|
||||
.el-select-dropdown__loading {
|
||||
margin-top: -150px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -11,8 +11,14 @@
|
||||
<firstMenu class="absolute zIndex9" ref="firstMenuRef"></firstMenu>
|
||||
<!--底部菜单-->
|
||||
<bottomMenu class="absolute zIndex9" ref="bottomMenuRef"></bottomMenu>
|
||||
<input type="file" id="fileInputlink" style="display: none" multiple accept=".jpeg,.png,.jpg,.mp4,.pdf"
|
||||
@input="uploadFile" />
|
||||
<input
|
||||
type="file"
|
||||
id="fileInputlink"
|
||||
style="display: none"
|
||||
multiple
|
||||
accept=".jpeg,.png,.jpg,.mp4,.pdf"
|
||||
@input="uploadFile"
|
||||
/>
|
||||
|
||||
<!-- 多点视线分析 -->
|
||||
<!-- <Visibility ref="visibility"></Visibility> -->
|
||||
@ -150,12 +156,6 @@ if (!localStorage.getItem('defaultLabelStyle')) {
|
||||
localStorage.setItem('defaultLabelStyle', JSON.stringify(defaultLabelStyle))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
if (dynamicComponentRef.value && dynamicComponentRef.value.close) {
|
||||
dynamicComponentRef.value.close()
|
||||
@ -393,6 +393,7 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
await nextTick()
|
||||
dynamicComponentRef.value?.open(id)
|
||||
break
|
||||
case 'roam': //飞行漫游
|
||||
case 'flyRoamDialog': //飞行漫游
|
||||
currentComponent.value = FlyRoam
|
||||
await nextTick()
|
||||
@ -436,7 +437,7 @@ eventBus.on('openDialog', async (sourceType: any, id: any) => {
|
||||
default:
|
||||
break
|
||||
}
|
||||
id && (dynamicComponentRef.value.id = id)
|
||||
id && dynamicComponentRef.value && (dynamicComponentRef.value.id = id)
|
||||
})
|
||||
eventBus.on('openSelectImg', (selected, entity) => {
|
||||
// $sendElectronChanel("requireGEMarkerName", {
|
||||
@ -504,9 +505,9 @@ const createEarth = async () => {
|
||||
// @ts-ignore
|
||||
let options = JSON.parse(localStorage.getItem('defaultView'))
|
||||
YJ.Global.setDefaultView(window.earth, options)
|
||||
setTimeout(() => {
|
||||
new YJ.Tools(window.earth).flyHome()
|
||||
}, 1000)
|
||||
// setTimeout(() => {
|
||||
new YJ.Tools(window.earth).flyHome(0)
|
||||
// }, 1000)
|
||||
// YJ.Global.setDefaultView(window.earth, {
|
||||
// destination: { lng: 100, lat: 30, alt: 10 },
|
||||
// orientation: {
|
||||
@ -558,9 +559,9 @@ const getStatus = (time) => {
|
||||
const currentTimestamp = Date.now()
|
||||
|
||||
if (timestamp > currentTimestamp) {
|
||||
; (window as any).checkAuthIsValid = true
|
||||
;(window as any).checkAuthIsValid = true
|
||||
} else {
|
||||
; (window as any).checkAuthIsValid = false
|
||||
;(window as any).checkAuthIsValid = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
<template>
|
||||
<div class="login-container" style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0">
|
||||
<transition name="video-fade" mode="out-in"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover">
|
||||
<div
|
||||
class="login-container"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0"
|
||||
>
|
||||
<transition
|
||||
name="video-fade"
|
||||
mode="out-in"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"
|
||||
>
|
||||
<!-- 第一个视频,播放一次 -->
|
||||
<!-- <video v-if="!isFirstVideoPlayed" ref="firstVideoRef" key="first-video" muted @ended="onFirstVideoEnded"
|
||||
src="../../assets/video/login_front.mp4"
|
||||
@ -9,8 +15,14 @@
|
||||
<!-- 第二个视频,循环播放 -->
|
||||
<!-- <video v-else key="second-video" autoplay loop muted src="../../assets/video/login_feature.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"></video> -->
|
||||
<video key="second-video" autoplay loop muted src="../../assets/video/author_video.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"></video>
|
||||
<video
|
||||
key="second-video"
|
||||
autoplay
|
||||
loop
|
||||
muted
|
||||
src="../../assets/video/author_video.mp4"
|
||||
style="position: fixed; width: 100vw; height: 100vh; left: 0; top: 0; object-fit: cover"
|
||||
></video>
|
||||
</transition>
|
||||
<!-- 登录页面 -->
|
||||
<div class="rightBox" v-if="isDesktop">
|
||||
@ -27,45 +39,95 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-form class="login-form" autoComplete="on" :model="loginForm" :rules="loginRules" ref="loginFormRef"
|
||||
label-position="left">
|
||||
<el-form
|
||||
class="login-form"
|
||||
autoComplete="on"
|
||||
:model="loginForm"
|
||||
:rules="loginRules"
|
||||
ref="loginFormRef"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item prop="username">
|
||||
<el-input name="username" type="text" v-model="loginForm.username" autoComplete="on" placeholder="请输入用户名"
|
||||
:prefix-icon="User" />
|
||||
<el-input
|
||||
name="username"
|
||||
type="text"
|
||||
v-model="loginForm.username"
|
||||
autoComplete="on"
|
||||
placeholder="请输入用户名"
|
||||
:prefix-icon="User"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input type="password" @keyup.enter.native="handleLogin(loginFormRef)" v-model="loginForm.password"
|
||||
autoComplete="on" placeholder="请输入密码" :prefix-icon="Unlock" show-password></el-input>
|
||||
<el-input
|
||||
type="password"
|
||||
@keyup.enter.native="handleLogin(loginFormRef)"
|
||||
v-model="loginForm.password"
|
||||
autoComplete="on"
|
||||
placeholder="请输入密码"
|
||||
:prefix-icon="Unlock"
|
||||
show-password
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item class="rememberForget">
|
||||
<!-- justify-content: space-around;align-items: center; -->
|
||||
<div style="display: flex">
|
||||
<svg class="checkbox-svg" v-show="checkboxVModel" style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14"
|
||||
viewBox="0 0 14 14" fill="none">
|
||||
<path fill="rgba(var(--color-base1), 1)"
|
||||
d="M7.34788e-16 2L-2.20436e-15 12C-2.40727e-15 13.1046 0.895431 14 2 14L12 14C13.1046 14 14 13.1046 14 12L14 2C14 0.895431 13.1046 -1.46958e-15 12 -1.46958e-15L2 -1.46958e-15C0.895431 -1.60485e-15 8.02424e-16 0.895431 7.34788e-16 2Z">
|
||||
</path>
|
||||
<svg
|
||||
class="checkbox-svg"
|
||||
v-show="checkboxVModel"
|
||||
style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
fill="rgba(var(--color-base1), 1)"
|
||||
d="M7.34788e-16 2L-2.20436e-15 12C-2.40727e-15 13.1046 0.895431 14 2 14L12 14C13.1046 14 14 13.1046 14 12L14 2C14 0.895431 13.1046 -1.46958e-15 12 -1.46958e-15L2 -1.46958e-15C0.895431 -1.60485e-15 8.02424e-16 0.895431 7.34788e-16 2Z"
|
||||
></path>
|
||||
<path
|
||||
d="M5.47283 8.3039L3.10764 6.12807C3.06194 6.08647 2.99525 6.08647 2.94955 6.12946L2.04424 6.98093C1.98989 7.03224 1.98495 7.12376 2.03312 7.18201L6.03602 11.9566C6.09778 12.0301 6.20647 12.0065 6.24105 11.9136C7.03644 9.69343 9.25835 5.63439 11.9619 2.69585C11.999 2.65564 12.0101 2.59601 11.9904 2.54331L11.8211 2.08568C11.7915 2.00525 11.7038 1.97474 11.6396 2.02328C8.63587 4.21019 6.45966 6.92546 5.47283 8.3039Z"
|
||||
fill="#004242"></path>
|
||||
fill="#004242"
|
||||
></path>
|
||||
</svg>
|
||||
<svg class="checkbox-svg" v-show="!checkboxVModel" style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14"
|
||||
viewBox="0 0 14 14" fill="none">
|
||||
<path fill-rule="evenodd" fill="url(#linear_border_2442_533_0)"
|
||||
d="M0 12L0 2C0 0.895431 0.895431 0 2 0L12 0C13.1046 0 14 0.895431 14 2L14 12C14 13.1046 13.1046 14 12 14L2 14C0.895431 14 0 13.1046 0 12ZM2 12.5C1.72386 12.5 1.5 12.2761 1.5 12L1.5 2C1.5 1.72386 1.72386 1.5 2 1.5L12 1.5C12.2761 1.5 12.5 1.72386 12.5 2L12.5 12C12.5 12.2761 12.2761 12.5 12 12.5L2 12.5Z">
|
||||
</path>
|
||||
<svg
|
||||
class="checkbox-svg"
|
||||
v-show="!checkboxVModel"
|
||||
style="pointer-events: none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
fill="url(#linear_border_2442_533_0)"
|
||||
d="M0 12L0 2C0 0.895431 0.895431 0 2 0L12 0C13.1046 0 14 0.895431 14 2L14 12C14 13.1046 13.1046 14 12 14L2 14C0.895431 14 0 13.1046 0 12ZM2 12.5C1.72386 12.5 1.5 12.2761 1.5 12L1.5 2C1.5 1.72386 1.72386 1.5 2 1.5L12 1.5C12.2761 1.5 12.5 1.72386 12.5 2L12.5 12C12.5 12.2761 12.2761 12.5 12 12.5L2 12.5Z"
|
||||
></path>
|
||||
<defs>
|
||||
<linearGradient id="linear_border_2442_533_0" x1="0" y1="-0.5574798583984375" x2="12.1173095703125"
|
||||
y2="12.878036499023438" gradientUnits="userSpaceOnUse">
|
||||
<linearGradient
|
||||
id="linear_border_2442_533_0"
|
||||
x1="0"
|
||||
y1="-0.5574798583984375"
|
||||
x2="12.1173095703125"
|
||||
y2="12.878036499023438"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop offset="0.0625" stop-color="rgba(var(--color-base1), 1)" />
|
||||
<stop offset="1" stop-color="var(--color-border1)" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
<el-checkbox :disabled="loading" v-model="checkboxVModel" @change="rememberpwd"
|
||||
label="string">记住密码</el-checkbox>
|
||||
<el-checkbox
|
||||
:disabled="loading"
|
||||
v-model="checkboxVModel"
|
||||
@change="rememberpwd"
|
||||
label="string"
|
||||
>记住密码</el-checkbox
|
||||
>
|
||||
<!-- <div style="cursor: pointer;">忘记密码?</div> -->
|
||||
</div>
|
||||
</el-form-item>
|
||||
@ -88,15 +150,24 @@
|
||||
<h2 class="greet"><span>欢迎您使用</span>实景三维电子沙盘系统</h2>
|
||||
<div class="serviceContent">
|
||||
<el-tabs v-model="selectedService" class="demo-tabs" @tab-click="handleSelect">
|
||||
<el-tab-pane v-for="item in serviceOptions" :label="item.name" :name="item.name"></el-tab-pane>
|
||||
<el-tab-pane
|
||||
v-for="item in serviceOptions"
|
||||
:label="item.name"
|
||||
:name="item.name"
|
||||
></el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="tabPanel">
|
||||
<template v-if="selectedService == '接口服务'">
|
||||
<div class="item">
|
||||
<span class="itemLabel">服务选择</span>
|
||||
<el-select class="select" popper-class="login-select-popper" v-model="servVal">
|
||||
<el-option size="mini" v-for="item in servOptions" :key="item.value" :label="item.name"
|
||||
:value="item.name">
|
||||
<el-option
|
||||
size="mini"
|
||||
v-for="item in servOptions"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -143,8 +214,13 @@
|
||||
<div class="item">
|
||||
<span class="itemLabel">串口选择</span>
|
||||
<el-select class="select" popper-class="login-select-popper" v-model="gpsVal">
|
||||
<el-option size="mini" v-for="item in gpsOptions" :key="item.value" :label="item.Product"
|
||||
:value="item.Name">
|
||||
<el-option
|
||||
size="mini"
|
||||
v-for="item in gpsOptions"
|
||||
:key="item.value"
|
||||
:label="item.Product"
|
||||
:value="item.Name"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@ -159,8 +235,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 授权页面 -->
|
||||
<Dialog ref="baseDialog" class="graffiti" title="系统授权" :closeCallback="closeCallBack" left="calc(50vw - 188px)"
|
||||
top="calc(50vh - 191px)">
|
||||
<Dialog
|
||||
ref="baseDialog"
|
||||
class="graffiti"
|
||||
title="系统授权"
|
||||
:closeCallback="closeCallBack"
|
||||
left="calc(50vw - 188px)"
|
||||
top="calc(50vh - 191px)"
|
||||
>
|
||||
<template #content>
|
||||
<div class="auth_info custom_scroll_bar content_h">
|
||||
<div class="auth_info_box">
|
||||
@ -168,7 +250,12 @@
|
||||
<span class="fankuai"></span>
|
||||
{{ t('auths.authCode') }}
|
||||
</div>
|
||||
<div class="auth_info_text" @click="copy(authInfo.license_code)" style="cursor: pointer" title="点击可复制">
|
||||
<div
|
||||
class="auth_info_text"
|
||||
@click="copy(authInfo.license_code)"
|
||||
style="cursor: pointer"
|
||||
title="点击可复制"
|
||||
>
|
||||
{{ authInfo.license_code || '' }}
|
||||
<svg-icon name="copy" :size="20" style="margin-left: 30px"></svg-icon>
|
||||
</div>
|
||||
@ -191,13 +278,22 @@
|
||||
<span class="fankuai"></span>
|
||||
{{ t('auths.authType') }}
|
||||
</div>
|
||||
<div v-if="authInfo.status != null" class="auth_info_text" style="font-size: 16px" :style="{
|
||||
color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)'
|
||||
}">
|
||||
<div
|
||||
v-if="authInfo.status != null"
|
||||
class="auth_info_text"
|
||||
style="font-size: 16px"
|
||||
:style="{
|
||||
color: authInfo.status ? 'rgba(27, 248, 195, 1)' : 'rgba(255, 161, 69, 1)'
|
||||
}"
|
||||
>
|
||||
{{ authInfo.status ? t('auths.authTempExpire') : t('auths.authexpire') }}
|
||||
</div>
|
||||
<!-- <div v-else class="auth_info_text">{{ authInfo.message || '无' }}</div> -->
|
||||
<div v-else class="auth_info_text" style="font-size: 16px; color: rgba(241, 108, 85, 1)">
|
||||
<div
|
||||
v-else
|
||||
class="auth_info_text"
|
||||
style="font-size: 16px; color: rgba(241, 108, 85, 1)"
|
||||
>
|
||||
{{ t('auths.noAuthexpire') }}
|
||||
</div>
|
||||
</div>
|
||||
@ -205,7 +301,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<uploadFiles accept=".lic" :maxSize="1"></uploadFiles>
|
||||
<uploadFiles accept=".YJ" :maxSize="1"></uploadFiles>
|
||||
<button @click="close">退出系统</button>
|
||||
</template>
|
||||
</Dialog>
|
||||
@ -234,6 +330,7 @@ const {
|
||||
loginInit,
|
||||
isDesktop
|
||||
} = useLogin() // 登录逻辑
|
||||
console.log('isDesktop', isDesktop)
|
||||
|
||||
const {
|
||||
serviceDialog,
|
||||
@ -305,12 +402,13 @@ const getAuthInfo = async () => {
|
||||
if (typeof res.data === 'object') {
|
||||
authInfo.value.generateTime = res.data.generateTime
|
||||
authInfo.value.expireTime = res.data.expireTime
|
||||
console.log(authInfo.value.expireTime, '授权时间222')
|
||||
getStatus2()
|
||||
getStatus(res.data.expireTime)
|
||||
}
|
||||
} catch (error) {
|
||||
// 统一处理错误
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用?', '提示', {
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用!', '提示', {
|
||||
confirmButtonText: '去授权',
|
||||
cancelButtonText: '退出系统',
|
||||
type: 'warning',
|
||||
@ -338,7 +436,7 @@ const getStatus = (date) => {
|
||||
// router.push({ path: '/login' })
|
||||
isAuth.value = false
|
||||
} else {
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用?', '提示', {
|
||||
ElMessageBox.confirm('您没有进行系统授权哦,系统功能将无法使用!', '提示', {
|
||||
confirmButtonText: '去授权',
|
||||
cancelButtonText: '退出系统',
|
||||
type: 'warning',
|
||||
@ -388,12 +486,25 @@ const authInfo = ref({
|
||||
status: null
|
||||
})
|
||||
//上传授权文件成功
|
||||
eventBus.on('upload', (data) => {
|
||||
let setFunc = (data) => {
|
||||
if (data) {
|
||||
isAuth.value = false
|
||||
baseDialog.value?.close()
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
eventBus.off('upload', setFunc)
|
||||
eventBus.on('upload', setFunc)
|
||||
})
|
||||
onUnmounted(() => {
|
||||
eventBus.off('upload', setFunc)
|
||||
})
|
||||
// eventBus.on('upload', (data) => {
|
||||
// if (data) {
|
||||
// isAuth.value = false
|
||||
// baseDialog.value?.close()
|
||||
// }
|
||||
// })
|
||||
|
||||
const { toClipboard } = useClipboard()
|
||||
|
||||
@ -401,7 +512,7 @@ const getStatus2 = () => {
|
||||
const timestamp = new Date(authInfo.value.expireTime).getTime()
|
||||
|
||||
const currentTimestamp = Date.now()
|
||||
|
||||
console.log('timestamp', timestamp > currentTimestamp)
|
||||
if (timestamp > currentTimestamp) {
|
||||
authInfo.value.status = true
|
||||
} else {
|
||||
@ -729,7 +840,7 @@ const validatePortRange = (rule, value, callback) => {
|
||||
border-radius: 0 0 0 90%;
|
||||
background: rgba(var(--color-base1), 1);
|
||||
|
||||
&>span {
|
||||
& > span {
|
||||
font-size: 1rem;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
@ -930,7 +1041,8 @@ const validatePortRange = (rule, value, callback) => {
|
||||
z-index: 99;
|
||||
background: linear-gradient(0deg, #00ffff33 0%, #00ffff00 100%), rgba(0, 0, 0, 0.6);
|
||||
border: 1.5px solid;
|
||||
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%) 1;
|
||||
border-image: linear-gradient(to bottom, rgba(var(--color-base1), 1) 6.25%, rgb(0, 200, 255) 100%)
|
||||
1;
|
||||
text-align: left;
|
||||
font-family: 'sy-boldface';
|
||||
}
|
||||
@ -976,11 +1088,11 @@ const validatePortRange = (rule, value, callback) => {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
::v-deep .title-box>.close-box {
|
||||
::v-deep .title-box > .close-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .title-box>.title {
|
||||
::v-deep .title-box > .title {
|
||||
font-family: 'Ali-mother-counts-bold';
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
@ -1003,7 +1115,7 @@ const validatePortRange = (rule, value, callback) => {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
::v-deep .foot>button {
|
||||
::v-deep .foot > button {
|
||||
margin-left: 10px;
|
||||
border-radius: 4px;
|
||||
background: rgba(var(--color-base1), 0.2);
|
||||
@ -1015,12 +1127,12 @@ const validatePortRange = (rule, value, callback) => {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::v-deep .foot>button:hover {
|
||||
::v-deep .foot > button:hover {
|
||||
border: 1px solid rgba(var(--color-base1), 1);
|
||||
color: rgba(var(--color-base1), 1);
|
||||
}
|
||||
|
||||
::v-deep .foot>.show>.label {
|
||||
::v-deep .foot > .show > .label {
|
||||
margin: 0px 10px;
|
||||
}
|
||||
|
||||
@ -1095,7 +1207,7 @@ const validatePortRange = (rule, value, callback) => {
|
||||
border-radius: 0 0 0 90%;
|
||||
background: rgba(var(--color-base1), 1);
|
||||
|
||||
&>span {
|
||||
& > span {
|
||||
font-size: 1rem;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
@ -1192,7 +1304,8 @@ const validatePortRange = (rule, value, callback) => {
|
||||
align-items: center;
|
||||
margin: 15px 0;
|
||||
|
||||
.select {}
|
||||
.select {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1242,6 +1355,9 @@ const validatePortRange = (rule, value, callback) => {
|
||||
linear-gradient(180deg, rgba(var(--color-base1), 0) 0%, rgba(var(--color-base1), 0.2) 100%),
|
||||
rgba(0, 0, 0, 0.6) !important;
|
||||
|
||||
.el-message-box__headerbtn {
|
||||
display: none !important;
|
||||
}
|
||||
.el-message-box__btns {
|
||||
.el-button {
|
||||
--el-button-text-color: #fff;
|
||||
|
||||
Reference in New Issue
Block a user