Browse Source

设备导出

gzb
guozhongbo 8 months ago
parent
commit
66d8b2c9ca

+ 12412
- 27
package-lock.json
File diff suppressed because it is too large
View File


+ 69
- 8
src/views/regionSection/log/deviceExport.vue View File

@@ -2,13 +2,18 @@
2 2
   <div class="main_root">
3 3
     <div class="search_header">
4 4
       <div class="search_left">
5
-        <Input
6
-          v-model="searchForm.name"
7
-          placeholder="请输入名称"
8
-          search
9
-          @on-search="searchList()"
10
-          style="width: 150px"
11
-        />
5
+        <div class="select">
6
+          <div class="title" @click.stop="headerTree">
7
+            {{ searchForm.title }}
8
+            <Icon type="ios-arrow-down" />
9
+          </div>
10
+          <div class="regintree" v-if="isshowtree">
11
+            <Tree
12
+              @on-select-change="getSelectedNodes"
13
+              :data="region_list"
14
+            ></Tree>
15
+          </div>
16
+        </div>
12 17
       </div>
13 18
       <Button type="primary" class="primary_btn" @click="toExport()"
14 19
         >导出</Button
@@ -51,11 +56,13 @@ export default {
51 56
     return {
52 57
       searchForm: {
53 58
         regionid: 0,
59
+        title: "所有区域",
54 60
         page: 1,
55 61
         size: 10,
56 62
         list: [],
57 63
         total: 0
58 64
       },
65
+      isshowtree: false,
59 66
       region_list: [],
60 67
       school_list: [],
61 68
       userInfo: {},
@@ -136,17 +143,33 @@ export default {
136 143
     this.init();
137 144
     this.searchList();
138 145
   },
146
+  mounted() {
147
+    window.addEventListener("click", () => {
148
+      this.isshowtree = false;
149
+    });
150
+  },
139 151
   methods: {
152
+    headerTree() {
153
+      //打开树形区域列表
154
+      this.isshowtree = true;
155
+    },
156
+    getSelectedNodes(data) {
157
+      this.searchForm.title = data[0].title;
158
+      this.searchForm.regionid = data[0].regionid;
159
+      this.searchList();
160
+    },
140 161
     init() {
141 162
       region_list_sel_tree({ regionid: this.powerParams.objectid }).then(
142 163
         (res) => {
143 164
           if (res.code === 0) {
165
+            this.setRegionList(res.obj[0]);
144 166
             this.region_list = res.obj;
145 167
             this.region_list.unshift({
146
-              regionName: "所有区域",
168
+              title: "所有区域",
147 169
               regionid: 0,
148 170
               children: []
149 171
             });
172
+
150 173
             console.log(this.region_list);
151 174
           } else {
152 175
             this.$Message.error(res.msg);
@@ -154,6 +177,15 @@ export default {
154 177
         }
155 178
       );
156 179
     },
180
+    setRegionList(node) {
181
+      node.title = node.regionName;
182
+      node.expand = true;
183
+      if (node.children && node.children.length > 0) {
184
+        for (let child of node.children) {
185
+          this.setRegionList(child);
186
+        }
187
+      }
188
+    },
157 189
     // 搜索
158 190
     searchList() {
159 191
       this.searchForm.page = 1;
@@ -203,6 +235,35 @@ export default {
203 235
     display: flex;
204 236
     justify-content: flex-start;
205 237
     align-items: center;
238
+    .select {
239
+      width: 200px;
240
+      height: 32px;
241
+      border-radius: 8px;
242
+      border: 1px solid #d8dce9;
243
+      line-height: 30px;
244
+      position: relative;
245
+      padding-left: 10px;
246
+      cursor: pointer;
247
+      .ivu-icon {
248
+        position: absolute;
249
+        top: 6px;
250
+        right: 10px;
251
+        font-size: 18px;
252
+      }
253
+    }
254
+    .regintree {
255
+      min-width: 200px;
256
+      height: 320px;
257
+      overflow-y: auto;
258
+      border-radius: 8px;
259
+      border: 1px solid #d8dce9;
260
+      position: absolute;
261
+      z-index: 10;
262
+      background-color: white;
263
+      top: 36px;
264
+      left: 0;
265
+      padding-left: 10px;
266
+    }
206 267
   }
207 268
 }
208 269
 </style>

+ 1
- 1
src/views/schoolSection/strategy/personalStrategy.vue View File

@@ -685,7 +685,7 @@ export default {
685 685
         if (res.code === 0) {
686 686
           this.stPadInfo = {
687 687
             show: true,
688
-            list: res.obj.map((v) => {
688
+            list: res.obj.data.map((v) => {
689 689
               v.checked = false;
690 690
               return v;
691 691
             }),

+ 1
- 1
src/views/schoolSection/strategy/publicStrategy.vue View File

@@ -550,7 +550,7 @@ export default {
550 550
         if (res.code === 0) {
551 551
           this.stPadInfo = {
552 552
             show: true,
553
-            list: res.obj.map((v) => {
553
+            list: res.obj.data.map((v) => {
554 554
               v.checked = false;
555 555
               return v;
556 556
             }),

Loading…
Cancel
Save