@@ -41,25 +46,25 @@ import page404 from '@/page/404.vue'
import registe from '@/page/registe/index.vue'
import password from '@/page/password/index.vue'
export default {
- components:{
- bgMenu,
+ components: {
+ bgMenu,
login,
page404,
registe,
password
},
- computed:{
- msgBoxFlag(){
- return this.$store.state.msgBoxFlag
+ computed: {
+ msgBoxFlag() {
+ return this.$store.state.msgBoxFlag;
},
userInfo() {
return this.$store.state.userInfo || {};
},
- navMenu(){
- return this.$store.state.menu
+ navMenu() {
+ return this.$store.state.menu;
},
- menuObj(){
- return this.$store.state.menuObj
+ menuObj() {
+ return this.$store.state.menuObj;
},
navShow(){
return false||!['/','/404','/login','/registe','/password'].includes(this.$route.path)
@@ -67,103 +72,99 @@ export default {
pageShow(){
return false||!['/404','/login','/registe','/password'].includes(this.$route.path)
},
- rowPath(){
- if(this.pageShow&&this.$store.state.userInfo){
- return this.menuObj[this.$route.path]&&this.menuObj[this.$route.path].rowPath
- }else{
- return ''
+ rowPath() {
+ if (this.pageShow && this.$store.state.userInfo) {
+ return this.menuObj[this.$route.path] && this.menuObj[this.$route.path].rowPath;
+ } else {
+ return "";
}
},
- nowParent(){
- if(this.pageShow&&this.$store.state.userInfo){
+ nowParent() {
+ if (this.pageShow && this.$store.state.userInfo) {
// console.log(2222222)
// console.log(this.navMenu)
// console.log(this.rowPath)
- return this.rowPath?this.navMenu[this.rowPath.slice(1,2)]:''
-
- }else{
- return ''
+ return this.rowPath ? this.navMenu[this.rowPath.slice(1, 2)] : "";
+ } else {
+ return "";
}
},
menuShow() {
- return false||!["/ui-example"].includes(this.$route.path)
- }
+ return false || !["/ui-example"].includes(this.$route.path);
+ },
},
- watch:{
- msgBoxFlag(n,o){
- this.readFlag = !this.readFlag
+ watch: {
+ msgBoxFlag(n, o) {
+ this.readFlag = !this.readFlag;
},
userInfo: {
- handler() {
- this.initMsg()
+ handler() {
+ this.initMsg();
},
deep: true,
- }
+ },
},
- data(){
- return{
- readFlag:false,
- menuIndex:'',
- }
+ data() {
+ return {
+ readFlag: false,
+ menuIndex: "",
+ };
},
- created(){
+ created() {
// this.initMsg()
},
- mounted() {
- },
- methods:{
+ mounted() {},
+ methods: {
openMsg(data) {
this.readFlag = !this.readFlag;
},
initMsg() {
- if(this.userInfo && this.userInfo.system_id) {
- this.$trace.setOptionValue('userId',this.userInfo.system_id)
+ if (this.userInfo && this.userInfo.system_id) {
+ this.$trace.setOptionValue("userId", this.userInfo.system_id);
// this.$trace.setOptionValue('userType',this.userInfo.userType)
// this.$trace.setOptionValue('roleId',this.userInfo.roleIds.join(','))
- this.$trace.setOptionValue('organization',this.userInfo.organization_id)
+ this.$trace.setOptionValue("organization", this.userInfo.organization_id);
}
},
- pathToData(data,path){
-
- let arr = path.split('.')
- let temp = null
- let tempName = ''
- let tempPath = ''
- arr.forEach((e,idx) => {
-
- if(idx==1){
- temp = data[e]
- tempName = data[e].menuName
- tempPath = data[e].path
- data = data[e]
+ pathToData(data, path) {
+ let arr = path.split(".");
+ let temp = null;
+ let tempName = "";
+ let tempPath = "";
+ arr.forEach((e, idx) => {
+ if (idx == 1) {
+ temp = data[e];
+ tempName = data[e].menuName;
+ tempPath = data[e].path;
+ data = data[e];
}
- if(idx==2){
- if(data.children&&data.children.length){
- temp = data.children[e]
- data = data.children[e]
+ if (idx == 2) {
+ if (data.children && data.children.length) {
+ temp = data.children[e];
+ data = data.children[e];
}
}
});
return {
- menuName:tempName,
- path:tempPath,
- children:[temp]
- }
+ menuName: tempName,
+ path: tempPath,
+ children: [temp],
+ };
},
- highlightParentRule(pathArr){
- return pathArr.includes(this.$route.path)
+ highlightParentRule(pathArr) {
+ return pathArr.includes(this.$route.path);
},
- ada(){
+ ada() {
console.log(12312);
- }
- }
-}
+ },
+ },
+};