mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
perf: 修改 accounts
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
<el-tree
|
<el-tree
|
||||||
:data="iTree"
|
:data="iTree"
|
||||||
:default-checked-keys="iValue"
|
:default-checked-keys="iValue"
|
||||||
:default-expand-all="true"
|
:default-expand-all="expandAll"
|
||||||
:default-expanded-keys="iValue"
|
:default-expanded-keys="defaultExpanded"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
:render-content="renderContent"
|
:render-content="renderContent"
|
||||||
class="el-tree-custom"
|
class="el-tree-custom"
|
||||||
@@ -27,6 +27,14 @@ export default {
|
|||||||
readonly: {
|
readonly: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
expandAll: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
defaultExpanded: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -95,7 +103,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
.el-tree-custom > > > {
|
.el-tree-custom ::v-deep {
|
||||||
.help-tips {
|
.help-tips {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@@ -105,6 +113,16 @@ export default {
|
|||||||
.el-tree-node__content:hover {
|
.el-tree-node__content:hover {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .el-tree-node > {
|
||||||
|
.el-tree-node__content > .el-tree-node__expand-icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tree-node__children {
|
||||||
|
margin-left: -25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -244,24 +244,21 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initDefaultChoice() {
|
initDefaultChoice() {
|
||||||
const choicesSelected = this.value.filter(i => i.startsWith('@'))
|
const choicesSelected = this.value.filter(i => {
|
||||||
|
return i.startsWith('@') && i !== this.SPEC && i !== this.VIRTUAL
|
||||||
|
})
|
||||||
// 是否添加特定账号选择
|
// 是否添加特定账号选择
|
||||||
const specAccountsInput = this.value.filter(i => !i.startsWith('@'))
|
const specAccountsInput = this.value.filter(i => !i.startsWith('@') && i !== this.SPEC)
|
||||||
if (specAccountsInput.length > 0 && !choicesSelected.includes(this.ALL)) {
|
if (specAccountsInput.length > 0 && !choicesSelected.includes(this.ALL)) {
|
||||||
choicesSelected.push(this.SPEC)
|
choicesSelected.push(this.SPEC)
|
||||||
this.showSpecAccounts = true
|
this.showSpecAccounts = true
|
||||||
}
|
}
|
||||||
if (this.value.indexOf(this.SPEC) > -1) {
|
|
||||||
this.showSpecAccounts = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 是否添加虚拟账号选择
|
// 是否添加虚拟账号选择
|
||||||
const hasVirtual = this.value.filter(i => {
|
const hasVirtual = this.value.filter(i => {
|
||||||
return i && i.startsWith('@') && i !== '@ALL' && i !== '@SPEC'
|
return i && i.startsWith('@') && i !== '@ALL' && i !== '@SPEC'
|
||||||
})
|
})
|
||||||
if (hasVirtual.length > 0 && !choicesSelected.includes(this.VIRTUAL)) {
|
if (hasVirtual.length > 0 && !choicesSelected.includes(this.VIRTUAL)) {
|
||||||
this.choicesSelected = [...choicesSelected, this.VIRTUAL]
|
choicesSelected.push(this.VIRTUAL)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果没有就设置 ALL
|
// 如果没有就设置 ALL
|
||||||
|
Reference in New Issue
Block a user