AppMain.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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>{{title}}</span>
  22. </p>
  23. </div>
  24. <div class="tkbox-footer">
  25. <button @click="quchulifun">去处理</button>
  26. </div>
  27. </div>
  28. <div class="tkbox2" v-if="open2">
  29. <div class="tkbox-title">
  30. <div class="tkbox-title-left">
  31. <img src="../../assets/images/八一.png" alt />
  32. <span>重要消息</span>
  33. </div>
  34. <div class="tkbox-title-right">
  35. <img src="../../assets/images/关闭.png" alt @click="showfun" />
  36. </div>
  37. </div>
  38. <div class="tkbox-main">
  39. <p>
  40. <img src="../../assets/images/警示.png" alt />
  41. <span>{{title2}}</span>
  42. </p>
  43. </div>
  44. <div class="tkbox-footer">
  45. <button @click="quchulifun2">去处理</button>
  46. </div>
  47. </div>
  48. <div class="tkbox3" v-if="open3">
  49. <div class="tkbox-title">
  50. <div class="tkbox-title-left">
  51. <img src="../../assets/images/八一.png" alt />
  52. <span>重要消息</span>
  53. </div>
  54. <div class="tkbox-title-right">
  55. <img src="../../assets/images/关闭.png" alt @click="showfun3" />
  56. </div>
  57. </div>
  58. <div class="tkbox-main">
  59. <p>
  60. <img src="../../assets/images/警示.png" alt />
  61. <span>{{ title3 }}</span>
  62. </p>
  63. </div>
  64. <div class="tkbox-footer">
  65. <button @click="quchulifun3">去处理</button>
  66. </div>
  67. </div>
  68. <div class="tkbox4" v-if="open4">
  69. <div class="tkbox-title">
  70. <div class="tkbox-title-left">
  71. <img src="../../assets/images/八一.png" alt />
  72. <span>重要消息</span>
  73. </div>
  74. <div class="tkbox-title-right">
  75. <img src="../../assets/images/关闭.png" alt @click="showfun4" />
  76. </div>
  77. </div>
  78. <div class="tkbox-main">
  79. <p>
  80. <img src="../../assets/images/警示.png" alt />
  81. <span>{{ title4 }}</span>
  82. </p>
  83. </div>
  84. <div class="tkbox-footer">
  85. <button @click="quchulifun4">去处理</button>
  86. </div>
  87. </div>
  88. </section>
  89. </template>
  90. <script>
  91. import {
  92. printTrigger,
  93. printTriggerClear,
  94. printEachTrigger
  95. } from "@/api/PrintsManage/manage";
  96. import { workEachTrigger, workTrigger } from "@/api/pt";
  97. import Cookies from "js-cookie";
  98. export default {
  99. name: "AppMain",
  100. data() {
  101. return {
  102. open: false,
  103. timer: null,
  104. title: "",
  105. open2: false,
  106. title2: "",
  107. open3: false,
  108. open4: false,
  109. title3: "",
  110. title4: ""
  111. };
  112. },
  113. created() {
  114. this.timer = null;
  115. this.startTime();
  116. },
  117. computed: {
  118. cachedViews() {
  119. return this.$store.state.tagsView.cachedViews;
  120. },
  121. key() {
  122. return this.$route.path;
  123. }
  124. },
  125. methods: {
  126. showfun() {
  127. printTriggerClear().then(res => {
  128. // console.log(res)
  129. });
  130. this.open = false;
  131. },
  132. showfun2() {
  133. printTriggerClear().then(res => {
  134. // console.log(res)
  135. });
  136. this.open2 = false;
  137. },
  138. showfun3() {
  139. printTriggerClear().then(res => {
  140. // console.log(res)
  141. });
  142. this.open3 = false;
  143. },
  144. showfun4() {
  145. printTriggerClear().then(res => {
  146. // console.log(res)
  147. });
  148. this.open4 = false;
  149. },
  150. quchulifun() {
  151. printTriggerClear().then(res => {
  152. if (res.code == 200) {
  153. window.open(`/print/manage`, "_self");
  154. }
  155. });
  156. },
  157. quchulifun2() {
  158. printTriggerClear().then(res => {
  159. if (res.code == 200) {
  160. this.open = false;
  161. window.open(`/print/manage`, "_self");
  162. }
  163. });
  164. },
  165. quchulifun3() {
  166. printTriggerClear().then(res => {
  167. if (res.code == 200) {
  168. this.open3 = false;
  169. window.open(`/workingArrangements/workTask`, "_self");
  170. }
  171. });
  172. },
  173. quchulifun4() {
  174. printTriggerClear().then(res => {
  175. if (res.code == 200) {
  176. this.open4 = false;
  177. window.open(`/workingArrangements/workTask`, "_self");
  178. }
  179. });
  180. },
  181. startTime() {
  182. this.timer = setInterval(() => {
  183. printTrigger().then(res => {
  184. if (res.code == 200) {
  185. if (res.print == "print") {
  186. if (res.numb != 0) {
  187. this.title2 = "您有打印文件需要处理,请尽快处理";
  188. this.open2 = true;
  189. }
  190. }
  191. }
  192. });
  193. printEachTrigger().then(res => {
  194. if (res.code == 200) {
  195. if (res.print == "printUserInfo") {
  196. var sendId = Cookies.get("userId");
  197. if (res.printUserInfo == sendId) {
  198. if (res.numb != 0) {
  199. this.title = res.msg;
  200. this.open = true;
  201. }
  202. }
  203. }
  204. }
  205. });
  206. workEachTrigger().then(res => {
  207. var sendId = Cookies.get("userId");
  208. if (res.code == 200) {
  209. if (res.workEach != 0) {
  210. if (res.workUserid == sendId) {
  211. this.title3 = res.msg;
  212. this.open3 = true;
  213. }
  214. }
  215. }
  216. });
  217. workTrigger().then(res => {
  218. // var sendId = Cookies.get("userId");
  219. if (res.code == 200) {
  220. if (res.workRequest != 0) {
  221. this.title4 = res.msg;
  222. this.open4 = true;
  223. }
  224. }
  225. });
  226. }, 10000); /* 每500毫秒执行一次,实现动态显示时间效果 */
  227. }
  228. },
  229. destroyed() {
  230. clearInterval(this.timer); // 清除定时器
  231. this.timer = null;
  232. }
  233. };
  234. </script>
  235. <style lang="scss" scoped>
  236. .app-main {
  237. /* 50= navbar 50 */
  238. min-height: calc(100vh - 50px);
  239. width: 100%;
  240. position: relative;
  241. overflow: hidden;
  242. position: relative;
  243. }
  244. .tkbox {
  245. width: 500px;
  246. height: 220px;
  247. background-image: url("../../assets/images/框.png");
  248. background-size: 100% 100%;
  249. background-repeat: no-repeat;
  250. position: absolute;
  251. left: 20%;
  252. top: 30%;
  253. }
  254. .tkbox2 {
  255. width: 500px;
  256. height: 220px;
  257. background-image: url("../../assets/images/框.png");
  258. background-size: 100% 100%;
  259. background-repeat: no-repeat;
  260. position: absolute;
  261. right: 26%;
  262. top: 30%;
  263. }
  264. .tkbox3 {
  265. width: 500px;
  266. height: 220px;
  267. background-image: url("../../assets/images/框.png");
  268. background-size: 100% 100%;
  269. background-repeat: no-repeat;
  270. position: absolute;
  271. left: 20%;
  272. top: 38%;
  273. }
  274. .tkbox4 {
  275. width: 500px;
  276. height: 220px;
  277. background-image: url("../../assets/images/框.png");
  278. background-size: 100% 100%;
  279. background-repeat: no-repeat;
  280. position: absolute;
  281. right: 26%;
  282. top: 38%;
  283. }
  284. .tkbox-title {
  285. width: 100%;
  286. height: 90px;
  287. }
  288. .tkbox-title-left {
  289. width: 90%;
  290. display: inline-block;
  291. line-height: 90px;
  292. position: relative;
  293. }
  294. .tkbox-title-left img {
  295. position: absolute;
  296. left: 35px;
  297. top: 30px;
  298. }
  299. .tkbox-title-left span {
  300. color: #fff;
  301. line-height: 95px;
  302. margin-left: 75px;
  303. }
  304. .tkbox-title-right {
  305. width: 10%;
  306. text-align: right;
  307. display: inline-block;
  308. }
  309. .tkbox-title-right img {
  310. text-align: right;
  311. margin-right: 30px;
  312. }
  313. .tkbox-main {
  314. width: 100%;
  315. height: 60px;
  316. }
  317. .tkbox-main p {
  318. width: 90%;
  319. height: auto;
  320. margin: 0 auto;
  321. color: #fff;
  322. font-size: 14px;
  323. display: flex;
  324. align-items: center;
  325. justify-content: center;
  326. }
  327. .tkbox-main p span {
  328. margin-left: 10px;
  329. }
  330. .tkbox-footer {
  331. width: 100%;
  332. height: 30px;
  333. margin-bottom: 30px;
  334. text-align: center;
  335. }
  336. .fixed-header + .app-main {
  337. padding-top: 50px;
  338. }
  339. .hasTagsView {
  340. .app-main {
  341. /* 84 = navbar + tags-view = 50 + 34 */
  342. min-height: calc(100vh - 84px);
  343. }
  344. .fixed-header + .app-main {
  345. padding-top: 84px;
  346. }
  347. }
  348. </style>
  349. <style lang="scss">
  350. // fix css style bug in open el-dialog
  351. .el-popup-parent--hidden {
  352. .fixed-header {
  353. padding-right: 17px;
  354. }
  355. }
  356. // 设置背景颜色
  357. .app-main {
  358. background: #022845;
  359. }
  360. // 头部背景颜色、字体颜色
  361. .navbar {
  362. background: #114a80 !important;
  363. color: #fff !important;
  364. // box-shadow:5px 5px 10px black;
  365. border-bottom: 1px solid #15324e;
  366. }
  367. .el-scrollbar__view {
  368. background-color: #114a80;
  369. }
  370. .app-breadcrumb.el-breadcrumb .no-redirect {
  371. color: #fff !important;
  372. }
  373. .el-breadcrumb__inner a {
  374. color: #fff !important;
  375. }
  376. .tags-view-container {
  377. background: #022845 !important;
  378. border: 0px !important;
  379. }
  380. .navbar .right-menu .avatar-container .avatar-wrapper .el-icon-caret-bottom {
  381. color: #fff !important;
  382. }
  383. .navbar .right-menu .right-menu-item {
  384. color: #fff !important;
  385. }
  386. // 设置主题内外边距
  387. .app-container {
  388. margin: 10px 10px 10px 10px;
  389. padding: 15px 15px 15px 15px;
  390. }
  391. .tkbox-footer button {
  392. width: 60px;
  393. height: 25px;
  394. text-align: center;
  395. line-height: 21px;
  396. background-color: #409eff;
  397. color: #fff;
  398. border-radius: 6px;
  399. border: none;
  400. }
  401. </style>