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.6 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
  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">
  5. <el-col :span="18">
  6. <div>
  7. <div class="main" id="menuDayTrend"
  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 padding">
  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. menuCloseCntCpd(){
  63. if(this.xmProductStateHiss.length==0){
  64. return []
  65. }else{
  66. return this.xmProductStateHiss.map(i=>i.menuCloseCnt)
  67. }
  68. },
  69. menuUnstartCntCpd(){
  70. if(this.xmProductStateHiss.length==0){
  71. return []
  72. }else{
  73. return this.xmProductStateHiss.map(i=> i.menuUnstartCnt)
  74. }
  75. },
  76. menuExecCntCpd(){
  77. if(this.xmProductStateHiss.length==0){
  78. return []
  79. }else{
  80. return this.xmProductStateHiss.map(i=> i.menuExecCnt)
  81. }
  82. },
  83. menuFinishCntCpd(){
  84. if(this.xmProductStateHiss.length==0){
  85. return []
  86. }else{
  87. return this.xmProductStateHiss.map(i=>i.menuFinishCnt)
  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.listXmIterationStateHis();
  157. },
  158. drawCharts() {
  159. this.myChart = this.$echarts.init(document.getElementById("menuDayTrend"));
  160. this.myChart.setOption(
  161. {
  162. legend: {
  163. right: 40,
  164. data: ['未开始故事数','执行中故事数','已完成故事数','已关闭故事数']
  165. },
  166. xAxis: {
  167. type: 'category',
  168. data: this.datesCpd
  169. },
  170. yAxis: {
  171. type: 'value'
  172. },
  173. series: [
  174. {
  175. name:'未开始故事数',
  176. data: this.menuUnstartCntCpd,
  177. type: 'line',
  178. smooth: true,
  179. itemStyle: {
  180. normal: {
  181. // 折点颜色样式
  182. color: 'orange',
  183. lineStyle: {
  184. // 折线颜色样式
  185. color: 'orange'
  186. }
  187. }
  188. },
  189. },
  190. {
  191. name:'执行中故事数',
  192. data: this.menuExecCntCpd,
  193. type: 'line',
  194. smooth: true,
  195. itemStyle: {
  196. normal: {
  197. // 折点颜色样式
  198. color: 'blue',
  199. lineStyle: {
  200. // 折线颜色样式
  201. color: 'blue'
  202. }
  203. }
  204. },
  205. },
  206. {
  207. name:'已完成故事数',
  208. data: this.menuFinishCntCpd,
  209. type: 'line',
  210. smooth: true,
  211. itemStyle: {
  212. normal: {
  213. // 折点颜色样式
  214. color: 'green',
  215. lineStyle: {
  216. // 折线颜色样式
  217. color: 'green'
  218. }
  219. }
  220. },
  221. },
  222. {
  223. name:'已关闭故事数',
  224. data: this.menuCloseCntCpd,
  225. type: 'line',
  226. smooth: true,
  227. itemStyle: {
  228. normal: {
  229. // 折点颜色样式
  230. color: 'red',
  231. lineStyle: {
  232. // 折线颜色样式
  233. color: 'red'
  234. }
  235. }
  236. },
  237. }
  238. ]
  239. }
  240. )
  241. },
  242. onProductSelected(product){
  243. this.filters.product=product
  244. this.xmProductStateHiss=[];
  245. },
  246. onProductClear(){
  247. this.filters.product=null
  248. this.xmProductStateHiss=[];
  249. },
  250. onIterationSelected(iteration){
  251. this.filters.iteration=iteration
  252. this.xmProductStateHiss=[];
  253. },
  254. onIterationClear(){
  255. this.filters.iteration=null
  256. this.xmProductStateHiss=[];
  257. }
  258. },//end method
  259. mounted() {
  260. /**
  261. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  262. this.dicts=res.data.data;
  263. })
  264. */
  265. //this.charts();
  266. //this.drawCharts();
  267. }//end mounted
  268. }
  269. </script>
  270. <style scoped>
  271. .image {
  272. width: 100%;
  273. display: block;
  274. }
  275. </style>