1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312 |
- <template>
- <el-drawer
- class="content-wrapper"
- :modal="false"
- size="100%"
- :class="drawerBox"
- destroy-on-close
- :visible.sync="drawer"
- :before-close="handleClose"
- @click.stop
- @open="setBoxShadow('')"
- @opened="setBoxShadow"
- @close="setBoxShadow('')"
- >
- <template slot="title">
- <div v-if="title" @click.stop>{{ title }}<span class="sub-title">{{ subTitle }}</span></div>
- </template>
- <!-- 时间线 -->
- <div
- v-if="openDrawer && isTimeLine(1)"
- class="drawer-padding drawer-header"
- :style="{paddingTop: !isTimeLine(2) ? '30px':'10px'}"
- @click.stop
- >
- <div id="index" ref="timeline1" class="drawer-scll">
- <timeline
- :num="timelineData.firstActive"
- bg-margin
- :data="timelineData.first"
- @update="(params) => timeLineClick(params, 1)"
- />
- </div>
- <div v-if="isTimeLine(2)" ref="timeline2" class="drawer-scll">
- <timeline
- :num="timelineData.secondActive"
- :data="timelineData.second"
- bg-margin
- @update="(params)=>timeLineClick(params, 2)"
- />
- </div>
- </div>
- <!-- 表格 -->
- <dmTable
- v-if="openDrawer"
- v-loading="loading"
- :table-list="tableList"
- :total="tableList"
- :column="column"
- :table-height="tableHeight"
- @click.stop
- @change="dmTableChange"
- >
- <template #bugStatusNameSlot="{scope}">
- <div @click.stop="print(scope)">自定义</div>
- </template>
- <!-- 改进项:级别 -->
- <template #improvementsOverRateColumnsPrioritySlot="{scope}">
- <div v-if="scope.row.caseName" @click.stop>
- <a target="_blank" :href="scope.row.url">{{ scope.row.caseName }}</a>
- </div>
- </template>
- <!-- 改进项:状态 -->
- <template #improvementsOverRateColumnsStatusSlot="{scope}">
- <div v-if="scope.row.status" @click.stop>
- {{ scope.row.status }} <el-tag v-if="scope.row.tag" size="mini" type="danger" effect="dark">{{ scope.row.tag }}</el-tag>
- </div>
- </template>
- <!-- 报告名称 -->
- <template #returnReasonSlot="{scope}">
- <div v-if="scope.row.reportName" @click.stop>
- <div class="drawer-name" @click.stop="jumper(scope.row,'提测')">{{ scope.row.reportName }}</div>
- <div v-if="scope.row.returnReason" style="color: red">打开报告:{{ scope.row.returnReason }}</div>
- </div>
- </template>
- <!-- 报告人 -->
- <template #creatorObjectSlot="{scope}">
- <div v-if="scope && scope.row && scope.row.creatorObject" @click.stop>{{ scope.row.creatorObject.name }}</div>
- </template>
- <!-- 质量:线上问题_改进方案 -->
- <template #starFlowerDoneSlot="{scope}">
- <div @click.stop>
- <div>{{ scope.row.done + scope.row.undone }}项任务</div>
- <div
- v-if="scope.row.done === scope.row.done + scope.row.undone"
- class="antdv3-tag antdv3-tag-green"
- >
- 已完成:{{ scope.row.done }}项
- </div>
- <div v-else class="antdv3-tag antdv3-tag-orange">已完成:{{ scope.row.done }}项</div>
- </div>
- </template>
- <!-- 质量:线上问题_改进方案 -->
- <template #gmtCreateSlot="{scope}">
- <div @click.stop>
- <div>{{ rTime(scope.row.startTime) }}</div>
- </div>
- </template>
- <!-- 质量:上线次数 -->
- <template #deployStartTsSlot="{scope}">
- <div @click.stop>
- <div>{{ moment(scope.row.deployStartTs * 1000).format("YYYY-MM-DD HH:mm:ss") }}</div>
- </div>
- </template>
- </dmTable>
- <!-- 下拉 -->
- <div class="footer-laout" @click.stop>
- <div v-if="exportTableList.isShow.indexOf(drawerData.label) > -1" style="margin-top: 10px;">
- <el-button type="primary" size="mini" @click="exportTable">导出</el-button>
- </div>
- <el-pagination
- style="line-height: 60px;"
- :current-page.sync="paging.curIndex"
- :page-size="paging.pageSize"
- :pager-count="5"
- layout="total, sizes, prev, pager, next, jumper"
- :page-sizes="[10, 15, 20, 30]"
- :total="paging.pageTotal"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- </el-drawer>
- </template>
- <script>
- // import { mapGetters } from 'vuex'
- import { bugList } from '@/api/defectManage'
- import _ from 'lodash'
- import moment from 'moment'
- import { getReportList } from '@/api/reportTemplate'
- import dmTable from '@/components/baseTable/table'
- // import timeline from '@/components/timeline/index'
- import timeline from './components/timeline'
- import { columns, timelineList, exportTableList } from './drawerModalData'
- import { EncryptId } from '@/utils/crypto-js'
- import Clickoutside from 'element-ui/src/utils/clickoutside'
- import { requirementQueryRequirementInfoList, taskList } from '@/api/projectIndex'
- Object.freeze(exportTableList)
- import {
- // 质量
- getRequireAvgData, // 需求平均交付周期
- getTaskData, // 任务平均交付周期
- getRequirePeopleData, // 平均需求使用人力
- getTaskPeopleData, // 平均任务使用人力
- getDelayLaunchData, // 延期提测率
- getDelayReleaseData, // 延期准出率
- bugRepairData, // 缺陷24小时修复率
- bugRepair2Data, // 缺陷平均修复时长
- getStarFlowerList, // 线上问题:半浮层 列表
- getProjectList, // 需求任务项目列表: 半浮层
- getOdinJobList, // 获取上线过程列表
- dataMarketQualityGetImproveList, // 线上问题-改进项半浮层
- dataMarketDownload // 导出
- } from '@/api/dataMarket'
- export default {
- name: 'DrawerModal',
- components: {
- dmTable, timeline
- },
- directives: { Clickoutside },
- props: {
- // title: {
- // type: String,
- // required: false,
- // default: ''
- // },
- // subTitle: {
- // type: String,
- // required: false,
- // default: ''
- // },
- openDrawer: {
- type: Boolean,
- required: false,
- default: false
- },
- drawerData: {
- type: Object,
- required: false,
- default: () => {}
- }
- },
- data() {
- return {
- drawer: false,
- loading: false,
- title: '',
- headerTitle: '',
- // timelineData,
- tableList: [],
- tableListOld: [],
- tableHeight: 'auto',
- column: [],
- ids: [],
- label: '',
- exportTableList,
- activeLabel: '',
- drawerBox: '',
- subTitle: '',
- sourceData: null,
- /* S 新增缺陷*/
- priorityList: [],
- /* E 新增缺陷*/
- timelineData: {
- first: [],
- firstActive: 0,
- second: [],
- secondActive: 0
- },
- paging: {
- curIndex: 1,
- pageTotal: 0,
- pageSize: 10
- }
- }
- },
- watch: {
- drawerData(v, o) {
- // if (JSON.stringify(v) !== JSON.stringify(o)) {
- // this.init()
- // }
- this.init()
- },
- openDrawer(value) {
- this.drawer = value
- }
- },
- mounted() {
- this.drawer = false
- },
- methods: {
- moment,
- print(slotProp) {
- console.log(slotProp)
- },
- init() {
- // console.log(this.drawerData, 210)
- this.headerTitle = this.drawerData.headerTitle
- this.title = this.headerTitle.search(/质量|效率/) > -1 ? this.drawerData.label || '' : this.drawerData.activeLabel
- console.log(this.drawerData.label)
- if (this.headerTitle && this.title) {
- // console.log(this.drawerData)
- this.pagingInit()
- this.setPageSize()
- this.column = []
- this.tableList = []
- this.drawer = this.openDrawer
- this.setTitle()
- this.setIds() // 设置ids
- this.setTimeLineData()
- this.setTitleHeight()
- this.setTimeLine()
- this.setColumn()
- this.setTableList()
- } else {
- this.handleClose()
- }
- },
- // 设置页数
- setPageSize() {
- const pageSize = window.localStorage.getItem('pageSize') || 10
- // this.paging.pageSize = pageSize
- const paging = _.cloneDeep(this.paging)
- paging.pageSize = Number.parseInt(pageSize)
- this.paging = _.cloneDeep(paging)
- // console.log(this.paging, 250)
- },
- // 设置标题
- setTitle() {
- // this.title = this.headerTitle.search(/质量|效率/) > -1 ? this.drawerData.label : this.drawerData.activeLabel
- if (this.headerTitle === '质量') {
- if (this.drawerData.label === '提测打回率') {
- this.title = '提测报告'
- }
- if (this.drawerData.label === '准出不通过率') {
- this.title = '准出记录'
- }
- if (this.drawerData.label === '改进项完成率') {
- this.title = '改进项'
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '回滚次数') {
- this.title = !this.drawerData.index ? '回滚次数' : this.drawerData[this.drawerData.itemKey].label
- }
- }
- if (this.headerTitle === '效率') {
- this.activeLabel = this.drawerData.activeLabel
- if (this.drawerData.label === '需求平均交付周期') {
- this.title = '需求周期'
- }
- if (this.drawerData.label === '任务平均交付周期') {
- this.title = '任务周期'
- }
- if (this.drawerData.label === '平均需求使用人力') {
- this.title = '需求人力'
- }
- if (this.drawerData.label === '平均任务使用人力') {
- this.title = '任务人力'
- }
- if (this.drawerData.label === '缺陷平均修复时长') {
- this.title = '缺陷修复时长'
- }
- }
- this.sourceData = this.drawerData.list
- if (this.headerTitle === '效率' && this.title && this.title.search(/延期准出率|延期提测率/) < 0) {
- this.sourceData = [
- {
- label: this.drawerData.label === '缺陷24小时修复率' ? '全部' : this.drawerData.label,
- IdList: this.drawerData.idList
- },
- ...this.drawerData.subCountList
- ]
- }
- },
- // 处理日期格式:JS - 2020-01-01T00:00:00.000000Z 日期格式转换
- rTime(date) {
- if (!date) return ''
- var json_date = new Date(date).toJSON()
- return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
- },
- // 设置ids
- setIds() {
- if (this.headerTitle === '质量' && !this.drawerData.moduleName) {
- if (this.drawerData.label === '改进项完成率') {
- // if (this.drawerData.hasOwnProperty('subCountItem')) {
- // const { subItemList, subIndex } = this.drawerData.subCountItem
- // this.ids = subItemList[subIndex].idList.map(e => e)
- // } else {
- // this.ids = this.drawerData.idList.map(e => e)
- // }
- this.ids = this.drawerData.IdList.map(e => e)
- } else {
- this.ids = this.drawerData.IdList.map(e => e)
- }
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '上线过程') {
- this.ids = this.drawerData.IdList.map(e => e)
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '回滚次数') {
- this.ids = this.drawerData[this.drawerData.itemKey].idList.map(e => e)
- }
- if (this.headerTitle === '吞吐量') {
- this.drawerData.list.forEach(elm => {
- if (elm.label === this.drawerData.activeLabel && elm.idList) {
- this.ids = elm.idList.map(e => e)
- }
- })
- }
- if (this.headerTitle === '效率') {
- this.ids = this.drawerData.idList.map(e => e) // 提测报告
- }
- },
- // 设置时间轴
- setTimeLineData() {
- let { firstActive, first, secondActive, second } = this.timelineData
- if (this.title.search(/新增问题|提测报告|准出记录/) < 0) {
- if (this.headerTitle === '质量') {
- if (this.title.search(/新增缺陷|reopen/) > -1) {
- first = [...timelineList.newDefect]
- firstActive = 0
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '上线过程') {
- first = [...timelineList.lineRate]
- // 免测上线率是1
- this.drawerData.index === 2 ? firstActive = 1 : firstActive = 0
- // console.log(first, firstActive)
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '回滚次数') {
- first = [...timelineList.returnCase]
- firstActive = this.drawerData.index
- }
- if (this.title === '改进项') {
- secondActive = 0
- firstActive = 0
- first = [...timelineList.ImprovementsOverRate]
- second = [...timelineList.ImprovementsOverRateTwo]
- firstActive = this.drawerData.index
- if (this.drawerData.hasOwnProperty('subCountItem')) {
- if (this.drawerData.subCountItem.index === 3) {
- firstActive = 0
- secondActive = this.drawerData.subCountItem.subIndex + 1
- } else {
- firstActive = this.drawerData.subCountItem.index
- secondActive = this.drawerData.subCountItem.subIndex
- }
- }
- }
- }
- if (this.headerTitle === '吞吐量') {
- secondActive = 0
- firstActive = 0
- first = []
- this.sourceData.forEach((elm, index) => {
- if (this.title.indexOf(elm.label) > -1) {
- firstActive = index
- }
- first.push(elm.label)
- })
- if (this.title.search(/需求/) > -1) {
- first = [...timelineList.requirementData]
- }
- }
- if (this.headerTitle === '效率') {
- secondActive = 0
- firstActive = 0
- first = []
- second = []
- if (this.title === '缺陷24小时修复率') {
- first = [...timelineList.time]
- }
- if (this.title === '延期提测率') {
- first = [...timelineList.delayLaunchData]
- }
- if (this.title === '延期准出率') {
- first = [...timelineList.delayLaunchData2]
- }
- if (this.title.search(/延期提测率|延期准出率/) < 0) {
- this.sourceData.forEach((elm, index) => {
- let label = `${elm.label}`
- if (this.activeLabel === label) {
- if (this.title === '缺陷24小时修复率') {
- secondActive = index
- } else {
- firstActive = index
- }
- }
- if (this.title === '缺陷24小时修复率') {
- second.push(label)
- } else {
- if (index === 0) {
- if (label === '需求平均交付周期') {
- label = '需求交付周期'
- }
- if (label === '任务平均交付周期') {
- label = '任务交付周期'
- }
- if (label === '平均需求使用人力') {
- label = '需求使用人力'
- }
- if (label === '平均任务使用人力') {
- label = '任务使用人力'
- }
- if (this.drawerData.label === '缺陷平均修复时长') {
- label = '全部'
- }
- }
- first.push(label)
- }
- })
- }
- }
- this.timelineData = { firstActive, first, secondActive, second }
- }
- },
- handleClose() {
- this.drawer = false
- this.$emit('update:openDrawer', this.drawer)
- },
- handleSizeChange(value) {
- this.paging.pageSize = value
- const paging = _.cloneDeep(this.paging)
- paging.pageSize = value
- this.paging = _.cloneDeep(paging)
- window.localStorage.setItem('pageSize', value)
- if (this.headerTitle === '效率') {
- this.tableListPagination()
- } else {
- this.setTableList()
- }
- },
- handleCurrentChange(value) {
- // this.paging.curIndex = value
- const paging = _.cloneDeep(this.paging)
- paging.curIndex = value
- this.paging = _.cloneDeep(paging)
- // console.log(this.title)
- if (this.headerTitle === '效率') {
- this.tableListPagination()
- } else {
- this.setTableList()
- }
- },
- // 导出
- exportTable() {
- dataMarketDownload({
- ids: this.ids,
- title: this.drawerData.label
- }).then(res => {
- const aLink = document.createElement('a')
- const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
- aLink.href = URL.createObjectURL(blob)
- aLink.download = this.drawerData.label + '.xlsx'
- aLink.style.display = 'none'
- aLink.click()
- })
- },
- // 格式化时间
- dateFomatter(date) {
- return date.substring(0, 10) + ' ' + date.substring(11, 19)
- },
- // 设置表格头
- setColumn() {
- if (this.title.search(/新增缺陷|reopen|缺陷24小时修复率/) > -1) {
- this.column = [...columns.bugColumn]
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '上线过程') {
- this.column = [...columns.test_freeOn_lineRateIdListColumns]
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '回滚次数') {
- // this.ids = this.drawerData[this.drawerData.itemKey].idList.map(e => e)
- this.column = [...columns.test_freeOn_lineRateIdListColumns]
- }
- if (this.title === '改进项') {
- this.column = [...columns.improvementsOverRateColumns]
- }
- if (this.title.search(/新增问题/) > -1) {
- this.column = [...columns.newQuestionColumns]
- }
- if (this.title.search(/提测报告|准出记录/) > -1) {
- this.column = [...columns.deliverTestReportIdListColumns]
- }
- if (this.headerTitle === '吞吐量') {
- if (this.title.search(/需求/) > -1) {
- this.column = [...columns.requirementListColumns]
- }
- if (this.title.search(/任务/) > -1) {
- this.column = [...columns.taskListColumns]
- }
- if (this.title.search(/项目/) > -1) {
- this.column = [...columns.projectListColumns]
- }
- }
- if (this.headerTitle === '效率') {
- let columnsKey = 'requirementColumns'
- if (this.title === '任务周期') {
- columnsKey = 'taskColumns'
- }
- if (this.title === '需求人力') {
- columnsKey = 'requirementPeopleColumns'
- }
- if (this.title === '任务人力') {
- columnsKey = 'taskPeopleColumns'
- }
- if (this.title === '延期提测率') {
- columnsKey = 'delayLaunchDataColumns'
- }
- if (this.title === '延期准出率') {
- columnsKey = 'delayReleaseData2Columns'
- }
- if (this.title.search(/缺陷修复时长|缺陷24小时修复率/) > -1) {
- columnsKey = 'bugRepairDataColumns'
- }
- // const columnsTipsKey = `${columnsKey}Tips`
- this.column = columns.efficiency[columnsKey].map((elm, index) => {
- // if (index === 2 && this.title.search(/任务周期|需求人力|任务人力|需求周期/) > -1) {
- // return columns.efficiency[columnsTipsKey][this.timelineData.firstActive || 0]
- // }
- return elm
- })
- }
- },
- // 时间轴点击事件
- timeLineClick({ value, name }, index) {
- this.pagingInit()
- this.ids = []
- if (index === 1) {
- if (this.headerTitle === '质量') {
- this.timelineData.firstActive = value || 0
- if (this.title.search(/新增缺陷|reopen/) > -1) {
- this.ids = this.drawerData.IdList.map(e => e)
- this.priorityList = value ? [value - 1] : []
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '上线过程') {
- // console.log(this.drawerData.parent.list[value])
- // 免测上线是1 0是上线次数 2是裸奔上线
- this.ids = [...this.drawerData.parent.list[value === 1 ? 2 : 0].IdList]
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '回滚次数') {
- const items = ['countStr', 'preCountStr', 'fullCountStr', 'lowCountStr']
- this.ids = [...this.drawerData[items[value]].idList]
- }
- if (this.title === '改进项') {
- this.ids = this.drawerData.IdList.map(e => e)
- this.priorityList = value ? [value - 1] : []
- }
- }
- if (this.headerTitle === '吞吐量') {
- this.timelineData.firstActive = value || 0
- if (this.sourceData[value || 0] && this.sourceData[value || 0].idList) {
- this.ids = this.sourceData[value || 0].idList
- this.title = name
- }
- }
- if (this.headerTitle === '效率') {
- this.timelineData.firstActive = value || 0
- if (this.title.search(/延期准出率|延期提测率/) > -1) {
- // this.ids = this.sourceData[value].IdList
- } else {
- this.timelineData.firstActive = value || 0
- this.ids = this.sourceData[value || 0].IdList
- }
- this.setColumn()
- }
- this.setTableList()
- }
- if (index === 2) {
- if (this.title === '改进项') {
- // console.log(593, value)
- this.timelineData.secondActive = value
- } else {
- this.timelineData.secondActive = value || 0
- this.ids = this.sourceData[value || 0].IdList
- // this.setTableList()
- }
- this.setTableList()
- }
- },
- // 设置列表数据
- setTableList() {
- this.tableList = []
- if (this.headerTitle === '质量') {
- if (this.title.search(/新增缺陷|reopen/) > -1) {
- // console.log(this.ids, 502)
- if (this.ids.length) {
- // console.log(504)
- this.loading = true
- this.getBugStatisticData()
- }
- }
- if (this.title.search(/新增问题/) > -1) {
- if (this.ids.length) {
- this.loading = true
- this.setStarFlowerList()
- }
- }
- if (this.title.search(/改进项/) > -1) {
- this.loading = true
- // console.log(624)
- this.dataMarketQualityGetImproveListFn()
- }
- if (this.title.search(/提测报告|准出记录/) > -1) {
- if (this.ids.length) {
- this.loading = true
- this.setReportList()
- }
- }
- if (this.drawerData.moduleName && (this.drawerData.moduleName === '上线过程' || this.drawerData.moduleName === '回滚次数')) {
- if (this.ids.length) {
- this.loading = true
- this.getOdinJobListFn()
- }
- }
- }
- if (this.headerTitle === '吞吐量') {
- if (this.title.search(/需求/) > -1) {
- if (this.ids.length) {
- this.loading = true
- this.getRequirementList()
- }
- }
- if (this.title.search(/任务/) > -1) {
- if (this.ids.length) {
- this.loading = true
- this.getTaskList()
- }
- }
- if (this.title.search(/项目/) > -1 && this.ids.length) {
- if (this.ids.length) {
- this.loading = true
- this.setProjectList()
- }
- }
- }
- if (this.headerTitle === '效率') {
- if (this.title === '需求周期') {
- if (this.sourceData[0].IdList.length) {
- this.loading = true
- this.setRequireAvgData()
- }
- }
- if (this.title === '任务周期') {
- this.loading = true
- if (this.sourceData[0].IdList.length) {
- this.loading = true
- this.setTaskData()
- }
- }
- if (this.title === '需求人力') {
- if (this.sourceData[0].IdList.length) {
- this.loading = true
- this.setRequirePeopleData()
- }
- }
- if (this.title === '任务人力') {
- if (this.sourceData[0].IdList.length) {
- this.loading = true
- this.setTaskPeopleData()
- }
- }
- if (this.title === '缺陷修复时长') {
- if (this.sourceData[0].IdList.length) {
- this.loading = true
- this.setBugRepair2Data()
- }
- }
- if (this.title === '缺陷24小时修复率') {
- if (this.sourceData[0].IdList.length) {
- this.loading = true
- this.setBugRepairData()
- }
- }
- if (this.title === '延期提测率') {
- if (this.drawerData.idList.length) {
- this.loading = true
- this.setDelayLaunchData()
- }
- }
- if (this.title === '延期准出率') {
- if (this.drawerData.idList.length) {
- this.loading = true
- this.setDelayReleaseData()
- }
- }
- }
- },
- // 线上问题-改进项半浮层
- async dataMarketQualityGetImproveListFn() {
- const paging = { ...this.paging }
- // const { index, subIndex } = this.drawerData.subCountItem
- const { firstActive,
- // first,
- secondActive
- // second
- } = this.timelineData
- const params = {
- ...paging,
- isOverDue: 1,
- ids: this.drawerData.IdList
- }
- if (firstActive) {
- params.status = timelineList.ImprovementsOverRate[firstActive]
- }
- // console.log(722, secondActive)
- if (secondActive === 2) {
- params.priority = '高优'
- }
- if (!firstActive) {
- delete params.status
- } else {
- delete params.isOverDue
- }
- if (!secondActive) {
- delete params.isOverDue
- } else {
- params.isOverDue = 1
- }
- // if (index < 2 && subIndex < 1) {
- // delete params.isOverDue
- // }
- delete params.pageTotal
- const res = await dataMarketQualityGetImproveList(params)
- if (res.code === 200) {
- this.tableList = res.data.result
- paging.pageTotal = res.data.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 获取需求
- async getRequirementList() {
- const paging = this.paging
- // {"ids":[14952,15453,15988,16182,17445,17447,17735,18062,18064,18067,18134,18137,18138,18140],"curIndex":2,"pageSize":10}
- const res = await requirementQueryRequirementInfoList({
- ids: this.ids,
- curIndex: this.paging.curIndex,
- pageSize: this.paging.pageSize
- })
- if (res.code === 200) {
- this.tableList = res.data.list
- this.paging.pageTotal = res.data.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 获取任务
- async getTaskList() {
- const paging = this.paging
- // {"ids":[14952,15453,15988,16182,17445,17447,17735,18062,18064,18067,18134,18137,18138,18140],"curIndex":2,"pageSize":10}
- const res = await taskList({
- ids: this.ids,
- curIndex: this.paging.curIndex,
- pageSize: this.paging.pageSize
- })
- if (res.code === 200) {
- this.tableList = res.data
- this.paging.pageTotal = res.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // getStarFlowerList, // 线上问题:半浮层 列表
- async setStarFlowerList() {
- if (!this.ids.length) {
- this.loading = false
- return
- }
- const paging = this.paging
- // {"ids":[14952,15453,15988,16182,17445,17447,17735,18062,18064,18067,18134,18137,18138,18140],"curIndex":2,"pageSize":10}
- const res = await getStarFlowerList({
- idList: this.ids,
- curIndex: this.paging.curIndex,
- pageSize: this.paging.pageSize
- })
- if (res.code === 200) {
- this.tableList = res.data.result
- this.paging.pageTotal = res.data.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // getProjectList // 需求任务项目列表: 半浮层
- async setProjectList() {
- const paging = this.paging
- // {"ids":[14952,15453,15988,16182,17445,17447,17735,18062,18064,18067,18134,18137,18138,18140],"curIndex":2,"pageSize":10}
- const res = await getProjectList({
- idList: this.ids.length ? this.ids : [],
- curIndex: this.paging.curIndex,
- pageSize: this.paging.pageSize
- })
- if (res.code === 200) {
- // console.log(res)
- this.tableList = res.data.result
- paging.pageTotal = res.data.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 累计新增缺陷
- async getBugStatisticData() {
- const paging = this.paging
- // {"ids":[14952,15453,15988,16182,17445,17447,17735,18062,18064,18067,18134,18137,18138,18140],"curIndex":2,"pageSize":10}
- const res = await bugList({
- ids: this.ids,
- curIndex: this.paging.curIndex,
- priorityList: this.priorityList[0] === 2 ? [2, 3, 4, 5] : this.priorityList,
- pageSize: this.paging.pageSize
- })
- if (res.code === 200) {
- this.tableList = res.data
- this.paging.pageTotal = res.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 提测报告 deliverTestReportIdList 准出记录 releaseReportIdList
- async setReportList() {
- const key = this.title === '提测报告' ? 'deliverTestReportIdList' : 'releaseReportIdList'
- const paging = this.paging
- const params = {
- ...paging,
- [key]: this.ids
- }
- delete params.pageTotal
- const res = await getReportList(params)
- if (res.code === 200) {
- this.tableList = res.data
- paging.pageTotal = res.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 上线过程
- async getOdinJobListFn() {
- const paging = this.paging
- const res = await getOdinJobList({
- idList: this.ids,
- curIndex: this.paging.curIndex,
- pageSize: this.paging.pageSize
- })
- if (res.code === 200) {
- this.tableList = res.data.result
- this.paging.pageTotal = res.data.total
- this.paging = { ...paging }
- this.loading = false
- }
- },
- /* S 效率:半浮层数据接口 */
- // 需求平均交付周期
- async setRequireAvgData() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.sourceData[0].IdList
- }
- delete params.pageTotal
- const res = await getRequireAvgData(params)
- if (res.code === 200) {
- // this.tableList = res.data
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 任务平均交付周期
- async setTaskData() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.sourceData[0].IdList
- }
- delete params.pageTotal
- const res = await getTaskData(params)
- if (res.code === 200) {
- // this.tableList = res.data
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 平均需求使用人力
- async setRequirePeopleData() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.sourceData[0].IdList
- }
- delete params.pageTotal
- const res = await getRequirePeopleData(params)
- if (res.code === 200) {
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 平均任务使用人力
- async setTaskPeopleData() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.sourceData[0].IdList
- }
- delete params.pageTotal
- const res = await getTaskPeopleData(params)
- if (res.code === 200) {
- // this.tableList = res.data
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- paging.pageTotal = this.sourceData[0].IdList.length
- this.paging = { ...paging }
- // console.log(847, this.paging)
- this.loading = false
- }
- },
- // 缺陷平均修复时长
- async setBugRepair2Data() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.sourceData[0].IdList
- }
- delete params.pageTotal
- const res = await bugRepair2Data(params)
- if (res.code === 200) {
- // this.tableList = res.data
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 缺陷24小时修复率
- async setBugRepairData() {
- const priorityList = [[0, 1, 2, 3], [0, 1], [2, 3]]
- const paging = this.paging
- const params = {
- // ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- priorityList: priorityList[this.timelineData.secondActive],
- ids: this.sourceData[0].IdList
- }
- delete params.pageTotal
- const res = await bugRepairData(params)
- if (res.code === 200) {
- this.tableList = res.data
- this.tableListOld = res.data.length && this.tableList.map(e => e)
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // getDelayLaunchData, // 延期提测率
- async setDelayLaunchData() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.drawerData.idList
- }
- delete params.pageTotal
- const res = await getDelayLaunchData(params)
- if (res.code === 200) {
- this.tableList = res.data
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // getDelayReleaseData, // 延期准出率
- async setDelayReleaseData() {
- const paging = this.paging
- const params = {
- ...paging,
- title: this.timelineData.first[this.timelineData.firstActive],
- ids: this.drawerData.idList
- }
- delete params.pageTotal
- const res = await getDelayReleaseData(params)
- if (res.code === 200) {
- // this.tableList = res.data
- this.tableListOld = res.data.length && res.data.map(e => e)
- this.tableListPagination()
- paging.pageTotal = this.tableListOld.length
- this.paging = { ...paging }
- this.loading = false
- }
- },
- // 分页
- tableListPagination() {
- if (this.tableListOld.length) {
- this.tableList = this.tableListOld.map(e => e).splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)
- // if (this.paging.curIndex - 1 || this.tableListOld.length > this.paging.pageSize.length) {
- // this.tableList = this.tableListOld.map(e => e).splice((this.paging.curIndex - 1 || 0) * this.paging.pageSize, this.paging.pageSize)
- // } else {
- // this.tableList = this.tableListOld.map(e => e) || []
- // }
- }
- },
- /* E 效率:半浮层数据接口 */
- // 分页数据初始化
- pagingInit() {
- const pageSize = window.localStorage.getItem('pageSize') || 10
- this.paging = {
- curIndex: 1,
- pageTotal: 0,
- pageSize: Number.parseInt(pageSize)
- }
- this.priorityList = []
- },
- // 设置表格高度
- setTitleHeight() {
- if (this.drawerData.moduleName && this.drawerData.moduleName.search(/上线过程|回滚次数/) > -1) {
- this.tableHeight = 'calc(100vh - 290px)'
- } else if (this.title.search(/状态停留分布图数据|状态累积流量图数据/) > -1) {
- this.tableHeight = 'calc(100vh - 363px)'
- } else if (this.title.search(/需求周期|需求人力|任务人力|任务周期/) > -1) {
- this.tableHeight = 'calc(100vh - 136px)'
- } else if (this.title.search(/新增项目|新增任务|reopen|新增缺陷|缺陷修复时长|延期准出率|延期提测率/) > -1) {
- this.tableHeight = 'calc(100vh - 288px)'
- } else if (this.title.search(/需求|任务|项目/) > -1) {
- // 吞吐量: 需求
- this.tableHeight = 'calc(100vh - 188px)'
- } else if (this.title === '缺陷24小时修复率') {
- this.tableHeight = 'calc(100vh - 328px)'
- } else {
- this.tableHeight = 'calc(100vh - 136px)'
- }
- if (this.headerTitle === '质量' && this.title.search(/新增缺陷|reopen/) < 0 && !this.drawerData.moduleName) {
- this.tableHeight = this.title === '改进项' ? 'calc(100vh - 300px)' : 'calc(100vh - 136px)'
- }
- if (this.headerTitle === '吞吐量') {
- this.tableHeight = 'calc(100vh - 288px)'
- }
- },
- // 设置表头
- // 表格跳转
- dmTableChange({ column, row }) {
- if (this.headerTitle === '质量' && this.drawerData.label === '新增问题') {
- const url = `https://odin.xiaojukeji.com/#/risk/starflower/casedetail?id=${row.id}&name=${row.title}`
- window.open(url, '_blank')
- } else if (this.drawerData.moduleName && this.drawerData.moduleName.search(/上线过程|回滚次数/) > -1) {
- const url = `https://odin.v5.intra.xiaojukeji.com/#/deploy/job/status/?jobId=${row.id}`
- window.open(url, '_blank')
- } else if (this.headerTitle === '质量' && this.drawerData.label.search(/^(提测报告|准出记录)/) > -1) {
- this.jumper(row, '报告')
- } else if (this.headerTitle === '吞吐量') {
- if (this.title.search(/需求/) > -1) {
- this.jumper(row, '需求')
- }
- if (this.title.search(/任务/) > -1) {
- this.jumper(row, '任务')
- }
- if (this.title.search(/项目/) > -1) {
- this.jumper(row, '项目')
- }
- } else if (this.headerTitle === '效率') {
- if (column.label.search(/需求/) > -1) {
- this.jumper(row, '需求')
- }
- if (column.label.search(/任务/) > -1) {
- this.jumper(row, '任务')
- }
- if (column.label.search(/缺陷/) > -1) {
- this.jumper(row, '缺陷')
- }
- } else {
- this.jumper(row, '缺陷')
- }
- },
- // 设置表格样式
- setBoxShadow(key = 'drawer-box') {
- if (key) {
- setTimeout(() => {
- this.drawerBox = key
- }, 300)
- } else {
- this.drawerBox = key
- }
- },
- // 设置时间轴自动滚动
- setTimeLine() {
- this.$nextTick(() => {
- if (this.isTimeLine(1)) {
- // Number(this.defaultKey) * 109 - 60
- // this.$refs.timeline1.scrollLeft = 100
- }
- if (this.isTimeLine(2)) {
- // Number(this.defaultKey2) * 100 - 60
- // this.$refs.timeline2.scrollLeft = 256
- }
- })
- },
- jumper(val, name) { // 需求、任务、缺陷跳转
- // const { bizId = null } = this.$store.state.global || {}
- const { bizId, id } = val
- const bizId_id = EncryptId(`${bizId}_${id}`)
- const newTab = this.$router.resolve({ name: name + '详情', query: { bizId_id: bizId_id }})
- window.open(newTab.href, '_blank')
- },
- // 设置时间轴自动滚动
- isTimeLine(index = 1) {
- // 是第一条
- if (index === 1) {
- if (this.headerTitle.search(/质量/) > -1 && this.title.search(/新增缺陷|reopen|改进项/) > -1) {
- return true
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '上线过程') {
- return true
- }
- if (this.drawerData.moduleName && this.drawerData.moduleName === '回滚次数') {
- return true
- }
- // console.log(1049, this.title, this.headerTitle)
- if (this.headerTitle.search(/效率/) > -1 && this.title.search(/需求周期|任务周期|需求人力|任务人力/) > -1) {
- return false
- }
- return this.headerTitle.search(/吞吐量|效率/) > -1
- }
- // 是第二条
- if (index === 2) {
- return this.title.search(/缺陷24小时修复率|改进项/) > -1
- }
- }
- }
- }
- </script>
- <style scoped lang='less'>
- .content-wrapper{
- /deep/.el-drawer__body{
- overflow: hidden;
- }
- }
- /deep/ .el-drawer__header {
- color: #444;
- font-size: 20px;
- font-weight: 500;
- margin-bottom: 0;
- padding: 20px 30px;
- border-bottom: 1px solid #E2E2E2;
- .sub-title {
- color: #444;
- font-size: 14px;
- margin-left: 20px;
- font-weight: 400;
- }
- }
- .drawer-box {
- 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);
- }
- .el-drawer-fade-enter-active {
- animation: el-drawer-fade-in 10ms;
- }
- .el-drawer-fade-leave-active {
- animation: el-drawer-fade-in 10ms reverse;
- }
- .el-drawer__wrapper {
- width: 100%;
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 50%;
- overflow: hidden;
- margin: 0;
- }
- /deep/.el-drawer__container {
- left: 0;
- right: 0;
- width: 50%;
- }
- /* S 时间轴 */
- .drawer-header {
- text-align: center;
- background: #F7F7F7;
- border-radius: 4px;
- min-height: 120px;
- margin: 20px 30px 10px;
- overflow: hidden;
- }
- .drawer-padding {
- padding: 20px 0;
- }
- .drawer-padding-s {
- padding: 1px 0;
- }
- .drawer-scll {
- overflow-x: scroll;
- }
- .drawer-scll::-webkit-scrollbar { width: 0 !important; height: 0 !important }
- .drawer-H {
- font-size: 16px;
- margin: 0 30px;
- color: #444444;
- }
- .drawer-scll {
- overflow-x: scroll;
- }
- .drawer-scll::-webkit-scrollbar { width: 0 !important; height: 0 !important }
- .drawer-H {
- font-size: 16px;
- margin: 0 30px;
- color: #444444;
- }
- /* E 时间轴 */
- /* S 质量:线上问题_改进方案 */
- .antdv3-tag{
- box-sizing: border-box;
- color: rgba(0,0,0,.65);
- font-variant: tabular-nums;
- list-style: none;
- font-feature-settings: "tnum";
- display: inline-block;
- height: auto;
- margin: 0 8px 0 0;
- padding: 0 7px;
- font-size: 12px;
- line-height: 20px;
- white-space: nowrap;
- background: #fafafa;
- border: 1px solid #d9d9d9;
- border-radius: 2px;
- cursor: default;
- opacity: 1;
- transition: all .3s cubic-bezier(.78,.14,.15,.86);
- }
- .antdv3-tag-orange {
- color: #fa8c16;
- background: #fff7e6;
- border-color: #ffd591;
- }
- .antdv3-tag-green {
- color: #52c41a;
- background: #f6ffed;
- border-color: #b7eb8f;
- }
- /* E 质量:线上问题_改进方案 */
- .footer-laout {
- display: flex;
- justify-content: space-between;
- margin: 0 30px;
- //width: 100%;
- //padding: 0 30px;
- //.el-pagination{
- // width: 100%;
- //}
- }
- .drawer-name:hover {
- color: #409eff;
- cursor: pointer;
- }
- </style>
|