Headside.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. <template>
  2. <div id="headside">
  3. <nav class="navbar user-info-navbar" role="navigation">
  4. <!-- <i
  5. v-if="isCollapse"
  6. :class="[{ 'el-icon-s-unfold left_hide_icon': left_panel_state }, { 'el-icon-s-fold left_show_icon': !left_panel_state }]"
  7. @click="left_hide"
  8. ></i> -->
  9. <span class="title">
  10. 场馆管理系统
  11. <em>{{ current }}</em>
  12. </span>
  13. <div @click="checkNews">
  14. <el-badge :value="newnum" class="item" v-if="newnumState">
  15. <el-button size="small">
  16. <i class="el-icon-message"></i>
  17. </el-button>
  18. </el-badge>
  19. </div>
  20. <ul class="user-info-menu pull-right list-unstyled">
  21. <!-- <img class="lteHead" src="../assets/img/header/lteHead.png" height="26" width="26"/>-->
  22. <span class="customer_serve logoutBtn" @click="logoutClick">
  23. <i class="el-icon-switch-button"></i> 退出</span
  24. >
  25. <!-- <span class="scrren customer_serve" @click="full_screen" v-if="!screen_full"><i
  26. class="el-icon-full-screen"></i>全屏</span>
  27. <span class="scrren customer_serve" @click="cancle_screen" v-if="screen_full"><i
  28. class="el-icon-full-screen"></i>缩小</span> -->
  29. <span class="el-dropdown-link customer_serve">{{ user.name }}</span>
  30. <span class="el-dropdown-link customer_serve shopinfo">
  31. <span>{{ ShopName }}</span>
  32. <span>{{ userLevelText }}</span>
  33. </span>
  34. </ul>
  35. </nav>
  36. </div>
  37. </template>
  38. <script>
  39. import axios from "axios";
  40. import Global from "../Global.js";
  41. import { SignOut, ManagerSelfQuery, ShopListQuery } from "../api/getApiRes.js";
  42. let qs = require("qs");
  43. export default {
  44. data() {
  45. return {
  46. isCollapse: document.body.clientWidth < 1367,
  47. user: {
  48. name: "admin",
  49. },
  50. time: "8:30-17:30",
  51. tel: "0000-0079-000",
  52. qq: "0000079000",
  53. newnum: "",
  54. newnumState: false,
  55. left_panel_state: true,
  56. screen_full: false,
  57. ShopName: "",
  58. userLevelText: "",
  59. current: globalcurrentWeek(),
  60. };
  61. },
  62. mounted() {
  63. this.readNewNum();
  64. this.getManagerSelfQuery();
  65. // 定时轮询news
  66. //设置10s刷新一次数据
  67. // if (this.timer) {
  68. // clearInterval(this.timer);
  69. // }else{
  70. // this.timer = setInterval(() => {
  71. // this.readNewNum();
  72. // },10000)
  73. // }
  74. },
  75. methods: {
  76. // 隐藏左侧和显示
  77. left_hide: function() {
  78. let that = this;
  79. that.left_panel_state = !that.left_panel_state;
  80. this.$emit("lefthide");
  81. // if (!that.left_panel_state) {
  82. // this.$emit('left_hide_func');
  83. // } else {
  84. // this.$emit('right_hide_func');
  85. // }
  86. },
  87. getManagerSelfQuery() {
  88. let that = this;
  89. let param = {
  90. token: localStorage.token,
  91. };
  92. let postdata = qs.stringify(param);
  93. ManagerSelfQuery(postdata).then((res) => {
  94. let json = res;
  95. if (json.Code == 0) {
  96. that.user.name = json.Rs.Name;
  97. localStorage.shopId = json.Rs.ShopId;
  98. localStorage.userLevel = json.Rs.Role.Id;
  99. localStorage.ServiceId = json.Rs.Shop.ServiceId;
  100. localStorage.ServiceKey = json.Rs.Shop.ServiceKey;
  101. that.userLevelText = json.Rs.Role.Name;
  102. // 1 会员 2 系统 3 店铺 4 教练
  103. switch (parseInt(json.Rs.Role.Id)) {
  104. case 1:
  105. that.userLevel = 1;
  106. break;
  107. case 2:
  108. that.userLevel = 2;
  109. break;
  110. case 3:
  111. that.userLevel = 3;
  112. break;
  113. case 4:
  114. that.userLevel = 4;
  115. break;
  116. }
  117. localStorage.shopId = json.Rs.ShopId;
  118. this.panelSelect(json.Rs.ShopId);
  119. } else {
  120. if (json.Code == 1010) {
  121. that.$message.error(json.Memo + " 错误码:" + json.Code);
  122. that.$router.push({ path: "/login", query: { status: 1 } });
  123. return false;
  124. } else {
  125. that.$message.error(json.Memo + " 错误码:" + json.Code);
  126. }
  127. }
  128. });
  129. },
  130. // 获取所属店铺
  131. panelSelect(ShopId) {
  132. let that = this;
  133. let param = {
  134. token: localStorage.token,
  135. };
  136. let postdata = qs.stringify(param);
  137. ShopListQuery(postdata).then((res) => {
  138. let json = res;
  139. if (json.Code == 0) {
  140. json.Rs.map(function(item) {
  141. if (item.ShopID == ShopId) {
  142. that.ShopName = item.ShopName;
  143. }
  144. });
  145. } else {
  146. that.$message.error(json.Memo + " 错误码:" + json.Code);
  147. }
  148. });
  149. },
  150. // 打开消息提示
  151. checkNews: function() {
  152. let that = this;
  153. const h = this.$createElement;
  154. this.$notify({
  155. title: "标题名称",
  156. position: "top-left",
  157. message: h(
  158. "i",
  159. { style: "color: teal" },
  160. "这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案"
  161. ),
  162. onClose: function() {
  163. //关闭时调用已读接口
  164. },
  165. onClick: function() {
  166. //关闭时调用已读接口
  167. this.close(); //关闭notify
  168. let thisdata = { name: "message", link: "/#/message" };
  169. that.$emit("navOpen", thisdata); //跳转新的message
  170. },
  171. });
  172. },
  173. // 读取消息提示数量
  174. readNewNum: function() {
  175. this.newnum = 0;
  176. this.newnumState = false;
  177. // ajax todo
  178. },
  179. // 退出登录
  180. logoutClick: function() {
  181. let that = this;
  182. that
  183. .$confirm("此操作将退出当前账号, 是否继续?", "提示", {
  184. confirmButtonText: "确定",
  185. cancelButtonText: "取消",
  186. type: "warning",
  187. })
  188. .then(() => {
  189. let that = this;
  190. that.$router.push({ path: "/login", query: { status: 1 } });
  191. let param = {
  192. token: localStorage.token,
  193. };
  194. let postdata = qs.stringify(param);
  195. SignOut(postdata).then((res) => {
  196. let json = res;
  197. if (json.Code == 0) {
  198. localStorage.clear();
  199. // that.$router.push({path: '/login', query: {status: 1}});
  200. that.$message({
  201. showClose: true,
  202. message: "当前用户已退出登陆!",
  203. type: "success",
  204. });
  205. } else {
  206. that.$message.error(json.Memo + " 错误码:" + json.Code);
  207. }
  208. });
  209. })
  210. .catch(() => {});
  211. },
  212. // 全屏显示
  213. full_screen() {
  214. let that = this;
  215. this.screen_full = true;
  216. let elem = document.getElementById("app");
  217. this.full_state = true;
  218. if (elem.webkitRequestFullScreen) {
  219. elem.webkitRequestFullScreen();
  220. that.full_rule();
  221. } else if (elem.mozRequestFullScreen) {
  222. elem.mozRequestFullScreen();
  223. that.full_rule();
  224. } else if (elem.requestFullScreen) {
  225. elem.requestFullscreen();
  226. that.full_rule();
  227. } else {
  228. this.screen_full = false;
  229. that.$message.error(
  230. "浏览器不支持全屏API或已被禁用",
  231. null,
  232. null,
  233. null,
  234. true,
  235. true
  236. );
  237. }
  238. },
  239. // 取消全屏
  240. cancle_screen() {
  241. let that = this;
  242. this.screen_full = false;
  243. this.full_state = false;
  244. var elem = document;
  245. if (elem.webkitCancelFullScreen) {
  246. elem.webkitCancelFullScreen();
  247. that.cancle_full_rule();
  248. } else if (elem.mozCancelFullScreen) {
  249. elem.mozCancelFullScreen();
  250. that.cancle_full_rule();
  251. } else if (elem.cancelFullScreen) {
  252. elem.cancelFullScreen();
  253. that.cancle_full_rule();
  254. } else if (elem.exitFullscreen) {
  255. elem.exitFullscreen();
  256. that.cancle_full_rule();
  257. } else {
  258. this.screen_full = true;
  259. that.$message.error(
  260. "浏览器不支持全屏API或已被禁用",
  261. null,
  262. null,
  263. null,
  264. true,
  265. true
  266. );
  267. }
  268. },
  269. },
  270. components: {},
  271. };
  272. </script>
  273. <!-- Add "scoped" attribute to limit CSS to this component only -->
  274. <style scoped>
  275. ul,
  276. li {
  277. list-style: none;
  278. padding: 0;
  279. margin: 0;
  280. }
  281. #headside {
  282. width: 100%;
  283. height: 72px;
  284. overflow: hidden;
  285. float: right;
  286. z-index: 1111;
  287. background-color: #0063c9;
  288. }
  289. .user-info-navbar {
  290. width: 100%;
  291. overflow: hidden;
  292. display: block;
  293. margin: 0 auto;
  294. min-height: 72px;
  295. height: 72px;
  296. border: 0;
  297. padding: 0;
  298. margin-bottom: 0px;
  299. }
  300. .user-info-navbar .user-info-menu > li > a {
  301. position: relative;
  302. display: block;
  303. padding: 12px 20px;
  304. color: #979898;
  305. border-bottom: 1px solid #ffffff;
  306. top: 1px;
  307. z-index: 5;
  308. }
  309. .user-info-navbar .user-info-menu > li > a .badge {
  310. font-size: 9px;
  311. position: absolute;
  312. top: 3px;
  313. right: 10px;
  314. padding: 4px;
  315. min-width: 18px;
  316. line-height: 1;
  317. }
  318. .user-info-navbar .user-info-menu > li > form {
  319. position: relative;
  320. display: block;
  321. padding: 12px 20px;
  322. padding-bottom: 5px;
  323. margin: 0;
  324. border-bottom: 1px solid #ffffff;
  325. }
  326. .user-info-navbar .user-info-menu > li.search-form .search-field,
  327. .navbar.horizontal-menu .navbar-inner > .nav > li.search-form .search-field {
  328. position: absolute;
  329. top: 25%;
  330. right: 15px;
  331. margin-top: 0px;
  332. line-height: 1;
  333. height: 25px;
  334. border: 1px solid #dddddd;
  335. border: 0;
  336. padding: 0 10px;
  337. width: 170px;
  338. padding-right: 30px;
  339. font-size: 12px;
  340. z-index: 1;
  341. visibility: hidden;
  342. background: #f3f3f3;
  343. zoom: 1;
  344. filter: alpha(opacity=0);
  345. -webkit-opacity: 0;
  346. -moz-opacity: 0;
  347. opacity: 0;
  348. }
  349. .frm-body {
  350. background-color: #eeeeee;
  351. }
  352. .sidebar-menu {
  353. display: table-cell;
  354. position: relative;
  355. width: 230px;
  356. background: #2c2e2f;
  357. z-index: 1;
  358. }
  359. footer.main-footer {
  360. padding: 8px 20px 0px 20px;
  361. border-top: 1px solid #dddddd;
  362. font-size: 12px;
  363. margin-left: -30px;
  364. margin-right: -30px;
  365. margin-top: 10px;
  366. margin-bottom: -10px;
  367. background-color: #eeeeee;
  368. }
  369. .panel {
  370. position: relative;
  371. background: #ffffff;
  372. padding: 10px 10px;
  373. border: 0;
  374. margin-top: 5px;
  375. margin-bottom: 0px;
  376. -webkit-box-shadow: none;
  377. -moz-box-shadow: none;
  378. box-shadow: none;
  379. }
  380. .panel .panel-body {
  381. padding: 0;
  382. padding-top: 20px;
  383. color: #000000;
  384. }
  385. .panel-title {
  386. margin-top: 5px;
  387. margin-bottom: 5px;
  388. }
  389. .panel .panel-heading {
  390. position: relative;
  391. padding: 0;
  392. margin: 0;
  393. background: none;
  394. font-size: 17px;
  395. padding-bottom: 0px;
  396. border-bottom: 2px solid #f5f5f5;
  397. }
  398. .panel.panel-color .panel-heading {
  399. margin-top: -10px;
  400. margin-left: -10px;
  401. margin-right: -10px;
  402. padding: 10px 10px;
  403. border-bottom: 0;
  404. }
  405. .panel.panel-color.collapsed > .panel-heading {
  406. margin-bottom: -10px;
  407. }
  408. .xe-widget.xe-progress-counter.xe-progress-counter-huise {
  409. background-color: #d7d7d7;
  410. }
  411. .xe-widget.xe-progress-counter.xe-progress-counter-huise .xe-background {
  412. color: #fff;
  413. }
  414. .xe-widget.xe-progress-counter.xe-progress-counter-huise .xe-upper {
  415. background-color: transparent;
  416. }
  417. .table > thead > tr > td,
  418. .table > tbody > tr > td,
  419. .table > tfood > tr > td,
  420. .table > thead > tr > th,
  421. .table > tbody > tr > th,
  422. .table > tfood > tr > th {
  423. padding: 5px 5px 5px 5px;
  424. }
  425. .input-sm {
  426. height: 26px;
  427. padding: 5px 10px;
  428. font-size: 12px;
  429. line-height: 1.5;
  430. border-radius: 0;
  431. }
  432. .col-xs-1,
  433. .col-sm-1,
  434. .col-md-1,
  435. .col-lg-1,
  436. .col-xs-2,
  437. .col-sm-2,
  438. .col-md-2,
  439. .col-lg-2,
  440. .col-xs-3,
  441. .col-sm-3,
  442. .col-md-3,
  443. .col-lg-3,
  444. .col-xs-4,
  445. .col-sm-4,
  446. .col-md-4,
  447. .col-lg-4,
  448. .col-xs-5,
  449. .col-sm-5,
  450. .col-md-5,
  451. .col-lg-5,
  452. .col-xs-6,
  453. .col-sm-6,
  454. .col-md-6,
  455. .col-lg-6,
  456. .col-xs-7,
  457. .col-sm-7,
  458. .col-md-7,
  459. .col-lg-7,
  460. .col-xs-8,
  461. .col-sm-8,
  462. .col-md-8,
  463. .col-lg-8,
  464. .col-xs-9,
  465. .col-sm-9,
  466. .col-md-9,
  467. .col-lg-9,
  468. .col-xs-10,
  469. .col-sm-10,
  470. .col-md-10,
  471. .col-lg-10,
  472. .col-xs-11,
  473. .col-sm-11,
  474. .col-md-11,
  475. .col-lg-11,
  476. .col-xs-12,
  477. .col-sm-12,
  478. .col-md-12,
  479. .col-lg-12 {
  480. position: relative;
  481. min-height: 1px;
  482. padding-left: 5px;
  483. padding-right: 5px;
  484. }
  485. .form-horizontal .form-group {
  486. margin-left: 0px;
  487. margin-right: 0px;
  488. }
  489. .btn-sm,
  490. .btn-group-sm > .btn {
  491. font-size: 14px;
  492. line-height: 1.5;
  493. padding: 2px 6px;
  494. border-radius: 0px;
  495. }
  496. .dataTables_wrapper .dataTables_info,
  497. .dataTables_wrapper .dataTables_paginate {
  498. padding-top: 10px;
  499. padding-left: 5px;
  500. padding-right: 5px;
  501. }
  502. .dataTables_wrapper .dataTables_length,
  503. .dataTables_wrapper .dataTables_filter {
  504. padding-bottom: 5px;
  505. padding-left: 5px;
  506. padding-right: 5px;
  507. }
  508. .comm_style {
  509. max-width: 200px;
  510. overflow: hidden;
  511. text-overflow: ellipsis;
  512. white-space: nowrap;
  513. margin: 0 auto;
  514. }
  515. .img_style {
  516. width: 40px;
  517. /*height: 40px;*/
  518. overflow: hidden;
  519. display: block;
  520. margin: 0 auto;
  521. }
  522. #modal_img {
  523. width: 300px;
  524. height: 300px;
  525. overflow: hidden;
  526. display: block;
  527. margin: 0 auto;
  528. }
  529. .modal-content {
  530. margin: 0 auto;
  531. /*width: 50%;*/
  532. /*20170623 mefisto*/
  533. }
  534. .customer_serve {
  535. float: right;
  536. margin-right: 20px;
  537. font-size: 14px;
  538. color: #fff;
  539. text-align: right;
  540. line-height: 72px;
  541. }
  542. .logoutBtn {
  543. cursor: pointer;
  544. }
  545. #about_us {
  546. color: #03b1ff;
  547. cursor: pointer;
  548. }
  549. .dropdown-menu-list a img {
  550. width: 30px;
  551. height: 30px;
  552. }
  553. .user-info-navbar
  554. .user-info-menu
  555. > li
  556. .dropdown-menu
  557. .dropdown-menu-list
  558. li
  559. a
  560. .line.desc,
  561. .navbar.horizontal-menu
  562. .navbar-inner
  563. > .nav
  564. > li
  565. .dropdown-menu
  566. .dropdown-menu-list
  567. li
  568. a
  569. .line.desc {
  570. margin-right: 0;
  571. }
  572. .user-info-navbar .user-info-menu > li .dropdown-menu .dropdown-menu-list li,
  573. .navbar.horizontal-menu
  574. .navbar-inner
  575. > .nav
  576. > li
  577. .dropdown-menu
  578. .dropdown-menu-list
  579. li {
  580. min-height: 50px;
  581. }
  582. .empty_li_noti {
  583. text-align: center;
  584. line-height: 50px !important;
  585. }
  586. .disagree_invite {
  587. background-color: #ff0000;
  588. }
  589. .agree_invite {
  590. background-color: #25cc42;
  591. }
  592. .disagree_invite:hover {
  593. background-color: #d20000;
  594. }
  595. .agree_invite:hover {
  596. background-color: #25cc42;
  597. }
  598. .invite_msg {
  599. width: 95%;
  600. overflow: hidden;
  601. display: block;
  602. margin: 0 auto;
  603. margin-top: 34px;
  604. margin-top: 10px;
  605. }
  606. .invite_time {
  607. width: 95%;
  608. overflow: hidden;
  609. display: block;
  610. margin: 0 auto;
  611. margin-top: 10px;
  612. }
  613. .left_hide_icon {
  614. width: 20px;
  615. height: 20px;
  616. margin-top: 8px;
  617. float: left;
  618. margin-left: 15px;
  619. cursor: pointer;
  620. color: #badcff;
  621. font-size: 22px;
  622. /*background: url("../assets/img/header/right.png")top center no-repeat;*/
  623. }
  624. /*.left_hide_icon:hover {*/
  625. /* background: #ccc;*/
  626. /* color: #fff;*/
  627. /*}*/
  628. .left_show_icon {
  629. width: 20px;
  630. height: 20px;
  631. margin-top: 8px;
  632. float: left;
  633. margin-left: 15px;
  634. cursor: pointer;
  635. color: #badcff;
  636. font-size: 22px;
  637. /*background: url("../assets/img/header/left.png")top center no-repeat;*/
  638. }
  639. .item {
  640. float: left;
  641. margin-left: 10px;
  642. margin-top: 10px;
  643. }
  644. .el-button--small,
  645. .el-button--small.is-round {
  646. padding: 4px 8px;
  647. }
  648. .user-profile {
  649. float: right;
  650. cursor: pointer;
  651. margin-right: 29px;
  652. }
  653. .el-dropdown-menu__item {
  654. padding: 5px;
  655. }
  656. .title {
  657. float: left;
  658. color: #badcff;
  659. font-size: 19px;
  660. line-height: 72px;
  661. margin-left: 23px;
  662. }
  663. .title em {
  664. font-style: normal;
  665. font-size: 14px;
  666. margin-left: 10px;
  667. font-size: 14px;
  668. }
  669. .lteHead {
  670. margin-top: 25px;
  671. margin-right: 10px;
  672. float: left;
  673. }
  674. .user-profile span {
  675. float: left;
  676. color: #fff;
  677. font-size: 14px;
  678. line-height: 72px;
  679. }
  680. .shopinfo span {
  681. padding-left: 10px;
  682. }
  683. .pull-right {
  684. float: right;
  685. height: 40px;
  686. line-height: 40px;
  687. color: #fff;
  688. }
  689. .scrren {
  690. cursor: pointer;
  691. }
  692. @media (min-width: 960px) and (max-width: 1367px) {
  693. #headside {
  694. height: 40px;
  695. }
  696. .user-info-navbar {
  697. min-height: 40px;
  698. height: 40px;
  699. }
  700. .title {
  701. line-height: 40px;
  702. }
  703. .user-profile span {
  704. line-height: 40px;
  705. }
  706. .customer_serve {
  707. float: right;
  708. margin-right: 20px;
  709. font-size: 12px;
  710. color: #fff;
  711. text-align: right;
  712. line-height: 45px;
  713. }
  714. }
  715. </style>