Commit bc1221ee authored by 黎博's avatar 黎博

对象转数组做个兼容

parent 26bb2da1
......@@ -399,22 +399,28 @@ export default {
// 将数组转成对象存储
this.FormatTabledata = {}
original.forEach((item, index) => {
if (Object.keys(this.FormatTabledata).indexOf(item.labels.type) > -1) {
if (item !== null) {
if (
Object.keys(this.FormatTabledata).indexOf(item.labels.type) > -1
) {
this.FormatTabledata[item.labels.type].push(item)
} else {
this.FormatTabledata[item.labels.type] = []
this.FormatTabledata[item.labels.type].push(item)
}
}
})
},
// 获取服务列表
getServiceList() {
const tLoading = this.$loading.service(this.loadingOptions)
getServiceList({ namespace: this.namespace }).then((resp) => {
getServiceList({ namespace: this.namespace })
.then((resp) => {
const serviceList = resp.data.data
this.array2Object(serviceList)
tLoading.close()
}).catch(() => {
})
.catch(() => {
tLoading.close()
})
},
......@@ -486,11 +492,15 @@ export default {
},
// 清空redis
clearRedis() {
this.$confirm(`此操作将清空${this.namespace}环境所有Redis缓存, 是否继续?`, '提示', {
this.$confirm(
`此操作将清空${this.namespace}环境所有Redis缓存, 是否继续?`,
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
}
).then(() => {
var formdata = new FormData()
formdata.set('namespace', this.namespace)
flushRedis(formdata).then((resp) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment