Merge pull request #615 from veops/dev_ui_240913

feat(ui): add employeeTreeSelect otherOptions prop
This commit is contained in:
Leo Song 2024-09-13 18:36:48 +08:00 committed by GitHub
commit 12c7b564cd
1 changed files with 122 additions and 106 deletions

View File

@ -21,8 +21,10 @@
</template>
<script>
import _ from 'lodash'
import Treeselect from '@riophae/vue-treeselect'
import { formatOption } from '@/utils/util'
export default {
name: 'EmployeeTreeSelect',
components: {
@ -69,6 +71,11 @@ export default {
type: Boolean,
default: false,
},
// eslint-disable-next-line vue/require-default-prop
otherOptions: {
type: Array,
defualt: () => [],
}
},
data() {
return {}
@ -96,7 +103,16 @@ export default {
return this.provide_allTreeDepAndEmp()
},
employeeTreeSelectOption() {
return formatOption(this.allTreeDepAndEmp, this.idType, false, this.departmentKey, this.employeeKey)
return formatOption(
[
..._.cloneDeep(this.allTreeDepAndEmp),
..._.cloneDeep(this.otherOptions)
],
this.idType,
false,
this.departmentKey,
this.employeeKey
)
},
},
methods: {},