Procházet zdrojové kódy

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

yunxing před 4 roky
rodič
revize
cafaefdbe3

+ 20 - 0
src/App.vue

@@ -190,6 +190,26 @@ body ::-webkit-scrollbar-thumb:vertical:hover {
   border: 1px solid #e6e6e6;
 }
 
+#app{
+    //meri-design组件select的字体颜色
+    /deep/ .p-select-fakePlaceholder {
+        span {
+            span {
+                color: #606266 !important;
+                font-size: 13px;
+                font-weight: normal;
+            }
+        }
+    }
+    //element 分页组件背景色
+    /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active{
+        background:linear-gradient(180deg,rgba(54,156,247,1) 0%,rgba(2,91,170,1) 100%);
+    }
+    //element button 
+   /deep/ .el-button--primary,.p-button-primary{
+      background:linear-gradient(180deg,rgba(54,156,247,1) 0%,rgba(2,91,170,1) 100%);
+   }
+}
 .clearfix::after {
   content: ".";
   display: block;

+ 0 - 12
src/views/equipment/index.vue

@@ -343,16 +343,4 @@ export default {
         white-space: nowrap;
     }
 }
-#equipment {
-    //meri-design组件select的字体颜色
-    /deep/ .p-select-fakePlaceholder {
-        span {
-            span {
-                color: #606266 !important;
-                font-size: 13px;
-                font-weight: normal;
-            }
-        }
-    }
-}
 </style>

+ 28 - 22
src/views/legendLibrary/addForm.vue

@@ -42,7 +42,7 @@
             <div v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
                 <div style='color:#646C73'>展示预览</div>
                 <div class='input-right' ref='graph'>
-                    <canvas id='canvas' :width='canvasWidth' :height='canvasHeight' v-show='!ruleForm.Url'></canvas>
+                    <canvas id='canvas' :width='canvasWidth' :height='canvasHeight'></canvas>
                 </div>
             </div>
         </div>
@@ -243,7 +243,6 @@ export default {
             var reader = new FileReader()
             reader.readAsDataURL(this.file)
             reader.onload = e => {
-                console.log(this.view)
                 this.view.url = e.target.result
             }
         },
@@ -304,9 +303,11 @@ export default {
             this.view.strokecolor = this.ruleForm.Color
             this.view.lineType = this.ruleForm.LineDash
             this.view.lineWidth = this.ruleForm.LineWidth
-            if (this.ruleForm.Url) {
+            if (this.ruleForm.Url && type == 2) {
                 let url = `/serve/topology-wanda/Picture/query/${this.ruleForm.Url}`
                 this.view.url = url
+            } else {
+                this.view.url = ''
             }
         },
         initGraph() {
@@ -458,16 +459,15 @@ export default {
                     if (res.Result == 'success') {
                         this.$set(vm.ruleForm, 'Url', res.EntityList[0])
                         this.$message.success('图标上传成功!')
-                        // if (this.title == '添加图例库') {
-                        //     this.create()
-                        //     this.$emit('addSuccess')
-                        //     this.view.canvas.clearRect(0, 0, this.width, this.height)
-                        // } else if (this.title == '修改图例库') {
-                        //     this.update()
-                        //     this.$emit('updateSuccess')
-                        //     this.view.canvas.clearRect(0, 0, this.width, this.height)
-                        // } else {
-                        // }
+                        if (this.title == '添加图例库') {
+                            this.create()
+                            this.$emit('addSuccess')
+                            this.view.canvas.clearRect(0, 0, this.width, this.height)
+                        } else if (this.title == '修改图例库') {
+                            this.update()
+                            this.$emit('updateSuccess')
+                            this.view.canvas.clearRect(0, 0, this.width, this.height)
+                        } 
                     }
                 })
             }
@@ -544,16 +544,22 @@ export default {
             this.changeLineType(this.ruleForm.LineDash)
             this.initGraph()
         }
+    },
+    watch:{
+        'ruleForm.Id':{
+            handler(){
+                this.initQueryDeviceAndPOsition()
+                this.visualization()
+                if (this.title == '修改图例库') {
+                    if (this.ruleForm.Type != 'Image') {
+                        this.changeLineWidth(this.ruleForm.LineWidth)
+                        this.changeLineType(this.ruleForm.LineDash)
+                    }
+                    this.initGraph()
+                }
+            }
+        }
     }
-    // updated() {
-    //     this.initQueryDeviceAndPOsition()
-    //     this.visualization()
-    //     if (this.title == '修改图例库') {
-    //         this.changeLineWidth(this.ruleForm.LineWidth)
-    //         this.changeLineType(this.ruleForm.LineDash)
-    //         this.initGraph()
-    //     }
-    // }
 }
 </script>
 

+ 11 - 11
src/views/legendLibrary/addLegend.vue

@@ -122,7 +122,6 @@ export default {
                 this.info = row
                 this.InfosList = []
                 this.InfoTypeIdList = []
-
                 // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
                 this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id }) => id)] : []
                 this.InfoTypeIdList = row.InfoTypeId
@@ -167,6 +166,15 @@ export default {
             this.$emit('addSuccess')
             this.cancal()
         },
+        isCreateOrUpdate(){
+            if (this.title == '添加图例库') {
+                this.$refs.add.create()
+                this.$emit('addSuccess')
+            } else if (this.title == '修改图例库') {
+                this.$refs.add.update()
+                this.$emit('updateSuccess')
+            }
+        },
         save() {
             // FillColor,Color,Name
             if (this.info.Name == '') {
@@ -175,18 +183,10 @@ export default {
             } else {
                 if (this.info.Type != 'None') {
                     this.$refs.add.saveImg()
-                } 
-                if (this.title == '添加图例库') {
-                    this.$refs.add.create()
-                    this.$emit('addSuccess')
-                } else if (this.title == '修改图例库') {
-                    this.$refs.add.update()
-                    this.$emit('updateSuccess')
+                }else{
+                    this.isCreateOrUpdate()
                 }
                 this.dialogVisible = false
-                // if (!this.title || this.info.Type == 'None') {
-                //     this.$refs.add.create()
-                // }
             }
         },
         treeConfirm(ids, dataObj) {