center.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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 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. titleItem:[],
  56. ranking: {
  57. data: [],
  58. carousel: 'single',
  59. //unit: '人'
  60. },
  61. water: {
  62. data: [],//[24, 66],
  63. shape: 'roundRect',
  64. formatter: '{value}%',
  65. waveNum: 3,
  66. waveHeight:20
  67. },
  68. // 通过率和达标率的组件复用数据
  69. rate: [
  70. {
  71. id: 'centerRate1',
  72. tips: 60,
  73. colorData: {
  74. textStyle: '#3fc0fb',
  75. series: {
  76. color: ['#00bcd44a', 'transparent'],
  77. dataColor: {
  78. normal: '#03a9f4',
  79. shadowColor: '#97e2f5'
  80. }
  81. }
  82. }
  83. },
  84. {
  85. id: 'centerRate2',
  86. tips: 40,
  87. colorData: {
  88. textStyle: '#67e0e3',
  89. series: {
  90. color: ['#faf3a378', 'transparent'],
  91. dataColor: {
  92. normal: '#ff9800',
  93. shadowColor: '#fcebad'
  94. }
  95. }
  96. }
  97. }
  98. ]
  99. }
  100. },
  101. components: {
  102. // CenterChart
  103. },
  104. mounted () {
  105. this.drawTimingFn();
  106. },
  107. methods: {
  108. drawTimingFn () {
  109. this.setData();
  110. setInterval(() => {
  111. this.setData(); //获取-数据
  112. }, 30000);
  113. },
  114. async setData () {
  115. // 首检任务数,完成数,合格数,巡检任务数,完成数,巡检合格数 name value
  116. /* await this.$http.get("kanban/datalist.action?caller=CheckData&_noc=1&page=1&pageSize=100",{
  117. params: {
  118. condition: "1=1",
  119. }
  120. }).then((result)=>{
  121. let dataList = JSON.parse(result.data.data);
  122. let titleitems = new Array();
  123. for (let index = 0; index < dataList.length; index++) {
  124. const element = dataList[index];
  125. titleitems.push({
  126. title: element.name,
  127. number: {
  128. number: [element.value],
  129. toFixed: 1,
  130. textAlign: 'left',
  131. content: '{nt}',
  132. style: {
  133. fontSize: 26
  134. }
  135. }
  136. });
  137. }
  138. this.titleItem = titleitems;
  139. },(result)=>{
  140. console.error(result)
  141. }
  142. );*/
  143. var caller = 'DPL!KeyStepRate';
  144. if (sessionStorage.getItem('li_code') == '所有'){
  145. caller = 'DPL!KeyStepRate!ALL';
  146. }
  147. //关键工序直通率
  148. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  149. params: {
  150. condition: "1=1",
  151. }
  152. }).then((result)=>{
  153. let dataList = JSON.parse(result.data.data);
  154. let datas = new Array();
  155. for (let index = 0; index < dataList.length; index++) {
  156. const element = dataList[index];
  157. datas.push({
  158. name:element.name ,
  159. value:element.value,
  160. });
  161. }
  162. this.ranking.data = datas;
  163. this.ranking = { ...this.ranking };
  164. /*两种刷新方式
  165. const scrollBoard = this.$refs['scroll-ranking-board'];
  166. scrollBoard.updateRows(datas);
  167. this.ranking = { data: datas }
  168. */
  169. },(result)=>{
  170. console.error(result)
  171. }
  172. );
  173. //饼图pie,首检合格率,巡检合格率
  174. /* await this.$http.get("kanban/datalist.action?caller=PieCheckRate&_noc=1&page=1&pageSize=100&condition=1=1")
  175. .then((result)=>{
  176. let dataList = JSON.parse(result.data.data);
  177. this.rate[0].tips = dataList[0].firstcheckrate;
  178. this.rate[0].tips = dataList[0].xcheckrate;
  179. },(result)=>{
  180. console.error(result)
  181. }
  182. );*/
  183. //水波图,首检合格率,巡检合格率
  184. /* await this.$http.get("kanban/datalist.action?caller=WaterCheckRate&_noc=1&page=1&pageSize=100&condition=1=1")
  185. .then((result)=>{
  186. let dataList = JSON.parse(result.data.data);
  187. let waterdatas = new Array();
  188. waterdatas.push(dataList[0].firstcheckrate);
  189. waterdatas.push(dataList[0].xcheckrate);
  190. this.water = { data: waterdatas }
  191. },(result)=>{
  192. console.error(result)
  193. }
  194. );*/
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. $box-height: 420px;
  201. #center {
  202. display: flex;
  203. flex-direction: column;
  204. .up {
  205. width: 100%;
  206. display: flex;
  207. flex-wrap: wrap;
  208. justify-content: space-around;
  209. .item {
  210. border-radius: 6px;
  211. padding-top: 8px;
  212. margin-top: 8px;
  213. width: 32%;
  214. height: 70px;
  215. .dv-dig-flop {
  216. width: 150px;
  217. height: 30px;
  218. }
  219. }
  220. }
  221. .down {
  222. padding: 6px 4px;
  223. padding-bottom: 0;
  224. width: 100%;
  225. display: flex;
  226. height: $box-height;
  227. justify-content: space-between;
  228. .bg-color-black {
  229. border-radius: 5px;
  230. height: $box-height - 15px;
  231. }
  232. .ranking {
  233. padding: 10px;
  234. width: 100%;
  235. .dv-scr-rank-board {
  236. height: 370px;
  237. }
  238. }
  239. .percent {
  240. width: 40%;
  241. display: flex;
  242. flex-wrap: wrap;
  243. .item {
  244. width: 50%;
  245. height: 120px;
  246. span {
  247. margin-top: 8px;
  248. font-size: 14px;
  249. display: flex;
  250. justify-content: center;
  251. }
  252. }
  253. .water {
  254. width: 100%;
  255. .dv-wa-le-po {
  256. height: 120px;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. </style>