Переглянути джерело

表格样式优化;行选中优化

gzb
wangzhonglu 8 місяці тому
джерело
коміт
e3cf5dbdac

+ 6
- 3
src/assets/less/common.less Переглянути файл

@@ -63,11 +63,9 @@ body,
63 63
 .ivu-table {
64 64
   color: #798cb5;
65 65
   background-color: #ffffff66;
66
-  .ivu-table-header {
67
-    background-color: #e9f0ff;
68
-  }
69 66
   .ivu-table-header,
70 67
   .ivu-table-fixed-header {
68
+    background-color: #e9f0ff;
71 69
     thead tr {
72 70
       background-color: #e9f0ff;
73 71
       th {
@@ -78,6 +76,11 @@ body,
78 76
       }
79 77
     }
80 78
   }
79
+  .ivu-table-fixed-body {
80
+    .ivu-table-tbody {
81
+      background-color: #fff;
82
+    }
83
+  }
81 84
   .ivu-table-fixed .ivu-table-tbody tr,
82 85
   .ivu-table-fixed-right .ivu-table-tbody tr,
83 86
   .ivu-table-body .ivu-table-tbody tr {

+ 2
- 0
src/views/platformSection/deviceManage/deviceManageExport/deviceManageExport.vue Переглянути файл

@@ -136,6 +136,7 @@ export default {
136 136
       columns: [
137 137
         {
138 138
           title: "序号",
139
+          fixed: "left",
139 140
           align: "center",
140 141
           width: 70,
141 142
           render: (h, params) => {
@@ -197,6 +198,7 @@ export default {
197 198
         },
198 199
         {
199 200
           title: "操作",
201
+          fixed: "right",
200 202
           slot: "actionSlot",
201 203
           width: 90,
202 204
           align: "center"

+ 27
- 1
src/views/platformSection/deviceManage/deviceManageImport/detail.vue Переглянути файл

@@ -46,6 +46,7 @@
46 46
         :columns="columns"
47 47
         :data="searchForm.list"
48 48
         @on-selection-change="tableSelectionChange"
49
+        @on-row-click="tableRowClick"
49 50
       >
50 51
         <template slot-scope="{ row }" slot="snStateSlot">
51 52
           <div class="action_list">
@@ -54,7 +55,7 @@
54 55
           </div>
55 56
         </template>
56 57
         <template slot-scope="{ row }" slot="actionSlot">
57
-          <div class="action_list">
58
+          <div class="action_list" @click.stop>
58 59
             <div @click="toEdit(row)">编辑</div>
59 60
             <div class="action_del" @click="toDel(row)">删除</div>
60 61
           </div>
@@ -190,11 +191,13 @@ export default {
190 191
       columns: [
191 192
         {
192 193
           type: "selection",
194
+          fixed: "left",
193 195
           width: 60,
194 196
           align: "center"
195 197
         },
196 198
         {
197 199
           title: "序号",
200
+          fixed: "left",
198 201
           align: "center",
199 202
           width: 70,
200 203
           render: (h, params) => {
@@ -208,12 +211,14 @@ export default {
208 211
         },
209 212
         {
210 213
           title: "所属区域",
214
+          fixed: "left",
211 215
           minWidth: 150,
212 216
           key: "regionName",
213 217
           align: "center"
214 218
         },
215 219
         {
216 220
           title: "设备号",
221
+          fixed: "left",
217 222
           minWidth: 170,
218 223
           key: "sn",
219 224
           align: "center"
@@ -250,6 +255,7 @@ export default {
250 255
         },
251 256
         {
252 257
           title: "操作",
258
+          fixed: "right",
253 259
           slot: "actionSlot",
254 260
           width: 130,
255 261
           align: "center"
@@ -300,6 +306,26 @@ export default {
300 306
         };
301 307
       });
302 308
     },
309
+    // 表格行点击
310
+    tableRowClick(row, index) {
311
+      let otherSelectedList = this.batchDeleteList.filter((item) => {
312
+        return item.daid !== row.daid;
313
+      });
314
+      if (
315
+        (this.batchDeleteList.length > 0 &&
316
+          otherSelectedList.length === this.batchDeleteList.length) ||
317
+        this.batchDeleteList.length === 0
318
+      ) {
319
+        row._checked = true;
320
+        this.batchDeleteList.push({
321
+          daid: row.daid
322
+        });
323
+      } else {
324
+        row._checked = false;
325
+        this.batchDeleteList = otherSelectedList;
326
+      }
327
+      this.searchForm.list.splice(index, 1, row);
328
+    },
303 329
     // 获取列表
304 330
     getList() {
305 331
       this.batchDeleteList = [];

+ 4
- 0
src/views/regionSection/home/index.vue Переглянути файл

@@ -117,21 +117,25 @@ export default {
117 117
         },
118 118
         {
119 119
           title: "学校名称",
120
+          minWidth: 100,
120 121
           key: "schoolName",
121 122
           align: "center"
122 123
         },
123 124
         {
124 125
           title: "设备数",
126
+          width: 80,
125 127
           key: "devicenum",
126 128
           align: "center"
127 129
         },
128 130
         {
129 131
           title: "班级数",
132
+          width: 80,
130 133
           key: "classnum",
131 134
           align: "center"
132 135
         },
133 136
         {
134 137
           title: "用户数",
138
+          width: 80,
135 139
           key: "usernum",
136 140
           align: "center"
137 141
         }

+ 20
- 1
src/views/schoolSection/deviceManage/breakRuleDevice.vue Переглянути файл

@@ -44,9 +44,10 @@
44 44
         :columns="columns"
45 45
         :data="searchForm.list"
46 46
         @on-selection-change="selectionChange"
47
+        @on-row-click="deviceTableRowClick"
47 48
       >
48 49
         <template slot-scope="{ row }" slot="actionSlot">
49
-          <div class="action_list">
50
+          <div class="action_list" @click.stop>
50 51
             <div v-if="row.sn && row.num > 0" @click="toDetail(row)">
51 52
               违规详情
52 53
             </div>
@@ -444,6 +445,24 @@ export default {
444 445
     selectionChange(selection) {
445 446
       this.tableSelection = selection;
446 447
     },
448
+    // 表格行点击
449
+    deviceTableRowClick(row, index) {
450
+      let otherSelectedList = this.tableSelection.filter((item) => {
451
+        return item.sn !== row.sn;
452
+      });
453
+      if (
454
+        (this.tableSelection.length > 0 &&
455
+          otherSelectedList.length === this.tableSelection.length) ||
456
+        this.tableSelection.length === 0
457
+      ) {
458
+        row._checked = true;
459
+        this.tableSelection.push(row);
460
+      } else {
461
+        row._checked = false;
462
+        this.tableSelection = otherSelectedList;
463
+      }
464
+      this.searchForm.list.splice(index, 1, row);
465
+    },
447 466
     // 其他操作
448 467
     dropdownSelected(name) {
449 468
       if (!this.wsEnterInfo.isEnter) {

+ 30
- 7
src/views/schoolSection/deviceManage/deviceManage.vue Переглянути файл

@@ -84,6 +84,7 @@
84 84
           :columns="columns"
85 85
           :data="searchForm.list"
86 86
           @on-selection-change="selectionChange"
87
+          @on-row-click="deviceTableRowClick"
87 88
         >
88 89
           <template slot-scope="{ row }" slot="loginnameSlot">
89 90
             <!-- lockState锁定状态0未锁定1已锁定 -->
@@ -103,7 +104,7 @@
103 104
             </div>
104 105
           </template>
105 106
           <template slot-scope="{ row }" slot="actionSlot">
106
-            <div class="action_list">
107
+            <div class="action_list" @click.stop>
107 108
               <div v-if="row.sn" @click="toView(row)">查看</div>
108 109
               <div @click="toStrategy(row)">策略</div>
109 110
               <div v-if="row.sn" @click="toPsw(row)">设备密码</div>
@@ -653,11 +654,13 @@ export default {
653 654
       columns: [
654 655
         {
655 656
           type: "selection",
657
+          fixed: "left",
656 658
           width: 60,
657 659
           align: "center"
658 660
         },
659 661
         {
660 662
           title: "序号",
663
+          fixed: "left",
661 664
           align: "center",
662 665
           width: 70,
663 666
           render: (h, params) => {
@@ -671,6 +674,7 @@ export default {
671 674
         },
672 675
         {
673 676
           title: "登录账号",
677
+          fixed: "left",
674 678
           minWidth: 100,
675 679
           slot: "loginnameSlot",
676 680
           align: "center"
@@ -699,12 +703,12 @@ export default {
699 703
           key: "sn",
700 704
           align: "center"
701 705
         },
702
-        {
703
-          title: "Rom版本",
704
-          minWidth: 200,
705
-          key: "romVersion",
706
-          align: "center"
707
-        },
706
+        // {
707
+        //   title: "Rom版本",
708
+        //   minWidth: 200,
709
+        //   key: "romVersion",
710
+        //   align: "center"
711
+        // },
708 712
         {
709 713
           title: "更新时间",
710 714
           key: "updatetime",
@@ -713,6 +717,7 @@ export default {
713 717
         },
714 718
         {
715 719
           title: "操作",
720
+          fixed: "right",
716 721
           slot: "actionSlot",
717 722
           width: 275,
718 723
           align: "center"
@@ -1275,6 +1280,24 @@ export default {
1275 1280
     selectionChange(selection) {
1276 1281
       this.tableSelection = selection;
1277 1282
     },
1283
+    // 表格行点击
1284
+    deviceTableRowClick(row, index) {
1285
+      let otherSelectedList = this.tableSelection.filter((item) => {
1286
+        return item.sn !== row.sn;
1287
+      });
1288
+      if (
1289
+        (this.tableSelection.length > 0 &&
1290
+          otherSelectedList.length === this.tableSelection.length) ||
1291
+        this.tableSelection.length === 0
1292
+      ) {
1293
+        row._checked = true;
1294
+        this.tableSelection.push(row);
1295
+      } else {
1296
+        row._checked = false;
1297
+        this.tableSelection = otherSelectedList;
1298
+      }
1299
+      this.searchForm.list.splice(index, 1, row);
1300
+    },
1278 1301
     // 其他操作
1279 1302
     dropdownSelected(name) {
1280 1303
       if (!this.wsEnterInfo.isEnter) {

+ 2
- 2
src/views/schoolSection/setting/wallpaper.vue Переглянути файл

@@ -324,13 +324,13 @@ export default {
324 324
         },
325 325
         {
326 326
           title: "横屏壁纸",
327
-          minWidth: 150,
327
+          width: 150,
328 328
           slot: "hpathSlot",
329 329
           align: "center"
330 330
         },
331 331
         {
332 332
           title: "竖屏壁纸",
333
-          minWidth: 150,
333
+          width: 150,
334 334
           slot: "vpathSlot",
335 335
           align: "center"
336 336
         },

Завантаження…
Відмінити
Зберегти