Przeglądaj źródła

Merge remote-tracking branch 'origin/gzb' into wzl

gzb
wangzhonglu 9 miesięcy temu
rodzic
commit
5922489616

+ 26
- 3
public/iconfont/demo_index.html Wyświetl plik

@@ -54,6 +54,12 @@
54 54
       <div class="content unicode" style="display: block;">
55 55
           <ul class="icon_lists dib-box">
56 56
           
57
+            <li class="dib">
58
+              <span class="icon iconfont">&#xe62b;</span>
59
+                <div class="name">三点</div>
60
+                <div class="code-name">&amp;#xe62b;</div>
61
+              </li>
62
+          
57 63
             <li class="dib">
58 64
               <span class="icon iconfont">&#xeb2a;</span>
59 65
                 <div class="name">时间</div>
@@ -234,9 +240,9 @@
234 240
 <pre><code class="language-css"
235 241
 >@font-face {
236 242
   font-family: 'iconfont';
237
-  src: url('iconfont.woff2?t=1712547599749') format('woff2'),
238
-       url('iconfont.woff?t=1712547599749') format('woff'),
239
-       url('iconfont.ttf?t=1712547599749') format('truetype');
243
+  src: url('iconfont.woff2?t=1713162473058') format('woff2'),
244
+       url('iconfont.woff?t=1713162473058') format('woff'),
245
+       url('iconfont.ttf?t=1713162473058') format('truetype');
240 246
 }
241 247
 </code></pre>
242 248
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@@ -262,6 +268,15 @@
262 268
       <div class="content font-class">
263 269
         <ul class="icon_lists dib-box">
264 270
           
271
+          <li class="dib">
272
+            <span class="icon iconfont icon-sandian"></span>
273
+            <div class="name">
274
+              三点
275
+            </div>
276
+            <div class="code-name">.icon-sandian
277
+            </div>
278
+          </li>
279
+          
265 280
           <li class="dib">
266 281
             <span class="icon iconfont icon-shijian"></span>
267 282
             <div class="name">
@@ -532,6 +547,14 @@
532 547
       <div class="content symbol">
533 548
           <ul class="icon_lists dib-box">
534 549
           
550
+            <li class="dib">
551
+                <svg class="icon svg-icon" aria-hidden="true">
552
+                  <use xlink:href="#icon-sandian"></use>
553
+                </svg>
554
+                <div class="name">三点</div>
555
+                <div class="code-name">#icon-sandian</div>
556
+            </li>
557
+          
535 558
             <li class="dib">
536 559
                 <svg class="icon svg-icon" aria-hidden="true">
537 560
                   <use xlink:href="#icon-shijian"></use>

+ 7
- 3
public/iconfont/iconfont.css Wyświetl plik

@@ -1,8 +1,8 @@
1 1
 @font-face {
2 2
   font-family: "iconfont"; /* Project id 4468064 */
3
-  src: url('iconfont.woff2?t=1712547599749') format('woff2'),
4
-       url('iconfont.woff?t=1712547599749') format('woff'),
5
-       url('iconfont.ttf?t=1712547599749') format('truetype');
3
+  src: url('iconfont.woff2?t=1713162473058') format('woff2'),
4
+       url('iconfont.woff?t=1713162473058') format('woff'),
5
+       url('iconfont.ttf?t=1713162473058') format('truetype');
6 6
 }
7 7
 
8 8
 .iconfont {
@@ -13,6 +13,10 @@
13 13
   -moz-osx-font-smoothing: grayscale;
14 14
 }
15 15
 
16
+.icon-sandian:before {
17
+  content: "\e62b";
18
+}
19
+
16 20
 .icon-shijian:before {
17 21
   content: "\eb2a";
18 22
 }

+ 1
- 1
public/iconfont/iconfont.js
Plik diff jest za duży
Wyświetl plik


+ 7
- 0
public/iconfont/iconfont.json Wyświetl plik

@@ -5,6 +5,13 @@
5 5
   "css_prefix_text": "icon-",
6 6
   "description": "",
