App.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <template>
  2. <div>
  3. <div
  4. :class="{ 'grid-container': isShowTopNavigation, 'grid-container-hide-column1': !isShowMenu }"
  5. >
  6. <div v-if="isShowMenu" class="grid-item-row12-column1">
  7. <div>
  8. <keep-alive>
  9. <MenuWidget />
  10. </keep-alive>
  11. </div>
  12. </div>
  13. <div v-if="isShowTopNavigation" class="grid-item-row1-column2">
  14. <div>
  15. <!-- top navigation -->
  16. <keep-alive>
  17. <TopNavigation @menu-visible-changed="clickIsShowMenu" />
  18. </keep-alive>
  19. </div>
  20. </div>
  21. <div :class="{'grid-item-row2-column2' : isShowTopNavigation}">
  22. <div id="grid-item-center" :class="{'grid-center-container' : isShowTopNavigation}" />
  23. <div :class="{'center-container-single' : !isShowTopNavigation, 'center-container' : isShowTopNavigation }">
  24. <router-view />
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import MenuWidget from './client/MenuWidget.vue';
  32. import TopNavigation from './client/TopNavigation.vue';
  33. export default {
  34. components: {
  35. MenuWidget,
  36. TopNavigation,
  37. },
  38. data: function () {
  39. return {
  40. // 是否显示菜单
  41. isShowMenu: false,
  42. // 是否显示上导航栏
  43. isShowTopNavigation: false,
  44. };
  45. },
  46. watch: {
  47. '$route.path': function (value) {
  48. this.computerComponentVisible();
  49. },
  50. },
  51. mounted: function () {
  52. var _self = this;
  53. var languageSelected = localStorage.getItem('#languageSelected');
  54. if (languageSelected == null || languageSelected == '') {
  55. this.$i18n.locale = 'zh-CN';
  56. } else {
  57. this.$i18n.locale = languageSelected;
  58. }
  59. this.computerComponentVisible();
  60. },
  61. methods: {
  62. /**
  63. * 点击之后存储isShowMenu
  64. */
  65. clickIsShowMenu: function () {
  66. var _self = this;
  67. this.isShowMenu = !this.isShowMenu;
  68. // localStorage.setItem('#IsShowMenu', this.isShowMenu);
  69. },
  70. /**
  71. * 计算组件的显示隐藏
  72. */
  73. computerComponentVisible: function () {
  74. let path = this.$route.path;
  75. let count = 0;
  76. if (path != null) {
  77. for (let index = 0; index < path.length; index++) {
  78. if (path[index] == '/') {
  79. count++;
  80. }
  81. }
  82. if (path.indexOf('register/') >= 0) {
  83. count = 1;
  84. }
  85. if (path.indexOf('dictionary/') >= 0) {
  86. count = 1;
  87. }
  88. if (path.indexOf('propassapp/') >= 0) {
  89. count = 1;
  90. }
  91. if (path.indexOf('single/') >= 0) {
  92. count = 1;
  93. }
  94. if (path.indexOf('lowcode-page/') >= 0) {
  95. count = 1;
  96. }
  97. if (path.indexOf('/generate-document/') >= 0) {
  98. count = 1;
  99. }
  100. if (window.top !== window.self) {
  101. count = 1;
  102. }
  103. }
  104. //if (value == "/client-init" || value == "/login") {
  105. if (count == 1) {
  106. this.isShowMenu = false;
  107. this.isShowTopNavigation = false;
  108. } else {
  109. // var isShowMenu = localStorage.getItem('#IsShowMenu');
  110. // if (isShowMenu == 'true') {
  111. // this.isShowMenu = true;
  112. // } else {
  113. // this.isShowMenu = false;
  114. // }
  115. this.isShowMenu = true;
  116. this.isShowTopNavigation = true;
  117. }
  118. },
  119. },
  120. };
  121. </script>
  122. <style scoped>
  123. .grid-container {
  124. display: grid;
  125. grid-template-columns: 230px auto;
  126. grid-template-rows: 54px 1fr;
  127. gap: 0px;
  128. justify-items: stretch;
  129. align-items: stretch;
  130. height: calc(100vh);
  131. overflow: auto;
  132. }
  133. .grid-container-hide-column1 {
  134. grid-template-columns: 0px auto;
  135. /*grid-template-rows: 0px 1fr;*/
  136. }
  137. .grid-item-row12-column1 {
  138. grid-row-start: 1;
  139. grid-row-end: 3;
  140. grid-column-start: 1;
  141. grid-column-end: 2;
  142. }
  143. .grid-item-row1-column2 {
  144. grid-row-start: 1;
  145. grid-row-end: 2;
  146. grid-column-start: 2;
  147. grid-column-end: 3;
  148. }
  149. .grid-item-row2-column2 {
  150. grid-row-start: 2;
  151. grid-row-end: 3;
  152. grid-column-start: 2;
  153. grid-column-end: 3;
  154. overflow: auto;
  155. }
  156. .grid-center-container {
  157. padding: 10px 20px 0;
  158. }
  159. .center-container-single {
  160. /* padding: 0px 20px 0; */
  161. padding: 0px;
  162. }
  163. .center-container {
  164. padding: 0px 20px 0;
  165. }
  166. </style>
  167. <style>
  168. /** 修复Bootstrap样式的BUG,input-group form-control 控件 会显示在 日期控件的前面 */
  169. .input-group .form-control {
  170. /* z-index: 0; */
  171. /*checked by DengXin,修复input-group form-control 控件 会显示在 日期控件的前面的BUG*/
  172. position: static;
  173. }
  174. </style>
  175. <!-- 已确定的CSS样式 -->
  176. <style>
  177. .site_title {
  178. text-overflow: ellipsis;
  179. overflow: hidden;
  180. font-weight: 400;
  181. font-size: 22px;
  182. width: 100%;
  183. color: #ecf0f1 !important;
  184. margin-left: 0 !important;
  185. line-height: 59px;
  186. display: block;
  187. height: 55px;
  188. margin: 0;
  189. padding-left: 10px;
  190. }
  191. .site_title:hover,
  192. .site_title:focus {
  193. text-decoration: none;
  194. }
  195. .clearfix {
  196. clear: both;
  197. }
  198. </style>
  199. <!-- 已确定的CSS 样式 -->
  200. <style>
  201. .container {
  202. width: 100% !important;
  203. padding: 0 !important;
  204. }
  205. .left_col {
  206. background: #2a3f54;
  207. }
  208. .menu_section {
  209. margin-bottom: 35px;
  210. }
  211. .menu_section h3 {
  212. padding-left: 23px;
  213. color: #fff;
  214. text-transform: uppercase;
  215. letter-spacing: 0.5px;
  216. font-weight: bold;
  217. font-size: 11px;
  218. margin-bottom: 0;
  219. margin-top: 0;
  220. text-shadow: 1px 1px #000;
  221. }
  222. .menu_section > ul {
  223. margin-top: 10px;
  224. }
  225. </style>
  226. <style>
  227. .nav-md .container.body .col-md-3.left_col {
  228. width: 230px;
  229. padding: 0;
  230. position: absolute;
  231. display: -ms-flexbox;
  232. display: flex;
  233. }
  234. .nav-md .container.body .col-md-3.left_col.menu_fixed {
  235. height: 100%;
  236. position: fixed;
  237. }
  238. .nav-md .container.body .right_col {
  239. padding: 10px 20px 0;
  240. }
  241. /*@media (max-width: 991px) {
  242. .nav-md .container.body .right_col {
  243. width: 100%;
  244. margin: 0;
  245. }
  246. .nav-md .container.body .col-md-3.left_col {
  247. display: none;
  248. }
  249. .nav-md .container.body .right_col {
  250. width: 100%;
  251. padding-right: 0;
  252. }
  253. .right_col {
  254. padding: 10px !important;
  255. }
  256. }*/
  257. </style>
  258. <style>
  259. .profile_pic {
  260. width: 35%;
  261. float: left;
  262. }
  263. .img-circle.profile_img {
  264. width: 70%;
  265. background: #fff;
  266. margin-left: 15%;
  267. z-index: 1000;
  268. position: inherit;
  269. border: 1px solid rgba(52, 73, 94, 0.44);
  270. padding: 0px;
  271. }
  272. .profile_info {
  273. margin-top: 5px;
  274. width: 65%;
  275. float: left;
  276. }
  277. .profile_info span {
  278. font-size: 13px;
  279. line-height: 30px;
  280. color: #bab8b8;
  281. }
  282. .profile_info h2 {
  283. font-size: 14px;
  284. color: #ecf0f1;
  285. margin: 0;
  286. font-weight: 300;
  287. }
  288. .profile.img_2 {
  289. text-align: center;
  290. }
  291. .profile.img_2 .profile_pic {
  292. width: 100%;
  293. }
  294. .profile.img_2 .profile_pic .img-circle.profile_img {
  295. width: 50%;
  296. margin: 10px 0 0;
  297. }
  298. .profile.img_2 .profile_info {
  299. padding: 15px 10px 0;
  300. width: 100%;
  301. margin-bottom: 10px;
  302. float: left;
  303. }
  304. .main_menu span.fa {
  305. float: right;
  306. text-align: center;
  307. margin-top: 5px;
  308. font-size: 10px;
  309. min-width: inherit;
  310. color: #c4cfda;
  311. }
  312. .active a span.fa {
  313. text-align: right !important;
  314. margin-right: 4px;
  315. }
  316. /* .navbar-nav > li > a {
  317. color: #fff !important;
  318. } */
  319. body .container.body .right_col {
  320. background: #f7f7f7;
  321. }
  322. .nav_title {
  323. width: 230px;
  324. float: left;
  325. background: #2a3f54;
  326. border-radius: 0;
  327. height: 57px;
  328. }
  329. @media (max-width: 1200px) {
  330. .x_title h2 {
  331. width: 62%;
  332. font-size: 17px;
  333. }
  334. .tile,
  335. .graph {
  336. zoom: 85%;
  337. height: inherit;
  338. }
  339. }
  340. @media (max-width: 1270px) and (min-width: 192px) {
  341. .x_title h2 small {
  342. display: none;
  343. }
  344. }
  345. .left_col .mCSB_scrollTools {
  346. width: 6px;
  347. }
  348. .left_col .mCSB_dragger {
  349. max-height: 400px !important;
  350. }
  351. </style>
  352. <style>
  353. /** 修复分页的样式 By YangZhiJie 2021-07-06 11:23 */
  354. nav ul.pagination {
  355. margin: 0 !important;
  356. }
  357. /** 修复CURD界面输入框右上角和右下角的圆弧倒角覆盖的BUG By YangZhiJie 2021-12-09 20:14 */
  358. .input-group .form-control:first-child {
  359. border-radius: 4px;
  360. }
  361. </style>