Layout.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <div class="app-wrapper" :class="classObj">
  3. <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"></div>
  4. <div class="mainBox">
  5. <div class="navLeft">
  6. <div v-if="menzhenShow" :class="index == 0 ? 'navOne navActive' : 'navOne'" @click="clickActive(0,'HIS管理')">
  7. <i class="iconfont icon--yishengmenzhen navIcon"></i>
  8. <p>HIS管理</p>
  9. </div>
  10. <div v-if="bingliShow" :class="index == 1 ? 'navOne navActive' : 'navOne'" @click="clickActive(1,'电子病历')">
  11. <i class="iconfont icon-s_bingli navIcon"></i>
  12. <p>电子病历</p>
  13. </div>
  14. <div v-if="touxiShow" :class="index == 2 ? 'navOne navActive' : 'navOne'" @click="clickActive(2,'透析管理')">
  15. <i class="iconfont icon-computer_fill navIcon"></i>
  16. <p>透析管理</p>
  17. </div>
  18. <div v-if="caigouShow" :class="index == 5 ? 'navOne navActive' : 'navOne'" @click="clickActive(5,'采购管理')">
  19. <i class="iconfont icon-kccx navIcon"></i>
  20. <p>采购管理</p>
  21. </div>
  22. <div v-if="kucunShow" :class="index == 3 ? 'navOne navActive' : 'navOne'" @click="clickActive(3,'库房管理')">
  23. <i class="iconfont icon-kccx navIcon"></i>
  24. <p>库房管理</p>
  25. </div>
  26. <div v-if="kuyishoppingShow" :class="index == 4 ? 'navOne navActive' : 'navOne'" @click="clickActive(4,'酷医商城')">
  27. <i class="iconfont icon-shangcheng-1 navIcon"></i>
  28. <p>酷医商城</p>
  29. </div>
  30. <div class="navOne" @click="open">
  31. <i class="iconfont icon-manage_fill navIcon"></i>
  32. <p>更多</p>
  33. </div>
  34. </div>
  35. <sidebar :navTitle="navTitle" v-show="navShow" class="sidebar-container" @func="show"></sidebar>
  36. <div class="main-container new-main-container" style="flex:1;margin-top:50px;">
  37. <navbar></navbar>
  38. <!-- <tags-view></tags-view> -->
  39. <app-main></app-main>
  40. </div>
  41. </div>
  42. <div class="dialogMadol" v-if="sign" @click="close"></div>
  43. <div class="dialogBox" v-if="sign">
  44. <div class="dialogBoxTitle">
  45. <span>更多菜单</span>
  46. <span @click="close">关闭</span>
  47. </div>
  48. <div class="dialogMain">
  49. <!-- <div class="dialogMainOne" @click="clickActive(5,'库存管理')">
  50. <div class="dialogIcon">
  51. <i class="el-icon-menu newIcon"></i>
  52. </div>
  53. <p>库存管理</p>
  54. </div> -->
  55. <!-- <a :href="CDMWebsit()" target="_blank" v-if="this.$store.getters.xt_user.cdm_role_exist">
  56. <div class="dialogMainOne">
  57. <div class="dialogIcon">
  58. <i class="iconfont icon-yiliao newIcon"></i>
  59. </div>
  60. <p>慢病管理</p>
  61. </div>
  62. </a>
  63. <a :href="SCRMWebsit()" target="_blank" v-if="this.$store.getters.xt_user.scrm_role_exist">
  64. <div class="dialogMainOne">
  65. <div class="dialogIcon">
  66. <i class="iconfont icon-yingxiao newIcon"></i>
  67. </div>
  68. <p>营销管理</p>
  69. </div>
  70. </a> -->
  71. <!-- <div class="dialogMainOne">
  72. <div class="dialogIcon">
  73. <i class="iconfont icon-shujufenxi-jingyinggaikuang newIcon"></i>
  74. </div>
  75. <p>经营中心</p>
  76. </div> -->
  77. <a :href="MircoMallWebsit()" target="_blank" v-if="this.$store.getters.xt_user.mall_role_exist">
  78. <div class="dialogMainOne">
  79. <div class="dialogIcon">
  80. <i class="iconfont icon-fenxiao newIcon"></i>
  81. </div>
  82. <p>分销商城</p>
  83. </div>
  84. </a>
  85. <div v-if="peizhiShow" class="dialogMainOne" @click="clickActive(11,'配置管理')">
  86. <div class="dialogIcon">
  87. <i class="iconfont icon-setup_fill newIcon"></i>
  88. </div>
  89. <p>配置管理</p>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. </template>
  95. <script>
  96. import { mapGetters } from "vuex";
  97. import { Navbar, Sidebar, AppMain, TagsView } from './components'
  98. import ResizeMixin from './mixin/ResizeHandler'
  99. export default {
  100. name: 'layout',
  101. components: {
  102. Navbar,
  103. Sidebar,
  104. AppMain,
  105. TagsView
  106. },
  107. mixins: [ResizeMixin],
  108. data(){
  109. return{
  110. index:2,
  111. navTitle:'透析管理',
  112. sign:false,
  113. navShow:true,
  114. //
  115. menzhenShow:true,
  116. bingliShow:true,
  117. touxiShow:true,
  118. kucunShow:true,
  119. peizhiShow:true,
  120. kuyishoppingShow:true,
  121. caigouShow:true,
  122. }
  123. },
  124. created(){
  125. let menzhen = ['hospitalStation',"hospitalRecord","hospitalCharges","hisTool",'outpatientRegistration','outpatientDoctorStation','outpatientCharges','outpatientPharmacy','outpatientRecord'];
  126. let bingli = ['User','createPatient'];
  127. let touxi = ['home','workforce', 'dialysisrecord', 'dialysis', 'medicalScheduling', 'signIndex', 'qcd', 'device', 'quality_control'];
  128. let kucun = ['stockManage','stockDrugs','selfPreparedMedicine','otherManagement'];
  129. let caigou = ['supplyManage','supplyList'];
  130. let peizhi = ['system','roleManage','DepartManage', 'bedManagement', 'dictionaryManagement', 'templateManagement','showconfig','printTemplate','integration_config','basicConfig'];
  131. let kuyishopping = ['kuyiShopping'];
  132. let menzhenArr = [];
  133. let bingliArr = [];
  134. let touxiArr = [];
  135. let kucunArr = [];
  136. let peizhiArr = [];
  137. let kuyishoppingArr = [];
  138. let caigouArr =[]
  139. this.permission_routers.map(item => {
  140. if(menzhen.indexOf(item.name) > -1){
  141. menzhenArr.push(item)
  142. }else if(bingli.indexOf(item.name) > -1){
  143. bingliArr.push(item)
  144. }else if(touxi.indexOf(item.name) > -1){
  145. touxiArr.push(item)
  146. }else if(kucun.indexOf(item.name) > -1){
  147. kucunArr.push(item)
  148. }else if(peizhi.indexOf(item.name) > -1){
  149. peizhiArr.push(item)
  150. }else if(kuyishopping.indexOf(item.name) > -1){
  151. kuyishoppingArr.push(item)
  152. }else if(caigou.indexOf(item.name)>-1){
  153. caigouArr.push(item)
  154. }
  155. });
  156. // console.log('menzhenArr.length',menzhenArr.length)
  157. // console.log('bingliArr.length',bingliArr.length)
  158. // console.log('touxiArr.length',touxiArr.length)
  159. // console.log('kucunArr.length',kucunArr.length)
  160. // console.log('peizhiArr.length',peizhiArr.length)
  161. // console.log('kuyishoppingArr.length',kuyishoppingArr.length)
  162. console.log("cagouArr23323322323",caigouArr.length)
  163. if(menzhenArr.length == 0){
  164. this.menzhenShow = false
  165. }else if(bingliArr.length == 0){
  166. this.bingliShow = false
  167. }else if(touxiArr.length == 0){
  168. this.touxiShow = false
  169. }else if(kucunArr.length == 0){
  170. this.kucunShow = false
  171. }else if(peizhiArr.length == 0){
  172. this.peizhiShow = false
  173. }else if(kuyishoppingArr.length == 0){
  174. this.kuyishoppingShow = false
  175. }else if(caigouArr.length == 0){
  176. this.caigouShow = false
  177. }
  178. },
  179. computed: {
  180. ...mapGetters(["permission_routers"]),
  181. sidebar() {
  182. return this.$store.state.app.sidebar
  183. },
  184. device() {
  185. return this.$store.state.app.device
  186. },
  187. classObj() {
  188. return {
  189. hideSidebar: !this.sidebar.opened,
  190. openSidebar: this.sidebar.opened,
  191. withoutAnimation: this.sidebar.withoutAnimation,
  192. mobile: this.device === 'mobile'
  193. }
  194. }
  195. },
  196. methods: {
  197. handleClickOutside() {
  198. this.$store.dispatch('closeSideBar', { withoutAnimation: false })
  199. },
  200. clickActive(index,title){
  201. if(index == 4){
  202. // this.$router.push({ path: "/kuyiShopping",name:"kuyiShopping" })
  203. this.$router.push('/kuyiShopping/index')
  204. }else if(index == 6){
  205. this.CDMWebsit()
  206. }
  207. this.index = index;
  208. this.navTitle = title;
  209. this.sign = false
  210. },
  211. open(){
  212. this.sign = true
  213. },
  214. close(){
  215. this.sign = false
  216. },
  217. show(data){
  218. this.navShow = data
  219. },
  220. SCRMWebsit() {
  221. return process.env.SRCM_HOST;
  222. },
  223. MircoMallWebsit() {
  224. return process.env.MIRCO_MALL_HOST;
  225. },
  226. CDMWebsit() {
  227. return process.env.CDM_HOST;
  228. },
  229. }
  230. }
  231. </script>
  232. <style rel="stylesheet/scss" lang="scss" scoped>
  233. @import "src/styles/mixin.scss";
  234. .app-wrapper {
  235. @include clearfix;
  236. position: relative;
  237. height: 100%;
  238. width: 100%;
  239. &.mobile.openSidebar{
  240. position: fixed;
  241. top: 0;
  242. }
  243. }
  244. .drawer-bg {
  245. background: #000;
  246. opacity: 0.3;
  247. width: 100%;
  248. top: 0;
  249. height: 100%;
  250. position: absolute;
  251. z-index: 999;
  252. }
  253. // .sidebar-container{
  254. // position: fixed;
  255. // top:50px;
  256. // left:0;
  257. // }
  258. .navLeft{
  259. width:80px;
  260. height:100%;
  261. background: #1F2D3D;
  262. margin-top:50px;
  263. .navOne{
  264. font-size:14px;
  265. width:80px;
  266. height:80px;
  267. color:#BFCBD9;
  268. display: flex;
  269. align-items: center;
  270. flex-direction: column;
  271. cursor: pointer;
  272. .navIcon{
  273. margin: 16px 0 10px 0;
  274. font-size: 24px;
  275. }
  276. }
  277. .navActive{
  278. background: #409EFF;
  279. color:#fff;
  280. }
  281. }
  282. .mainBox{
  283. display:flex;
  284. width:100%;
  285. height:calc(100% - 50px)
  286. }
  287. #app .sidebar-container {
  288. width: 140px !important;
  289. height: 100%;
  290. margin-top:50px;
  291. overflow: visible;
  292. background-color: #fff;
  293. }
  294. .dialogBox{
  295. width: 392px;
  296. height: 400px;
  297. background: #304155;
  298. position: fixed;
  299. bottom:0;
  300. left:80px;
  301. z-index:4000;
  302. .dialogBoxTitle{
  303. display: flex;
  304. justify-content: space-between;
  305. padding:0 16px;
  306. border-bottom:1px solid #BFCBD9;
  307. height:44px;
  308. align-items: center;
  309. color:#BFCBD9;
  310. >:last-child{
  311. cursor: pointer;
  312. }
  313. }
  314. .dialogMain{
  315. display: flex;
  316. flex-wrap: wrap;
  317. }
  318. .dialogMainOne{
  319. color:#BFCBD9;
  320. display: flex;
  321. align-items: center;
  322. flex-direction: column;
  323. margin: 16px;
  324. .dialogIcon{
  325. width: 66px;
  326. height: 66px;
  327. background: rgba(64, 158, 255, 0.2);
  328. display: flex;
  329. align-items: center;
  330. margin-bottom: 10px;
  331. }
  332. .newIcon{
  333. margin: 0 auto;
  334. font-size: 24px;
  335. }
  336. >p{
  337. font-size: 14px;
  338. }
  339. }
  340. }
  341. .dialogMadol{
  342. position: fixed;
  343. left: 0;
  344. top: 0;
  345. width: 100%;
  346. height: 100%;
  347. opacity: .5;
  348. background: #000;
  349. z-index: 3000;
  350. }
  351. .new-main-container{
  352. width: calc(100% - 220px);
  353. }
  354. .sidebar-container{
  355. transform: translate3d(0, 0, 0) !important;
  356. }
  357. </style>