Commit 4d6d53a0 authored by 李鹏 's avatar 李鹏

格式化代码

parent 5e712cc7
......@@ -4,17 +4,22 @@
<bg-menu :path="nowParent.path" v-if="menuShow" @openMsg="openMsg"></bg-menu>
<div class="container" :class="menuShow ? '' : 'full_screen'" v-if="pageShow">
<!-- <bg-nav :highlightParentRule="highlightParentRule" :title="nowParent.menuName" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" /> -->
<bg-nav :highlightParentRule="highlightParentRule" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" />
<bg-nav
:highlightParentRule="highlightParentRule"
width="208px"
:list="nowParent.children"
v-show="navShow"
class="con-nav" />
<div class="bg-main view">
<router-view />
</div>
</div>
<div class="container" v-else-if="$route.path=='/login'">
<div class="container" v-else-if="$route.path == '/login'">
<div class="bg-main view">
<login></login>
</div>
</div>
<div class="container" v-else-if="$route.path=='/404'">
<div class="container" v-else-if="$route.path == '/404'">
<div class="bg-main view">
<page404></page404>
</div>
......@@ -25,131 +30,127 @@
</template>
<script>
import bgMenu from '@/components/bg-menu.vue'
import login from '@/page/login/index.vue'
import page404 from '@/page/404.vue'
import bgMenu from "@/components/bg-menu.vue";
import login from "@/page/login/index.vue";
import page404 from "@/page/404.vue";
export default {
components:{
bgMenu,
components: {
bgMenu,
login,
page404,
},
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'].includes(this.$route.path)
navShow() {
return false || !["/", "/404", "/login"].includes(this.$route.path);
},
pageShow(){
return false||!['/404','/login'].includes(this.$route.path)
pageShow() {
return false || !["/404", "/login"].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);
}
}
}
},
},
};
</script>
<style>
#app{
#app {
height: 100%;
}
.container{
.container {
width: 100%;
height: calc(100% - 56px);
overflow: hidden;
......@@ -160,10 +161,10 @@ export default {
.full_screen .bg-main {
overflow-x: hidden;
}
.con-nav{
.con-nav {
float: left;
}
.view{
.view {
height: 100%;
overflow-y: auto;
background-color: #ebedf2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment