Browse Source

提交demo

YaolongHan 4 years ago
parent
commit
ef80ecf688
5 changed files with 684 additions and 1197 deletions
  1. 3 3
      package.json
  2. 4 464
      src/api/plan.js
  3. 503 467
      src/components/basePlan.vue
  4. 168 257
      src/views/Home.vue
  5. 6 6
      vue.config.js

+ 3 - 3
package.json

@@ -9,9 +9,9 @@
   },
   "dependencies": {
     "@persagy-web/base": "2.2.1",
-    "@persagy-web/big": "2.2.43",
-    "@persagy-web/draw": "2.2.10",
-    "@persagy-web/graph": "2.2.40",
+    "@persagy-web/big": "2.2.48",
+    "@persagy-web/draw": "2.2.12",
+    "@persagy-web/graph": "2.2.44",
     "axios": "^0.21.0",
     "core-js": "^3.6.5",
     "vue": "^2.6.11",

+ 4 - 464
src/api/plan.js

@@ -20,467 +20,7 @@ export function readPubGroup(postParams) {
     // return httputils.postJson(`/labsl/graph/pub/read`, postParams)
     return axios.post(`${window.topo_baseurl}/labsl/graph/pub/read`, postParams);
 }
-
-// 读取系统图状态
-export function readDeviceStatus(postParams) {
-    if (false) {
-        return new Promise((resolve, reject) => {
-            resolve({
-                result: "Success",
-                reason: "",
-                content: [
-                    {
-                        objectId: "Eq11010500292ef58cce08f14400ba8a59eef8aeeed1",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002900b49e50f37b4a7093cb458f8e0e70cb",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500290236905f8e404dd194caba72c18ee4f7",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029038aeb94f6bb403c8e61c2522e229428",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002906b496d1972d4bfd943d7041184dfa62",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002906e7061c52b346e38d82e595b4e8ad57",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500291885405e72d74f94a99e83333a3ad1ba",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002918fc7920901d46b9b9de47a879bf0a15",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500292a45259335684970bfb0947b57575fe5",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500293162f7813d2e4fcd88208e239939779a",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500293276dd9793df4c9d95443d45fdbc4d38",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500293eecc87a3aa24b43b0118a859576f921",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029489dacec7c9d48f8a0d1cd55d57b21fc",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500294b3a67de47494743bda953995bb2a44f",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500294db52b9408e2465081a6575b690789d0",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029511114ca135b4c2fab6b1b763c8ba84d",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500296049a991c6c84e5ea986fdf47b6dc430",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002968b7001eee83465184279a2de33d5f05",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500296bc83cfc489f4476a7b2fb430858f8d5",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002973a82c3453874739b086ba58de67ebd4",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500297a75138745cb416d91e5b0e7708ed16b",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500297a946a5029c3436b8d37324780131cbf",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500297c40c0dd42aa4a0283210d655040119b",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029814dbdbd01f14f2a9b824d99f5787107",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029831e56776cc541868db4d1b73d97a62e",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002984730605552146e7b86a4d2f652a43db",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002985439a25f15244d3bf2c035b12031cbb",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq110105002985def8013f824614935efc06e4f42ba1",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029927bb343e9e543cab5978a07a795a185",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029984a8acc66f94a6793b47b553f33449f",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq11010500299b115c5d30b6491586a2bc7395a365d4",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029a242f4a954bb46dfa1db7be5b5499123",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029aab5ecc924404f2197442f7db6a96277",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029ac2242d5ca3d49f88737ae7b1779b819",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029ac437b5f6388403798014edd8358347c",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029b4665f0959af42fd9af6e2b8fc42589a",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029b95972a00da24117a920495ab0a7b1ec",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029b9b55d6e5aa1465b8d0f1b48d4d2e6ac",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029c91bcb8540544ad09642856e2e800b08",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029cbc5709e424948399b7b2206433c35ed",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029d13490e84dc2462a9479416d7874d0dc",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029d571ea8454634336958fd497d2a64a33",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029da7586ee57a9438d896cfd0cce934ea3",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029dfaa4f674e0b443fb62010de77691fea",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029e7240a9357b245a79fa28074aa413e43",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029e9418f9666f0442fb5e4a61b4233f467",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029e97ccf08db434484be755a249f554de7",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029e9a859867fe44c44a7b6119c7daf452a",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029ea79ee69b4dc471d9aa8791091e0dc0b",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029ea8927b06d8946939fd0969a73a41412",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029ebb829fe0445489996717d8097711695",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029f5c911f289b441e688dabc0199890b40",
-                        status: 2,
-                        status_name: "关",
-                    },
-                    {
-                        objectId: "Eq1101050029fe6434f1925e4ef1b090a9baf2a29870",
-                        status: 2,
-                        status_name: "关",
-                    },
-                ],
-                totalCount: 0,
-            });
-        });
-    }
-    return httputils.postJson(`${window._url}/api/common/GetEquipmentRunningStateList`, postParams);
-}
-
-// 读取某个系统图 运行参数
-export function readDeviceParams(postParams) {
-    if (false) {
-        let data = {
-            result: "Success",
-            reason: "",
-            content: [
-                {
-                    firstTag: "运行参数",
-                    infoCode: "inCloudStatus",
-                    infoName: "云端控制状态",
-                    data: "0",
-                    dataType: "BOOLEAN",
-                    meterId: "ACATAH_0_inCloudStatus",
-                    funcId: "901",
-                    dataSource: [
-                        {
-                            code: "0",
-                            name: "非云端",
-                        },
-                        {
-                            code: "1",
-                            name: "云端",
-                        },
-                    ],
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "returnAirTemp",
-                    infoName: "回风温度",
-                    data: "0.69",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_returnAirTemp",
-                    funcId: "901",
-                    unit: "℃",
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "onlineStatus",
-                    infoName: "在线状态",
-                    data: "0",
-                    dataType: "BOOLEAN",
-                    meterId: "ACATAH_0_onlineStatus",
-                    funcId: "901",
-                    dataSource: [
-                        {
-                            code: "0",
-                            name: "离线",
-                        },
-                        {
-                            code: "1",
-                            name: "在线",
-                        },
-                    ],
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "faultStatus",
-                    infoName: "故障状态",
-                    data: "0",
-                    dataType: "BOOLEAN",
-                    meterId: "ACATAH_0_faultStatus",
-                    funcId: "901",
-                    dataSource: [
-                        {
-                            code: "0",
-                            name: "正常",
-                        },
-                        {
-                            code: "1",
-                            name: "故障",
-                        },
-                    ],
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "returnAirRH",
-                    infoName: "回风相对湿度",
-                    data: "0.7",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_returnAirRH",
-                    funcId: "901",
-                    unit: "%RH",
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "returnAirValveOpening",
-                    infoName: "回风阀开度",
-                    data: "0.7",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_returnAirValveOpening",
-                    funcId: "901",
-                    unit: "%",
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "manualAutoStatus",
-                    infoName: "手自动状态",
-                    data: "0",
-                    dataType: "BOOLEAN",
-                    meterId: "ACATAH_0_manualAutoStatus",
-                    funcId: "901",
-                    dataSource: [
-                        {
-                            code: "0",
-                            name: "手动",
-                        },
-                        {
-                            code: "1",
-                            name: "自动",
-                        },
-                    ],
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "chillWaterValveOpening",
-                    infoName: "冷水阀开度",
-                    data: "0.7",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_chillWaterValveOpening",
-                    funcId: "901",
-                    unit: "%",
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "supplyAirTemp",
-                    infoName: "送风温度",
-                    data: "0.69",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_supplyAirTemp",
-                    funcId: "901",
-                    unit: "℃",
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "runStatus",
-                    infoName: "运行状态",
-                    data: "0",
-                    dataType: "BOOLEAN",
-                    meterId: "ACATAH_0_runStatus",
-                    funcId: "901",
-                    dataSource: [
-                        {
-                            code: "0",
-                            name: "停止",
-                        },
-                        {
-                            code: "1",
-                            name: "运行",
-                        },
-                    ],
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "freshAirValveOpening",
-                    infoName: "新风阀开度",
-                    data: "0.7",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_freshAirValveOpening",
-                    funcId: "901",
-                    unit: "%",
-                },
-                {
-                    firstTag: "运行参数",
-                    infoCode: "chillWaterOutTemp",
-                    infoName: "冷水出口温度",
-                    data: "0.69",
-                    dataType: "DOUBLE",
-                    meterId: "ACATAH_0_chillWaterOutTemp",
-                    funcId: "901",
-                    unit: "℃",
-                },
-            ],
-            totalCount: 0,
-        };
-        // return data
-        return new Promise((resolve, reject) => {
-            resolve(data);
-        });
-    }
-    return httputils.postJson(window._url + `/api/common/FindRuntimeDatas`, postParams);
-}
+// 已发布 - 查询平面图信息
+export function pubPlanerQuery(postParams) {
+    return httputils.postJson(`/labsl/planar/graph/pub/query`, postParams);
+}

File diff suppressed because it is too large
+ 503 - 467
src/components/basePlan.vue


+ 168 - 257
src/views/Home.vue

@@ -1,295 +1,206 @@
 <template>
-    <div class="persagyPlan">
-        <basePlan @onMousedown="onMousedown" @postDeviceIds="postDeviceIds" ref="planEl"></basePlan>
-        <tooltip ref="tooltip_map" v-show="showtip" class="toolTip">
-            <div class="title">
-                {{ this.tooltipName }}
-            </div>
-            <div class="tip-body">
-                <div class="info">
-                    <p v-for="(item, index) in device_params" :key="index">
-                        <span class="label">{{ item.infoName }}:</span>
-                        <span class="value">{{ showData(item) }}</span>
-                        <span class="unit">{{ item.unit }}</span>
-                    </p>
-                </div>
-            </div>
-            <div class="tip-footer">查看设备详情</div>
-        </tooltip>
-    </div>
+  <div class="persagyPlan">
+    <basePlan @onMousedown="onMousedown" ref="planEl"></basePlan>
+    <tooltip ref="tooltip_map" v-show="showtip" class="toolTip">
+      <div class="title">
+        {{ this.tooltipName }}
+      </div>
+      <div class="tip-body">
+        <div class="info">
+          <p v-for="(item, index) in device_params" :key="index">
+            <span class="label">{{ item.infoName }}:</span>
+            <span class="value">{{ showData(item) }}</span>
+            <span class="unit">{{ item.unit }}</span>
+          </p>
+        </div>
+      </div>
+      <div class="tip-footer">查看设备详情</div>
+    </tooltip>
+  </div>
 </template>
 <script>
-import { readPubGroup, readDeviceParams, readDeviceStatus } from "@/api/plan"; // 引入获取底图得接口
+import { readPubGroup, readDeviceStatus, pubPlanerQuery } from "@/api/plan"; // 引入获取底图得接口
 import basePlan from "@/components/basePlan.vue";
 import tooltip from "@/components/tooltip.vue";
 export default {
-    components: { basePlan, tooltip },
-    data() {
-        return {
-            showtip: false,
-            tooltipName: "",
-            device_params: [],
-            deviceIds: [],
-            graphId: "e4c6b131ced74032b02b5721cb496b77",
-            id: "ad1195f2492f41e3a06f792d6701365c",
-        };
-    },
-    mounted() {
-        let _this = this;
-        let canvasEl = document.getElementsByTagName("canvas")[0];
-        window._resizeTimer = null;
-        window.addEventListener("resize", () => {
-            clearTimeout(window._resizeTimer);
-            window._resizeTimer = setTimeout(() => {
-                canvasEl.height = document.body.clientHeight;
-                canvasEl.width = document.body.clientWidth;
-                _this.$refs.planEl.fixWindow();
-            }, 50);
-        });
-    },
-    beforeMount() {
-        let searchStr = window.location.search.substr(1);
-        // 设备
-        // searchStr =
-        //     'projectId=Pj1101050029&&buildingId=Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6&floorId=Fl11010500295de391e3e5564ce58003c7e5391dc5e4&id=c57264b1252245e6b2713f1cbb9c4148&graphId=cbe7180ead0f420782acf1c39382319a&floorMap=base/ebd53bb00d3511eb9a1db95f725712e8.jsonz'
+  components: { basePlan, tooltip },
+  data() {
+    return {
+      showtip: false,
+      tooltipName: "",
+      device_params: [],
+      deviceIds: [],
+      graphId: "e4c6b131ced74032b02b5721cb496b77",
+      id: "ad1195f2492f41e3a06f792d6701365c",
+    };
+  },
+  created() {
+    this.pubPlanerQuery();
+  },
+  mounted() {
+    let _this = this;
 
-        // 设备 + 空间
-        searchStr =
-            "projectId=Pj1101050029&&buildingId=Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6&floorId=Fl1101050029f18b92c5ceaf408d893e257bf03692df&id=0234df7a9a7b40dca38358b7e0a71ce9&graphId=e43a9c03d9bb482ca96b3b545735be35&floorMap=base/a5f453020d4111eb9a1d57eee76e51f1.jsonz";
-        // buildingId=Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6&floorId=Fl1101050029f18b92c5ceaf408d893e257bf03692df&name=%E5%BE%88%E8%B4%B9%E5%8A%B2&id=0234df7a9a7b40dca38358b7e0a71ce9&graphId=e43a9c03d9bb482ca96b3b545735be35&version=1.1.1&floorMap=base%2Fa5f453020d4111eb9a1d57eee76e51f1.jsonz
-        // 项目id,建筑id,楼层id,图id,图graphId,底图floorMap
-        const params = this.queryURLParams(searchStr);
-        Object.entries(params).map((arr) => {
-            this[arr[0]] = arr[1];
-            window[`_${arr[0]}`] = arr[1];
-        });
-        console.log(params);
-        // console.log("here");
-        // console.log("id:", this.id);
-        // console.log("graphId:", this.graphId);
-        // console.log("url:", this.url);
-        // console.log("projectId:", this.projectId);
-    },
+    // 自适应
+    let canvasEl = document.getElementsByTagName("canvas")[0];
+    window._resizeTimer = null;
+    window.addEventListener("resize", () => {
+      clearTimeout(window._resizeTimer);
+      window._resizeTimer = setTimeout(() => {
+        canvasEl.height = document.body.clientHeight;
+        canvasEl.width = document.body.clientWidth;
+        _this.$refs.planEl.fixWindow();
+      }, 50);
+    });
+  },
+  beforeMount() {
+    // 获取图对应参数
+    let searchStr = window.location.search.substr(1);
+    // 设备
+    // searchStr =
+    //     'projectId=Pj1101050029&&buildingId=Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6&floorId=Fl11010500295de391e3e5564ce58003c7e5391dc5e4&id=c57264b1252245e6b2713f1cbb9c4148&graphId=cbe7180ead0f420782acf1c39382319a&floorMap=base/ebd53bb00d3511eb9a1db95f725712e8.jsonz'
 
-    methods: {
-        /**
-         * 查询url参数
-         */
-        queryURLParams(url) {
-            let obj = {};
-            url.replace(/([^?=&#]+)=([^?=&#]+)/g, (_, key, value) => (obj[key] = value));
-            url.replace(/#([^?=&#]+)/g, (_, hash) => (obj["HASH"] = hash));
-            return obj;
-        },
-        postDeviceIds(ids) {
-            this.deviceIds = ids;
-            if (ids.length > 0) {
-                readDeviceStatus({ objectIds: ids }).then((res) => {
-                    // console.log('res')
-                    // console.log(res)
-                    window.parse.nodes.forEach((nodeItem) => {
-                        let sItem = res.content.find((_item) => {
-                            return _item.objectId == nodeItem._data.attachObjectIds[0];
-                        });
+    // 设备 + 空间
+    searchStr =
+      // "projectId=Pj1101050029&&buildingId=Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6&floorId=Fl1101050029f18b92c5ceaf408d893e257bf03692df&id=0234df7a9a7b40dca38358b7e0a71ce9&graphId=e43a9c03d9bb482ca96b3b545735be35&floorMap=base/a5f453020d4111eb9a1d57eee76e51f1.jsonz";
+      "projectId=Pj4403070003&&buildingId=Bd4403070003b5858fefad1a4d1586d38910e99dd140&floorId=Fl44030700030232b37b40f84312932da8cb6046698a&id=0234df7a9a7b40dca38358b7e0a71ce9&graphId=e43a9c03d9bb482ca96b3b545735be35&floorMap=base/2a00d9e248f811eba46a2b6533ccab6d.jsonz";
+    // buildingId=Bd1101050029cb77fbd1846611eaac87cd1cd6a961c6&floorId=Fl1101050029f18b92c5ceaf408d893e257bf03692df&name=%E5%BE%88%E8%B4%B9%E5%8A%B2&id=0234df7a9a7b40dca38358b7e0a71ce9&graphId=e43a9c03d9bb482ca96b3b545735be35&version=1.1.1&floorMap=base%2Fa5f453020d4111eb9a1d57eee76e51f1.jsonz
+    // 项目id,建筑id,楼层id,图id,图graphId,底图floorMap
+    const params = this.queryURLParams(searchStr);
+    Object.entries(params).map((arr) => {
+      this[arr[0]] = arr[1];
+      window[`_${arr[0]}`] = arr[1];
+    });
+    console.log(params);
+  },
 
-                        // if(sItem == null){
-                        //   sItem = res.content[0]
-                        // }
-                        let key = null;
-                        /**
-             *  0: 灰
-                1:蓝
-                2:红
-                3:黄
-                4:绿
-                5:棕
-             *
-             */
-                        if (sItem) {
-                            switch (sItem.status) {
-                                case 0:
-                                    // 空
-                                    key = 0;
-                                    break;
-                                case 1:
-                                    // 运行
-                                    key = 1;
-                                    break;
-                                case 2:
-                                    // 关闭
-                                    key = 0;
-                                    break;
-                                default:
-                                    break;
-                            }
-                            let picUrl = nodeItem._data.properties.state.find((item) => {
-                                return item.state == key;
-                            }).pic;
-                            if (nodeItem.__picUrl && nodeItem.__picUrl == picUrl) {
-                            } else {
-                                nodeItem.__picUrl = picUrl;
-                                nodeItem.url = window.img_baseurl + "/image-service/common/image_get?systemId=dataPlatform&key=" + picUrl;
-                                // nodeItem.url ='/dp-auxiliary/image-service/common/image_get?systemId=dataPlatform&key='+picUrl
-                            }
-                        }
-                    });
-                });
-            }
-        },
-        showData(item) {
-            if (item.dataSource) {
-                return item.dataSource.find((item) => {
-                    return item.code == "0";
-                }).name;
-            } else {
-                return item.data;
-            }
-        },
-        onMousedown(item, e) {
-            let time = new Date().getTime();
-            window._now = console.log("item:", item);
-            setTimeout(() => {
-                if (item) {
-                    clearTimeout(window._caller);
-                    let operationType = "click";
-                    console.log(111);
-                    this.showtip = true;
-                    this.tooltipName = "test";
-                    this.device_params = [
-                        {
-                            infoName: "hhh",
-                            unit: "g",
-                        },
-                    ];
-                    this.$refs.tooltip_map.$el.style.left = e[0].offsetX + "px";
-                    this.$refs.tooltip_map.$el.style.top = e[0].offsetY + "px";
-                    return;
-                    let deviceId = item.data.attachObjectIds[0];
-                    if (window._now) {
-                        let diff = time - window._now;
-                        console.log("diff:", diff);
-                        if (diff < 400) {
-                            operationType = "dbclick";
-                            // 双击
-                        } else {
-                            // 单击
-                        }
-                    }
-                    window._now = time;
-                    if (operationType == "click") {
-                        // 单击
-                        window._caller = setTimeout(() => {
-                            readDeviceParams({ objectId: deviceId }).then((res) => {
-                                this.tooltipName = item.data.name;
-                                this.device_params = res.content;
-                                this.$refs.tooltip_map.$el.style.left = e[0].offsetX + "px";
-                                this.$refs.tooltip_map.$el.style.top = e[0].offsetY + "px";
-                                this.showtip = true;
-                            });
-                        }, 300);
-                    } else {
-                        // 双击
-                        try {
-                            window.postMsgToU3d(JSON.stringify({ time: new Date(), data: { deviceId: deviceId } }));
-                        } catch (error) {
-                            console.error("to u3d error", error);
-                        }
-                    }
-                } else {
-                    this.showtip = false;
-                }
-            }, 200);
-        },
+  methods: {
+    // 查询平面图信息
 
-        // 移入
-        onMousedownx(item, e) {
-            // return false;
+    pubPlanerQuery() {
+      id = "ec53d14a461149988ff1790087cc9994"; //广场id
+      const data = {
+        filters: `folderId=${id}`,
+        PageNumber: 1,
+        PageSize: 1000,
+      };
+      pubPlanerQuery(data).then((res) => {
+        console.log("res", res);
+      });
+    },
+
+    /**
+     * 查询url参数
+     */
+    queryURLParams(url) {
+      let obj = {};
+      url.replace(
+        /([^?=&#]+)=([^?=&#]+)/g,
+        (_, key, value) => (obj[key] = value)
+      );
+      url.replace(/#([^?=&#]+)/g, (_, hash) => (obj["HASH"] = hash));
+      return obj;
+    },
+    showData(item) {
+      if (item.dataSource) {
+        return item.dataSource.find((item) => {
+          return item.code == "0";
+        }).name;
+      } else {
+        return item.data;
+      }
+    },
+    onMousedown(item, e) {
+      if (item) {
+        this.showtip = !this.showtip;
+        if (!e[0].offsetX) return;
+        this.$refs.tooltip_map.$el.style.left = e[0].offsetX + "px";
+        this.$refs.tooltip_map.$el.style.top = e[0].offsetY + "px";
+      } else {
+        this.showtip = false;
+      }
+    },
 
-            let deviceId = item.data.attachObjectIds[0];
-            let res = readDeviceParams(deviceId);
-            this.tooltipName = item.data.name;
-            this.device_params = res.content;
-            this.showtip = true;
-            console.log(e[0].offsetX + "px");
-            this.$refs.tooltip_map.$el.style.left = e[0].offsetX + "px";
-            this.$refs.tooltip_map.$el.style.top = e[0].offsetY + "px";
-        },
+    // 移入
+    onMousedownx(item, e) {
+      return false;
     },
+  },
 };
 </script>
 <style lang="less">
 .persagyPlan {
-    padding: 6 px 10px 6px 10px;
-    width: 100%;
-    height: 100%;
-    overflow: hidden;
+  padding: 6 px 10px 6px 10px;
+  width: 100%;
+  height: 100%;
+  overflow: hidden;
 }
 .title {
-    padding: 10px 16px;
-    line-height: 22px;
-    color: #ebeef5;
-    font-size: 16px;
-    font-weight: 600;
+  padding: 10px 16px;
+  line-height: 22px;
+  color: #ebeef5;
+  font-size: 16px;
+  font-weight: 600;
 }
 .toolTip {
-    min-width: 40px;
-    box-shadow: 0px 2px 4px 0px rgba(31, 36, 41, 0.1);
-    border: 1px solid #5d6177;
-    // padding: 6px 10px 6px 10px;
-    position: absolute;
-    border-radius: 8px;
-    box-shadow: 0px 1px 13px rgba(0, 0, 0, 0.189549), 0px 1px 11px rgba(0, 0, 0, 0.5);
+  min-width: 40px;
+  box-shadow: 0px 2px 4px 0px rgba(31, 36, 41, 0.1);
+  border: 1px solid #5d6177;
+  // padding: 6px 10px 6px 10px;
+  position: absolute;
+  border-radius: 8px;
+  box-shadow: 0px 1px 13px rgba(0, 0, 0, 0.189549),
+    0px 1px 11px rgba(0, 0, 0, 0.5);
 }
 .tip-body {
-    border-top: 1px solid #5d6177;
-    border-bottom: 1px solid #5d6177;
+  border-top: 1px solid #5d6177;
+  border-bottom: 1px solid #5d6177;
 }
 .info {
-    padding: 16px;
-    max-height: 280px;
-    overflow: auto;
-    line-height: 29px;
-    span {
-        color: #a7abc0;
-    }
-    .value {
-        color: #fff;
-        // margin-left: 12px;
-    }
-    .unit {
-        margin-left: 0;
-    }
+  padding: 16px;
+  max-height: 280px;
+  overflow: auto;
+  line-height: 29px;
+  span {
+    color: #a7abc0;
+  }
+  .value {
+    color: #fff;
+    // margin-left: 12px;
+  }
+  .unit {
+    margin-left: 0;
+  }
 }
 .tip-footer {
-    width: 100%;
-    height: 50px;
-    line-height: 50px;
-    font-size: 16px;
-    text-align: center;
-    color: #a7abc0;
-    transition: background-color 0.3s;
-    cursor: pointer;
-    &:hover {
-        color: #fff;
-        background-color: rgba(0, 145, 255, 0.295974);
-    }
+  width: 100%;
+  height: 50px;
+  line-height: 50px;
+  font-size: 16px;
+  text-align: center;
+  color: #a7abc0;
+  transition: background-color 0.3s;
+  cursor: pointer;
+  &:hover {
+    color: #fff;
+    background-color: rgba(0, 145, 255, 0.295974);
+  }
 }
 
 ::-webkit-scrollbar {
-    width: 6px;
-    height: 6px;
+  width: 6px;
+  height: 6px;
 }
 
 ::-webkit-scrollbar-track {
-    border-radius: 0;
+  border-radius: 0;
 }
 
 ::-webkit-scrollbar-thumb {
-    background-color: #21262f;
-    border-radius: 3px;
+  background-color: #21262f;
+  border-radius: 3px;
 
-    &:hover {
-        background-color: #21262f;
-    }
+  &:hover {
+    background-color: #21262f;
+  }
 }
 </style>

+ 6 - 6
vue.config.js

@@ -3,21 +3,21 @@ module.exports = {
         hot: true,
         proxy: {
             '/labsl': {
-                // target: 'http://39.102.40.239:8080',
-                target: 'http://60.205.177.43:28888',
+                target: 'http://39.102.40.239:8080',
+                // target: 'http://60.205.177.43:28888',
                 changeOrigin: true,
                 secure: false,
             },
             '/equip-component': {
-                // target: 'http://39.102.40.239:8080',
-                target: 'http://60.205.177.43:28888',
+                target: 'http://39.102.40.239:8080',
+                // target: 'http://60.205.177.43:28888',
                 changeOrigin: true,
                 secure: false,
             },
             // 图片服务器
             '/image-service': {
-                // target: 'http://39.102.40.239',
-                target: "http://39.97.179.199:8891",
+                target: 'http://39.102.40.239',
+                // target: "http://39.97.179.199:8891",
                 changeOrigin: true,
                 secure: false,
             }