Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

248 linhas
5.7 KiB

  1. <!--
  2. * @Description: 项目入口组件
  3. * @version: V1.0
  4. * @Author: xzx
  5. * @Date: 2019-11-04 17:22:44
  6. * @LastEditors : xzx
  7. * @LastEditTime : 2020-01-08 16:47:56
  8. -->
  9. <template>
  10. <div id="app">
  11. <!-- <Header
  12. :v-show="header_show"
  13. ref="mychild"
  14. :showHelp="showHelpPage"
  15. :showIndexOption="showIndexOption"
  16. @closeShowOption="closeShowOption"
  17. @closeWorkSet="closeWorkSet"
  18. @searchName="getSearchName"
  19. :isShowOutWorkSpace="isShowOutWorkSpace"
  20. @outWorkSpace="getOutWorkSpace"
  21. id="bignav"
  22. ></Header> -->
  23. <!--
  24. @showOption="showOption"
  25. @showHelp="showHelp"
  26. :searchName="searchName"
  27. @isShowOutWorkSpace="getIsShowOutWorkSpace"
  28. :outWorkSpace="outWorkSpace"
  29. -->
  30. <router-view
  31. ref="mainpage"
  32. id="bigbody"
  33. class="mt-40"
  34. :class="{'mt-64': setMarginTop,
  35. 'calc-height': setMarginTop,
  36. 'workspace-bigbody': $route.path.indexOf('/workspace') >=0,
  37. 'mt-76': $route.name == 'newproject' || $route.name == 'projdetail'}"
  38. ></router-view>
  39. </div>
  40. </template>
  41. <script>
  42. // import Header from "@/views/components_web/head/head.vue";
  43. import system from "@/services/system";
  44. export default {
  45. components: {
  46. // Header,
  47. },
  48. name: "App",
  49. data() {
  50. return {
  51. header_show: true,
  52. companyName: "",
  53. mypath: "/",
  54. showIndexOption: false, //index.vue里的意见反馈
  55. showHelpPage: false, //index.vue里的帮助
  56. searchName: "",
  57. isShowOutWorkSpace: false,
  58. outWorkSpace: false,
  59. isClient: system.isClient,
  60. onlineStatus: false,//网关状态
  61. state: this.$store.state,
  62. };
  63. },
  64. created: function () {
  65. console.log('版本编译时间:', process.env.BUILD_TIME);
  66. if (
  67. document.getElementById("Loading") != null &&
  68. document.getElementById("Loading").nodeName != null &&
  69. document.getElementById("Loading").nodeName != ""
  70. ) {
  71. document.body.removeChild(document.getElementById("Loading"));
  72. }
  73. if (this.$route.name == "login" || this.$route.name == "notfound" || this.$route.name === 'platform') {
  74. this.header_show = false;
  75. }
  76. if(this.isClient) {
  77. system.keepLiveTest((status)=> {
  78. this.onlineStatus = status;
  79. this.$store.changeGatewayState(status);
  80. sessionStorage.setItem('isOnLine', String(status && navigator.onLine));
  81. }, (isMaxWindowSize) => {
  82. this.$store.state.isMaxWindowSize = isMaxWindowSize;
  83. });
  84. system.subscribeGatewayMessage();
  85. }
  86. },
  87. computed: {
  88. setMarginTop() {
  89. return this.isClient || this.$route.name == 'workspace';
  90. },
  91. currentRoutePath() {
  92. return this.$route.path;
  93. }
  94. },
  95. mounted: function () {
  96. // 监听滚动事件
  97. window.addEventListener("scroll", this.handleScroll, true);
  98. },
  99. methods: {
  100. /**
  101. * 检测bigbody滚动距离添加样式
  102. */
  103. handleScroll: function () {
  104. // let scrollBody = document.getElementById("bigbody");
  105. // let scrollnav = document.getElementById("bignav");
  106. // if (scrollBody.scrollTop > 0) {
  107. // scrollnav.classList.add("scorllbaron");
  108. // } else {
  109. // scrollnav.classList.remove("scorllbaron");
  110. // }
  111. // 项目列表首页
  112. },
  113. /**
  114. * @description: 打开意见反馈弹框
  115. * @param {type}
  116. * @return:
  117. */
  118. showOption: function () {
  119. this.showIndexOption = true;
  120. },
  121. /**
  122. * @description: 打开帮助弹框
  123. * @param {type}
  124. * @return:
  125. */
  126. showHelp: function () {
  127. this.showHelpPage = true;
  128. },
  129. /**
  130. * @description: 关闭意见反馈弹框
  131. * @param {type}
  132. * @return:
  133. */
  134. closeShowOption: function () {
  135. this.showIndexOption = false;
  136. this.showHelpPage = false;
  137. },
  138. closeWorkSet: function () {
  139. if (this.$route.name == "workspace") {
  140. this.$refs["mainpage"].closeAppManagePain();
  141. }
  142. },
  143. /**
  144. * 获取全局搜索的值
  145. * */
  146. getSearchName(data) {
  147. this.searchName = data;
  148. },
  149. /**
  150. * 获取是否显示 回到协作空间 的值
  151. * */
  152. getIsShowOutWorkSpace(data) {
  153. this.outWorkSpace = false;
  154. this.isShowOutWorkSpace = data;
  155. },
  156. /**
  157. * 获取 点击回到协作空间后的动作
  158. * */
  159. getOutWorkSpace(data) {
  160. this.outWorkSpace = data;
  161. },
  162. },
  163. beforeDestroy() {
  164. // 销毁监听
  165. window.removeEventListener("scroll", this.handleScroll);
  166. },
  167. watch: {
  168. $route(to) {
  169. this.mypath = to.path;
  170. },
  171. currentRoutePath(val) {
  172. if(val.indexOf('projdetail') >=0 ) {
  173. document.body.classList.add('set-bgc');
  174. } else {
  175. document.body.classList.remove('set-bgc');
  176. }
  177. }
  178. },
  179. };
  180. </script>
  181. <style lang="scss">
  182. jmnode {
  183. border: none;
  184. box-shadow: 0 1px 2px 0 rgba(#000, 0.2);
  185. border-radius: 4px;
  186. &:hover {
  187. box-shadow: none;
  188. border: 2px solid rgba(#7850FF, 1);
  189. }
  190. &.selected {
  191. box-shadow: none;
  192. border: 2px solid rgba(#7850FF, 1);
  193. background-color: #fff;
  194. color: #333;
  195. }
  196. }
  197. .workspace-bigbody {
  198. overflow: hidden !important;
  199. }
  200. ::-webkit-scrollbar {
  201. width: 8px;
  202. border-radius: 4px;
  203. }
  204. ::-webkit-scrollbar-thumb {
  205. -webkit-border-radius: 10px;
  206. border-radius: 10px;
  207. height: 10px;
  208. background-color: #adadad;
  209. }
  210. /*当前窗口失去焦点时的滑块样式*/
  211. ::-webkit-scrollbar-thumb:window-inactive {
  212. background-color: #adadad;
  213. }
  214. </style>
  215. <style lang="scss" scoped>
  216. .mt-40 {
  217. margin: 40px 0 0 0;
  218. }
  219. .mt-60 {
  220. margin: 60px 0 0 0;
  221. }
  222. .mt-64 {
  223. margin: 64px 0 0 0;
  224. }
  225. .mt-76 {
  226. margin: 76px 0 0 0;
  227. }
  228. </style>
  229. <style>
  230. .calc-height {
  231. height: calc(100vh - 64px) !important;
  232. }
  233. .set-bgc {
  234. background-color: #ebebeb !important;
  235. }
  236. </style>