taskStatistics.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. <template>
  2. <div @click="openDrawer = false">
  3. <el-container class="defect-container">
  4. <el-header class="defect-main" style="height: auto;">
  5. <el-form :model="chartForm" class="demo-form-inline" :inline="true">
  6. <el-form-item label="时间:">
  7. <div class="date-select">
  8. <span :class="[dateType==='week'?'date-active':'']" class="date-item" @click.stop="dateType='week';setDate('week')">本周</span>
  9. <span :class="[dateType==='month'?'date-active':'']" class="date-item" @click.stop="dateType='month';setDate('month')">本月</span>
  10. <span :class="[dateType==='year'?'date-active':'']" class="date-item" @click.stop="dateType='year';setDate('year')">本年</span>
  11. </div>
  12. <el-date-picker
  13. v-model="stratAndEnd"
  14. type="daterange"
  15. align="right"
  16. unlink-panels
  17. range-separator="至"
  18. start-placeholder="开始日期"
  19. end-placeholder="结束日期"
  20. size="small"
  21. value-format="yyyy.MM.dd"
  22. :default-time="['00:00:00','23:59:59']"
  23. @change="dateType = ''"
  24. />
  25. </el-form-item>
  26. </el-form>
  27. <el-form :model="chartForm" class="demo-form-inline" :inline="true">
  28. <el-form-item label="团队:">
  29. <el-select
  30. v-model="chartForm.team"
  31. placeholder="请选择"
  32. size="small"
  33. clearable
  34. filterable
  35. multiple
  36. >
  37. <el-option-group
  38. v-for="group in teamOptions"
  39. :key="group.label"
  40. :label="group.label"
  41. >
  42. <el-option
  43. v-for="item in group.options"
  44. :key="item.teamId"
  45. :label="item.teamName"
  46. :value="item.teamId"
  47. />
  48. </el-option-group>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item label="技术模块:">
  52. <el-cascader
  53. v-model="chartForm.moduleIds"
  54. size="small"
  55. clearable
  56. collapse-tags
  57. :props="{ multiple: true }"
  58. :options="moduleList"
  59. placeholder="请选择"
  60. />
  61. </el-form-item>
  62. <el-form-item>
  63. <el-button type="primary" size="mini" @click="onSubmit">查询</el-button>
  64. </el-form-item>
  65. </el-form>
  66. <div class="data-total">
  67. <div v-for="(item,index) in Summary" :key="'Summary'+index" class="data-item" :class="['item'+ (index + 1)]">
  68. <article>
  69. <div class="item-top">
  70. <div class="item-circle">
  71. <img v-show="index === 0" src="../../../src/assets/defect_images/add.png">
  72. <img v-show="index === 1" src="../../../src/assets/defect_images/repair.png">
  73. <img v-show="index === 2" src="../../../src/assets/defect_images/reopen.png">
  74. </div>
  75. <span>{{ item.label }}</span>
  76. <el-tooltip v-if="index === 0" class="item" effect="dark" content="统计区间内,新建的任务数量" placement="top">
  77. <i class="el-icon-info" />
  78. </el-tooltip>
  79. <el-tooltip v-if="index === 1" class="item" effect="dark" content="任务最近一次更新状态为“已上线”在统计区间内,并且当前状态是“已上线”的任务数量" placement="top">
  80. <i class="el-icon-info" />
  81. </el-tooltip>
  82. <el-tooltip v-if="index === 2" class="item" effect="dark" content="任务最近一次更新状态为“Hold”在统计区间内,并且当前状态是“Hold”的任务数量" placement="top">
  83. <i class="el-icon-info" />
  84. </el-tooltip>
  85. </div>
  86. <div class="item-title" @click.stop="getRequiredNum(item)">{{ item.total }}</div>
  87. <div class="item-line" />
  88. <div v-show="Number(item.relativeRatio)>=0" class="item-up">环比:<i class="el-icon-caret-top" />{{ item.relativeRatio }}%</div>
  89. <div v-show="Number(item.relativeRatio)<0" class="item-down">环比:<i class="el-icon-caret-bottom" />{{ item.relativeRatio.substring(1,item.relativeRatio.length) }}%</div>
  90. <div v-show="item.relativeRatio === '--'" class="item-down">环比:{{ item.relativeRatio }}%</div>
  91. </article>
  92. </div>
  93. </div>
  94. <div class="chart-item bottom-padding">
  95. <h3>状态累积流量图</h3>
  96. <status-chart :chart-data="cumulativeData" @code="statusCumulativeData" @clone="openDrawer = false" />
  97. </div>
  98. </el-header>
  99. <el-main class="charts-main">
  100. <el-tabs v-model="activeTab" class="tab-change" @tab-click="onSubmit">
  101. <el-tab-pane name="1">
  102. <span slot="label" class="tab-item">累计新增</span>
  103. </el-tab-pane>
  104. <el-tab-pane name="2">
  105. <span slot="label" class="tab-item">累计上线</span>
  106. </el-tab-pane>
  107. </el-tabs>
  108. <div class="chart-item">
  109. <h3 v-show="activeTab === '1'">新增趋势图</h3>
  110. <h3 v-show="activeTab === '2'">上线趋势图</h3>
  111. <tendency-chart :chart-data="tendencyData" type-title="任务数量" @code="getTrendChart" @clone="openDrawer = false" />
  112. </div>
  113. <div class="chart-item">
  114. <h3>所属需求方向分布图</h3>
  115. <belong-requirement-chart :chart-data="belongRequirementData" @code="getRequirementData" @clone="openDrawer = false" />
  116. </div>
  117. <div class="chart-item">
  118. <h3>周期统计<span>(根据排期计算)</span></h3>
  119. <!-- <div class="chart-item-tip">
  120. <i class="el-icon-warning-outline" />
  121. <span>仅统计状态已变更“已排期”且排期不为空的任务</span>
  122. </div> -->
  123. <cycle-statistic :chart-data="cycleData" type="task" @clickCount="clickCycleData" />
  124. </div>
  125. <div class="chart-item">
  126. <h3>周期&等待时长分布图<span>(根据排期计算)</span></h3>
  127. <!-- <div class="chart-item-tip">
  128. <i class="el-icon-warning-outline" />
  129. <span>仅统计状态已变更“已排期”且排期不为空的任务;横坐标表示任务交付日期,纵坐标代表研发交付周期(研发、联调、上线类型排期的总周期)</span>
  130. </div> -->
  131. <development-cycle
  132. id="102"
  133. :chart-data="developmentCycleData"
  134. type="task"
  135. :graph-type.sync="graphType"
  136. :graph-type-list="graphTypeList"
  137. @change="getDevelopmentCycle()"
  138. />
  139. </div>
  140. <div class="chart-item">
  141. <h3>人力统计<span>(根据排期计算)</span></h3>
  142. <cycle-statistic :chart-data="taskPeoplecData" type="task_a" @clickCount="getTaskPeoplecData" />
  143. </div>
  144. <div class="chart-item">
  145. <h3>人力分布图<span>(根据排期计算)</span></h3>
  146. <development-cycle
  147. id="105"
  148. :chart-data="developmentTaskPeopleData"
  149. type="task"
  150. :graph-type.sync="graphTypes"
  151. :graph-type-list="peopleTypeList"
  152. @change="getManpowerDistributedData()"
  153. />
  154. </div>
  155. <div class="chart-item">
  156. <h3>任务分布图</h3>
  157. <distribution-chart
  158. :chart-data="distributeData"
  159. :status-list="distributeStatusList"
  160. :status.sync="distributeStatus"
  161. :active-tab="activeTab"
  162. @change="getDistributeData()"
  163. @code="getTaskDat"
  164. @state="getStatusType"
  165. @clone="openDrawer = false"
  166. />
  167. </div>
  168. <div class="chart-item">
  169. <h3>状态停留分布图</h3>
  170. <status-stay-chart :chart-data="statusStayData" @code="statusStayChart" @clone="openDrawer = false" />
  171. </div>
  172. <div class="chart-item">
  173. <h3>模块分布图</h3>
  174. <belong-chart :chart-data="moduleDistributeData" @code="getModuleDistribute" @clone="openDrawer = false" />
  175. </div>
  176. <div class="chart-item">
  177. <h3>排期发生变更的任务(<span class="strong-font">{{ changeTotal }}</span>个)</h3>
  178. <change-require-chart :chart-data="changeTaskData" type-name="任务" />
  179. </div>
  180. <div class="chart-item">
  181. <h3>报告统计</h3>
  182. <cycle-statistic :chart-data="reportSummaryData" child-data="relativeRatio" :show-tips="false" @clickCount="clickCount" />
  183. </div>
  184. <div class="chart-item">
  185. <h3>缺陷统计</h3>
  186. <bug-list :chart-data="bugListData" @requireBug="clickCountStr" />
  187. </div>
  188. </el-main>
  189. <div @click.stop>
  190. <drawer-all v-if="openDrawer" :drawer="openDrawer" :data="requireList" :status="reqStatus" @clone="clone" />
  191. </div>
  192. </el-container>
  193. </div>
  194. </template>
  195. <script>
  196. import moment from 'moment'
  197. moment.locale('zh-cn')
  198. import { mapGetters } from 'vuex'
  199. import { settingQueryBizModuleList } from '@/api/defectManage'
  200. import { teamQueryTeamInfoList } from '@/api/configure'
  201. import {
  202. getSummary,
  203. getCumulativeFlowDiagram,
  204. getTaskCountTrend,
  205. getRequirementOrientationDistributeData,
  206. getTaskPeriodicData,
  207. getTaskRdDeliveryPeriodicData,
  208. getDistributeData,
  209. getStatusStayData,
  210. getModuleDistributeData,
  211. getTaskUnlockData,
  212. getReportSummary,
  213. getBugStatisticData,
  214. getManpowerStatistics,
  215. getManpowerDistributedData
  216. } from '@/api/statisticsApi/taskStatistics'
  217. import statusChart from './components/statusChart'
  218. import tendencyChart from './components/tendencyChart'
  219. import belongRequirementChart from './components/belongRequirementChart'
  220. import cycleStatistic from './components/cycleStatistic'
  221. import developmentCycle from './components/developmentCycle'
  222. import distributionChart from './components/distributionChart'
  223. import statusStayChart from './components/statusStayChart'
  224. import belongChart from './components/belongChart'
  225. import changeRequireChart from './components/changeRequireChart'
  226. import bugList from './components/bugList'
  227. import drawerAll from './components/drawerAll'
  228. export default {
  229. components: {
  230. statusChart,
  231. tendencyChart,
  232. belongRequirementChart,
  233. cycleStatistic,
  234. developmentCycle,
  235. distributionChart,
  236. statusStayChart,
  237. belongChart,
  238. changeRequireChart,
  239. bugList,
  240. drawerAll
  241. },
  242. data() {
  243. return {
  244. requireList: {},
  245. reqStatus: '',
  246. bugCountTimeType: 1, // 获取趋缺陷势图数据接口入参:1本周 2本月 3本年
  247. timeTypeList: [ // 日期选择
  248. { code: 1, label: '周' },
  249. { code: 2, label: '月' },
  250. { code: 3, label: '年' }
  251. ],
  252. openDrawer: false,
  253. teamOptions: [], // 团队列表
  254. chartForm: {}, // 筛选表单
  255. stratAndEnd: [], // 开始结束日期
  256. dateType: 'week', // 时间选择类型
  257. moduleList: [], // 任务方向列表
  258. Summary: [], // 顶部数据
  259. activeTab: '1', // tab标签
  260. cumulativeData: null, // 任务状态累计流数据
  261. tendencyData: null, // 趋势图数据
  262. belongRequirementData: null, // 所属需求方向分布图
  263. cycleData: [], // 周期统计数据
  264. taskPeoplecData: [], // 任务人力统计
  265. graphTypes: -1, // 任务人力分布图默认
  266. graphType: 4, // 周期分布图选项
  267. graphTypeList: [// 周期分布图选项列表
  268. { code: 4, label: '研发交付周期' },
  269. { code: 5, label: '研发周期' },
  270. { code: 6, label: '测试周期' },
  271. { code: 7, label: '提测等待测试时长' }
  272. ],
  273. developmentCycleData: [], // 研发交付周期分布数据
  274. developmentTaskPeopleData: [], // 人力分布图
  275. distributeStatus: 1, // 任务分布图任务状态
  276. distributeStatusList: [
  277. { code: 1, label: '任务状态' },
  278. { code: 2, label: '任务等级' },
  279. { code: 3, label: '开发负责人' },
  280. { code: 4, label: '测试负责人' },
  281. { code: 5, label: '跟版客户端' },
  282. { code: 6, label: '直接归属' }
  283. ], // 任务分布图任务状态列表
  284. peopleTypeList: [ // 人力分布图选项列表
  285. { code: -1, label: '排期使用人力' },
  286. { code: 0, label: '开发类型排期使用人力' },
  287. { code: 1, label: '用例类型排期使用人力' },
  288. { code: 2, label: '联调类型排期使用人力' },
  289. { code: 3, label: '提测类型排期使用人力' },
  290. { code: 4, label: '测试类型排期使用人力 ' },
  291. { code: 5, label: '准出类型排期使用人力 ' },
  292. { code: 6, label: '上线类型排期使用人力 ' },
  293. { code: 7, label: '其他 ' }
  294. ],
  295. moduleDistributeData: null, // 任务模块分布
  296. distributeData: null, // 任务分布图数据
  297. statusStayData: null, // 状态停留图数据
  298. moduleDistribute: null, // 模块分布图数据
  299. changeTaskData: null, // 排期变更任务数据
  300. changeTotal: 0, // 变更总数
  301. reportSummaryData: null, // 报告统计数据
  302. bugListData: {} // 缺陷统计数据
  303. }
  304. },
  305. computed: {
  306. ...mapGetters(['bizId']),
  307. globalParams: { // 通用接口参数
  308. get() {
  309. const moduleIds = this.chartForm.moduleIds
  310. const team = this.chartForm.team
  311. const params = {
  312. startTime: this.stratAndEnd[0] || null,
  313. endTime: this.stratAndEnd[1] || null,
  314. bizId: this.bizId,
  315. teamIds: team && team.length > 0 ? team : null,
  316. moduleIds: moduleIds && moduleIds.length > 0 ? moduleIds : null
  317. }
  318. return params
  319. }
  320. },
  321. timeType: {
  322. get() {
  323. let timeType = 0
  324. switch (this.dateType) {
  325. case 'week':
  326. timeType = 1
  327. break
  328. case 'month':
  329. timeType = 2
  330. break
  331. case 'year':
  332. timeType = 3
  333. break
  334. default:
  335. timeType = 0
  336. break
  337. }
  338. return timeType
  339. }
  340. }
  341. },
  342. watch: {
  343. bizId: {
  344. handler(newV) {
  345. if (newV === -1) return
  346. this.init()
  347. },
  348. immediate: true
  349. }
  350. },
  351. created() {
  352. this.$store.state.data.status = true
  353. },
  354. methods: {
  355. async init() {
  356. this.setDate(this.dateType)
  357. this.getTeamList()
  358. this.getMoudlesList()
  359. },
  360. onSubmit() {
  361. if (this.activeTab === '2' && this.distributeStatus === 1) {
  362. this.distributeStatus = 2
  363. }
  364. this.getSummary()
  365. this.getCumulativeFlowDiagram()
  366. this.getTaskCountTrend()
  367. this.getBelongRequirementData()
  368. this.getCycleData()
  369. this.getManpowerStatistics()
  370. this.getDevelopmentCycle()
  371. this.getManpowerDistributedData()
  372. this.getModuleDistributeData()
  373. this.getDistributeData()
  374. this.getStatusStayData()
  375. this.getTaskUnlockData()
  376. this.getReportSummary()
  377. this.getBugStatisticData()
  378. },
  379. setDate(type) { // 日期筛选
  380. let startDate = null
  381. let endDate = null
  382. switch (type) {
  383. case 'week':
  384. startDate = moment().startOf('week').format('YYYY.MM.DD')
  385. endDate = moment().endOf('week').format('YYYY.MM.DD')
  386. this.bugCountTimeType = this.timeTypeList[0].code
  387. break
  388. case 'month':
  389. startDate = moment().startOf('month').format('YYYY.MM.DD')
  390. endDate = moment().endOf('month').format('YYYY.MM.DD')
  391. this.bugCountTimeType = this.timeTypeList[1].code
  392. break
  393. case 'year':
  394. startDate = moment().startOf('year').format('YYYY.MM.DD')
  395. endDate = moment().endOf('year').format('YYYY.MM.DD')
  396. this.bugCountTimeType = this.timeTypeList[2].code
  397. break
  398. }
  399. this.stratAndEnd = [startDate, endDate]
  400. this.onSubmit()
  401. },
  402. async getMoudlesList() { // 技术模块
  403. const res = await settingQueryBizModuleList(this.bizId)
  404. if (res.code === 200) {
  405. this.moduleList = this.handlerModules(res.data)
  406. }
  407. },
  408. handlerModules(arr) {
  409. return arr.map(item => ({
  410. ...item,
  411. value: item.id,
  412. label: item.moduleName,
  413. children: item.childModules.length ? this.handlerModules(item.childModules) : null
  414. }))
  415. },
  416. async getTeamList() { // 获取我的团队和所有团队
  417. const myRes = await teamQueryTeamInfoList({ type: 0 })// 我的团队
  418. const allRes = await teamQueryTeamInfoList({ type: 1 })// 所有团队
  419. this.teamOptions = [
  420. { label: '我的团队', options: [...myRes.data.list] },
  421. { label: '全部团队', options: [...allRes.data.list] }
  422. ]
  423. },
  424. async getSummary() { // 获取顶部数据
  425. const res = await getSummary(this.globalParams)
  426. if (res.code === 200) this.Summary = res.data || []
  427. },
  428. async getTaskCountTrend() { // 趋势图日期变动
  429. const params = {
  430. ...this.globalParams,
  431. type: Number(this.activeTab),
  432. timeType: this.timeType
  433. }
  434. const res = await getTaskCountTrend(params)
  435. if (res.code === 200) this.tendencyData = res.data
  436. },
  437. async getBelongRequirementData() { // 所属需求方向分布图
  438. const params = {
  439. ...this.globalParams,
  440. type: Number(this.activeTab)
  441. }
  442. const res = await getRequirementOrientationDistributeData(params)
  443. if (res.code === 200) this.belongRequirementData = res.data
  444. },
  445. async getCumulativeFlowDiagram() { // 任务状态累计流图
  446. const params = {
  447. ...this.globalParams,
  448. timeType: this.timeType
  449. }
  450. const res = await getCumulativeFlowDiagram(params)
  451. if (res.code === 200) this.cumulativeData = res.data
  452. },
  453. async getManpowerStatistics() { // 获取任务人力统计
  454. const params = {
  455. ...this.globalParams,
  456. type: Number(this.activeTab)
  457. }
  458. const res = await getManpowerStatistics(params)
  459. if (res.code === 200) this.taskPeoplecData = res.data
  460. },
  461. async getManpowerDistributedData() { // 人力分布图
  462. const params = {
  463. ...this.globalParams,
  464. type: Number(this.activeTab),
  465. graphType: this.graphTypes,
  466. timeType: this.timeType
  467. }
  468. const res = await getManpowerDistributedData(params)
  469. if (res.code === 200) {
  470. res.data.length > 0
  471. ? this.developmentTaskPeopleData = res.data
  472. : this.developmentTaskPeopleData = [moment().format('YYYY-MM-DD'), '0']
  473. }
  474. },
  475. async getCycleData() { // 周期统计数据
  476. const params = {
  477. ...this.globalParams,
  478. type: Number(this.activeTab)
  479. }
  480. const res = await getTaskPeriodicData(params)
  481. if (res.code === 200) this.cycleData = res.data
  482. },
  483. async getDevelopmentCycle() { // 获取研发交付周期分布数据
  484. const params = {
  485. ...this.globalParams,
  486. type: Number(this.activeTab),
  487. graphType: this.graphType
  488. }
  489. const res = await getTaskRdDeliveryPeriodicData(params)
  490. if (res.code === 200) {
  491. res.data.length > 0
  492. ? this.developmentCycleData = res.data
  493. : this.developmentCycleData = [moment().format('YYYY-MM-DD'), '0']
  494. }
  495. },
  496. async getDistributeData() { // 获取任务分布图
  497. this.openDrawer = false
  498. const params = {
  499. ...this.globalParams,
  500. type: Number(this.activeTab),
  501. distributeType: this.distributeStatus
  502. }
  503. const res = await getDistributeData(params)
  504. if (res.code === 200) this.distributeData = res.data
  505. },
  506. async getStatusStayData() { // 状态停留时长分布
  507. const params = {
  508. ...this.globalParams,
  509. type: Number(this.activeTab)
  510. }
  511. const res = await getStatusStayData(params)
  512. if (res.code === 200) this.statusStayData = res.data
  513. },
  514. async getModuleDistributeData() { // 获取模块分布
  515. const params = {
  516. ...this.globalParams,
  517. type: Number(this.activeTab)
  518. }
  519. const res = await getModuleDistributeData(params)
  520. if (res.code === 200) this.moduleDistributeData = this.handlerData(res.data)
  521. },
  522. handlerData(arr) { // 处理任务模块分布图数据
  523. const bfs = (arr) => {
  524. for (const item of arr) {
  525. if (item.children && item.children.length > 0) {
  526. delete item.value
  527. bfs(item.children)
  528. } else {
  529. delete item.children
  530. }
  531. }
  532. }
  533. bfs(arr)
  534. return { children: arr, name: '模块分布' }
  535. },
  536. async getTaskUnlockData() { // 排期发生变更的任务
  537. const params = {
  538. ...this.globalParams,
  539. type: Number(this.activeTab),
  540. distributeType: this.distributeStatus
  541. }
  542. const res = await getTaskUnlockData(params)
  543. if (res.code === 200) {
  544. this.changeTaskData = res.data || []
  545. this.changeTotal = this.changeTaskData.length
  546. }
  547. },
  548. async getReportSummary() { // 报告统计
  549. const params = { ...this.globalParams, type: Number(this.activeTab) }
  550. const res = await getReportSummary(params)
  551. if (res.code === 200) this.reportSummaryData = res.data
  552. },
  553. async getBugStatisticData() { // 缺陷统计
  554. const params = { ...this.globalParams, type: Number(this.activeTab) }
  555. const res = await getBugStatisticData(params)
  556. if (res.code === 200) this.bugListData = res.data
  557. },
  558. getStatusType(e) {
  559. this.reqStatus = e
  560. },
  561. mapData(data) {
  562. const arr = []
  563. data.map(item => {
  564. arr.push(item.label.substr(2))
  565. })
  566. return arr
  567. },
  568. getRequiredNum(value) {
  569. value.title = value.label
  570. value.toType = '任务'
  571. this.requireList = { ...value, ...this.Summary }
  572. this.openDrawer = true
  573. },
  574. getModuleDistribute(value, data) {
  575. if (value.data === undefined) {
  576. this.clone()
  577. return
  578. }
  579. value.title = '模块分布图数据'
  580. value.xaxis = ['全部']
  581. this.requireList = { ...value, ...data, name: value.data.data ? value.data.data.name : value.data._origin.name }
  582. this.openDrawer = true
  583. },
  584. statusCumulativeData(value, option, data) {
  585. value.title = '状态累积流量图数据'
  586. value.toType = '任务'
  587. value.towTimeLine = option.legend.data
  588. value.statusList = this.cumulativeData
  589. this.requireList = { ...value, xaxis: data[0].dayTime }
  590. this.openDrawer = true
  591. },
  592. getRequirementData(value, data) {
  593. value.title = '所属需求方向分布图数据'
  594. value.toType = '需求'
  595. this.requireList = { ...value, ...data }
  596. this.openDrawer = true
  597. },
  598. getTrendChart(value, option, data) {
  599. const titArr = ['占位', '新增趋势图', '上线趋势图']
  600. value.title = titArr[Number(this.activeTab)] + '数据'
  601. value.toType = '任务'
  602. this.requireList = { ...value, ...data }
  603. this.openDrawer = true
  604. },
  605. clickCycleData(value, data) {
  606. value.title = '周期统计数据'
  607. value.toType = '任务'
  608. value.xaxis = this.mapData(data)
  609. value.yaxis = data
  610. this.requireList = value
  611. this.openDrawer = true
  612. },
  613. getTaskPeoplecData(value, data) {
  614. value.title = '人力统计数据'
  615. value.toType = '任务'
  616. value.xaxis = this.mapData(data)
  617. value.yaxis = data
  618. this.requireList = value
  619. this.openDrawer = true
  620. },
  621. clickCountStr(value) { // 需求bug 浮层数据
  622. value.title = '缺陷统计数据'
  623. value.xaxis = ['全部', 'P0', 'P1', 'P2', 'P3']
  624. this.requireList = value
  625. this.openDrawer = true
  626. window.log({ c: 'statistic', d: 'task_defect_statistics_data' })
  627. },
  628. clickCount(value, data) {
  629. value.title = '报告统计数据'
  630. value.xaxis = ['全部', '提测报告', '测试日报', '准出报告']
  631. this.requireList = { ...value, reportData: data }
  632. this.openDrawer = true
  633. window.log({ c: 'statistic', d: 'task_report_statistics_data' })
  634. },
  635. getTaskDat(value) {
  636. value.title = '任务分布图数据'
  637. value.toType = '任务'
  638. this.requireList = { ...value, ...this.distributeData }
  639. this.openDrawer = true
  640. window.log({ c: 'statistic', d: 'task_distribution_data' })
  641. },
  642. statusStayChart(value, list, data) {
  643. value.title = '状态停留分布图数据'
  644. value.toType = '任务'
  645. value.towTimeLine = list
  646. value.statusList = data
  647. this.requireList = { ...value, xaxis: data.xaxis }
  648. this.openDrawer = true
  649. window.log({ c: 'statistic', d: 'task_state_stay_data' })
  650. },
  651. clone(v) {
  652. this.openDrawer = false
  653. }
  654. }
  655. }
  656. </script>
  657. <style lang="scss" scoped>
  658. .defect-container {
  659. width: 100%;
  660. height:100%;
  661. background:#F2F3F6;
  662. display: inline-block;
  663. color: #666666;
  664. h3 {
  665. font-size: 18px;
  666. margin: 0;
  667. padding: 0;
  668. span {
  669. font-size: 14px;
  670. color: #666666;
  671. }
  672. }
  673. .defect-main {
  674. padding: 20px 20px 0 20px;
  675. height:100%;
  676. width:auto;
  677. background:#ffffff;
  678. margin: 10px;
  679. border-radius: 4px;
  680. .date-select {
  681. line-height: 20px;
  682. display: inline-block;
  683. .date-item {
  684. display: inline-block;
  685. width: 40px;
  686. text-align: center;
  687. cursor: pointer;
  688. border-radius: 2px;
  689. }
  690. .date-active {
  691. color: #FFFFFF;
  692. background-color: #409EFF;
  693. }
  694. }
  695. }
  696. }
  697. .data-total {
  698. display: grid;
  699. width: 100%;
  700. margin: auto;
  701. grid-template-columns: repeat(3,25%);
  702. grid-gap: 12.5%;
  703. padding-bottom: 40px;
  704. ul,li{
  705. padding:0;margin:0;list-style:none
  706. }
  707. .data-item {
  708. position: relative;
  709. width: 100%;
  710. border-radius: 8px;
  711. article {
  712. display: flex;
  713. flex-direction: column;
  714. align-items: flex-start;
  715. color: #FFFFFF;
  716. }
  717. .item-top {
  718. width: 100%;
  719. display: flex;
  720. align-items: center;
  721. padding: 10px 20px;
  722. font-size: 13px;
  723. .item-circle {
  724. height: 36px;
  725. width: 36px;
  726. border-radius: 50%;
  727. background:rgba(255,255,255,0.24);
  728. margin-right: 10px;
  729. display: flex;
  730. justify-content: center;
  731. align-items: center;
  732. img {
  733. height: 20px;
  734. width: 20px;
  735. }
  736. }
  737. span {
  738. margin-right: 5px;
  739. }
  740. }
  741. .item-line {
  742. width: 100%;
  743. border-bottom:1px solid rgba(255,255,255,0.2);
  744. }
  745. .item-title {
  746. font-size: 40px;
  747. padding: 5% 20px;
  748. cursor: pointer;
  749. }
  750. .item-up,.item-down {
  751. font-size: 13px;
  752. padding: 10px 20px 0 20px;
  753. margin-bottom: 20px;
  754. }
  755. .item-up i {
  756. color:#F32850
  757. }
  758. .item-down i {
  759. color:#9FFF39
  760. }
  761. }
  762. .item1 {
  763. background-image: url('../../../src/assets/defect_images/数据1.png');
  764. background-size: 100% 100%;
  765. background-position: 50% 50%;
  766. box-shadow:0px 50px 24px -25px rgba(64,137,255,0.30);
  767. }
  768. .item2 {
  769. background-image: url('../../../src/assets/defect_images/数据2.png');
  770. background-size: 100% 100%;
  771. background-position: 50% 50%;
  772. box-shadow:0px 50px 24px -25px rgba(78,188,250,0.40);
  773. }
  774. .item3 {
  775. background-image: url('../../../src/assets/defect_images/数据3.png');
  776. background-size: 100% 100%;
  777. background-position: 50% 50%;
  778. box-shadow:0px 50px 24px -25px rgba(255,136,134,0.30);
  779. }
  780. .item4 {
  781. background-image: url('../../../src/assets/defect_images/数据4.png');
  782. background-size: 100% 100%;
  783. background-position: 50% 50%;
  784. box-shadow:0px 50px 24px -25px rgba(83,97,255,0.30);
  785. }
  786. }
  787. .bottom-padding {
  788. padding-bottom: 30px;
  789. }
  790. .charts-main {
  791. padding-bottom: 20px;
  792. width:auto;
  793. background:#ffffff;
  794. margin: 10px;
  795. border-radius: 4px;
  796. .chart-item {
  797. margin-bottom: 30px;
  798. }
  799. .tab-change {
  800. overflow: hidden;
  801. }
  802. .chart-item-tip {
  803. padding: 6px 10px;
  804. margin-top: 5px;
  805. font-size: 12px;
  806. color: #444444;
  807. background: rgba(230, 162, 61, 0.1);
  808. border: 2px;
  809. i {
  810. margin-right: 10px;
  811. }
  812. }
  813. }
  814. .strong-font {
  815. color: #F01A1A !important;
  816. font-size: 18px !important;
  817. }
  818. /deep/.el-tabs__nav-wrap:after {
  819. background-color: #E4E7ED !important;
  820. }
  821. </style>