Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

肖康 / cloudSystem

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit cf90e32a authored 3 years ago by liangjianmin's avatar liangjianmin
Browse files
Options
  • _('Browse Files')
  • Download
  • Email Patches
  • Plain Diff

js

parent ac9c65bb
Hide whitespace changes
Inline Side-by-side
Showing with 162 additions and 166 deletions
  • src/ajax/index.js
  • src/components/menu.vue
src/ajax/index.js
View file @ cf90e32a
...@@ -15,7 +15,7 @@ export let NODE_ENVS = "/"; ...@@ -15,7 +15,7 @@ export let NODE_ENVS = "/";
switch (envs) { switch (envs) {
case 'development': case 'development':
//开发环境 //开发环境
NODE_ENVS = 'http://192.168.2.164:8080'; NODE_ENVS = 'http://192.168.2.142:8080';
break; break;
case 'test': case 'test':
//测试环境 //测试环境
......
This diff is collapsed. Click to expand it.
src/components/menu.vue
View file @ cf90e32a
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
</a> </a>
<a class="item fl" <a class="item fl"
:class="{'act':(JSON.stringify(item)==JSON.stringify({path: $route.path,title: $route.meta.title,query:$route.query}))}" :class="{'act':(JSON.stringify(item)==JSON.stringify({path: $route.path,title: $route.meta.title,query:$route.query}))}"
@click="tabUrl(item)" v-for="item in tabs"> @click="tabUrl(item)" v-for="item in tabs">
<font class="fl">{{item.title}}</font> <font class="fl">{{item.title}}</font>
<span class="icon iconfont fl" @click.stop="closetab(item.path)"></span> <span class="icon iconfont fl" @click.stop="closetab(item.path)"></span>
</a> </a>
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
</div> </div>
<el-menu class="el-menu-vertical-demo" @open="handleOpen" active-text-color="#1969F9" router <el-menu class="el-menu-vertical-demo" @open="handleOpen" active-text-color="#1969F9" router
:default-active="$route.path" :router="true" :unique-opened="true" @close="handleClose" :default-active="$route.path" :router="true" :unique-opened="true" @close="handleClose"
@select="handleSelect"> @select="handleSelect">
<el-menu-item :index="'/'" :class="{'indextab':isIndexTab}"> <el-menu-item :index="'/'" :class="{'indextab':isIndexTab}">
<template slot="title"> <template slot="title">
<span class="icon iconfont"></span> <span class="icon iconfont"></span>
...@@ -142,178 +142,174 @@ ...@@ -142,178 +142,174 @@
</template> </template>
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Util from "../tool"; import Util from "../tool";
import { import {
Form, Form,
FormItem, FormItem,
Menu, Menu,
MenuItem, MenuItem,
Submenu, Submenu,
MenuItemGroup, MenuItemGroup,
Message, Message,
Dialog, Dialog,
Button Button
} from 'element-ui' } from 'element-ui'
Vue.use(Menu).use(MenuItem).use(MenuItemGroup).use(Submenu).use(Form).use(FormItem).use(Dialog).use(Button); Vue.use(Menu).use(MenuItem).use(MenuItemGroup).use(Submenu).use(Form).use(FormItem).use(Dialog).use(Button);
export default { export default {
name: 'menus', name: 'menus',
props: {}, props: {},
created() { created() {
this.getData(); this.getData();
},
data() {
return {
userinfo: {},
collapse: false,
isIndexTab: true,
tabSure: "",
tabs: "",
dialogVisible: false,
ruleForm: {
name: ''
}, },
data() { rules: {
return { name: [{
userinfo: {}, required: true,
collapse: false, message: '请输入活动名称',
isIndexTab: true, trigger: 'blur'
tabSure: "", }]
tabs: "", }
dialogVisible: false, }
ruleForm: { },
name: '' watch: {
}, $route(to, from) {
rules: { let tab_arr = sessionStorage.getItem('tabs')
name: [{ if (tab_arr) {
required: true, this.tabs = JSON.parse(tab_arr);
message: '请输入活动名称', }
trigger: 'blur'
}]
}
}
},
watch: {
$route(to, from) {
let tab_arr = sessionStorage.getItem('tabs')
if (tab_arr) {
this.tabs = JSON.parse(tab_arr);
}
let app_ = document.getElementById('app'); let app_ = document.getElementById('app');
this.collapse = false this.collapse = false
if (this.collapse) { if (this.collapse) {
app_.setAttribute('style', 'padding-left:62px'); app_.setAttribute('style', 'padding-left:62px');
} else { } else {
app_.setAttribute('style', 'padding-left:226px'); app_.setAttribute('style', 'padding-left:226px');
} }
}
},
mounted() {
this.tabss(this.$route.path)
},
methods: {
getData() {
var userInfo_ = sessionStorage.getItem('userInfox');
if (userInfo_) {
this.userinfo = JSON.parse(userInfo_);
} else {
this.$http('get', "/api/user/getuserinfo").then(res => {
this.userinfo = res.data;
if (res.data) {
sessionStorage.setItem('userInfox', JSON.stringify(res.data));
} }
},
mounted() {
this.tabss(this.$route.path)
},
methods: {
getData() {
var userInfo_ = sessionStorage.getItem('userInfox');
if (userInfo_) {
this.userinfo = JSON.parse(userInfo_);
} else {
this.$http('get', "/api/user/getuserinfo").then(res => {
this.userinfo = res.data;
if(res.data){
sessionStorage.setItem('userInfox', JSON.stringify(res.data));
}
})
}
}, })
tabUrl(item) { }
},
tabUrl(item) {
this.$router.push({
path: item.path,
query: item.query
})
},
changePwd() {
this.dialogVisible = true;
},
tabss(lk) {
if (lk == "/") {
this.tabSure = 1
}
if (lk == "/inquire" || lk == "/quote") {
this.tabSure = 2
}
if (lk == "/list" || lk == "/enter") {
this.tabSure = 3
}
if (lk == "/goods" || lk == "/brand") {
this.tabSure = 4
}
if (lk == "/message") {
this.tabSure = 5
}
let tab_arr = sessionStorage.getItem('tabs')
if (tab_arr) {
this.tabs = JSON.parse(tab_arr);
}
},
closetab(path) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
for (var i = 0; i < tab_arr.length; i++) {
if (tab_arr[i].path == path) {
tab_arr.splice(i, 1);
sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
this.tabs = tab_arr;
if (path == this.$route.path) {
if (i == 0) {
this.$router.push({ this.$router.push({
path: item.path, path: "/",
query: item.query
}) })
}, } else {
changePwd() { this.$router.push({
this.dialogVisible = true; path: tab_arr[i - 1].path,
},
tabss(lk) {
if (lk == "/") {
this.tabSure = 1
}
if (lk == "/inquire" || lk == "/quote") {
this.tabSure = 2
}
if (lk == "/list" || lk == "/enter") {
this.tabSure = 3
}
if (lk == "/goods" || lk == "/brand") {
this.tabSure = 4
}
if (lk == "/message") {
this.tabSure = 5
}
let tab_arr = sessionStorage.getItem('tabs')
if (tab_arr) {
this.tabs = JSON.parse(tab_arr);
}
},
closetab(path) {
let tab_arr = JSON.parse(sessionStorage.getItem('tabs'))
for (var i = 0; i < tab_arr.length; i++) {
if (tab_arr[i].path == path) {
tab_arr.splice(i, 1);
sessionStorage.setItem('tabs', JSON.stringify(tab_arr));
this.tabs = tab_arr;
if (path == this.$route.path) {
if (i == 0) {
this.$router.push({
path: "/",
})
} else {
this.$router.push({
path: tab_arr[i - 1].path,
})
}
}
break;
}
}
},
zk() {
this.collapse = !this.collapse;
let app_ = document.getElementById('app');
if (this.collapse) {
app_.setAttribute('style', 'padding-left:62px');
} else {
app_.setAttribute('style', 'padding-left:226px');
}
},
handleOpen(key, keyPath) {
if (this.$route.path == "/") {
this.isIndexTab = false
}
},
handleClose(key, keyPath) {
if (this.$route.path == "/") {
this.isIndexTab = true
}
},
handleSelect(key, keyPath) {
this.tabss(key)
},
logout() {
this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token');
if (res.err_code === 0) {
window.location.href = '/#/login';
sessionStorage.removeItem('userInfox')
history.go(0);
} else {
Message(res.err_msg);
}
}).catch(err => {
console.log(err.message);
}) })
}
} }
break;
}
}
},
zk() {
this.collapse = !this.collapse;
let app_ = document.getElementById('app');
if (this.collapse) {
app_.setAttribute('style', 'padding-left:62px');
} else {
app_.setAttribute('style', 'padding-left:226px');
}
},
handleOpen(key, keyPath) {
if (this.$route.path == "/") {
this.isIndexTab = false
}
},
handleClose(key, keyPath) {
if (this.$route.path == "/") {
this.isIndexTab = true
} }
},
handleSelect(key, keyPath) {
this.tabss(key)
},
logout() {
this.$http('post', "/auth/logout").then(res => {
Util.delCookie('token');
window.location.href = '/#/login';
sessionStorage.removeItem('userInfox')
history.go(0);
}).catch(err => {
console.log(err.message);
})
}
} }
}
</script> </script>
<style lang="less"> <style lang="less">
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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 sign in to comment