fix: 去除无用代码及组件
This commit is contained in:
@@ -421,7 +421,6 @@ export default {
|
||||
logout () {
|
||||
sessionStorage.removeItem(storageKey.tokenExpireCurrentPath)
|
||||
localStorage.removeItem(storageKey.token)
|
||||
localStorage.removeItem(storageKey.currentTab)
|
||||
get(api.logout)
|
||||
},
|
||||
refreshLang () {
|
||||
@@ -649,10 +648,6 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
// 清除administration的tab列表保存状态currentTab
|
||||
if (route !== '/administration') {
|
||||
localStorage.removeItem(storageKey.currentTab)
|
||||
}
|
||||
this.changeUrlTabState()
|
||||
if (opeType === 2 || opeType === 0) { // 二级菜单 或主菜单
|
||||
// 如果有四级菜单,则将四级菜单对应tab的checked设置为true:根据columnName和columnValue 或 url判断不准确
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
<template>
|
||||
<el-table
|
||||
id="userTable"
|
||||
ref="dataTable"
|
||||
:data="tableData"
|
||||
:height="height"
|
||||
border
|
||||
@header-dragend="dragend"
|
||||
@sort-change="tableDataSort"
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
:resizable="false"
|
||||
align="center"
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="(item, index) in customTableTitles"
|
||||
:key="`col-${index}`"
|
||||
:fixed="item.fixed"
|
||||
:label="item.label"
|
||||
:min-width="`${item.minWidth}`"
|
||||
:prop="item.prop"
|
||||
:resizable="true"
|
||||
:sort-orders="['ascending', 'descending']"
|
||||
:sortable="item.sortable"
|
||||
:width="`${item.width}`"
|
||||
>
|
||||
<template #header>
|
||||
<span class="data-column__span">{{item.label}}</span>
|
||||
<div class="col-resize-area"></div>
|
||||
</template>
|
||||
<template #default="scope" :column="item">
|
||||
<span v-if="item.prop === 'dataRange'">
|
||||
<template v-if="scope.row.startTime && scope.row.endTime">
|
||||
{{dateFormatByAppearance(scope.row.startTime)}}<span style="padding: 0 5px">-</span>{{dateFormatByAppearance(scope.row.endTime)}}
|
||||
</template>
|
||||
</span>
|
||||
<span v-else-if="item.prop === 'type'">
|
||||
{{$_.get(scope.row.reportTemp, 'name')}}
|
||||
</span>
|
||||
<span v-else-if="item.prop === 'state'">
|
||||
{{getJobStatus(scope.row)}}
|
||||
</span>
|
||||
<span v-else>{{scope.row[item.prop]}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:resizable="false"
|
||||
:width="operationWidth"
|
||||
fixed="right">
|
||||
<template #header>
|
||||
<div class="table-operation-title">{{$t('overall.option')}}</div>
|
||||
</template>
|
||||
<template #default="scope">
|
||||
<div class="table-operation-items" v-if="scope.row.state === 1">
|
||||
<div class="table-operation-item--no-border" @click="tableOperation(['download', scope.row, 1])">
|
||||
<loading :loading="loadingTableId === scope.row.id"></loading>
|
||||
<svg class="icon" aria-hidden="true" :class="{'table-operation-all-loading': loadingTableId}">
|
||||
<use xlink:href="#cn-icon-download2"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="table-operation-item--no-border" @click="tableOperation(['preview', scope.row])">
|
||||
<loading :loading="loadingPreviewId === scope.row.id"></loading>
|
||||
<svg class="icon" aria-hidden="true" :class="{'table-operation-all-loading': loadingPreviewId}">
|
||||
<use xlink:href="#cn-icon-preview"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<!-- <div class="table-operation-item--no-border" @click="tableOperation(['rerun', scope.row])">
|
||||
<loading :loading="loadingPreviewId === scope.row.id"></loading>
|
||||
<svg class="icon2" aria-hidden="true" :class="{'table-operation-all-loading': loadingPreviewId}">
|
||||
<use xlink:href="#cn-icon-refresh"></use>
|
||||
</svg>
|
||||
</div>-->
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-operation-all">
|
||||
<el-checkbox v-model="checkboxAll" @change="selectAll(tableData)"></el-checkbox>
|
||||
<div class="table-operation-all-span">
|
||||
<span>{{ $t('overall.all') }}</span>
|
||||
<div class="table-operation-back-down" :class="{'table-operation-all-checkbox': batchDow, 'table-operation-all-loading': loading}" @click="tableOperation(['download', this.checkboxIds, 2])">
|
||||
<loading :loading="loading"></loading>
|
||||
<span>{{$t('report.batchDow')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import table from '@/mixins/table'
|
||||
import Loading from '@/components/common/Loading'
|
||||
export default {
|
||||
name: 'builtinReportTable',
|
||||
mixins: [table],
|
||||
components: {
|
||||
Loading
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
tableTitle: [ // 原始table列
|
||||
{
|
||||
label: this.$t('config.user.name'),
|
||||
prop: 'name',
|
||||
show: true,
|
||||
sortable: 'custom'
|
||||
}, /* {
|
||||
label: this.$t('config.chart.remark'),
|
||||
prop: 'remark',
|
||||
show: true
|
||||
}, */{
|
||||
label: this.$t('overall.type'),
|
||||
prop: 'type',
|
||||
show: true,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('report.dataRange'),
|
||||
prop: 'dataRange',
|
||||
show: true,
|
||||
minWidth: 110
|
||||
}, {
|
||||
label: this.$t('overall.completionTime'),
|
||||
prop: 'finishTime',
|
||||
show: true
|
||||
}, {
|
||||
label: this.$t('overall.status'),
|
||||
prop: 'state',
|
||||
show: true,
|
||||
width: 130,
|
||||
sortable: 'custom'
|
||||
}
|
||||
],
|
||||
checkboxAll: false,
|
||||
checkboxIds: '',
|
||||
batchDow: false,
|
||||
builtinId: '',
|
||||
indeterminate: false,
|
||||
loading: false,
|
||||
loadingTableId: '',
|
||||
loadingPreviewId: ''
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getJobStatus (report) {
|
||||
if (report.state === 1 && report.upload === 1) {
|
||||
return this.$t('overall.completed')
|
||||
} else {
|
||||
return this.$t('overall.inProgress')
|
||||
}
|
||||
},
|
||||
selectionChange (objs) {
|
||||
this.$emit('selectionChange', objs)
|
||||
this.checkboxIds = objs.map(item => { return item.id }).join(',')
|
||||
this.checkboxAll = objs.length > 0 || objs.length === this.tableData.length
|
||||
this.batchDow = objs.length > 0
|
||||
},
|
||||
selectAll (objs) {
|
||||
if (objs) {
|
||||
objs.forEach(item => {
|
||||
this.$refs.dataTable.toggleAllSelection(item)
|
||||
})
|
||||
} else {
|
||||
this.$refs.dataTable.clearSelection()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -34,8 +34,7 @@ export const storageKey = {
|
||||
drillDownTableConfig: 'drilldownTableConfig',
|
||||
userCustomizationConfig: 'userCustomizationConfig',
|
||||
linkInfo: 'cn-link-info',
|
||||
history: 'cn-history',
|
||||
currentTab: 'cn-current-tab'
|
||||
history: 'cn-history'
|
||||
}
|
||||
export const largeCountryList = ['CN', 'US', 'RU', 'AU', 'CA', 'KZ', 'IN', 'BR']
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
<template>
|
||||
<div class="npm-tabs">
|
||||
<div class="npm-tabs__active-bar"></div>
|
||||
<el-tabs v-model="currentTab" ref="elTabs" type="border-card" @tab-click="jumpPage">
|
||||
<el-tab-pane
|
||||
v-for="(tab, index) in tabsData"
|
||||
:key="tab.i18n"
|
||||
:name="index">
|
||||
<template #label>
|
||||
<div class="npm-tab__label">
|
||||
<i :class="tab.icon"></i>
|
||||
<span>{{ $t(tab.i18n) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { storageKey } from '@/utils/constants'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'DetectionTabs',
|
||||
props: {
|
||||
tabsData: Array
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
leftOffset: 27,
|
||||
currentTab: ref(0)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleActiveBar (index) {
|
||||
const tabDom = document.getElementById('tab-' + index)
|
||||
if (tabDom) {
|
||||
const offsetLeft = tabDom.offsetLeft
|
||||
const clientWidth = tabDom.clientWidth
|
||||
const clientLeft = tabDom.clientLeft
|
||||
const activeBar = document.querySelector('.npm-tabs .npm-tabs__active-bar')
|
||||
activeBar.style.cssText += `width: ${clientWidth + 2}px; left: ${offsetLeft + this.leftOffset + clientLeft - 1}px;`
|
||||
}
|
||||
},
|
||||
jumpPage (tab) {
|
||||
localStorage.setItem(storageKey.currentTab, tab.index)
|
||||
this.$router.push({
|
||||
path: this.tabsData[tab.index].path,
|
||||
query: {
|
||||
t: +new Date()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
const index = localStorage.getItem(storageKey.currentTab)
|
||||
if (index) {
|
||||
this.currentTab = parseFloat(index)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.handleActiveBar(this.currentTab)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -5,7 +5,6 @@
|
||||
<div class="explorer-top-tools-title">{{$t('overall.administration')}}</div>
|
||||
</div>
|
||||
<div style="width: 100%;padding-bottom: 26px;">
|
||||
<!--<administration-tabs :tabs-data="tabsData" />-->
|
||||
<chart-tabs :data="tabsData" router></chart-tabs>
|
||||
</div>
|
||||
<!-- 内容区 -->
|
||||
@@ -16,13 +15,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import AdministrationTabs from '@/views/administration/AdministrationTabs'
|
||||
import ChartTabs from '@/components/common/ChartTabs'
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
ChartTabs
|
||||
// AdministrationTabs
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
<template>
|
||||
<div class="npm-tabs">
|
||||
<div class="npm-tabs__active-bar"></div>
|
||||
<el-tabs v-model="currentTab" ref="elTabs" type="border-card" @tab-click="jumpPage">
|
||||
<el-tab-pane
|
||||
v-for="(tab,index) in tabs"
|
||||
:key="tab.i18n"
|
||||
:name="index"
|
||||
:disabled="tab.disable">
|
||||
<template #label>
|
||||
<div class="npm-tab__label">
|
||||
<i :class="tab.icon"></i>
|
||||
<span>{{ $t(tab.i18n) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import chartMixin from '@/views/charts2/chart-mixin'
|
||||
import { overwriteUrl, urlParamsHandler } from '@/utils/tools'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'DetectionTabs',
|
||||
data () {
|
||||
return {
|
||||
leftOffset: 27
|
||||
}
|
||||
},
|
||||
mixins: [chartMixin],
|
||||
setup (props) {
|
||||
const tabs = ref([])
|
||||
if (props.chart) {
|
||||
tabs.value = [...props.chart]
|
||||
tabs.value.forEach(item => {
|
||||
item.disable = false
|
||||
})
|
||||
}
|
||||
const { query } = useRoute()
|
||||
const tabIndexParam = query.tabIndex
|
||||
const currentTab = ref(tabIndexParam ? parseInt(tabIndexParam) : 0)
|
||||
return {
|
||||
currentTab,
|
||||
tabs
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
currentTab (n) {
|
||||
const { query } = this.$route
|
||||
const newUrl = urlParamsHandler(window.location.href, query, {
|
||||
tabIndex: n
|
||||
})
|
||||
overwriteUrl(newUrl)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.handleActiveBar(n)
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleActiveBar (index) {
|
||||
const tabDom = document.getElementById('tab-' + index)
|
||||
if (tabDom) {
|
||||
const offsetLeft = tabDom.offsetLeft
|
||||
const clientWidth = tabDom.clientWidth
|
||||
const clientLeft = tabDom.clientLeft
|
||||
const activeBar = document.querySelector('.npm-tabs .npm-tabs__active-bar')
|
||||
activeBar.style.cssText += `width: ${clientWidth + 2}px; left: ${offsetLeft + this.leftOffset + clientLeft - 1}px;`
|
||||
}
|
||||
},
|
||||
jumpPage (item) {
|
||||
this.$router.push({
|
||||
path: this.tabs[item.index].path,
|
||||
query: {
|
||||
t: +new Date(),
|
||||
tabIndex: this.currentTab
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
// setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
this.handleActiveBar(this.currentTab)
|
||||
})
|
||||
// }, 120)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,96 +0,0 @@
|
||||
<template>
|
||||
<div class="cn-builtin">
|
||||
<div class="cn-builtin-left">
|
||||
<div class="cn-builtin-left-title">
|
||||
{{$t('report.category')}}
|
||||
</div>
|
||||
<div class="cn-builtin-left-menu" :class="{'cn-active': !builtinId}" @click="builtinTabs(null)">
|
||||
{{$t('dns.all')}}
|
||||
</div>
|
||||
<div class="cn-builtin-left-menu" :class="{'cn-active': builtinId === item.id}" v-for="item in builtinReportLeftMenu" :key="item.id" @click="builtinTabs(item.id)">
|
||||
{{item.name}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="cn-builtin-right">
|
||||
<cn-data-list
|
||||
ref="dataList"
|
||||
:tableId="tableId"
|
||||
v-model:custom-table-title="tools.customTableTitle"
|
||||
:api="url"
|
||||
:from="fromRoute.builtinReport"
|
||||
:layout="['search']"
|
||||
@search="search"
|
||||
>
|
||||
<template #default>
|
||||
<builtin-report-table
|
||||
ref="dataTable"
|
||||
v-loading="tools.loading"
|
||||
:api="url"
|
||||
:custom-table-title="tools.customTableTitle"
|
||||
:height="mainTableHeight"
|
||||
:table-data="tableData"
|
||||
@download="download"
|
||||
@preview="preview"
|
||||
@orderBy="tableDataSort"
|
||||
@reload="getTableData"
|
||||
@selectionChange="selectionChange"
|
||||
/>
|
||||
</template>
|
||||
<template #pagination>
|
||||
<pagination ref="pagination" :page-obj="pageObj" :tableData="tableData" :table-id="tableId" @pageNo='pageNo' @pageSize='pageSize'></pagination>
|
||||
</template>
|
||||
</cn-data-list>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get } from '@/utils/http'
|
||||
import builtinReportTable from '@/components/table/report/builtinReportTable'
|
||||
import cnDataList from '@/components/table/CnDataList'
|
||||
import dataListMixin from '@/mixins/data-list'
|
||||
import { api } from '@/utils/api'
|
||||
|
||||
export default {
|
||||
name: 'Report',
|
||||
data () {
|
||||
return {
|
||||
builtinReportLeftMenu: [], // 左侧列表菜单数据
|
||||
builtinColor: false,
|
||||
builtinId: '',
|
||||
url: api.reportJob,
|
||||
blankObject: { // 空白对象
|
||||
id: '',
|
||||
name: '',
|
||||
ctime: '',
|
||||
remark: '',
|
||||
uniq: '',
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
tableId: 'builtinReportTable'
|
||||
}
|
||||
},
|
||||
mixins: [dataListMixin],
|
||||
components: {
|
||||
cnDataList,
|
||||
builtinReportTable
|
||||
},
|
||||
methods: {
|
||||
queryGetTempData () {
|
||||
get(api.reportTemp).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.builtinReportLeftMenu = res.data.list
|
||||
}
|
||||
})
|
||||
},
|
||||
builtinTabs (id) {
|
||||
this.getTableData({ tempId: id })
|
||||
this.builtinId = id
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.queryGetTempData()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user