Browse Source

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

gzb
wangzhonglu 9 months ago
parent
commit
75909373c9

BIN
public/doc/student.xls View File


+ 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">&#xe703;</span>
59
+                <div class="name">关注-已关注</div>
60
+                <div class="code-name">&amp;#xe703;</div>
61
+              </li>
62
+          
57
             <li class="dib">
63
             <li class="dib">
58
               <span class="icon iconfont">&#xe6a2;</span>
64
               <span class="icon iconfont">&#xe6a2;</span>
59
                 <div class="name">钉-面型</div>
65
                 <div class="name">钉-面型</div>
198
 <pre><code class="language-css"
204
 <pre><code class="language-css"
199
 >@font-face {
205
 >@font-face {
200
   font-family: 'iconfont';
206
   font-family: 'iconfont';
201
-  src: url('iconfont.woff2?t=1711933298260') format('woff2'),
202
-       url('iconfont.woff?t=1711933298260') format('woff'),
203
-       url('iconfont.ttf?t=1711933298260') format('truetype');
207
+  src: url('iconfont.woff2?t=1712026774551') format('woff2'),
208
+       url('iconfont.woff?t=1712026774551') format('woff'),
209
+       url('iconfont.ttf?t=1712026774551') format('truetype');
204
 }
210
 }
205
 </code></pre>
211
 </code></pre>
206
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
212
           <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
226
       <div class="content font-class">
232
       <div class="content font-class">
227
         <ul class="icon_lists dib-box">
233
         <ul class="icon_lists dib-box">
228
           
234
           
235
+          <li class="dib">
236
+            <span class="icon iconfont icon-guanzhu-yiguanzhu"></span>
237
+            <div class="name">
238
+              关注-已关注
239
+            </div>
240
+            <div class="code-name">.icon-guanzhu-yiguanzhu
241
+            </div>
242
+          </li>
243
+          
229
           <li class="dib">
244
           <li class="dib">
230
             <span class="icon iconfont icon-ding-mianxing"></span>
245
             <span class="icon iconfont icon-ding-mianxing"></span>
231
             <div class="name">
246
             <div class="name">
442
       <div class="content symbol">
457
       <div class="content symbol">
443
           <ul class="icon_lists dib-box">
458
           <ul class="icon_lists dib-box">
444
           
459
           
460
+            <li class="dib">
461
+                <svg class="icon svg-icon" aria-hidden="true">
462
+                  <use xlink:href="#icon-guanzhu-yiguanzhu"></use>
463
+                </svg>
464
+                <div class="name">关注-已关注</div>
465
+                <div class="code-name">#icon-guanzhu-yiguanzhu</div>
466
+            </li>
467
+          
445
             <li class="dib">
468
             <li class="dib">
446
                 <svg class="icon svg-icon" aria-hidden="true">
469
                 <svg class="icon svg-icon" aria-hidden="true">
447
                   <use xlink:href="#icon-ding-mianxing"></use>
470
                   <use xlink:href="#icon-ding-mianxing"></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=1711933298260') format('woff2'),
