mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
Merge pull request #3772 from jumpserver/pr@dev@detail_formatter
perf: 支持点击“转到”后进行颜色标识
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user