fix: 1、修复customize只保留最后一项点击空白处,再打开customize新增选项,上次禁用的项还存在的问题;2、表格某一列数据为空时,添加-避免界面展示空白
This commit is contained in:
@@ -70,8 +70,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
custom: [],
|
custom: [],
|
||||||
dragIndex: -1,
|
dragIndex: -1,
|
||||||
selectList: [],
|
selectList: []
|
||||||
lastIndex: -1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@@ -95,19 +94,13 @@ export default {
|
|||||||
this.selectList = this.custom.filter(item => item.show)
|
this.selectList = this.custom.filter(item => item.show)
|
||||||
// 最少保留一个选项
|
// 最少保留一个选项
|
||||||
if (this.selectList.length === 1) {
|
if (this.selectList.length === 1) {
|
||||||
let index = -1
|
const obj = this.custom.find(item => item.prop === this.selectList[0].prop)
|
||||||
this.custom.find((item, i) => {
|
obj.disabled = true
|
||||||
index = i
|
} else if (this.selectList.length > 1) {
|
||||||
return item.prop === this.selectList[0].prop
|
|
||||||
})
|
|
||||||
this.lastIndex = index
|
|
||||||
this.custom[index].disabled = true
|
|
||||||
} else if (this.lastIndex > -1) {
|
|
||||||
this.custom.forEach(item => {
|
this.custom.forEach(item => {
|
||||||
// 该方案仅用于原始table列表无禁用的情况,目前无原始列表禁用的情况,后续有原始列表禁用的情况再修改
|
// 该方案仅用于原始table列表无禁用的情况,目前无原始列表禁用的情况,后续有原始列表禁用的情况再修改
|
||||||
item.disabled = false
|
item.disabled = false
|
||||||
})
|
})
|
||||||
this.lastIndex = -1
|
|
||||||
}
|
}
|
||||||
this.save()
|
this.save()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="col-resize-area"></div>
|
<div class="col-resize-area"></div>
|
||||||
</template>
|
</template>
|
||||||
<template #default="scope" :column="item">
|
<template #default="scope" :column="item">
|
||||||
<span>{{scope.row[item.prop]}}</span>
|
<span>{{scope.row[item.prop] || '-'}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column><template v-slot:empty >
|
</el-table-column><template v-slot:empty >
|
||||||
<div class="table-no-data" v-if="isNoData">
|
<div class="table-no-data" v-if="isNoData">
|
||||||
|
|||||||
@@ -43,15 +43,15 @@
|
|||||||
{{$t('operationLog.state.fail')}}
|
{{$t('operationLog.state.fail')}}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
{{scope.row[item.prop]}}
|
{{scope.row[item.prop] || '-'}}
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="item.prop === 'username'">{{formatUsername(scope.row)}}</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>
|
<span v-else-if="item.prop === 'ctime'">{{dateFormatByAppearance(scope.row[item.prop])}}</span>
|
||||||
<template v-else-if="item.prop === 'params' || item.prop === 'response'">
|
<template v-else-if="item.prop === 'params' || item.prop === 'response'">
|
||||||
<span>{{scope.row[item.prop]}}</span>
|
<span>{{scope.row[item.prop] || '-'}}</span>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{scope.row[item.prop]}}</span>
|
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-slot:empty >
|
<template v-slot:empty >
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<span>-</span>
|
<span>-</span>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{scope.row[item.prop]}}</span>
|
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-slot:empty >
|
<template v-slot:empty >
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'lastLoginTime'">
|
<template v-else-if="item.prop === 'lastLoginTime'">
|
||||||
<template v-if="scope.row[item.prop]">
|
<template v-if="scope.row[item.prop]">
|
||||||
{{dateFormatByAppearance(scope.row[item.prop])}}
|
{{dateFormatByAppearance(scope.row[item.prop]) || '-'}}
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
@change="()=>{statusChange(scope.row)}">
|
@change="()=>{statusChange(scope.row)}">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
</template>
|
</template>
|
||||||
<span v-else>{{scope.row[item.prop]}}</span>
|
<span v-else>{{scope.row[item.prop] || '-'}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-slot:empty >
|
<template v-slot:empty >
|
||||||
|
|||||||
@@ -117,9 +117,7 @@
|
|||||||
{{ handleTimeRange(scope.row) }}
|
{{ handleTimeRange(scope.row) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="item.prop === 'categoryId'">
|
<span v-else-if="item.prop === 'categoryId'">
|
||||||
<span v-for="(item, i) in categoryList" :key="i">
|
<span>{{ getCategoryName(scope.row.categoryId) }}</span>
|
||||||
<span v-if="scope.row.categoryId === item.id">{{ item.name }}</span>
|
|
||||||
</span>
|
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="item.prop === 'timePlan'">
|
<span v-else-if="item.prop === 'timePlan'">
|
||||||
<template v-if="scope.row.config && scope.row.config.isScheduler === 0">
|
<template v-if="scope.row.config && scope.row.config.isScheduler === 0">
|
||||||
@@ -768,6 +766,16 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.configCustom = str
|
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 () {
|
beforeUnmount () {
|
||||||
|
|||||||
Reference in New Issue
Block a user