4
-       url('iconfont.woff?t=1711933298260') format('woff'),
5
-       url('iconfont.ttf?t=1711933298260') format('truetype');
3
+  src: url('iconfont.woff2?t=1712026774551') format('woff2'),
4
+       url('iconfont.woff?t=1712026774551') format('woff'),
5
+       url('iconfont.ttf?t=1712026774551') 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-guanzhu-yiguanzhu:before {
17
+  content: "\e703";
18
+}
19
+
16
 .icon-ding-mianxing:before {
20
 .icon-ding-mianxing:before {
17
   content: "\e6a2";
21
   content: "\e6a2";
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": "9974412",
10
+      "name": "关注-已关注",
11
+      "font_class": "guanzhu-yiguanzhu",
12
+      "unicode": "e703",
13
+      "unicode_decimal": 59139
14
+    },
8
     {
15
     {
9
       "icon_id": "24267510",
16
       "icon_id": "24267510",
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


+ 11
- 9
src/api/school.js View File

42
 /**
42
 /**
43
  * 3.2.0.1用户--验证码登录
43
  * 3.2.0.1用户--验证码登录
44
  */
44
  */
45
-export const ulogin_login_code = (data) => setRequest("ulogin/login_code", data);
45
+export const ulogin_login_code = (data) =>
46
+  setRequest("ulogin/login_code", data);
46
 /**
47
 /**
47
  * 3.2.0.2用户--校验登录状态
48
  * 3.2.0.2用户--校验登录状态
48
  */
49
  */
49
-export const ulogin_check_login = (data) => setRequest("ulogin/check_login", data);
50
+export const ulogin_check_login = (data) =>
51
+  setRequest("ulogin/check_login", data);
50
 /**
52
 /**
51
  * 3.2.0.3用户--退出登录
53
  * 3.2.0.3用户--退出登录
52
  */
54
  */
78
 /**
80
 /**
79
  * 3.2.3.2用户--启用
81
  * 3.2.3.2用户--启用
80
  */
82
  */
81
-export const user_enable= (data) => setRequest("user/enable", data);
83
+export const user_enable = (data) => setRequest("user/enable", data);
82
 /**
84
 /**
83
  * 3.2.3.2用户--启用
85
  * 3.2.3.2用户--启用
84
  */
86
  */
85
-export const user_disabled= (data) => setRequest("user/disabled", data);
87
+export const user_disabled = (data) => setRequest("user/disabled", data);
86
 /**
88
 /**
87
  * 3.2.3.4用户--关注
89
  * 3.2.3.4用户--关注
88
  */
90
  */
89
-export const user_care= (data) => setRequest("user/care", data);
91
+export const user_care = (data) => setRequest("user/care", data);
90
 /**
92
 /**
91
  * 3.2.3.5用户--取消关注
93
  * 3.2.3.5用户--取消关注
92
  */
94
  */
93
-export const user_un_care= (data) => setRequest("user/un_care", data);
95
+export const user_un_care = (data) => setRequest("user/un_care", data);
94
 /**
96
 /**
95
  * 3.2.3.6用户--管控
97
  * 3.2.3.6用户--管控
96
  */
98
  */
97
-export const user_control= (data) => setRequest("user/control", data);
99
+export const user_control = (data) => setRequest("user/control", data);
98
 /**
100
 /**
99
  * 3.2.3.7用户--取消管控
101
  * 3.2.3.7用户--取消管控
100
  */
102
  */
101
-export const user_un_control= (data) => setRequest("user/un_control", data);
103
+export const user_un_control = (data) => setRequest("user/un_control", data);
102
 /**
104
 /**
103
  * 3.2.4用户--删除
105
  * 3.2.4用户--删除
104
  */
106
  */
106
 /**
108
 /**
107
  * 3.2.5用户--导入
109
  * 3.2.5用户--导入
108
  */
110
  */
109
-export const user_import = (data) => setRequest("user/import", data);
111
+export const user_import = (data) => setRequest("user/import", data);

+ 323
- 45
src/views/schoolSection/userManage/userManage.vue View File

5
       <div class="class_list">
5
       <div class="class_list">
6
         <div v-for="item in schoolInfo.children" :key="item.id">
6
         <div v-for="item in schoolInfo.children" :key="item.id">
7
           <div
7
           <div
8
-            :class="[curClass === item.id ? 'active' : '']"
8
+            :class="[curClass.id === item.id ? 'active' : '']"
9
             :title="item.name"
9
             :title="item.name"
10
             @click="selectClass(item)"
10
             @click="selectClass(item)"
11
           >
11
           >
62
           />
62
           />
63
         </div>
63
         </div>
64
         <div>
64
         <div>
65
-          <Button type="primary" class="primary_btn" @click="userExport()"
65
+          <Button type="primary" class="primary_btn" @click="userImport()"
66
             >用户导入</Button
66
             >用户导入</Button
67
           >
67
           >
68
           <Button
68
           <Button
69
             style="margin: 0 10px"
69
             style="margin: 0 10px"
70
             type="primary"
70
             type="primary"
71
             class="primary_btn"
71
             class="primary_btn"
72
-            @click="toAdd()"
72
+            @click="userExport()"
73
             >用户导出</Button
73
             >用户导出</Button
74
           >
74
           >
75
           <Button type="primary" class="primary_btn" @click="toAdd()"
75
           <Button type="primary" class="primary_btn" @click="toAdd()"
79
       </div>
79
       </div>
80
       <div class="table_wrap">
80
       <div class="table_wrap">
81
         <Table :columns="columns" :data="searchForm.list">
81
         <Table :columns="columns" :data="searchForm.list">
82
+          <template slot-scope="{ row }" slot="loginname">
83
+            <span
84
+              v-if="row.care === 1"
85
+              style="color: #fcc138"
86
+              class="ivu-icon iconfont icon-guanzhu-yiguanzhu"
87
+            ></span>
88
+            {{ row.loginname }}
89
+          </template>
82
           <template slot-scope="{ row }" slot="enabled">
90
           <template slot-scope="{ row }" slot="enabled">
83
             <i-switch
91
             <i-switch
84
               size="large"
92
               size="large"
94
           <template slot-scope="{ row }" slot="actionSlot">
102
           <template slot-scope="{ row }" slot="actionSlot">
95
             <div class="action_list">
103
             <div class="action_list">
96
               <div class="action_del" @click="toDel(row)">删除</div>
104
               <div class="action_del" @click="toDel(row)">删除</div>
97
-              <div class="action_success" @click="toCare(row)">重点关注</div>
105
+              <div class="action_success" @click="toCare(row)">
106
+                <span v-if="row.care === 2">重点关注</span>
107
+                <span v-else>取消关注</span>
108
+              </div>
98
             </div>
109
             </div>
99
           </template>
110
           </template>
100
         </Table>
111
         </Table>
113
         ></Page>
124
         ></Page>
114
       </div>
125
       </div>
115
     </div>
126
     </div>
127
+    <!-- 已存在列表 -->
128
+    <Modal
129
+      v-model="exitInfo.show"
130
+      :mask-closable="false"
131
+      class="exit_modal modal1"
132
+      title="提示"
133
+    >
134
+      <div class="exit">
135
+        <div>
136
+          <div v-if="exitInfo.studentsExisted.length > 0">
137
+            以下学生信息已存在
138
+            <Table border :columns="columns2" :data="exitInfo.studentsExisted">
139
+              <template slot-scope="{ row }" slot="usersex">
140
+                <span>
141
+                  {{
142
+                    row.usersex == 1 ? "男" : row.usersex == 2 ? "女" : "未知"
143
+                  }}
144
+                </span>
145
+              </template>
146
+            </Table>
147
+          </div>
148
+          <div v-if="exitInfo.usersExisted.length > 0">
149
+            已存在非本校账号列表
150
+            <Table border :columns="columns2" :data="exitInfo.usersExisted">
151
+              <template slot-scope="{ row }" slot="usersex">
152
+                <span>
153
+                  {{
154
+                    row.usersex == 1 ? "男" : row.usersex == 2 ? "女" : "未知"
155
+                  }}
156
+                </span>
157
+              </template>
158
+            </Table>
159
+          </div>
160
+        </div>
161
+      </div>
162
+    </Modal>
163
+    <!-- 导入 -->
164
+    <Modal
165
+      :mask-closable="false"
166
+      v-model="importInfo.show"
167
+      class="modal_tip"
168
+      title="导入"
169
+    >
170
+      <Upload
171
+        v-if="importInfo.show"
172
+        type="drag"
173
+        action
174
+        accept=".xls,.xlsx"
175
+        :before-upload="handleUpload"
176
+      >
177
+        <div style="padding: 30px 0; background: #f8f8f9">
178
+          <Button type="primary" class="primary_btn" style="font-size: 16px">
179
+            <Icon type="ios-cloud-upload-outline" size="18"></Icon>上传excel
180
+          </Button>
181
+          <div style="margin-top: 10px; color: #999">支持上传xlsx/xls文件</div>
182
+        </div>
183
+      </Upload>
184
+      <div v-if="importInfo.file" class="files_list">
185
+        {{ importInfo.file.name }}
186
+      </div>
187
+      <div class="import_tip">
188
+        导入数据需按照模板填写信息,
189
+        <span class="theme_color" @click="download()">下载表格模板</span>
190
+      </div>
191
+      <div slot="footer">
192
+        <Button @click="importInfo.show = false">取消</Button>
193
+        <Button
194
+          @click="ok_import"
195
+          class="primary_btn"
196
+          :loading="wait_flag"
197
+          type="primary"
198
+          >保存</Button
199
+        >
200
+      </div>
201
+    </Modal>
116
     <!-- 新建 -->
202
     <!-- 新建 -->
117
     <Modal
203
     <Modal
118
       class="modal1"
204
       class="modal1"
132
           <Input v-model="addInfo.username" placeholder="请输入姓名"></Input>
218
           <Input v-model="addInfo.username" placeholder="请输入姓名"></Input>
133
         </FormItem>
219
         </FormItem>
134
         <FormItem label="性别" style="width: calc(50% - 10px)">
220
         <FormItem label="性别" style="width: calc(50% - 10px)">
135
-          <RadioGroup v-model="addInfo.sex">
221
+          <RadioGroup v-model="addInfo.usersex">
136
             <Radio :label="1">男</Radio>
222
             <Radio :label="1">男</Radio>
137
             <Radio :label="2">女</Radio>
223
             <Radio :label="2">女</Radio>
138
             <Radio :label="0">未知</Radio>
224
             <Radio :label="0">未知</Radio>
216
 <script>
302
 <script>
217
 import {
303
 import {
218
   class_list,
304
   class_list,
305
+  user_care,
306
+  user_delete,
219
   user_disabled,
307
   user_disabled,
220
   user_enable,
308
   user_enable,
221
-  user_list
309
+  user_export,
310
+  user_import,
311
+  user_list,
312
+  user_un_care
222
 } from "@/api/school";
313
 } from "@/api/school";
223
-import {user_add, user_edit} from "@/api/school";
224
-import {generateRandomString} from "@/utils";
314
+import { user_add, user_edit } from "@/api/school";
315
+import { exportToExcel } from "@/utils/exportToExcel";
225
 
316
 
226
 export default {
317
 export default {
227
   data() {
318
   data() {
228
     const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
319
     const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
229
     // 密码验证
320
     // 密码验证
230
     const pwdCheck = (rule, value, callback) => {
321
     const pwdCheck = (rule, value, callback) => {
231
-      console.log(value)
232
-      if (!reg.test(this.addInfo.loginpwd)) {
322
+      if (!reg.test(value)) {
233
         return callback(new Error("密码格式不正确!"));
323
         return callback(new Error("密码格式不正确!"));
234
       }
324
       }
235
-      console.log(this.addInfo.loginpwd)
325
+      callback();
236
     };
326
     };
237
     // 重复密码验证
327
     // 重复密码验证
238
     const pwdAgainCheck = async (rule, value, callback) => {
328
     const pwdAgainCheck = async (rule, value, callback) => {
239
-      if (!reg.test(this.addInfo.loginpwd1)) {
329
+      if (!value) {
240
         return callback(new Error("确认密码不能为空!"));
330
         return callback(new Error("确认密码不能为空!"));
241
       }
331
       }
242
-      if (!reg.test(this.addInfo.loginpwd1)) {
332
+      if (!reg.test(value)) {
243
         return callback(new Error("密码格式不正确!"));
333
         return callback(new Error("密码格式不正确!"));
244
       }
334
       }
245
-      if (this.addInfo.loginpwd != this.addInfo.loginpwd1) {
335
+      if (this.addInfo.loginpwd != value) {
246
         return callback(new Error("两次输入密码不一致!"));
336
         return callback(new Error("两次输入密码不一致!"));
247
       }
337
       }
338
+      callback();
248
     };
339
     };
249
     return {
340
     return {
250
       userInfo: {},
341
       userInfo: {},
342
+      importInfo: {
343
+        show: false,
344
+        file: null
345
+      },
346
+      exitInfo: {
347
+        show: false,
348
+        studentsExisted: [],
349
+        usersExisted: []
350
+      },
351
+      columns2: [
352
+        {
353
+          title: "姓名",
354
+          key: "username",
355
+          minWidth: 140,
356
+          align: "center"
357
+        },
358
+        {
359
+          title: "登录名",
360
+          key: "loginname",
361
+          minWidth: 140,
362
+          align: "center"
363
+        },
364
+        {
365
+          title: "性别",
366
+          key: "usersex",
367
+          align: "center",
368
+          slot: "usersex"
369
+        }
370
+      ],
371
+      form_data: null,
372
+      wait_flag: false,
251
       showLoading: false,
373
       showLoading: false,
252
       care_list: [
374
       care_list: [
253
         { id: 0, title: "请选择关注状态" },
375
         { id: 0, title: "请选择关注状态" },
264
         { id: 1, title: "管控中" },
386
         { id: 1, title: "管控中" },
265
         { id: 2, title: "解除管控" }
387
         { id: 2, title: "解除管控" }
266
       ],
388
       ],
267
-      curClass: 0,
389
+      curClass: {
390
+        id: 0,
391
+        name: ""
392
+      },
268
       addInfo: {
393
       addInfo: {
269
         show: false,
394
         show: false,
270
         userid: null,
395
         userid: null,
338
         },
463
         },
339
         {
464
         {
340
           title: "登录名",
465
           title: "登录名",
341
-          key: "loginname",
466
+          slot: "loginname",
342
           align: "center"
467
           align: "center"
343
         },
468
         },
344
         {
469
         {
382
     this.userInfo = JSON.parse(
507
     this.userInfo = JSON.parse(
383
       localStorage.getItem("xh_control_userInfo")
508
       localStorage.getItem("xh_control_userInfo")
384
     ).content;
509
     ).content;
385
-    console.log(this.userInfo);
386
     this.init();
510
     this.init();
387
     this.searchList();
511
     this.searchList();
388
   },
512
   },
389
   methods: {
513
   methods: {
390
     classChange() {
514
     classChange() {
391
-      if(this.schoolInfo.children.length === 0){
515
+      if (this.schoolInfo.children.length === 0) {
392
         return;
516
         return;
393
       }
517
       }
394
-      let classInfo = this.schoolInfo.children.filter(v=>v.id === this.addInfo.classid)[0];
518
+      let classInfo = this.schoolInfo.children.filter(
519
+        (v) => v.id === this.addInfo.classid
520
+      )[0];
395
       this.addInfo.classname = classInfo.name;
521
       this.addInfo.classname = classInfo.name;
396
     },
522
     },
397
-    userImport() {},
398
-    userExport() {},
523
+    download() {
524
+      //下载模版
525
+      let url = "../../../../doc/student.xls";
526
+      const a = document.createElement("a"); // 创建a标签
527
+      a.setAttribute("download", "学生信息模版"); // download属性
528
+      a.setAttribute("href", url); // href链接
529
+      a.click(); // 自执行点击事件
530
+    },
531
+    //确定导入
532
+    ok_import() {
533
+      if (!this.importInfo.file) {
534
+        this.$Message.error("请选择上传文件");
535
+        return;
536
+      }
537
+      this.wait_flag = true;
538
+      let that = this;
539
+      user_import(this.form_data)
540
+        .then((res) => {
541
+          this.wait_flag = false;
542
+          if (res.code == 0) {
543
+            this.importInfo = {
544
+              show: false,
545
+              file: null
546
+            };
547
+            if (res.obj.code == 0) {
548
+              this.$Message.success("导入成功");
549
+              this.searchList();
550
+            } else {
551
+              this.exitInfo = {
552
+                show: true,
553
+                studentsExisted: res.obj.studentsExisted,
554
+                usersExisted: res.obj.usersExisted
555
+              };
556
+            }
557
+          } else {
558
+            this.$Message.error(res.msg);
559
+          }
560
+          this.form_data = null;
561
+        })
562
+        .catch(() => {
563
+          that.wait_flag = false;
564
+        });
565
+    },
566
+    //导入
567
+    userImport() {
568
+      this.importInfo = {
569
+        show: true,
570
+        file: null
571
+      };
572
+    },
573
+    // 上传文件
574
+    handleUpload(file) {
575
+      let str = file.name.split(".");
576
+      let suffix = str[str.length - 1];
577
+      suffix = suffix.toLowerCase();
578
+      if (suffix === "xls" || suffix === "xlsx") {
579
+        this.importInfo.file = file;
580
+        this.import_img = true;
581
+        this.form_data = new FormData();
582
+        this.form_data.append("file", file);
583
+        this.form_data.append("schoolid", 1);
584
+        this.form_data.append("regionid", this.userInfo.regionid);
585
+      } else {
586
+        this.importInfo.file = null;
587
+        this.$Message.error("请上传excel文件");
588
+      }
589
+      return false;
590
+    },
591
+    //导出
592
+    userExport() {
593
+      user_export({ schoolid: 1 }).then((res) => {
594
+        if (res.code === 0) {
595
+          exportToExcel(
596
+            [
597
+              {
598
+                list: res.obj.map((item) => {
599
+                  return {
600
+                    登录名: item.loginname,
601
+                    姓名: item.username,
602
+                    班级: item.classname,
603
+                    状态: item.enabled === 1 ? "启用" : "禁用",
604
+                    最后登录时间: item.lasttime || ""
605
+                  };
606
+                }),
607
+                name: this.curClass.name
608
+              }
609
+            ],
610
+            this.curClass.name
611
+          );
612
+        } else {
613
+          this.$Message.error(res.msg);
614
+        }
615
+      });
616
+    },
399
     toAdd() {
617
     toAdd() {
400
       this.addInfo = {
618
       this.addInfo = {
401
         show: true,
619
         show: true,
402
         userid: null,
620
         userid: null,
403
-        sex: 1,
621
+        usersex: 1,
404
         username: "",
622
         username: "",
405
         loginname: "",
623
         loginname: "",
406
         loginpwd: "",
624
         loginpwd: "",
415
       };
633
       };
416
     },
634
     },
417
     saveAddInfo() {
635
     saveAddInfo() {
418
-      console.log(this.addInfo);
419
       this.$refs.addForm.validate((valid) => {
636
       this.$refs.addForm.validate((valid) => {
420
         if (valid) {
637
         if (valid) {
421
-          console.log(this.addInfo.classid)
422
-           if(!this.addInfo.classid){
423
-             this.$Message.error("请选择班级!")
424
-             return
425
-           }
638
+          if (this.addInfo.userphone) {
639
+            var filter = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
640
+            if (!filter.test(this.addInfo.userphone)) {
641
+              this.$Message.error("手机号码格式不正确!");
642
+              return;
643
+            }
644
+          }
645
+          if (!this.addInfo.classid) {
646
+            this.$Message.error("请选择班级!");
647
+            return;
648
+          }
426
           let form = {
649
           let form = {
427
             username: this.addInfo.username,
650
             username: this.addInfo.username,
428
             loginname: this.addInfo.loginname,
651
             loginname: this.addInfo.loginname,
652
+            usersex: this.addInfo.usersex,
429
             loginpwd: this.addInfo.loginpwd,
653
             loginpwd: this.addInfo.loginpwd,
430
             classid: this.addInfo.classid,
654
             classid: this.addInfo.classid,
431
             classname: this.addInfo.classname,
655
             classname: this.addInfo.classname,
432
-            schoolid: this.addInfo.schoolid,
433
-            regionid: this.addInfo.regionid,
656
+            schoolid: this.addInfo.schoolid || 1,
657
+            regionid: this.userInfo.regionid,
434
             enabled: this.addInfo.enabled,
658
             enabled: this.addInfo.enabled,
435
             studentno: this.addInfo.studentno,
659
             studentno: this.addInfo.studentno,
436
             userphone: this.addInfo.userphone,
660
             userphone: this.addInfo.userphone,
437
             cardid: this.addInfo.cardid
661
             cardid: this.addInfo.cardid
438
           };
662
           };
439
-          //编辑
440
-          // if (this.addInfo.appid) {
441
-          //   form.userid = this.addInfo.userid;
442
-          //   form.rversion = this.addInfo.rversion;
443
-          // }
444
-          console.log(form);
445
           let api = this.addInfo.userid ? user_edit : user_add;
663
           let api = this.addInfo.userid ? user_edit : user_add;
446
           api(form).then((res) => {
664
           api(form).then((res) => {
447
             if (res.code === 0) {
665
             if (res.code === 0) {
448
               this.addInfo.show = false;
666
               this.addInfo.show = false;
449
-              console.log(res.obj);
450
               this.$Message.success(res.msg);
667
               this.$Message.success(res.msg);
451
               this.searchList();
668
               this.searchList();
452
             } else {
669
             } else {
456
         }
673
         }
457
       });
674
       });
458
     },
675
     },
459
-    toCare(row) {},
460
-    toDel(row) {},
676
+    toCare(row) {
677
+      let api = row.care === 1 ? user_un_care : user_care;
678
+      api({ userid: row.userid, rversion: row.rversion }).then((res) => {
679
+        if (res.code === 0) {
680
+          this.searchList();
681
+          this.$Message.success(res.msg);
682
+        } else {
683
+          this.$Message.error(res.msg);
684
+        }
685
+      });
686
+    },
687
+    toDel(row) {
688
+      user_delete({ userid: row.userid, rversion: row.rversion }).then(
689
+        (res) => {
690
+          if (res.code === 0) {
691
+            this.searchList();
692
+            this.$Message.success(res.msg);
693
+          } else {
694
+            this.$Message.error(res.msg);
695
+          }
696
+        }
697
+      );
698
+    },
461
     enabledChange(row) {
699
     enabledChange(row) {
462
       let api = row.enabled === 1 ? user_enable : user_disabled;
700
       let api = row.enabled === 1 ? user_enable : user_disabled;
463
       api({
701
       api({
473
       });
711
       });
474
     },
712
     },
475
     selectClass(item) {
713
     selectClass(item) {
476
-      this.curClass = item.id;
714
+      this.curClass = item;
715
+      this.searchList();
477
     },
716
     },
478
     init() {
717
     init() {
479
       this.showLoading = true;
718
       this.showLoading = true;
482
         if (res.code === 0) {
721
         if (res.code === 0) {
483
           this.schoolInfo = res.obj;
722
           this.schoolInfo = res.obj;
484
           if (this.schoolInfo.children.length > 0) {
723
           if (this.schoolInfo.children.length > 0) {
485
-            this.curClass = this.schoolInfo.children[0].id;
724
+            this.curClass = this.schoolInfo.children[0];
486
           }
725
           }
487
-          console.log(res.obj);
488
         } else {
726
         } else {
489
           this.$Message.error(res.msg);
727
           this.$Message.error(res.msg);
490
         }
728
         }
513
         page: this.searchForm.page,
751
         page: this.searchForm.page,
514
         size: this.searchForm.size,
752
         size: this.searchForm.size,
515
         schoolid: this.searchForm.schoolid,
753
         schoolid: this.searchForm.schoolid,
516
-        classid: this.curClass,
754
+        classid: this.curClass.id,
517
         care: this.searchForm.care,
755
         care: this.searchForm.care,
518
         enabled: this.searchForm.enabled,
756
         enabled: this.searchForm.enabled,
519
         control: this.searchForm.control,
757
         control: this.searchForm.control,
523
         if (res.code === 0) {
761
         if (res.code === 0) {
524
           this.searchForm.list = res.obj.data;
762
           this.searchForm.list = res.obj.data;
525
           this.searchForm.total = res.obj.total;
763
           this.searchForm.total = res.obj.total;
526
-          console.log(this.searchForm.list);
527
         } else {
764
         } else {
528
           this.$Message.error(res.msg);
765
           this.$Message.error(res.msg);
529
         }
766
         }
558
         line-height: 30px;
795
         line-height: 30px;
559
         height: 30px;
796
         height: 30px;
560
         text-align: center;
797
         text-align: center;
561
-        cursor: p;
798
+        cursor: pointer;
562
       }
799
       }
563
       .active {
800
       .active {
564
         border-radius: 6px;
801
         border-radius: 6px;
569
   .user_list {
806
   .user_list {
570
     width: calc(100% - 216px);
807
     width: calc(100% - 216px);
571
     height: 100%;
808
     height: 100%;
809
+    overflow-y: auto;
572
     border-radius: 15px;
810
     border-radius: 15px;
573
     background-color: white;
811
     background-color: white;
574
   }
812
   }
617
     }
855
     }
618
   }
856
   }
619
 }
857
 }
858
+.modal_tip {
859
+  .files_list {
860
+    height: 30px;
861
+    line-height: 30px;
862
+  }
863
+  .import_tip {
864
+    height: 30px;
865
+    line-height: 30px;
866
+    text-align: center;
867
+    .theme_color {
868
+      color: #339dff;
869
+      cursor: pointer;
870
+    }
871
+  }
872
+}
873
+// 存在信息
874
+.exit_modal {
875
+  /deep/ .ivu-modal {
876
+    .ivu-modal-content {
877
+      .exit {
878
+        div {
879
+          // margin-bottom: 10px;
880
+          font-size: 18px;
881
+          line-height: 40px;
882
+        }
883
+      }
884
+      .ivu-table {
885
+        -moz-user-select: none;
886
+        -khtml-user-select: none;
887
+        user-select: none;
888
+      }
889
+      div .ivu-table-header thead tr > th {
890
+        height: 40px;
891
+      }
892
+      .ivu-modal-footer {
893
+        display: none;
894
+      }
895
+    }
896
+  }
897
+}
620
 </style>
898
 </style>

Loading…
Cancel
Save