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.

1148 lines
30 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <section class="page-container">
  3. <div class="page-main">
  4. <div class="row_1">
  5. <div class="r r1">
  6. <span style="color: #4779F6">{{xmBranchState.projectCnt || 0}}</span>
  7. <p>项目数</p>
  8. </div>
  9. <div class="r r2">
  10. <span style="color: #4779F6">{{xmBranchState.budgetWorkload || 0}}</span>
  11. <p>项目总工时</p>
  12. </div>
  13. <div class="r r3">
  14. <span style="color: #F6AE47">{{xmBranchState.productCnt || 0}}</span>
  15. <p>产品数</p>
  16. </div>
  17. <div class="r r4">
  18. <span style="color: #F6AE47">{{xmBranchState.productBudgetWorkload || 0}}</span>
  19. <p>产品总工时</p>
  20. </div>
  21. <div class="r r5">
  22. <span style="color: #47CBF6">{{xmBranchState.phaseCnt || 0}}</span>
  23. <p>计划数</p>
  24. </div>
  25. <div class="r r6">
  26. <span style="color: #47CBF6">{{xmBranchState.iterationCnt || 0}}</span>
  27. <p>迭代数</p>
  28. </div>
  29. <div class="r r7">
  30. <span style="color: #F68D47">{{xmBranchState.totalStaffCnt || 0}}</span>
  31. <p>总人数</p>
  32. </div>
  33. <div class="r r8">
  34. <span style="color: #7D7D7D">{{xmBranchState.taskCnt || 0}}</span>
  35. <p>任务数</p>
  36. </div>
  37. <div class="r r9">
  38. <span style="color: #7D7D7D">{{xmBranchState.menuCnt || 0}}</span>
  39. <p>需求数</p>
  40. </div>
  41. </div>
  42. <div class="row_2">
  43. <div class="r1">
  44. <p class="r_text">项目进度</p>
  45. <div class="message">
  46. <div>
  47. <span>{{this.xmBranchState.estimateWorkload || 0}}h</span>
  48. <p>预估工时</p>
  49. </div>
  50. <div>
  51. <span>{{this.xmBranchState.actWorkload || 0}}h</span>
  52. <p>登记工时</p>
  53. </div>
  54. <div>
  55. <span>{{workloadProgress || 0}}%</span>
  56. <p>工时进度</p>
  57. </div>
  58. <div>
  59. <span>{{remainWorkload || 0}}h</span>
  60. <p>剩余工时</p>
  61. </div>
  62. <div>
  63. <span>{{deviation || 0}}h</span>
  64. <p>预估偏差</p>
  65. </div>
  66. <div>
  67. <span>{{deviationRate || 0}}%</span>
  68. <p>预估偏差率</p>
  69. </div>
  70. </div>
  71. <div style="padding: 0 40px">
  72. <el-divider></el-divider>
  73. </div>
  74. <div class="chart">
  75. <div class="desc">
  76. <span>项目预计进度</span>
  77. <span>项目实际进度</span>
  78. </div>
  79. <div class="process">
  80. <el-progress class="pc" :stroke-width="14" :percentage="planProgress"></el-progress>
  81. <el-progress class="pc" :stroke-width="14" color="#47CBF6" :percentage="realProgress"></el-progress>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="r2">
  86. <p class="r_text">工作量分布</p>
  87. <div class="chart">
  88. <div id="workloadDistribution" :style="{width: '100%', height: '250px'}"></div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="row_3">
  93. <div class="r1">
  94. <p class="r_text">任务每日状态趋势</p>
  95. <div class="chart">
  96. <div id="taskChart" :style="{width: '100%', height: '320px'}"></div>
  97. </div>
  98. </div>
  99. <div class="r2">
  100. <p class="r_text">工作项数量分布</p>
  101. <div class="chart">
  102. <div id="allChart" :style="{width: '100%', height: '320px'}"></div>
  103. </div>
  104. </div>
  105. </div>
  106. <div class="row_4">
  107. <div class="r4_1">
  108. <p class="r_text">总预算情况</p>
  109. <div class="chart">
  110. <div id="planTotalCostPie" :style="{width: '100%', height: '410px'}"></div>
  111. </div>
  112. </div>
  113. <div class="r4_2">
  114. <p class="r_text">总缺陷情况</p>
  115. <div class="chart">
  116. <div id="bugPieChart" :style="{width: '100%', height: '410px'}"></div>
  117. </div>
  118. </div>
  119. <div class="r4_3">
  120. <p class="r_text">所含产品和迭代情况</p>
  121. <div class="chart">
  122. <div id="iterationAndProduct" :style="{width: '100%', height: '320px'}"></div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </section>
  128. </template>
  129. <script>
  130. import util from "@/common/js/util"; // 全局公共库
  131. import { mapGetters } from "vuex";
  132. import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询
  133. import { listXmBranchState,loadProjectStateToXmBranchState } from '@/api/xm/core/xmBranchState';
  134. import Guider from '@/components/Guider/Index.js';
  135. export default {
  136. computed: {
  137. ...mapGetters(["userInfo"]),
  138. finish: function (){
  139. return this.xmBranchState.taskFinishCnt;
  140. },
  141. notStart: function() {
  142. return this.xmBranchState.taskCnt-this.xmBranchState.taskFinishCnt;
  143. },
  144. totalTask: function() {
  145. return this.xmBranchState.taskCnt;
  146. },
  147. taskProgress: function (){
  148. return this.xmBranchState.finishRate;
  149. },
  150. taskStartTime: function (){
  151. return this.xmBranchState.startTime.substring(0,10);
  152. },
  153. taskEndTime: function (){
  154. return this.xmBranchState.endTime.substring(0,10);
  155. },
  156. taskMng: function (){
  157. return this.xmBranchState.createUsername;
  158. },
  159. workloadProgress:function (){
  160. if(!this.xmBranchState.budgetWorkload){
  161. return 0;
  162. }
  163. if(this.xmBranchState.actWorkload < this.xmBranchState.budgetWorkload){
  164. return Math.round(this.xmBranchState.actWorkload/this.xmBranchState.budgetWorkload*100)
  165. }else{
  166. return 100;
  167. }
  168. },
  169. deviation:function (){
  170. return Math.round(this.xmBranchState.actWorkload-this.xmBranchState.estimateWorkload);
  171. },
  172. deviationRate:function (){
  173. return Math.round((this.xmBranchState.actWorkload-this.xmBranchState.estimateWorkload)/this.xmBranchState.estimateWorkload*100);
  174. },
  175. remainWorkload:function (){
  176. return this.xmBranchState.budgetWorkload - this.xmBranchState.actWorkload;
  177. },
  178. planProgress:function (){
  179. if(!this.xmBranchState.budgetWorkload){
  180. return 0;
  181. }
  182. return Math.round( this.xmBranchState.estimateWorkload/this.xmBranchState.budgetWorkload*100)
  183. },
  184. realProgress:function (){
  185. if(!this.xmBranchState.budgetWorkload){
  186. return 0;
  187. }
  188. if(this.xmBranchState.actWorkload < this.xmBranchState.budgetWorkload){
  189. return Math.round(this.xmBranchState.actWorkload/this.xmBranchState.budgetWorkload*100)
  190. }else{
  191. return 100;
  192. }
  193. },
  194. xmBranchStateCpd(){
  195. return this.xmBranchState
  196. },
  197. },
  198. watch:{
  199. xmBranchStateCpd:function(){
  200. this.drawWorkload();
  201. this.drawTaskByDate();
  202. this.drawAllBar();
  203. this.drawCostPie();
  204. this.drawPieBug();
  205. this.drawIterationProduct();
  206. }
  207. },
  208. data() {
  209. return {
  210. isActive: true,
  211. xmBranchState:{},
  212. maxTableHeight:300,
  213. // options: getDefOptions(),//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  214. };
  215. },
  216. methods:{
  217. drawAllBar() {
  218. // 基于准备好的dom,初始化echarts实例
  219. let allChart = this.$echarts.init(document.getElementById("allChart"));
  220. let option = {
  221. color:['#A3BCFA', '#A3BCFA', '#A3BCFA'],
  222. grid: {
  223. left: '3%',
  224. right: '4%',
  225. bottom: '3%',
  226. containLabel: true
  227. },
  228. yAxis: {
  229. type: 'value',
  230. axisLine: {
  231. show: false
  232. },
  233. axisTick: {
  234. show: false
  235. },
  236. splitLine: {
  237. lineStyle: {
  238. color: 'rgba(0, 0, 0, .05)'
  239. }
  240. }
  241. },
  242. xAxis: {
  243. type: 'category',
  244. boundaryGap: false,
  245. data: ['需求', '任务', '缺陷'],
  246. splitLine: {
  247. show: true,
  248. lineStyle: {
  249. color: 'rgba(0, 0, 0, .05)'
  250. }
  251. },
  252. axisLine: {
  253. lineStyle: {
  254. color: 'rgba(0, 0, 0, .1)'
  255. }
  256. },
  257. axisTick: {
  258. lineStyle: {
  259. color: 'rgba(0, 0, 0, .1)'
  260. }
  261. },
  262. axisLabel: {
  263. color: '#555'
  264. }
  265. },
  266. series: [
  267. {
  268. name: '需求',
  269. type: 'line',
  270. stack: 'Total',
  271. areaStyle: {},
  272. emphasis: {
  273. focus: 'series'
  274. },
  275. data: [this.xmBranchState.menuCnt],
  276. markPoint: {
  277. data: [{
  278. type: 'min',
  279. name: 'min'
  280. }],
  281. }
  282. },
  283. {
  284. name: '任务',
  285. type: 'line',
  286. stack: 'Total',
  287. areaStyle: {},
  288. emphasis: {
  289. focus: 'series'
  290. },
  291. data: [0, this.xmBranchState.taskCnt],
  292. markPoint: {
  293. data: [{
  294. type: 'max',
  295. name: 'max'
  296. }],
  297. },
  298. },
  299. {
  300. name: '缺陷',
  301. type: 'line',
  302. stack: 'Total',
  303. areaStyle: {},
  304. emphasis: {
  305. focus: 'series'
  306. },
  307. data: [0, 0, this.xmBranchState.bugCnt],
  308. markPoint: {
  309. data: [{
  310. name: '',
  311. yAxis: this.xmBranchState.bugCnt, // y轴就是数据轴,那么标记数据的y轴坐标就是当前显示的数据,this.trenddata[1]是显示的所有数据,他是个数组,通过数组下标的形式获取最后一个数据即可
  312. x: '95.55%'// 标记数据的x轴的位置,由于是最后一个点,所以这个位置是固定的,用百分比表示该图标内最后一个点的位置即可
  313. }],
  314. },
  315. }
  316. ]
  317. };
  318. // 绘制图表
  319. allChart.setOption(option);
  320. },
  321. drawTaskByDate() {
  322. let taskChart = this.$echarts.init(document.getElementById("taskChart"));
  323. let option = {
  324. tooltip: {
  325. trigger: 'axis'
  326. },
  327. color:['#76AEF7', '#A8E5FA'],
  328. legend: {
  329. data: ['未开始', '进行中']
  330. },
  331. grid: {
  332. left: '1%',
  333. right: '3%',
  334. bottom: '5%',
  335. containLabel: true
  336. },
  337. xAxis: {
  338. type: 'category',
  339. boundaryGap: false,
  340. data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
  341. splitLine: {
  342. show: true,
  343. lineStyle: {
  344. color: 'rgba(0, 0, 0, .05)'
  345. }
  346. },
  347. axisLine: {
  348. lineStyle: {
  349. color: 'rgba(0, 0, 0, .1)'
  350. }
  351. },
  352. axisTick: {
  353. lineStyle: {
  354. color: 'rgba(0, 0, 0, .1)'
  355. }
  356. },
  357. axisLabel: {
  358. color: '#555'
  359. }
  360. },
  361. yAxis: {
  362. type: 'value',
  363. boundaryGap: false,
  364. axisLine: {
  365. show: false
  366. },
  367. axisTick: {
  368. show: false
  369. },
  370. splitLine: {
  371. lineStyle: {
  372. color: 'rgba(0, 0, 0, .05)'
  373. }
  374. }
  375. },
  376. series: [
  377. {
  378. name: '未开始',
  379. type: 'line',
  380. smooth: true,
  381. data: [120, 132, 101, 134, 90, 230, 210],
  382. areaStyle: {},
  383. label: {
  384. show: true,
  385. position: 'right',
  386. color: '#888',
  387. formatter: ({
  388. data
  389. }) => data == 0 ? '' : `${data}`
  390. },
  391. markPoint: {
  392. data: [
  393. {
  394. type: 'min',
  395. name: 'min'
  396. },
  397. {
  398. type: 'max',
  399. name: 'max'
  400. }
  401. ],
  402. },
  403. areaStyle: {
  404. normal: {
  405. color: {
  406. type: "linear",
  407. x: 0,
  408. y: 0,
  409. x2: 0,
  410. y2: 1,
  411. colorStops: [
  412. {
  413. offset: 0,
  414. color: "rgba(118,174,247,.4)"
  415. },
  416. {
  417. offset: 1,
  418. color: "rgba(118,174,247,0)"
  419. }
  420. ]
  421. }
  422. }
  423. },
  424. },
  425. {
  426. name: '进行中',
  427. type: 'line',
  428. smooth: true,
  429. data: [220, 182, 191, 234, 290, 330, 310],
  430. areaStyle: {
  431. opacity: 0.8,
  432. color: 'rgb(55, 162, 255)'
  433. },
  434. label: {
  435. show: true,
  436. position: 'right',
  437. color: '#888',
  438. formatter: ({
  439. data
  440. }) => data == 0 ? '' : `${data}`
  441. },
  442. markPoint: {
  443. data: [
  444. {
  445. type: 'min',
  446. name: 'min'
  447. },
  448. {
  449. type: 'max',
  450. name: 'max'
  451. }
  452. ],
  453. },
  454. areaStyle: {
  455. normal: {
  456. color: {
  457. type: "linear",
  458. x: 0,
  459. y: 0,
  460. x2: 0,
  461. y2: 1,
  462. colorStops: [
  463. {
  464. offset: 0,
  465. color: "rgba(35,184,210,.2)"
  466. },
  467. {
  468. offset: 1,
  469. color: "rgba(35,184,210,0)"
  470. }
  471. ]
  472. }
  473. }
  474. },
  475. },
  476. ],
  477. };
  478. // 绘制图表
  479. taskChart.setOption(option);
  480. },
  481. drawPieBug() {
  482. let bugPieChart = this.$echarts.init(document.getElementById("bugPieChart"));
  483. let option = {
  484. tooltip: {
  485. trigger: 'item',
  486. formatter: '{b} : {c} ({d}%)'
  487. },
  488. legend: {
  489. orient: 'horizontal',
  490. bottom: '80',
  491. data: ['已关闭', '已解决', '已激活', '已确认'],
  492. itemGap: 30,
  493. },
  494. series: [
  495. {
  496. center:['48%','40%'],//饼图位置
  497. type: 'pie',
  498. radius: '50%',//饼图半径大小
  499. label:{ //饼图图形上的文本标签
  500. normal:{
  501. show:true,
  502. position:'outer', //标签的位置:内部
  503. textStyle : {
  504. fontWeight : 100 ,
  505. fontSize: document.body.clientWidth / 120, //标签字体大小
  506. color: "#000000"
  507. },
  508. formatter:'{b}\n{c}({d}%)',//b:name,c:value,d:占比
  509. alignTo:'edge',
  510. margin:10
  511. }
  512. },
  513. data: [
  514. {value: this.xmBranchState.closedBugs,
  515. itemStyle: {
  516. normal:{
  517. color: '#47CBF6'
  518. }
  519. },
  520. name: '已关闭',
  521. label: {
  522. normal: {
  523. color: '#47CBF6'
  524. }
  525. },
  526. labelLine: {
  527. normal: {
  528. position: "inner",
  529. show: false
  530. }
  531. }
  532. },
  533. {value: this.xmBranchState.resolvedBugs,
  534. itemStyle: {
  535. normal:{
  536. color: '#88B0BA'
  537. }
  538. },
  539. name: '已解决',
  540. label: {
  541. normal: {
  542. color: '#88B0BA'
  543. }
  544. },
  545. labelLine: {
  546. normal: {
  547. position: "inner",
  548. show: false
  549. }
  550. }
  551. },
  552. {value: this.xmBranchState.activeBugs,
  553. itemStyle: {
  554. normal:{
  555. color: '#F6AD48'
  556. }
  557. },
  558. name: '已激活',
  559. label: {
  560. normal: {
  561. color: '#F6AD48'
  562. }
  563. },
  564. labelLine: {
  565. normal: {
  566. position: "inner",
  567. show: false
  568. }
  569. }
  570. },
  571. {value: this.xmBranchState.confirmedBugs,
  572. itemStyle: {
  573. normal:{
  574. color: '#467AF6'
  575. }
  576. },
  577. name: '已确认',
  578. label: {
  579. normal: {
  580. color: '#467AF6'
  581. }
  582. },
  583. labelLine: {
  584. normal: {
  585. position: "inner",
  586. show: false
  587. }
  588. }
  589. },
  590. ],
  591. emphasis: {
  592. itemStyle: {
  593. shadowBlur: 10,
  594. shadowOffsetX: 0,
  595. shadowColor: 'rgba(0, 0, 0, 0.5)'
  596. }
  597. }
  598. }
  599. ]
  600. };
  601. // 绘制图表
  602. bugPieChart.setOption(option);
  603. },
  604. drawCostPie() {
  605. let planTotalCostPie = this.$echarts.init(document.getElementById("planTotalCostPie"));
  606. let option = {
  607. tooltip: {
  608. trigger: 'item',
  609. formatter: '{b} : {c} ({d}%)'
  610. },
  611. legend: {
  612. orient: 'horizontal',
  613. bottom: '80',
  614. data: ['非人力', '内部人力', '外购人力'],
  615. itemGap: 30,
  616. },
  617. series: [
  618. {
  619. center:['48%','40%'],//饼图位置
  620. type: 'pie',
  621. radius: '50%',//饼图半径大小
  622. label:{ //饼图图形上的文本标签
  623. normal:{
  624. show:true,
  625. position:'outer', //标签的位置:外部
  626. textStyle : {
  627. fontWeight : 100 ,
  628. fontSize: document.body.clientWidth / 120, //标签字体大小
  629. color: "#000000"
  630. },
  631. formatter:'{b}\n{c}({d}%)',//b:name,c:value,d:占比
  632. alignTo:'edge',
  633. margin:10
  634. }
  635. },
  636. data: [
  637. {
  638. value: this.xmBranchState.budgetNouserAt,
  639. itemStyle: {
  640. normal:{
  641. color: '#46CBF6'
  642. }
  643. },
  644. name: '非人力',
  645. label: {
  646. normal: {
  647. color: '#46CBF6'
  648. },
  649. },
  650. labelLine: {
  651. normal: {
  652. position: "inner",
  653. show: false
  654. }
  655. }
  656. },
  657. {value: this.xmBranchState.budgetIuserAt,
  658. itemStyle: {
  659. normal:{
  660. color: '#F7AE48'
  661. }
  662. },
  663. name: '内部人力',
  664. label: {
  665. normal: {
  666. color: '#F7AE48'
  667. },
  668. },
  669. labelLine: {
  670. normal: {
  671. position: "inner",
  672. show: false
  673. }
  674. }
  675. },
  676. {value: this.xmBranchState.budgetOuserAt,
  677. itemStyle: {
  678. normal:{
  679. color: '#4679F6'
  680. }
  681. },
  682. name: '外购人力',
  683. label: {
  684. normal: {
  685. color: '#4679F6'
  686. }
  687. },
  688. labelLine: {
  689. normal: {
  690. position: "inner",
  691. show: false
  692. }
  693. }
  694. },
  695. ],
  696. emphasis: {
  697. itemStyle: {
  698. shadowBlur: 10,
  699. shadowOffsetX: 0,
  700. shadowColor: 'rgba(0, 0, 0, 0.5)'
  701. }
  702. }
  703. }
  704. ]
  705. };
  706. // 绘制图表
  707. planTotalCostPie.setOption(option);
  708. },
  709. drawWorkload() {
  710. let workloadDistribution = this.$echarts.init(document.getElementById("workloadDistribution"));
  711. let that = this;
  712. let option = {
  713. tooltip: {
  714. trigger: 'item',
  715. formatter: '{b} :<br/> {c} ({d}%)'
  716. },
  717. legend: {
  718. orient: 'vertical',
  719. top: '20',
  720. right: '60',
  721. data: ['内部人力', '外购人力'],
  722. itemGap: 30,
  723. textStyle: {
  724. rich: {
  725. name: {
  726. color: '#7D7D7D',
  727. fontWeight: 'bold',
  728. fontSize: 18
  729. },
  730. val: {
  731. fontSize: '14',
  732. color: '#7D7D7D'
  733. },
  734. desc: {
  735. lineHeight: 20,
  736. color: '#7D7D7D'
  737. }
  738. }
  739. },
  740. formatter(params) {
  741. console.log(params);
  742. let total = that.xmBranchState.budgetIuserWorkload + that.xmBranchState.budgetOuserWorkload;
  743. if(params == '内部人力') {
  744. let p = ((that.xmBranchState.budgetIuserWorkload / total) * 100).toFixed(2)
  745. return [
  746. `{name|${that.xmBranchState.budgetIuserWorkload}}/{val|${p}%}`,
  747. `{desc|${params}}`
  748. ].join('\n')
  749. }
  750. if(params == '外购人力') {
  751. let p = ((that.xmBranchState.budgetOuserWorkload / total) * 100).toFixed(2)
  752. return [
  753. `{name|${that.xmBranchState.budgetOuserWorkload}}/{val|${p}%}`,
  754. `{desc|${params}}`
  755. ].join('\n')
  756. }
  757. return params;
  758. },
  759. },
  760. series: [
  761. {
  762. center:['30%','40%'],//饼图位置
  763. type: 'pie',
  764. radius: ['40%', '70%'],//饼图半径大小
  765. label:{ //饼图图形上的文本标签
  766. show: false,
  767. position: 'center'
  768. },
  769. data: [
  770. {
  771. value: this.xmBranchState.budgetIuserWorkload,
  772. itemStyle: {
  773. normal:{
  774. color: '#3AC2ED'
  775. }
  776. },
  777. name: '内部人力',
  778. label: {
  779. normal: {
  780. position: "inner",
  781. show: false
  782. }
  783. },
  784. labelLine: {
  785. normal: {
  786. position: "inner",
  787. show: false
  788. }
  789. }
  790. },
  791. {value: this.xmBranchState.budgetOuserWorkload,
  792. itemStyle: {
  793. normal:{
  794. color: '#4072F5'
  795. }
  796. },
  797. name: '外购人力',
  798. label: {
  799. normal: {
  800. position: "inner",
  801. show: false
  802. }
  803. },
  804. labelLine: {
  805. normal: {
  806. position: "inner",
  807. show: false
  808. }
  809. }
  810. },
  811. ],
  812. }
  813. ]
  814. };
  815. // 绘制图表
  816. workloadDistribution.setOption(option);
  817. },
  818. drawIterationProduct() {
  819. let iterationAndProduct = this.$echarts.init(document.getElementById("iterationAndProduct"));
  820. let option = {
  821. tooltip: {
  822. trigger: 'axis',
  823. formatter: '{b} : {c}',
  824. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  825. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  826. },
  827. },
  828. grid: {
  829. left: '1%',
  830. right: '3%',
  831. bottom: '5%',
  832. containLabel: true
  833. },
  834. xAxis: {
  835. type: 'value',
  836. boundaryGap: [0, 0.01],
  837. splitLine: {
  838. show: true,
  839. lineStyle: {
  840. color: 'rgba(0, 0, 0, .05)'
  841. }
  842. },
  843. axisLine: {
  844. lineStyle: {
  845. color: 'rgba(0, 0, 0, .1)'
  846. }
  847. },
  848. axisTick: {
  849. lineStyle: {
  850. color: 'rgba(0, 0, 0, .1)'
  851. }
  852. },
  853. axisLabel: {
  854. color: '#555'
  855. }
  856. },
  857. yAxis: {
  858. type: 'category',
  859. data: ['产品数', '迭代数'],
  860. splitLine: {
  861. show: true,
  862. lineStyle: {
  863. color: 'rgba(0, 0, 0, .05)'
  864. }
  865. },
  866. axisLine: {
  867. lineStyle: {
  868. color: 'rgba(0, 0, 0, .1)'
  869. }
  870. },
  871. axisTick: {
  872. lineStyle: {
  873. color: 'rgba(0, 0, 0, .1)'
  874. }
  875. },
  876. axisLabel: {
  877. color: '#555'
  878. }
  879. },
  880. series: [{
  881. label: {
  882. normal:{
  883. show: true,
  884. position: 'inside',
  885. color:'#fff',
  886. fontSize: '14'
  887. }
  888. },
  889. data: [this.xmBranchState.productCnt, this.xmBranchState.iterationCnt],
  890. type: 'bar',
  891. showBackground: true,
  892. itemStyle: {
  893. normal:{
  894. color: '#467AF6'
  895. }
  896. },
  897. backgroundStyle: {
  898. color: '#FFFFFF'
  899. }
  900. }]
  901. };
  902. // 绘制图表
  903. iterationAndProduct.setOption(option);
  904. },
  905. searchXmBranchState(callBack){
  906. listXmBranchState({branchId:this.userInfo.branchId}).then(res=>{
  907. var tips=res.data.tips;
  908. if(tips.isOk && res.data.data.length>0){
  909. this.xmBranchState=res.data.data[0]
  910. }
  911. if(callBack){
  912. this.$nextTick(()=>{
  913. callBack();
  914. })
  915. }
  916. });
  917. },
  918. //路由跳转
  919. gotolink(link) {
  920. this.$router.replace(link);
  921. },
  922. /**end 自定义函数请在上面加**/
  923. guiderStart(forceDisplayWhileClosed) { // 初始化引导页
  924. Guider.startByName('xmHomePage',forceDisplayWhileClosed);
  925. },
  926. },
  927. mounted() {
  928. //this.searchXmBranchState( this.guiderStart );
  929. this.searchXmBranchState();
  930. this.drawWorkload();
  931. this.drawTaskByDate();
  932. this.drawAllBar();
  933. this.drawCostPie();
  934. this.drawPieBug();
  935. this.drawIterationProduct();
  936. },
  937. };
  938. </script>
  939. <style scoped lang="scss">
  940. .page-container {
  941. width: 100%;
  942. height: 100%;
  943. background-color: #F4F5F8;
  944. .page-main {
  945. padding: 18px;
  946. overflow: hidden;
  947. h2 {
  948. margin-top: 16px;
  949. font-size: 24px;
  950. color: #7D7D7D;
  951. }
  952. h2:before {
  953. content: " ";
  954. border-left: 10px #AEB8CE solid;
  955. margin-right: 12px;
  956. }
  957. .row_1 {
  958. background-color: #fff;
  959. display: flex;
  960. flex-direction: row;
  961. height: 120px;
  962. margin-top: 10px;
  963. .r {
  964. flex: 1;
  965. display: flex;
  966. flex-direction: column;
  967. justify-content: center;
  968. align-items: center;
  969. span {
  970. margin-bottom: 14px;
  971. font-size: 24px;
  972. font-weight: bold;
  973. }
  974. p {
  975. font-size: 18px;
  976. color: #7D7D7D;
  977. font-weight: bold;
  978. opacity: 0.55;
  979. }
  980. }
  981. }
  982. .row_2 {
  983. height: 354px;
  984. margin-top: 22px;
  985. display: flex;
  986. flex-direction: row;
  987. .r1 {
  988. flex: 2;
  989. background-color: #fff;
  990. margin-right: 20px;
  991. .message {
  992. display: flex;
  993. margin: 0 43px;
  994. div {
  995. flex: 1;
  996. display: flex;
  997. flex-direction: column;
  998. align-items: center;
  999. justify-content: center;
  1000. span {
  1001. margin-bottom: 8px;
  1002. font-weight: bold;
  1003. color: #7D7D7D;
  1004. }
  1005. p {
  1006. color: #7D7D7D;
  1007. opacity: 0.55;
  1008. }
  1009. }
  1010. }
  1011. .chart {
  1012. display: flex;
  1013. flex-direction: row;
  1014. margin: 0 47px 0 47px;
  1015. height: 120px;
  1016. .desc {
  1017. display: flex;
  1018. flex-direction: column;
  1019. margin-right: 20px;
  1020. font-size: 18px;
  1021. color: #7D7D7D;
  1022. justify-content: center;
  1023. span:nth-child(1) {
  1024. margin-bottom: 20px;
  1025. }
  1026. }
  1027. .process {
  1028. display: flex;
  1029. flex-direction: column;
  1030. flex: 1;
  1031. justify-content: center;
  1032. .pc:nth-child(1) {
  1033. margin-bottom: 20px;
  1034. }
  1035. }
  1036. .tj {
  1037. display: flex;
  1038. flex: 1;
  1039. justify-content: center;
  1040. align-items: center;
  1041. }
  1042. .chart {
  1043. flex: 1;
  1044. }
  1045. }
  1046. }
  1047. .r2 {
  1048. width: 540px;
  1049. background-color: #fff;
  1050. .r2 {
  1051. width: 100%;
  1052. height: 100%;
  1053. display: flex;
  1054. align-items: center;
  1055. justify-content: center;
  1056. }
  1057. }
  1058. }
  1059. .row_3 {
  1060. height: 450px;
  1061. display: flex;
  1062. flex-direction: row;
  1063. margin-top: 24px;
  1064. .r1 {
  1065. display: flex;
  1066. flex: 1;
  1067. background-color: #fff;
  1068. flex-direction: column;
  1069. margin-right: 20px;
  1070. }
  1071. .r2 {
  1072. flex: 1;
  1073. background-color: #fff;
  1074. display: flex;
  1075. flex-direction: column;
  1076. }
  1077. }
  1078. .row_4 {
  1079. height: 445px;
  1080. display: flex;
  1081. margin-top: 21px;
  1082. .r4_1 {
  1083. flex: 1;
  1084. background-color: #fff;
  1085. margin-right: 25px;
  1086. display: flex;
  1087. flex-direction: column;
  1088. }
  1089. .r4_2 {
  1090. flex: 1;
  1091. background-color: #fff;
  1092. margin-right: 25px;
  1093. display: flex;
  1094. flex-direction: column;
  1095. }
  1096. .r4_3 {
  1097. display: flex;
  1098. flex-direction: column;
  1099. background-color: #fff;
  1100. flex: 1;
  1101. }
  1102. }
  1103. .r_text {
  1104. font-size: 20px;
  1105. color: #7D7D7D;
  1106. margin: 26px 0 50px 28px;
  1107. }
  1108. }
  1109. }
  1110. </style>