|
@@ -5,10 +5,15 @@
|
|
</style>
|
|
</style>
|
|
<template>
|
|
<template>
|
|
<div class="select-project">
|
|
<div class="select-project">
|
|
- <!-- <treeselect :options="options"
|
|
|
|
|
|
+ <treeselect :options="options"
|
|
:multiple="multiple"
|
|
:multiple="multiple"
|
|
|
|
+ :disable-branch-nodes="!multiple"
|
|
|
|
+ :load-options="loadOptions"
|
|
placeholder="请选择项目以及账户"
|
|
placeholder="请选择项目以及账户"
|
|
v-model="value"
|
|
v-model="value"
|
|
|
|
+ :value-consists-of="valueConsistsOf"
|
|
|
|
+ :auto-load-root-options="false"
|
|
|
|
+ @select="update"
|
|
@input="emitValue"
|
|
@input="emitValue"
|
|
:limit="2"
|
|
:limit="2"
|
|
:limitText="
|
|
:limitText="
|
|
@@ -16,18 +21,19 @@
|
|
return '隐藏' + count + '条'
|
|
return '隐藏' + count + '条'
|
|
}
|
|
}
|
|
"
|
|
"
|
|
|
|
+ noChildrenText="该项目下暂无账号"
|
|
noOptionsText="loading..."
|
|
noOptionsText="loading..."
|
|
>
|
|
>
|
|
<div slot="value-label" slot-scope="{ node }">{{ node.raw.customLabel }}</div>
|
|
<div slot="value-label" slot-scope="{ node }">{{ node.raw.customLabel }}</div>
|
|
- </treeselect> -->
|
|
|
|
|
|
+ </treeselect>
|
|
|
|
|
|
- <treeselect :options="options" @input="emitValue" placeholder="请选择项目以及账户" v-model="value" :multiple="multiple" noOptionsText="loading..." :limit="2"
|
|
|
|
|
|
+ <!-- <treeselect :options="options" @input="emitValue" placeholder="请选择项目以及账户" v-model="value" :multiple="multiple" noOptionsText="loading..." :limit="2"
|
|
:limitText="
|
|
:limitText="
|
|
count => {
|
|
count => {
|
|
return '隐藏' + count + '条'
|
|
return '隐藏' + count + '条'
|
|
}
|
|
}
|
|
">
|
|
">
|
|
- </treeselect>
|
|
|
|
|
|
+ </treeselect> -->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -54,9 +60,32 @@
|
|
data: () => ({
|
|
data: () => ({
|
|
multiple: true,
|
|
multiple: true,
|
|
value: null,
|
|
value: null,
|
|
- options: []
|
|
|
|
|
|
+ options: [],
|
|
|
|
+ valueConsistsOf: 'LEAF_PRIORITY',
|
|
|
|
|
|
}),
|
|
}),
|
|
|
|
+ props: {
|
|
|
|
+ // multiple: {
|
|
|
|
+ // type: Boolean,
|
|
|
|
+ // default() {
|
|
|
|
+ // return true
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ appId: {},
|
|
|
|
+ // request: {
|
|
|
|
+ // type: String,
|
|
|
|
+ // default() {
|
|
|
|
+ // return '2'
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ reqUrl: {
|
|
|
|
+ type: String,
|
|
|
|
+ default () {
|
|
|
|
+ return '/ctop/projectMember/participateList'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
components: {
|
|
components: {
|
|
Treeselect
|
|
Treeselect
|
|
},
|
|
},
|
|
@@ -82,6 +111,27 @@
|
|
console.log(this.value)
|
|
console.log(this.value)
|
|
this.$emit('update:appId', this.value)
|
|
this.$emit('update:appId', this.value)
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ update(node, id) {
|
|
|
|
+
|
|
|
|
+ getAction('/ctop/projectMember/bytedanceProjectParticipateInList', { projectId: node.id }).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ if (res.result.length > 0) {
|
|
|
|
+ node.children = res.result.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.accountId,
|
|
|
|
+ label: item.userName + ' ' + item.authName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ new Error('Failed to load options: network error.')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getChildren() {},
|
|
getChildren() {},
|
|
getParticipateList() {
|
|
getParticipateList() {
|
|
//我参与的
|
|
//我参与的
|
|
@@ -97,8 +147,36 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ loadOptions({ action, parentNode, callback }) {
|
|
|
|
+ console.log({ action, parentNode, callback })
|
|
|
|
+ // Typically, do the AJAX stuff here.
|
|
|
|
+ // Once the server has responded,
|
|
|
|
+ // assign children options to the parent node & call the callback.
|
|
|
|
+ if (action === LOAD_CHILDREN_OPTIONS) {
|
|
|
|
+ getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: parentNode.id }).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.code == 0) {
|
|
|
|
+ if (res.result.length > 0) {
|
|
|
|
+ parentNode.children = res.result.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ id: item.accountId,
|
|
|
|
+ label: item.userName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item.authName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ callback()
|
|
|
|
+ } else {
|
|
|
|
+ parentNode.children = []
|
|
|
|
+ callback()
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ callback(new Error('Failed to load options: network error.'))
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ },
|
|
|
|
|
|
activated() {
|
|
activated() {
|
|
this.getParticipateList()
|
|
this.getParticipateList()
|