|
@@ -13,7 +13,8 @@ import {
|
|
|
publishReport,
|
|
|
getSubReportInfo,
|
|
|
updateSubReport,
|
|
|
- pullDataAgain
|
|
|
+ pullDataAgain,
|
|
|
+ pullSubTitle
|
|
|
} from '@/api/qualityMonthlyReport/edit'
|
|
|
// import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
|
|
|
import { getAvaliableInfo, getMonthlyReportVersion } from '@/api/qualityMonthlyReport'
|
|
@@ -1003,6 +1004,71 @@ export default {
|
|
|
state.userNames = userNames
|
|
|
}
|
|
|
}, 100)
|
|
|
+ },
|
|
|
+ // 重新拉取线上问题的 SubTitle,只在tableData数据变化时更新
|
|
|
+ async pullOnlineQuestion({ state }, { domKey, route }) {
|
|
|
+ // 获取数据
|
|
|
+ let baseData = {}
|
|
|
+ let { subReportId } = route.query
|
|
|
+ const [tabKey, subTabKey] = state.subTabsActive
|
|
|
+ if (!subReportId) {
|
|
|
+ subReportId = state.tabsActive.replace(/tab_/, '')
|
|
|
+ }
|
|
|
+ //
|
|
|
+ const tabDataObj = {
|
|
|
+ tabKey: '',
|
|
|
+ subTabKey: ''
|
|
|
+ }
|
|
|
+ const setValue = (item, key, value) => {
|
|
|
+ if (item.domKey === value) {
|
|
|
+ tabDataObj[key] = item
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const find = (arr) => {
|
|
|
+ arr &&
|
|
|
+ arr.length &&
|
|
|
+ arr.forEach((elm) => {
|
|
|
+ setValue(elm, 'tabKey', tabKey)
|
|
|
+ setValue(elm, 'subTabKey', subTabKey)
|
|
|
+ if (elm.domKey === domKey) {
|
|
|
+ baseData = _.cloneDeep(elm)
|
|
|
+ }
|
|
|
+ if (elm.content && elm.content.length) {
|
|
|
+ find(elm.content)
|
|
|
+ }
|
|
|
+ if (elm.children && elm.children.length) {
|
|
|
+ find(elm.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ find(state.tabPageData.children)
|
|
|
+ // 转换数据
|
|
|
+ const tableRows = objToArr(baseData.content[1].tableRows, baseData.content[1].tableHeaders)
|
|
|
+ const res = await pullSubTitle({
|
|
|
+ subReportId,
|
|
|
+ catalogTitle: '线上问题',
|
|
|
+ isServer: tabDataObj.tabKey.title ? tabDataObj.tabKey.title === '服务端' : false,
|
|
|
+ tableRows
|
|
|
+ })
|
|
|
+ // 覆盖数据
|
|
|
+ const setSubTitle = (arr) => {
|
|
|
+ arr &&
|
|
|
+ arr.length &&
|
|
|
+ arr.forEach((elm) => {
|
|
|
+ if (elm.domKey === domKey) {
|
|
|
+ elm.subTitles = res.data
|
|
|
+ }
|
|
|
+ if (elm.content && elm.content.length) {
|
|
|
+ setSubTitle(elm.content)
|
|
|
+ }
|
|
|
+ if (elm.children && elm.children.length) {
|
|
|
+ setSubTitle(elm.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ const tabPageData = { ...state.tabPageData }
|
|
|
+ setSubTitle(tabPageData.children)
|
|
|
+ state.tabPageData = { ...tabPageData }
|
|
|
}
|
|
|
}
|
|
|
}
|