summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/table/ColumnCustomize.vue15
-rw-r--r--src/components/table/administration/I18nTable.vue2
-rw-r--r--src/components/table/administration/OperationLogTable.vue6
-rw-r--r--src/components/table/administration/RoleTable.vue2
-rw-r--r--src/components/table/administration/UserTable.vue4
-rw-r--r--src/components/table/report/ReportTable.vue14
6 files changed, 22 insertions, 21 deletions
diff --git a/src/components/table/ColumnCustomize.vue b/src/components/table/ColumnCustomize.vue
index 64b42c7a..39a9898b 100644
--- a/src/components/table/ColumnCustomize.vue
+++ b/src/components/table/ColumnCustomize.vue
@@ -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()
},
diff --git a/src/components/table/administration/I18nTable.vue b/src/components/table/administration/I18nTable.vue
index a15b2bf4..edf1ee37 100644
--- a/src/components/table/administration/I18nTable.vue
+++ b/src/components/table/administration/I18nTable.vue
@@ -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">
diff --git a/src/components/table/administration/OperationLogTable.vue b/src/components/table/administration/OperationLogTable.vue
index 55b82d12..d1cb324c 100644
--- a/src/components/table/administration/OperationLogTable.vue
+++ b/src/components/table/administration/OperationLogTable.vue
@@ -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 >
diff --git a/src/components/table/administration/RoleTable.vue b/src/components/table/administration/RoleTable.vue
index 32967cd9..2cf7b9b9 100644
--- a/src/components/table/administration/RoleTable.vue
+++ b/src/components/table/administration/RoleTable.vue
@@ -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 >
diff --git a/src/components/table/administration/UserTable.vue b/src/components/table/administration/UserTable.vue
index 7b455a34..6a775844 100644
--- a/src/components/table/administration/UserTable.vue
+++ b/src/components/table/administration/UserTable.vue
@@ -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 >
diff --git a/src/components/table/report/ReportTable.vue b/src/components/table/report/ReportTable.vue
index 82ca82c8..98da0c60 100644
--- a/src/components/table/report/ReportTable.vue
+++ b/src/components/table/report/ReportTable.vue
@@ -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 () {