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.

1008 lines
32 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
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
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
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 padding">
  3. <el-row class="page-main " :style="{overflowX: 'hidden',height:maxTableHeight+'px'}" ref="table">
  4. <el-row :gutter="10" style="margin-bottom:10px">
  5. <el-col :span="16" >
  6. <el-card class="box-card" style="padding:0px ;height:425px">
  7. <div slot="header" class="clearfix">
  8. <span class="el-icon-s-data" style=" color: #3E68fe;">数据汇总</span>
  9. </div>
  10. <el-row style="margin-bottom:18px">
  11. <el-col :span="8">
  12. <div class="item">
  13. <div class="icon" style="background-color: rgb(79, 140, 255);">
  14. <i class="el-icon-alarm-clock"></i>
  15. </div>
  16. <div class="info">
  17. <div v-text="xmBranchState.totalPlanWorkload"></div>
  18. <div class="title">项目总工时</div>
  19. </div>
  20. </div>
  21. </el-col>
  22. <el-col :span="8">
  23. <div class="item">
  24. <div class="icon" style="background-color: rgb(255, 153, 51);">
  25. <i class="el-icon-alarm-clock"></i>
  26. </div>
  27. <div class="info">
  28. <div v-text="xmBranchState.productBudgetWorkload">
  29. </div>
  30. <div class="title">产品总工时</div>
  31. </div>
  32. </div>
  33. </el-col>
  34. <el-col :span="8">
  35. <div class="item">
  36. <div class="icon" style="background-color: rgb(0, 153, 51);">
  37. <i class="el-icon-s-custom"></i>
  38. </div>
  39. <div class="info">
  40. <div v-text="xmBranchState.totalStaffCnt" >
  41. </div>
  42. <div class="title">总人数</div>
  43. </div>
  44. </div>
  45. </el-col>
  46. </el-row>
  47. <el-row style="margin-bottom:18px">
  48. <el-col :span="8">
  49. <div class="item">
  50. <div class="icon" style="background-color: rgb(79, 140, 255);">
  51. <i class="el-icon-s-unfold"></i>
  52. </div>
  53. <div class="info">
  54. <div v-text="xmBranchState.projectCnt"></div>
  55. <div class="title">项目数</div>
  56. </div>
  57. </div>
  58. </el-col>
  59. <el-col :span="8">
  60. <div class="item">
  61. <div class="icon" style="background-color: rgb(255, 153, 51);">
  62. <i class="el-icon-date"></i>
  63. </div>
  64. <div class="info">
  65. <div v-text="xmBranchState.totalPhaseCnt">
  66. </div>
  67. <div class="title">计划数</div>
  68. </div>
  69. </div>
  70. </el-col>
  71. <el-col :span="8">
  72. <div class="item">
  73. <div class="icon" style="background-color: rgb(0, 153, 51);">
  74. <i class="el-icon-s-operation"></i>
  75. </div>
  76. <div class="info">
  77. <div v-text="xmBranchState.totalTaskCnt" >
  78. </div>
  79. <div class="title">任务数</div>
  80. </div>
  81. </div>
  82. </el-col>
  83. </el-row>
  84. <el-row style="margin-bottom:18px">
  85. <el-col :span="8">
  86. <div class="item">
  87. <div class="icon" style="background-color: rgb(79, 140, 255);">
  88. <i class="el-icon-star-off"></i>
  89. </div>
  90. <div class="info">
  91. <div v-text="xmBranchState.productCnt" >
  92. </div>
  93. <div class="title">产品数</div>
  94. </div>
  95. </div>
  96. </el-col>
  97. <el-col :span="8">
  98. <div class="item">
  99. <div class="icon" style="background-color: rgb(255, 153, 51);">
  100. <i class="el-icon-refresh"></i>
  101. </div>
  102. <div class="info">
  103. <div v-text="xmBranchState.iterationCnt" >
  104. </div>
  105. <div class="title">迭代数</div>
  106. </div>
  107. </div>
  108. </el-col>
  109. <el-col :span="8">
  110. <div class="item">
  111. <div class="icon" style="background-color: rgb(0, 153, 51);">
  112. <i class="el-icon-loading"></i>
  113. </div>
  114. <div class="info">
  115. <div v-text="xmBranchState.menuCnt" >
  116. </div>
  117. <div class="title">需求数</div>
  118. </div>
  119. </div>
  120. </el-col>
  121. </el-row>
  122. </el-card>
  123. </el-col>
  124. <el-col :span="8" >
  125. <el-card class="box-card" style="height:425px">
  126. <div slot="header" class="clearfix">
  127. <span class="el-icon-document" style=" color: #3E68fe;">&nbsp;快捷菜单</span>
  128. </div>
  129. <div class="menu">
  130. <div class="menu-content">
  131. <div class="quick-menu" @click="gotolink('/xm/core/xmProduct/XmProductAllMng')" id="XmProductAllMng">
  132. <div class="quick-menu-icon-outer">
  133. <img src="../../assets/image/platform/module-attendance.png" />
  134. </div>
  135. <div class="quick-menu-text">产品管理</div>
  136. </div>
  137. <div class="quick-menu" @click="gotolink('/xm/core/xmMenu/XmMenuMng')" id="XmMenuMng">
  138. <div class="quick-menu-icon-outer">
  139. <img src="../../assets/image/platform/module-contract.png" />
  140. </div>
  141. <div class="quick-menu-text">需求管理</div>
  142. </div>
  143. <div class="quick-menu" @click="gotolink('/xm/core/xmProject/XmProjectAllMng')" id="XmProjectAllMng">
  144. <div class="quick-menu-icon-outer">
  145. <img src="../../assets/image/platform/module-project.png" />
  146. </div>
  147. <div class="quick-menu-text">项目管理</div>
  148. </div>
  149. <div class="quick-menu" @click="gotolink('/xm/core/xmTask/XmMyTaskCenter')" id="XmMyTaskCenter">
  150. <div class="quick-menu-icon-outer">
  151. <img src="../../assets/image/platform/module-code.png" />
  152. </div>
  153. <div class="quick-menu-text">开发任务</div>
  154. </div>
  155. <div class="quick-menu" @click="gotolink('/xm/core/xmGroup/XmGroupAllMng')" id="XmGroupAllMng">
  156. <div class="quick-menu-icon-outer">
  157. <img src="../../assets/image/platform/module-organization.png" />
  158. </div>
  159. <div class="quick-menu-text">团队管理</div>
  160. </div>
  161. <div class="quick-menu" @click="gotolink('/xm/core/xmQuestion/XmQuestionMng')" id="XmQuestionMng">
  162. <div class="quick-menu-icon-outer">
  163. <img src="../../assets/image/platform/module-fake.png" />
  164. </div>
  165. <div class="quick-menu-text">缺陷管理</div>
  166. </div>
  167. <div class="quick-menu" @click="gotolink('/mdp/workflow/ru/task/TaskListAssigneeToMe')" id="TaskListAssigneeToMe">
  168. <div class="quick-menu-icon-outer">
  169. <img src="../../assets/image/platform/module-task.png" />
  170. </div>
  171. <div class="quick-menu-text">待审事项</div>
  172. </div>
  173. </div>
  174. </div>
  175. </el-card>
  176. </el-col>
  177. </el-row>
  178. <el-row :gutter="10" style="margin-bottom:10px">
  179. <el-col :span="16" >
  180. <el-card class="box-card" style="padding:0px ;height:425px">
  181. <div slot="header" class="clearfix">
  182. <span class="el-icon-s-operation" style=" color: #3E68fe;">项目进度</span>
  183. </div>
  184. <div>
  185. <el-row style="padding-top:15px;padding-left:25px;">
  186. <div class="item">
  187. <el-col :span="8">
  188. <div>
  189. <div style="text-align:center;">
  190. <span style="font-size:24px;" v-text="this.xmBranchState.estimateWorkload"></span>
  191. <span style="font-size:5px;">h</span>
  192. </div>
  193. <div style="text-align:center;font-size:5px;">预估工时</div>
  194. </div>
  195. </el-col>
  196. <el-col :span="8">
  197. <div>
  198. <div style="text-align:center;">
  199. <span style="font-size:24px;" v-text="this.xmBranchState.totalActWorkload"></span>
  200. <span style="font-size:5px;">h</span>
  201. </div>
  202. <div style="text-align:center;font-size:5px;">登记工时</div>
  203. </div>
  204. </el-col>
  205. <el-col :span="8">
  206. <div>
  207. <div style="text-align:center;">
  208. <span style="font-size:24px;" v-text="workloadProgress"></span>
  209. <span style="font-size:5px;">%</span>
  210. </div>
  211. <div style="text-align:center;font-size:5px;">工时进度</div>
  212. </div>
  213. </el-col>
  214. </div>
  215. </el-row>
  216. <el-row style="padding-top:15px;padding-left:25px;">
  217. <div class="item">
  218. <el-col :span="8">
  219. <div>
  220. <div style="text-align:center;">
  221. <span style="font-size:24px;" v-text="remainWorkload"></span>
  222. <span style="font-size:5px;">h</span>
  223. </div>
  224. <div style="text-align:center;font-size:5px;">剩余工时</div>
  225. </div>
  226. </el-col>
  227. <el-col :span="8">
  228. <div>
  229. <div style="text-align:center;">
  230. <span style="font-size:24px;" v-text="deviation"></span>
  231. <span style="font-size:5px;">h</span>
  232. </div>
  233. <div style="text-align:center;font-size:5px;">预估偏差</div>
  234. </div>
  235. </el-col>
  236. <el-col :span="8">
  237. <div>
  238. <div style="text-align:center;">
  239. <span style="font-size:24px;" v-text="deviationRate"></span>
  240. <span style="font-size:5px;">%</span>
  241. </div>
  242. <div style="text-align:center;font-size:5px;">预估偏差率</div>
  243. </div>
  244. </el-col>
  245. </div>
  246. </el-row>
  247. <el-row>
  248. <span style="margin-left:20px;">项目预计进度</span>
  249. <el-progress style="width: 90%;margin-left:20px;margin-top: 10px;margin-bottom: 20px;" :text-inside="true" :stroke-width="24" :percentage="planProgress"></el-progress>
  250. </el-row>
  251. <el-row>
  252. <span style="margin-left:20px;">项目实际进度</span>
  253. <el-progress style="width: 90%;margin-left:20px;margin-top: 10px;" :text-inside="true" :stroke-width="24" :percentage="realProgress"></el-progress>
  254. </el-row>
  255. </div>
  256. </el-card>
  257. </el-col>
  258. <el-col :span="8" >
  259. <el-card class="box-card" style="height:425px">
  260. <div slot="header" class="clearfix">
  261. <span class="el-icon-document" style=" color: #3E68fe;">工作量分布</span>
  262. </div>
  263. <div>
  264. <div id="workloadDistribution" :style="{width: '100%', height: '410px'}"></div>
  265. </div>
  266. </el-card>
  267. </el-col>
  268. </el-row>
  269. <el-row :gutter="10" style="margin-bottom:10px">
  270. <el-col :span="16" >
  271. <el-card class="box-card" style="padding:0px ;height:425px">
  272. <div slot="header" class="clearfix">
  273. <span class="el-icon-document" style=" color: #3E68fe;">任务每日状态趋势</span>
  274. </div>
  275. <div>
  276. <div id="taskChart" :style="{width: '100%', height: '320px'}"></div>
  277. </div>
  278. </el-card>
  279. </el-col>
  280. <el-col :span="8" >
  281. <el-card class="box-card" style="height:425px">
  282. <div slot="header" class="clearfix">
  283. <span class="el-icon-document" style=" color: #3E68fe;">工作项数量分布</span>
  284. </div>
  285. <div>
  286. <div id="allChart" :style="{width: '100%', height: '350px'}"></div>
  287. </div>
  288. </el-card>
  289. </el-col>
  290. </el-row>
  291. <el-row :gutter="10" style="margin-bottom:10px">
  292. <el-col :span="8" >
  293. <el-card class="box-card" style="height:425px">
  294. <div slot="header" class="clearfix">
  295. <span class="el-icon-document" style=" color: #3E68fe;">总预算情况</span>
  296. </div>
  297. <div>
  298. <div id="planTotalCostPie" :style="{width: '100%', height: '410px'}"></div>
  299. </div>
  300. </el-card>
  301. </el-col>
  302. <el-col :span="8" >
  303. <el-card class="box-card" style="height:425px">
  304. <div slot="header" class="clearfix">
  305. <span class="el-icon-document" style=" color: #3E68fe;">缺陷情况</span>
  306. </div>
  307. <div>
  308. <div id="bugPieChart" :style="{width: '100%', height: '410px'}"></div>
  309. </div>
  310. </el-card>
  311. </el-col>
  312. <el-col :span="8" >
  313. <el-card class="box-card" style="height:425px">
  314. <div slot="header" class="clearfix">
  315. <span class="el-icon-document" style=" color: #3E68fe;">所含产品和迭代情况</span>
  316. </div>
  317. <div>
  318. <div id="iterationAndProduct" :style="{width: '100%', height: '350px'}"></div>
  319. </div>
  320. </el-card>
  321. </el-col>
  322. </el-row>
  323. </el-row>
  324. </section>
  325. </template>
  326. <script>
  327. import util from "@/common/js/util"; // 全局公共库
  328. import { mapGetters } from "vuex";
  329. import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询
  330. import { listXmBranchState,loadProjectStateToXmBranchState } from '@/api/xm/core/xmBranchState';
  331. import Guider from '@/components/Guider/Index.js';
  332. export default {
  333. computed: {
  334. ...mapGetters(["userInfo"]),
  335. finish: function (){
  336. return this.xmBranchState.totalCompleteTaskCnt;
  337. },
  338. notStart: function() {
  339. return this.xmBranchState.totalTaskCnt-this.xmBranchState.totalCompleteTaskCnt;
  340. },
  341. totalTask: function() {
  342. return this.xmBranchState.totalTaskCnt;
  343. },
  344. taskProgress: function (){
  345. return this.xmBranchState.totalProgress;
  346. },
  347. taskStartTime: function (){
  348. return this.xmBranchState.startTime.substring(0,10);
  349. },
  350. taskEndTime: function (){
  351. return this.xmBranchState.endTime.substring(0,10);
  352. },
  353. taskMng: function (){
  354. return this.xmBranchState.createUsername;
  355. },
  356. workloadProgress:function (){
  357. return Math.round(this.xmBranchState.totalActWorkload/this.xmBranchState.estimateWorkload*100);
  358. },
  359. deviation:function (){
  360. return Math.round(this.xmBranchState.totalActWorkload-this.xmBranchState.estimateWorkload);
  361. },
  362. deviationRate:function (){
  363. return Math.round((this.xmBranchState.totalActWorkload-this.xmBranchState.estimateWorkload)/this.xmBranchState.estimateWorkload*100);
  364. },
  365. remainWorkload:function (){
  366. return this.xmBranchState.totalPlanWorkload - this.xmBranchState.totalActWorkload;
  367. },
  368. planProgress:function (){
  369. if(!this.xmBranchState.totalPlanWorkload){
  370. return 0;
  371. }
  372. return parseInt( this.xmBranchState.estimateWorkload/this.xmBranchState.totalPlanWorkload*100)
  373. },
  374. realProgress:function (){
  375. if(!this.xmBranchState.totalPlanWorkload){
  376. return 0;
  377. }
  378. if(this.xmBranchState.totalActWorkload < this.xmBranchState.totalPlanWorkload){
  379. return Math.round(this.xmBranchState.totalActWorkload/this.xmBranchState.totalPlanWorkload*100)
  380. }else{
  381. return 100;
  382. }
  383. },
  384. xmBranchStateCpd(){
  385. return this.xmBranchState
  386. },
  387. },
  388. watch:{
  389. xmBranchStateCpd:function(){
  390. this.drawAllBar();
  391. this.drawTaskByDate();
  392. this.drawPieBug();
  393. this.drawCostPie();
  394. this.drawWorkload();
  395. this.drawIterationProduct();
  396. }
  397. },
  398. data() {
  399. return {
  400. isActive: true,
  401. xmBranchState:{},
  402. maxTableHeight:300,
  403. // dicts: getDefOptions(),//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]}
  404. };
  405. },
  406. methods:{
  407. drawAllBar() {
  408. // 基于准备好的dom,初始化echarts实例
  409. let allChart = this.$echarts.init(document.getElementById("allChart"));
  410. let option = {
  411. tooltip: {
  412. trigger: 'axis',
  413. axisPointer: {
  414. type: 'shadow'
  415. }
  416. },
  417. grid: {
  418. left: '3%',
  419. right: '4%',
  420. bottom: '10%',
  421. containLabel: true
  422. },
  423. yAxis: {
  424. type: 'value'
  425. },
  426. xAxis: {
  427. type: 'category',
  428. data: ['需求', '任务', '缺陷']
  429. },
  430. series: [
  431. {
  432. label: {
  433. normal:{
  434. show: true,
  435. position: 'top',
  436. color:'#000000',
  437. }
  438. },
  439. data: [
  440. {
  441. value: this.xmBranchState.menuCnt,
  442. itemStyle: {
  443. normal:{
  444. color: '#99CCFF'
  445. }
  446. }
  447. },
  448. {
  449. value: this.xmBranchState.totalTaskCnt,
  450. itemStyle: {
  451. normal:{
  452. color: '#99CCFF'
  453. }
  454. }
  455. },
  456. {
  457. value: this.xmBranchState.totalBugCnt,
  458. itemStyle: {
  459. normal:{
  460. color: '#99CCFF'
  461. }
  462. }
  463. },
  464. ],
  465. type: 'bar'
  466. }
  467. ]
  468. };
  469. // 绘制图表
  470. allChart.setOption(option);
  471. },
  472. drawTaskByDate() {
  473. let taskChart = this.$echarts.init(document.getElementById("taskChart"));
  474. let option = {
  475. tooltip: {
  476. trigger: 'axis'
  477. },
  478. color:['rgb(0, 153, 255)','#6699CC'],
  479. legend: {
  480. data: ['未开始', '进行中']
  481. },
  482. grid: {
  483. left: '1%',
  484. right: '3%',
  485. bottom: '5%',
  486. containLabel: true
  487. },
  488. toolbox: {
  489. feature: {
  490. saveAsImage: {}
  491. }
  492. },
  493. xAxis: {
  494. type: 'category',
  495. boundaryGap: false,
  496. data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
  497. },
  498. yAxis: {
  499. type: 'value'
  500. },
  501. series: [
  502. {
  503. name: '未开始',
  504. type: 'line',
  505. //stack: '总量',
  506. data: [120, 132, 101, 134, 90, 230, 210],
  507. areaStyle: {
  508. normal:{
  509. color:"rgb(153, 204, 255)" , //设置折线图颜色
  510. }
  511. },
  512. lineStyle:{
  513. normal:{
  514. color:'rgb(0, 153, 255)'
  515. }
  516. },
  517. },
  518. {
  519. name: '进行中',
  520. type: 'line',
  521. //stack: '总量',
  522. data: [220, 182, 191, 234, 290, 330, 310],
  523. areaStyle: {
  524. normal:{
  525. color:"rgb(153, 204, 255)", //设置折线图颜色
  526. }
  527. },
  528. lineStyle:{
  529. normal:{
  530. color:'#6699CC'
  531. }
  532. },
  533. },
  534. ],
  535. };
  536. // 绘制图表
  537. taskChart.setOption(option);
  538. },
  539. drawPieBug() {
  540. let bugPieChart = this.$echarts.init(document.getElementById("bugPieChart"));
  541. let option = {
  542. tooltip: {
  543. trigger: 'item',
  544. formatter: '{b} : {c} ({d}%)'
  545. },
  546. legend: {
  547. orient: 'vertical',
  548. left: 'left',
  549. },
  550. series: [
  551. {
  552. center:['55%','40%'],//饼图位置
  553. type: 'pie',
  554. radius: '50%',//饼图半径大小
  555. label:{ //饼图图形上的文本标签
  556. normal:{
  557. show:true,
  558. position:'outer', //标签的位置:内部
  559. textStyle : {
  560. fontWeight : 100 ,
  561. fontSize: document.body.clientWidth / 120, //标签字体大小
  562. color: "#000000"
  563. },
  564. formatter:'{b}\n{c}({d}%)',//b:name,c:value,d:占比
  565. alignTo:'edge',
  566. margin:10
  567. }
  568. },
  569. data: [
  570. {value: this.xmBranchState.totalClosedBugCnt,
  571. itemStyle: {
  572. normal:{
  573. color: '#5470C6'
  574. }
  575. },
  576. name: '已关闭'},
  577. {value: this.xmBranchState.totalResolvedBugCnt,
  578. itemStyle: {
  579. normal:{
  580. color: '#91CC75'
  581. }
  582. },
  583. name: '已解决'},
  584. {value: this.xmBranchState.totalActiveBugCnt,
  585. itemStyle: {
  586. normal:{
  587. color: '#FAC858'
  588. }
  589. },
  590. name: '已激活'},
  591. {value: this.xmBranchState.totalConfirmedBugCnt,
  592. itemStyle: {
  593. normal:{
  594. color: '#EE6666'
  595. }
  596. },
  597. name: '已确认'},
  598. ],
  599. emphasis: {
  600. itemStyle: {
  601. shadowBlur: 10,
  602. shadowOffsetX: 0,
  603. shadowColor: 'rgba(0, 0, 0, 0.5)'
  604. }
  605. }
  606. }
  607. ]
  608. };
  609. // 绘制图表
  610. bugPieChart.setOption(option);
  611. },
  612. drawCostPie() {
  613. let planTotalCostPie = this.$echarts.init(document.getElementById("planTotalCostPie"));
  614. let option = {
  615. tooltip: {
  616. trigger: 'item',
  617. formatter: '{b} : {c} ({d}%)'
  618. },
  619. legend: {
  620. bottom: 10,
  621. left: 'center',
  622. },
  623. series: [
  624. {
  625. center:['55%','40%'],//饼图位置
  626. type: 'pie',
  627. radius: '50%',//饼图半径大小
  628. label:{ //饼图图形上的文本标签
  629. normal:{
  630. show:true,
  631. position:'outer', //标签的位置:外部
  632. textStyle : {
  633. fontWeight : 100 ,
  634. fontSize: document.body.clientWidth / 120, //标签字体大小
  635. color: "#000000"
  636. },
  637. formatter:'{b}\n{c}({d}%)',//b:name,c:value,d:占比
  638. alignTo:'edge',
  639. margin:10
  640. }
  641. },
  642. data: [
  643. {value: this.xmBranchState.totalBudgetNouserAmount,
  644. itemStyle: {
  645. normal:{
  646. color: '#FAC858'
  647. }
  648. },
  649. name: '非人力'},
  650. {value: this.xmBranchState.totalBudgetIuserAmount,
  651. itemStyle: {
  652. normal:{
  653. color: '#73C0DE'
  654. }
  655. },
  656. name: '内部人力'},
  657. {value: this.xmBranchState.totalBudgetOuserAmount,
  658. itemStyle: {
  659. normal:{
  660. color: '#5470C6'
  661. }
  662. },
  663. name: '外购人力'},
  664. ],
  665. emphasis: {
  666. itemStyle: {
  667. shadowBlur: 10,
  668. shadowOffsetX: 0,
  669. shadowColor: 'rgba(0, 0, 0, 0.5)'
  670. }
  671. }
  672. }
  673. ]
  674. };
  675. // 绘制图表
  676. planTotalCostPie.setOption(option);
  677. },
  678. drawWorkload() {
  679. let workloadDistribution = this.$echarts.init(document.getElementById("workloadDistribution"));
  680. let option = {
  681. tooltip: {
  682. trigger: 'item',
  683. formatter: '{b} :<br/> {c} ({d}%)'
  684. },
  685. legend: {
  686. bottom: 10,
  687. left: 'center',
  688. },
  689. series: [
  690. {
  691. center:['55%','40%'],//饼图位置
  692. type: 'pie',
  693. radius: '50%',//饼图半径大小
  694. label:{ //饼图图形上的文本标签
  695. normal:{
  696. show:true,
  697. position:'outer', //标签的位置:外部
  698. textStyle : {
  699. fontWeight : 100 ,
  700. fontSize: document.body.clientWidth / 120, //标签字体大小
  701. color: "#000000"
  702. },
  703. formatter:'{b}\n{c}({d}%)',//b:name,c:value,d:占比
  704. alignTo:'edge',
  705. margin:10
  706. }
  707. },
  708. data: [
  709. {value: this.xmBranchState.totalPlanIuserWorkload,
  710. itemStyle: {
  711. normal:{
  712. color: '#91CC75'
  713. }
  714. },
  715. name: '内部人力'},
  716. {value: this.xmBranchState.totalPlanOuserWorkload,
  717. itemStyle: {
  718. normal:{
  719. color: '#3BA272'
  720. }
  721. },
  722. name: '外购人力'},
  723. ],
  724. emphasis: {
  725. itemStyle: {
  726. shadowBlur: 10,
  727. shadowOffsetX: 0,
  728. shadowColor: 'rgba(0, 0, 0, 0.5)'
  729. }
  730. }
  731. }
  732. ]
  733. };
  734. // 绘制图表
  735. workloadDistribution.setOption(option);
  736. },
  737. drawIterationProduct() {
  738. let iterationAndProduct = this.$echarts.init(document.getElementById("iterationAndProduct"));
  739. let option = {
  740. tooltip: {
  741. trigger: 'axis',
  742. formatter: '{b} : {c}',
  743. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  744. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  745. },
  746. },
  747. xAxis: {
  748. type: 'category',
  749. data: ['产品数', '迭代数']
  750. },
  751. yAxis: {
  752. type: 'value'
  753. },
  754. series: [{
  755. label: {
  756. normal:{
  757. show: true,
  758. position: 'top',
  759. color:'#000000',
  760. }
  761. },
  762. data: [this.xmBranchState.productCnt, this.xmBranchState.iterationCnt],
  763. type: 'bar',
  764. showBackground: true,
  765. itemStyle: {
  766. normal:{
  767. color: '#87CEFA'
  768. }
  769. },
  770. backgroundStyle: {
  771. color: '#FFFFFF'
  772. }
  773. }]
  774. };
  775. // 绘制图表
  776. iterationAndProduct.setOption(option);
  777. },
  778. searchXmBranchState(callBack){
  779. listXmBranchState({branchId:this.userInfo.branchId}).then(res=>{
  780. var tips=res.data.tips;
  781. if(tips.isOk && res.data.data.length>0){
  782. this.xmBranchState=res.data.data[0]
  783. }
  784. if(callBack){
  785. this.$nextTick(()=>{
  786. callBack();
  787. })
  788. }
  789. });
  790. },
  791. //路由跳转
  792. gotolink(link) {
  793. this.$router.replace(link);
  794. },
  795. /**end 自定义函数请在上面加**/
  796. guiderStart(forceDisplayWhileClosed) { // 初始化引导页
  797. Guider.startByName('xmHomePage',forceDisplayWhileClosed);
  798. },
  799. },
  800. mounted() {
  801. this.$nextTick(() => {
  802. this.maxTableHeight=util.calcTableMaxHeight(this.$refs.table.$el)
  803. });
  804. this.drawAllBar();
  805. this.drawTaskByDate();
  806. this.drawPieBug();
  807. this.drawCostPie();
  808. this.drawWorkload();
  809. this.drawIterationProduct();
  810. this.searchXmBranchState( this.guiderStart );
  811. },
  812. };
  813. </script>
  814. <style scoped lang="scss">
  815. .container {
  816. margin: 10px;
  817. }
  818. .header {
  819. display: flex;
  820. justify-content: flex-start;
  821. padding: 10px;
  822. span {
  823. padding-right: 15px;
  824. }
  825. }
  826. .col {
  827. margin-bottom: 20px;
  828. }
  829. .icon {
  830. color: #fff;
  831. height: 30px;
  832. width: 30px;
  833. border-radius: 15px;
  834. text-align: center;
  835. line-height: 30px;
  836. font-size: 20px;
  837. display: inline-block;
  838. margin-right: 5px;
  839. }
  840. .icon2 {
  841. color: #000000;
  842. height: 30px;
  843. width: 30px;
  844. border-radius: 15px;
  845. text-align: center;
  846. line-height: 30px;
  847. font-size: 20px;
  848. display: inline-block;
  849. margin-right: 5px;
  850. margin-left: 5px;
  851. }
  852. .item {
  853. display: flex;
  854. justify-content: flex-start;
  855. position: relative;
  856. .progress-item{
  857. position:absolute; width:80%;
  858. }
  859. }
  860. .card-font {
  861. color: #000000;
  862. font-size: 12px;
  863. .el-col {
  864. margin-bottom: 20px;
  865. }
  866. }
  867. .calendar-header {
  868. display: flex;
  869. justify-content: space-between;
  870. .cal-header-boxs {
  871. flex: 1;
  872. display: flex;
  873. justify-content: flex-end;
  874. .cal-header-box {
  875. padding: 5px;
  876. height: 45px;
  877. margin-left: 10px;
  878. }
  879. .box-icon {
  880. text-align: center;
  881. }
  882. .box-info {
  883. text-align: center;
  884. font-size: 12px;
  885. color: #000000;
  886. }
  887. }
  888. }
  889. .el-tag:hover {
  890. cursor: pointer;
  891. }
  892. .value {
  893. cursor: pointer;
  894. }
  895. .reference {
  896. margin-top: 10px;
  897. font-size: 12px;
  898. }
  899. .click {
  900. background: #e9f7ff;
  901. }
  902. .calendar-box {
  903. display: flex;
  904. justify-content: flex-start;
  905. }
  906. </style>
  907. <style>
  908. .app-container{
  909. padding: 20px;
  910. padding-bottom: 0;
  911. }
  912. </style>
  913. <style scoped lang="scss" >
  914. .menu {
  915. background: white;
  916. min-height: 280px;
  917. margin-top: 10px;
  918. .menu-content {
  919. display: flex;
  920. justify-content: flex-start;
  921. padding: 10px;
  922. flex-wrap: wrap;
  923. .quick-menu {
  924. height: 80px;
  925. width: 60px;
  926. margin-right: 15px;
  927. cursor: pointer;
  928. margin-bottom: 20px;
  929. .quick-menu-icon-outer {
  930. width: 52px;
  931. height: 52px;
  932. padding: 6px;
  933. border: 1px solid transparent;
  934. border-radius: 5px;
  935. text-align: center;
  936. line-height: 52px;
  937. display: flex;
  938. flex-direction: column;
  939. justify-content: center;
  940. align-items: center;
  941. img {
  942. width: 30px;
  943. color: white;
  944. }
  945. }
  946. .quick-menu-text {
  947. height: 30px;
  948. width: 60px;
  949. line-height: 30px;
  950. font-size: 12px;
  951. color: #333;
  952. float: left;
  953. text-overflow: ellipsis;
  954. overflow: hidden;
  955. white-space: nowrap;
  956. text-align: center;
  957. }
  958. }
  959. .quick-menu:hover {
  960. opacity: 0.8;
  961. .quick-menu-text {
  962. color: rgb(3, 169, 244);
  963. }
  964. }
  965. }
  966. }
  967. </style>