Просмотр исходного кода

Merge branch 'hcb' of SH-Arbitrate/Mediation-Frontend into dev

hanchaobo 2 лет назад
Родитель
Сommit
a7ae328123

+ 1118
- 0
public/api.js
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 1
- 0
public/index.html Просмотреть файл

7
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
7
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
8
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
8
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
9
     <title><%= webpackConfig.name %></title>
9
     <title><%= webpackConfig.name %></title>
10
+    <script src="http://121.40.189.20:8899/web-apps/apps/api/documents/api.js"></script>
10
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
11
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
11
 	  <style>
12
 	  <style>
12
     html,
13
     html,

+ 7
- 0
src/api/caseManagement/caseManagement.js Просмотреть файл

239
     params: query
239
     params: query
240
   })
240
   })
241
 }
241
 }
242
+// 获取证件类型
243
+export function getIdType() {
244
+  return request({
245
+    url: '/system/dict/data/type/id_type',
246
+    method: 'get',
247
+  })
248
+}

+ 7
- 0
src/api/login.js Просмотреть файл

83
 		method: 'get',
83
 		method: 'get',
84
 		params:data
84
 		params:data
85
 	})
85
 	})
86
+}
87
+// 获取证件类型
88
+export function getIdType() {
89
+  return request({
90
+    url: '/system/dict/data/type/skipToken/id_type',
91
+    method: 'get',
92
+  })
86
 }
93
 }

+ 20
- 0
src/api/onlyoffice/onlyoffice.js Просмотреть файл

1
+import request from '@/utils/request'
2
+// 获取onlyoffice配置文件
3
+export function getOnlyoffice(params) {
4
+  return request({
5
+    url: '/onlyOffice',
6
+    // headers: {
7
+    //   isToken: false
8
+    // },
9
+    method: 'get',
10
+    params: params
11
+  })
12
+}
13
+// 保存onlyoffice文档
14
+export function saveOnlyOfficeFile(data) {
15
+  return request({
16
+    url: '/caseApplication/saveOnlyOfficeFile',
17
+    method: 'post',
18
+    data: data
19
+  })
20
+}

+ 5
- 0
src/router/index.js Просмотреть файл

61
     component: () => import('@/views/error/401'),
61
     component: () => import('@/views/error/401'),
62
     hidden: true
62
     hidden: true
63
   },
63
   },
64
+  {
65
+    path: '/onlyoffice',
66
+    component: () => import('@/views/onlyoffice/onlyoffice'),
67
+    hidden: true
68
+  },
64
   {
69
   {
65
     path: '',
70
     path: '',
66
     component: Layout,
71
     component: Layout,

+ 1
- 0
src/store/getters.js Просмотреть файл

15
   topbarRouters:state => state.permission.topbarRouters,
15
   topbarRouters:state => state.permission.topbarRouters,
16
   defaultRoutes:state => state.permission.defaultRoutes,
16
   defaultRoutes:state => state.permission.defaultRoutes,
17
   sidebarRouters:state => state.permission.sidebarRouters,
17
   sidebarRouters:state => state.permission.sidebarRouters,
18
+  userId:state => state.user.userId,
18
 }
19
 }
19
 export default getters
20
 export default getters

+ 5
- 0
src/store/modules/user.js Просмотреть файл

6
     token: getToken(),
6
     token: getToken(),
7
     name: '',
7
     name: '',
8
     avatar: '',
8
     avatar: '',
9
+    userId:null,
9
     roles: [],
10
     roles: [],
10
     permissions: []
11
     permissions: []
11
   },
12
   },
12
 
13
 
13
   mutations: {
14
   mutations: {
15
+    SET_USERID:(state,userId) => {
16
+      state.userId = userId
17
+    },
14
     SET_TOKEN: (state, token) => {
18
     SET_TOKEN: (state, token) => {
15
       state.token = token
19
       state.token = token
16
     },
20
     },
60
           }
64
           }
61
           commit('SET_NAME', user.userName)
65
           commit('SET_NAME', user.userName)
62
           commit('SET_AVATAR', avatar)
66
           commit('SET_AVATAR', avatar)
67
+          commit('SET_USERID',user.userId)
63
           resolve(res)
68
           resolve(res)
64
         }).catch(error => {
69
         }).catch(error => {
65
           reject(error)
70
           reject(error)

+ 72
- 70
src/views/caseManagement/components/addCase.vue Просмотреть файл

118
           <el-col :span="24" v-if="modelFlag && showmediate">
118
           <el-col :span="24" v-if="modelFlag && showmediate">
119
             <el-form-item label="调解书:">
119
             <el-form-item label="调解书:">
120
               <div v-for="(item, index) in formData.caseAttachList" :key="index" v-if="item.annexType == 7">
120
               <div v-for="(item, index) in formData.caseAttachList" :key="index" v-if="item.annexType == 7">
121
-                <div style="color: blue; cursor: pointer" @click="fileDetil(item.annexPath)">
121
+                <div style="color: blue; cursor: pointer" @click="fileDetil(item.onlyOfficeFileId)">
122
                   {{ item.annexName }}
122
                   {{ item.annexName }}
123
                 </div>
123
                 </div>
124
               </div>
124
               </div>
205
     ]">
205
     ]">
206
               <el-select v-model="formData.affiliate.idType" placeholder="证件类型" auto-complete="off" style="width: 100%;"
206
               <el-select v-model="formData.affiliate.idType" placeholder="证件类型" auto-complete="off" style="width: 100%;"
207
                 disabled>
207
                 disabled>
208
-                <el-option v-for="item in idTypeList" :key="item.id" :label="item.value" :value="item.id">
208
+                <el-option v-for="item in idTypeList" :key="Number(item.dictValue)" :label="item.dictLabel" :value="Number(item.dictValue)">
209
 
209
 
210
                 </el-option>
210
                 </el-option>
211
               </el-select>
211
               </el-select>
212
             </el-form-item>
212
             </el-form-item>
213
           </el-col>
213
           </el-col>
214
-          <el-col :span="12" v-if="formData.affiliate.organizeFlag == 0 && formData.affiliate.idType == 0">
215
-            <el-form-item label="申请人身份证号码" prop="affiliate.code" :rules="[
214
+          <el-col :span="12" v-if="formData.affiliate.organizeFlag == 0">
215
+            <el-form-item label="证号码" prop="affiliate.code" :rules="[
216
       {
216
       {
217
         required: true,
217
         required: true,
218
-        message: '申请人身份证号不能为空',
219
-        trigger: 'blur',
220
-      },
221
-      {
222
-        pattern:
223
-          /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
224
-        message: '请输入正确的身份证号码',
218
+        message: '证件号码不能为空',
225
         trigger: 'blur',
219
         trigger: 'blur',
226
       },
220
       },
227
     ]">
221
     ]">
228
-              <el-input v-model="formData.affiliate.code" disabled placeholder="请输入申请人的身份证号" />
222
+              <el-input v-model="formData.affiliate.code" disabled placeholder="请输入申请人的证件号码" />
229
             </el-form-item>
223
             </el-form-item>
230
           </el-col>
224
           </el-col>
231
-          <el-col :span="12" v-if="formData.affiliate.organizeFlag == 0 && formData.affiliate.idType == 1">
225
+          <!-- <el-col :span="12" v-if="formData.affiliate.organizeFlag == 0 && formData.affiliate.idType == 1">
232
             <el-form-item label="申请人护照号码" prop="affiliate.code" :rules="[
226
             <el-form-item label="申请人护照号码" prop="affiliate.code" :rules="[
233
       {
227
       {
234
         required: true,
228
         required: true,
238
     ]">
232
     ]">
239
               <el-input v-model="formData.affiliate.code" disabled placeholder="请输入申请人的申请人护照号" />
233
               <el-input v-model="formData.affiliate.code" disabled placeholder="请输入申请人的申请人护照号" />
240
             </el-form-item>
234
             </el-form-item>
241
-          </el-col>
235
+          </el-col> -->
242
           <el-col :span="12" v-if="formData.affiliate.organizeFlag == 0">
236
           <el-col :span="12" v-if="formData.affiliate.organizeFlag == 0">
243
             <el-form-item label="申请人邮箱" prop="affiliate.applicationEmail" :rules="[
237
             <el-form-item label="申请人邮箱" prop="affiliate.applicationEmail" :rules="[
244
       {
238
       {
428
               <el-input v-model="formData.affiliate.respondentPhone" placeholder="请输入被申请人联系电话" />
422
               <el-input v-model="formData.affiliate.respondentPhone" placeholder="请输入被申请人联系电话" />
429
             </el-form-item>
423
             </el-form-item>
430
           </el-col>
424
           </el-col>
431
-                    <el-col :span="12">
425
+          <el-col :span="12">
432
             <el-form-item label-width="150px" label="被申请人申请人住所" prop="affiliate.respondentHome" :rules="[
426
             <el-form-item label-width="150px" label="被申请人申请人住所" prop="affiliate.respondentHome" :rules="[
433
       {
427
       {
434
         required: true,
428
         required: true,
457
             </el-form-item>
451
             </el-form-item>
458
           </el-col>
452
           </el-col>
459
         </el-row>
453
         </el-row>
460
-              <el-col :span="12">
461
-                <el-form-item label-width="140px" label="被申请人身份证号" prop="affiliate.respondentIdentityNum" :rules="[
462
-          {
463
-            required: true,
464
-            message: '被申请人身份证号不能为空',
465
-            trigger: 'blur',
466
-          },
467
-          {
468
-            pattern:
469
-              /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
470
-            message: '请输入正确的身份证号码',
471
-            trigger: 'blur',
472
-          },
473
-        ]">
474
-              <el-input v-model="formData.affiliate.respondentIdentityNum" @blur="handleBlur"
475
-                placeholder="请输入被申请人身份证号" />
476
-            </el-form-item>
477
-            </el-col>
478
-                      <el-col :span="12">
479
-              <el-form-item label-width="140px" label="被申请人出生年月:" prop="affiliate.respondentBirth">
480
-                <el-date-picker disabled v-model="formData.affiliate.respondentBirth" type="date" placeholder="被申请人出生年月日">
481
-                </el-date-picker>
482
-              </el-form-item>
483
-            </el-col>
484
-                  <el-col :span="12">
485
-                    <el-form-item label="被申请人性别:" prop="affiliate.respondentSex" :rules="[
486
-              {
487
-                required: true,
488
-                message: '请选择性别',
489
-              },
490
-            ]">
491
-              <el-radio-group v-model="formData.affiliate.respondentSex" disabled>
492
-                <el-radio :label="0">男</el-radio>
493
-                <el-radio :label="1">女</el-radio>
494
-              </el-radio-group>
495
-            </el-form-item>
496
-          </el-col>
454
+        <el-col :span="12">
455
+          <el-form-item label-width="140px" label="被申请人身份证号" prop="affiliate.respondentIdentityNum" :rules="[
456
+      {
457
+        required: true,
458
+        message: '被申请人身份证号不能为空',
459
+        trigger: 'blur',
460
+      },
461
+      {
462
+        pattern:
463
+          /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
464
+        message: '请输入正确的身份证号码',
465
+        trigger: 'blur',
466
+      },
467
+    ]">
468
+            <el-input v-model="formData.affiliate.respondentIdentityNum" @blur="handleBlur" placeholder="请输入被申请人身份证号" />
469
+          </el-form-item>
470
+        </el-col>
471
+        <el-col :span="12">
472
+          <el-form-item label-width="140px" label="被申请人出生年月:" prop="affiliate.respondentBirth">
473
+            <el-date-picker disabled v-model="formData.affiliate.respondentBirth" type="date" placeholder="被申请人出生年月日">
474
+            </el-date-picker>
475
+          </el-form-item>
476
+        </el-col>
477
+        <el-col :span="12">
478
+          <el-form-item label="被申请人性别:" prop="affiliate.respondentSex" :rules="[
479
+      {
480
+        required: true,
481
+        message: '请选择性别',
482
+      },
483
+    ]">
484
+            <el-radio-group v-model="formData.affiliate.respondentSex" disabled>
485
+              <el-radio :label="0">男</el-radio>
486
+              <el-radio :label="1">女</el-radio>
487
+            </el-radio-group>
488
+          </el-form-item>
489
+        </el-col>
497
         <el-col :span="24" v-if="modelFlag">
490
         <el-col :span="24" v-if="modelFlag">
498
           <el-form-item v-for="item in formData.columnValueList" :label="item.name" :key="item.id">
491
           <el-form-item v-for="item in formData.columnValueList" :label="item.name" :key="item.id">
499
             <el-input type="textarea" v-model="item.value"></el-input>
492
             <el-input type="textarea" v-model="item.value"></el-input>
534
   caseApplicationSelectById,
527
   caseApplicationSelectById,
535
   updateComfire,
528
   updateComfire,
536
   getInfoByIdCard,
529
   getInfoByIdCard,
537
-  getUserInfo
530
+  getUserInfo,
531
+  getIdType
538
 } from "@/api/caseManagement/caseManagement.js";
532
 } from "@/api/caseManagement/caseManagement.js";
539
 import { getTemplate } from "@/api/officialSeal/officialSeal.js";
533
 import { getTemplate } from "@/api/officialSeal/officialSeal.js";
540
 import { getToken } from "@/utils/auth";
534
 import { getToken } from "@/utils/auth";
547
     "tabFlag",
541
     "tabFlag",
548
     "addModifyData",
542
     "addModifyData",
549
   ],
543
   ],
550
-  dicts: ["case_built_type"],
544
+  // dicts: ["id_type"],
551
   data() {
545
   data() {
552
     return {
546
     return {
553
       activeName: "first",
547
       activeName: "first",
591
         }
585
         }
592
       ],
586
       ],
593
       idTypeList: [
587
       idTypeList: [
594
-        {
595
-          value: '身份证',
596
-          id: 0
597
-        },
598
-        {
599
-          value: '护照',
600
-          id: 1
601
-        }
588
+        // {
589
+        //   value: '身份证',
590
+        //   id: 0
591
+        // },
592
+        // {
593
+        //   value: '护照',
594
+        //   id: 1
595
+        // }
602
       ]
596
       ]
603
     };
597
     };
604
   },
598
   },
619
         this.buttonFlag = false;
613
         this.buttonFlag = false;
620
       }
614
       }
621
     },
615
     },
622
-    addVisable(val) {
616
+    async addVisable(val) {
623
       if (val) {
617
       if (val) {
624
         if (this.addModifyData == 1) {
618
         if (this.addModifyData == 1) {
625
           this.formData = {
619
           this.formData = {
641
         this.showmediate = false;
635
         this.showmediate = false;
642
         this.getTemplateFn();
636
         this.getTemplateFn();
643
         if (this.addModifyData != 1) {
637
         if (this.addModifyData != 1) {
644
-          this.caseApplicationSelectByIdFn(this.caseData.id);
638
+          await this.getIdTypeFn();
639
+          await this.caseApplicationSelectByIdFn(this.caseData.id);
645
         }
640
         }
646
       }
641
       }
647
     },
642
     },
648
   },
643
   },
649
   created() {
644
   created() {
650
-    console.log(this.formData, "000000000000000000")
651
     // this.getUserInfoFn();
645
     // this.getUserInfoFn();
646
+    this.getIdTypeFn();
652
   },
647
   },
653
   methods: {
648
   methods: {
649
+    /** 获取证件类型 */
650
+    getIdTypeFn(){
651
+      getIdType().then(res=>{
652
+        this.idTypeList = res.data;
653
+      })
654
+    },
654
     /** 切换申请类型 */
655
     /** 切换申请类型 */
655
     changeApplyType(val) {
656
     changeApplyType(val) {
656
       console.log(val, "变化");
657
       console.log(val, "变化");
669
       })
670
       })
670
     },
671
     },
671
     /** 根据案件id获取对应信息 */
672
     /** 根据案件id获取对应信息 */
672
-    caseApplicationSelectByIdFn(data) {
673
+    async caseApplicationSelectByIdFn(data) {
673
       this.applicantEvidence = [];
674
       this.applicantEvidence = [];
674
       this.respondentEvidence = [];
675
       this.respondentEvidence = [];
675
-      this.showEvidence = false;
676
-      caseApplicationSelectById({ id: data }).then((res) => {
676
+      await caseApplicationSelectById({ id: data }).then((res) => {
677
         res.data.affiliate.respondentSex = Number(res.data.affiliate.respondentSex)
677
         res.data.affiliate.respondentSex = Number(res.data.affiliate.respondentSex)
678
         this.formData = res.data;
678
         this.formData = res.data;
679
         this.formData.caseAttachList.forEach((item) => {
679
         this.formData.caseAttachList.forEach((item) => {
712
     },
712
     },
713
     /** 查看证据 */
713
     /** 查看证据 */
714
     fileDetil(val) {
714
     fileDetil(val) {
715
-      window.open(this.fileURL + val);
715
+      // window.open(this.fileURL + val);
716
+      this.$router.push({ path: '/onlyoffice', query: { id: val, flag: 0 } })
716
     },
717
     },
717
     /** 查看证据 */
718
     /** 查看证据 */
718
     toPreview(val) {
719
     toPreview(val) {
899
   height: 700px !important;
900
   height: 700px !important;
900
   overflow: auto !important;
901
   overflow: auto !important;
901
 }
902
 }
902
-::v-deep .el-input--medium .el-input__inner{
903
+
904
+::v-deep .el-input--medium .el-input__inner {
903
   height: 40px;
905
   height: 40px;
904
   line-height: 40px;
906
   line-height: 40px;
905
 }
907
 }

+ 4
- 3
src/views/caseManagement/components/mediation.vue Просмотреть файл

81
         <el-col :span="24">
81
         <el-col :span="24">
82
           <el-form-item label="调解书:" v-if="recordArrMediate.length > 0">
82
           <el-form-item label="调解书:" v-if="recordArrMediate.length > 0">
83
             <div v-for="(item, index) in recordArrMediate" :key="index" style="color: blue">
83
             <div v-for="(item, index) in recordArrMediate" :key="index" style="color: blue">
84
-              <a href="#" @click="toFileMediate(item.annexPath)">{{ item.annexName }}</a>
84
+              <a href="#" @click="toFileMediate(item.onlyOfficeFileId)">{{ item.annexName }}</a>
85
             </div>
85
             </div>
86
           </el-form-item>
86
           </el-form-item>
87
         </el-col>
87
         </el-col>
289
     toFile2(annexPath) {
289
     toFile2(annexPath) {
290
       window.open(window.location.origin + "/API" + annexPath, "_black");
290
       window.open(window.location.origin + "/API" + annexPath, "_black");
291
     },
291
     },
292
-    toFileMediate(annexPath) {
293
-      window.open(window.location.origin + "/API" + annexPath, "_black");
292
+    toFileMediate(val) {
293
+      // window.open(window.location.origin + "/API" + annexPath, "_black");
294
+      this.$router.push({ path: '/onlyoffice', query: {id:val,flag:1} })
294
     },
295
     },
295
     /** 生成调解书 */
296
     /** 生成调解书 */
296
     mediationFn(data) {
297
     mediationFn(data) {

+ 121
- 0
src/views/onlyoffice/onlyoffice.vue Просмотреть файл

1
+<template>
2
+    <div style="width: 100%;height: 100%;">
3
+        <div id="placeholder"></div>
4
+    </div>
5
+</template>
6
+
7
+<script>
8
+import { getOnlyoffice, saveOnlyOfficeFile } from "@/api/onlyoffice/onlyoffice"
9
+import store from "@/store"
10
+import axios from 'axios'
11
+export default {
12
+    props: [],
13
+    data() {
14
+        return {
15
+            config: {},
16
+            flag: 0,
17
+            userId: store.getters.userId,
18
+            websock: null
19
+        };
20
+    },
21
+    destroyed() {
22
+        //页面销毁时关闭ws连接
23
+        if (this.websock) {
24
+            this.websock.close() // 关闭websocket
25
+        }
26
+    },
27
+    methods: {
28
+        getConfig(id) {
29
+            let edit = edit;
30
+            if (this.flag == 0) {
31
+                edit = 'view';
32
+            } else {
33
+                edit = 'edit'
34
+            }
35
+            axios.get(`http://121.40.189.20:9090/onlyOfficeConfig/${edit}/${id}/${this.userId}/desktop/true`).then(res => {
36
+                this.config = res.data;
37
+                // this.config.callbackUrl = this.config.callbackUrl + `/${this.userId}`;
38
+                console.log(res.data,"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO");
39
+                var docEditor = new DocsAPI.DocEditor("placeholder", this.config);
40
+            })
41
+        },
42
+        //初始化weosocket
43
+        initWebSocket() {
44
+            if (typeof (WebSocket) === "undefined") {
45
+                alert("您的浏览器不支持WebSocket")
46
+                return false
47
+            }
48
+            const wsuri = `ws://121.40.189.20:9090/api/websocket/${this.userId}` // websocket地址
49
+            this.websock = new WebSocket(wsuri)
50
+            this.websock.onopen = this.websocketonopen
51
+            this.websock.onmessage = this.websocketonmessage
52
+            this.websock.onerror = this.websocketonerror
53
+            this.websock.onclose = this.websocketclose
54
+        },
55
+        //连接成功
56
+        websocketonopen() {
57
+            console.log('WebSocket连接成功')
58
+        },
59
+        //接收后端返回的数据
60
+        websocketonmessage(e) {
61
+            let dataJson = e.data;
62
+            if (dataJson != "conn_success") {
63
+                dataJson = JSON.parse(dataJson);
64
+            }
65
+            if (dataJson.caseId) {
66
+                saveOnlyOfficeFile({
67
+                    caseAppliId: Number(dataJson.caseId),
68
+                    annexName: dataJson.fileName,
69
+                    annexPath: dataJson.filePath,
70
+                    onlyOfficeFileId: dataJson.fileId
71
+                }).then(res => {
72
+                    this.websock.send()
73
+                })
74
+            }
75
+            // 在这里使用后端返回的数据,对数据进行处理渲染
76
+        },
77
+        //连接建立失败重连
78
+        websocketonerror(e) {
79
+            console.log(`连接失败的信息:`, e)
80
+            this.initWebSocket() // 连接失败后尝试重新连接
81
+        },
82
+        //关闭连接
83
+        websocketclose(e) {
84
+            console.log('断开连接', e)
85
+        },
86
+        // 点击按钮
87
+        // btnClick() {
88
+        //     // 因为需求是每次点击都是发起不同ws连接,拿到的数据也不一致,所以连接前要先断开上次的连接
89
+        //     if (this.websock) {
90
+        //         this.websock.close() // 关闭websocket连接
91
+        //     }
92
+        //     this.initWebSocket() // 初始化weosocket,发起连接
93
+        //     // 这里使用定时器是为了等待连接后才发送数据,避免错误
94
+        //     setTimeout(() => {
95
+        //         //添加状态判断,当为OPEN时,前端发送消息给后端
96
+        //         if (this.websock.readyState === 1) {
97
+        //             // 把后台需要的参数数据传过去
98
+        //             let obj = {
99
+        //                 jobId: 111,
100
+        //                 token: 'xxxxx',
101
+        //                 message: 'send ok'
102
+        //             }
103
+        //             //发给后端的数据需要字符串化
104
+        //             this.websock.send(JSON.stringify(obj))
105
+        //         }
106
+        //     }, 500)
107
+        // }
108
+    },
109
+    mounted() {
110
+        let id = this.$route.query.id;
111
+        this.flag = this.$route.query.flag;
112
+        this.getConfig(id);
113
+        this.initWebSocket();
114
+        console.log(this.userId, "PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP");
115
+    },
116
+    watch: {
117
+
118
+    }
119
+};
120
+</script>
121
+<style lang="scss" scoped></style>

+ 10
- 10
src/views/register.vue Просмотреть файл

30
       <el-form-item prop="idType">
30
       <el-form-item prop="idType">
31
         <el-select v-model="registerForm.idType" placeholder="证件类型" auto-complete="off" style="width: 100%;">
31
         <el-select v-model="registerForm.idType" placeholder="证件类型" auto-complete="off" style="width: 100%;">
32
           <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
32
           <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
33
-          <el-option v-for="item in idTypeList" :key="item.id" :label="item.value" :value="item.id">
33
+          <el-option v-for="item in idTypeList" :key="Number(item.dictValue)" :label="item.dictLabel" :value="Number(item.dictValue)">
34
 
34
 
35
           </el-option>
35
           </el-option>
36
         </el-select>
36
         </el-select>
105
 </template>
105
 </template>
106
 
106
 
107
 <script>
107
 <script>
108
-import { getCodeImg, register, sendCode, wxregister,verifyUserName } from "@/api/login";
108
+import { getCodeImg, register, sendCode, wxregister,verifyUserName,getIdType } from "@/api/login";
109
 import { listRoleNotoken } from "@/api/system/role.js"
109
 import { listRoleNotoken } from "@/api/system/role.js"
110
 export default {
110
 export default {
111
   name: "Register",
111
   name: "Register",
215
         }
215
         }
216
       ],
216
       ],
217
       idTypeList:[
217
       idTypeList:[
218
-      {
219
-          value:'身份证',
220
-          id:0
221
-        },
222
-        {
223
-          value:'护照',
224
-          id:1
225
-        }
218
+      
226
       ]
219
       ]
227
     };
220
     };
228
   },
221
   },
229
   created() {
222
   created() {
230
     this.getCode();
223
     this.getCode();
231
     this.getListRole();
224
     this.getListRole();
225
+    this.getIdTypeFn();
232
   },
226
   },
233
   methods: {
227
   methods: {
234
     changeInput(){
228
     changeInput(){
235
       verifyUserName({userName:this.registerForm.userName})
229
       verifyUserName({userName:this.registerForm.userName})
236
     },
230
     },
231
+    /** 获取证件类型 */
232
+    getIdTypeFn(){
233
+      getIdType().then(res=>{
234
+        this.idTypeList = res.data;
235
+      })
236
+    },
237
     /**获取角色 */
237
     /**获取角色 */
238
     getListRole() {
238
     getListRole() {
239
       listRoleNotoken().then(res => {
239
       listRoleNotoken().then(res => {