123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <div>
- <a-card :class="$style.tree" bordered size="small">
- <a-input-search slot="title" v-model="searchValue" placeholder="搜索" @search="onSearch" />
- <a-checkbox slot="extra" v-model="isContainSub">含下级</a-checkbox>
- <AuditGroupTree
- :root-node="rootNode"
- :hierarchical="hierarchical"
- @update:selectedKeys="handleTreeSelect"
- />
- </a-card>
- <sd-picker-source-lazy-list
- v-if="key"
- :key="listKey + isContainSub"
- v-bind="$attrs"
- :load-list-data="() => loadListData()"
- :show-search="false"
- v-on="$listeners"
- />
- </div>
- </template>
- <script>
- import AddressBook from '@/addressbook/group-user-service'
- import AuditGroupTree from './audit-group-tree.vue'
- import components from './_import-components/audit-picker-users-by-group-import'
- export default {
- name: 'AuditPickerUsersByGroup',
- metaInfo: {},
- components: {
- ...components,
- AuditGroupTree,
- },
- inheritAttrs: false,
- props: {
- title: {
- type: String,
- default: '',
- },
- icon: {
- type: String,
- default: '',
- },
- rootNode: {
- type: [Object, Array],
- default: undefined,
- },
- hierarchical: {
- type: Boolean,
- default: undefined,
- },
- secretLevel: {
- type: String,
- default: '',
- },
- },
- data() {
- return {
- key: '',
- isContainSub: false,
- searchValue: '',
- listKey: '',
- }
- },
- methods: {
- handleTreeSelect(key) {
- this.key = key[0]
- this.listKey = this.key
- this.searchValue = ''
- },
- loadListData() {
- if (this.searchValue) {
- return AddressBook.usersQuery(this.searchValue, [], {
- secretLevel: this.secretLevel,
- hierarchical: this.hierarchical,
- })
- }
- if (this.key) {
- return AddressBook.getChildNodes(this.key, {
- type: 'U',
- isContainSub: this.isContainSub,
- secretLevel: this.secretLevel,
- hierarchical: this.hierarchical,
- })
- }
- },
- onSearch() {
- this.listKey = this.searchValue
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .tree {
- position: absolute;
- top: -41px;
- left: -285px;
- width: 275px;
- height: calc(100% + 42px);
- :global(.ant-card-body) {
- height: calc(100% - 42px);
- padding: 0;
- > div {
- height: 100%;
- overflow: auto;
- }
- }
- :global(.ant-card-head > .ant-card-head-wrapper > .ant-card-head-title) {
- padding: 0;
- margin-right: 4px;
- }
- }
- </style>
|