Browse Source

安全指挥

zhangy 2 năm trước cách đây
mục cha
commit
6c74c97c34
1 tập tin đã thay đổi với 18 bổ sung11 xóa
  1. 18 11
      src/views/energyOperationSupport/components/securitys/pic2.vue

+ 18 - 11
src/views/energyOperationSupport/components/securitys/pic2.vue

@@ -76,7 +76,6 @@
         </el-button>
       </el-upload>
     </el-dialog>
-
     <el-dialog title="文件上传" :visible.sync="dialogVisible1" destroy-on-close width="15%" top="6vh" height="90%">
       <el-upload class="upload-demo" ref="upload1" action="" :http-request="beforeUpload" :loading="loading"
         :auto-upload="true">
@@ -106,7 +105,7 @@ const nodeType2Color = {
   600: "#BBDAFB",
 };
 //根据节点状态颜色
-const itemStatusColor = { 
+const itemStatusColor = {
   0: "#5B8FF9",
   100: "#EEBC20",
   200: "#5BD8A6",
@@ -117,6 +116,8 @@ export default {
 
   data() {
     return {
+      canvasWidth: 0, // 画布宽度
+      canvasHeight: 0 ,// 画布高度
       singleTableHeight: '720px',
       previewUrl: '',
       activeMenu: '',
@@ -441,14 +442,12 @@ export default {
       );
 
       const treeDiv = document.querySelector("#treeDiv");
-      const width = treeDiv.scrollWidth;
-      const height = treeDiv.scrollHeight || 800;
 
       graph = new TreeGraph({
         plugins: [menu, minimap, tooltip],
         container: "treeDiv",
-        width: window.innerWidth - 10,
-        height: window.innerHeight - 10,
+        width: window.innerWidth - 100,
+        height: window.innerHeight - 100,
         fitView: true,
         pixelRatio: 2,
         modes: {
@@ -509,7 +508,7 @@ export default {
             return 40;
           },
           getWidth: function getWidth() {
-            return 200;
+            return 150;
           },
           getVGap: function getVGap() {
             return 10;
@@ -534,7 +533,6 @@ export default {
         item.label = that.formatLabel(item.name);
       });
       graph.read(this.treeData);
-      graph.fitView();
 
       if (typeof window !== "undefined")
         window.onresize = () => {
@@ -1153,7 +1151,7 @@ export default {
     downloadFile(data) {
       let that = this;
       let SubmitData = {
-        fileName: data.fileName,
+        fileName: data.fileName,    
         fileUrl: data.fileUrl
       };
       // 不带token访问方式,留底后端修改shiroconfig.java,application.properties
@@ -1261,13 +1259,22 @@ export default {
 };
 </script>
 <style rel="stylesheet/scss" lang="scss" scoped>
+.root {
+  width: 100%;
+  height: 100%;
+  left: 0;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  position: absolute;
+}
 .minimap {
   position: absolute;
   top: 0;
   left: 0;
   z-index: 1;
-  border: 1px solid #ddd;
-  background-color: #fff;
+  border: 1px solid #994343;
+  background-color: #e0f0e9;
 }
 
 .container {