Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

Navbar.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <template>
  2. <div class="top-nav">
  3. <!-- <div class="nav-logo">
  4. <img :src="require(`../../../assets/logo/logo.png`)" alt="">
  5. </div>
  6. <el-menu class="navbar" mode="horizontal">
  7. <div>
  8. <span> {{this.$store.getters.xt_user.org.org_name}}
  9. </span>
  10. </div>
  11. <div class="system-nav">
  12. <div class="system-nav-menu active">
  13. <a>
  14. <span><i class="icon iconfont icon-jiankangshuidi"></i> 血透管理</span>
  15. </a>
  16. </div>
  17. <div class="system-nav-menu" v-if="this.$store.getters.xt_user.cdm_role_exist">
  18. <a :href="CDMWebsit()">
  19. <span><i class="icon iconfont icon-manbing-xuanzhong"></i> 慢病管理</span>
  20. </a>
  21. </div>
  22. <div class="system-nav-menu" v-if="this.$store.getters.xt_user.scrm_role_exist">
  23. <a :href="SCRMWebsit()">
  24. <span><i class="iconfont icon-pengyou"></i> SCRM</span>
  25. </a>
  26. </div>
  27. <div class="system-nav-menu" v-if="this.$store.getters.xt_user.mall_role_exist">
  28. <a :href="MircoMallWebsit()">
  29. <span><i class="icon iconfont icon-service_fill"></i> 微商城</span>
  30. </a>
  31. </div>
  32. <div class="system-nav-menu">
  33. <a :href="APPManageWebsit()">
  34. <span><i class="icon iconfont icon-suoyou"></i> 应用</span>
  35. </a>
  36. </div>
  37. </div>
  38. <div class="right-menu">
  39. <el-dropdown class="avatar-container right-menu-item" trigger="click" @command="handleCommand">
  40. <div class="avatar-wrapper">
  41. <img class="user-avatar" :src="avater">
  42. <span class="user-title">{{ this.$store.getters.xt_user.user.user_name }}</span>
  43. <i class="el-icon-caret-bottom"></i>
  44. </div>
  45. <el-dropdown-menu slot="dropdown">
  46. <el-dropdown-item command="modifyUserInfoAction">
  47. 个人信息
  48. </el-dropdown-item>
  49. <el-dropdown-item command="modifyOrgInfoAction">
  50. 机构信息
  51. </el-dropdown-item>
  52. <el-dropdown-item divided command="logout">
  53. {{$t('navbar.logOut')}}
  54. </el-dropdown-item>
  55. </el-dropdown-menu>
  56. </el-dropdown>
  57. <modify-user-info-dialog ref="modify_user_info_dialog"></modify-user-info-dialog>
  58. <modify-org-info-dialog ref="modify_org_info_dialog"></modify-org-info-dialog>
  59. </div>
  60. </el-menu>-->
  61. <div class="dropdownBox">
  62. <el-dropdown trigger="click" @command="handleOrgCommand">
  63. <span class="el-dropdown-link">
  64. {{ org_name }}
  65. <i class="el-icon-arrow-down el-icon--right"></i>
  66. </span>
  67. <el-dropdown-menu slot="dropdown">
  68. <el-dropdown-item
  69. v-for="(item, index) in orgs"
  70. :key="index"
  71. :command="item.id"
  72. >{{ item.org_name }}</el-dropdown-item
  73. >
  74. </el-dropdown-menu>
  75. </el-dropdown>
  76. </div>
  77. <div class="navRight">
  78. <!-- <el-input placeholder="搜索患者透析号/姓名/首拼" prefix-icon="el-icon-search" v-model="input2"></el-input>
  79. <div style="color: #b2b2b3;">通知中心</div> -->
  80. <div class="right-menu">
  81. <el-dropdown
  82. class="avatar-container right-menu-item"
  83. trigger="click"
  84. @command="handleCommand"
  85. >
  86. <div class="avatar-wrapper">
  87. <img class="user-avatar" :src="avater" />
  88. <span class="user-title">{{
  89. this.$store.getters.xt_user.user.user_name
  90. }}</span>
  91. <i class="el-icon-caret-bottom"></i>
  92. </div>
  93. <el-dropdown-menu slot="dropdown">
  94. <el-dropdown-item command="modifyUserInfoAction"
  95. >个人信息</el-dropdown-item
  96. >
  97. <el-dropdown-item command="modifyOrgInfoAction"
  98. >机构信息</el-dropdown-item
  99. >
  100. <el-dropdown-item divided command="logout">{{
  101. $t("navbar.logOut")
  102. }}</el-dropdown-item>
  103. </el-dropdown-menu>
  104. </el-dropdown>
  105. <modify-user-info-dialog
  106. ref="modify_user_info_dialog"
  107. ></modify-user-info-dialog>
  108. <modify-org-info-dialog
  109. ref="modify_org_info_dialog"
  110. ></modify-org-info-dialog>
  111. </div>
  112. <div>
  113. <i class="el-icon-question"></i>
  114. <span @click="toClick">帮助中心</span>
  115. </div>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import { mapGetters } from "vuex";
  121. // import Breadcrumb from "@/components/Breadcrumb";
  122. // import Hamburger from "@/components/Hamburger";
  123. import Screenfull from "@/components/Screenfull";
  124. import ModifyUserInfoDialog from "@/xt_pages/home/modify_user_info_dialog";
  125. import ModifyOrgInfoDialog from "@/xt_pages/home/modifyOrgInfoDialog";
  126. import { getFiledConfigList, setFiledConfigList } from "@/utils/data_config"; // getConfigList from sessionStorage
  127. import {
  128. getAdminUserInfoCache,
  129. cacheAdminUserInfo,
  130. removeAdminUserInfoCache
  131. } from "@/utils/admin_info_cache";
  132. import { getOrgs, changeOrg } from "@/api/config";
  133. export default {
  134. inject: ["reload"],
  135. data() {
  136. return {
  137. orgs: [],
  138. org_id: this.$store.getters.xt_user.org.id,
  139. org_name: this.$store.getters.xt_user.org.org_name
  140. // scrm_role_exist: $store.getters.xt_user.scrm_role_exist
  141. };
  142. },
  143. components: {
  144. Screenfull,
  145. ModifyUserInfoDialog,
  146. ModifyOrgInfoDialog
  147. },
  148. computed: {
  149. ...mapGetters(["sidebar"]),
  150. avater: function() {
  151. var avatar = this.$store.getters.xt_user.user.avatar;
  152. return avatar.length > 0
  153. ? avatar
  154. : require("../../../assets/home/userData.png");
  155. }
  156. },
  157. methods: {
  158. handleOrgCommand(org_id) {
  159. let params = {
  160. org_id: org_id
  161. };
  162. changeOrg(params)
  163. .then(response => {
  164. if (response.data.state === 1) {
  165. // window.location.reload()
  166. this.$message.success("切换成功");
  167. let data = response.data.data;
  168. this.org_id = data.org.id;
  169. this.org_name = data.org.org_name;
  170. this.$store.dispatch("ModifyAdminUserOrgInfo", {
  171. user: data.user,
  172. cur_org_id: data.current_org_id,
  173. cur_app_id: data.current_app_id,
  174. org: data.org,
  175. subscibe: data.subscibe,
  176. template_info: data.template_info,
  177. scrm_role_exist: data.scrm_role_exist,
  178. cdm_role_exist: data.cdm_role_exist,
  179. mall_role_exist: data.mall_role_exist
  180. });
  181. this.$store.dispatch("ModifyUrlInfo", {
  182. urlfors: data.urlfors
  183. });
  184. this.$store.dispatch("ModifyFiled", {
  185. fileds: data.fileds
  186. });
  187. setFiledConfigList(JSON.stringify(data.fileds));
  188. cacheAdminUserInfo(JSON.stringify(data));
  189. this.$store
  190. .dispatch(
  191. "xt_GenerateRoutes",
  192. this.$store.getters.current_role_urls
  193. )
  194. .then(() => {
  195. this.$store.dispatch("VerifyConfigList").then(() => {
  196. // alert('token 验证成功')
  197. // console.log(this.$store.getters.xt_permission.addRouters)
  198. this.$router.addRoutes(
  199. this.$store.getters.xt_permission.addRouters
  200. ); // 动态添加可访问路由表
  201. // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
  202. // this.$router.replace({ path: '/' })
  203. window.location.reload();
  204. // this.$router.go(0)
  205. // this.reload()
  206. });
  207. });
  208. } else {
  209. this.$message.success(response.data.msg);
  210. }
  211. })
  212. .catch(e => {
  213. // this.$message.success("网络异常")
  214. });
  215. },
  216. handleCommand(command) {
  217. switch (command) {
  218. case "modifyUserInfoAction":
  219. this.modifyUserInfoAction();
  220. break;
  221. case "modifyOrgInfoAction":
  222. this.modifyOrgInfoAction();
  223. break;
  224. case "logout":
  225. this.logout();
  226. break;
  227. }
  228. },
  229. logout() {
  230. this.$store.dispatch("FrontendLogout");
  231. window.location.href = process.env.BASE_API + "/logout";
  232. },
  233. modifyOrgInfoAction() {
  234. // this.$refs.modify_org_info_dialog.show()
  235. this.$router.push("/orginfo");
  236. return false;
  237. },
  238. modifyUserInfoAction() {
  239. this.$refs.modify_user_info_dialog.show();
  240. },
  241. myServe() {
  242. this.$router.push("/service");
  243. return false;
  244. },
  245. SCRMWebsit() {
  246. return process.env.SRCM_HOST;
  247. },
  248. MircoMallWebsit() {
  249. return process.env.MIRCO_MALL_HOST;
  250. },
  251. CDMWebsit() {
  252. return process.env.CDM_HOST;
  253. },
  254. APPManageWebsit() {
  255. return (
  256. process.env.SSO_HOST +
  257. "/org/admin/apps?org=" +
  258. this.$store.getters.xt_user.org_id
  259. );
  260. },
  261. toClick() {
  262. window.location.href = "https://testsso.sgjyun.com/help";
  263. },
  264. getCreatorName() {
  265. getCreatorName().then(response => {});
  266. }
  267. },
  268. created() {
  269. getOrgs().then(response => {
  270. if (response.data.state === 1) {
  271. this.orgs = response.data.data.orgs;
  272. console.log("org", this.orgs);
  273. var creator = response.data.data.creator;
  274. console.log("creator", creator);
  275. for (let i = 0; i < this.orgs.length; i++) {
  276. if (this.orgs[i].id == this.org_id) {
  277. this.org_name = this.orgs[i].org_name;
  278. }
  279. }
  280. }
  281. });
  282. this.getCreatorName();
  283. }
  284. };
  285. </script>
  286. <style rel="stylesheet/scss" lang="scss" scoped>
  287. .top-nav {
  288. background: #409eff;
  289. position: fixed;
  290. top: 0;
  291. left: 150px;
  292. right: 0;
  293. z-index: 1000;
  294. height: 50px;
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-between;
  298. color: #fff;
  299. .dropdownBox {
  300. margin-left: 10px;
  301. }
  302. .navRight {
  303. display: flex;
  304. align-items: center;
  305. justify-content: space-between;
  306. min-width: 200px;
  307. margin-right: 10px;
  308. font-size: 14px;
  309. .right-menu {
  310. float: right;
  311. height: 100%;
  312. z-index: 99999;
  313. color: #fff;
  314. & :focus {
  315. outline: none;
  316. }
  317. .right-menu-item {
  318. display: inline-block;
  319. margin: 0 8px;
  320. .iconfont {
  321. font-size: 18px;
  322. }
  323. }
  324. .screenfull {
  325. height: 20px;
  326. }
  327. .international {
  328. vertical-align: top;
  329. }
  330. .theme-switch {
  331. vertical-align: 15px;
  332. }
  333. .avatar-container {
  334. margin-right: 10px;
  335. .avatar-wrapper {
  336. cursor: pointer;
  337. margin-top: 3px;
  338. display: flex;
  339. align-items: center;
  340. justify-content: center;
  341. .user-avatar {
  342. width: 40px;
  343. height: 40px;
  344. border-radius: 50%;
  345. object-fit: cover;
  346. object-position: center;
  347. }
  348. .user-title {
  349. margin: 0 8px;
  350. font-size: 14px;
  351. color: #fff;
  352. }
  353. .el-icon-caret-bottom {
  354. font-size: 12px;
  355. color: #fff;
  356. }
  357. }
  358. }
  359. }
  360. }
  361. .nav-logo {
  362. width: 162px;
  363. display: flex;
  364. align-items: center;
  365. height: 60px;
  366. text-align: center;
  367. justify-content: center;
  368. padding: 10px 0;
  369. box-sizing: border-box;
  370. float: left;
  371. img {
  372. display: inline-block;
  373. width: 100px;
  374. }
  375. }
  376. .navbar {
  377. border-radius: 0px !important;
  378. display: flex;
  379. justify-content: space-between;
  380. width: calc(100% - 180px);
  381. align-items: center;
  382. color: #fff;
  383. border: none;
  384. background: #409eff;
  385. float: left;
  386. .breadcrumb-container {
  387. float: left;
  388. }
  389. .errLog-container {
  390. display: inline-block;
  391. vertical-align: top;
  392. }
  393. .right-menu {
  394. float: right;
  395. height: 100%;
  396. z-index: 99999;
  397. & :focus {
  398. outline: none;
  399. }
  400. .right-menu-item {
  401. display: inline-block;
  402. margin: 0 8px;
  403. .iconfont {
  404. font-size: 18px;
  405. }
  406. }
  407. .screenfull {
  408. height: 20px;
  409. }
  410. .international {
  411. vertical-align: top;
  412. }
  413. .theme-switch {
  414. vertical-align: 15px;
  415. }
  416. .avatar-container {
  417. margin-right: 10px;
  418. .avatar-wrapper {
  419. cursor: pointer;
  420. margin-top: 3px;
  421. display: flex;
  422. align-items: center;
  423. justify-content: center;
  424. .user-avatar {
  425. width: 40px;
  426. height: 40px;
  427. border-radius: 50%;
  428. object-fit: cover;
  429. object-position: center;
  430. }
  431. .user-title {
  432. margin: 0 8px;
  433. font-size: 14px;
  434. color: #fff;
  435. }
  436. .el-icon-caret-bottom {
  437. font-size: 12px;
  438. color: #fff;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. .system-nav {
  445. .system-nav-menu {
  446. float: left;
  447. height: 60px;
  448. line-height: 60px;
  449. padding: 0 25px;
  450. a {
  451. font-size: 15px;
  452. .iconfont {
  453. font-size: 18px;
  454. }
  455. }
  456. }
  457. .active {
  458. background: #3090eb;
  459. border-left: 1px #5fabf7 solid;
  460. border-right: 1px #5fabf7 solid;
  461. }
  462. }
  463. .el-menu::after,
  464. .el-menu::before {
  465. width: 1px;
  466. height: 1px;
  467. position: absolute;
  468. top: 0;
  469. left: 0;
  470. }
  471. }
  472. .el-dropdown-menu {
  473. z-index: 9999 !important;
  474. }
  475. .v-modal {
  476. z-index: 9999 !important;
  477. }
  478. </style>
  479. <style lang="scss">
  480. .navRight {
  481. .el-input {
  482. width: 250px;
  483. }
  484. .el-input__inner {
  485. border-radius: 30px;
  486. background: #f5f7fa;
  487. }
  488. }
  489. .dropdownBox {
  490. .el-dropdown-link {
  491. font-size: 14px;
  492. color: #fff;
  493. }
  494. }
  495. </style>