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.

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