perf: 优化名称显示

This commit is contained in:
ibuler
2022-03-22 10:26:57 +08:00
committed by 老广
parent 088dbc4e42
commit d3c2d0e7e8
2 changed files with 8 additions and 2 deletions

View File

@@ -43,7 +43,6 @@ export function getResourceNameByPath(path) {
export function getResourceFromApiUrl(apiUrl) {
const re = new RegExp('/api/v1/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/.*')
console.log('Api url: ', apiUrl)
const matched = apiUrl.match(re)
if (!matched) {
return { path: '', app: '', resource: '' }

View File

@@ -14,7 +14,7 @@
<span>{{ scope.row.value }}</span>
</template>
</el-table-column>
<el-table-column v-for="header in receiveBackends" :key="header.id" :label="header.name_display" width="120">
<el-table-column v-for="header in receiveBackends" :key="header.id" :label="getNameDisplay(header)" width="80">
<template v-slot="scope">
<span v-if="!scope.row.children">
<el-checkbox
@@ -105,6 +105,13 @@ export default {
console.log(err)
})
},
getNameDisplay(header) {
const displayName = header['name_display']
if (displayName === 'Site message') {
return 'Inbox'
}
return displayName
},
onOpenDialog(sub) {
this.currentEditSub = sub
this.dialogSelectedUsers = sub.receivers