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.

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