zydx-plus 1.32.239 → 1.32.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/treeList/src/treeList.vue +135 -114
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,138 +1,159 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
<div class="list">
|
|
3
|
+
<div class="list-cont" v-if="list.length > 0">
|
|
4
|
+
<div class="list-li"
|
|
5
|
+
:style="{'border-bottom': (link)? '1px solid #ccc': '0', 'color': (active === index)? activeColor : '#333'}"
|
|
6
|
+
@click="listTap(item,index)" v-for="(item,index) in list" :key="index">
|
|
7
|
+
<div class="list-title">
|
|
8
|
+
<span :style="{'font-size': column[0].fontSize + 'px', 'font-weight': column[0].fontWeight}">{{
|
|
9
|
+
index + 1
|
|
10
|
+
}}. {{ (angleBrackets) ? '《' : '' }} {{ item[column[0].label] }} {{
|
|
11
|
+
(angleBrackets) ? '》' : ''
|
|
12
|
+
}}</span>
|
|
13
|
+
<button v-if="delShow" @click="del(item)">{{ delText }}</button>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="list-cont" v-if="open">
|
|
16
|
+
<div class="list-li-cont">
|
|
17
|
+
<p v-for="(it,ind) in column.slice(1, column.length)" :key="ind">{{ it.name }}:{{
|
|
18
|
+
item[it.label]
|
|
19
|
+
}}</p>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="list-cont" v-else>
|
|
23
|
+
<div class="list-li-cont" v-if="active === index">
|
|
24
|
+
<p v-for="(it,ind) in column.slice(1, column.length)" :key="ind">{{ it.name }}:{{
|
|
25
|
+
item[it.label]
|
|
26
|
+
}}</p>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
17
29
|
</div>
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
</div>
|
|
31
|
+
<div v-else class="wu">暂无数据</div>
|
|
20
32
|
</div>
|
|
21
|
-
<div v-else class="wu">暂无数据</div>
|
|
22
|
-
</div>
|
|
23
33
|
</template>
|
|
24
34
|
|
|
25
35
|
<script>
|
|
26
36
|
export default {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
props: {
|
|
34
|
-
list: { // 数据列表
|
|
35
|
-
type: Array,
|
|
36
|
-
default: () => []
|
|
37
|
-
},
|
|
38
|
-
column: { // 数据列表
|
|
39
|
-
type: Array,
|
|
40
|
-
default: () => []
|
|
41
|
-
},
|
|
42
|
-
delShow: { //是否显示取消按钮
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: false
|
|
37
|
+
name: "zydx-tree-list",
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
active: this.actives,
|
|
41
|
+
}
|
|
45
42
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
props: {
|
|
44
|
+
list: { // 数据列表
|
|
45
|
+
type: Array,
|
|
46
|
+
default: () => []
|
|
47
|
+
},
|
|
48
|
+
column: { // 数据列表
|
|
49
|
+
type: Array,
|
|
50
|
+
default: () => []
|
|
51
|
+
},
|
|
52
|
+
delShow: { //是否显示取消按钮
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
angleBrackets: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
open: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
link: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
activeColor: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: '#e20808'
|
|
71
|
+
},
|
|
72
|
+
actives: {
|
|
73
|
+
type: Number,
|
|
74
|
+
default: 0
|
|
75
|
+
},
|
|
76
|
+
delText: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: '删除'
|
|
79
|
+
}
|
|
49
80
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
81
|
+
watch: {
|
|
82
|
+
actives(val) {
|
|
83
|
+
if (val === -1) return
|
|
84
|
+
this.active = val
|
|
85
|
+
}
|
|
53
86
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
actives: {
|
|
63
|
-
type: Number,
|
|
64
|
-
default: 0
|
|
65
|
-
},
|
|
66
|
-
delText: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: '删除'
|
|
87
|
+
methods: {
|
|
88
|
+
del(data) {
|
|
89
|
+
this.$emit('del', data)
|
|
90
|
+
},
|
|
91
|
+
listTap(data, index) {
|
|
92
|
+
this.active = index
|
|
93
|
+
this.$emit('confirm', data)
|
|
94
|
+
},
|
|
69
95
|
}
|
|
70
|
-
},
|
|
71
|
-
watch: {
|
|
72
|
-
actives(val) {
|
|
73
|
-
if(val === -1) return
|
|
74
|
-
this.active = val
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
methods: {
|
|
78
|
-
del(data) {
|
|
79
|
-
this.$emit('del',data)
|
|
80
|
-
},
|
|
81
|
-
listTap(data,index) {
|
|
82
|
-
this.active = index
|
|
83
|
-
this.$emit('confirm',data)
|
|
84
|
-
},
|
|
85
|
-
}
|
|
86
96
|
}
|
|
87
97
|
</script>
|
|
88
98
|
|
|
89
99
|
<style scoped>
|
|
90
|
-
.wu{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
.wu {
|
|
101
|
+
text-align: center;
|
|
102
|
+
font-size: 18px;
|
|
103
|
+
padding: 40px 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.list-title {
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
line-height: 30px;
|
|
94
110
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
|
|
112
|
+
.list-title > span {
|
|
113
|
+
flex: 1;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
text-overflow: ellipsis;
|
|
117
|
+
height: 30px;
|
|
118
|
+
font-size: 16px;
|
|
99
119
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
|
|
121
|
+
.list-title > button {
|
|
122
|
+
margin-left: 5px;
|
|
123
|
+
margin-top: 4px;
|
|
124
|
+
font-size: 12px;
|
|
125
|
+
background-color: transparent;
|
|
126
|
+
border: 1px solid #000;
|
|
127
|
+
border-radius: 3px;
|
|
128
|
+
padding: 2px 5px;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
height: 22px;
|
|
131
|
+
min-width: 60px;
|
|
106
132
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
background-color: transparent;
|
|
112
|
-
border: 1px solid #000;
|
|
113
|
-
border-radius: 3px;
|
|
114
|
-
padding: 2px 5px;
|
|
115
|
-
cursor: pointer;
|
|
116
|
-
height: 22px;
|
|
117
|
-
min-width: 60px;
|
|
133
|
+
|
|
134
|
+
.list {
|
|
135
|
+
padding: 0 10px;
|
|
136
|
+
cursor: pointer;
|
|
118
137
|
}
|
|
119
|
-
.list{
|
|
120
|
-
|
|
121
|
-
cursor: pointer;
|
|
138
|
+
.list-li{
|
|
139
|
+
padding-bottom: 10px;
|
|
122
140
|
}
|
|
123
|
-
.list-li>span{
|
|
124
|
-
|
|
125
|
-
|
|
141
|
+
.list-li > span {
|
|
142
|
+
font-size: 16px;
|
|
143
|
+
line-height: 30px;
|
|
126
144
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
|
|
146
|
+
.list-li-cont {
|
|
147
|
+
font-size: 14px;
|
|
148
|
+
padding-left: 18px;
|
|
130
149
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
|
|
151
|
+
.list-li-cont > p {
|
|
152
|
+
height: 25px;
|
|
153
|
+
line-height: 25px;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
font-size: 14px;
|
|
137
158
|
}
|
|
138
159
|
</style>
|