|
@@ -37,14 +37,16 @@ import MenuTreeItem from "@/components/MenuTreeItem";
|
|
import menuApi from "@/api/sys/menu";
|
|
import menuApi from "@/api/sys/menu";
|
|
import userApi from "@/api/sys/user";
|
|
import userApi from "@/api/sys/user";
|
|
import messageApi from "@/api/base/message";
|
|
import messageApi from "@/api/base/message";
|
|
|
|
+import {mapState,mapMutations, mapActions} from 'vuex';
|
|
|
|
+import insuranceApplicationApi from "@/api/business/insuranceApplication";
|
|
|
|
+import approvalApi from "@/api/business/approval";
|
|
|
|
+
|
|
|
|
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- menuList: [],
|
|
|
|
loading: false,
|
|
loading: false,
|
|
user: {},
|
|
user: {},
|
|
- messageNum: 0,
|
|
|
|
collapse: false
|
|
collapse: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -58,13 +60,20 @@ export default {
|
|
"icon-icon_left_arrow" : this.collapse,
|
|
"icon-icon_left_arrow" : this.collapse,
|
|
"icon-icon_right_arrow" : !this.collapse
|
|
"icon-icon_right_arrow" : !this.collapse
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ ...mapState('menu', {
|
|
|
|
+ menuList: state => state.menuList
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- // created() {
|
|
|
|
- // //获取未读消息数
|
|
|
|
- // this.getUnReadMessageNum();
|
|
|
|
- // },
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapMutations('menu',[
|
|
|
|
+ 'setMenuList'
|
|
|
|
+ ]),
|
|
|
|
+ ...mapActions('menu',[
|
|
|
|
+ 'getUnReadMessageNum',
|
|
|
|
+ 'getInsuranceApplicationNum',
|
|
|
|
+ 'getInsurancePolicyNum'
|
|
|
|
+ ]),
|
|
handleOpen(key, keyPath) {
|
|
handleOpen(key, keyPath) {
|
|
console.log(key, keyPath);
|
|
console.log(key, keyPath);
|
|
},
|
|
},
|
|
@@ -72,33 +81,12 @@ export default {
|
|
console.log(key, keyPath);
|
|
console.log(key, keyPath);
|
|
},
|
|
},
|
|
handleSelect(key, keyPath) {
|
|
handleSelect(key, keyPath) {
|
|
- //console.log(key, keyPath);
|
|
|
|
this.$router.push({ path: key });
|
|
this.$router.push({ path: key });
|
|
},
|
|
},
|
|
logout() {
|
|
logout() {
|
|
this.$store.dispatch("user/logout").then(() => {
|
|
this.$store.dispatch("user/logout").then(() => {
|
|
this.$router.push({ path: "/login" });
|
|
this.$router.push({ path: "/login" });
|
|
});
|
|
});
|
|
- }, //获取未读消息数
|
|
|
|
- getUnReadMessageNum() {
|
|
|
|
- messageApi.getMessageCount().then(resp => {
|
|
|
|
- if (resp.data.result) {
|
|
|
|
- this.messageNum = resp.data.data;
|
|
|
|
- this.resetMenu();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- //定义菜单的未读消息数
|
|
|
|
- resetMenu() {
|
|
|
|
- //定义菜单的未读消息数
|
|
|
|
- var menuList = this.menuList;
|
|
|
|
- console.log(menuList);
|
|
|
|
- for (var key in menuList) {
|
|
|
|
- if (menuList[key]["menuName"] == "我的消息") {
|
|
|
|
- menuList[key]["msgNum"] = this.messageNum; //this.messageNum;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.menuList = menuList;
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
@@ -121,8 +109,14 @@ export default {
|
|
|
|
|
|
var jsonData = response.data;
|
|
var jsonData = response.data;
|
|
|
|
|
|
- this.menuList = jsonData.data;
|
|
|
|
|
|
+ this.setMenuList(jsonData.data);
|
|
|
|
+
|
|
this.getUnReadMessageNum();
|
|
this.getUnReadMessageNum();
|
|
|
|
+
|
|
|
|
+ this.getInsuranceApplicationNum();
|
|
|
|
+
|
|
|
|
+ this.getInsurancePolicyNum();
|
|
|
|
+
|
|
this.loading = false;
|
|
this.loading = false;
|
|
})
|
|
})
|
|
.catch(exception => {
|
|
.catch(exception => {
|