center.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <div id="center">
  3. <!-- <div class="up">
  4. <div
  5. class="bg-color-black item"
  6. v-for="item in titleItem"
  7. :key="item.title"
  8. >
  9. <p class="ml-3 colorBlue fw-b fs-xl">{{ item.title }}</p>
  10. <div>
  11. <dv-digital-flop
  12. class="dv-dig-flop ml-1 mt-2 pl-3"
  13. :config="item.number"
  14. />
  15. </div>
  16. </div>
  17. </div>-->
  18. <div class="down">
  19. <div class="ranking bg-color-black">
  20. <span>
  21. <icon name="chart-pie" class="text-icon"></icon>
  22. </span>
  23. <span class="fs-xl text mx-2 mb-1 pl-3">当前时段生产明细</span>
  24. <dv-scroll-board class="dv-scr-board" :config="config" ref="scroll-board" />
  25. </div>
  26. <!-- <div class="percent">
  27. <div class="item bg-color-black">
  28. <span>首检合格率</span>
  29. <CenterChart
  30. :id="rate[0].id"
  31. :tips="rate[0].tips"
  32. :colorObj="rate[0].colorData"
  33. />
  34. </div>
  35. <div class="item bg-color-black">
  36. <span>巡检合格率</span>
  37. <CenterChart
  38. :id="rate[1].id"
  39. :tips="rate[1].tips"
  40. :colorObj="rate[1].colorData"
  41. />
  42. </div>
  43. <div class="water">
  44. <dv-water-level-pond class="dv-wa-le-po" :config="water" />
  45. </div>
  46. </div>-->
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. //import CenterChart from '@/components/packageechart/center/centerChartRate'
  52. export default {
  53. data() {
  54. return {
  55. config: {
  56. header: ['工单号','工序', '当前小时数量'],
  57. data: [
  58. ],
  59. rowNum: 7, //表格行数
  60. headerHeight: 35,
  61. headerBGC: '#0f1325', //表头
  62. oddRowBGC: '#0f1325', //奇数行
  63. evenRowBGC: '#171c33', //偶数行
  64. columnWidth: [130,120,110],
  65. align: ['center']
  66. },
  67. timing : null,
  68. }
  69. },
  70. components: {
  71. // CenterChart
  72. },
  73. mounted () {
  74. this.drawTimingFn();
  75. },
  76. beforeDestroy () {
  77. clearInterval(this.timing)
  78. },
  79. methods: {
  80. drawTimingFn () {
  81. this.setData();
  82. this.timing = setInterval(() => {
  83. this.setData(); //获取-数据
  84. }, 30000);
  85. },
  86. async setData () {
  87. // 首检任务数,完成数,合格数,巡检任务数,完成数,巡检合格数 name value
  88. /* await this.$http.get("kanban/datalist.action?caller=CheckData&_noc=1&page=1&pageSize=100",{
  89. params: {
  90. condition: "1=1",
  91. }
  92. }).then((result)=>{
  93. let dataList = JSON.parse(result.data.data);
  94. let titleitems = new Array();
  95. for (let index = 0; index < dataList.length; index++) {
  96. const element = dataList[index];
  97. titleitems.push({
  98. title: element.name,
  99. number: {
  100. number: [element.value],
  101. toFixed: 1,
  102. textAlign: 'left',
  103. content: '{nt}',
  104. style: {
  105. fontSize: 26
  106. }
  107. }
  108. });
  109. }
  110. this.titleItem = titleitems;
  111. },(result)=>{
  112. console.error(result)
  113. }
  114. );*/
  115. // var caller = 'KeyStepRate!ZZ';
  116. var caller = 'CurrentHour!ZZ';
  117. if (sessionStorage.getItem('li_code') == '所有'){
  118. caller = 'ZZ!KeyStepRate!ALL';
  119. }
  120. //关键工序直通率
  121. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  122. params: {
  123. condition: "1=1",
  124. }
  125. }).then((result)=>{
  126. let dataList = JSON.parse(result.data.data);
  127. let resultList = new Array();
  128. for (let index = 0; index < dataList.length; index++) {
  129. const element = dataList[index];
  130. let item = new Array();
  131. item.push("<span class='colorGrass'>"+element.makecode+"</span>");
  132. item.push("<span class='colorGrass'>"+element.stepcode+"</span>");
  133. item.push("<span class='colorGrass'>"+element.value+"</span>");
  134. resultList.push(item);
  135. }
  136. const scrollBoard = this.$refs['scroll-board'];
  137. //刷新数据
  138. scrollBoard.updateRows(resultList);
  139. },(result)=>{
  140. console.error(result)
  141. }
  142. );
  143. //饼图pie,首检合格率,巡检合格率
  144. /* await this.$http.get("kanban/datalist.action?caller=PieCheckRate&_noc=1&page=1&pageSize=100&condition=1=1")
  145. .then((result)=>{
  146. let dataList = JSON.parse(result.data.data);
  147. this.rate[0].tips = dataList[0].firstcheckrate;
  148. this.rate[0].tips = dataList[0].xcheckrate;
  149. },(result)=>{
  150. console.error(result)
  151. }
  152. );*/
  153. //水波图,首检合格率,巡检合格率
  154. /* await this.$http.get("kanban/datalist.action?caller=WaterCheckRate&_noc=1&page=1&pageSize=100&condition=1=1")
  155. .then((result)=>{
  156. let dataList = JSON.parse(result.data.data);
  157. let waterdatas = new Array();
  158. waterdatas.push(dataList[0].firstcheckrate);
  159. waterdatas.push(dataList[0].xcheckrate);
  160. this.water = { data: waterdatas }
  161. },(result)=>{
  162. console.error(result)
  163. }
  164. );*/
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. $box-height: 420px;
  171. #center {
  172. display: flex;
  173. flex-direction: column;
  174. .up {
  175. width: 100%;
  176. display: flex;
  177. flex-wrap: wrap;
  178. justify-content: space-around;
  179. .item {
  180. border-radius: 6px;
  181. padding-top: 8px;
  182. margin-top: 8px;
  183. width: 32%;
  184. height: 70px;
  185. .dv-dig-flop {
  186. width: 150px;
  187. height: 30px;
  188. }
  189. }
  190. }
  191. .down {
  192. padding: 6px 4px;
  193. padding-bottom: 0;
  194. width: 100%;
  195. display: flex;
  196. height: $box-height;
  197. justify-content: space-between;
  198. .bg-color-black {
  199. border-radius: 5px;
  200. height: $box-height - 15px;
  201. }
  202. .ranking {
  203. padding: 10px;
  204. width: 100%;
  205. .dv-scr-rank-board {
  206. height: 370px;
  207. }
  208. }
  209. .percent {
  210. width: 40%;
  211. display: flex;
  212. flex-wrap: wrap;
  213. .item {
  214. width: 50%;
  215. height: 120px;
  216. span {
  217. margin-top: 8px;
  218. font-size: 14px;
  219. display: flex;
  220. justify-content: center;
  221. }
  222. }
  223. .water {
  224. width: 100%;
  225. .dv-wa-le-po {
  226. height: 120px;
  227. }
  228. }
  229. }
  230. }
  231. }
  232. </style>