This commit is contained in:
宋伟佳
2021-10-15 15:00:48 +08:00
parent 1968fd8b0a
commit 7142b4f322
3 changed files with 97 additions and 61 deletions
+24 -8
View File
@@ -42,6 +42,7 @@
<script> <script>
import {mapGetters, mapState} from 'vuex' import {mapGetters, mapState} from 'vuex'
import { webLoginType } from '@/sysConfig'
export default { export default {
name: 'App', name: 'App',
data () { data () {
@@ -61,17 +62,31 @@
confirmButtonClass: 'common-button-primary', confirmButtonClass: 'common-button-primary',
roundButton: false roundButton: false
}).then(() => { }).then(() => {
if(webLoginType != null && webLoginType === 'idm' ) {
window.location.href= 'http://testsso1.foton.com.cn/logout?service='
// this.$http.post('logout', {}, res => {
// window.location.href= 'http://testsso1.foton.com.cn/logout?service='
// })
}else if(webLoginType != null && webLoginType === 'dev'){
this.$store.commit('setTypeFlag', 'loginOut')
this.$http.get('logout', {}, {
_this: this
}, res => {
this.$store.dispatch('logout')
this.$router.push('/login')
}, e => {})
}
// this.$http.post('/logout', {}, res => { // this.$http.post('/logout', {}, res => {
// window.location.href = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&redirect_uri=http://127.0.0.1:9090&response_type=code' // window.location.href = 'http://testsso1.foton.com.cn/oauth2.0/authorize?client_id=app_slrs&redirect_uri=http://127.0.0.1:9090&response_type=code'
// }) // })
// return // return
this.$store.commit('setTypeFlag', 'loginOut') // this.$store.commit('setTypeFlag', 'loginOut')
this.$http.get('logout', {}, { // this.$http.get('logout', {}, {
_this: this // _this: this
}, res => { // }, res => {
this.$store.dispatch('logout') // this.$store.dispatch('logout')
this.$router.push('/login') // this.$router.push('/login')
}, e => {}) // }, e => {})
}).catch(() => { }).catch(() => {
}) })
} }
@@ -271,7 +286,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
background: url('~@/assets/images/shangqi/home/BG.png') no-repeat; background-color: #F0F2F5;
//background: url('~@/assets/images/shangqi/home/BG.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
font-family: MicrosoftYaHei,微软雅黑; font-family: MicrosoftYaHei,微软雅黑;
& > div{ & > div{
+66 -47
View File
@@ -3,8 +3,13 @@
<div class="header-left"> <div class="header-left">
<span class="logo" @click="toHome" title="回到首页"></span> <span class="logo" @click="toHome" title="回到首页"></span>
</div> </div>
<div class="header-center">
<span style="color: #fff; line-height: 65px; font-size: 20px;">
标准法规管理系统 standard and regulations management system
</span>
</div>
<div class="header-right"> <div class="header-right">
<span class="date">{{currentTime}}</span> <span class="date">{{ currentTime }}</span>
<span class="divide-line"> | </span> <span class="divide-line"> | </span>
<span class="user-img"></span> <span class="user-img"></span>
<span class="user">{{ $store.getters.userInfo.uName }}</span> <span class="user">{{ $store.getters.userInfo.uName }}</span>
@@ -16,7 +21,7 @@
> >
<div class="iconfont" style="color: #fff;"><i class="el-icon-arrow-down"></i></div> <div class="iconfont" style="color: #fff;"><i class="el-icon-arrow-down"></i></div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item name="logout" command="logout">{{$t('m.exit')}}</el-dropdown-item> <el-dropdown-item name="logout" command="logout">{{ $t("m.exit") }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
@@ -25,78 +30,84 @@
</template> </template>
<script> <script>
import {mapGetters, mapMutations} from 'vuex' import { mapGetters, mapMutations } from "vuex";
export default { export default {
name: 'useImg', name: "useImg",
data () { data() {
return { return {
// 当前系统时间 // 当前系统时间
currentTime: '', currentTime: "",
userInfoVisible: false userInfoVisible: false
} };
}, },
methods: { methods: {
toHome () { toHome() {
this.$router.push('/home2') this.$router.push("/home2");
}, },
// 获取当前时间 // 获取当前时间
getTime () { getTime() {
this.currentTime = this.$dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss') this.currentTime = this.$dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss");
}, },
// 用户菜单栏点击 // 用户菜单栏点击
userInfoOpen (name) { userInfoOpen(name) {
switch (name) { switch (name) {
case 'personal': case "personal":
this.$router.push('/personal') this.$router.push("/personal");
break break;
case 'logout': case "logout":
this.$confirm('您确认要退出吗?', '提示', { this.$confirm("您确认要退出吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning', type: "warning",
confirmButtonClass: 'common-button-primary', confirmButtonClass: "common-button-primary",
roundButton: true roundButton: true
}).then(() => { }).then(() => {
this.userLoginOut() this.userLoginOut();
}).catch(() => {}) }).catch(() => {
break });
break;
} }
}, },
// 用户退出登录 // 用户退出登录
userLoginOut () { userLoginOut() {
this.$http.get('logout', {}, { this.$http.get("logout", {}, {
_this: this _this: this
}, res => { }, res => {
this.$store.dispatch('logout') this.$store.dispatch("logout");
this.$router.push('/sign_in') this.$router.push("/sign_in");
}, e => {}) }, e => {
});
}, },
...mapMutations(['setProcess', 'setDynamicTotal']) ...mapMutations(["setProcess", "setDynamicTotal"])
}, },
mounted () { mounted() {
this.getTime() this.getTime();
}, },
computed: { computed: {
// 用户头像 // 用户头像
userAvator () { userAvator() {
return this.$store.getters.userInfo.avator || require('@/assets/images/avator_default.png') return this.$store.getters.userInfo.avator || require("@/assets/images/avator_default.png");
}, },
uName () { uName() {
return this.$store.getters.userInfo.uName return this.$store.getters.userInfo.uName;
}, },
...mapGetters(['getDynamicTotal', 'getMenuList']) ...mapGetters(["getDynamicTotal", "getMenuList"])
} }
} };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.header{ .header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
background-color: #171E4A;
color: #fff; color: #fff;
.header-left{
.header-left {
text-align: left; text-align: left;
width: 50%; //width: 50%;
.logo { .logo {
display: inline-block; display: inline-block;
width: 160px; width: 160px;
@@ -106,19 +117,25 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.header-right{ .header-center{
width: 49%; width: 70%;
}
.header-right {
//width: 49%;
text-align: right; text-align: right;
line-height: 61px; line-height: 61px;
height: 61px; height: 61px;
display: flex; display: flex;
margin-right: 20px;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
.date{
.date {
display: inline-block; display: inline-block;
margin-right: 20px; margin-right: 20px;
} }
.user-img{
.user-img {
display: inline-block; display: inline-block;
width: 20px; width: 20px;
height: 21px; height: 21px;
@@ -126,11 +143,13 @@ export default {
background-size: 100% 100%; background-size: 100% 100%;
margin-right: 15px; margin-right: 15px;
} }
.divide-line{
.divide-line {
display: inline-block; display: inline-block;
margin-right: 20px; margin-right: 20px;
} }
.user{
.user {
display: inline-block; display: inline-block;
} }
} }
@@ -5,7 +5,7 @@
<div class="standard-search-content"> <div class="standard-search-content">
<div style="position: absolute;left: 0;right: 0;top: 0;bottom: 0;"> <div style="position: absolute;left: 0;right: 0;top: 0;bottom: 0;">
<div class="content-left"> <div class="content-left">
<div class="search"> <div class="search" style="padding: 40px;">
<div class="search-box"> <div class="search-box">
<div class="home-input"> <div class="home-input">
<el-input <el-input
@@ -2565,7 +2565,7 @@
border-bottom-left-radius: 20px; border-bottom-left-radius: 20px;
} }
.standard-search { .standard-search {
padding: 6px 26px; //padding: 6px 26px;
@borderColor: #BFBFBF; @borderColor: #BFBFBF;
height: 100%; height: 100%;
font-size: 14px; font-size: 14px;
@@ -2641,7 +2641,7 @@
} }
@media screen and (min-width: 1920px) { @media screen and (min-width: 1920px) {
.header{ .header{
height: 75px; height: 65px;
} }
} }
.standard-search-content{ .standard-search-content{
@@ -3065,7 +3065,7 @@
} }
.router-link{ .router-link{
position: relative; position: relative;
color: #fff; color: #333;
top: 17px; top: 17px;
left: 44px; left: 44px;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
@@ -3074,7 +3074,7 @@
} }
.router-link1{ .router-link1{
position: relative; position: relative;
color: #fff; color: #333;
top: 17px; top: 17px;
left: 54px; left: 54px;
font-family: PingFang-SC-Medium; font-family: PingFang-SC-Medium;
@@ -3107,7 +3107,8 @@
border-radius: 20px; border-radius: 20px;
flex: 1; flex: 1;
overflow: hidden; overflow: hidden;
margin-top: 20px; //margin-top: 20px;
margin: 20px 26px 0 26px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.all-box__wrap { .all-box__wrap {