Compare commits
4 Commits
23.10.demo
...
dev-23.06
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
419a2c8905 | ||
|
|
1f8df7f404 | ||
|
|
8dc6f03df2 | ||
|
|
3a28cb45cd |
@@ -70,8 +70,7 @@ export default {
|
||||
return {
|
||||
custom: [],
|
||||
dragIndex: -1,
|
||||
selectList: [],
|
||||
lastIndex: -1
|
||||
selectList: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -95,19 +94,13 @@ export default {
|
||||
this.selectList = this.custom.filter(item => item.show)
|
||||
// 最少保留一个选项
|
||||
if (this.selectList.length === 1) {
|
||||
let index = -1
|
||||
this.custom.find((item, i) => {
|
||||
index = i
|
||||
return item.prop === this.selectList[0].prop
|
||||
})
|
||||
this.lastIndex = index
|
||||
this.custom[index].disabled = true
|
||||
} else if (this.lastIndex > -1) {
|
||||
const obj = this.custom.find(item => item.prop === this.selectList[0].prop)
|
||||
obj.disabled = true
|
||||
} else if (this.selectList.length > 1) {
|
||||
this.custom.forEach(item => {
|
||||
// 该方案仅用于原始table列表无禁用的情况,目前无原始列表禁用的情况,后续有原始列表禁用的情况再修改
|
||||
item.disabled = false
|
||||
})
|
||||
this.lastIndex = -1
|
||||
}
|
||||
this.save()
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="col-resize-area"></div>
|
||||
</template>
|
||||
<template #default="scope" :column="item">
|
||||
<span>{{scope.row[item.prop]}}</span>
|
||||
<span>{{scope.row[item.prop] || '-'}}</span>
|
||||
</template>
|
||||
</el-table-column><template v-slot:empty >
|
||||
<div class="table-no-data" v-if="isNoData">
|
||||
|
||||
@@ -43,15 +43,15 @@
|
||||
{{$t('operationLog.state.fail')}}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{scope.row[item.prop]}}
|
||||
{{scope.row[item.prop] || '-'}}
|
||||
</template>
|
||||
</span>
|
||||
<span v-else-if="item.prop === 'username'">{{formatUsername(scope.row)}}</span>
|
||||
<span v-else-if="item.prop === 'ctime'">{{dateFormatByAppearance(scope.row[item.prop])}}</span>
|
||||
<template v-else-if="item.prop === 'params' || item.prop === 'response'">
|
||||
<span>{{scope.row[item.prop]}}</span>
|
||||
<span>{{scope.row[item.prop] || '-'}}</span>
|
||||
</template>
|
||||
<span v-else>{{scope.row[item.prop]}}</span>
|
||||
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-slot:empty >
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<span>-</span>
|
||||
</template>
|
||||
</template>
|
||||
<span v-else>{{scope.row[item.prop]}}</span>
|
||||
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-slot:empty >
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</template>
|
||||
<template v-else-if="item.prop === 'lastLoginTime'">
|
||||
<template v-if="scope.row[item.prop]">
|
||||
{{dateFormatByAppearance(scope.row[item.prop])}}
|
||||
{{dateFormatByAppearance(scope.row[item.prop]) || '-'}}
|
||||
</template>
|
||||
<template v-else>
|
||||
<span>-</span>
|
||||
@@ -60,7 +60,7 @@
|
||||
@change="()=>{statusChange(scope.row)}">
|
||||
</el-switch>
|
||||
</template>
|
||||
<span v-else>{{scope.row[item.prop]}}</span>
|
||||
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-slot:empty >
|
||||
|
||||
@@ -117,9 +117,7 @@
|
||||
{{ handleTimeRange(scope.row) }}
|
||||
</span>
|
||||
<span v-else-if="item.prop === 'categoryId'">
|
||||
<span v-for="(item, i) in categoryList" :key="i">
|
||||
<span v-if="scope.row.categoryId === item.id">{{ item.name }}</span>
|
||||
</span>
|
||||
<span>{{ getCategoryName(scope.row.categoryId) }}</span>
|
||||
</span>
|
||||
<span v-else-if="item.prop === 'timePlan'">
|
||||
<template v-if="scope.row.config && scope.row.config.isScheduler === 0">
|
||||
@@ -768,6 +766,16 @@ export default {
|
||||
}
|
||||
}
|
||||
this.configCustom = str
|
||||
},
|
||||
getCategoryName (id) {
|
||||
let name = '-'
|
||||
for (let i = 0; i < this.categoryList.length; i++) {
|
||||
if (id === this.categoryList[i].id) {
|
||||
name = this.categoryList[i].name
|
||||
break
|
||||
}
|
||||
}
|
||||
return name
|
||||
}
|
||||
},
|
||||
beforeUnmount () {
|
||||
|
||||
@@ -231,6 +231,7 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.linkNoData = data.length === 0
|
||||
data.forEach((item) => {
|
||||
item.totalBitsRate = item.egressBitsRate + item.ingressBitsRate
|
||||
})
|
||||
@@ -246,7 +247,7 @@ export default {
|
||||
this.linkData = sorted
|
||||
}
|
||||
} else {
|
||||
this.linkNoData = false
|
||||
this.linkNoData = true
|
||||
this.showError1 = true
|
||||
this.errorMsg1 = this.errorMsgHandler(res[0])
|
||||
}
|
||||
@@ -267,7 +268,7 @@ export default {
|
||||
directionArr = Array.from(new Set(directionArr))
|
||||
|
||||
const newNextHopData = []
|
||||
|
||||
this.nextHopNoData = directionArr.length === 0
|
||||
directionArr.forEach((item1) => {
|
||||
const newObj = { egressBitsRate: 0, ingressBitsRate: 0, totalBitsRate: 0, linkDirection: item1 }
|
||||
nextHopData.forEach((item2) => {
|
||||
@@ -309,7 +310,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
this.showError2 = true
|
||||
this.nextHopNoData = false
|
||||
this.nextHopNoData = true
|
||||
this.errorMsg2 = this.errorMsgHandler(res[1])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,10 +138,11 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.isLinkNoData = linkGridData.length === 0
|
||||
this.linkGridData = linkGridData
|
||||
}
|
||||
} else {
|
||||
this.isLinkNoData = false
|
||||
this.isLinkNoData = true
|
||||
this.isLinkShowError = true
|
||||
this.linkErrorMsg = this.errorMsgHandler(res[0])
|
||||
}
|
||||
@@ -227,10 +228,11 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.isNextNoData = nextGridData.length === 0
|
||||
this.nextGridData = nextGridData
|
||||
}
|
||||
} else {
|
||||
this.isNextNoData = false
|
||||
this.isNextNoData = true
|
||||
this.isNextShowError = true
|
||||
this.nextErrorMsg = this.errorMsgHandler(res[1])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user