You need to sign in or sign up before continuing.
Commit 4d6d53a0 authored by 李鹏 's avatar 李鹏

格式化代码

parent 5e712cc7
...@@ -4,17 +4,22 @@ ...@@ -4,17 +4,22 @@
<bg-menu :path="nowParent.path" v-if="menuShow" @openMsg="openMsg"></bg-menu> <bg-menu :path="nowParent.path" v-if="menuShow" @openMsg="openMsg"></bg-menu>
<div class="container" :class="menuShow ? '' : 'full_screen'" v-if="pageShow"> <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" :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"> <div class="bg-main view">
<router-view /> <router-view />
</div> </div>
</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"> <div class="bg-main view">
<login></login> <login></login>
</div> </div>
</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"> <div class="bg-main view">
<page404></page404> <page404></page404>
</div> </div>
...@@ -25,131 +30,127 @@ ...@@ -25,131 +30,127 @@
</template> </template>
<script> <script>
import bgMenu from '@/components/bg-menu.vue' import bgMenu from "@/components/bg-menu.vue";
import login from '@/page/login/index.vue' import login from "@/page/login/index.vue";
import page404 from '@/page/404.vue' import page404 from "@/page/404.vue";
export default { export default {
components:{ components: {
bgMenu, bgMenu,
login, login,
page404, page404,
}, },
computed:{ computed: {
msgBoxFlag(){ msgBoxFlag() {
return this.$store.state.msgBoxFlag return this.$store.state.msgBoxFlag;
}, },
userInfo() { userInfo() {
return this.$store.state.userInfo || {}; return this.$store.state.userInfo || {};
}, },
navMenu(){ navMenu() {
return this.$store.state.menu return this.$store.state.menu;
}, },
menuObj(){ menuObj() {
return this.$store.state.menuObj return this.$store.state.menuObj;
}, },
navShow(){ navShow() {
return false||!['/','/404','/login'].includes(this.$route.path) return false || !["/", "/404", "/login"].includes(this.$route.path);
}, },
pageShow(){ pageShow() {
return false||!['/404','/login'].includes(this.$route.path) return false || !["/404", "/login"].includes(this.$route.path);
}, },
rowPath(){ rowPath() {
if(this.pageShow&&this.$store.state.userInfo){ if (this.pageShow && this.$store.state.userInfo) {
return this.menuObj[this.$route.path]&&this.menuObj[this.$route.path].rowPath return this.menuObj[this.$route.path] && this.menuObj[this.$route.path].rowPath;
}else{ } else {
return '' return "";
} }
}, },
nowParent(){ nowParent() {
if(this.pageShow&&this.$store.state.userInfo){ if (this.pageShow && this.$store.state.userInfo) {
// console.log(2222222) // console.log(2222222)
// console.log(this.navMenu) // console.log(this.navMenu)
// console.log(this.rowPath) // console.log(this.rowPath)
return this.rowPath?this.navMenu[this.rowPath.slice(1,2)]:'' return this.rowPath ? this.navMenu[this.rowPath.slice(1, 2)] : "";
} else {
}else{ return "";
return ''
} }
}, },
menuShow() { menuShow() {
return false||!["/ui-example"].includes(this.$route.path) return false || !["/ui-example"].includes(this.$route.path);
} },
}, },
watch:{ watch: {
msgBoxFlag(n,o){ msgBoxFlag(n, o) {
this.readFlag = !this.readFlag this.readFlag = !this.readFlag;
}, },
userInfo: { userInfo: {
handler() { handler() {
this.initMsg() this.initMsg();
}, },
deep: true, deep: true,
} },
}, },
data(){ data() {
return{ return {
readFlag:false, readFlag: false,
menuIndex:'', menuIndex: "",
} };
}, },
created(){ created() {
// this.initMsg() // this.initMsg()
}, },
mounted() { mounted() {},
}, methods: {
methods:{
openMsg(data) { openMsg(data) {
this.readFlag = !this.readFlag; this.readFlag = !this.readFlag;
}, },
initMsg() { initMsg() {
if(this.userInfo && this.userInfo.system_id) { if (this.userInfo && this.userInfo.system_id) {
this.$trace.setOptionValue('userId',this.userInfo.system_id) this.$trace.setOptionValue("userId", this.userInfo.system_id);
// this.$trace.setOptionValue('userType',this.userInfo.userType) // this.$trace.setOptionValue('userType',this.userInfo.userType)
// this.$trace.setOptionValue('roleId',this.userInfo.roleIds.join(',')) // 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){ pathToData(data, path) {
let arr = path.split(".");
let arr = path.split('.') let temp = null;
let temp = null let tempName = "";
let tempName = '' let tempPath = "";
let tempPath = '' arr.forEach((e, idx) => {
arr.forEach((e,idx) => { if (idx == 1) {
temp = data[e];
if(idx==1){ tempName = data[e].menuName;
temp = data[e] tempPath = data[e].path;
tempName = data[e].menuName data = data[e];
tempPath = data[e].path
data = data[e]
} }
if(idx==2){ if (idx == 2) {
if(data.children&&data.children.length){ if (data.children && data.children.length) {
temp = data.children[e] temp = data.children[e];
data = data.children[e] data = data.children[e];
} }
} }
}); });
return { return {
menuName:tempName, menuName: tempName,
path:tempPath, path: tempPath,
children:[temp] children: [temp],
} };
}, },
highlightParentRule(pathArr){ highlightParentRule(pathArr) {
return pathArr.includes(this.$route.path) return pathArr.includes(this.$route.path);
}, },
ada(){ ada() {
console.log(12312); console.log(12312);
} },
} },
} };
</script> </script>
<style> <style>
#app{ #app {
height: 100%; height: 100%;
} }
.container{ .container {
width: 100%; width: 100%;
height: calc(100% - 56px); height: calc(100% - 56px);
overflow: hidden; overflow: hidden;
...@@ -160,10 +161,10 @@ export default { ...@@ -160,10 +161,10 @@ export default {
.full_screen .bg-main { .full_screen .bg-main {
overflow-x: hidden; overflow-x: hidden;
} }
.con-nav{ .con-nav {
float: left; float: left;
} }
.view{ .view {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
background-color: #ebedf2; 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