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.

299 lines
7.3 KiB

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
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
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <section>
  3. <el-row :gutter="5" >
  4. <el-col :span="18">
  5. <div>
  6. <div class="main" id="iterationQuestionDayTrend"
  7. :style="{width:'100%',height:(maxTableHeight>600?600:maxTableHeight)+'px',overflow: 'hidden'}"></div>
  8. <div class="progress"></div>
  9. </div>
  10. </el-col>
  11. <el-col :span="6" class="border">
  12. <el-form :model="filters" class="padding" :style="{width:'100%',maxHeight:maxTableHeight+'px',overflow: 'auto'}" ref="filtersRef">
  13. <el-form-item label="日期区间">
  14. <br>
  15. <mdp-date-range v-model="filters" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></mdp-date-range>
  16. </el-form-item>
  17. <el-form-item>
  18. <el-button type="primary" icon="el-icon-search" @click="listXmBranchStateHis">查询</el-button>
  19. </el-form-item>
  20. </el-form>
  21. </el-col>
  22. </el-row>
  23. </section>
  24. </template>
  25. <script>
  26. import util from '@/common/js/util';//全局公共库
  27. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  28. import { mapGetters } from 'vuex'
  29. import { listXmBranchStateHis } from '@/api/xm/core/xmBranchStateHis';
  30. import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//产品选择界面
  31. import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect';//迭代选择界面
  32. export default {
  33. components: {
  34. XmIterationSelect,XmProductSelect,
  35. },
  36. props:['xmProduct','xmProject','xmIteration'],
  37. computed: {
  38. ...mapGetters([
  39. 'userInfo','roles'
  40. ]),
  41. datesCpd(){
  42. if(this.xmProductStateHiss.length==0){
  43. return []
  44. }else{
  45. return this.xmProductStateHiss.map(i=>i.bizDate)
  46. }
  47. },
  48. closedBugsCpd(){
  49. if(this.xmProductStateHiss.length==0){
  50. return []
  51. }else{
  52. return this.xmProductStateHiss.map(i=>i.closedBugs)
  53. }
  54. },
  55. activeBugsCpd(){
  56. if(this.xmProductStateHiss.length==0){
  57. return []
  58. }else{
  59. return this.xmProductStateHiss.map(i=> i.activeBugs)
  60. }
  61. },
  62. confirmedBugsCpd(){
  63. if(this.xmProductStateHiss.length==0){
  64. return []
  65. }else{
  66. return this.xmProductStateHiss.map(i=> i.confirmedBugs)
  67. }
  68. },
  69. resolvedBugsCpd(){
  70. if(this.xmProductStateHiss.length==0){
  71. return []
  72. }else{
  73. return this.xmProductStateHiss.map(i=>i.resolvedBugs)
  74. }
  75. },
  76. title(){
  77. return '企业缺陷每日趋势图'
  78. },
  79. xmProductCpd(){
  80. if(this.xmIteration && this.xmIteration.id){
  81. return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
  82. }
  83. if(this.xmProduct && this.xmProduct.id){
  84. return this.xmProduct
  85. }
  86. return null;
  87. }
  88. },
  89. watch: {
  90. datesCpd(){
  91. this.$nextTick(()=>{
  92. this.drawCharts();
  93. })
  94. }
  95. },
  96. data() {
  97. return {
  98. filters:{
  99. category:'',
  100. product:null,
  101. project:null,
  102. testPlan:null,
  103. iteration:null,
  104. testCasedb:null,
  105. },
  106. dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  107. load:{ list: false, edit: false, del: false, add: false },//查询中...
  108. dateRanger:[],
  109. maxTableHeight:300,
  110. visible:false,
  111. xmProductStateHiss:[],
  112. }//end return
  113. },//end data
  114. methods: {
  115. listXmBranchStateHis(){
  116. var params={orderBy:'biz_date asc'}
  117. if(this.filters.startBizDate && this.filters.endBizDate){
  118. params.startBizDate=this.filters.startBizDate;
  119. params.endBizDate=this.filters.endBizDate;
  120. }
  121. listXmBranchStateHis(params).then(res=>{
  122. this.xmProductStateHiss=res.data.tips.isOk?res.data.data:this.xmProductStateHiss;
  123. })
  124. },
  125. open(){
  126. this.visible=true;
  127. this.filters.testPlan=this.xmTestPlan
  128. this.filters.product=this.xmProduct
  129. this.filters.project=this.xmProject
  130. this.filters.iteration=this.xmIteration
  131. this.filters.testCasedb=this.xmTestCasedb
  132. if(this.$refs['xmProductSelect'])this.$refs['xmProductSelect'].clearSelect();
  133. if(this.$refs['xmIterationSelect'])this.$refs['xmIterationSelect'].clearSelect();
  134. this.$nextTick(()=>{
  135. this.listXmBranchStateHis();
  136. })
  137. },
  138. drawCharts() {
  139. this.myChart = this.$echarts.init(document.getElementById("iterationQuestionDayTrend"));
  140. this.myChart.setOption(
  141. {
  142. title: {
  143. text: this.title,
  144. left: 'center'
  145. },
  146. tooltip: {
  147. trigger: 'axis',
  148. },
  149. barMaxWidth: 100,
  150. toolbox: {
  151. show: true,
  152. right:"20px",
  153. feature: {
  154. dataView: { show: true, readOnly: false },
  155. magicType: { show: true, type: ['line', 'bar'] },
  156. saveAsImage: { show: true }
  157. }
  158. },
  159. calculable: true,
  160. legend: {
  161. top:'5%',
  162. left: 'center',
  163. data: ['新提出','执行中','已解决','已关闭']
  164. },
  165. xAxis: {
  166. type: 'category',
  167. data: this.datesCpd
  168. },
  169. yAxis: {
  170. type: 'value'
  171. },
  172. series: [
  173. {
  174. name:'新提出',
  175. data: this.activeBugsCpd,
  176. type: 'line',
  177. smooth: true,
  178. itemStyle: {
  179. normal: {
  180. // 折点颜色样式
  181. color: 'orange',
  182. lineStyle: {
  183. // 折线颜色样式
  184. color: 'orange'
  185. }
  186. }
  187. },
  188. },
  189. {
  190. name:'执行中',
  191. data: this.confirmedBugsCpd,
  192. type: 'line',
  193. smooth: true,
  194. itemStyle: {
  195. normal: {
  196. // 折点颜色样式
  197. color: 'blue',
  198. lineStyle: {
  199. // 折线颜色样式
  200. color: 'blue'
  201. }
  202. }
  203. },
  204. },
  205. {
  206. name:'已解决',
  207. data: this.resolvedBugsCpd,
  208. type: 'line',
  209. smooth: true,
  210. itemStyle: {
  211. normal: {
  212. // 折点颜色样式
  213. color: 'green',
  214. lineStyle: {
  215. // 折线颜色样式
  216. color: 'green'
  217. }
  218. }
  219. },
  220. },
  221. {
  222. name:'已关闭',
  223. data: this.closedBugsCpd,
  224. type: 'line',
  225. smooth: true,
  226. itemStyle: {
  227. normal: {
  228. // 折点颜色样式
  229. color: 'red',
  230. lineStyle: {
  231. // 折线颜色样式
  232. color: 'red'
  233. }
  234. }
  235. },
  236. }
  237. ]
  238. }
  239. )
  240. },
  241. onProductSelected(product){
  242. this.filters.product=product
  243. this.xmProductStateHiss=[];
  244. },
  245. onProductClear(){
  246. this.filters.product=null
  247. this.xmProductStateHiss=[];
  248. },
  249. onIterationSelected(iteration){
  250. this.filters.iteration=iteration
  251. this.xmProductStateHiss=[];
  252. },
  253. onIterationClear(){
  254. this.filters.iteration=null
  255. this.xmProductStateHiss=[];
  256. }
  257. },//end method
  258. mounted() {
  259. /**
  260. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  261. this.dicts=res.data.data;
  262. })
  263. */
  264. //this.charts();
  265. this.open();
  266. }//end mounted
  267. }
  268. </script>
  269. <style scoped>
  270. .image {
  271. width: 100%;
  272. display: block;
  273. }
  274. </style>