Merge pull request #3772 from jumpserver/pr@dev@detail_formatter

perf: 支持点击“转到”后进行颜色标识
This commit is contained in:
feng626
2024-03-06 19:11:00 +08:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
:disabled="disabled"
:type="col.type || 'info'"
class="detail"
:class="{ 'clicked': linkClicked }"
@click="goDetail"
>
<slot>
@@ -30,6 +31,7 @@ export default {
routeQuery: null,
can: true,
openInNewPage: false,
removeColorOnClick: false,
getTitle({ col, row, cellValue }) {
return cellValue
},
@@ -43,6 +45,7 @@ export default {
data() {
const formatterArgs = Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
return {
linkClicked: false,
formatterArgs: formatterArgs
}
},
@@ -100,6 +103,7 @@ export default {
methods: {
goDetail() {
if (this.formatterArgs.openInNewPage) {
this.linkClicked = this.formatterArgs.removeColorOnClick
const { href } = this.$router.resolve(this.detailRoute)
window.open(href, '_blank')
} else {
@@ -125,6 +129,11 @@ export default {
font-size: 13px;
}
.clicked,
.el-link.el-link--info.clicked {
color: inherit !important;
}
.icon {
width: 28px;
height: 28px;

View File

@@ -92,6 +92,7 @@ export default {
width: '80px',
formatterArgs: {
openInNewPage: true,
removeColorOnClick: true,
can: this.$hasPerm('terminal.view_session'),
getTitle() {
return vm.$t('sessions.goto')