layout.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <div
  3. :style="styleLayoutMainGroup"
  4. :class="{grayMode: grayActive}"
  5. class="ibps-layout-header-aside-group hidden-print"
  6. >
  7. <!-- <iframe
  8. style="display: none;"
  9. id="iframeContain"
  10. name="iframeContain"
  11. seamless
  12. scrolling="yes"
  13. src="https://www.szjyxt.com/#/fileView?url=https%3A%2F%2Fwww.szjyxt.com%2Fibps%2Fplatform%2Fv3%2Ffile%2Fdownload%3FattachmentId%3D925044155762081792&isEdit=true&fileType=docx&title=GDYR-CX01-A0%20%E4%BF%9D%E8%AF%81%E5%85%AC%E6%AD%A3%E6%80%A7%E7%AE%A1%E7%90%86%E7%A8%8B%E5%BA%8F&user=%5Bobject%20Object%5D&mode=view&editUrl=https%3A%2F%2Fwww.szjyxt.com%2Fibps%2Fplatform%2Fv3%2Ffile%2FeditCallback%3FfileName%3DGDYR-CX01-A0%20%E4%BF%9D%E8%AF%81%E5%85%AC%E6%AD%A3%E6%80%A7%E7%AE%A1%E7%90%86%E7%A8%8B%E5%BA%8F%26fileType%3Ddocx&key="
  14. >
  15. </iframe> -->
  16. <!-- 半透明遮罩 -->
  17. <div class="ibps-layout-header-aside-mask" />
  18. <!-- websocket -->
  19. <!-- <ibps-notify-monitor /> -->
  20. <!-- 主体内容 -->
  21. <div class="ibps-layout-header-aside-content" flex="dir:top">
  22. <panle/>
  23. <!-- 顶栏 -->
  24. <div
  25. :style="{
  26. opacity: searchActive ? 0.5 : 1
  27. }"
  28. class="ibps-theme-header"
  29. style=" box-shadow: 1px 4px 6px rgba(0, 0, 0, .12), 0 0 5px rgba(155,155, 0, .04);margin-bottom: 5px;"
  30. flex-box="0"
  31. flex
  32. >
  33. <!-- <div
  34. :class="{'logo-group': true,
  35. 'logo-transition': asideTransition,
  36. 'ibps-pt-5':system.logoType ==='image',
  37. 'ibps-pl-0':system.logoType ==='image'
  38. }"
  39. :style="{width: asideCollapse ? asideWidthCollapse : asideWidth}"
  40. flex-box="0"
  41. >
  42. <el-dropdown
  43. v-if="subsystemList && subsystemList.length >1"
  44. trigger="click"
  45. placement="bottom-start"
  46. @command="command => handleSubsystemClick(command)"
  47. >
  48. <ibps-logo
  49. :system="system"
  50. :aside-collapse="asideCollapse"
  51. :subsystem-list="subsystemList"
  52. :logo-icon-all="logoIconAll"
  53. :logo-icon-only="logoIconOnly"
  54. />
  55. <el-dropdown-menu slot="dropdown" style="width:180px;">
  56. <el-dropdown-item
  57. v-for="(item,index) in subsystemList"
  58. :key="index"
  59. :disabled="item.id===system.id"
  60. :command="item"
  61. >
  62. <ibps-icon :name="item.logo||'logo'" :title="item.name" /> {{ item.name }}
  63. </el-dropdown-item>
  64. </el-dropdown-menu>
  65. </el-dropdown>
  66. <ibps-logo
  67. v-else
  68. :system="system"
  69. :aside-collapse="asideCollapse"
  70. :subsystem-list="subsystemList"
  71. :logo-icon-all="logoIconAll"
  72. :logo-icon-only="logoIconOnly"
  73. />
  74. </div> -->
  75. <!-- <div class="toggle-aside-btn" flex-box="0" @click="handleToggleAside">
  76. <ibps-icon :name="asideCollapse ?'indent':'outdent'" />
  77. </div> -->
  78. <ibps-menu-header
  79. flex-box="1"
  80. @pageChange ="pageChange"
  81. />
  82. <!-- 顶栏右侧 -->
  83. <div class="ibps-header-right" flex-box="0">
  84. <!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$nodeEnv === 'development'" -->
  85. <!-- <ibps-header-search @click="handleSearchClick" /> --> <!-- 全局搜索放大镜 -->
  86. <!-- <ibps-header-error-log v-if="$nodeEnv === 'development'" />
  87. <ibps-header-base-url v-if="$nodeEnv === 'development'" /> --><!-- 日志与异常 -->
  88. <!-- <ibps-header-download /> -->
  89. <!-- <ibps-header-locking />
  90. <ibps-header-theme />
  91. <ibps-header-language />
  92. <ibps-header-size /> -->
  93. <!-- <ibps-header-fullscreen /> -->
  94. <!-- <ibps-header-tenant /> -->
  95. <span style="font-size: 12px; cursor: pointer;" @click="goToMain()">首页</span>
  96. <span style="margin: 0 10px; ">|</span>
  97. <ibps-header-message /><!-- 消息中心 -->
  98. <span style="margin: 0 10px; ">|</span>
  99. <ibps-header-user />
  100. <span style="margin-left: 10px;">|</span>
  101. <ibps-header-setting />
  102. </div>
  103. </div>
  104. <!-- 下面 主体 -->
  105. <div class="ibps-theme-container" flex-box="1" flex>
  106. <!-- 主体 侧边栏 -->
  107. <div
  108. v-if="sysName !='首页'"
  109. ref="aside"
  110. flex-box="0"
  111. :class="{'ibps-theme-container-aside': true, 'ibps-theme-container-transition': asideTransition}"
  112. :style="{
  113. width: asideCollapse ? asideWidthCollapse : asideWidth,
  114. opacity: searchActive ? 0.5 : 1
  115. }"
  116. >
  117. <!-- 侧部顶头栏-->
  118. <div class="layout-border-left">
  119. <div class="toggle-aside-btn" style="float: right; width: 25%;" @click="handleToggleAside">
  120. <ibps-icon :name="asideCollapse ?'indent':'outdent'" />
  121. </div>
  122. <div style="width: 74%;" class="toggle-aside-btn layout-border-left-name">
  123. <span>{{getSystemName[0].name}}</span>
  124. </div>
  125. </div>
  126. <ibps-menu-side style="margin-top: 52px;"/>
  127. </div>
  128. <!-- 主体 -->
  129. <div class="ibps-theme-container-main" flex-box="1" flex>
  130. <!-- 搜索 -->
  131. <transition name="fade-scale">
  132. <div v-show="searchActive" class="ibps-theme-container-main-layer" flex>
  133. <ibps-panel-search
  134. ref="panelSearch"
  135. @close="searchPanelClose"
  136. />
  137. </div>
  138. </transition>
  139. <!-- 内容 -->
  140. <transition name="fade-scale">
  141. <div v-show="!searchActive" class="ibps-theme-container-main-layer" flex="dir:top">
  142. <!-- tab -->
  143. <!-- <div class="ibps-theme-container-main-header" flex-box="0">
  144. <ibps-tabs />
  145. </div> -->
  146. <!-- 页面 -->
  147. <div class="ibps-theme-container-main-body" flex-box="1">
  148. <transition :name="transitionActive ? 'fade-transverse' : ''">
  149. <!-- <keep-alive :include="keepAlive"> -->
  150. <router-view :key="routerViewKey" />
  151. <!-- </keep-alive> -->
  152. </transition>
  153. </div>
  154. </div>
  155. </transition>
  156. </div>
  157. </div>
  158. </div>
  159. <FloatBall></FloatBall>
  160. </div>
  161. </template>
  162. <script>
  163. import IbpsLogo from './components/logo'
  164. import IbpsMenuSide from './components/menu-side/index.js'
  165. import IbpsMenuHeader from './components/menu-header/index.js'
  166. import IbpsTabs from './components/tabs'
  167. import IbpsHeaderSearch from './components/header-search'
  168. import FloatBall from './components/components/float-ball';
  169. import IbpsHeaderFullscreen from './components/header-fullscreen'
  170. // import IbpsHeaderLocking from './components/header-locking'
  171. // import IbpsHeaderLanguage from './components/header-language'
  172. // import IbpsHeaderSize from './components/header-size'
  173. // import IbpsHeaderTheme from './components/header-theme'
  174. // import IbpsHeaderToolbar from './components/header-toolbar'
  175. // import IbpsHeaderTenant from './components/header-tenant'
  176. import IbpsHeaderSetting from './components/header-setting'
  177. import IbpsHeaderMessage from './components/header-message'
  178. import panle from '@/components/jbd-panel'
  179. import IbpsHeaderUser from './components/header-user'
  180. import IbpsHeaderErrorLog from './components/header-error-log'
  181. import IbpsHeaderBaseUrl from './components/header-base-url'
  182. // import IbpsHeaderDownload from './components/header-download'
  183. // import IbpsNotifyMonitor from '@/business/platform/socket/notify-monitor'
  184. import { mapState, mapGetters, mapActions } from 'vuex'
  185. import mixinSearch from './mixins/search'
  186. import mixinLock from './mixins/lock'
  187. import setting from '@/setting.js'
  188. export default {
  189. name: 'ibps-layout-header-aside',
  190. components: {
  191. IbpsLogo,
  192. IbpsMenuSide,
  193. IbpsMenuHeader,
  194. IbpsTabs,
  195. IbpsHeaderSearch,
  196. FloatBall,
  197. panle,
  198. IbpsHeaderFullscreen,
  199. // IbpsHeaderLocking,
  200. // IbpsHeaderLanguage,
  201. // IbpsHeaderSize,
  202. // IbpsHeaderTheme,
  203. // IbpsHeaderToolbar,
  204. // IbpsHeaderTenant,
  205. IbpsHeaderSetting,
  206. IbpsHeaderMessage,
  207. IbpsHeaderUser,
  208. IbpsHeaderErrorLog,
  209. IbpsHeaderBaseUrl
  210. // IbpsHeaderDownload,
  211. // IbpsNotifyMonitor
  212. },
  213. mixins: [
  214. mixinSearch,
  215. mixinLock
  216. ],
  217. data() {
  218. return {
  219. // [侧边栏宽度] 正常状态
  220. asideWidth: '200px',
  221. // [侧边栏宽度] 折叠状态
  222. asideWidthCollapse: '65px',
  223. }
  224. },
  225. /* watch:{
  226. getSystemName(value){
  227. this.sysName = ''
  228. },
  229. }, */
  230. mounted() {
  231. /* window.performance.navigation.type == 1 && */
  232. if (this.$route.name == 'dashboard') {
  233. this.sysName = '首页'
  234. }
  235. },
  236. computed: {
  237. ...mapState('ibps', {
  238. // sysName:state=>state.menu.sysName,
  239. keepAlive: state => state.page.keepAlive,
  240. grayActive: state => state.gray.active,
  241. transitionActive: state => state.transition.active,
  242. asideCollapse: state => state.menu.asideCollapse,
  243. asideTransition: state => state.menu.asideTransition,
  244. system: state => state.system.system,
  245. subsystemList: state => state.system.subsystemList
  246. }),
  247. ...mapGetters('ibps', {
  248. themeActiveSetting: 'theme/activeSetting'
  249. }),
  250. getSystemName() {
  251. let this_ = this
  252. return this.header().filter(function (name){ return name.id == this_.activeHeader()})
  253. },
  254. /**
  255. * @description 用来实现带参路由的缓存
  256. */
  257. sysName() {
  258. if (this.$route.name == 'dashboard') {
  259. return '首页'
  260. } else {
  261. return ''
  262. }
  263. },
  264. routerViewKey() {
  265. // 默认情况下 key 类似 __transition-n-/foo
  266. // 这里的字符串操作是为了最终 key 的格式和原来相同 类似 __transition-n-__stamp-time-/foo
  267. const stamp = this.$route.meta[`__stamp-${this.$route.path}`] || ''
  268. return `${stamp ? `__stamp-${stamp}-` : ''}${this.$route.path}`
  269. },
  270. /**
  271. /**
  272. * @description 最外层容器的背景图片样式
  273. */
  274. styleLayoutMainGroup() {
  275. return {
  276. ...this.themeActiveSetting.backgroundImage ? {
  277. backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`
  278. } : {}
  279. }
  280. },
  281. logoIconAll() {
  282. return `${this.$baseUrl}images/theme/${this.themeActiveSetting.name}/all.png`
  283. },
  284. logoIconOnly() {
  285. return `${this.$baseUrl}images/theme/${this.themeActiveSetting.name}/only.png`
  286. }
  287. },
  288. methods: {
  289. ...mapActions('ibps/menu', [
  290. 'asideCollapseToggle'
  291. ]),
  292. ...mapState('ibps/menu', [
  293. 'activeHeader',
  294. 'header',
  295. 'activeName'
  296. ]),
  297. /* 跳转首页*/
  298. goToMain() {
  299. // this.sysName = "首页"
  300. this.$router.push({
  301. name: 'dashboard'
  302. })
  303. },
  304. pageChange() {
  305. this.sysName = ''
  306. },
  307. /**
  308. * 接收点击切换侧边栏的按钮
  309. */
  310. handleToggleAside() {
  311. this.asideCollapseToggle()
  312. },
  313. handleSubsystemClick(system) {
  314. this.$store.dispatch('ibps/system/set', system)
  315. window.location.href = this.$baseUrl
  316. // location.reload() // 为了重新实例化vue-router对象 避免bug
  317. }
  318. }
  319. }
  320. </script>
  321. <style lang="scss">
  322. // 注册主题
  323. @import '~@/assets/styles/theme/register.scss';
  324. .jbd-sys-title{
  325. background: linear-gradient(to top,rgb(51, 150, 209),#7dbfdf);
  326. // background: rgb(51, 150, 209);
  327. height: 40px;
  328. line-height: 40px;
  329. font-size: 18px;
  330. color: #FFF;
  331. text-align: center;
  332. }
  333. .jbd-sys-title-cont{
  334. height: 40px;
  335. line-height: 40px;
  336. font-weight: bold;
  337. font-size: 14px;
  338. }
  339. .jbd-sys-title-contact{
  340. line-height: 20px;
  341. margin-right: 40px;
  342. font-size: 14px;
  343. }
  344. .layout-border-left{
  345. float: left;
  346. box-shadow: 0px 2px 4px #E78C45, 0 0 5px rgba(155,155, 0, .04);
  347. width: 100%;
  348. height: 50px;
  349. line-height: 50px;
  350. .layout-border-left-name{
  351. float: left;
  352. font-size: 18px;
  353. font-weight: bold;
  354. }
  355. }
  356. </style>