Commit d85c4224 by 吴春元

壮举:添加字典实用功能和图像的进度动画

-实现‘ useDict ’功能,从存储和API中获取和管理字典数据。
-增加了‘ getDictLabel ’功能,根据类型和值检索字典标签。
-包括新的PNG图像进度动画在资产目录。
parent 3a4a0449
......@@ -30,6 +30,7 @@ declare module 'vue' {
ElSelect: typeof import('element-plus/es')['ElSelect']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
HelloWorld: typeof import('./src/components/HelloWorld.vue')['default']
ItemWrap: typeof import('./src/components/ItemWrap/index.vue')['default']
ItemWrap2: typeof import('./src/components/ItemWrap2/index.vue')['default']
......
......@@ -6,6 +6,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>路桥集团智慧物联网平台</title>
<script src="/auto-imports.d.ts"></script>
<script src="/videoPlayer/plugin/hk_h5_sdk/h5player.min.js"></script>
<script src="/videoPlayer/plugin/dh_wsplayer/public/icc/api.js"></script>
<script src="/videoPlayer/plugin/dh_wsplayer/public/icc/PlayerManager.js"></script>
......
......@@ -2,300 +2,306 @@
"hash": "cafa6c33",
"configHash": "ca4ef806",
"lockfileHash": "2e2ef206",
"browserHash": "a1fff30e",
"browserHash": "0e27a73e",
"optimized": {
"vue": {
"src": "../../.pnpm/vue@3.5.21_typescript@5.8.3/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "5a715d56",
"fileHash": "87ddee12",
"needsInterop": false
},
"vue-router": {
"src": "../../.pnpm/vue-router@4.5.1_vue@3.5.21_typescript@5.8.3_/node_modules/vue-router/dist/vue-router.mjs",
"file": "vue-router.js",
"fileHash": "e7e39dc0",
"fileHash": "5c928852",
"needsInterop": false
},
"element-plus": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/index.mjs",
"file": "element-plus.js",
"fileHash": "54370ffb",
"fileHash": "ccdc7587",
"needsInterop": false
},
"@element-plus/icons-vue": {
"src": "../../.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.21_typescript@5.8.3_/node_modules/@element-plus/icons-vue/dist/index.js",
"file": "@element-plus_icons-vue.js",
"fileHash": "2c4e3fd2",
"fileHash": "264612ec",
"needsInterop": false
},
"nprogress": {
"src": "../../.pnpm/nprogress@0.2.0/node_modules/nprogress/nprogress.js",
"file": "nprogress.js",
"fileHash": "14c5d8dd",
"fileHash": "1b284b75",
"needsInterop": true
},
"pinia": {
"src": "../../.pnpm/pinia@3.0.3_typescript@5.8.3_vue@3.5.21_typescript@5.8.3_/node_modules/pinia/dist/pinia.mjs",
"file": "pinia.js",
"fileHash": "568b8013",
"fileHash": "be92118b",
"needsInterop": false
},
"js-cookie": {
"src": "../../.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs",
"file": "js-cookie.js",
"fileHash": "b983782f",
"fileHash": "62c4cd6c",
"needsInterop": false
},
"axios": {
"src": "../../.pnpm/axios@1.12.2/node_modules/axios/index.js",
"file": "axios.js",
"fileHash": "ff27b63b",
"fileHash": "ea2a71e4",
"needsInterop": false
},
"element-plus/es": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/index.mjs",
"file": "element-plus_es.js",
"fileHash": "080ac84c",
"fileHash": "89bc77ef",
"needsInterop": false
},
"element-plus/es/components/base/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/base/style/index.mjs",
"file": "element-plus_es_components_base_style_index.js",
"fileHash": "1492dfd8",
"fileHash": "43656ea6",
"needsInterop": false
},
"element-plus/es/components/dialog/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/dialog/style/index.mjs",
"file": "element-plus_es_components_dialog_style_index.js",
"fileHash": "19eabf4a",
"fileHash": "d7741cf6",
"needsInterop": false
},
"element-plus/es/components/icon/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/icon/style/index.mjs",
"file": "element-plus_es_components_icon_style_index.js",
"fileHash": "694e7b5c",
"fileHash": "2404825c",
"needsInterop": false
},
"element-plus/es/components/row/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/row/style/index.mjs",
"file": "element-plus_es_components_row_style_index.js",
"fileHash": "3b6e8a98",
"fileHash": "c1961891",
"needsInterop": false
},
"element-plus/es/components/col/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/col/style/index.mjs",
"file": "element-plus_es_components_col_style_index.js",
"fileHash": "0123ae00",
"fileHash": "bf25bb81",
"needsInterop": false
},
"@amap/amap-jsapi-loader": {
"src": "../../.pnpm/@amap+amap-jsapi-loader@1.0.1/node_modules/@amap/amap-jsapi-loader/dist/index.js",
"file": "@amap_amap-jsapi-loader.js",
"fileHash": "94957f44",
"fileHash": "bd0193b2",
"needsInterop": true
},
"mitt": {
"src": "../../.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs",
"file": "mitt.js",
"fileHash": "e85c7fe4",
"fileHash": "aeb356e1",
"needsInterop": false
},
"element-plus/es/components/select/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/select/style/index.mjs",
"file": "element-plus_es_components_select_style_index.js",
"fileHash": "b06aa374",
"fileHash": "8608194a",
"needsInterop": false
},
"element-plus/es/components/option/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/option/style/index.mjs",
"file": "element-plus_es_components_option_style_index.js",
"fileHash": "3a29e5a8",
"fileHash": "21f81b09",
"needsInterop": false
},
"element-plus/es/components/cascader/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/cascader/style/index.mjs",
"file": "element-plus_es_components_cascader_style_index.js",
"fileHash": "bffd4874",
"fileHash": "e0a83a59",
"needsInterop": false
},
"echarts": {
"src": "../../.pnpm/echarts@6.0.0/node_modules/echarts/index.js",
"file": "echarts.js",
"fileHash": "b7d5acf9",
"fileHash": "6074d5e8",
"needsInterop": false
},
"lodash-es": {
"src": "../../lodash-es/lodash.js",
"file": "lodash-es.js",
"fileHash": "35e49d1c",
"fileHash": "59e4445c",
"needsInterop": false
},
"element-plus/es/components/form/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/form/style/index.mjs",
"file": "element-plus_es_components_form_style_index.js",
"fileHash": "3d1ae4d8",
"fileHash": "e954add2",
"needsInterop": false
},
"element-plus/es/components/button/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/button/style/index.mjs",
"file": "element-plus_es_components_button_style_index.js",
"fileHash": "cc030ebe",
"fileHash": "7a0082cf",
"needsInterop": false
},
"element-plus/es/components/checkbox/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/checkbox/style/index.mjs",
"file": "element-plus_es_components_checkbox_style_index.js",
"fileHash": "96a4f578",
"fileHash": "620b4d72",
"needsInterop": false
},
"element-plus/es/components/form-item/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/form-item/style/index.mjs",
"file": "element-plus_es_components_form-item_style_index.js",
"fileHash": "656b0133",
"fileHash": "01c653d7",
"needsInterop": false
},
"element-plus/es/components/input/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/input/style/index.mjs",
"file": "element-plus_es_components_input_style_index.js",
"fileHash": "7560e0d7",
"fileHash": "fbcbcbcf",
"needsInterop": false
},
"jsencrypt": {
"src": "../../.pnpm/jsencrypt@3.5.4/node_modules/jsencrypt/lib/index.js",
"file": "jsencrypt.js",
"fileHash": "36170e3c",
"fileHash": "b0d90799",
"needsInterop": false
},
"element-plus/es/locales.mjs": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/locales.mjs",
"file": "element-plus_es_locales__mjs.js",
"fileHash": "9ee1fc4b",
"fileHash": "28aa4287",
"needsInterop": false
},
"gsap": {
"src": "../../.pnpm/gsap@3.13.0/node_modules/gsap/index.js",
"file": "gsap.js",
"fileHash": "80c73c13",
"fileHash": "4ad6140f",
"needsInterop": false
},
"element-plus/es/components/image/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/image/style/index.mjs",
"file": "element-plus_es_components_image_style_index.js",
"fileHash": "65fdaaf7",
"fileHash": "8a7bbb14",
"needsInterop": false
},
"element-plus/es/components/radio-group/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/radio-group/style/index.mjs",
"file": "element-plus_es_components_radio-group_style_index.js",
"fileHash": "f6746f4f",
"fileHash": "1d02d183",
"needsInterop": false
},
"element-plus/es/components/radio-button/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/radio-button/style/index.mjs",
"file": "element-plus_es_components_radio-button_style_index.js",
"fileHash": "1a146c86",
"fileHash": "cca3c084",
"needsInterop": false
},
"element-plus/es/components/table/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/table/style/index.mjs",
"file": "element-plus_es_components_table_style_index.js",
"fileHash": "c67b6370",
"fileHash": "7fd3a7bc",
"needsInterop": false
},
"element-plus/es/components/table-column/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/table-column/style/index.mjs",
"file": "element-plus_es_components_table-column_style_index.js",
"fileHash": "3e51f843",
"fileHash": "c6c96631",
"needsInterop": false
},
"element-plus/es/components/empty/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/empty/style/index.mjs",
"file": "element-plus_es_components_empty_style_index.js",
"fileHash": "62165c23",
"fileHash": "f87315b7",
"needsInterop": false
},
"three": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/build/three.module.js",
"file": "three.js",
"fileHash": "acd8be1d",
"fileHash": "d7a19317",
"needsInterop": false
},
"three/examples/jsm/controls/OrbitControls.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/controls/OrbitControls.js",
"file": "three_examples_jsm_controls_OrbitControls__js.js",
"fileHash": "28b59dff",
"fileHash": "f0193881",
"needsInterop": false
},
"three/examples/jsm/renderers/CSS2DRenderer.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/renderers/CSS2DRenderer.js",
"file": "three_examples_jsm_renderers_CSS2DRenderer__js.js",
"fileHash": "0402defc",
"fileHash": "5c5fdd84",
"needsInterop": false
},
"three/addons/renderers/CSS3DRenderer.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/renderers/CSS3DRenderer.js",
"file": "three_addons_renderers_CSS3DRenderer__js.js",
"fileHash": "e187b6ec",
"fileHash": "8401fe7c",
"needsInterop": false
},
"three/addons/postprocessing/EffectComposer.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/postprocessing/EffectComposer.js",
"file": "three_addons_postprocessing_EffectComposer__js.js",
"fileHash": "73b4ed17",
"fileHash": "e7ffac86",
"needsInterop": false
},
"three/addons/postprocessing/RenderPass.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/postprocessing/RenderPass.js",
"file": "three_addons_postprocessing_RenderPass__js.js",
"fileHash": "69f178bd",
"fileHash": "2b0dd704",
"needsInterop": false
},
"three/addons/postprocessing/OutlinePass.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/postprocessing/OutlinePass.js",
"file": "three_addons_postprocessing_OutlinePass__js.js",
"fileHash": "db4d4624",
"fileHash": "01742d42",
"needsInterop": false
},
"d3": {
"src": "../../.pnpm/d3@7.9.0/node_modules/d3/src/index.js",
"file": "d3.js",
"fileHash": "e03cf7b9",
"fileHash": "82a9c8d0",
"needsInterop": false
},
"three/examples/jsm/lines/Line2.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/lines/Line2.js",
"file": "three_examples_jsm_lines_Line2__js.js",
"fileHash": "1d1bf1ea",
"fileHash": "aaa10260",
"needsInterop": false
},
"three/examples/jsm/lines/LineGeometry.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/lines/LineGeometry.js",
"file": "three_examples_jsm_lines_LineGeometry__js.js",
"fileHash": "080284d4",
"fileHash": "afba021a",
"needsInterop": false
},
"three/examples/jsm/lines/LineMaterial.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/lines/LineMaterial.js",
"file": "three_examples_jsm_lines_LineMaterial__js.js",
"fileHash": "4349af95",
"fileHash": "979cf533",
"needsInterop": false
},
"three/examples/jsm/renderers/CSS3DRenderer.js": {
"src": "../../.pnpm/three@0.181.2/node_modules/three/examples/jsm/renderers/CSS3DRenderer.js",
"file": "three_examples_jsm_renderers_CSS3DRenderer__js.js",
"fileHash": "df4a41bc",
"fileHash": "e8002e08",
"needsInterop": false
},
"element-plus/es/components/card/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/card/style/index.mjs",
"file": "element-plus_es_components_card_style_index.js",
"fileHash": "218ffed9",
"fileHash": "d8002715",
"needsInterop": false
},
"element-plus/es/components/link/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/link/style/index.mjs",
"file": "element-plus_es_components_link_style_index.js",
"fileHash": "0f278fe0",
"fileHash": "6bbb9ec6",
"needsInterop": false
},
"element-plus/es/components/tree-select/style/index": {
"src": "../../.pnpm/element-plus@2.11.2_vue@3.5.21_typescript@5.8.3_/node_modules/element-plus/es/components/tree-select/style/index.mjs",
"file": "element-plus_es_components_tree-select_style_index.js",
"fileHash": "c417acc4",
"needsInterop": false
}
},
......@@ -306,30 +312,33 @@
"chunk-PPLACW3U": {
"file": "chunk-PPLACW3U.js"
},
"chunk-IXSGC3JQ": {
"file": "chunk-IXSGC3JQ.js"
},
"chunk-YP2RKF6U": {
"file": "chunk-YP2RKF6U.js"
},
"chunk-ZYZE4ADI": {
"file": "chunk-ZYZE4ADI.js"
},
"chunk-IXSGC3JQ": {
"file": "chunk-IXSGC3JQ.js"
},
"chunk-27VY4B4A": {
"file": "chunk-27VY4B4A.js"
},
"chunk-QMPMWDA4": {
"file": "chunk-QMPMWDA4.js"
},
"chunk-U7ZX2BS5": {
"file": "chunk-U7ZX2BS5.js"
},
"chunk-WGK4RKLA": {
"file": "chunk-WGK4RKLA.js"
"chunk-QMPMWDA4": {
"file": "chunk-QMPMWDA4.js"
},
"chunk-ZID7SM67": {
"file": "chunk-ZID7SM67.js"
},
"chunk-KL6JP65J": {
"file": "chunk-KL6JP65J.js"
},
"chunk-WGK4RKLA": {
"file": "chunk-WGK4RKLA.js"
},
"chunk-XJ4FNH6G": {
"file": "chunk-XJ4FNH6G.js"
},
......@@ -339,6 +348,9 @@
"chunk-WYGDTZ7H": {
"file": "chunk-WYGDTZ7H.js"
},
"chunk-HQ2UCEI6": {
"file": "chunk-HQ2UCEI6.js"
},
"chunk-5WDSIG6Y": {
"file": "chunk-5WDSIG6Y.js"
},
......@@ -347,9 +359,6 @@
},
"chunk-G3PMV62Z": {
"file": "chunk-G3PMV62Z.js"
},
"chunk-HQ2UCEI6": {
"file": "chunk-HQ2UCEI6.js"
}
}
}
\ No newline at end of file
import request from "@/utils/request";
// 查询字典数据列表
export function listData(query: any) {
return request({
url: "/system/dict/data/list",
method: "get",
params: query,
});
}
// 查询字典数据详细
export function getData(dictCode: any) {
return request({
url: "/system/dict/data/" + dictCode,
method: "get",
});
}
// 根据字典类型查询字典数据信息
export function getDicts(dictType: any) {
return request({
url: "/system/dict/data/type/" + dictType,
method: "get",
});
}
// 新增字典数据
export function addData(data: any) {
return request({
url: "/system/dict/data",
method: "post",
data: data,
});
}
// 修改字典数据
export function updateData(data: any) {
return request({
url: "/system/dict/data",
method: "put",
data: data,
});
}
// 删除字典数据
export function delData(dictCode: any) {
return request({
url: "/system/dict/data/" + dictCode,
method: "delete",
});
}
import request from "@/utils/request";
// 查询字典类型列表
export function listType(query: any) {
return request({
url: "/system/dict/type/list",
method: "get",
params: query,
});
}
// 查询字典类型详细
export function getType(dictId: any) {
return request({
url: "/system/dict/type/" + dictId,
method: "get",
});
}
// 新增字典类型
export function addType(data: any) {
return request({
url: "/system/dict/type",
method: "post",
data: data,
});
}
// 修改字典类型
export function updateType(data: any) {
return request({
url: "/system/dict/type",
method: "put",
data: data,
});
}
// 删除字典类型
export function delType(dictId: any) {
return request({
url: "/system/dict/type/" + dictId,
method: "delete",
});
}
// 刷新字典缓存
export function refreshCache() {
return request({
url: "/system/dict/type/refreshCache",
method: "delete",
});
}
// 获取字典选择框列表
export function optionselect() {
return request({
url: "/system/dict/type/optionselect",
method: "get",
});
}
......@@ -62,10 +62,38 @@ export function countBySysType(deptId: number) {
}
// 地图 获取设备
export function deviceList(deptId: number) {
export function deviceList(
deptId: number,
oneTypeId: String,
twoTypeId: String,
threeTypeId: String,
fourTypeId: String,
fiveTypeId: String,
sixTypeId: String
) {
return request({
url: "/iot-device/baseDevice/list?pageNum=1&pageSize=10000000000000",
url:
"/iot-device/baseDevice/list?pageNum=1&pageSize=10000000000000" +
+"&oneTypeId=" +
oneTypeId +
"&twoTypeId=" +
twoTypeId +
"&threeTypeId=" +
threeTypeId +
"&fourTypeId=" +
fourTypeId +
"&fiveTypeId=" +
fiveTypeId +
"&sixTypeId=" +
sixTypeId,
method: "get",
});
}
// 地图 获取设备类型
export function deviceTypeList() {
return request({
url: "/iot-device/deviceType/list",
method: "get",
});
// pageNum=1&pageSize=10
}
......@@ -71,7 +71,6 @@ $blue-hover: #40a9ff; // 悬停蓝色
.el-input__inner {
color: #{$white-text};
}
}
......
......@@ -12,7 +12,14 @@ import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import store from "./store";
import "./permission.ts"; // permission control
import plugins from "./plugins"; // plugins
import { useDict } from "@/utils/dict";
import { handleTree } from "@/utils/ruoyi";
const app = createApp(App);
// 全局方法挂载
app.config.globalProperties.useDict = useDict;
app.config.globalProperties.handleTree = handleTree;
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component);
}
......
import { defineStore } from 'pinia'
import { defineStore } from "pinia";
const useDictStore = defineStore(
'dict',
{
state: () => ({
dict: new Array()
}),
actions: {
// 获取字典
getDict(_key: string) {
if (_key == null && _key == "") {
return null;
}
try {
for (let i = 0; i < this.dict.length; i++) {
if (this.dict[i].key == _key) {
return this.dict[i].value;
}
const useDictStore = defineStore("dict", {
state: () => ({
dict: new Array(),
}),
actions: {
// 获取字典
getDict(_key: string) {
if (_key == null && _key == "") {
return null;
}
try {
for (let i = 0; i < this.dict.length; i++) {
if (this.dict[i].key == _key) {
return this.dict[i].value;
}
} catch (e) {
return null;
}
},
// 设置字典
setDict(_key: string, value: any) {
if (_key !== null && _key !== "") {
this.dict.push({
key: _key,
value: value
});
}
},
// 删除字典
removeDict(_key: string) {
var bln = false;
try {
for (let i = 0; i < this.dict.length; i++) {
if (this.dict[i].key == _key) {
this.dict.splice(i, 1);
return true;
}
} catch (e) {
return null;
}
},
// 设置字典
setDict(_key: string, value: any) {
if (_key !== null && _key !== "") {
this.dict.push({
key: _key,
value: value,
});
}
},
// 删除字典
removeDict(_key: string) {
var bln = false;
try {
for (let i = 0; i < this.dict.length; i++) {
if (this.dict[i].key == _key) {
this.dict.splice(i, 1);
return true;
}
} catch (e) {
bln = false;
}
return bln;
},
// 清空字典
cleanDict() {
this.dict = new Array();
},
// 初始字典
initDict() {
} catch (e) {
bln = false;
}
}
})
return bln;
},
// 清空字典
cleanDict() {
this.dict = new Array();
},
// 初始字典
initDict() {},
},
});
export default useDictStore
export default useDictStore;
import { ref, toRefs } from "vue";
import useDictStore from "@/store/modules/dict";
import { getDicts } from "@/api/iot/dict/data";
/**
* 获取字典数据
*/
export function useDict(...args: any[]) {
const res = ref<any>({});
return (() => {
args.forEach((dictType: any, index: number) => {
res.value[dictType] = [];
const dicts = useDictStore().getDict(dictType);
if (dicts) {
res.value[dictType] = dicts;
} else {
getDicts(dictType).then((resp) => {
res.value[dictType] = resp.data.map((p) => ({
label: p.dictLabel,
value: p.dictValue,
elTagType: p.listClass,
elTagClass: p.cssClass,
}));
useDictStore().setDict(dictType, res.value[dictType]);
});
}
});
return toRefs(res.value);
})();
}
/**
* 获取字典标签
*/
export function getDictLabel(dictType: any, value: any) {
const dicts = useDictStore().getDict(dictType);
if (dicts) {
const data = dicts.find((p) => p.value == value);
return data ? data.label : "";
}
}
......@@ -273,7 +273,7 @@ function getNowTime() {
getNowTime();
</script>
<style scoped>
<style scoped lang="scss">
.full-screen-container {
width: 100vw;
height: calc(100vh - 86px);
......
<template>
<!-- 已部署项目 -->
<div>
<div class="grid grid-cols-4 gap-7">
<div class="grid grid-cols-4 gap-6">
<div
v-for="(item, index) in projectList"
:key="index"
......
......@@ -2,34 +2,45 @@
<!-- map-container上面加一个下拉框 -->
<div class="map-container w-full h-full relative" id="container">
<div class="absolute top-2 left-2 z-10">
<el-select
style="width: 130px"
v-model="selectedScene"
<el-tree-select
style="width: 150px"
v-model="treeDataValue"
:data="treeDataList"
:props="{ value: 'id', label: 'name', children: 'children' }"
value-key="id"
placeholder="设备筛选"
check-strictly
:render-after-expand="false"
@change="handleSceneChange"
>
<el-option
v-for="item in deviceData"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
/>
</div>
</div>
</template>
<script setup>
import { onMounted, onUnmounted, nextTick } from "vue";
import { onMounted, onUnmounted, nextTick, getCurrentInstance } from "vue";
import AMapLoader from "@amap/amap-jsapi-loader";
import mapBg from "/src/assets/imgs/map-bg.png";
import closeIcon from "/src/assets/imgs/close-icon.png";
import { deviceList } from "@/api/iot/home";
import { deviceList, deviceTypeList } from "@/api/iot/home";
import useDictStore from "@/store/modules/dict";
import { de } from "element-plus/es/locales.mjs";
import { handleTree } from "@/utils/ruoyi";
const instance = getCurrentInstance();
const { sys_type: sysType } = instance.proxy.useDict("sys_type");
let map = null;
let showInfoWindow = false;
let infoWindow = null;
var points = ref([]);
const treeDataValue = ref([]);
const treeDataList = ref([]);
const oneTypeId = ref("");
const twoTypeId = ref("");
const threeTypeId = ref("");
const fourTypeId = ref("");
const fiveTypeId = ref("");
const sixTypeId = ref("");
const props = defineProps({
deptId: {
......@@ -38,23 +49,43 @@ const props = defineProps({
},
});
const deviceData = [
{
value: 1,
label: "设备1",
},
{
value: 2,
label: "设备2",
},
];
onMounted(() => {
window._AMapSecurityConfig = {
securityJsCode: "40f496011ee130bf5a5713bc90291655",
};
});
function handleSceneChange(val) {
treeDataList.value.forEach((item) => {
if (item.id === val) {
const parentIds = item.parentIds;
const ids = parentIds
.split("|")
.filter((item) => item !== "" && item !== "0");
//将当前选中的类型赋值给对应的类型id
if (ids.length == 0) {
oneTypeId.value = val;
}
if (ids.length == 1) {
twoTypeId.value = val;
}
if (ids.length == 2) {
threeTypeId.value = val;
}
if (ids.length == 3) {
fourTypeId.value = val;
}
if (ids.length == 4) {
fiveTypeId.value = val;
}
if (ids.length == 5) {
sixTypeId.value = val;
}
}
});
// getDeviceList();
}
function initMap() {
AMapLoader.load({
key: "fee919a8e608c39d1d528ec662a2ca17", // 申请好的Web端开发者Key,首次调用 load 时必填
......@@ -65,11 +96,6 @@ function initMap() {
"AMap.MarkerCluster",
"AMap.IndexCluster",
"AMap.ToolBar",
"AMap.MapType",
"AMap.Geolocation",
"AMap.AutoComplete",
"AMap.PlaceSearch",
"AMap.HawkEye",
"AMap.InfoWindow",
], //需要使用的的插件列表,如比例尺'AMap.Scale',支持添加多个如:['...','...']
})
......@@ -88,12 +114,12 @@ function initMap() {
mask.push([bounds[i]]);
}
const map = new AMap.Map("container", {
pitch: 40, // 倾斜角度
zoom: 6.3, // 设置当前显示级别
pitch: 30, // 倾斜角度
zoom: 6.7, // 设置当前显示级别
expandZoomRange: true, // 开启显示范围设置
animateEnable: true,
zooms: [3, 20], //最小显示级别为7,最大显示级别为20
center: [112.55, 37.87], // 设置地图中心点位置
center: [112.39, 36.99], // 设置地图中心点位置
viewMode: "3D", // 特别注意,设置为3D则其他地区不显示
zoomEnable: true, // 是否可以缩放地图
resizeEnable: true, // 是否开启地图自动调整大小
......@@ -115,27 +141,21 @@ function initMap() {
map, // 地图实例
points.value, // 海量点数据,数据中需包含经纬度信息字段 lnglat
{
gridSize: 20, // 聚合网格的像素大小,默认值为60
gridSize: 10, // 聚合网格的像素大小,默认值为60
//聚合点样式
// renderClusterMarker: _renderClusterMarker,
//非聚合点样式
renderMarker: (context) => {
const item = context.data[0];
context.marker.setOffset(new AMap.Pixel(-12, -24));
//设置非聚合点样式
context.marker.setContent(
`<img src="${item.remark}" alt="" style="width: 25px;height: 25px;">`
`<img src="${item.twoType.pic}" alt="" style="width: 25px;height: 25px;">`
);
// context.marker.setContent(
// `<div style="width: 10px;height: 10px;">${item.img}</div>`
// );
let isMouseInTooltip = false;
// 自定义点击事件
context.marker.on("click", function (e) {
var info = [];
info.push(
`<div style="background:url(${mapBg}) no-repeat; background-size: 100% 100%;width: 260px;height: 130px;">`
`<div style="background:url(${mapBg}) no-repeat; background-size: 100% 100%;width: 260px;height: 145px;">`
);
info.push(
"<div style='display: flex; align-items: center; justify-content: space-between;'>"
......@@ -146,36 +166,30 @@ function initMap() {
info.push(
`<div style="margin-right: 10px;background:url(${closeIcon}) no-repeat; background-size: 100% 100%;height: 20px;width: 20px;" class="close-info-window"></div></div>`
);
// 在创建 InfoWindow 后,通过事件委托绑定点击事件
// document.body.addEventListener("click", function (e) {
// if (e.target.classList.contains("close-info-window")) {
// infoWindow.close(map, e.target.getPosition());
// }
// });
info.push("<div style='display: flex;'>");
info.push(
"<div style='font-size: 11px;color:#357abd;height: 150px'>"
);
info.push(
"<div class='form_info_font'> 设备名称 </div> <div class='form_info_font'> 设备类型 </div> <div class='form_info_font'> 所属单位 </div> <div class='form_info_font'>是否在线</div></div>"
"<div class='form_info_font'> 设备类型 </div> <div class='form_info_font'> 设备名称 </div> <div class='form_info_font'> 系统类型 </div> <div class='form_info_font'>所属工程</div> <div class='form_info_font'>是否在线</div></div>"
);
info.push(
"<div style='font-size: 11px;color:#000;'> <div class='form_info_font1'> " +
item.name +
showDeviceType(item) +
"</div> <div class='form_info_font1'>" +
item.sysType +
item.name +
" </div> <div class='form_info_font1'>" +
showSysType(item) +
"</div> <div class='form_info_font1'> " +
item.sysDept.deptName +
"</div> <div class='form_info_font1'> " +
item.state +
(item.state == 1 ? "在线" : "离线") +
"</div></div>"
);
infoWindow = new AMap.InfoWindow({
isCustom: true, // 是否自定义窗体
autoMove: true, // 是否自动调整窗体到视野内
offset: new AMap.Pixel(0, -30),
offset: new AMap.Pixel(0, -35),
content: info.join(""), //使用默认信息窗体框样式,显示信息内容
});
infoWindow.open(map, context.marker.getPosition());
......@@ -198,6 +212,18 @@ function initMap() {
console.log(e);
});
}
//显示设备类型
var showDeviceType = function (item) {
return item.twoType.name;
};
//显示系统类型
var showSysType = function (item) {
const sysTypeItem = sysType.value.find(
(i) => String(i.value) == String(item.sysType)
);
return sysTypeItem ? sysTypeItem.label : "-";
};
//关闭信息窗体
var closeInfoWindow = function () {
......@@ -244,29 +270,22 @@ var _renderClusterMarker = function (context) {
// }
});
};
//非聚合点样式
var _renderMarker = function (context) {
//context 为回调参数,
//包含如下属性 marker:当前非聚合点
context.marker.setContent('<div style="background-color:#ff0000">1</div>');
// 自定义点击事件
context.marker.on("click", function (e) {
// touchend 移动端点击事件;mouseup pc点击
// let clickType = e.originEvent.type;
// let infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(0, -30) });
// infoWindow.open(map, [e.lnglat.lng, e.lnglat.lat]);
// alert(e.lnglat.lng, e.lnglat.lat);
});
};
onUnmounted(() => {
map?.destroy();
});
function getDeviceList() {
deviceList(props.deptId).then((res) => {
deviceList(
props.deptId,
oneTypeId.value,
twoTypeId.value,
threeTypeId.value,
fourTypeId.value,
fiveTypeId.value,
sixTypeId.value
).then((res) => {
points.value = res.rows;
// lnglat: ["113.12", "36.2"],
points.value.forEach((item) => {
item.lnglat = [item.longitude, item.latitude];
item.weight = 1;
......@@ -275,7 +294,14 @@ function getDeviceList() {
});
}
function getDeviceTypeList() {
deviceTypeList().then((res) => {
treeDataList.value = handleTree(res.data, "id");
});
}
getDeviceList();
getDeviceTypeList();
</script>
<style>
......
......@@ -488,12 +488,13 @@ function getData() {
::v-deep(.el-dialog) {
// background-color: #122953 !important;
background: url("@/assets/imgs/dialog-bgg.png") no-repeat center center;
background: url("@/assets/imgs/dialog-bg.png");
background-size: 100% 100%;
}
::v-deep(.el-dialog__header) {
// border-bottom: 0.5px solid #63fbfc;
}
// ::v-deep(.el-dialog__header) {
// // border-bottom: 0.5px solid #63fbfc;
// }
.table-column {
background-color: #000;
}
......
......@@ -675,7 +675,7 @@ function getData() {
::v-deep(.el-dialog) {
// background-color: #122953 !important;
background: url("@/assets/imgs/dialog-bgg.png") no-repeat center center;
background: url("@/assets/imgs/dialog-bg.png") no-repeat center center;
background-size: 100% 100%;
}
::v-deep(.el-dialog__header) {
......
......@@ -17,7 +17,7 @@
<!-- 正向开挖进度 -->
<div
v-if="dualType == 0 ? true : dxType == 20910 ? true : false"
class="progress-anim absolute left-0 top-0 bottom-0 bg-[url('@/assets/imgs/zx-progress1.png')] bg-cover"
class="progress-anim absolute left-0 top-0 bottom-0 bg-[url('@/assets/imgs/zx-progress.png')] bg-cover"
:style="{ width: `${zxProgress.toFixed(2)}%` }"
></div>
......
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