Browse Source

修改bug

shaun-sheep 4 years ago
parent
commit
9f3218f713
2 changed files with 55 additions and 15 deletions
  1. 18 2
      src/views/legendLibrary/addForm.vue
  2. 37 13
      src/views/legendLibrary/index.vue

+ 18 - 2
src/views/legendLibrary/addForm.vue

@@ -100,6 +100,7 @@
                     :choseArea='true'
                     :data='deviceList'
                     @change='treeConfirmDevice'
+                    :hideClear='true'
                 />
 
                 <!-- <TreeSelect
@@ -124,6 +125,7 @@
                     :data='typeVisualization'
                     @change='treeConfirm'
                     @focusChange='focusChange'
+                    :hideClear='true'
                 />
             </div>
         </div>
@@ -389,8 +391,22 @@ export default {
         },
         visualization() {
             getVisualization({}).then(res => {
-                this.typeVisualization = res.Data && res.Data.map(i => this.getTree(i))
-                console.log(this.typeVisualization)
+                this.typeVisualization =
+                    res.Data &&
+                    res.Data.map(i => {
+                        return {
+                            id: i.Id,
+                            name: i.Name,
+                            children: i.Children
+                                ? i.Children.map(j => {
+                                      return {
+                                          id: j.Id,
+                                          name: j.Id + '-' + j.Name
+                                      }
+                                  })
+                                : []
+                        }
+                    })
             })
         },
         getTree(data) {

+ 37 - 13
src/views/legendLibrary/index.vue

@@ -32,18 +32,20 @@
                     @change='treeConfirmPosition'
                     :hideClear='true'
                 />
-                <TreeSelect
-                    caption='专业/设备、位置类型:'
-                    tipPlace='top'
-                    width='250'
-                    style='margin:0 12px'
-                    :returnParentNode='false'
-                    :isShowAllChoice='true'
-                    :choseArea='true'
-                    :data='deviceList'
-                    :hideClear='true'
-                    @change='treeConfirmDevice'
-                />
+                <span class='device-position'>
+                    <TreeSelect
+                        caption='专业/设备、位置类型:'
+                        tipPlace='top'
+                        width='300'
+                        style='margin:0 12px'
+                        :returnParentNode='false'
+                        :isShowAllChoice='true'
+                        :choseArea='true'
+                        :data='deviceList'
+                        :hideClear='true'
+                        @change='treeConfirmDevice'
+                    />
+                </span>
 
                 <!-- <TreeSelect
                     caption='专业:'
@@ -232,7 +234,22 @@ export default {
         },
         visualization() {
             getVisualization({}).then(res => {
-                this.typeVisualization = res.Data && res.Data.map(i => this.getTree(i))
+                this.typeVisualization =
+                    res.Data &&
+                    res.Data.map(i => {
+                        return {
+                            id: i.Id,
+                            name: i.Name,
+                            children: i.Children
+                                ? i.Children.map(j => {
+                                      return {
+                                          id: j.Id,
+                                          name: j.Id + '-' + j.Name
+                                      }
+                                  })
+                                : []
+                        }
+                    })
             })
         },
         getTree(data) {
@@ -393,6 +410,13 @@ export default {
     /deep/ .p-select-input-content {
         line-height: 32px;
     }
+    .device-position {
+        /deep/ .p-date-picker-caption {
+            display: block;
+            width: 200px !important;
+            max-width: 200px !important;
+        }
+    }
 }
 </style>
 <style lang="less">