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

Navbar.vue 14KB

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