赫艾前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

253 lines
6.8 KiB

3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config container ">
  3. <div class="pdfMenu" >
  4. <div v-bind:style="{ width: '100%', height: '13%', backgroundColor: color,border: '3px',borderColor: 'white' ,borderStyle:'solid'}"></div>
  5. <!-- <button v-on:click="changeColor">Change Color</button>-->
  6. <h1 style="color: white">SOP指导书 派工单|{{seqNo}}</h1>
  7. </div>
  8. <div class="pdf-wrapper" ref="pdfWrapper">
  9. <img style="max-width: 100%;max-height: 100%;vertical-align:middle;" :src="sopUrl">
  10. <!-- <pdf ref="pdfViewer"-->
  11. <!-- :src="sopUrl"-->
  12. <!-- :page="sopPage"-->
  13. <!-- @num-pages="setSopPages"-->
  14. <!-- @page-loaded="setPageLoaded"-->
  15. <!-- class="pdf-document"-->
  16. <!-- ></pdf>-->
  17. </div>
  18. <div class="pdfMenu" >
  19. <h1 style="color: white">SIP指导书 操作员|{{operator}}</h1>
  20. </div>
  21. <div class="pdf-wrapper" ref="pdfWrapper">
  22. <img style="max-width: 100%;max-height: 100%;vertical-align:middle;" :src="badUrl">
  23. <!-- <pdf ref="pdfViewer"-->
  24. <!-- :src="badUrl"-->
  25. <!-- :page="badPage"-->
  26. <!-- @num-pages="setBadPages"-->
  27. <!-- @page-loaded="setPageLoaded"-->
  28. <!-- class="pdf-document"-->
  29. <!-- ></pdf>-->
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import {
  35. getSopAddress,
  36. } from '@/api/board.js'
  37. export default {
  38. name: 'sopBoard',
  39. data () {
  40. return {
  41. color:'#ffff00',
  42. tvId:this.$route.query.ip?this.$route.query.ip:'TV001',
  43. operator:'',
  44. seqNo:'',
  45. sopMax: 1,
  46. sopPage: 1,
  47. badMax: 1,
  48. badPage: 1,
  49. height: 200,
  50. tableData: [],
  51. // 默认的刷新,滚动时间,滚动间距
  52. // refreshTime: 5,
  53. // rollTime: 5,
  54. // rollPx: 1,
  55. sopUrl: '',
  56. badUrl: '',
  57. sopList:[],
  58. badList:[],
  59. pageLoaded: false,
  60. timeOut:30000,
  61. // packageUrl:'http://192.168.1.130/upload/',
  62. // packageUrl:'http://192.168.2.172/sopFile/',
  63. packageUrl:this.$store.state.user.tvSopUrl,
  64. }
  65. },
  66. mounted () {
  67. this.changePdf();
  68. this.changePage();
  69. this.getPDF();
  70. },
  71. methods: {
  72. changePdf() {
  73. //获取图片数据
  74. setInterval(() => {
  75. this.getPDF();
  76. }, 90000)
  77. },
  78. changePage() {
  79. //刷新图片
  80. setInterval(() => {
  81. this.changePic()
  82. }, 30000)
  83. // }, this.timeOut)
  84. },
  85. changePic(){
  86. if(this.sopPage==this.sopMax){
  87. this.sopPage=1;
  88. }else {
  89. this.sopPage=Number(this.sopPage)+1
  90. }
  91. this.sopUrl=this.packageUrl+this.sopList[this.sopPage-1].attaFileNameDb;
  92. if(this.badPage==this.badMax){
  93. this.badPage=1;
  94. }else {
  95. this.badPage=Number(this.badPage)+1
  96. }
  97. this.badUrl=this.packageUrl+this.badList[this.badPage-1].attaFileNameDb;
  98. },
  99. changeColor(type){
  100. if(type==='1'){
  101. this.color='#00ff00'
  102. }else if(type==='2'){
  103. this.color='#ffff00'
  104. }else if(type==='3'){
  105. this.color='#ff0303'
  106. }else {
  107. this.color='#ffff00'
  108. }
  109. },
  110. getPDF(){
  111. let data={
  112. tvId: this.tvId
  113. }
  114. getSopAddress(data).then(({data}) => {
  115. if(data.code==0){
  116. if(data.data.nowSeqNo==null||data.data.nowSeqNo==''){
  117. this.sopUrl='';
  118. this.badUrl='';
  119. this.sopList=[];
  120. this.badList=[];
  121. this.seqNo='无';
  122. this.operator='无';
  123. this.changeColor(data.data.colourFlag)
  124. }else if(this.seqNo!=data.data.nowSeqNo) {
  125. this.sopUrl='';
  126. this.badUrl='';
  127. this.operator = data.data.nowOperator;
  128. this.seqNo = data.data.nowSeqNo;
  129. this.sopList=data.sop;
  130. this.badList=data.bad;
  131. this.sopPage=1;
  132. this.badPage=1;
  133. this.sopMax=data.sop.length;
  134. this.badMax=data.bad.length;
  135. this.changeColor(data.data.colourFlag)
  136. if(this.sopList.length>0){
  137. this.sopUrl=this.packageUrl+this.sopList[0].attaFileNameDb;
  138. }
  139. if(this.badList.length>0){
  140. this.badUrl=this.packageUrl+this.badList[0].attaFileNameDb;
  141. }
  142. }else if(this.seqNo==data.data.nowSeqNo) {
  143. this.sopList=data.sop;
  144. this.badList=data.bad;
  145. this.sopMax=data.sop.length;
  146. this.badMax=data.bad.length;
  147. this.changeColor(data.data.colourFlag)
  148. }
  149. // console.log("SOP:"+ this.sopUrl)
  150. // console.log("不良:"+ this.badUrl)
  151. // console.log(this.$store.state.user.tvSopUrl)
  152. // console.log(this.sopList)
  153. // console.log("SOP:"+ this.sopList[0].attaFileNameDb)
  154. }else {
  155. this.sopUrl='';
  156. this.badUrl='';
  157. this.sopList=[];
  158. this.badList=[];
  159. this.seqNo='无';
  160. this.operator='无';
  161. this.changeColor('2')
  162. }
  163. })
  164. }
  165. },
  166. created () {
  167. // this.search()
  168. // this.refreshTable()
  169. }
  170. }
  171. </script>
  172. <style >
  173. .board2 .el-table .cell {
  174. line-height: 13px;
  175. font-size: 12px;
  176. height: 13px;
  177. padding: 0px;
  178. }
  179. .board2 .el-table .#00ff00 {
  180. background: #8cee8c;
  181. }
  182. .board2 .el-table .success-row {
  183. background: #00ff00;
  184. }
  185. .board2 .el-table .false-row {
  186. /*background: #cbcb14;*/
  187. background: #ff0000;
  188. }
  189. .board2 .el-table .#ffff00-row{
  190. background: #ffff00;
  191. }
  192. .container {
  193. font-size: 13px;
  194. position: fixed;
  195. top: 0;
  196. left: 0;
  197. z-index: -1;
  198. width: 100%;
  199. height: 100%;
  200. content: "";
  201. background-image: url(~@/assets/img/factory.jpg);
  202. background-size: cover;
  203. }
  204. .pdf-container {
  205. position: relative;
  206. width: 100%;
  207. height: 100%;
  208. }
  209. .pdf-wrapper {
  210. position: relative;
  211. width: 43%;
  212. height: 100%;
  213. float: left;
  214. margin-top: 0%;
  215. margin-left: 0%;
  216. overflow: hidden;
  217. display: flex;
  218. align-items: center; /* 垂直居中 */
  219. justify-content: center; /* 水平居中 */
  220. }
  221. .pdf-document {
  222. transform-origin: center;
  223. width: 100%;
  224. height: 100%;
  225. }
  226. .pdfMenu {
  227. font-size: 11px;
  228. width: 7%;
  229. height: 100%;
  230. float: left;
  231. writing-mode: vertical-lr; /* 竖排显示,从左到右 */
  232. text-orientation: upright; /* 竖排文字方向为正常朝向 */
  233. display: flex; /* 使用 Flex 布局 */
  234. align-items: center; /* 垂直居中对齐 */
  235. }
  236. .vertical-text {
  237. writing-mode: vertical-lr; /* 竖排显示,从左到右 */
  238. text-orientation: upright; /* 竖排文字方向为正常朝向 */
  239. }
  240. </style>