Commit 3a4a0449 by 吴春元

高德地图接入,接口调试

parent 568600c8
...@@ -11,6 +11,7 @@ declare module 'vue' { ...@@ -11,6 +11,7 @@ declare module 'vue' {
AsyncMap3D: typeof import('./src/components/ThreeMap/AsyncMap3D.vue')['default'] AsyncMap3D: typeof import('./src/components/ThreeMap/AsyncMap3D.vue')['default']
ContainerWrap: typeof import('./src/components/ContainerWrap/index.vue')['default'] ContainerWrap: typeof import('./src/components/ContainerWrap/index.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCascader: typeof import('element-plus/es')['ElCascader'] ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol'] ElCol: typeof import('element-plus/es')['ElCol']
...@@ -21,6 +22,7 @@ declare module 'vue' { ...@@ -21,6 +22,7 @@ declare module 'vue' {
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput'] ElInput: typeof import('element-plus/es')['ElInput']
ElLink: typeof import('element-plus/es')['ElLink']
ElOption: typeof import('element-plus/es')['ElOption'] ElOption: typeof import('element-plus/es')['ElOption']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
......
...@@ -24,23 +24,11 @@ ...@@ -24,23 +24,11 @@
<link rel="stylesheet" type="text/css" href="/videoPlayer/common/hk/index.css"> <link rel="stylesheet" type="text/css" href="/videoPlayer/common/hk/index.css">
<link rel="stylesheet" type="text/css" href="/videoPlayer/common/dh/index.css"> <link rel="stylesheet" type="text/css" href="/videoPlayer/common/dh/index.css">
<link rel="stylesheet" type="text/css" href="/videoPlayer/common/css/videoPlayer.css"> <link rel="stylesheet" type="text/css" href="/videoPlayer/common/css/videoPlayer.css">
<!-- <script src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.2.2/particles.min.js"></script> -->
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.ts"></script> <script type="module" src="/src/main.ts"></script>
<script type="text/javascript"
src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=i8RgXE4a6vzGgbFs5s4ynlyUh6YnUQIB">
</script>
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=2.0&key=fee919a8e608c39d1d528ec662a2ca17&plugin=AMap.DistrictSearch"></script>
<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
<!-- <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" /> -->
</body> </body>
</html> </html>
\ No newline at end of file
../sass/sass.js
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/sass@1.92.1/node_modules/sass/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/sass@1.92.1/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/sass@1.92.1/node_modules/sass/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/sass@1.92.1/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../sass/sass.js" "$@"
else
exec node "$basedir/../sass/sass.js" "$@"
fi
../typescript/bin/tsc
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
else
exec node "$basedir/../typescript/bin/tsc" "$@"
fi
../typescript/bin/tsserver
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/typescript@5.8.3/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
else
exec node "$basedir/../typescript/bin/tsserver" "$@"
fi
../vite/bin/vite.js
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/vite@7.1.5_@types+node@24.3.1_jiti@2.5.1_lightningcss@1.30.1_sass@1.92.1/node_modules/vite/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vite@7.1.5_@types+node@24.3.1_jiti@2.5.1_lightningcss@1.30.1_sass@1.92.1/node_modules/vite/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vite@7.1.5_@types+node@24.3.1_jiti@2.5.1_lightningcss@1.30.1_sass@1.92.1/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/vite@7.1.5_@types+node@24.3.1_jiti@2.5.1_lightningcss@1.30.1_sass@1.92.1/node_modules/vite/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vite@7.1.5_@types+node@24.3.1_jiti@2.5.1_lightningcss@1.30.1_sass@1.92.1/node_modules/vite/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vite@7.1.5_@types+node@24.3.1_jiti@2.5.1_lightningcss@1.30.1_sass@1.92.1/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
else
exec node "$basedir/../vite/bin/vite.js" "$@"
fi
../vue-tsc/bin/vue-tsc.js
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -z "$NODE_PATH" ]; then
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/vue-tsc@3.0.6_typescript@5.8.3/node_modules/vue-tsc/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vue-tsc@3.0.6_typescript@5.8.3/node_modules/vue-tsc/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vue-tsc@3.0.6_typescript@5.8.3/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules"
else
export NODE_PATH="/Library/web/git/iot-web/node_modules/.pnpm/vue-tsc@3.0.6_typescript@5.8.3/node_modules/vue-tsc/bin/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vue-tsc@3.0.6_typescript@5.8.3/node_modules/vue-tsc/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/vue-tsc@3.0.6_typescript@5.8.3/node_modules:/Library/web/git/iot-web/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../vue-tsc/bin/vue-tsc.js" "$@"
else
exec node "$basedir/../vue-tsc/bin/vue-tsc.js" "$@"
fi
...@@ -185,100 +185,6 @@ hoistedDependencies: ...@@ -185,100 +185,6 @@ hoistedDependencies:
'@tailwindcss/oxide-win32-x64-msvc': private '@tailwindcss/oxide-win32-x64-msvc': private
'@tailwindcss/oxide@4.1.13': '@tailwindcss/oxide@4.1.13':
'@tailwindcss/oxide': private '@tailwindcss/oxide': private
'@tsparticles/basic@3.9.1':
'@tsparticles/basic': private
'@tsparticles/engine@3.9.1':
'@tsparticles/engine': private
'@tsparticles/interaction-external-attract@3.9.1':
'@tsparticles/interaction-external-attract': private
'@tsparticles/interaction-external-bounce@3.9.1':
'@tsparticles/interaction-external-bounce': private
'@tsparticles/interaction-external-bubble@3.9.1':
'@tsparticles/interaction-external-bubble': private
'@tsparticles/interaction-external-connect@3.9.1':
'@tsparticles/interaction-external-connect': private
'@tsparticles/interaction-external-grab@3.9.1':
'@tsparticles/interaction-external-grab': private
'@tsparticles/interaction-external-pause@3.9.1':
'@tsparticles/interaction-external-pause': private
'@tsparticles/interaction-external-push@3.9.1':
'@tsparticles/interaction-external-push': private
'@tsparticles/interaction-external-remove@3.9.1':
'@tsparticles/interaction-external-remove': private
'@tsparticles/interaction-external-repulse@3.9.1':
'@tsparticles/interaction-external-repulse': private
'@tsparticles/interaction-external-slow@3.9.1':
'@tsparticles/interaction-external-slow': private
'@tsparticles/interaction-external-trail@3.9.1':
'@tsparticles/interaction-external-trail': private
'@tsparticles/interaction-particles-attract@3.9.1':
'@tsparticles/interaction-particles-attract': private
'@tsparticles/interaction-particles-collisions@3.9.1':
'@tsparticles/interaction-particles-collisions': private
'@tsparticles/interaction-particles-links@3.9.1':
'@tsparticles/interaction-particles-links': private
'@tsparticles/move-base@3.9.1':
'@tsparticles/move-base': private
'@tsparticles/move-parallax@3.9.1':
'@tsparticles/move-parallax': private
'@tsparticles/plugin-absorbers@3.9.1':
'@tsparticles/plugin-absorbers': private
'@tsparticles/plugin-easing-quad@3.9.1':
'@tsparticles/plugin-easing-quad': private
'@tsparticles/plugin-emitters-shape-circle@3.9.1':
'@tsparticles/plugin-emitters-shape-circle': private
'@tsparticles/plugin-emitters-shape-square@3.9.1':
'@tsparticles/plugin-emitters-shape-square': private
'@tsparticles/plugin-emitters@3.9.1':
'@tsparticles/plugin-emitters': private
'@tsparticles/plugin-hex-color@3.9.1':
'@tsparticles/plugin-hex-color': private
'@tsparticles/plugin-hsl-color@3.9.1':
'@tsparticles/plugin-hsl-color': private
'@tsparticles/plugin-rgb-color@3.9.1':
'@tsparticles/plugin-rgb-color': private
'@tsparticles/shape-circle@3.9.1':
'@tsparticles/shape-circle': private
'@tsparticles/shape-emoji@3.9.1':
'@tsparticles/shape-emoji': private
'@tsparticles/shape-image@3.9.1':
'@tsparticles/shape-image': private
'@tsparticles/shape-line@3.9.1':
'@tsparticles/shape-line': private
'@tsparticles/shape-polygon@3.9.1':
'@tsparticles/shape-polygon': private
'@tsparticles/shape-square@3.9.1':
'@tsparticles/shape-square': private
'@tsparticles/shape-star@3.9.1':
'@tsparticles/shape-star': private
'@tsparticles/shape-text@3.9.1':
'@tsparticles/shape-text': private
'@tsparticles/slim@3.9.1':
'@tsparticles/slim': private
'@tsparticles/updater-color@3.9.1':
'@tsparticles/updater-color': private
'@tsparticles/updater-destroy@3.9.1':
'@tsparticles/updater-destroy': private
'@tsparticles/updater-life@3.9.1':
'@tsparticles/updater-life': private
'@tsparticles/updater-opacity@3.9.1':
'@tsparticles/updater-opacity': private
'@tsparticles/updater-out-modes@3.9.1':
'@tsparticles/updater-out-modes': private
'@tsparticles/updater-roll@3.9.1':
'@tsparticles/updater-roll': private
'@tsparticles/updater-rotate@3.9.1':
'@tsparticles/updater-rotate': private
'@tsparticles/updater-size@3.9.1':
'@tsparticles/updater-size': private
'@tsparticles/updater-stroke-color@3.9.1':
'@tsparticles/updater-stroke-color': private
'@tsparticles/updater-tilt@3.9.1':
'@tsparticles/updater-tilt': private
'@tsparticles/updater-twinkle@3.9.1':
'@tsparticles/updater-twinkle': private
'@tsparticles/updater-wobble@3.9.1':
'@tsparticles/updater-wobble': private
'@types/estree@1.0.8': '@types/estree@1.0.8':
'@types/estree': private '@types/estree': private
'@types/lodash-es@4.17.12': '@types/lodash-es@4.17.12':
...@@ -617,8 +523,6 @@ hoistedDependencies: ...@@ -617,8 +523,6 @@ hoistedDependencies:
to-regex-range: private to-regex-range: private
tslib@2.3.0: tslib@2.3.0:
tslib: private tslib: private
tsparticles-engine@2.12.0:
tsparticles-engine: private
ufo@1.6.1: ufo@1.6.1:
ufo: private ufo: private
undici-types@7.10.0: undici-types@7.10.0:
......
...@@ -292,8 +292,8 @@ import { ...@@ -292,8 +292,8 @@ import {
wind_power_default, wind_power_default,
zoom_in_default, zoom_in_default,
zoom_out_default zoom_out_default
} from "./chunk-S4WGN4LU.js"; } from "./chunk-5WDSIG6Y.js";
import "./chunk-JDSL2H4L.js"; import "./chunk-P6TLTLJ2.js";
import "./chunk-G3PMV62Z.js"; import "./chunk-G3PMV62Z.js";
export { export {
add_location_default as AddLocation, add_location_default as AddLocation,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -311,7 +311,6 @@ import { ...@@ -311,7 +311,6 @@ import {
localeContextKey, localeContextKey,
makeInstaller, makeInstaller,
makeList, makeList,
mentionDefaultProps,
mentionEmits, mentionEmits,
mentionProps, mentionProps,
menuEmits, menuEmits,
...@@ -510,11 +509,10 @@ import { ...@@ -510,11 +509,10 @@ import {
virtualizedScrollbarProps, virtualizedScrollbarProps,
watermarkProps, watermarkProps,
zIndexContextKey zIndexContextKey
} from "./chunk-IQCPA24U.js"; } from "./chunk-ZFNCKSYC.js";
import "./chunk-TKM7ANES.js"; import "./chunk-WYGDTZ7H.js";
import "./chunk-S4WGN4LU.js"; import "./chunk-5WDSIG6Y.js";
import "./chunk-3EK6V4TN.js"; import "./chunk-P6TLTLJ2.js";
import "./chunk-JDSL2H4L.js";
import "./chunk-G3PMV62Z.js"; import "./chunk-G3PMV62Z.js";
var export_dayjs = import_dayjs.default; var export_dayjs = import_dayjs.default;
export { export {
...@@ -832,7 +830,6 @@ export { ...@@ -832,7 +830,6 @@ export {
localeContextKey, localeContextKey,
makeInstaller, makeInstaller,
makeList, makeList,
mentionDefaultProps,
mentionEmits, mentionEmits,
mentionProps, mentionProps,
menuEmits, menuEmits,
......
import "./chunk-G3PMV62Z.js"; import "./chunk-G3PMV62Z.js";
// node_modules/mitt/dist/mitt.mjs // node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
function mitt_default(n) { function mitt_default(n) {
return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) { return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
var i = n.get(t); var i = n.get(t);
......
{ {
"version": 3, "version": 3,
"sources": ["../../mitt/src/index.ts"], "sources": ["../../.pnpm/mitt@3.0.1/node_modules/mitt/src/index.ts"],
"sourcesContent": ["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n"], "sourcesContent": ["export type EventType = string | symbol;\n\n// An event handler can take an optional event argument\n// and should not return a value\nexport type Handler<T = unknown> = (event: T) => void;\nexport type WildcardHandler<T = Record<string, unknown>> = (\n\ttype: keyof T,\n\tevent: T[keyof T]\n) => void;\n\n// An array of all currently registered event handlers for a type\nexport type EventHandlerList<T = unknown> = Array<Handler<T>>;\nexport type WildCardEventHandlerList<T = Record<string, unknown>> = Array<\n\tWildcardHandler<T>\n>;\n\n// A map of event types and their corresponding event handlers.\nexport type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<\n\tkeyof Events | '*',\n\tEventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>\n>;\n\nexport interface Emitter<Events extends Record<EventType, unknown>> {\n\tall: EventHandlerMap<Events>;\n\n\ton<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;\n\ton(type: '*', handler: WildcardHandler<Events>): void;\n\n\toff<Key extends keyof Events>(\n\t\ttype: Key,\n\t\thandler?: Handler<Events[Key]>\n\t): void;\n\toff(type: '*', handler: WildcardHandler<Events>): void;\n\n\temit<Key extends keyof Events>(type: Key, event: Events[Key]): void;\n\temit<Key extends keyof Events>(\n\t\ttype: undefined extends Events[Key] ? Key : never\n\t): void;\n}\n\n/**\n * Mitt: Tiny (~200b) functional event emitter / pubsub.\n * @name mitt\n * @returns {Mitt}\n */\nexport default function mitt<Events extends Record<EventType, unknown>>(\n\tall?: EventHandlerMap<Events>\n): Emitter<Events> {\n\ttype GenericEventHandler =\n\t\t| Handler<Events[keyof Events]>\n\t\t| WildcardHandler<Events>;\n\tall = all || new Map();\n\n\treturn {\n\t\t/**\n\t\t * A Map of event names to registered handler functions.\n\t\t */\n\t\tall,\n\n\t\t/**\n\t\t * Register an event handler for the given type.\n\t\t * @param {string|symbol} type Type of event to listen for, or `'*'` for all events\n\t\t * @param {Function} handler Function to call in response to given event\n\t\t * @memberOf mitt\n\t\t */\n\t\ton<Key extends keyof Events>(type: Key, handler: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.push(handler);\n\t\t\t} else {\n\t\t\t\tall!.set(type, [handler] as EventHandlerList<Events[keyof Events]>);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove an event handler for the given type.\n\t\t * If `handler` is omitted, all handlers of the given type are removed.\n\t\t * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)\n\t\t * @param {Function} [handler] Handler function to remove\n\t\t * @memberOf mitt\n\t\t */\n\t\toff<Key extends keyof Events>(type: Key, handler?: GenericEventHandler) {\n\t\t\tconst handlers: Array<GenericEventHandler> | undefined = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\tif (handler) {\n\t\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t\t} else {\n\t\t\t\t\tall!.set(type, []);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Invoke all handlers for the given type.\n\t\t * If present, `'*'` handlers are invoked after type-matched handlers.\n\t\t *\n\t\t * Note: Manually firing '*' handlers is not supported.\n\t\t *\n\t\t * @param {string|symbol} type The event type to invoke\n\t\t * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler\n\t\t * @memberOf mitt\n\t\t */\n\t\temit<Key extends keyof Events>(type: Key, evt?: Events[Key]) {\n\t\t\tlet handlers = all!.get(type);\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as EventHandlerList<Events[keyof Events]>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(evt!);\n\t\t\t\t\t});\n\t\t\t}\n\n\t\t\thandlers = all!.get('*');\n\t\t\tif (handlers) {\n\t\t\t\t(handlers as WildCardEventHandlerList<Events>)\n\t\t\t\t\t.slice()\n\t\t\t\t\t.map((handler) => {\n\t\t\t\t\t\thandler(type, evt!);\n\t\t\t\t\t});\n\t\t\t}\n\t\t}\n\t};\n}\n"],
"mappings": ";;;sBA8CCA,GAAAA;AAOA,SAAO,EAINA,KANDA,IAAMA,KAAO,oBAAIC,OAchBC,IAAAA,SAA6BC,GAAWC,GAAAA;AACvC,QAAMC,IAAmDL,EAAKM,IAAIH,CAAAA;AAC9DE,QACHA,EAASE,KAAKH,CAAAA,IAEdJ,EAAKQ,IAAIL,GAAM,CAACC,CAAAA,CAAAA;EAAAA,GAWlBK,KAAAA,SAA8BN,GAAWC,GAAAA;AACxC,QAAMC,IAAmDL,EAAKM,IAAIH,CAAAA;AAC9DE,UACCD,IACHC,EAASK,OAAOL,EAASM,QAAQP,CAAAA,MAAa,GAAG,CAAA,IAEjDJ,EAAKQ,IAAIL,GAAM,CAAA,CAAA;EAAA,GAelBS,MAAAA,SAA+BT,GAAWU,GAAAA;AACzC,QAAIR,IAAWL,EAAKM,IAAIH,CAAAA;AACpBE,SACFA,EACCS,MAAAA,EACAC,IAAI,SAACX,IAAAA;AACLA,MAAAA,GAAQS,CAAAA;IAAAA,CAAAA,IAIXR,IAAWL,EAAKM,IAAI,GAAA,MAElBD,EACCS,MAAAA,EACAC,IAAI,SAACX,IAAAA;AACLA,MAAAA,GAAQD,GAAMU,CAAAA;IAAAA,CAAAA;EAAAA,EAAAA;AAAAA;", "mappings": ";;;sBA8CCA,GAAAA;AAOA,SAAO,EAINA,KANDA,IAAMA,KAAO,oBAAIC,OAchBC,IAAAA,SAA6BC,GAAWC,GAAAA;AACvC,QAAMC,IAAmDL,EAAKM,IAAIH,CAAAA;AAC9DE,QACHA,EAASE,KAAKH,CAAAA,IAEdJ,EAAKQ,IAAIL,GAAM,CAACC,CAAAA,CAAAA;EAAAA,GAWlBK,KAAAA,SAA8BN,GAAWC,GAAAA;AACxC,QAAMC,IAAmDL,EAAKM,IAAIH,CAAAA;AAC9DE,UACCD,IACHC,EAASK,OAAOL,EAASM,QAAQP,CAAAA,MAAa,GAAG,CAAA,IAEjDJ,EAAKQ,IAAIL,GAAM,CAAA,CAAA;EAAA,GAelBS,MAAAA,SAA+BT,GAAWU,GAAAA;AACzC,QAAIR,IAAWL,EAAKM,IAAIH,CAAAA;AACpBE,SACFA,EACCS,MAAAA,EACAC,IAAI,SAACX,IAAAA;AACLA,MAAAA,GAAQS,CAAAA;IAAAA,CAAAA,IAIXR,IAAWL,EAAKM,IAAI,GAAA,MAElBD,EACCS,MAAAA,EACAC,IAAI,SAACX,IAAAA;AACLA,MAAAA,GAAQD,GAAMU,CAAAA;IAAAA,CAAAA;EAAAA,EAAAA;AAAAA;",
"names": ["all", "Map", "on", "type", "handler", "handlers", "get", "push", "set", "off", "splice", "indexOf", "emit", "evt", "slice", "map"] "names": ["all", "Map", "on", "type", "handler", "handlers", "get", "push", "set", "off", "splice", "indexOf", "emit", "evt", "slice", "map"]
......
...@@ -16,10 +16,10 @@ import { ...@@ -16,10 +16,10 @@ import {
unref, unref,
watch, watch,
watchEffect watchEffect
} from "./chunk-JDSL2H4L.js"; } from "./chunk-P6TLTLJ2.js";
import "./chunk-G3PMV62Z.js"; import "./chunk-G3PMV62Z.js";
// node_modules/@vue/devtools-api/lib/esm/env.js // node_modules/.pnpm/@vue+devtools-api@6.6.4/node_modules/@vue/devtools-api/lib/esm/env.js
function getDevtoolsGlobalHook() { function getDevtoolsGlobalHook() {
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__; return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
} }
...@@ -28,11 +28,11 @@ function getTarget() { ...@@ -28,11 +28,11 @@ function getTarget() {
} }
var isProxyAvailable = typeof Proxy === "function"; var isProxyAvailable = typeof Proxy === "function";
// node_modules/@vue/devtools-api/lib/esm/const.js // node_modules/.pnpm/@vue+devtools-api@6.6.4/node_modules/@vue/devtools-api/lib/esm/const.js
var HOOK_SETUP = "devtools-plugin:setup"; var HOOK_SETUP = "devtools-plugin:setup";
var HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set"; var HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
// node_modules/@vue/devtools-api/lib/esm/time.js // node_modules/.pnpm/@vue+devtools-api@6.6.4/node_modules/@vue/devtools-api/lib/esm/time.js
var supported; var supported;
var perf; var perf;
function isPerformanceSupported() { function isPerformanceSupported() {
...@@ -55,7 +55,7 @@ function now() { ...@@ -55,7 +55,7 @@ function now() {
return isPerformanceSupported() ? perf.now() : Date.now(); return isPerformanceSupported() ? perf.now() : Date.now();
} }
// node_modules/@vue/devtools-api/lib/esm/proxy.js // node_modules/.pnpm/@vue+devtools-api@6.6.4/node_modules/@vue/devtools-api/lib/esm/proxy.js
var ApiProxy = class { var ApiProxy = class {
constructor(plugin, hook) { constructor(plugin, hook) {
this.target = null; this.target = null;
...@@ -155,7 +155,7 @@ var ApiProxy = class { ...@@ -155,7 +155,7 @@ var ApiProxy = class {
} }
}; };
// node_modules/@vue/devtools-api/lib/esm/index.js // node_modules/.pnpm/@vue+devtools-api@6.6.4/node_modules/@vue/devtools-api/lib/esm/index.js
function setupDevtoolsPlugin(pluginDescriptor, setupFn) { function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
const descriptor = pluginDescriptor; const descriptor = pluginDescriptor;
const target = getTarget(); const target = getTarget();
...@@ -177,7 +177,7 @@ function setupDevtoolsPlugin(pluginDescriptor, setupFn) { ...@@ -177,7 +177,7 @@ function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
} }
} }
// node_modules/vue-router/dist/vue-router.mjs // node_modules/.pnpm/vue-router@4.5.1_vue@3.5.21_typescript@5.8.3_/node_modules/vue-router/dist/vue-router.mjs
var isBrowser = typeof document !== "undefined"; var isBrowser = typeof document !== "undefined";
function isRouteComponent(component) { function isRouteComponent(component) {
return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component; return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -168,7 +168,7 @@ import { ...@@ -168,7 +168,7 @@ import {
withMemo, withMemo,
withModifiers, withModifiers,
withScopeId withScopeId
} from "./chunk-JDSL2H4L.js"; } from "./chunk-P6TLTLJ2.js";
import "./chunk-G3PMV62Z.js"; import "./chunk-G3PMV62Z.js";
export { export {
BaseTransition, BaseTransition,
......
...@@ -60,3 +60,12 @@ export function countBySysType(deptId: number) { ...@@ -60,3 +60,12 @@ export function countBySysType(deptId: number) {
method: "get", method: "get",
}); });
} }
// 地图 获取设备
export function deviceList(deptId: number) {
return request({
url: "/iot-device/baseDevice/list?pageNum=1&pageSize=10000000000000",
method: "get",
});
// pageNum=1&pageSize=10
}
...@@ -129,7 +129,7 @@ import SysClassification from "./components/SysClassification.vue"; ...@@ -129,7 +129,7 @@ import SysClassification from "./components/SysClassification.vue";
import DeviceClassification from "./components/DeviceClassification.vue"; import DeviceClassification from "./components/DeviceClassification.vue";
import EquipmentAlarm from "./components/EquipmentAlarm.vue"; import EquipmentAlarm from "./components/EquipmentAlarm.vue";
import Alert7Days from "./components/Alert7Days.vue"; import Alert7Days from "./components/Alert7Days.vue";
import MapEcharts from "./components/MapEcharts.vue"; import MapEcharts from "./components/MapEcharts1.vue";
import DeployProject from "./components/DeployProject.vue"; import DeployProject from "./components/DeployProject.vue";
import SubsidiaryCompanyEquipment from "./components/SubsidiaryCompanyEquipment.vue"; import SubsidiaryCompanyEquipment from "./components/SubsidiaryCompanyEquipment.vue";
// import Map from "./components/Map.vue"; // import Map from "./components/Map.vue";
......
...@@ -121,18 +121,16 @@ ...@@ -121,18 +121,16 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onUnmounted } from "vue";
import DeviceNumber from "./components/DeviceNumber.vue"; import DeviceNumber from "./components/DeviceNumber.vue";
import SysClassification from "./components/SysClassification.vue"; import SysClassification from "./components/SysClassification.vue";
import DeviceClassification from "./components/DeviceClassification.vue"; import DeviceClassification from "./components/DeviceClassification.vue";
import EquipmentAlarm from "./components/EquipmentAlarm.vue"; import EquipmentAlarm from "./components/EquipmentAlarm.vue";
import Alert7Days from "./components/Alert7Days.vue"; import Alert7Days from "./components/Alert7Days.vue";
import MapEcharts from "./components/Map1.vue"; import MapEcharts from "./components/Map.vue";
import DeployProject from "./components/DeployProject.vue"; import DeployProject from "./components/DeployProject.vue";
import SubsidiaryCompanyEquipment from "./components/SubsidiaryCompanyEquipment.vue"; import SubsidiaryCompanyEquipment from "./components/SubsidiaryCompanyEquipment.vue";
import ContainerWrap from "@/components/ContainerWrap/index.vue"; import ContainerWrap from "@/components/ContainerWrap/index.vue";
// import Map from "./components/Map.vue";
import { ref, onMounted, onUnmounted } from "vue";
import { eventBus } from "@/eventBus"; import { eventBus } from "@/eventBus";
import { nowTime } from "@/api/iot/home"; import { nowTime } from "@/api/iot/home";
const nowTimes = ref(""); const nowTimes = ref("");
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
import { ref, onMounted, onBeforeUnmount } from "vue"; import { ref, onMounted, onBeforeUnmount } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { countByDay } from "@/api/iot/home"; import { countByDay } from "@/api/iot/home";
import { de } from "element-plus/es/locales.mjs";
const chartRef = ref<HTMLDivElement>(); const chartRef = ref<HTMLDivElement>();
const chartContainer = ref<HTMLDivElement>(); const chartContainer = ref<HTMLDivElement>();
const chartInstance = ref<echarts.ECharts | null>(null); const chartInstance = ref<echarts.ECharts | null>(null);
let resizeObserver: ResizeObserver | null = null; let resizeObserver: ResizeObserver | null = null;
const isNull = ref(true);
const xData = ref<any[]>([ const xData = ref<any[]>([
{ {
...@@ -73,6 +73,17 @@ const initChart = () => { ...@@ -73,6 +73,17 @@ const initChart = () => {
chartInstance.value = echarts.init(chartRef.value); chartInstance.value = echarts.init(chartRef.value);
const option = { const option = {
title: {
show: !isNull.value,
text: "暂无数据",
x: "center",
y: "center",
textStyle: {
fontSize: 16,
color: "#66FFFF",
fontFamily: "PangMen",
},
},
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
...@@ -269,10 +280,14 @@ onMounted(() => { ...@@ -269,10 +280,14 @@ onMounted(() => {
endTime: new Date().toISOString().substring(0, 10) + " 23:59:59", endTime: new Date().toISOString().substring(0, 10) + " 23:59:59",
}; };
// 获取近7天告警统计 // 获取近7天告警统计
countByDay(data).then((res) => { countByDay(data).then((res: any) => {
if (res.code === 200) {
const haveHandle = res.data.haveHandle; //已处理 const haveHandle = res.data.haveHandle; //已处理
const notHandle = res.data.notHandle; //未处理 const notHandle = res.data.notHandle; //未处理
const haveIgnore = res.data.haveIgnore; //已忽略 const haveIgnore = res.data.haveIgnore; //已忽略
if (!haveHandle && !notHandle && !haveIgnore) {
isNull.value = false; //暂无数据
}
// 将近7天的日期添加到xData.time中,格式为yyyy-MM-dd 00:00:00 // 将近7天的日期添加到xData.time中,格式为yyyy-MM-dd 00:00:00
xData.value.forEach((item, index) => { xData.value.forEach((item, index) => {
item.time = `${new Date( item.time = `${new Date(
...@@ -285,7 +300,6 @@ onMounted(() => { ...@@ -285,7 +300,6 @@ onMounted(() => {
new Date().getTime() - (6 - index) * 24 * 60 * 60 * 1000 new Date().getTime() - (6 - index) * 24 * 60 * 60 * 1000
).getDate()} 00:00:00`; ).getDate()} 00:00:00`;
}); });
// 将近7天的时间戳添加到xData.timestamp中 // 将近7天的时间戳添加到xData.timestamp中
xData.value.forEach((item, index) => { xData.value.forEach((item, index) => {
item.timestamp = new Date(item.time).getTime(); item.timestamp = new Date(item.time).getTime();
...@@ -322,6 +336,27 @@ onMounted(() => { ...@@ -322,6 +336,27 @@ onMounted(() => {
} }
} }
initChart(); initChart();
} else {
// 将近7天的日期添加到xData.time中,格式为yyyy-MM-dd 00:00:00
xData.value.forEach((item, index) => {
item.time = `${new Date(
new Date().getTime() - (6 - index) * 24 * 60 * 60 * 1000
).getFullYear()}-${
new Date(
new Date().getTime() - (6 - index) * 24 * 60 * 60 * 1000
).getMonth() + 1
}-${new Date(
new Date().getTime() - (6 - index) * 24 * 60 * 60 * 1000
).getDate()} 00:00:00`;
});
xData.value.forEach((item) => {
item.haveHandle = 0;
item.notHandle = 0;
item.haveIgnore = 0;
});
isNull.value = false; //暂无数据
initChart();
}
}); });
// 使用 ResizeObserver 监听容器尺寸变化 // 使用 ResizeObserver 监听容器尺寸变化
......
...@@ -192,6 +192,8 @@ const handleResize = () => { ...@@ -192,6 +192,8 @@ const handleResize = () => {
onMounted(() => { onMounted(() => {
deviceCountByType(props.deptId, "1").then((res: any) => { deviceCountByType(props.deptId, "1").then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
const dcbt = res.dcbt || [];
if (dcbt.length > 0) {
//将res.dcbt中的数据赋值给datas.value //将res.dcbt中的数据赋值给datas.value
datas.value = res.dcbt.map((item: any) => ({ datas.value = res.dcbt.map((item: any) => ({
value: item.count, value: item.count,
...@@ -202,6 +204,22 @@ onMounted(() => { ...@@ -202,6 +204,22 @@ onMounted(() => {
(acc: number, item: any) => acc + item.count, (acc: number, item: any) => acc + item.count,
0 0
); );
} else {
datas.value = [
{ value: 0, name: "未知设备" },
{ value: 0, name: "未知设备" },
{ value: 0, name: "未知设备" },
];
totalCount.value = 0;
}
initChart();
} else {
datas.value = [
{ value: 0, name: "未知设备" },
{ value: 0, name: "未知设备" },
{ value: 0, name: "未知设备" },
];
totalCount.value = 0;
initChart(); initChart();
} }
}); });
......
...@@ -70,7 +70,7 @@ const props = defineProps({ ...@@ -70,7 +70,7 @@ const props = defineProps({
}, },
}); });
// 设备接入数量(在线、离线) // 设备接入数量(在线、离线)
var sumCount = ref([]); var sumCount = ref("0".padStart(9, "0").split(""));
//在线数量 //在线数量
var onLineCount = ref(0); var onLineCount = ref(0);
//离线数量 //离线数量
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<div <div
class="font-medium text-[28px] text-[#66FFFF] font-[YouSheBiaoTiHei]" class="font-medium text-[28px] text-[#66FFFF] font-[YouSheBiaoTiHei]"
> >
{{ processedCount }} {{ ignoredCount }}
</div> </div>
<img <img
src="@/assets/imgs/equ-right-icon.png" src="@/assets/imgs/equ-right-icon.png"
......
<template>
<div id="map-container" ref="mapContainer" class="w-full h-full"></div>
</template>
<script>
import { ref, onMounted, onBeforeUnmount } from "vue";
onMounted(() => {
initMap();
});
function initMap() {
//创建地图对象
this.map = new AMap.Map("map", {
center: [113.280637, 23.125178],
resizeEnable: true,
zoom: 7,
});
//获取边界坐标点
AMap.plugin("AMap.DistrictSearch", () => {
var districtSearch = new AMap.DistrictSearch({
// 关键字对应的行政区级别,共有5种级别
level: "province",
// 是否显示下级行政区级数,1表示返回下一级行政区
subdistrict: 0,
// 返回行政区边界坐标点
extensions: "all",
});
// 搜索所有省/直辖市信息
districtSearch.search("广东", (status, result) => {
// 查询成功时,result即为对应的行政区信息
this.handlePolygon(result);
});
});
}
// function handlePolygon(result) {
// let bounds = result.districtList[0].boundaries
// if (bounds) {
// for (let i = 0, l = bounds.length; i < l; i++) {
// //生成行政区划polygon
// let polygon = new AMap.Polygon({
// map: this.map, // 指定地图对象
// strokeWeight: 1, // 轮廓线宽度
// path: bounds[i], //轮廓线的节点坐标数组
// fillOpacity: 0.15, //透明度
// fillColor: '#256edc', //填充颜色
// strokeColor: '#256edc', //线条颜色
// })
// polygon.on('click', (e) => {
// // 点击绘制的区域时执行其他交互
// // ......
// })
// }
// // 地图自适应
// this.map.setFitView()
// }
</script>
<style scoped></style>
<template>
<div ref="mapContainer" class="map-container w-full h-full"></div>
</template>
<script>
import { ref, onMounted, onBeforeUnmount, nextTick } from "vue";
import mapConfig from "@/assets/map_config.json";
import Cluster from "@bmapgl-plugin/cluster";
import { testData } from "@/views/components/mapData";
import { iconsData } from "@/views/components/mapData";
export default {
props: {
lngLat: {
type: Object,
default: () => ({}),
},
},
setup(props) {
const mapContainer = ref(null);
const mapInstance = ref(null);
const resizeObserver = ref(null);
const province = "山西";
const provincePoint = {
lng: 112.569376,
lat: 37.879831,
};
const initMap = () => {
if (!mapContainer.value) return;
// 确保地图容器有明确尺寸
mapContainer.value.style.width = "100%";
mapContainer.value.style.height = "100%";
// 创建地图实例
const map = new BMapGL.Map(mapContainer.value, {
enableDblclickZoom: false,
displayOptions: {
building: false,
},
});
mapInstance.value = map;
// 初始化地图视图
map.centerAndZoom(
new BMapGL.Point(provincePoint.lng, provincePoint.lat),
7
);
// 开启鼠标滚轮缩放
map.enableScrollWheelZoom(true);
// 设置地图样式
map.setMapStyleV2({ styleJson: mapConfig });
// 绘制省份镂空面
var bd = new BMapGL.Boundary();
bd.get(province, function (rs) {
var hole = new BMapGL.Polygon(rs.boundaries, {
fillColor: "blue",
fillOpacity: 0.2,
strokeWeight: 5,
strokeColor: "blue",
strokeOpacity: 0.5,
});
map.addOverlay(hole);
});
// 添加聚合数据
addCluster(map);
};
const addCluster = (map) => {
const cluster = new Cluster.View(map, {
renderSingleStyle: {
type: Cluster.ClusterRender.WEBGL,
style: {
width: 13,
height: 13,
icon: [
"match",
["get", "type"],
1,
iconsData[0],
2,
iconsData[1],
3,
iconsData[2],
iconsData[3],
],
},
},
});
cluster.on(Cluster.ClusterEvent.CLICK, (e) => {
// 点击聚合事件
});
cluster.on(Cluster.ClusterEvent.MOUSE_OVER, (e) => {
if (!e.isCluster) {
let sContent = `
<div>
<p style="font-size:14px;">设备名称:${
e.properties.typeNames
}</p>
<p style="font-size:14px;">在线状态:<span style="color:${
e.properties.online ? "green" : "red"
};">${e.properties.online ? "在线" : "不在线"}</span></p>
<p style="font-size:14px;">设备地址:${e.properties.address}</p>
<p style="font-size:14px;">城市:${e.properties.city} ${
e.properties.area
}</p>
</div>
`;
let opts = {
offset: new BMapGL.Size(10, -20),
};
let infoWindow = new BMapGL.InfoWindow(sContent, opts);
let point = new BMapGL.Point(e.latLng[0], e.latLng[1]);
map.openInfoWindow(infoWindow, point);
}
});
cluster.on(Cluster.ClusterEvent.MOUSE_OUT, (e) => {
if (!e.isCluster) {
map.closeInfoWindow();
}
});
var points = Cluster.pointTransformer(testData, function (data) {
return {
point: [data.location.lng, data.location.lat],
properties: {
name: data.name,
address: data.address,
province: data.province,
city: data.city,
area: data.area,
type: data.properties.type,
typeNames: data.typeNames,
online: data.online,
},
};
});
cluster.setData(points);
};
// 监听容器大小变化
const setupResizeObserver = () => {
if (typeof ResizeObserver !== "undefined" && mapContainer.value) {
resizeObserver.value = new ResizeObserver(() => {
if (mapInstance.value) {
mapInstance.value.centerAndZoom(
new BMapGL.Point(provincePoint.lng, provincePoint.lat),
mapInstance.value.getZoom()
);
}
});
resizeObserver.value.observe(mapContainer.value);
}
};
onMounted(() => {
nextTick(() => {
// 确保DOM完全渲染
setTimeout(() => {
initMap();
setupResizeObserver();
}, 300);
});
});
onBeforeUnmount(() => {
if (resizeObserver.value) {
resizeObserver.value.disconnect();
}
if (mapInstance.value) {
mapInstance.value.destroy();
}
});
return {
mapContainer,
};
},
};
</script>
<style lang="scss" scoped>
.map-container {
:deep(.BMap_bubble_content) {
color: #fff !important;
top: -15px !important;
}
:deep(.BMap_bubble_pop) {
background-color: #121b4d !important;
border: 1px solid #408bde !important;
}
}
// 隐藏百度地图logo
:global(.anchorBL) {
display: none;
}
</style>
...@@ -8,7 +8,6 @@ import { ref, onMounted, onBeforeUnmount } from "vue"; ...@@ -8,7 +8,6 @@ import { ref, onMounted, onBeforeUnmount } from "vue";
import * as echarts from "echarts"; import * as echarts from "echarts";
import { debounce } from "lodash-es"; // 或使用自定义防抖函数 import { debounce } from "lodash-es"; // 或使用自定义防抖函数
import { deviceCountByChild } from "@/api/iot/home"; import { deviceCountByChild } from "@/api/iot/home";
import { de } from "element-plus/es/locales.mjs";
const chartRef = ref<HTMLDivElement>(); const chartRef = ref<HTMLDivElement>();
const chart = ref<echarts.ECharts | null>(null); const chart = ref<echarts.ECharts | null>(null);
...@@ -34,6 +33,18 @@ const initChart = () => { ...@@ -34,6 +33,18 @@ const initChart = () => {
chart.value?.dispose(); chart.value?.dispose();
chart.value = echarts.init(chartRef.value); chart.value = echarts.init(chartRef.value);
const option = { const option = {
title: {
show: xData.value[0] === "",
text: "暂无数据",
x: "center",
y: "center",
textStyle: {
fontSize: 16,
color: "#66FFFF",
fontFamily: "PangMen",
},
},
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
axisPointer: { axisPointer: {
...@@ -43,6 +54,7 @@ const initChart = () => { ...@@ -43,6 +54,7 @@ const initChart = () => {
legend: { legend: {
show: false, show: false,
}, },
xAxis: { xAxis: {
data: xData.value, data: xData.value,
axisLabel: { axisLabel: {
...@@ -104,18 +116,28 @@ onMounted(() => { ...@@ -104,18 +116,28 @@ onMounted(() => {
deviceCountByChild(props.deptId).then((res: any) => { deviceCountByChild(props.deptId).then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
const childDeptList = res.result?.childDeptList || []; const childDeptList = res.result?.childDeptList || [];
const numMap = res.result?.numMap || []; const numMap = res.result?.numMap || {};
if (numMap && Object.keys(numMap).length > 0) {
//numMap中的 key 和childDeptList.deptId 进行匹配 //numMap中的 key 和childDeptList.deptId 进行匹配
Object.entries(numMap).forEach(([key, value]) => { Object.entries(numMap).forEach(([key, value]) => {
console.log(`Key: ${key}, Value: ${value}`);
yData.value.push(value); yData.value.push(value);
// 匹配到后,将对应的部门名称添加到 xData // 匹配到后,将对应的部门名称添加到xData
for (let i = 0; i < childDeptList.length; i++) { for (let i = 0; i < childDeptList.length; i++) {
if (childDeptList[i].deptId === Number(key)) { if (childDeptList[i].deptId === Number(key)) {
xData.value.push(childDeptList[i].deptName); xData.value.push(childDeptList[i].deptName);
} }
} }
}); });
} else {
// 没有匹配到的部门,添加默认值
xData.value.push("");
yData.value.push(0);
}
initChart();
} else {
// 没有子部门,添加默认值
xData.value.push("");
yData.value.push(0);
initChart(); initChart();
} }
}); });
......
...@@ -41,47 +41,53 @@ ...@@ -41,47 +41,53 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { sw } from "element-plus/es/locales.mjs";
import { ref } from "vue"; import { ref } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { countBySysType } from "@/api/iot/home";
const router = useRouter(); const router = useRouter();
const props = defineProps({
deptId: {
type: Number,
default: 0,
},
});
const sysClassificationList = ref([ const sysClassificationList = ref([
{ {
name: "智慧隧道", name: "智慧隧道",
number: 100, number: 0,
online: 150, online: 0,
offline: 10, offline: 0,
}, },
{ {
name: "幸福小镇", name: "幸福小镇",
number: 110, number: 0,
online: 100, online: 0,
offline: 20, offline: 0,
}, },
{ {
name: "智慧园区", name: "智慧园区",
number: 234, number: 0,
online: 50, online: 0,
offline: 30, offline: 0,
}, },
{ {
name: "拌合站", name: "拌合站",
number: 455, number: 0,
online: 200, online: 0,
offline: 50, offline: 0,
}, },
{ {
name: "视频监控", name: "视频监控",
number: 231, number: 0,
online: 100, online: 0,
offline: 0, offline: 0,
}, },
{ {
name: "钢筋场", name: "钢筋场",
number: 432, number: 0,
online: 30, online: 0,
offline: 11, offline: 0,
}, },
]); ]);
...@@ -113,6 +119,22 @@ const handleClick = (item: any, index: number) => { ...@@ -113,6 +119,22 @@ const handleClick = (item: any, index: number) => {
break; break;
} }
}; };
function getCountBySysType() {
countBySysType(props.deptId).then((res: any) => {
if (res.code === 200) {
res.data.map((item: any) => {
// 如果 item.type==1 则赋值给 sysClassificationList[0]
if (item.type === 1) {
sysClassificationList.value[0].number = item.count || 0; // 智慧隧道 总数
sysClassificationList.value[0].online = item.count || 0; // 在线
// sysClassificationList.value[0].offline = item.offline || 0;
}
});
}
});
}
getCountBySysType();
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -54,6 +54,7 @@ export default defineConfig({ ...@@ -54,6 +54,7 @@ export default defineConfig({
proxy: { proxy: {
"/dev-api": { "/dev-api": {
target: "http://192.168.19.84:8081", target: "http://192.168.19.84:8081",
// target: "http://192.168.19.9:8081",
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/dev-api/, ""), rewrite: (path) => path.replace(/^\/dev-api/, ""),
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment