处理字典数据
Showing
2 changed files
with
24 additions
and
0 deletions
... | @@ -5,14 +5,32 @@ | ... | @@ -5,14 +5,32 @@ |
5 | </template> | 5 | </template> |
6 | 6 | ||
7 | <script> | 7 | <script> |
8 | import { getDdicByMC } from "../src/api/common"; | ||
8 | export default { | 9 | export default { |
9 | mounted() { | 10 | mounted() { |
10 | window.addEventListener("unload", this.saveState); | 11 | window.addEventListener("unload", this.saveState); |
12 | this.getDic(); | ||
11 | }, | 13 | }, |
12 | methods: { | 14 | methods: { |
13 | saveState() { | 15 | saveState() { |
14 | sessionStorage.setItem("state", JSON.stringify(this.$store.state)); | 16 | sessionStorage.setItem("state", JSON.stringify(this.$store.state)); |
15 | }, | 17 | }, |
18 | //请求字典数据 | ||
19 | getDic() { | ||
20 | debugger | ||
21 | let s = this.$store.state; | ||
22 | s.zjzlList = s.zjzlList.length == 0 ? this.getDicData("证件种类") : s.zjzlList; | ||
23 | s.gjList = s.gjList.length == 0 ? this.getDicData("国家和地区") : s.gjList; | ||
24 | s.ssList = s.ssList.length == 0 ? this.getDicData("省市") : s.ssList; | ||
25 | s.qlrlxList = s.qlrlxList.length == 0 ? this.getDicData("权利人类型") : s.qlrlxList; | ||
26 | s.xbList = s.xbList.length == 0 ? this.getDicData("性别") : s.xbList; | ||
27 | s.sshyList = s.sshyList.length == 0 ? this.getDicData("国民经济行业分类代码") : s.sshyList; | ||
28 | }, | ||
29 | getDicData(name) { | ||
30 | getDdicByMC(name).then((res) => { | ||
31 | return res.result; | ||
32 | }); | ||
33 | }, | ||
16 | }, | 34 | }, |
17 | }; | 35 | }; |
18 | </script> | 36 | </script> | ... | ... |
... | @@ -13,6 +13,12 @@ const store = new Vuex.Store({ | ... | @@ -13,6 +13,12 @@ const store = new Vuex.Store({ |
13 | xzqList: [], | 13 | xzqList: [], |
14 | djqList: [], | 14 | djqList: [], |
15 | djzqList: [], | 15 | djzqList: [], |
16 | zjzlList:[], | ||
17 | gjList:[], | ||
18 | ssList:[], | ||
19 | qlrlxList:[], | ||
20 | xbList:[], | ||
21 | sshyList:[], | ||
16 | //创建自然幢时需要用到的临时存储信息 | 22 | //创建自然幢时需要用到的临时存储信息 |
17 | zrzbsm: '', | 23 | zrzbsm: '', |
18 | xmmc: '', | 24 | xmmc: '', | ... | ... |
-
Please register or sign in to post a comment