drawerAll.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. <template>
  2. <el-drawer v-if="drawer_" :title="Statistics.title" :visible.sync="drawer_" :direction="direction" :modal="false" class="drawer-box" size="100%" :before-close="handleClose">
  3. <div v-if="Statistics.title === '任务分布图数据'" class="qz-drawer-grade">按任务等级分布</div>
  4. <div v-if="Statistics.title === '分布图数据'" class="qz-drawer-grade-tow">按缺陷等级分布</div>
  5. <div>
  6. <div v-if="Statistics.title !== '模块分布数据' && Statistics.title !== '需求方向分布图数据' && Statistics.title !== '责任人分布数据' && Statistics.title !== `模块分布图数据` && show === true " :class="[Statistics.towTimeLine ? 'qz-drawer-padding' : 'qz-drawer-padding-s', 'qz-drawer-header']">
  7. <div id="index" class="qz-drawer-scll">
  8. <timeline :data="list" :num="defaultKey" :bgmargin="bgMargin" @update="getvalue" />
  9. </div>
  10. <div v-if="Statistics.towTimeLine" id="index1" class="qz-drawer-scll">
  11. <timeline :data="Statistics.towTimeLine" :num="defaultKey2" :bgmargin="bgMargin" @update="getvalueTow" />
  12. </div>
  13. </div>
  14. <div v-if="Statistics.title === '需求分布图数据' || Statistics.title === '任务分布图数据'" class="qz-drawer-H"><span>{{ status }}</span>为<span>{{ type }}</span>的{{ Statistics.toType }}</div>
  15. <div v-if="Statistics.title === '状态停留分布图数据'" class="qz-drawer-H">在<span>{{ type }}</span>状态停留时长为<span>{{ typeTow }}</span>的{{ Statistics.toType }}</div>
  16. <div v-if="Statistics.title === '模块分布数据'" class="qz-drawer-H qz-margin-H"> 模块<span>{{ Statistics.name }}</span>的缺陷</div>
  17. <div v-if="Statistics.title === `${Statistics.qz_holiday}的修复时长区间数据`" class="qz-drawer-H qz-margin-H">{{ Statistics.qz_holiday }}修复时间区间为<span>{{ type }}</span>的<span>{{ typeTow }}</span>级缺陷</div>
  18. <div v-if="Statistics.title === `状态累积流量图数据`" class="qz-drawer-H qz-margin-H"><span>{{ type }}</span>流入到<span>{{ typeTow }}</span>的{{ Statistics.toType }}</div>
  19. <div v-if="Statistics.title === `需求方向分布图数据` || Statistics.title === '所属需求方向分布图数据'" class="qz-drawer-H qz-margin-H">需求方向为<span>{{ type }}</span>的{{ Statistics.toType }}</div>
  20. <div v-if="Statistics.title === `责任人分布数据`" class="qz-drawer-H qz-margin-H">责任人<span>{{ type }}</span>的缺陷</div>
  21. <div v-if="Statistics.title === `趋势图数据`" class="qz-drawer-H qz-margin-H"><span>{{ type }}</span>新增的缺陷</div>
  22. <div v-if="Statistics.title === `模块分布图数据`" class="qz-drawer-H qz-margin-H">模块为<span>{{ type }}</span>的任务</div>
  23. <div v-if="Statistics.title === '新增趋势图数据' && Statistics.toType === '任务' || Statistics.title === '上线趋势图数据' && Statistics.toType === '任务'" class="qz-drawer-H qz-margin-H"><span>{{ type }}</span>{{ Statistics.title.substring(0, Statistics.title.length - 5 ) }}的任务</div>
  24. <div v-if="Statistics.toType === '需求' && Statistics.title === '新增趋势图数据' || Statistics.title === '上线趋势图数据' && Statistics.toType === '需求' || Statistics.title === 'PRD评审趋势图数据' || Statistics.title === '技术准入趋势图数据'" class="qz-drawer-H qz-margin-H"><span>{{ type }}</span>{{ Statistics.title.substring(0, Statistics.title.length - 5 ) }}的需求</div>
  25. <qzTable
  26. :data="tableData"
  27. :title="Statistics.title"
  28. :type="Statistics.title === '需求分布图数据' || Statistics.title === '任务分布图数据' || Statistics.title === '分布图数据' ? status : Statistics.toType"
  29. :oftype="type"
  30. :mintitle="Statistics.title === '周期统计数据' || Statistics.title === '人力统计数据' ? min_title : ''"
  31. />
  32. </div>
  33. <div class="qz-footer-laout">
  34. <div style="line-height: 60px;">
  35. <el-button type="primary" size="mini" @click="exportTable">导 出</el-button>
  36. </div>
  37. <el-pagination
  38. :current-page.sync="currentPage"
  39. :page-size="10"
  40. :pager-count="5"
  41. layout="total, prev, pager, next, jumper"
  42. :total="total"
  43. @size-change="handleSizeChange"
  44. @current-change="handleCurrentChange"
  45. />
  46. </div>
  47. </el-drawer>
  48. </template>
  49. <script>
  50. import { getRequirement, requirementDownload } from '@/api/requirement.js'
  51. import { taskList, taskDownload } from '@/api/taskIndex'
  52. import { bugList, bugDownload } from '@/api/defectManage'
  53. import { getReportList } from '@/api/reportTemplate'
  54. import timeline from '@/components/timeline'
  55. import qzTable from './tables'
  56. export default {
  57. components: { timeline, qzTable },
  58. props: {
  59. data: { type: Object, required: true },
  60. drawer: { type: Boolean, default: false },
  61. status: { type: String, default: '' }
  62. },
  63. data() {
  64. return {
  65. list: [],
  66. show: true,
  67. responseDownload: '',
  68. min_title: '', // 周期统计表头标题
  69. bgMargin: false,
  70. dataList: [],
  71. Statistics: {}, // title
  72. direction: 'rtl',
  73. defaultKey2: 0,
  74. defaultKey: 0,
  75. bugList: [],
  76. type: '',
  77. typeTow: '',
  78. towVal: '',
  79. oneVal: '',
  80. currentPage: 1,
  81. total: 0,
  82. reportData: {},
  83. paging: {
  84. curIndex: 1, // 分页
  85. pageSize: 10 // 分页
  86. },
  87. tableData: []
  88. }
  89. },
  90. computed: {
  91. drawer_: {
  92. get() { return this.drawer },
  93. set(v) { this.$emit('clone', v) }
  94. }
  95. },
  96. watch: {
  97. data: {
  98. handler(newV, oldV) {
  99. console.log(newV, '刚进来')
  100. if (newV) {
  101. this.Statistics = newV
  102. this.list = newV.xaxis
  103. this.type = newV.name
  104. this.bgMargin = false
  105. this.currentPage = 1
  106. this.paging = { curIndex: 1, pageSize: 10 }
  107. this.setDrawerDate()
  108. }
  109. },
  110. immediate: true
  111. }
  112. },
  113. mounted() {
  114. // this.$nextTick(() => {
  115. // const dateId = document.getElementById('index')
  116. // dateId.scrollLeft = Number(this.defaultKey) * 100 - 60
  117. // })
  118. },
  119. methods: {
  120. setDrawerDate() {
  121. this.show = true
  122. if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === '所属需求方向分布图数据' || this.Statistics.title === '趋势图数据') {
  123. this.defaultKey = this.Statistics.dataIndex
  124. this.dataList = this.Statistics.yaxis[0].idList[this.defaultKey]
  125. this.getTableData(this.dataList)
  126. } else if (this.Statistics.title === '责任人分布数据') {
  127. this.dataList = this.Statistics[this.Statistics.key].idList
  128. this.getTableData(this.dataList)
  129. } else if (this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '去除节假日的修复时长数据' || this.Statistics.title === '周期统计数据' || this.Statistics.title === '人力统计数据' || this.Statistics.title === '平均修复时长数据') {
  130. const key = this.Statistics.title === '周期统计数据' || this.Statistics.title === '人力统计数据' ? this.Statistics.xaxis.indexOf(this.Statistics.label.substr(2)) : this.Statistics.xaxis.indexOf(this.Statistics.label)
  131. this.Statistics.title === '周期统计数据' || this.Statistics.title === '人力统计数据' ? this.min_title = this.Statistics.label.substr(2) : ''
  132. this.defaultKey = key === -1 ? 0 : key
  133. this.dataList = this.Statistics.idList
  134. this.getTableData(this.dataList)
  135. } else if (this.Statistics.title === '状态累积流量图数据') {
  136. this.bgMargin = true
  137. this.typeTow = this.Statistics.seriesName
  138. this.defaultKey = this.Statistics.dataIndex
  139. this.defaultKey2 = Number(this.Statistics.seriesIndex)
  140. const statusArr = this.Statistics.statusList[this.Statistics.seriesName]
  141. this.dataList = statusArr[this.defaultKey].idList
  142. this.getTableData(this.dataList)
  143. } else if (this.Statistics.title === '状态停留分布图数据') {
  144. this.bgMargin = true
  145. this.typeTow = this.Statistics.seriesName // 停留时长
  146. this.defaultKey = this.Statistics.dataIndex
  147. this.defaultKey2 = Number(this.Statistics.seriesIndex)
  148. this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
  149. this.getTableData(this.dataList)
  150. } else if (this.Statistics.title === '报告统计数据') {
  151. const key = this.Statistics.xaxis.indexOf(this.Statistics.label)
  152. this.defaultKey = key === -1 ? 0 : key
  153. this.Statistics.label === '总数' ? this.getIdList({ deliverTestReportIdList: this.Statistics.subCountList[0].idList, dailyReportIdList: this.Statistics.subCountList[1].idList, releaseReportIdList: this.Statistics.subCountList[2].idList }) : ''
  154. key === 1 ? this.getIdList({ deliverTestReportIdList: this.Statistics.subCountList[0].idList }) : '' // 提测
  155. key === 2 ? this.getIdList({ dailyReportIdList: this.Statistics.subCountList[0].idList }) : '' // 日报
  156. key === 3 ? this.getIdList({ releaseReportIdList: this.Statistics.subCountList[0].idList }) : '' // 准出
  157. } else if (this.Statistics.title === '模块分布数据') {
  158. this.getTableData(this.Statistics.newData.idList)
  159. } else if (this.Statistics.title === '需求方向分布图数据' || this.Statistics.title === `模块分布图数据`) {
  160. this.mapChildren(this.Statistics)
  161. } else if (this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据`) {
  162. this.bgMargin = true
  163. this.typeTow = this.Statistics.seriesName
  164. this.defaultKey = this.Statistics.dataIndex
  165. this.defaultKey2 = Number(this.Statistics.seriesIndex)
  166. this.dataList = this.Statistics.series[this.defaultKey2].idList[this.defaultKey]
  167. this.getTableData(this.dataList)
  168. } else if (this.Statistics.title === '新增趋势图数据' || this.Statistics.title === '上线趋势图数据' || this.Statistics.title === 'PRD评审趋势图数据' || this.Statistics.title === '技术准入趋势图数据') {
  169. this.defaultKey = this.Statistics.dataIndex
  170. this.defaultKey2 = this.Statistics.seriesIndex
  171. this.dataList = this.Statistics.yaxis[0].idList[this.defaultKey]
  172. this.getTableData(this.dataList)
  173. } else if (this.Statistics.title === '累计新增' || this.Statistics.title === 'PRD评审通过' || this.Statistics.title === '技术准入' || this.Statistics.title === '累计上线' || this.Statistics.title === '累计hold' || this.Statistics.title === '累计修复' || this.Statistics.title === '累计reopen') {
  174. this.show = false
  175. this.dataList = this.Statistics.idList
  176. this.getTableData(this.dataList)
  177. } else if (this.Statistics.title === '新增缺陷' || this.Statistics.title === '缺陷修复时长') {
  178. this.defaultKey = this.Statistics.dataIndex
  179. this.dataList = this.Statistics.yaxis[this.defaultKey]
  180. this.getTableData(this.dataList)
  181. } else if (this.Statistics.title === '缺陷24小时修复') {
  182. this.bgMargin = true
  183. this.defaultKey = this.Statistics.dataIndex
  184. this.defaultKey2 = this.Statistics.dataIndex
  185. const listData = this.Statistics.yaxis[this.defaultKey]
  186. this.dataList = listData[this.defaultKey2]
  187. this.getTableData(this.dataList)
  188. }
  189. this.$nextTick(() => { // 时间轴定位
  190. const dateId = document.getElementById('index')
  191. if (dateId) {
  192. dateId.scrollLeft = Number(this.defaultKey) * 109 - 60
  193. if (this.Statistics.towTimeLine) {
  194. const dateIds = document.getElementById('index1')
  195. dateIds.scrollLeft = Number(this.defaultKey2) * 100 - 60
  196. }
  197. }
  198. })
  199. },
  200. getvalue(e) { // 时间轴one
  201. this.oneVal = e
  202. this.type = e.name
  203. this.defaultKey = e.value
  204. this.getTimeLine()
  205. },
  206. getvalueTow(e) { // 时间轴tow
  207. this.towVal = e
  208. this.typeTow = e.name
  209. this.defaultKey2 = e.value
  210. this.getTimeLine()
  211. },
  212. getTimeLine() { // 数据筛选
  213. this.dataList = []
  214. this.currentPage = 1
  215. this.paging = { curIndex: 1, pageSize: 10 }
  216. if (this.Statistics.title === '需求分布图数据' || this.Statistics.title === '任务分布图数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === '新增趋势图数据' || this.Statistics.title === '上线趋势图数据' || this.Statistics.title === 'PRD评审趋势图数据' || this.Statistics.title === '技术准入趋势图数据' || this.Statistics.title === '所属需求方向分布图数据' || this.Statistics.title === '趋势图数据') {
  217. this.dataList = this.Statistics.yaxis[0].idList[this.oneVal.value]
  218. } else if (this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '平均修复时长数据') {
  219. this.dataList = this.Statistics.yaxis[this.oneVal.value].idList
  220. } else if (this.Statistics.title === '周期统计数据' || this.Statistics.title === '人力统计数据') {
  221. this.min_title = this.type
  222. this.dataList = this.Statistics.yaxis[this.defaultKey].idList
  223. } else if (this.Statistics.title === '状态累积流量图数据') {
  224. const statusArr = this.Statistics.statusList[this.typeTow]
  225. this.dataList = statusArr[this.defaultKey].idList
  226. } else if (this.Statistics.title === '状态停留分布图数据') {
  227. this.dataList = this.Statistics.statusList.yaxis[this.defaultKey2].idList[this.defaultKey]
  228. } else if (this.Statistics.title === '报告统计数据') {
  229. this.defaultKey === 0 ? this.getIdList({ deliverTestReportIdList: this.Statistics.reportData[1].subCountList[0].idList, dailyReportIdList: this.Statistics.reportData[2].subCountList[0].idList, releaseReportIdList: this.Statistics.reportData[3].subCountList[0].idList }) : ''
  230. this.defaultKey === 1 ? this.getIdList({ deliverTestReportIdList: this.Statistics.reportData[1].subCountList[0].idList }) : '' // 提测
  231. this.defaultKey === 2 ? this.getIdList({ dailyReportIdList: this.Statistics.reportData[2].subCountList[0].idList }) : '' // 日报
  232. this.defaultKey === 3 ? this.getIdList({ releaseReportIdList: this.Statistics.reportData[3].subCountList[0].idList }) : '' // 准出
  233. return
  234. } else if (this.Statistics.title === '去除节假日的修复时长数据') {
  235. this.dataList = this.Statistics[this.defaultKey].idList
  236. } else if (this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据`) {
  237. this.dataList = this.Statistics.series[this.defaultKey2].idList[this.defaultKey]
  238. } else if (this.Statistics.title === '新增缺陷' || this.Statistics.title === '缺陷修复时长') {
  239. this.dataList = this.Statistics.yaxis[this.defaultKey]
  240. } else if (this.Statistics.title === '缺陷24小时修复') {
  241. const listData = this.Statistics.yaxis[this.defaultKey]
  242. this.dataList = listData[this.defaultKey2]
  243. }
  244. if (this.dataList && this.dataList[0]) { // 判断idList有没有数据
  245. this.getTableData(this.dataList)
  246. } else { // 没有数据初始化table
  247. this.tableData = []
  248. this.total = 0
  249. }
  250. },
  251. async getTableData(taskIdList) { // 获取需求、任务、缺陷表格数据
  252. if (!taskIdList || taskIdList.length <= 0) {
  253. this.tableData = []
  254. this.total = 0
  255. return
  256. }
  257. const data = { ids: taskIdList, ...this.paging }
  258. if (this.Statistics.title === '周期统计数据') { data.statisticsType = 1 }
  259. if (this.Statistics.title === '人力统计数据') { data.statisticsType = 2 }
  260. if (this.Statistics.title === '需求方向分布图数据' || this.Statistics.title === '所属需求方向分布图数据' || this.Statistics.title === '需求分布图数据' || this.Statistics.title === '状态停留分布图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '状态累积流量图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '周期统计数据' && this.Statistics.toType === '需求' || this.Statistics.title === '人力统计数据' && this.Statistics.toType === '需求' || this.Statistics.title === '新增趋势图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '上线趋势图数据' && this.Statistics.toType === '需求' || this.Statistics.title === 'PRD评审趋势图数据' || this.Statistics.title === '技术准入趋势图数据' || this.Statistics.title === '累计新增' && this.Statistics.toType === '需求' || this.Statistics.title === 'PRD评审通过' && this.Statistics.toType === '需求' || this.Statistics.title === '技术准入' && this.Statistics.toType === '需求' || this.Statistics.title === '累计上线' && this.Statistics.toType === '需求' || this.Statistics.title === '累计hold' && this.Statistics.toType === '需求') {
  261. const res = await getRequirement(data)
  262. if (res.code === 200) {
  263. this.tableData = res.data.list
  264. this.total = res.data.total
  265. }
  266. } else if (this.Statistics.title === '任务分布图数据' || this.Statistics.title === '状态停留分布图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '状态累积流量图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '新增趋势图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '上线趋势图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '人力统计数据' && this.Statistics.toType === '任务' || this.Statistics.title === '周期统计数据' && this.Statistics.toType === '任务' || this.Statistics.title === `模块分布图数据` || this.Statistics.title === '累计新增' && this.Statistics.toType === '任务' || this.Statistics.title === '技术准入' && this.Statistics.toType === '任务' || this.Statistics.title === '累计上线' && this.Statistics.toType === '任务' || this.Statistics.title === '累计hold' && this.Statistics.toType === '任务') {
  267. const res = await taskList(data)
  268. if (res.code === 200) {
  269. this.tableData = res.data
  270. this.total = res.total
  271. }
  272. } else if (this.Statistics.title === '缺陷24小时修复' || this.Statistics.title === '新增缺陷' || this.Statistics.title === '缺陷修复时长' || this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === `责任人分布数据` || this.Statistics.title === '去除节假日的修复时长数据' || this.Statistics.title === '模块分布数据' || this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据` || this.Statistics.title === '平均修复时长数据' || this.Statistics.title === '趋势图数据' || this.Statistics.title === '累计修复' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计reopen' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计新增' && this.Statistics.toType === '缺陷') {
  273. const res = await bugList(data)
  274. if (res.code === 200) {
  275. this.tableData = res.data
  276. this.total = res.total
  277. }
  278. }
  279. },
  280. async getIdList(value) {
  281. this.reportData = value
  282. const data = { ...value, ...this.paging }
  283. const res = await getReportList(data)
  284. if (res.code === 200) {
  285. this.tableData = res.data
  286. this.total = res.total
  287. }
  288. },
  289. handleSizeChange(val) {
  290. this.paging.pageSize = val
  291. this.Statistics.title === '报告统计数据' ? this.getIdList(this.reportData) : this.getTableData(this.dataList)
  292. },
  293. handleCurrentChange(val) {
  294. this.paging.curIndex = val
  295. this.Statistics.title === '报告统计数据' ? this.getIdList(this.reportData) : this.getTableData(this.dataList)
  296. },
  297. mapChildren(item) {
  298. if (this.Statistics.name === '需求方向分布' || this.Statistics.name === '模块分布') {
  299. this.dataList = []
  300. item.children.map(i => {
  301. this.dataList = this.dataList.concat(i.idList)
  302. })
  303. this.getTableData(this.dataList)
  304. return
  305. }
  306. item.children.map(i => {
  307. if (i.name === this.Statistics.name) {
  308. this.dataList = i.idList
  309. this.getTableData(this.dataList)
  310. } else {
  311. if (i.children) {
  312. this.mapChildren(i)
  313. }
  314. }
  315. })
  316. },
  317. async exportTable() {
  318. const data = { ids: this.dataList }
  319. if (this.Statistics.title === '需求方向分布图数据' || this.Statistics.title === '需求分布图数据' || this.Statistics.title === '状态停留分布图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '状态累积流量图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '周期统计数据' && this.Statistics.toType === '需求' || this.Statistics.title === '人力统计数据' && this.Statistics.toType === '需求' || this.Statistics.title === '新增趋势图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '上线趋势图数据' && this.Statistics.toType === '需求' || this.Statistics.title === '所属需求方向分布图数据' || this.Statistics.title === 'PRD评审趋势图数据' || this.Statistics.title === '技术准入趋势图数据' || this.Statistics.title === '累计新增' && this.Statistics.toType === '需求' || this.Statistics.title === '技术准入' && this.Statistics.toType === '需求' || this.Statistics.title === '累计上线' && this.Statistics.toType === '需求' || this.Statistics.title === '累计hold' && this.Statistics.toType === '需求') {
  320. this.responseDownload = await requirementDownload(data)
  321. } else if (this.Statistics.title === '任务分布图数据' || this.Statistics.title === '状态停留分布图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '状态累积流量图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '新增趋势图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '上线趋势图数据' && this.Statistics.toType === '任务' || this.Statistics.title === '人力统计数据' && this.Statistics.toType === '任务' || this.Statistics.title === '周期统计数据' && this.Statistics.toType === '任务' || this.Statistics.title === `模块分布图数据` || this.Statistics.title === '累计新增' && this.Statistics.toType === '任务' || this.Statistics.title === '技术准入' && this.Statistics.toType === '任务' || this.Statistics.title === '累计上线' && this.Statistics.toType === '任务' || this.Statistics.title === '累计hold' && this.Statistics.toType === '任务') {
  322. this.responseDownload = await taskDownload(data)
  323. } else if (this.Statistics.title === '缺陷统计数据' || this.Statistics.title === '分布图数据' || this.Statistics.title === `责任人分布数据` || this.Statistics.title === '去除节假日的修复时长数据' || this.Statistics.title === '模块分布数据' || this.Statistics.title === `${this.Statistics.qz_holiday}的修复时长区间数据` || this.Statistics.title === '平均修复时长数据' || this.Statistics.title === '趋势图数据' || this.Statistics.title === '累计修复' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计reopen' && this.Statistics.toType === '缺陷' || this.Statistics.title === '累计新增' && this.Statistics.toType === '缺陷') {
  324. this.responseDownload = await bugDownload(data)
  325. }
  326. const aLink = document.createElement('a')
  327. const blob = new Blob([this.responseDownload], { type: 'application/vnd.ms-excel' })
  328. aLink.href = URL.createObjectURL(blob)
  329. aLink.download = this.Statistics.title + '.xlsx'
  330. aLink.style.display = 'none'
  331. aLink.click()
  332. },
  333. handleClose(done) { // 关闭
  334. this.$emit('clone')
  335. }
  336. }
  337. }
  338. </script>
  339. <style lang="less" scoped>
  340. .qz-drawer-header {
  341. text-align: center;
  342. background: #F7F7F7;
  343. border-radius: 4px;
  344. min-height: 120px;
  345. margin: 20px 30px;
  346. overflow: hidden;
  347. }
  348. .qz-drawer-padding {
  349. padding: 20px 0;
  350. }
  351. .qz-drawer-padding-s {
  352. padding: 1px 0;
  353. }
  354. .qz-drawer-scll {
  355. overflow-x: scroll;
  356. }
  357. .qz-drawer-scll::-webkit-scrollbar { width: 0 !important; height: 0 !important }
  358. .qz-drawer-H {
  359. font-size: 16px;
  360. margin: 0 30px;
  361. color: #444444;
  362. }
  363. .qz-drawer-H span {
  364. color: #333333;
  365. font-weight: 600;
  366. }
  367. .qz-drawer-grade {
  368. color: #444;
  369. font-size: 14px;
  370. position: absolute;
  371. top: 28px;
  372. left: 185px;
  373. }
  374. .qz-drawer-grade-tow {
  375. color: #444;
  376. font-size: 14px;
  377. position: absolute;
  378. top: 28px;
  379. left: 150px;
  380. }
  381. /deep/ :focus{outline:0;}
  382. /deep/.el-table::before {
  383. left: 0;
  384. bottom: 0;
  385. width: 100%;
  386. height: 0px;
  387. }
  388. /deep/.el-drawer__header {
  389. color: #444;
  390. font-size: 20px;
  391. font-weight: 500;
  392. margin-bottom: 0px;
  393. padding: 20px 30px;
  394. border-bottom: 1px solid #E2E2E2;
  395. }
  396. .drawer-box {
  397. box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
  398. }
  399. .el-drawer__wrapper {
  400. width: 100%;
  401. position: fixed;
  402. top: 0;
  403. right: 0;
  404. bottom: 0;
  405. left: 50%;
  406. overflow: hidden;
  407. margin: 0;
  408. }
  409. /deep/.el-drawer__container {
  410. left: 0;
  411. right: 0;
  412. width: 50%;
  413. }
  414. /deep/.el-table td, .el-table th {
  415. padding: 5px 0;
  416. }
  417. .qz-margin-H {
  418. margin: 20px 30px 10px;
  419. }
  420. .qz-footer-laout {
  421. display: flex;
  422. justify-content: space-between;
  423. margin: 0 30px;
  424. }
  425. </style>
  426. <style>
  427. .el-drawer__open .el-drawer.rtl {
  428. -webkit-animation: none;
  429. animation: none;
  430. }
  431. </style>