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.

1175 lines
34 KiB

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