statisticsSection.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="drawer-statistics" :class="{'drawer-padding': show}">
  3. <transition name="fade-drawer">
  4. <div v-show="show" class="statistics">
  5. <div class="statistics-data">
  6. <h2>{{ title }}统计</h2>
  7. <div class="data-main">
  8. <div class="data-item">
  9. <label>交付已延期</label>
  10. <div class="number">1</div>
  11. </div>
  12. <div class="data-item" />
  13. <div class="data-item" />
  14. <div class="data-item" />
  15. <div class="data-item" />
  16. <div class="data-item" />
  17. </div>
  18. </div>
  19. <div v-if="title !=='缺陷'" class="statistics-chart">
  20. <h2>未上线{{ title }}状态分布</h2>
  21. <div class="chart-contain">
  22. <normal-echart v-if="echartsOption" :chart-id="type+title" :option="echartsOption" />
  23. </div>
  24. </div>
  25. <div v-if="title ==='缺陷'" class="statistics-chart">
  26. <div class="two-title">
  27. <h2>我提报的-未完成缺陷状态分布</h2>
  28. <h2>提给我的-未完成缺陷状态分布</h2>
  29. </div>
  30. <div class="two-chart-contain">
  31. <div class="chart-contain">
  32. <normal-echart v-if="echartsOption" :chart-id="type+title+'1'" :option="echartsOption" />
  33. </div>
  34. <div class="chart-contain">
  35. <normal-echart v-if="echartsOption" :chart-id="type+title+'2'" :option="echartsOption2" />
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </transition>
  41. <div v-show="show" class="drawer" @click="show = !show">
  42. <i class="el-icon-arrow-up" />
  43. </div>
  44. <div v-show="!show" class="drawer drawer-pull" @click="show = !show">
  45. <i class="el-icon-arrow-down" />
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import normalEchart from '@/components/chart/normalEchart'
  51. export default {
  52. name: 'StatisticsSectionVue',
  53. components: { normalEchart },
  54. props: {
  55. searchForm: { // 搜索项的信息
  56. type: Object,
  57. default: () => {
  58. return {
  59. teamId: null,
  60. bizId: null
  61. }
  62. },
  63. required: true
  64. },
  65. type: { // 个人还是团队
  66. type: String,
  67. default: 'person',
  68. required: false
  69. },
  70. title: {
  71. type: String,
  72. default: '需求',
  73. required: false
  74. },
  75. requestObj: { // 请求的接口
  76. type: Object,
  77. default: () => null,
  78. required: false
  79. }
  80. },
  81. data() {
  82. return {
  83. show: true,
  84. echartsOption: null,
  85. echartsOption2: null,
  86. tips: {
  87. '需求': [
  88. '交付日期为今天,且状态仍未变更为“已上线”的需求数量。',
  89. '已过交付日期,状态仍未变更为“已上线”的需求数量。',
  90. '交付日期在本周内的需求数量。',
  91. '交付日期在本周,且状态仍未变更为“已上线”的需求数量。',
  92. '交付日期在下周的需求数量。'
  93. ],
  94. '任务': [
  95. '交付日期为今天,且状态仍未变更为“已上线”的任务数量。',
  96. '已过交付日期,状态仍未变更为“已上线”的任务数量。',
  97. '交付日期在本周内的任务数量。',
  98. '交付日期在本周,且状态仍未变更为“已上线”的任务数量。',
  99. '交付日期在下周任务数量。'
  100. ]
  101. }
  102. }
  103. },
  104. watch: {
  105. searchForm: {
  106. handler(newV) {
  107. },
  108. deep: true
  109. }
  110. },
  111. methods: {
  112. initData() {
  113. if (this.requestObj) {
  114. const { requestData, requestChart } = this.requestObj
  115. this.getData(requestData)
  116. this.getChart(requestChart)
  117. }
  118. },
  119. async getData(requestUrl) {
  120. const res = await requestUrl()
  121. },
  122. async getChart(requestUrl) {
  123. const res = await requestUrl()
  124. },
  125. changeData() {
  126. this.$emit('change', this.title)
  127. }
  128. }
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .drawer-statistics {
  133. position: relative;
  134. width: 100%;
  135. padding-bottom: 1px;
  136. }
  137. .drawer-padding {
  138. padding-bottom: 14px;
  139. }
  140. //.fade-drawer-enter-active {
  141. // transition: all 1.5s ease
  142. //}
  143. //.fade-drawer-leave-active {s
  144. // transition: all 1.5s ease
  145. //}
  146. //.fade-drawer-enter, .fade-drawer-leave-to {
  147. // transition: all 1.5s ease;
  148. //}
  149. .statistics {
  150. position: relative;
  151. width: 100%;
  152. height: 474px;
  153. padding: 27px 35px;
  154. display: grid;
  155. grid-template-columns: repeat(2,50%);
  156. h2 {
  157. color: #333333;
  158. font-size: 16px;
  159. margin-bottom: 20px;
  160. font-weight: bold;
  161. }
  162. }
  163. .statistics-data {
  164. .data-main{
  165. width: 80%;
  166. display: grid;
  167. grid-template-columns: repeat(2,188px);
  168. grid-column-gap: 30px;
  169. grid-template-rows: repeat(3,111px);
  170. grid-row-gap: 20px;
  171. }
  172. .data-item {
  173. box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
  174. border-radius: 5px;
  175. display: grid;
  176. grid-template-rows: repeat(2,50%);
  177. align-items: center;
  178. padding: 5px 11px;
  179. label {
  180. font-weight: 400;
  181. color: #666666;
  182. }
  183. .number {
  184. font-weight: 500;
  185. color: #333333;
  186. font-size: 26px;
  187. }
  188. }
  189. }
  190. .statistics-chart {
  191. .two-title {
  192. width: 100%;
  193. display: grid;
  194. grid-template-columns: repeat(2,50%);
  195. }
  196. .two-chart-contain {
  197. width: 100%;
  198. height: 100%;
  199. display: grid;
  200. grid-template-columns: repeat(2,50%);
  201. }
  202. .chart-contain {
  203. width: 100%;
  204. height: 350px;
  205. }
  206. }
  207. .drawer-statistics:after {
  208. content: '';
  209. width: 100%;
  210. height: 14px;
  211. background-color: #F2F3F6;
  212. position: absolute;
  213. left: 0;
  214. bottom: 0;
  215. }
  216. .drawer {
  217. width: 26px;
  218. height: 13px;
  219. left: 50%;
  220. position: absolute;
  221. bottom: 1px;
  222. transform: translateX(-50%);
  223. z-index: 98;
  224. display: flex;
  225. justify-content: center;
  226. align-items: center;
  227. color: #666666;
  228. font-weight: bold;
  229. background-color: #ffffff;
  230. border-bottom: 1px solid #999999;
  231. border-left: 1px solid #999999;
  232. border-right: 1px solid #999999;
  233. border-bottom-left-radius: 2px;
  234. border-bottom-right-radius: 2px;
  235. }
  236. .drawer-pull {
  237. top: 1px;
  238. }
  239. </style>