index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div id="index" ref="appRef">
  3. <div class="bg">
  4. <dv-loading v-if="loading">Loading...</dv-loading>
  5. <div v-else class="host-body">
  6. <div class="d-flex jc-center">
  7. <dv-decoration-10 class="dv-dec-10" />
  8. <div class="d-flex jc-center">
  9. <dv-decoration-8 class="dv-dec-8" :color="decorationColor" />
  10. <div class="title">
  11. <span class="title-text">COSTEC-MES 可视化平台</span>
  12. <dv-decoration-6
  13. class="dv-dec-6"
  14. :reverse="true"
  15. :color="['#50e3c2', '#67a1e5']"
  16. />
  17. </div>
  18. <dv-decoration-8
  19. class="dv-dec-8"
  20. :reverse="true"
  21. :color="decorationColor"
  22. />
  23. </div>
  24. <dv-decoration-10 class="dv-dec-10-s" />
  25. </div>
  26. <!-- 第二行 -->
  27. <div class="d-flex jc-between px-2">
  28. <div class="d-flex aside-width">
  29. <div class="react-left ml-4 react-l-s bg-color-blue">
  30. <span class="react-left"></span>
  31. <span class="text fw-b" style="font-size:24px;">柯赛科技数据看板</span>
  32. </div>
  33. </div>
  34. <div class="d-flex aside-width">
  35. <div class="react-right bg-color-r mr-3">
  36. <el-button type="text" class="text" style="width:50% ;font-size: 21px;" @click="fullScreen" ref="fullScreen"
  37. v-show=!isFullScreen >全屏</el-button>
  38. <el-button type="text" class="text" style="width:50% ;font-size: 21px;" @click="exitFullScreen" ref="exitFullScreen" v-show=isFullScreen>退出全屏</el-button>
  39. </div>
  40. <div class="react-right mr-4 react-l-s" style="width: 900px">
  41. <span class="react-after"></span>
  42. <el-dropdown class="dropdown">
  43. <span class="el-dropdown-link" ref="echarType">
  44. 生产进度看板<i class="el-icon-arrow-down el-icon--right"></i>&nbsp;&nbsp;&nbsp;&nbsp;
  45. </span>
  46. <el-dropdown-menu slot="dropdown">
  47. <el-dropdown-item class="dropdownitem"><router-link to="total">总看板</router-link></el-dropdown-item>
  48. <el-dropdown-item class="dropdownitem"><router-link to="prodline">车间看板</router-link></el-dropdown-item>
  49. <el-dropdown-item class="dropdownitem"><router-link to="quality">品质看板</router-link></el-dropdown-item>
  50. <el-dropdown-item class="dropdownitem"><router-link to="warehouse">仓库看板</router-link></el-dropdown-item>
  51. <el-dropdown-item class="dropdownitem"><router-link to="zz">组装看板</router-link></el-dropdown-item>
  52. <el-dropdown-item class="dropdownitem"><router-link to="compare">各车间进度</router-link></el-dropdown-item>
  53. </el-dropdown-menu>
  54. </el-dropdown>
  55. <span class="text">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  56. <span class="text">{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span>
  57. </div>
  58. </div>
  59. </div>
  60. <!-- 修改后的主体内容区域 -->
  61. <div class="body-box" style="height: calc(100vh - 120px); overflow: hidden;">
  62. <div class="bottom-box" style="height: 100%;">
  63. <dv-border-box-12 style="height: 100%;">
  64. <bottom1 />
  65. </dv-border-box-12>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </template>
  72. <script>
  73. import drawMixin from "../../utils/drawMixin";
  74. import common from '../../utils/common';
  75. import {formatTime} from '../../utils/index.js'
  76. import bottom1 from './bottom1.vue'
  77. import {mapMutations, mapState} from "vuex"
  78. export default {
  79. mixins: [ drawMixin,common ],
  80. computed: {
  81. ...mapState(['user','factoryoptions','factory']),
  82. },
  83. data() {
  84. return {
  85. timing: null,
  86. timing2: null,
  87. timing3: null,
  88. loading: true,
  89. dateDay: null,
  90. dateYear: null,
  91. dateWeek: null,
  92. weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
  93. decorationColor: ['#568aea', '#000000'],
  94. }
  95. },
  96. components: {
  97. bottom1
  98. },
  99. created() {
  100. this.isFullScreen = document.fullscreenElement;
  101. },
  102. mounted() {
  103. this.timeFn();
  104. this.cancelLoading();
  105. this.autoFullScreen();
  106. },
  107. beforeDestroy () {
  108. clearInterval(this.timing);
  109. clearInterval(this.timing2);
  110. },
  111. methods: {
  112. ...mapMutations(['setFactory']),
  113. timeFn() {
  114. this.timing = setInterval(() => {
  115. this.dateDay = formatTime(new Date(), 'HH: mm: ss')
  116. this.dateYear = formatTime(new Date(), 'yyyy-MM-dd')
  117. this.dateWeek = this.weekday[new Date().getDay()]
  118. }, 1000);
  119. },
  120. cancelLoading() {
  121. setTimeout(() => {
  122. this.loading = false
  123. }, 1000)
  124. },
  125. autoFullScreen(){
  126. if (!this.isFullScreen) {
  127. setTimeout(() => {
  128. this.$showMsgBox({
  129. caption: "提示",
  130. msg: '是否全屏展示?',
  131. callback: (data) => {
  132. if (data == "yes") {
  133. this.fullScreen();
  134. }
  135. }
  136. })
  137. }, 3000)
  138. }
  139. },
  140. }
  141. }
  142. </script>
  143. <style lang="scss" scoped>
  144. @import '../../assets/scss/indexmakeprocess.scss';
  145. .dropdown{
  146. font-size: 22px;
  147. color: #f7f8fa;
  148. transform: skewX(45deg);
  149. ::v-deep .el-select-dropdown {
  150. border: 1px solid #0f1325;
  151. background: #04308D !important;
  152. }
  153. ::v-deep .el-input__inner {
  154. background-color: #0f1325;
  155. color: #fff;
  156. border: 1px solid #0f1325;
  157. }
  158. .el-select-dropdown__item {
  159. color: #fff;
  160. background-color: #0f1325;
  161. }
  162. ::v-deep .el-select-dropdown {
  163. background-color: transparent;
  164. border: 1px solid #0f1325;
  165. }
  166. ::v-deep.el-select-dropdown__list {
  167. padding: 0;
  168. }
  169. ::v-deep.el-popper[x-placement^="bottom"] {
  170. margin-top: 0px;
  171. }
  172. ::v-deep.el-popper .popper__arrow,
  173. ::v-deep.el-popper .popper__arrow::after {
  174. display: none;
  175. }
  176. .el-select-dropdown__item:hover {
  177. background-color: rgba(0, 225, 219, 0.690196078431373);
  178. }
  179. }
  180. /* 新增样式 */
  181. .bg {
  182. height: 100vh;
  183. width: 100vw;
  184. overflow: hidden;
  185. }
  186. .host-body {
  187. height: 100%;
  188. display: flex;
  189. flex-direction: column;
  190. }
  191. .body-box {
  192. flex: 1;
  193. min-height: 0; /* 修复flex布局中内容溢出问题 */
  194. }
  195. .bottom-box {
  196. height: 100%;
  197. width: 100%;
  198. }
  199. </style>