7 7
   "glyphs": [
8
+    {
9
+      "icon_id": "766814",
10
+      "name": "三点",
11
+      "font_class": "sandian",
12
+      "unicode": "e62b",
13
+      "unicode_decimal": 58923
14
+    },
8 15
     {
9 16
       "icon_id": "5387666",
10 17
       "name": "时间",

BIN
public/iconfont/iconfont.ttf Wyświetl plik


BIN
public/iconfont/iconfont.woff Wyświetl plik


BIN
public/iconfont/iconfont.woff2 Wyświetl plik


+ 8
- 0
src/api/school.js Wyświetl plik

@@ -117,3 +117,11 @@ export const user_import = (data) => setRequest("user/import", data);
117 117
  * 3.2.6用户--获取班级sn
118 118
  */
119 119
 export const user_list_cs = (data) => setRequest("user/list_cs", data);
120
+/**
121
+ * 3.4.3班级--更新
122
+ */
123
+export const class_edit = (data) => setRequest("class/edit", data);
124
+/**
125
+ * 3.4.4班级--删除
126
+ */
127
+export const class_delete = (data) => setRequest("class/delete", data);

+ 1
- 0
src/views/login/login.vue Wyświetl plik

@@ -32,6 +32,7 @@
32 32
             oncopy="return false"
33 33
             onpaste="return false"
34 34
             oncut="return false"
35
+            :maxlength="16"
35 36
             v-model="loginForm.loginpwd"
36 37
             @keyup.enter.native="login_by_username('loginForm')"
37 38
             placeholder="请输入密码"

+ 197
- 89
src/views/regionSection/setting/wallpaper.vue Wyświetl plik

@@ -23,6 +23,11 @@
23 23
             <img v-if="row.hpath" :src="$api.showImageUrl + row.hpath" />
24 24
           </div>
25 25
         </template>
26
+        <template slot-scope="{ row }" slot="vpath">
27
+          <div class="hpath">
28
+            <img v-if="row.vpath" :src="$api.showImageUrl + row.vpath" />
29
+          </div>
30
+        </template>
26 31
         <template slot-scope="{ row }" slot="actionSlot">
27 32
           <div class="action_list">
28 33
             <div @click="toView(row)">查看</div>
@@ -66,29 +71,60 @@
66 71
             placeholder="请输入壁纸名称"
67 72
           ></Input>
68 73
         </FormItem>
69
-        <FormItem label="壁纸" style="width: 100%">
70
-          <div class="up">
71
-            <Upload
72
-              class="Upload"
73
-              action
74
-              :show-upload-list="false"
75
-              :before-upload="
76
-                (file) => {
77
-                  upLoad(file);
78
-                  return false;
79
-                }
80
-              "
81
-              accept=".png,.jpeg,.jpg,.gif"
82
-            >
83
-              <div v-if="wallpaperInfo.hpath" class="hpath">
84
-                <img :src="$api.showImageUrl + wallpaperInfo.hpath" />
85
-              </div>
86
-              <div v-else class="icon">
87
-                <Icon type="ios-cloud-upload-outline" size="42"></Icon>
88
-                <div>横屏壁纸</div>
89
-              </div>
90
-            </Upload>
91
-            <span>支持图片格式:jpg、jgeg、gif、png</span>
74
+        <FormItem label="壁纸" class="require" style="width: 100%">
75
+          <div class="wallpaper_upload_box">
76
+            <div class="wallpaper_h">
77
+              <Upload
78
+                action
79
+                :show-upload-list="false"
80
+                class="wallpaper_upload"
81
+                :before-upload="
82
+                  (file) => {
83
+                    upLoad(file, 1);
84
+                    return false;
85
+                  }
86
+                "
87
+                accept=".png,.jpeg,.jpg,.gif"
88
+              >
89
+                <div class="wallpaper_img_box" v-if="wallpaperInfo.hpath">
90
+                  <img :src="$api.showImageUrl + wallpaperInfo.hpath" />
91
+                </div>
92
+                <div v-else class="upload_tip">
93
+                  <div>
94
+                    <Icon type="ios-cloud-upload-outline" size="42"></Icon>
95
+                    <div>横屏壁纸</div>
96
+                  </div>
97
+                </div>
98
+              </Upload>
99
+            </div>
100
+            <div class="wallpaper_v">
101
+              <Upload
102
+                action
103
+                :show-upload-list="false"
104
+                class="wallpaper_upload"
105
+                :before-upload="
106
+                  (file) => {
107
+                    upLoad(file, 2);
108
+                    return false;
109
+                  }
110
+                "
111
+                accept=".png,.jpeg,.jpg,.gif"
112
+              >
113
+                <div class="wallpaper_img_box" v-if="wallpaperInfo.vpath">
114
+                  <img :src="$api.showImageUrl + wallpaperInfo.vpath" />
115
+                </div>
116
+                <div v-else class="upload_tip">
117
+                  <div>
118
+                    <Icon type="ios-cloud-upload-outline" size="42"></Icon>
119
+                    <div>竖屏壁纸</div>
120
+                  </div>
121
+                </div>
122
+              </Upload>
123
+            </div>
124
+            <div class="wallpaper_tip">
125
+              <div>支持格式:jpg、jpeg、gif、png</div>
126
+              <div>最大限制:2MB</div>
127
+            </div>
92 128
           </div>
93 129
         </FormItem>
94 130
         <FormItem label="适配类型" class="require" style="width: 100%">
@@ -121,11 +157,13 @@
121 157
       <div class="view_titles">{{ viewInfo.wname }}</div>
122 158
       <div class="view_content">
123 159
         <div class="view_title">壁纸效果</div>
124
-        <div class="hpath">
125
-          <img
126
-            v-if="viewInfo.hpath"
127
-            :src="$api.showImageUrl + viewInfo.hpath"
128
-          />
160
+        <div class="view_wallpaper_box">
161
+          <div class="view_img_box h" v-if="viewInfo.hpath">
162
+            <img :src="$api.showImageUrl + viewInfo.hpath" />
163
+          </div>
164
+          <div class="view_img_box v" v-if="viewInfo.vpath">
165
+            <img :src="$api.showImageUrl + viewInfo.vpath" />
166
+          </div>
129 167
         </div>
130 168
       </div>
131 169
       <div class="view_content" style="margin-top: 20px">
@@ -169,7 +207,6 @@ import {
169 207
   wallpaper_list_device,
170 208
   wallpaper_list_devicewp
171 209
 } from "@/api/setting";
172
-import { device_list } from "@/api/appgroup";
173 210
 export default {
174 211
   components: {
175 212
     CheckboxDevice
@@ -184,25 +221,17 @@ export default {
184 221
         list: [],
185 222
         total: 0
186 223
       },
187
-      // 新建
224
+      // 新建/编辑
188 225
       wallpaperInfo: {
189 226
         show: false,
190 227
         id: null,
191 228
         wname: "",
192 229
         hpath: "",
230
+        vpath: "",
193 231
         wlevel: "",
194 232
         objectid: "",
195 233
         deviceids: []
196 234
       },
197
-      // 编辑
198
-      modifyRegion: {
199
-        show: false,
200
-        regionid: null,
201
-        name: "",
202
-        regionCode: "",
203
-        comm: "",
204
-        rversion: null
205
-      },
206 235
       // 查看
207 236
       viewInfo: {
208 237
         show: false,
@@ -240,6 +269,11 @@ export default {
240 269
           slot: "hpath",
241 270
           align: "center"
242 271
         },
272
+        {
273
+          title: "竖屏壁纸",
274
+          slot: "vpath",
275
+          align: "center"
276
+        },
243 277
         {
244 278
           title: "壁纸名称",
245 279
           key: "wname",
@@ -295,17 +329,23 @@ export default {
295 329
         this.$Message.error(res.msg);
296 330
       }
297 331
     },
298
-    upLoad(file) {
332
+    upLoad(file, type) {
333
+      //type 1横屏 2竖屏
299 334
       let str = file.name.split(".");
335
+      let size = file.size / 1024 / 1024;
300 336
       let suffix = str[str.length - 1];
301 337
       suffix = suffix.toLowerCase();
302 338
       if (suffix !== "png" && suffix !== "jpeg" && suffix !== "jpg") {
303 339
         this.$Message.warning("请上传png、jpeg、jpg类型的文件");
304 340
         return false;
305 341
       }
342
+      if (size > 2) {
343
+        this.$Message.error("图片太大,不能超过2M!");
344
+        return false;
345
+      }
306 346
       let formData = new FormData();
307 347
       formData.append("file", file);
308
-      formData.append("savefolder", "app");
348
+      formData.append("savefolder", "wallpaper");
309 349
       formData.append("isrename", "1");
310 350
       let Url = this.$api.baseImageUrl + "up/upfile";
311 351
       this.showLoading = true;
@@ -316,7 +356,11 @@ export default {
316 356
         .then((res) => {
317 357
           this.showLoading = false;
318 358
           if (res.data.code === 0) {
319
-            this.wallpaperInfo.hpath = res.data.obj;
359
+            if (type === 1) {
360
+              this.wallpaperInfo.hpath = res.data.obj;
361
+            } else {
362
+              this.wallpaperInfo.vpath = res.data.obj;
363
+            }
320 364
             this.$Message.success(res.data.msg);
321 365
           } else {
322 366
             this.$Message.error(res.data.msg);
@@ -324,7 +368,7 @@ export default {
324 368
         })
325 369
         .catch(() => {
326 370
           this.showLoading = false;
327
-          this.$Message.error("图片上传失败");
371
+          this.$Message.error("壁纸上传失败");
328 372
         });
329 373
     },
330 374
     // 搜索
@@ -377,6 +421,7 @@ export default {
377 421
             id: null,
378 422
             wname: "",
379 423
             hpath: "",
424
+            vpath: "",
380 425
             wlevel: "",
381 426
             objectid: "",
382 427
             deviceids: []
@@ -401,8 +446,8 @@ export default {
401 446
             this.$Message.error("请选择设备!");
402 447
             return;
403 448
           }
404
-          if (!this.wallpaperInfo.hpath) {
405
-            this.$Message.error("请上传横屏壁纸!");
449
+          if (!this.wallpaperInfo.hpath && !this.wallpaperInfo.vpath) {
450
+            this.$Message.error("请上传壁纸!");
406 451
             return;
407 452
           }
408 453
           let api = this.wallpaperInfo.wallpaperid
@@ -411,6 +456,7 @@ export default {
411 456
           let form = {
412 457
             wname: this.wallpaperInfo.wname,
413 458
             hpath: this.wallpaperInfo.hpath,
459
+            vpath: this.wallpaperInfo.vpath,
414 460
             wlevel: 2,
415 461
             rtype: this.powerParams.rtype,
416 462
             objectid: this.powerParams.objectid,
@@ -426,6 +472,7 @@ export default {
426 472
             this.showLoading = false;
427 473
             if (data.code === 0) {
428 474
               this.wallpaperInfo.show = false;
475
+              this.init();
429 476
               this.searchList();
430 477
               this.$Message.success(data.msg);
431 478
             } else {
@@ -449,6 +496,7 @@ export default {
449 496
             show: true,
450 497
             wname: data.obj.wname,
451 498
             hpath: data.obj.hpath,
499
+            vpath: data.obj.vpath,
452 500
             devices: data.obj.devices
453 501
           };
454 502
         } else {
@@ -483,6 +531,7 @@ export default {
483 531
           wallpaperid: res.obj.wallpaperid,
484 532
           wname: res.obj.wname,
485 533
           hpath: res.obj.hpath,
534
+          vpath: res.obj.vpath,
486 535
           wlevel: res.obj.wlevel,
487 536
           objectid: res.obj.objectid,
488 537
           deviceids: res.obj.devices,
@@ -556,17 +605,32 @@ export default {
556 605
       flex: none;
557 606
       margin: 0 10px;
558 607
     }
559
-    .hpath {
560
-      width: 180px;
561
-      height: 120px;
562
-      border-radius: 8px;
563
-      overflow: hidden;
564
-      border: 3px solid #333333;
565
-      background-color: #f0f6fc;
566
-      img {
567
-        width: 100%;
568
-        height: 100%;
569
-        object-fit: cover;
608
+    .view_wallpaper_box {
609
+      display: flex;
610
+      justify-content: flex-start;
611
+      align-items: flex-end;
612
+      .view_img_box {
613
+        position: relative;
614
+        margin-right: 20px;
615
+        border-radius: 6px;
616
+        border: 5px solid #333;
617
+        background: #f0f6fc;
618
+        &.h {
619
+          width: 180px;
620
+          height: 120px;
621
+          img {
622
+            width: 100%;
623
+            height: 100%;
624
+          }
625
+        }
626
+        &.v {
627
+          width: 120px;
628
+          height: 180px;
629
+          img {
630
+            width: 100%;
631
+            height: 100%;
632
+          }
633
+        }
570 634
       }
571 635
     }
572 636
     .view_devices {
@@ -590,55 +654,99 @@ export default {
590 654
 
591 655
 .table_wrap {
592 656
   .hpath {
593
-    width: 100px;
594
-    height: 60px;
657
+    max-width: 100px;
658
+    max-height: 60px;
595 659
     margin: 10px auto;
596 660
     img {
597
-      width: 100%;
598
-      height: 100%;
599
-      object-fit: cover;
661
+      max-width: 100px;
662
+      max-height: 60px;
600 663
     }
601 664
   }
602 665
 }
603
-.up {
666
+.wallpaper_upload_box {
604 667
   display: flex;
605
-  .Upload {
606
-    width: 180px;
607
-    height: 120px;
608
-    border-radius: 8px;
609
-    border: 3px solid #333333;
610
-    background-color: #f0f6fc;
611
-    display: flex;
612
-    align-items: center;
613
-    justify-content: center;
614
-    cursor: pointer;
615
-    .icon {
616
-      color: #b8c2d9;
617
-      text-align: center;
618
-    }
668
+  justify-content: flex-start;
669
+  align-items: flex-start;
670
+  .wallpaper_h {
671
+    position: relative;
672
+    margin-top: 60px;
673
+    margin-right: 50px;
674
+    width: 190px;
675
+    height: 130px;
676
+    border-radius: 6px;
677
+    opacity: 1;
678
+    border: 5px solid #333;
679
+    background: #f0f6fc;
619 680
     &:hover {
620 681
       background: #eaf5ff;
621
-      .icon {
622
-        color: #339cff;
682
+      .upload_tip {
683
+        color: #339cff !important;
623 684
       }
624 685
     }
625
-    .hpath {
686
+    .wallpaper_upload {
626 687
       width: 180px;
627 688
       height: 120px;
628
-      border-radius: 8px;
629
-      overflow: hidden;
630
-      padding: 3px;
631
-      img {
632
-        width: 100%;
633
-        height: 100%;
634
-        object-fit: cover;
689
+      cursor: pointer;
690
+      .wallpaper_img_box {
691
+        width: 180px;
692
+        height: 120px;
693
+        img {
694
+          width: 100%;
695
+          height: 100%;
696
+        }
697
+      }
698
+      .upload_tip {
699
+        display: flex;
700
+        justify-content: center;
701
+        align-items: center;
702
+        width: 180px;
703
+        height: 120px;
704
+        text-align: center;
705
+        color: #b8c2d9;
635 706
       }
636 707
     }
637 708
   }
638
-  span {
639
-    margin-left: 20px;
640
-    color: #7c8db5;
709
+  .wallpaper_v {
710
+    position: relative;
711
+    margin-right: 20px;
712
+    width: 130px;
713
+    height: 190px;
714
+    border-radius: 6px;
715
+    opacity: 1;
716
+    border: 5px solid #333;
717
+    background: #f0f6fc;
718
+    &:hover {
719
+      background: #eaf5ff;
720
+      .upload_tip {
721
+        color: #339cff !important;
722
+      }
723
+    }
724
+    .wallpaper_upload {
725
+      width: 120px;
726
+      height: 180px;
727
+      cursor: pointer;
728
+      .wallpaper_img_box {
729
+        width: 120px;
730
+        height: 180px;
731
+        img {
732
+          width: 100%;
733
+          height: 100%;
734
+        }
735
+      }
736
+      .upload_tip {
737
+        display: flex;
738
+        justify-content: center;
739
+        align-items: center;
740
+        width: 120px;
741
+        height: 180px;
742
+        text-align: center;
743
+        color: #b8c2d9;
744
+      }
745
+    }
746
+  }
747
+  .wallpaper_tip {
641 748
     font-size: 16px;
749
+    color: #7c8db5;
642 750
   }
643 751
 }
644 752
 </style>

+ 63
- 24
src/views/schoolSection/setting/wallpaper.vue Wyświetl plik

@@ -8,7 +8,13 @@
8 8
         @on-search="searchList()"
9 9
         style="width: 150px"
10 10
       />
11
-      <Button type="primary" class="primary_btn" @click="toAdd()">新建</Button>
11
+      <Button
12
+        type="primary"
13
+        v-if="add_has === 1"
14
+        class="primary_btn"
15
+        @click="toAdd()"
16
+        >新建</Button
17
+      >
12 18
     </div>
13 19
     <div class="table_wrap">
14 20
       <Table :columns="columns" :data="searchForm.list">
@@ -283,13 +289,17 @@ import {
283 289
   wallpaper_add,
284 290
   wallpaper_edit,
285 291
   wallpaper_detail,
286
-  wallpaper_delete
292
+  wallpaper_delete,
293
+  wallpaper_list_device,
294
+  wallpaper_list_devicewp,
295
+  wallpaper_add_has
287 296
 } from "@/api/setting";
288 297
 import { device_list } from "@/api/appgroup";
289 298
 export default {
290 299
   data() {
291 300
     return {
292 301
       userInfo: {},
302
+      add_has: false,
293 303
       searchForm: {
294 304
         name: "",
295 305
         page: 1,
@@ -385,6 +395,7 @@ export default {
385 395
     this.userInfo = JSON.parse(
386 396
       localStorage.getItem("xh_control_userInfo")
387 397
     ).content;
398
+    this.init();
388 399
     this.searchList();
389 400
   },
390 401
   computed: {
@@ -393,6 +404,18 @@ export default {
393 404
     }
394 405
   },
395 406
   methods: {
407
+    async init() {
408
+      //是否显示添加按钮
409
+      let res = await wallpaper_add_has({
410
+        wlevel: 3,
411
+        objectid: this.powerParams.objectid
412
+      });
413
+      if (res.code === 0) {
414
+        this.add_has = res.obj;
415
+      } else {
416
+        this.$Message.error(res.msg);
417
+      }
418
+    },
396 419
     // 搜索
397 420
     searchList() {
398 421
       this.searchForm.page = 1;
@@ -432,24 +455,30 @@ export default {
432 455
     },
433 456
     // 新建
434 457
     toAdd() {
435
-      this.wallpaperInfo = {
436
-        show: true,
437
-        wallpaperid: null,
438
-        rversion: null,
439
-        wname: "",
440
-        hpath: "",
441
-        hLoading: false,
442
-        vpath: "",
443
-        vLoading: false,
444
-        // 2区域3学校
458
+      wallpaper_list_device({
445 459
         wlevel: 3,
446
-        // 对应的区域/学校ID
447
-        objectid: this.powerParams.objectid,
448
-        deviceids: [],
449
-        deviceList: []
450
-      };
451
-      this.getDeviceList().then((list) => {
452
-        this.wallpaperInfo.deviceList = list;
460
+        objectid: this.powerParams.objectid
461
+      }).then((res) => {
462
+        if (res.code === 0) {
463
+          this.wallpaperInfo = {
464
+            show: true,
465
+            wallpaperid: null,
466
+            rversion: null,
467
+            wname: "",
468
+            hpath: "",
469
+            hLoading: false,
470
+            vpath: "",
471
+            vLoading: false,
472
+            // 2区域3学校
473
+            wlevel: 3,
474
+            // 对应的区域/学校ID
475
+            objectid: this.powerParams.objectid,
476
+            deviceids: [],
477
+            deviceList: res.obj
478
+          };
479
+        } else {
480
+          this.$Message.error(res.msg);
481
+        }
453 482
       });
454 483
     },
455 484
     // 获取设备列表
@@ -603,6 +632,9 @@ export default {
603 632
             this.$Message.error("请上传壁纸");
604 633
             return;
605 634
           }
635
+          if (this.wallpaperInfo.deviceids.length === 0) {
636
+            this.$Message.error("请选择设备!");
637
+          }
606 638
           this.wallpaperInfo.show = false;
607 639
           let form = {
608 640
             rtype: this.powerParams.rtype,
@@ -623,6 +655,7 @@ export default {
623 655
               : wallpaper_add;
624 656
           api(form).then((data) => {
625 657
             if (data.code === 0) {
658
+              this.init();
626 659
               this.searchList();
627 660
               this.$Message.success(data.msg);
628 661
             } else {
@@ -658,7 +691,16 @@ export default {
658 691
       });
659 692
     },
660 693
     // 编辑
661
-    toEdit(row) {
694
+    async toEdit(row) {
695
+      //获取选择设备包含自己
696
+      let res1 = await wallpaper_list_devicewp({
697
+        wlevel: this.powerParams.rtype,
698
+        objectid: this.powerParams.objectid,
699
+        wallpaperid: row.wallpaperid
700
+      });
701
+      if (res1.code != 0) {
702
+        this.$Message.error(res1.msg);
703
+      }
662 704
       this.wallpaperInfo = {
663 705
         show: true,
664 706
         wallpaperid: row.wallpaperid,
@@ -673,7 +715,7 @@ export default {
673 715
         // 对应的区域/学校ID
674 716
         objectid: row.objectid,
675 717
         deviceids: [],
676
-        deviceList: []
718
+        deviceList: res1.obj
677 719
       };
678 720
       this.getWallpaperDetail(row.wallpaperid).then((data) => {
679 721
         if (data) {
@@ -686,9 +728,6 @@ export default {
686 728
           this.wallpaperInfo.deviceids = _deviceids;
687 729
         }
688 730
       });
689
-      this.getDeviceList().then((list) => {
690
-        this.wallpaperInfo.deviceList = list;
691
-      });
692 731
     },
693 732
     getWallpaperDetail(wallpaperid) {
694 733
       return new Promise((resolve) => {

+ 2
- 0
src/views/schoolSection/strategy/publicStrategy.vue Wyświetl plik

@@ -532,6 +532,8 @@ export default {
532 532
                 arr.length > 0 ? arr[0].handleMethod.split(";") : [];
533 533
             });
534 534
           }
535
+          //刷新左侧树
536
+          this.$emit("refresh");
535 537
           this.curState = 2; //编辑状态
536 538
           this.stPadInfo.show = false;
537 539
         } else {

+ 4
- 2
src/views/schoolSection/strategy/strategyManage.vue Wyświetl plik

@@ -116,12 +116,14 @@ export default {
116 116
         if (res.code === 0) {
117 117
           this.schoolInfo = res.obj;
118 118
           this.schoolInfo.schoolid = this.schoolInfo.id;
119
-          this.curClass = this.schoolInfo;
120
-          if (this.schoolInfo.children.length > 0 && !this.curClass.id) {
119
+          if (this.schoolInfo.children.length > 0) {
121 120
             this.schoolInfo.children.forEach((item) => {
122 121
               item.schoolid = this.schoolInfo.id;
123 122
             });
124 123
           }
124
+          if (!this.curClass.id) {
125
+            this.curClass = this.schoolInfo;
126
+          }
125 127
           this.strategy = this.strategy ? this.strategy : 1; //渲染页面
126 128
         } else {
127 129
           this.$Message.error(res.msg);

+ 190
- 2
src/views/schoolSection/userManage/userManage.vue Wyświetl plik

@@ -16,6 +16,7 @@
16 16
         <div v-for="item in schoolInfo.children" :key="item.id">
17 17
           <div
18 18
             :class="[
19
+              'class_item',
19 20
               curClass.id === item.id && curClass.type === item.type
20 21
                 ? 'active'
21 22
                 : ''
@@ -25,6 +26,10 @@
25 26
           >
26 27
             {{ item.name }}
27 28
           </div>
29
+          <span
30
+            @click="toOpenMenu(item, $event)"
31
+            class="ivu-icon iconfont icon-sandian"
32
+          ></span>
28 33
         </div>
29 34
       </div>
30 35
     </div>
@@ -138,6 +143,45 @@
138 143
         ></Page>
139 144
       </div>
140 145
     </div>
146
+    <!-- 更多菜单弹窗 -->
147
+    <div
148
+      class="more_menu"
149
+      ref="moreMenuRef"
150
+      @mousedown.stop
151
+      @contextmenu.stop.prevent
152
+      @mousewheel.stop
153
+    >
154
+      <div @click="toSelectMenuItem(1)" class="menu_group">编辑</div>
155
+      <div @click="toSelectMenuItem(2)" class="menu_group">删除</div>
156
+    </div>
157
+    <!-- 编辑班级 -->
158
+    <Modal
159
+      v-model="classInfo.show"
160
+      :mask-closable="false"
161
+      class="modal_tip"
162
+      title="编辑"
163
+    >
164
+      <Form
165
+        v-if="classInfo.show"
166
+        ref="classInfo"
167
+        :model="classInfo"
168
+        :rules="rules"
169
+        :label-width="110"
170
+      >
171
+        <FormItem label="班级名称" prop="classname">
172
+          <Input
173
+            v-model.trim="classInfo.classname"
174
+            placeholder="请输入班级名称"
175
+          ></Input>
176
+        </FormItem>
177
+      </Form>
178
+      <div slot="footer" style="text-align: right">
179
+        <Button @click="exitInfo.show = false">取消</Button>
180
+        <Button @click="saveclassInfo()" type="primary" class="primary_btn"
181
+          >保存</Button
182
+        >
183
+      </div>
184
+    </Modal>
141 185
     <!-- 已存在列表 -->
142 186
     <Modal
143 187
       v-model="exitInfo.show"
@@ -321,6 +365,8 @@
321 365
 
322 366
 <script>
323 367
 import {
368
+  class_delete,
369
+  class_edit,
324 370
   class_list,
325 371
   user_care,
326 372
   user_delete,
@@ -333,9 +379,26 @@ import {
333 379
 } from "@/api/school";
334 380
 import { user_add, user_edit } from "@/api/school";
335 381
 import { exportToExcel } from "@/utils/exportToExcel";
336
-import { generateRandomString, pwdCheck, reg} from "@/utils";
382
+import { generateRandomString, pwdCheck, reg } from "@/utils";
337 383
 export default {
338 384
   data() {
385
+    const classnameCheck = async (rule, value, callback) => {
386
+      if (value) {
387
+        let flag = this.schoolInfo.children.some((v) => {
388
+          return (
389
+            v.name === this.classInfo.classname &&
390
+            v.id != this.classInfo.classid
391
+          );
392
+        });
393
+        if (flag) {
394
+          return callback(new Error("班级名称已存在!"));
395
+        } else {
396
+          callback();
397
+        }
398
+      } else {
399
+        return callback(new Error("班级名称不能为空!"));
400
+      }
401
+    };
339 402
     // 重复密码验证
340 403
     const pwdAgainCheck = async (rule, value, callback) => {
341 404
       if (!reg.test(value)) {
@@ -417,6 +480,13 @@ export default {
417 480
         cardid: ""
418 481
       },
419 482
       rules: {
483
+        classname: [
484
+          {
485
+            required: true,
486
+            validator: classnameCheck,
487
+            trigger: "blur"
488
+          }
489
+        ],
420 490
         username: [
421 491
           {
422 492
             required: true,
@@ -508,6 +578,8 @@ export default {
508 578
           align: "center"
509 579
         }
510 580
       ],
581
+      classInfo: {},
582
+      selectedModel: {},
511 583
       schoolInfo: {
512 584
         children: [],
513 585
         name: ""
@@ -527,6 +599,91 @@ export default {
527 599
     this.searchList();
528 600
   },
529 601
   methods: {
602
+    saveclassInfo() {
603
+      this.$refs.classInfo.validate((valid) => {
604
+        if (valid) {
605
+          this.showLoading = true;
606
+          class_edit({
607
+            classid: this.classInfo.classid,
608
+            classname: this.classInfo.classname,
609
+            rversion: this.classInfo.rversion
610
+          }).then((res) => {
611
+            this.showLoading = false;
612
+            if (res.code === 0) {
613
+              if (this.classInfo.classid === this.curClass.id) {
614
+                this.curClass.name = this.classInfo.classname;
615
+              }
616
+              this.classInfo.show = false;
617
+              this.init();
618
+              this.$Message.success(res.msg);
619
+            } else {
620
+              this.$Message.error(res.msg);
621
+            }
622
+          });
623
+        }
624
+      });
625
+    },
626
+    toSelectMenuItem(type) {
627
+      this.removeMoreMenu();
628
+      //type 1编辑 2删除
629
+      if (type === 1) {
630
+        this.classInfo = {
631
+          show: true,
632
+          classid: this.selectedModel.id,
633
+          rversion: this.selectedModel.rversion,
634
+          classname: this.selectedModel.name
635
+        };
636
+      } else {
637
+        this.$Modal.confirm({
638
+          title: "提示",
639
+          content: "您确定删除【" + this.selectedModel.name + "】吗?",
640
+          onOk: () => {
641
+            class_delete({
642
+              classid: this.selectedModel.id,
643
+              rversion: this.selectedModel.rversion
644
+            }).then((res) => {
645
+              if (res.code === 0) {
646
+                this.init();
647
+                this.$Message.success(res.msg);
648
+              } else {
649
+                this.$Message.error(res.msg);
650
+              }
651
+            });
652
+          },
653
+          onCancel: () => {}
654
+        });
655
+      }
656
+    },
657
+    // 打开弹窗菜单
658
+    toOpenMenu(Item, event) {
659
+      this.selectClass(Item);
660
+      if (!this.$refs.moreMenuRef) {
661
+        return;
662
+      }
663
+      this.selectedModel = Item;
664
+      let _clientX = event.clientX;
665
+      let _clientY = event.clientY;
666
+      this.$refs.moreMenuRef.style.display = `block`;
667
+      this.$nextTick(() => {
668
+        let _bodyHeight = document.body.clientHeight;
669
+        let _domHeight = this.$refs.moreMenuRef.getBoundingClientRect().height;
670
+        this.$refs.moreMenuRef.style.left = `${_clientX - 105}px`;
671
+        if (_clientY + _domHeight > _bodyHeight) {
672
+          this.$refs.moreMenuRef.style.top = `${_bodyHeight - _domHeight}px`;
673
+        } else {
674
+          this.$refs.moreMenuRef.style.top = `${_clientY}px`;
675
+        }
676
+      });
677
+    },
678
+    // 隐藏弹窗菜单
679
+    removeMoreMenu() {
680
+      if (!this.$refs.moreMenuRef) {
681
+        return;
682
+      }
683
+      this.$refs.moreMenuRef.style.display = `none`;
684
+      this.$refs.moreMenuRef.style.left = `-9999px`;
685
+      this.$refs.moreMenuRef.style.top = `-9999px`;
686
+    },
530 687
     classChange() {
531 688
       if (this.schoolInfo.children.length === 0) {
532 689
         return;
@@ -767,7 +924,9 @@ export default {
767 924
         this.showLoading = false;
768 925
         if (res.code === 0) {
769 926
           this.schoolInfo = res.obj;
770
-          this.curClass = res.obj;
927
+          if (!this.curClass.id) {
928
+            this.curClass = res.obj;
929
+          }
771 930
         } else {
772 931
           this.$Message.error(res.msg);
773 932
         }
@@ -846,6 +1005,19 @@ export default {
846 1005
         height: 30px;
847 1006
         text-align: center;
848 1007
         cursor: pointer;
1008
+        position: relative;
1009
+        .icon-sandian {
1010
+          display: none;
1011
+        }
1012
+        &:hover {
1013
+          .icon-sandian {
1014
+            display: block;
1015
+            position: absolute;
1016
+            top: 4px;
1017
+            right: 6px;
1018
+            font-size: 24px;
1019
+          }
1020
+        }
849 1021
       }
850 1022
     }
851 1023
     .active {
@@ -945,4 +1117,20 @@ export default {
945 1117
     }
946 1118
   }
947 1119
 }
1120
+.more_menu {
1121
+  width: 100px;
1122
+  text-align: center;
1123
+  background: #ffffff;
1124
+  box-shadow: 0 8px 30px 0 #bcc9e380;
1125
+  border-radius: 10px;
1126
+  border: none;
1127
+  .menu_group {
1128
+    height: 35px;
1129
+    line-height: 35px;
1130
+    cursor: pointer;
1131
+    &:hover {
1132
+      background-color: #dbeeffcc;
1133
+    }
1134
+  }
1135
+}
948 1136
 </style>

Ładowanie…
Anuluj
Zapisz