fix: 修复项目运行时eslint报错的提示

This commit is contained in:
刘洪洪
2023-03-02 17:55:47 +08:00
parent 5685e6b2c0
commit 3fc6a42d99
5 changed files with 21 additions and 23 deletions

View File

@@ -319,7 +319,6 @@ export default {
} }
} }
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '') const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '') const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '')

View File

@@ -110,7 +110,6 @@
<script> <script>
import table from '@/mixins/table' import table from '@/mixins/table'
import { panelTypeAndRouteMapping } from '@/utils/constants' import { panelTypeAndRouteMapping } from '@/utils/constants'
import { api } from '@/utils/api'
export default { export default {
name: 'chartTable', name: 'chartTable',

View File

@@ -1,6 +1,5 @@
import router from './router' import router from './router'
import store from './store' import store from './store'
import { ElMessage } from 'element-plus'
import { getPermission } from '@/utils/api' import { getPermission } from '@/utils/api'
import { loadGeoData } from '@/utils/tools' import { loadGeoData } from '@/utils/tools'
import axios from 'axios' import axios from 'axios'
@@ -18,6 +17,7 @@ router.beforeEach(async (to, from, next) => {
loadGeoData() loadGeoData()
// 加载baseUrl // 加载baseUrl
if (!axios.defaults.baseURL) { if (!axios.defaults.baseURL) {
// eslint-disable-next-line no-undef
axios.defaults.baseURL = BASE_CONFIG.baseUrl axios.defaults.baseURL = BASE_CONFIG.baseUrl
} }
if (localStorage.getItem(storageKey.token)) { if (localStorage.getItem(storageKey.token)) {
@@ -81,7 +81,7 @@ export function hasMenu (menuList, route) {
export function hasParam (url, param) { export function hasParam (url, param) {
let hasParam = false let hasParam = false
let tempArr = url.split('?') let tempArr = url.split('?')
const query = {} // const query = {}
if (tempArr[1]) { if (tempArr[1]) {
tempArr = tempArr[1].split('&') tempArr = tempArr[1].split('&')
tempArr.forEach(t => { tempArr.forEach(t => {

View File

@@ -532,14 +532,14 @@ export function getUserDrilldownTableGeo (userId) {
return data[userId] return data[userId]
} }
function JSONParse (data) { // function JSONParse (data) {
const firstParse = JSON.parse(data) // const firstParse = JSON.parse(data)
if (typeof firstParse === 'string') { // if (typeof firstParse === 'string') {
return JSON.parse(firstParse) // return JSON.parse(firstParse)
} else { // } else {
return firstParse // return firstParse
} // }
} // }
export function copyValue (item) { export function copyValue (item) {
const str = item const str = item
@@ -879,8 +879,8 @@ export async function getDnsMapData (type) {
export function handleSpecialValue (value) { export function handleSpecialValue (value) {
if (value) { if (value) {
value.replace(/\'/g, "\\\\'") value.replace(/\'/g, "\\\\'")
.replace(/\"/g, '\\"') .replace(/\"/g, '\\"')
.replace(/\&/g, '%26') .replace(/\&/g, '%26')
} }
return value return value
} }
@@ -894,13 +894,13 @@ export function combineTabList (tableType, list, commonTabList) {
const commonTab = commonTabList.find(item => item.name === tabName) const commonTab = commonTabList.find(item => item.name === tabName)
tab.label = commonTab ? commonTab.i18n : '' tab.label = commonTab ? commonTab.i18n : ''
tab.prop = commonTab ? commonTab.prop : '' tab.prop = commonTab ? commonTab.prop : ''
if (!tab.hasOwnProperty('checked')) { if (!Object.prototype.hasOwnProperty.call(tab, 'checked')) {
tab.checked = tab ? tab.show : true tab.checked = tab ? tab.show : true
} }
if (!tab.hasOwnProperty('disabled')) { if (!Object.prototype.hasOwnProperty.call(tab, 'disabled')) {
tab.disabled = tab ? !tab.enable : false tab.disabled = tab ? !tab.enable : false
} }
if (!tab.hasOwnProperty('panelId')) { if (!Object.prototype.hasOwnProperty.call(tab, 'panelId')) {
tab.panelId = tab ? tab.panelIdOfFourthMenu : null tab.panelId = tab ? tab.panelIdOfFourthMenu : null
} }
// 代码里写死的 // 代码里写死的

View File

@@ -1543,13 +1543,13 @@ export default {
const commonTab = this.commonTabList.find(item => item.name === tabName) const commonTab = this.commonTabList.find(item => item.name === tabName)
tab.label = commonTab ? commonTab.i18n : '' tab.label = commonTab ? commonTab.i18n : ''
tab.prop = commonTab ? commonTab.prop : '' tab.prop = commonTab ? commonTab.prop : ''
if (!tab.hasOwnProperty('checked') || tab.checked === undefined || tab.checked === null) { if (!Object.prototype.hasOwnProperty.call(tab, 'checked') || tab.checked === undefined || tab.checked === null) {
tab.checked = tab ? tab.show : true tab.checked = tab ? tab.show : true
} }
if (!tab.hasOwnProperty('disabled') || tab.disabled === undefined || tab.disabled === null) { if (!Object.prototype.hasOwnProperty.call(tab, 'disabled') || tab.disabled === undefined || tab.disabled === null) {
tab.disabled = tab ? !tab.enable : false tab.disabled = tab ? !tab.enable : false
} }
if (!tab.hasOwnProperty('panelId') || tab.panelId === undefined || tab.panelId === null) { if (!Object.prototype.hasOwnProperty.call(tab, 'panelId') || tab.panelId === undefined || tab.panelId === null) {
tab.panelId = tab ? tab.panelIdOfFourthMenu : null tab.panelId = tab ? tab.panelIdOfFourthMenu : null
} }
// 代码里写死的 // 代码里写死的
@@ -1566,7 +1566,7 @@ export default {
const drilldownTabFull = [] const drilldownTabFull = []
const drilldownTabList = tab.drilldownTabs const drilldownTabList = tab.drilldownTabs
drilldownTabList.forEach(drilldownTab => { drilldownTabList.forEach(drilldownTab => {
if (!drilldownTab.hasOwnProperty('name') || drilldownTab.name === undefined || drilldownTab.name === null) { if (!Object.prototype.hasOwnProperty.call(drilldownTab, 'name') || drilldownTab.name === undefined || drilldownTab.name === null) {
const drilldownTabName = drilldownTab ? (drilldownTab.name ? drilldownTab.name : drilldownTab) : '' const drilldownTabName = drilldownTab ? (drilldownTab.name ? drilldownTab.name : drilldownTab) : ''
const fullTab = oldList.find(item => item.name === drilldownTabName) const fullTab = oldList.find(item => item.name === drilldownTabName)
const drilldownTabWithAllInfo = this.$_.cloneDeep(fullTab) const drilldownTabWithAllInfo = this.$_.cloneDeep(fullTab)
@@ -1664,7 +1664,7 @@ export default {
let isSetDrilldownTabInfo = false let isSetDrilldownTabInfo = false
if (tabList && tabList.length > 0) { if (tabList && tabList.length > 0) {
const drilldownTab = tabList[0].drilldownTabs const drilldownTab = tabList[0].drilldownTabs
if (drilldownTab && drilldownTab.length > 0 && drilldownTab.hasOwnProperty('name')) { if (drilldownTab && drilldownTab.length > 0 && Object.prototype.hasOwnProperty.call(drilldownTab, 'name')) {
isSetDrilldownTabInfo = true isSetDrilldownTabInfo = true
} }
} }
@@ -1747,7 +1747,7 @@ export default {
const tabItem = this.curTable.tabs.find(tabItem => tabItem.name === tab.name) const tabItem = this.curTable.tabs.find(tabItem => tabItem.name === tab.name)
tab.hiddenDrilldownTabs = this.getHiddenDrilldownTabNameGroup(tabItem) tab.hiddenDrilldownTabs = this.getHiddenDrilldownTabNameGroup(tabItem)
if (tab && tab.hasMetricSearch === true) { if (tab && tab.hasMetricSearch === true) {
const columnsForMetric = tab.metrics.find(metric => metric.name === this.metric) // const columnsForMetric = tab.metrics.find(metric => metric.name === this.metric)
tab.metrics.forEach(metric => { tab.metrics.forEach(metric => {
const oldSortColumns = metric.columns const oldSortColumns = metric.columns
const newSortColumns = this.customTableTitles.slice(1) const newSortColumns = this.customTableTitles.slice(1)