center.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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-ranking-board class="dv-scr-rank-board mt-1" :config="ranking" ref="scroll-ranking-board"/>
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. //import CenterChart from '@/components/packageechart/center/centerChartRate'
  31. export default {
  32. data() {
  33. return {
  34. titleItem:[],
  35. ranking: {
  36. data: [],
  37. carousel: 'single',
  38. rowNum:4,
  39. valueFormatter ({ name,value }) {
  40. console.warn(arguments);
  41. if((name == '插件' && value<98) || (name == '组装' && value<99.2) || (name == '老化' && value<99) || (name == '包装' && value<98)) {
  42. return '<div style ="color:red">' + value + ' </div>';
  43. }else{
  44. return '<div style ="color:#18a158">' + value + ' </div>';
  45. }
  46. }
  47. },
  48. water: {
  49. data: [],//[24, 66],
  50. shape: 'roundRect',
  51. formatter: '{value}%',
  52. waveNum: 3,
  53. waveHeight:20
  54. },
  55. }
  56. },
  57. components: {
  58. // CenterChart
  59. },
  60. mounted () {
  61. this.drawTimingFn();
  62. },
  63. beforeDestroy () {
  64. clearInterval(this.timing)
  65. },
  66. methods: {
  67. drawTimingFn () {
  68. this.setData();
  69. this.timing = setInterval(() => {
  70. this.setData(); //获取-数据
  71. }, 30000);
  72. },
  73. async setData () {
  74. // 首检任务数,完成数,合格数,巡检任务数,完成数,巡检合格数 name value
  75. /* await this.$http.get("kanban/datalist.action?caller=CheckData&_noc=1&page=1&pageSize=100",{
  76. params: {
  77. condition: "1=1",
  78. }
  79. }).then((result)=>{
  80. let dataList = JSON.parse(result.data.data);
  81. let titleitems = new Array();
  82. for (let index = 0; index < dataList.length; index++) {
  83. const element = dataList[index];
  84. titleitems.push({
  85. title: element.name,
  86. number: {
  87. number: [element.value],
  88. toFixed: 1,
  89. textAlign: 'left',
  90. content: '{nt}',
  91. style: {
  92. fontSize: 26
  93. }
  94. }
  95. });
  96. }
  97. this.titleItem = titleitems;
  98. },(result)=>{
  99. console.error(result)
  100. }
  101. );*/
  102. var caller = 'KeyStepRate!Total';
  103. //关键工序直通率
  104. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  105. params: {
  106. condition: "1=1",
  107. }
  108. }).then((result)=>{
  109. let dataList = JSON.parse(result.data.data);
  110. let resultList = new Array();
  111. for (let index = 0; index < dataList.length; index++) {
  112. const element = dataList[index];
  113. let item = new Array();
  114. item.push("<span class='colorGrass'>"+element.makecode+"</span>");
  115. item.push("<span class='colorGrass'>"+element.stepcode+"</span>");
  116. item.push("<span class='colorGrass'>"+element.value+"</span>");
  117. resultList.push(item);
  118. }
  119. const scrollBoard = this.$refs['scroll-board'];
  120. //刷新数据
  121. scrollBoard.updateRows(resultList);
  122. },(result)=>{
  123. console.error(result)
  124. }
  125. );
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. $box-height: 420px;
  132. $box-width: 100%;
  133. #center {
  134. display: flex;
  135. flex-direction: column;
  136. .up {
  137. width: 100%;
  138. display: flex;
  139. flex-wrap: wrap;
  140. justify-content: space-around;
  141. .item {
  142. border-radius: 6px;
  143. padding-top: 8px;
  144. margin-top: 8px;
  145. width: 100%;
  146. height: 70px;
  147. .dv-dig-flop {
  148. width: 170px;
  149. height: 30px;
  150. }
  151. }
  152. }
  153. .down {
  154. padding: 6px 4px;
  155. padding-bottom: 0;
  156. width: 100%;
  157. display: flex;
  158. height: $box-height;
  159. justify-content: space-between;
  160. .bg-color-black {
  161. border-radius: 5px;
  162. height: $box-height - 15px;
  163. }
  164. .ranking {
  165. padding: 10px;
  166. width: 100%;
  167. .dv-scr-rank-board {
  168. height: 370px;
  169. }
  170. }
  171. .percent {
  172. width: 40%;
  173. display: flex;
  174. flex-wrap: wrap;
  175. .item {
  176. width: 50%;
  177. height: 120px;
  178. span {
  179. margin-top: 8px;
  180. font-size: 14px;
  181. display: flex;
  182. justify-content: center;
  183. }
  184. }
  185. .water {
  186. width: 100%;
  187. .dv-wa-le-po {
  188. height: 120px;
  189. }
  190. }
  191. }
  192. }
  193. }
  194. </style>