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.

328 lines
8.2 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
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="showParams?23:24"> <div>
  5. <div class="echart-box" id="iterationMenuDayAccumulate" ></div>
  6. </div>
  7. </el-col>
  8. <el-col :span="showParams?1:0" v-if="showParams">
  9. <el-popover trigger="manual" v-model="filterVisible" style="float:right;" width="500">
  10. <el-button slot="reference" style="margin-top:10px;margin-right:10px;z-index: 99999;" icon="el-icon-more" @click="filterVisible=!filterVisible"></el-button>
  11. <el-row>
  12. <el-button type="danger" icon="el-icon-delete" @click="$emit('delete',cfg)">从报告移出该报表</el-button>
  13. <el-button icon="el-icon-close" style="float:right;" @click="filterVisible=false">关闭</el-button>
  14. </el-row>
  15. <el-row>
  16. <el-form :model="params" class="padding" :style="{width:'100%',overflow: 'auto'}" ref="filtersRef">
  17. <el-form-item label="日期区间">
  18. <br>
  19. <mdp-date-range v-model="params" value-format="yyyy-MM-dd" start-key="startBizDate" end-key="endBizDate"></mdp-date-range>
  20. </el-form-item>
  21. <el-form-item>
  22. <el-button type="primary" style="float:right;" icon="el-icon-search" @click="listXmBranchStateHis">查询</el-button>
  23. </el-form-item>
  24. </el-form>
  25. </el-row>
  26. </el-popover>
  27. </el-col>
  28. </el-row>
  29. </section>
  30. </template>
  31. <script>
  32. import util from '@/common/js/util';//全局公共库
  33. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  34. import { mapGetters } from 'vuex'
  35. import { listXmBranchStateHis } from '@/api/xm/core/xmBranchStateHis';
  36. import XmProductSelect from '@/views/xm/core/components/XmProductSelect';//产品选择界面
  37. import XmIterationSelect from '@/views/xm/core/components/XmIterationSelect';//迭代选择界面
  38. export default {
  39. components: {
  40. XmIterationSelect,XmProductSelect,
  41. },
  42. props:['id','cfg','category','showToolBar','showParams','isRptCfg','rptDatas','xmProduct','xmProject','xmIteration'],
  43. computed: {
  44. ...mapGetters([
  45. 'userInfo','roles'
  46. ]),
  47. datesCpd(){
  48. if(this.rawDatas.length==0){
  49. return []
  50. }else{
  51. return this.rawDatas.map(i=>i.bizDate)
  52. }
  53. },
  54. menuCloseCntCpd(){
  55. if(this.rawDatas.length==0){
  56. return []
  57. }else{
  58. return this.rawDatas.map(i=>i.menuCloseCnt)
  59. }
  60. },
  61. menuUnstartCntCpd(){
  62. if(this.rawDatas.length==0){
  63. return []
  64. }else{
  65. return this.rawDatas.map(i=> i.menuUnstartCnt)
  66. }
  67. },
  68. menuExecCntCpd(){
  69. if(this.rawDatas.length==0){
  70. return []
  71. }else{
  72. return this.rawDatas.map(i=> i.menuExecCnt)
  73. }
  74. },
  75. menuFinishCntCpd(){
  76. if(this.rawDatas.length==0){
  77. return []
  78. }else{
  79. return this.rawDatas.map(i=>i.menuFinishCnt)
  80. }
  81. },
  82. titleCpd(){
  83. return '企业需求每日累积图'
  84. },
  85. xmProductCpd(){
  86. if(this.xmIteration && this.xmIteration.id){
  87. return {id:this.xmIteration.productId,productName:this.xmIteration.productName}
  88. }
  89. if(this.xmProduct && this.xmProduct.id){
  90. return this.xmProduct
  91. }
  92. return null;
  93. }
  94. },
  95. watch: {
  96. datesCpd(){
  97. this.$nextTick(()=>{
  98. this.drawCharts();
  99. })
  100. }
  101. },
  102. data() {
  103. return {
  104. filterVisible:false,
  105. filters:{
  106. category:'',
  107. product:null,
  108. project:null,
  109. testPlan:null,
  110. iteration:null,
  111. testCasedb:null,
  112. },
  113. params:{
  114. },
  115. title:'',//报表配置项
  116. remark:'', //报表配置项
  117. dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  118. load:{ list: false, edit: false, del: false, add: false },//查询中...
  119. dateRanger:[],
  120. maxTableHeight:300,
  121. visible:false,
  122. rawDatas:[],
  123. }//end return
  124. },//end data
  125. methods: {
  126. listXmBranchStateHis(){
  127. var params={...this.params,orderBy:'biz_date asc'}
  128. listXmBranchStateHis(params).then(res=>{
  129. this.rawDatas=res.data.tips.isOk?res.data.data:this.rawDatas;
  130. })
  131. },
  132. open(){
  133. this.visible=true;
  134. this.filters.testPlan=this.xmTestPlan
  135. this.filters.product=this.xmProduct
  136. this.filters.project=this.xmProject
  137. this.filters.iteration=this.xmIteration
  138. this.filters.testCasedb=this.xmTestCasedb
  139. if( this.filters.testPlan && this.filters.testPlan.id){
  140. this.params.planId= this.filters.testPlan.id
  141. }
  142. if( this.filters.product && this.filters.product.id){
  143. this.params.productId= this.filters.product.id
  144. }
  145. if( this.filters.project && this.filters.project.id){
  146. this.params.projectId= this.filters.project.id
  147. }
  148. if( this.filters.iteration && this.filters.iteration.id){
  149. this.params.iterationId= this.filters.iteration.id
  150. }
  151. if( this.filters.testCasedb && this.filters.testCasedb.id){
  152. this.params.casedbId= this.filters.testCasedb.id
  153. }
  154. if(this.cfg && this.cfg.id){
  155. this.params=this.cfg.params
  156. this.title=this.cfg.title
  157. this.remark=this.cfg.remark
  158. }
  159. if(this.showToolBar && !this.title){
  160. this.title="企业工作项每日趋势图"
  161. }
  162. if(this.$refs['xmProductSelect'])this.$refs['xmProductSelect'].clearSelect();
  163. if(this.$refs['xmIterationSelect'])this.$refs['xmIterationSelect'].clearSelect();
  164. this.$nextTick(()=>{
  165. this.listXmBranchStateHis();
  166. })
  167. },
  168. drawCharts() {
  169. this.myChart = this.$echarts.init(document.getElementById(this.id));
  170. this.myChart.setOption(
  171. {
  172. title: {
  173. text: this.titleCpd,
  174. left: 'center'
  175. },
  176. tooltip: {
  177. trigger: 'axis',
  178. axisPointer: {
  179. type: 'cross',
  180. label: {
  181. backgroundColor: '#6a7985'
  182. }
  183. }
  184. },
  185. legend: {
  186. bottom: 'bottom',
  187. data: ['未开始', '执行中', '已完成', '已关闭']
  188. },
  189. grid: {
  190. containLabel: true
  191. },
  192. toolbox: {
  193. show: true,
  194. top:"5%",
  195. right:"10px",
  196. feature: {
  197. dataView: { show: true, readOnly: false },
  198. magicType: { show: true, type: ['line', 'bar'] },
  199. saveAsImage: { show: true }
  200. }
  201. },
  202. xAxis: {
  203. type: 'category',
  204. boundaryGap: false,
  205. data: this.datesCpd,
  206. },
  207. yAxis: {
  208. type: 'value'
  209. },
  210. series: [
  211. {
  212. name: '未开始',
  213. type: 'line',
  214. stack: 'Total',
  215. areaStyle: {},
  216. emphasis: {
  217. focus: 'series'
  218. },
  219. data: this.menuUnstartCntCpd
  220. },
  221. {
  222. name: '执行中',
  223. type: 'line',
  224. stack: 'Total',
  225. areaStyle: {},
  226. emphasis: {
  227. focus: 'series'
  228. },
  229. data: this.menuExecCntCpd,
  230. },
  231. {
  232. name: '已完成',
  233. type: 'line',
  234. stack: 'Total',
  235. areaStyle: {},
  236. emphasis: {
  237. focus: 'series'
  238. },
  239. data: this.menuFinishCntCpd,
  240. },
  241. {
  242. name: '已关闭',
  243. type: 'line',
  244. stack: 'Total',
  245. areaStyle: {},
  246. emphasis: {
  247. focus: 'series'
  248. },
  249. label: {
  250. show: true,
  251. position: 'top'
  252. },
  253. data: this.menuCloseCntCpd,
  254. }
  255. ]
  256. }
  257. )
  258. },
  259. onProductSelected(product){
  260. this.filters.product=product
  261. },
  262. onProductClear(){
  263. this.filters.product=null
  264. },
  265. onIterationSelected(iteration){
  266. this.filters.iteration=iteration
  267. },
  268. onIterationClear(){
  269. this.filters.iteration=null
  270. }
  271. },//end method
  272. mounted() {
  273. /**
  274. initSimpleDicts('all',['demandSource','demandLvl','demandType','priority','menuStatus'] ).then(res=>{
  275. this.dicts=res.data.data;
  276. })
  277. */
  278. //this.maxTableHeight = util.calcTableMaxHeight(this.$refs.filtersRef.$el)
  279. //this.charts();
  280. this.open();
  281. }//end mounted
  282. }
  283. </script>
  284. <style scoped>
  285. .image {
  286. width: 100%;
  287. display: block;
  288. }
  289. </style>