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
   <div class="main_root">
2
   <div class="main_root">
3
     <div class="search_header">
3
     <div class="search_header">
4
       <div class="search_left">
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
       </div>
17
       </div>
13
       <Button type="primary" class="primary_btn" @click="toExport()"
18
       <Button type="primary" class="primary_btn" @click="toExport()"
14
         >导出</Button
19
         >导出</Button
51
     return {
56
     return {
52
       searchForm: {
57
       searchForm: {
53
         regionid: 0,
58
         regionid: 0,
59
+        title: "所有区域",
54
         page: 1,
60
         page: 1,
55
         size: 10,
61
         size: 10,
56
         list: [],
62
         list: [],
57
         total: 0
63
         total: 0
58
       },
64
       },
65
+      isshowtree: false,
59
       region_list: [],
66
       region_list: [],
60
       school_list: [],
67
       school_list: [],
61
       userInfo: {},
68
       userInfo: {},
136
     this.init();
143
     this.init();
137
     this.searchList();
144
     this.searchList();
138
   },
145
   },
146
+  mounted() {
147
+    window.addEventListener("click", () => {
148
+      this.isshowtree = false;
149
+    });
150
+  },
139
   methods: {
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
     init() {
161
     init() {
141
       region_list_sel_tree({ regionid: this.powerParams.objectid }).then(
162
       region_list_sel_tree({ regionid: this.powerParams.objectid }).then(
142
         (res) => {
163
         (res) => {
143
           if (res.code === 0) {
164
           if (res.code === 0) {
165
+            this.setRegionList(res.obj[0]);
144
             this.region_list = res.obj;
166
             this.region_list = res.obj;
145
             this.region_list.unshift({
167
             this.region_list.unshift({
146
-              regionName: "所有区域",
168
+              title: "所有区域",
147
               regionid: 0,
169
               regionid: 0,
148
               children: []
170
               children: []
149
             });
171
             });
172
+
150
             console.log(this.region_list);
173
             console.log(this.region_list);
151
           } else {
174
           } else {
152
             this.$Message.error(res.msg);
175
             this.$Message.error(res.msg);
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
     searchList() {
190
     searchList() {
159
       this.searchForm.page = 1;
191
       this.searchForm.page = 1;
203
     display: flex;
235
     display: flex;
204
     justify-content: flex-start;
236
     justify-content: flex-start;
205
     align-items: center;
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
 </style>
269
 </style>

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

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

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

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

Loading…
Cancel
Save