panhui 4 лет назад
Родитель
Сommit
d1dc0018e3
3 измененных файлов с 26 добавлено и 1 удалено
  1. 1 0
      src/App.vue
  2. 12 1
      src/mixins/nodeHtml.js
  3. 13 0
      src/store/index.js

+ 1 - 0
src/App.vue

@@ -39,6 +39,7 @@ export default {
         this.$store.dispatch('getSystemInfo');
         this.$store.dispatch('getBarHeight');
         this.$store.dispatch('getArea');
+        this.$store.dispatch('getSpecail');
     },
     onShow(options) {
         // Do something when show.

+ 12 - 1
src/mixins/nodeHtml.js

@@ -1,7 +1,18 @@
+import { mapState } from 'vuex';
 export default {
+    computed: {
+        ...mapState(['specialVal'])
+    },
     data() {
         return {
-            specialVal: [[/±/g, '±'], [/á/g, 'á'], [/º/g, 'º'], [/®/g, '®'], [/Ø/g, 'Ø']]
+            // specialVal: [
+            //     [/±/g, '±'],
+            //     [/á/g, 'á'],
+            //     [/º/g, 'º'],
+            //     [/®/g, '®'],
+            //     [/Ø/g, 'Ø'],
+            //     [/Ø/g, 'Ø']
+            // ]
         };
     },
     methods: {

+ 13 - 0
src/store/index.js

@@ -23,6 +23,7 @@ export default new Vuex.Store({
         userMoreInfo: {},
         emailInfo: {},
         messageList: [],
+        specialVal: [],
         barInfo: {},
         rpx: 2,
         nodeEnv: false,
@@ -31,6 +32,9 @@ export default new Vuex.Store({
             '{"phone":"13365135976","sex":"male","nickname":"蒋耀忠","position":"总经理","chCompanyName":"NE洛阳新能轴承制造有限公司","email":"11@qq.com.cn","products":[{"chName":"MS22-8多轴数控机床","enName":"MultiLine MS22-8","id":6296,"mainPicture":"https://imt.oss-cn-hangzhou.aliyuncs.com/image/2020-11-26-18-08-34MaKXCzxH.png"}]}'
     },
     mutations: {
+        setSpecial(state, val) {
+            state.specialVal = val;
+        },
         setSafeAreaTop(state, val) {
             state.safeAreaTop = val;
         },
@@ -230,6 +234,15 @@ export default new Vuex.Store({
                     });
                 }
             });
+        },
+        getSpecail(context) {
+            http.http.get('/sysConfig/get/SPECIAL_VAL').then(res => {
+                let list = res.value.split('_;_').map(item => {
+                    return [new RegExp(item.split('_,_')[0], 'g'), item.split('_,_')[1]];
+                });
+                console.log(list);
+                context.commit('setSpecial', list);
+            });
         }
     }
 });