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