AppMain.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <section class="app-main">
  3. <transition name="fade-transform" mode="out-in">
  4. <keep-alive :include="cachedViews">
  5. <router-view :key="key" />
  6. </keep-alive>
  7. </transition>
  8. <div class="tkbox" v-if="open">
  9. <div class="tkbox-title">
  10. <div class="tkbox-title-left">
  11. <img src="../../assets/images/八一.png" alt />
  12. <span>重要消息</span>
  13. </div>
  14. <div class="tkbox-title-right">
  15. <img src="../../assets/images/关闭.png" alt @click="showfun" />
  16. </div>
  17. </div>
  18. <div class="tkbox-main">
  19. <p>
  20. <img src="../../assets/images/警示.png" alt />
  21. <span>您有一条打印文件需要处理,请尽快处理</span>
  22. </p>
  23. </div>
  24. <div class="tkbox-footer">
  25. <el-button type="primary" @click="quchulifun">去处理</el-button>
  26. </div>
  27. </div>
  28. </section>
  29. </template>
  30. <script>
  31. import { printTrigger, printTriggerClear } from "@/api/PrintsManage/manage";
  32. export default {
  33. name: "AppMain",
  34. data() {
  35. return {
  36. open: false,
  37. timer: null
  38. };
  39. },
  40. created() {
  41. this.timer = null;
  42. this.startTime();
  43. },
  44. computed: {
  45. cachedViews() {
  46. return this.$store.state.tagsView.cachedViews;
  47. },
  48. key() {
  49. return this.$route.path;
  50. }
  51. },
  52. methods: {
  53. showfun() {
  54. printTriggerClear().then(res => {
  55. // console.log(res)
  56. });
  57. this.open = false;
  58. },
  59. quchulifun() {
  60. // this.$router
  61. // .push({ path: "/index", query: { name: "/print" } })
  62. // .catch(() => {});
  63. printTriggerClear().then(res => {
  64. // if(res.code==200){
  65. // }
  66. });
  67. window.open(`/print/manage`, "_self");
  68. },
  69. startTime() {
  70. this.timer = setInterval(() => {
  71. printTrigger().then(res => {
  72. console.log(res);
  73. });
  74. }, 1000000); /* 每500毫秒执行一次,实现动态显示时间效果 */
  75. }
  76. },
  77. destroyed() {
  78. clearInterval(this.timer); // 清除定时器
  79. this.timer = null;
  80. }
  81. };
  82. </script>
  83. <style lang="scss" scoped>
  84. .app-main {
  85. /* 50= navbar 50 */
  86. min-height: calc(100vh - 50px);
  87. width: 100%;
  88. position: relative;
  89. overflow: hidden;
  90. position: relative;
  91. }
  92. .tkbox {
  93. width: 500px;
  94. height: 220px;
  95. background-image: url("../../assets/images/框.png");
  96. background-size: 100% 100%;
  97. background-repeat: no-repeat;
  98. position: absolute;
  99. left: 30%;
  100. top: 30%;
  101. }
  102. .tkbox-title {
  103. width: 100%;
  104. height: 90px;
  105. display: flex;
  106. flex-direction: row;
  107. }
  108. .tkbox-title-left {
  109. flex: 1;
  110. display: flex;
  111. align-items: center;
  112. }
  113. .tkbox-title-left img {
  114. margin-right: 10px;
  115. width: 30px;
  116. height: 30px;
  117. margin-left: 35px;
  118. display: inline-block;
  119. }
  120. .tkbox-title-left span {
  121. color: #fff;
  122. }
  123. .tkbox-title-right {
  124. flex: 1;
  125. display: flex;
  126. justify-content: right;
  127. align-items: center;
  128. margin-right: 35px;
  129. }
  130. .tkbox-main {
  131. width: 100%;
  132. height: 60px;
  133. }
  134. .tkbox-main p {
  135. width: 90%;
  136. height: auto;
  137. margin: 0 auto;
  138. color: #fff;
  139. font-size: 14px;
  140. display: flex;
  141. align-items: center;
  142. justify-content: center;
  143. }
  144. .tkbox-main p span {
  145. margin-left: 10px;
  146. }
  147. .tkbox-footer {
  148. width: 100%;
  149. height: 30px;
  150. margin-bottom: 30px;
  151. text-align: center;
  152. }
  153. .fixed-header + .app-main {
  154. padding-top: 50px;
  155. }
  156. .hasTagsView {
  157. .app-main {
  158. /* 84 = navbar + tags-view = 50 + 34 */
  159. min-height: calc(100vh - 84px);
  160. }
  161. .fixed-header + .app-main {
  162. padding-top: 84px;
  163. }
  164. }
  165. </style>
  166. <style lang="scss">
  167. // fix css style bug in open el-dialog
  168. .el-popup-parent--hidden {
  169. .fixed-header {
  170. padding-right: 17px;
  171. }
  172. }
  173. // 设置背景颜色
  174. .app-main {
  175. background: #022845;
  176. }
  177. // 头部背景颜色、字体颜色
  178. .navbar {
  179. background: #114a80 !important;
  180. color: #fff !important;
  181. // box-shadow:5px 5px 10px black;
  182. border-bottom: 1px solid #15324e;
  183. }
  184. .el-scrollbar__view {
  185. background-color: #114a80;
  186. }
  187. .app-breadcrumb.el-breadcrumb .no-redirect {
  188. color: #fff !important;
  189. }
  190. .el-breadcrumb__inner a {
  191. color: #fff !important;
  192. }
  193. .tags-view-container {
  194. background: #022845 !important;
  195. border: 0px !important;
  196. }
  197. .navbar .right-menu .avatar-container .avatar-wrapper .el-icon-caret-bottom {
  198. color: #fff !important;
  199. }
  200. .navbar .right-menu .right-menu-item {
  201. color: #fff !important;
  202. }
  203. // 设置主题内外边距
  204. .app-container {
  205. margin: 10px 10px 10px 10px;
  206. padding: 15px 15px 15px 15px;
  207. }
  208. </style>