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

Navbar.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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. <a href="https://sso.kuyicloud.com/help" target="_blank">帮助中心</a>
  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. //
  182. // this.$store.dispatch("ModifyUrlInfo", {
  183. // urlfors: data.urlfors
  184. // });
  185. //
  186. // this.$store.dispatch("ModifyFiled", {
  187. // fileds: data.fileds
  188. // });
  189. // setFiledConfigList(JSON.stringify(data.fileds));
  190. // cacheAdminUserInfo(JSON.stringify(data));
  191. window.location.reload();
  192. // this.$store
  193. // .dispatch(
  194. // "xt_GenerateRoutes",
  195. // this.$store.getters.current_role_urls
  196. // )
  197. // .then(() => {
  198. // this.$store.dispatch("VerifyConfigList").then(() => {
  199. // // alert('token 验证成功')
  200. // // console.log(this.$store.getters.xt_permission.addRouters)
  201. // this.$router.addRoutes(
  202. // this.$store.getters.xt_permission.addRouters
  203. // ); // 动态添加可访问路由表
  204. // // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
  205. // // this.$router.replace({ path: '/' })
  206. // // this.$router.go(0)
  207. // // this.reload()
  208. // });
  209. // });
  210. } else {
  211. this.$message.success(response.data.msg);
  212. }
  213. })
  214. .catch(e => {
  215. // this.$message.success("网络异常")
  216. });
  217. },
  218. handleCommand(command) {
  219. switch (command) {
  220. case "modifyUserInfoAction":
  221. this.modifyUserInfoAction();
  222. break;
  223. case "modifyOrgInfoAction":
  224. this.modifyOrgInfoAction();
  225. break;
  226. case "logout":
  227. this.logout();
  228. break;
  229. }
  230. },
  231. logout() {
  232. this.$store.dispatch("FrontendLogout");
  233. window.location.href = process.env.BASE_API + "/logout";
  234. },
  235. modifyOrgInfoAction() {
  236. // this.$refs.modify_org_info_dialog.show()
  237. this.$router.push("/orginfo");
  238. return false;
  239. },
  240. modifyUserInfoAction() {
  241. this.$refs.modify_user_info_dialog.show();
  242. },
  243. myServe() {
  244. this.$router.push("/service");
  245. return false;
  246. },
  247. SCRMWebsit() {
  248. return process.env.SRCM_HOST;
  249. },
  250. MircoMallWebsit() {
  251. return process.env.MIRCO_MALL_HOST;
  252. },
  253. CDMWebsit() {
  254. return process.env.CDM_HOST;
  255. },
  256. APPManageWebsit() {
  257. return (
  258. process.env.SSO_HOST +
  259. "/org/admin/apps?org=" +
  260. this.$store.getters.xt_user.org_id
  261. );
  262. }
  263. },
  264. created() {
  265. getOrgs().then(response => {
  266. if (response.data.state === 1) {
  267. this.orgs = response.data.data.orgs;
  268. console.log("org", this.orgs);
  269. var creator = response.data.data.creator;
  270. console.log("creator", creator);
  271. for (let i = 0; i < this.orgs.length; i++) {
  272. if (this.orgs[i].id == this.org_id) {
  273. this.org_name = this.orgs[i].org_name;
  274. }
  275. }
  276. }
  277. });
  278. }
  279. };
  280. </script>
  281. <style rel="stylesheet/scss" lang="scss" scoped>
  282. .top-nav {
  283. background: #409eff;
  284. position: fixed;
  285. top: 0;
  286. left: 150px;
  287. right: 0;
  288. z-index: 1000;
  289. height: 50px;
  290. display: flex;
  291. align-items: center;
  292. justify-content: space-between;
  293. color: #fff;
  294. .dropdownBox {
  295. margin-left: 10px;
  296. }
  297. .navRight {
  298. display: flex;
  299. align-items: center;
  300. justify-content: space-between;
  301. min-width: 200px;
  302. margin-right: 10px;
  303. font-size: 14px;
  304. .right-menu {
  305. float: right;
  306. height: 100%;
  307. z-index: 99999;
  308. color: #fff;
  309. & :focus {
  310. outline: none;
  311. }
  312. .right-menu-item {
  313. display: inline-block;
  314. margin: 0 8px;
  315. .iconfont {
  316. font-size: 18px;
  317. }
  318. }
  319. .screenfull {
  320. height: 20px;
  321. }
  322. .international {
  323. vertical-align: top;
  324. }
  325. .theme-switch {
  326. vertical-align: 15px;
  327. }
  328. .avatar-container {
  329. margin-right: 10px;
  330. .avatar-wrapper {
  331. cursor: pointer;
  332. margin-top: 3px;
  333. display: flex;
  334. align-items: center;
  335. justify-content: center;
  336. .user-avatar {
  337. width: 40px;
  338. height: 40px;
  339. border-radius: 50%;
  340. object-fit: cover;
  341. object-position: center;
  342. }
  343. .user-title {
  344. margin: 0 8px;
  345. font-size: 14px;
  346. color: #fff;
  347. }
  348. .el-icon-caret-bottom {
  349. font-size: 12px;
  350. color: #fff;
  351. }
  352. }
  353. }
  354. }
  355. }
  356. .nav-logo {
  357. width: 162px;
  358. display: flex;
  359. align-items: center;
  360. height: 60px;
  361. text-align: center;
  362. justify-content: center;
  363. padding: 10px 0;
  364. box-sizing: border-box;
  365. float: left;
  366. img {
  367. display: inline-block;
  368. width: 100px;
  369. }
  370. }
  371. .navbar {
  372. border-radius: 0px !important;
  373. display: flex;
  374. justify-content: space-between;
  375. width: calc(100% - 180px);
  376. align-items: center;
  377. color: #fff;
  378. border: none;
  379. background: #409eff;
  380. float: left;
  381. .breadcrumb-container {
  382. float: left;
  383. }
  384. .errLog-container {
  385. display: inline-block;
  386. vertical-align: top;
  387. }
  388. .right-menu {
  389. float: right;
  390. height: 100%;
  391. z-index: 99999;
  392. & :focus {
  393. outline: none;
  394. }
  395. .right-menu-item {
  396. display: inline-block;
  397. margin: 0 8px;
  398. .iconfont {
  399. font-size: 18px;
  400. }
  401. }
  402. .screenfull {
  403. height: 20px;
  404. }
  405. .international {
  406. vertical-align: top;
  407. }
  408. .theme-switch {
  409. vertical-align: 15px;
  410. }
  411. .avatar-container {
  412. margin-right: 10px;
  413. .avatar-wrapper {
  414. cursor: pointer;
  415. margin-top: 3px;
  416. display: flex;
  417. align-items: center;
  418. justify-content: center;
  419. .user-avatar {
  420. width: 40px;
  421. height: 40px;
  422. border-radius: 50%;
  423. object-fit: cover;
  424. object-position: center;
  425. }
  426. .user-title {
  427. margin: 0 8px;
  428. font-size: 14px;
  429. color: #fff;
  430. }
  431. .el-icon-caret-bottom {
  432. font-size: 12px;
  433. color: #fff;
  434. }
  435. }
  436. }
  437. }
  438. }
  439. .system-nav {
  440. .system-nav-menu {
  441. float: left;
  442. height: 60px;
  443. line-height: 60px;
  444. padding: 0 25px;
  445. a {
  446. font-size: 15px;
  447. .iconfont {
  448. font-size: 18px;
  449. }
  450. }
  451. }
  452. .active {
  453. background: #3090eb;
  454. border-left: 1px #5fabf7 solid;
  455. border-right: 1px #5fabf7 solid;
  456. }
  457. }
  458. .el-menu::after,
  459. .el-menu::before {
  460. width: 1px;
  461. height: 1px;
  462. position: absolute;
  463. top: 0;
  464. left: 0;
  465. }
  466. }
  467. .el-dropdown-menu {
  468. z-index: 9999 !important;
  469. }
  470. .v-modal {
  471. z-index: 9999 !important;
  472. }
  473. </style>
  474. <style lang="scss">
  475. .navRight {
  476. .el-input {
  477. width: 250px;
  478. }
  479. .el-input__inner {
  480. border-radius: 30px;
  481. background: #f5f7fa;
  482. }
  483. }
  484. .dropdownBox {
  485. .el-dropdown-link {
  486. font-size: 14px;
  487. color: #fff;
  488. }
  489. }
  490. </style>