1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
| <template>
| <zt-project-list-selector
| ref="selector"
| v-model="selectValue"
| title="项目清单选择"
| :projectId="projectId"
| :showLevel="showLevel"
| :disabled="disabled"
| :multiple="multiple"
| :lazy="true"
| :check-strictly="true"
| :disabled-filter="disabledFilter"
| :placeholder="placeholder"
| @confirm="onConfirm"
| />
|
| </template>
| <script>
|
| export default {
| name: 'ProjectListSelectDialog',
| components: {},
| props: {
| value: [String, Array],
| parentIds: [String, Number], // 所展示树的根节点(某些地方要求可选项要在选择的产品节点的下级)
| projectId: String, // X号ID
| showLevel: {// 显示层级
| type: String,
| default: 'L5'
| },
| canSelectLevel: String, // 可选节点的层级
| multiple: {
| type: Boolean,
| default: false
| },
| disabled: {
| type: Boolean,
| default: false
| },
| placeholder: String
| },
| data() {
| return {
| selectValue: this.value || ''
| }
| },
| watch: {
| value(val, oldval) { // 传递给tree-selector
| this.selectValue = val
| },
| parentIds(val, oldVal) {
| this.reloadDatas()
| }
| },
| methods: {
| async reloadDatas() {
| // let res = await this.$http.get(`/product/treeSelect?parentIds=${this.parentIds}&showLevel=${this.showLevel}`, null)
| // this.$refs.selector.datas = res.data
| // this.$refs.selector.setTextOnetime()
| },
| disabledFilter(node) {
| return false
| //return this.canSelectLevel && this.canSelectLevel !== node.level
| },
| onConfirm(value, selectedData) {
| this.$emit('input', value)
| this.$emit('confirm', value, selectedData)
| }
| }
| }
| </script>
|
|