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.

108 lines
3.8 KiB

4 years ago
  1. <template>
  2. <section class="padding">
  3. <el-row class="page-main ">
  4. <el-select v-model="filters.category" clearable>
  5. <el-option v-for="(item,index) in categorys" :label="item" :value="item" :key="index"></el-option>
  6. </el-select>
  7. </el-row>
  8. <el-row class="padding">
  9. <el-row :style="{overflowX:'hidden',height:maxTableHeight+'px'}" ref="table">
  10. <el-col v-cloak v-for="(p,i) in rptListCpd" :key="i" :xl="4" :lg="6" :md="8" :sm="12" :body-style="{ padding: '0px' }">
  11. <el-card @click.native="intoInfo(p,i)" class="project-card" shadow="always" id="prj-view-box">
  12. <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
  13. <div style="padding: 14px;">
  14. <span>{{p.rptName}}</span>
  15. </div>
  16. </el-card>
  17. </el-col>
  18. </el-row>
  19. </el-row>
  20. <xm-iteration-burnout ref="xmIterationBurnout"></xm-iteration-burnout>
  21. </section>
  22. </template>
  23. <script>
  24. import util from '@/common/js/util';//全局公共库
  25. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  26. import { mapGetters } from 'vuex'
  27. import xmIterationBurnout from './iteration/burnout'
  28. export default {
  29. components: {
  30. xmIterationBurnout
  31. },
  32. props:['xmProduct','xmIteration','xmProject'],
  33. computed: {
  34. ...mapGetters([
  35. 'userInfo','roles'
  36. ]),
  37. rptListCpd(){
  38. if(!this.filters.category){
  39. return this.rptList;
  40. }else{
  41. return this.rptList.filter(i=>i.category==this.filters.category)
  42. }
  43. },
  44. categorys:function(){
  45. var map={};
  46. var list=[];
  47. this.rptList.forEach(e => {
  48. if(!map[e.category]){
  49. list.push(e.category);
  50. map[e.category]=e.category
  51. }
  52. });
  53. return list;
  54. },
  55. },
  56. watch: {
  57. },
  58. data() {
  59. return {
  60. filters:{
  61. category:'',
  62. },
  63. dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  64. load:{ list: false, edit: false, del: false, add: false },//查询中...
  65. dateRanger:[],
  66. maxTableHeight:300,
  67. rptList:[/**{name:'报表名称',category:'报表分类,组织级、产品级、项目级、迭代级、需求、测试、任务',path:'路由路径',imgUrl:'图片路径',query:{参数}} */
  68. {rptName:'迭代燃尽图',category:'迭代级',ref:'xmIterationBurnout' }
  69. ],
  70. }//end return
  71. },//end data
  72. methods: {
  73. intoInfo(row) {
  74. var params={...row}
  75. params.xmProduct=this.xmProduct
  76. params.xmProject=this.xmProject
  77. params.xmIteration=this.xmIteration
  78. this.$refs[row.ref].open(params);
  79. },
  80. },//end method
  81. mounted() {
  82. /**
  83. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  84. this.dicts=res.data.data;
  85. })
  86. */
  87. this.maxTableHeight = this.source == 'GZT' ? this.maxTableHeight : util.calcTableMaxHeight(this.$refs.table.$el);
  88. }//end mounted
  89. }
  90. </script>
  91. <style scoped>
  92. .image {
  93. width: 100%;
  94. display: block;
  95. }
  96. </style>