123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- <template>
- <!-- :load-tree-data="loadTreeData"
- :module-id="treeparams.moduleId" -->
- <icTreePicker
- :is-abandonment="isAbandonment"
- v-bind="pickerMixinProps"
- :load-tree-data="loadTreeData"
- :selectclick="selectclick"
- :default-expanded-keys="defaultExpandedKeys"
- :selecttype="selecttype"
- :types="types"
- :org-id="orgId"
- :version-id="versionId"
- option-value="code"
- option-label="text"
- :search-tree-data="searchTreeData"
- :render="(item, direction) => renderItem(item, direction)"
- v-on="$listeners"
- ><a-icon v-if="!readOnly" slot="suffixIcon" type="apartment" />
- </icTreePicker>
- </template>
- <script>
- // import AddressBook from '@/addressbook/group-user-service'
- // import auditPermissionTreeService from '../audit-permission-tree-service'
- import icTreeService from './ic-tree-service'
- import icTreePicker from './ic-tree-picker.vue'
- import pickerMixin from './picker-mixin'
- import components from './_import-components/ic-measure-picker-import'
- /**
- * 组织选择器
- * @displayName icMeasurPicker 组织选择器
- */
- export default {
- name: 'IcMeasurPicker',
- components: {
- ...components,
- icTreePicker,
- },
- mixins: [pickerMixin],
- props: {
- selectall: {
- type: Boolean,
- default: false,
- },
- selectclick: {
- type: Function,
- default: null,
- },
- /**
- * 根节点{code:'200000',name:'西安分公司'}
- */
- rootNode: {
- type: [Object, Array],
- default: undefined,
- },
- /**
- * 默认展开的节点['200000']
- */
- defaultExpandedKeys: {
- type: Array,
- default: undefined,
- },
- /**
- * 当开启分级授权时,是否过滤掉启用分级授权的子公司,true时过滤,false时不过滤
- *
- */
- hierarchical: {
- type: Boolean,
- default: undefined,
- },
- // 地址树接口数据源
- treeparams: {
- type: Object,
- default: () => {
- return {}
- },
- },
- // 根节点名称
- topNodeText: {
- type: String,
- default: '审计机构',
- },
- // 根节点ID
- topNodeId: {
- type: String,
- default: '0',
- },
- // 事项选择器
- versionId: {
- type: String,
- default: '',
- },
- orgId: {
- type: String,
- default: '',
- },
- orgName: {
- type: String,
- default: '',
- },
- selecttype: {
- type: String,
- default: 'control',
- },
- types: {
- type: String,
- default: 'NK',
- },
- isAbandonment: {
- type: String,
- default: 'NO',
- },
- },
- data() {
- return {
- defaultTopNodeId: -1,
- // defaultTopNodeText: '风控库',
- }
- },
- methods: {
- loadTreeData(depId) {
- const params = {
- auditOrgId: parseInt(this.orgId),
- versionId: parseInt(this.versionId),
- }
- this.defaultTopNodeText = this.orgName
- const getdata = new Promise((resolve) => {
- icTreeService.getCategoryTree(this.defaultTopNodeId, params, this.types).then((res1) => {
- this.spinning = false
- res1.data.forEach((item) => {
- item.code = item.id.toString()
- item.cat = true
- item.isLeaf = false
- })
- const treeNode = [
- {
- id: this.defaultTopNodeId,
- text: this.defaultTopNodeText,
- code: this.defaultTopNodeId.toString(),
- isLeaf: false,
- props: {
- isroot: true,
- },
- children: res1.data,
- key: this.defaultTopNodeId.toString(),
- cat: true,
- },
- ]
- resolve(treeNode)
- })
- })
- return getdata
- },
- searchTreeData(searchValue) {
- if (searchValue) {
- }
- },
- renderItem(item, direction) {
- let name = item.name
- if (name === undefined) {
- name = item.text
- }
- if (name.indexOf('/') > -1) {
- return <span title={name}>{name.split('/').pop()}</span>
- } else {
- return <span title={name}>{name}</span>
- }
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- </style>
|