Browse Source

平板策略引用优化

gzb
guozhongbo 9 months ago
parent
commit
551d52db38

+ 26
- 3
public/iconfont/demo_index.html View File

54
       <div class="content unicode" style="display: block;">
54
       <div class="content unicode" style="display: block;">
55
           <ul class="icon_lists dib-box">
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
             <li class="dib">
63
             <li class="dib">
58
               <span class="icon iconfont">&#xeb2a;</span>
64
               <span class="icon iconfont">&#xeb2a;</span>
59
                 <div class="name">时间</div>
65
                 <div class="name">时间</div>
234
 <pre><code class="language-css"
240
 <pre><code class="language-css"
235
 >@font-face {
241
 >@font-face {
236
   font-family: 'iconfont';
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
 </code></pre>
247
 </code></pre>
242
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
248
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
262
       <div class="content font-class">
268
       <div class="content font-class">
263
         <ul class="icon_lists dib-box">
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
           <li class="dib">
280
           <li class="dib">
266
             <span class="icon iconfont icon-shijian"></span>
281
             <span class="icon iconfont icon-shijian"></span>
267
             <div class="name">
282
             <div class="name">
532
       <div class="content symbol">
547
       <div class="content symbol">
533
           <ul class="icon_lists dib-box">
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
             <li class="dib">
558
             <li class="dib">
536
                 <svg class="icon svg-icon" aria-hidden="true">
559
                 <svg class="icon svg-icon" aria-hidden="true">
537
                   <use xlink:href="#icon-shijian"></use>
560
                   <use xlink:href="#icon-shijian"></use>

+ 7
- 3
public/iconfont/iconfont.css View File

1
 @font-face {
1
 @font-face {
2
   font-family: "iconfont"; /* Project id 4468064 */
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
 .iconfont {
8
 .iconfont {
13
   -moz-osx-font-smoothing: grayscale;
13
   -moz-osx-font-smoothing: grayscale;
14
 }
14
 }
15
 
15
 
16
+.icon-sandian:before {
17
+  content: "\e62b";
18
+}
19
+
16
 .icon-shijian:before {
20
 .icon-shijian:before {
17
   content: "\eb2a";
21
   content: "\eb2a";
18
 }
22
 }

+ 1
- 1
public/iconfont/iconfont.js
File diff suppressed because it is too large
View File


+ 7
- 0
public/iconfont/iconfont.json View File

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

BIN
public/iconfont/iconfont.ttf View File


BIN
public/iconfont/iconfont.woff View File


BIN
public/iconfont/iconfont.woff2 View File


+ 8
- 0
src/api/school.js View File

117
  * 3.2.6用户--获取班级sn
117
  * 3.2.6用户--获取班级sn
118
  */
118
  */
119
 export const user_list_cs = (data) => setRequest("user/list_cs", data);
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 View File

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

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

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

+ 4
- 2
src/views/schoolSection/strategy/strategyManage.vue View File

116
         if (res.code === 0) {
116
         if (res.code === 0) {
117
           this.schoolInfo = res.obj;
117
           this.schoolInfo = res.obj;
118
           this.schoolInfo.schoolid = this.schoolInfo.id;
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
             this.schoolInfo.children.forEach((item) => {
120
             this.schoolInfo.children.forEach((item) => {
122
               item.schoolid = this.schoolInfo.id;
121
               item.schoolid = this.schoolInfo.id;
123
             });
122
             });
124
           }
123
           }
124
+          if (!this.curClass.id) {
125
+            this.curClass = this.schoolInfo;
126
+          }
125
           this.strategy = this.strategy ? this.strategy : 1; //渲染页面
127
           this.strategy = this.strategy ? this.strategy : 1; //渲染页面
126
         } else {
128
         } else {
127
           this.$Message.error(res.msg);
129
           this.$Message.error(res.msg);

+ 190
- 2
src/views/schoolSection/userManage/userManage.vue View File

16
         <div v-for="item in schoolInfo.children" :key="item.id">
16
         <div v-for="item in schoolInfo.children" :key="item.id">
17
           <div
17
           <div
18
             :class="[
18
             :class="[
19
+              'class_item',
19
               curClass.id === item.id && curClass.type === item.type
20
               curClass.id === item.id && curClass.type === item.type
20
                 ? 'active'
21
                 ? 'active'
21
                 : ''
22
                 : ''
25
           >
26
           >
26
             {{ item.name }}
27
             {{ item.name }}
27
           </div>
28
           </div>
29
+          <span
30
+            @click="toOpenMenu(item, $event)"
31
+            class="ivu-icon iconfont icon-sandian"
32
+          ></span>
28
         </div>
33
         </div>
29
       </div>
34
       </div>
30
     </div>
35
     </div>
138
         ></Page>
143
         ></Page>
139
       </div>
144
       </div>
140
     </div>
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
     <Modal
186
     <Modal
143
       v-model="exitInfo.show"
187
       v-model="exitInfo.show"
321
 
365
 
322
 <script>
366
 <script>
323
 import {
367
 import {
368
+  class_delete,
369
+  class_edit,
324
   class_list,
370
   class_list,
325
   user_care,
371
   user_care,
326
   user_delete,
372
   user_delete,
333
 } from "@/api/school";
379
 } from "@/api/school";
334
 import { user_add, user_edit } from "@/api/school";
380
 import { user_add, user_edit } from "@/api/school";
335
 import { exportToExcel } from "@/utils/exportToExcel";
381
 import { exportToExcel } from "@/utils/exportToExcel";
336
-import { generateRandomString, pwdCheck, reg} from "@/utils";
382
+import { generateRandomString, pwdCheck, reg } from "@/utils";
337
 export default {
383
 export default {
338
   data() {
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
     const pwdAgainCheck = async (rule, value, callback) => {
403
     const pwdAgainCheck = async (rule, value, callback) => {
341
       if (!reg.test(value)) {
404
       if (!reg.test(value)) {
417
         cardid: ""
480
         cardid: ""
418
       },
481
       },
419
       rules: {
482
       rules: {
483
+        classname: [
484
+          {
485
+            required: true,
486
+            validator: classnameCheck,
487
+            trigger: "blur"
488
+          }
489
+        ],
420
         username: [
490
         username: [
421
           {
491
           {
422
             required: true,
492
             required: true,
508
           align: "center"
578
           align: "center"
509
         }
579
         }
510
       ],
580
       ],
581
+      classInfo: {},
582
+      selectedModel: {},
511
       schoolInfo: {
583
       schoolInfo: {
512
         children: [],
584
         children: [],
513
         name: ""
585
         name: ""
527
     this.searchList();
599
     this.searchList();
528
   },
600
   },
529
   methods: {
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
     classChange() {
687
     classChange() {
531
       if (this.schoolInfo.children.length === 0) {
688
       if (this.schoolInfo.children.length === 0) {
532
         return;
689
         return;
767
         this.showLoading = false;
924
         this.showLoading = false;
768
         if (res.code === 0) {
925
         if (res.code === 0) {
769
           this.schoolInfo = res.obj;
926
           this.schoolInfo = res.obj;
770
-          this.curClass = res.obj;
927
+          if (!this.curClass.id) {
928
+            this.curClass = res.obj;
929
+          }
771
         } else {
930
         } else {
772
           this.$Message.error(res.msg);
931
           this.$Message.error(res.msg);
773
         }
932
         }
846
         height: 30px;
1005
         height: 30px;
847
         text-align: center;
1006
         text-align: center;
848
         cursor: pointer;
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
     .active {
1023
     .active {
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
 </style>
1136
 </style>

Loading…
Cancel
Save