| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778 |
- <template>
- <div id="headside">
- <nav class="navbar user-info-navbar" role="navigation">
- <!-- <i
- v-if="isCollapse"
- :class="[{ 'el-icon-s-unfold left_hide_icon': left_panel_state }, { 'el-icon-s-fold left_show_icon': !left_panel_state }]"
- @click="left_hide"
- ></i> -->
- <span class="title">
- 场馆管理系统
- <em>{{ current }}</em>
- </span>
- <div @click="checkNews">
- <el-badge :value="newnum" class="item" v-if="newnumState">
- <el-button size="small">
- <i class="el-icon-message"></i>
- </el-button>
- </el-badge>
- </div>
- <ul class="user-info-menu pull-right list-unstyled">
- <!-- <img class="lteHead" src="../assets/img/header/lteHead.png" height="26" width="26"/>-->
- <span class="customer_serve logoutBtn" @click="logoutClick">
- <i class="el-icon-switch-button"></i> 退出</span
- >
- <!-- <span class="scrren customer_serve" @click="full_screen" v-if="!screen_full"><i
- class="el-icon-full-screen"></i>全屏</span>
- <span class="scrren customer_serve" @click="cancle_screen" v-if="screen_full"><i
- class="el-icon-full-screen"></i>缩小</span> -->
- <span class="el-dropdown-link customer_serve">{{ user.name }}</span>
- <span class="el-dropdown-link customer_serve shopinfo">
- <span>{{ ShopName }}</span>
- <span>{{ userLevelText }}</span>
- </span>
- </ul>
- </nav>
- </div>
- </template>
- <script>
- import axios from "axios";
- import Global from "../Global.js";
- import { SignOut, ManagerSelfQuery, ShopListQuery } from "../api/getApiRes.js";
- let qs = require("qs");
- export default {
- data() {
- return {
- isCollapse: document.body.clientWidth < 1367,
- user: {
- name: "admin",
- },
- time: "8:30-17:30",
- tel: "0000-0079-000",
- qq: "0000079000",
- newnum: "",
- newnumState: false,
- left_panel_state: true,
- screen_full: false,
- ShopName: "",
- userLevelText: "",
- current: globalcurrentWeek(),
- };
- },
- mounted() {
- this.readNewNum();
- this.getManagerSelfQuery();
- // 定时轮询news
- //设置10s刷新一次数据
- // if (this.timer) {
- // clearInterval(this.timer);
- // }else{
- // this.timer = setInterval(() => {
- // this.readNewNum();
- // },10000)
- // }
- },
- methods: {
- // 隐藏左侧和显示
- left_hide: function() {
- let that = this;
- that.left_panel_state = !that.left_panel_state;
- this.$emit("lefthide");
- // if (!that.left_panel_state) {
- // this.$emit('left_hide_func');
- // } else {
- // this.$emit('right_hide_func');
- // }
- },
- getManagerSelfQuery() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- ManagerSelfQuery(postdata).then((res) => {
- let json = res;
- if (json.Code == 0) {
- that.user.name = json.Rs.Name;
- localStorage.shopId = json.Rs.ShopId;
- localStorage.userLevel = json.Rs.Role.Id;
- localStorage.ServiceId = json.Rs.Shop.ServiceId;
- localStorage.ServiceKey = json.Rs.Shop.ServiceKey;
- that.userLevelText = json.Rs.Role.Name;
- // 1 会员 2 系统 3 店铺 4 教练
- switch (parseInt(json.Rs.Role.Id)) {
- case 1:
- that.userLevel = 1;
- break;
- case 2:
- that.userLevel = 2;
- break;
- case 3:
- that.userLevel = 3;
- break;
- case 4:
- that.userLevel = 4;
- break;
- }
- localStorage.shopId = json.Rs.ShopId;
- this.panelSelect(json.Rs.ShopId);
- } else {
- if (json.Code == 1010) {
- that.$message.error(json.Memo + " 错误码:" + json.Code);
- that.$router.push({ path: "/login", query: { status: 1 } });
- return false;
- } else {
- that.$message.error(json.Memo + " 错误码:" + json.Code);
- }
- }
- });
- },
- // 获取所属店铺
- panelSelect(ShopId) {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- ShopListQuery(postdata).then((res) => {
- let json = res;
- if (json.Code == 0) {
- json.Rs.map(function(item) {
- if (item.ShopID == ShopId) {
- that.ShopName = item.ShopName;
- }
- });
- } else {
- that.$message.error(json.Memo + " 错误码:" + json.Code);
- }
- });
- },
- // 打开消息提示
- checkNews: function() {
- let that = this;
- const h = this.$createElement;
- this.$notify({
- title: "标题名称",
- position: "top-left",
- message: h(
- "i",
- { style: "color: teal" },
- "这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案"
- ),
- onClose: function() {
- //关闭时调用已读接口
- },
- onClick: function() {
- //关闭时调用已读接口
- this.close(); //关闭notify
- let thisdata = { name: "message", link: "/#/message" };
- that.$emit("navOpen", thisdata); //跳转新的message
- },
- });
- },
- // 读取消息提示数量
- readNewNum: function() {
- this.newnum = 0;
- this.newnumState = false;
- // ajax todo
- },
- // 退出登录
- logoutClick: function() {
- let that = this;
- that
- .$confirm("此操作将退出当前账号, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- let that = this;
- that.$router.push({ path: "/login", query: { status: 1 } });
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- SignOut(postdata).then((res) => {
- let json = res;
- if (json.Code == 0) {
- localStorage.clear();
- // that.$router.push({path: '/login', query: {status: 1}});
- that.$message({
- showClose: true,
- message: "当前用户已退出登陆!",
- type: "success",
- });
- } else {
- that.$message.error(json.Memo + " 错误码:" + json.Code);
- }
- });
- })
- .catch(() => {});
- },
- // 全屏显示
- full_screen() {
- let that = this;
- this.screen_full = true;
- let elem = document.getElementById("app");
- this.full_state = true;
- if (elem.webkitRequestFullScreen) {
- elem.webkitRequestFullScreen();
- that.full_rule();
- } else if (elem.mozRequestFullScreen) {
- elem.mozRequestFullScreen();
- that.full_rule();
- } else if (elem.requestFullScreen) {
- elem.requestFullscreen();
- that.full_rule();
- } else {
- this.screen_full = false;
- that.$message.error(
- "浏览器不支持全屏API或已被禁用",
- null,
- null,
- null,
- true,
- true
- );
- }
- },
- // 取消全屏
- cancle_screen() {
- let that = this;
- this.screen_full = false;
- this.full_state = false;
- var elem = document;
- if (elem.webkitCancelFullScreen) {
- elem.webkitCancelFullScreen();
- that.cancle_full_rule();
- } else if (elem.mozCancelFullScreen) {
- elem.mozCancelFullScreen();
- that.cancle_full_rule();
- } else if (elem.cancelFullScreen) {
- elem.cancelFullScreen();
- that.cancle_full_rule();
- } else if (elem.exitFullscreen) {
- elem.exitFullscreen();
- that.cancle_full_rule();
- } else {
- this.screen_full = true;
- that.$message.error(
- "浏览器不支持全屏API或已被禁用",
- null,
- null,
- null,
- true,
- true
- );
- }
- },
- },
- components: {},
- };
- </script>
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style scoped>
- ul,
- li {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- #headside {
- width: 100%;
- height: 72px;
- overflow: hidden;
- float: right;
- z-index: 1111;
- background-color: #0063c9;
- }
- .user-info-navbar {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- min-height: 72px;
- height: 72px;
- border: 0;
- padding: 0;
- margin-bottom: 0px;
- }
- .user-info-navbar .user-info-menu > li > a {
- position: relative;
- display: block;
- padding: 12px 20px;
- color: #979898;
- border-bottom: 1px solid #ffffff;
- top: 1px;
- z-index: 5;
- }
- .user-info-navbar .user-info-menu > li > a .badge {
- font-size: 9px;
- position: absolute;
- top: 3px;
- right: 10px;
- padding: 4px;
- min-width: 18px;
- line-height: 1;
- }
- .user-info-navbar .user-info-menu > li > form {
- position: relative;
- display: block;
- padding: 12px 20px;
- padding-bottom: 5px;
- margin: 0;
- border-bottom: 1px solid #ffffff;
- }
- .user-info-navbar .user-info-menu > li.search-form .search-field,
- .navbar.horizontal-menu .navbar-inner > .nav > li.search-form .search-field {
- position: absolute;
- top: 25%;
- right: 15px;
- margin-top: 0px;
- line-height: 1;
- height: 25px;
- border: 1px solid #dddddd;
- border: 0;
- padding: 0 10px;
- width: 170px;
- padding-right: 30px;
- font-size: 12px;
- z-index: 1;
- visibility: hidden;
- background: #f3f3f3;
- zoom: 1;
- filter: alpha(opacity=0);
- -webkit-opacity: 0;
- -moz-opacity: 0;
- opacity: 0;
- }
- .frm-body {
- background-color: #eeeeee;
- }
- .sidebar-menu {
- display: table-cell;
- position: relative;
- width: 230px;
- background: #2c2e2f;
- z-index: 1;
- }
- footer.main-footer {
- padding: 8px 20px 0px 20px;
- border-top: 1px solid #dddddd;
- font-size: 12px;
- margin-left: -30px;
- margin-right: -30px;
- margin-top: 10px;
- margin-bottom: -10px;
- background-color: #eeeeee;
- }
- .panel {
- position: relative;
- background: #ffffff;
- padding: 10px 10px;
- border: 0;
- margin-top: 5px;
- margin-bottom: 0px;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- }
- .panel .panel-body {
- padding: 0;
- padding-top: 20px;
- color: #000000;
- }
- .panel-title {
- margin-top: 5px;
- margin-bottom: 5px;
- }
- .panel .panel-heading {
- position: relative;
- padding: 0;
- margin: 0;
- background: none;
- font-size: 17px;
- padding-bottom: 0px;
- border-bottom: 2px solid #f5f5f5;
- }
- .panel.panel-color .panel-heading {
- margin-top: -10px;
- margin-left: -10px;
- margin-right: -10px;
- padding: 10px 10px;
- border-bottom: 0;
- }
- .panel.panel-color.collapsed > .panel-heading {
- margin-bottom: -10px;
- }
- .xe-widget.xe-progress-counter.xe-progress-counter-huise {
- background-color: #d7d7d7;
- }
- .xe-widget.xe-progress-counter.xe-progress-counter-huise .xe-background {
- color: #fff;
- }
- .xe-widget.xe-progress-counter.xe-progress-counter-huise .xe-upper {
- background-color: transparent;
- }
- .table > thead > tr > td,
- .table > tbody > tr > td,
- .table > tfood > tr > td,
- .table > thead > tr > th,
- .table > tbody > tr > th,
- .table > tfood > tr > th {
- padding: 5px 5px 5px 5px;
- }
- .input-sm {
- height: 26px;
- padding: 5px 10px;
- font-size: 12px;
- line-height: 1.5;
- border-radius: 0;
- }
- .col-xs-1,
- .col-sm-1,
- .col-md-1,
- .col-lg-1,
- .col-xs-2,
- .col-sm-2,
- .col-md-2,
- .col-lg-2,
- .col-xs-3,
- .col-sm-3,
- .col-md-3,
- .col-lg-3,
- .col-xs-4,
- .col-sm-4,
- .col-md-4,
- .col-lg-4,
- .col-xs-5,
- .col-sm-5,
- .col-md-5,
- .col-lg-5,
- .col-xs-6,
- .col-sm-6,
- .col-md-6,
- .col-lg-6,
- .col-xs-7,
- .col-sm-7,
- .col-md-7,
- .col-lg-7,
- .col-xs-8,
- .col-sm-8,
- .col-md-8,
- .col-lg-8,
- .col-xs-9,
- .col-sm-9,
- .col-md-9,
- .col-lg-9,
- .col-xs-10,
- .col-sm-10,
- .col-md-10,
- .col-lg-10,
- .col-xs-11,
- .col-sm-11,
- .col-md-11,
- .col-lg-11,
- .col-xs-12,
- .col-sm-12,
- .col-md-12,
- .col-lg-12 {
- position: relative;
- min-height: 1px;
- padding-left: 5px;
- padding-right: 5px;
- }
- .form-horizontal .form-group {
- margin-left: 0px;
- margin-right: 0px;
- }
- .btn-sm,
- .btn-group-sm > .btn {
- font-size: 14px;
- line-height: 1.5;
- padding: 2px 6px;
- border-radius: 0px;
- }
- .dataTables_wrapper .dataTables_info,
- .dataTables_wrapper .dataTables_paginate {
- padding-top: 10px;
- padding-left: 5px;
- padding-right: 5px;
- }
- .dataTables_wrapper .dataTables_length,
- .dataTables_wrapper .dataTables_filter {
- padding-bottom: 5px;
- padding-left: 5px;
- padding-right: 5px;
- }
- .comm_style {
- max-width: 200px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin: 0 auto;
- }
- .img_style {
- width: 40px;
- /*height: 40px;*/
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- #modal_img {
- width: 300px;
- height: 300px;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .modal-content {
- margin: 0 auto;
- /*width: 50%;*/
- /*20170623 mefisto*/
- }
- .customer_serve {
- float: right;
- margin-right: 20px;
- font-size: 14px;
- color: #fff;
- text-align: right;
- line-height: 72px;
- }
- .logoutBtn {
- cursor: pointer;
- }
- #about_us {
- color: #03b1ff;
- cursor: pointer;
- }
- .dropdown-menu-list a img {
- width: 30px;
- height: 30px;
- }
- .user-info-navbar
- .user-info-menu
- > li
- .dropdown-menu
- .dropdown-menu-list
- li
- a
- .line.desc,
- .navbar.horizontal-menu
- .navbar-inner
- > .nav
- > li
- .dropdown-menu
- .dropdown-menu-list
- li
- a
- .line.desc {
- margin-right: 0;
- }
- .user-info-navbar .user-info-menu > li .dropdown-menu .dropdown-menu-list li,
- .navbar.horizontal-menu
- .navbar-inner
- > .nav
- > li
- .dropdown-menu
- .dropdown-menu-list
- li {
- min-height: 50px;
- }
- .empty_li_noti {
- text-align: center;
- line-height: 50px !important;
- }
- .disagree_invite {
- background-color: #ff0000;
- }
- .agree_invite {
- background-color: #25cc42;
- }
- .disagree_invite:hover {
- background-color: #d20000;
- }
- .agree_invite:hover {
- background-color: #25cc42;
- }
- .invite_msg {
- width: 95%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 34px;
- margin-top: 10px;
- }
- .invite_time {
- width: 95%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 10px;
- }
- .left_hide_icon {
- width: 20px;
- height: 20px;
- margin-top: 8px;
- float: left;
- margin-left: 15px;
- cursor: pointer;
- color: #badcff;
- font-size: 22px;
- /*background: url("../assets/img/header/right.png")top center no-repeat;*/
- }
- /*.left_hide_icon:hover {*/
- /* background: #ccc;*/
- /* color: #fff;*/
- /*}*/
- .left_show_icon {
- width: 20px;
- height: 20px;
- margin-top: 8px;
- float: left;
- margin-left: 15px;
- cursor: pointer;
- color: #badcff;
- font-size: 22px;
- /*background: url("../assets/img/header/left.png")top center no-repeat;*/
- }
- .item {
- float: left;
- margin-left: 10px;
- margin-top: 10px;
- }
- .el-button--small,
- .el-button--small.is-round {
- padding: 4px 8px;
- }
- .user-profile {
- float: right;
- cursor: pointer;
- margin-right: 29px;
- }
- .el-dropdown-menu__item {
- padding: 5px;
- }
- .title {
- float: left;
- color: #badcff;
- font-size: 19px;
- line-height: 72px;
- margin-left: 23px;
- }
- .title em {
- font-style: normal;
- font-size: 14px;
- margin-left: 10px;
- font-size: 14px;
- }
- .lteHead {
- margin-top: 25px;
- margin-right: 10px;
- float: left;
- }
- .user-profile span {
- float: left;
- color: #fff;
- font-size: 14px;
- line-height: 72px;
- }
- .shopinfo span {
- padding-left: 10px;
- }
- .pull-right {
- float: right;
- height: 40px;
- line-height: 40px;
- color: #fff;
- }
- .scrren {
- cursor: pointer;
- }
- @media (min-width: 960px) and (max-width: 1367px) {
- #headside {
- height: 40px;
- }
- .user-info-navbar {
- min-height: 40px;
- height: 40px;
- }
- .title {
- line-height: 40px;
- }
- .user-profile span {
- line-height: 40px;
- }
- .customer_serve {
- float: right;
- margin-right: 20px;
- font-size: 12px;
- color: #fff;
- text-align: right;
- line-height: 45px;
- }
- }
- </style>
|