tianheng-ui 0.0.2 → 0.0.6
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/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff2 +0 -0
- package/lib/theme-chalk/icon.css +1940 -0
- package/lib/theme-chalk/index.css +1940 -0
- package/package.json +11 -7
- package/{src/component → packages}/cell/index.js +0 -0
- package/{src/component → packages}/cell/index.vue +0 -0
- package/packages/icons/index.js +8 -0
- package/packages/icons/index.vue +360 -0
- package/packages/table/action.vue +126 -0
- package/packages/table/column.vue +111 -0
- package/packages/table/index.js +8 -0
- package/packages/table/index.vue +251 -0
- package/packages/table/search.vue +105 -0
- package/packages/table/tools.vue +98 -0
- package/src/App.vue +1 -1
- package/src/index.js +21 -0
- package/.babelrc +0 -6
- package/.editorconfig +0 -9
- package/dist/tianheng-ui.js +0 -2
- package/dist/tianheng-ui.js.map +0 -1
- package/index.html +0 -11
- package/webpack.config.js +0 -97
package/package.json
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "tianheng-ui",
|
3
3
|
"description": "A Vue.js project",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.6",
|
5
5
|
"author": "shu lang <403732931@qq.com>",
|
6
6
|
"license": "MIT",
|
7
7
|
"private": false,
|
8
|
-
"main": "dist/tianheng-ui.js",
|
8
|
+
"main": "./dist/tianheng-ui.js",
|
9
9
|
"scripts": {
|
10
10
|
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
|
11
11
|
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
12
12
|
},
|
13
|
-
"directories": {
|
14
|
-
"dist": "dist"
|
15
|
-
},
|
16
13
|
"dependencies": {
|
17
14
|
"element-ui": "^2.15.6",
|
18
15
|
"vue": "^2.5.11"
|
@@ -39,8 +36,15 @@
|
|
39
36
|
"webpack": "^3.6.0",
|
40
37
|
"webpack-dev-server": "^2.9.1"
|
41
38
|
},
|
39
|
+
"files": [
|
40
|
+
"lib",
|
41
|
+
"packages",
|
42
|
+
"src"
|
43
|
+
],
|
44
|
+
"homepage": "http://element.eleme.io",
|
42
45
|
"keywords": [
|
43
|
-
"
|
46
|
+
"tianheng",
|
44
47
|
"prompt"
|
45
|
-
]
|
48
|
+
],
|
49
|
+
"style": "lib/theme-chalk/index.css"
|
46
50
|
}
|
File without changes
|
File without changes
|
@@ -0,0 +1,360 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<el-popover
|
4
|
+
placement="bottom-start"
|
5
|
+
title="Element图标库"
|
6
|
+
:width="width || 400"
|
7
|
+
trigger="click"
|
8
|
+
>
|
9
|
+
<el-input
|
10
|
+
slot="reference"
|
11
|
+
:value="value"
|
12
|
+
placeholder="请选择图标"
|
13
|
+
clearable
|
14
|
+
@clear="handleInputClear"
|
15
|
+
>
|
16
|
+
<div v-if="value" class="input-prefix" slot="prefix">
|
17
|
+
<i :class="value" class="icon"> </i>
|
18
|
+
</div>
|
19
|
+
</el-input>
|
20
|
+
|
21
|
+
<div class="th-icons">
|
22
|
+
<i
|
23
|
+
class="icon"
|
24
|
+
v-for="(icon, index) in icons"
|
25
|
+
:key="index"
|
26
|
+
:class="icon"
|
27
|
+
@click="handleIconClick(icon)"
|
28
|
+
></i>
|
29
|
+
</div>
|
30
|
+
</el-popover>
|
31
|
+
</div>
|
32
|
+
</template>
|
33
|
+
|
34
|
+
<script>
|
35
|
+
export default {
|
36
|
+
name:'ThIcons',
|
37
|
+
props: ["value", "width"],
|
38
|
+
data() {
|
39
|
+
return {
|
40
|
+
icons: [
|
41
|
+
"el-icon-platform-eleme",
|
42
|
+
"el-icon-eleme",
|
43
|
+
"el-icon-delete-solid",
|
44
|
+
"el-icon-delete",
|
45
|
+
"el-icon-s-tools",
|
46
|
+
"el-icon-setting",
|
47
|
+
"el-icon-user-solid",
|
48
|
+
"el-icon-user",
|
49
|
+
"el-icon-phone",
|
50
|
+
"el-icon-phone-outline",
|
51
|
+
"el-icon-more",
|
52
|
+
"el-icon-more-outline",
|
53
|
+
"el-icon-star-on",
|
54
|
+
"el-icon-star-off",
|
55
|
+
"el-icon-s-goods",
|
56
|
+
"el-icon-goods",
|
57
|
+
"el-icon-warning",
|
58
|
+
"el-icon-warning-outline",
|
59
|
+
"el-icon-question",
|
60
|
+
"el-icon-info",
|
61
|
+
"el-icon-remove",
|
62
|
+
"el-icon-circle-plus",
|
63
|
+
"el-icon-success",
|
64
|
+
"el-icon-error",
|
65
|
+
"el-icon-zoom-in",
|
66
|
+
"el-icon-zoom-out",
|
67
|
+
"el-icon-remove-outline",
|
68
|
+
"el-icon-circle-plus-outline",
|
69
|
+
"el-icon-circle-check",
|
70
|
+
"el-icon-circle-close",
|
71
|
+
"el-icon-s-help",
|
72
|
+
"el-icon-help",
|
73
|
+
"el-icon-minus",
|
74
|
+
"el-icon-plus",
|
75
|
+
"el-icon-check",
|
76
|
+
"el-icon-close",
|
77
|
+
"el-icon-picture",
|
78
|
+
"el-icon-picture-outline",
|
79
|
+
"el-icon-picture-outline-round",
|
80
|
+
"el-icon-upload",
|
81
|
+
"el-icon-upload2",
|
82
|
+
"el-icon-download",
|
83
|
+
"el-icon-camera-solid",
|
84
|
+
"el-icon-camera",
|
85
|
+
"el-icon-video-camera-solid",
|
86
|
+
"el-icon-video-camera",
|
87
|
+
"el-icon-message-solid",
|
88
|
+
"el-icon-bell",
|
89
|
+
"el-icon-s-cooperation",
|
90
|
+
"el-icon-s-order",
|
91
|
+
"el-icon-s-platform",
|
92
|
+
"el-icon-s-fold",
|
93
|
+
"el-icon-s-unfold",
|
94
|
+
"el-icon-s-operation",
|
95
|
+
"el-icon-s-promotion",
|
96
|
+
"el-icon-s-home",
|
97
|
+
"el-icon-s-release",
|
98
|
+
"el-icon-s-ticket",
|
99
|
+
"el-icon-s-management",
|
100
|
+
"el-icon-s-open",
|
101
|
+
"el-icon-s-shop",
|
102
|
+
"el-icon-s-marketing",
|
103
|
+
"el-icon-s-flag",
|
104
|
+
"el-icon-s-comment",
|
105
|
+
"el-icon-s-finance",
|
106
|
+
"el-icon-s-claim",
|
107
|
+
"el-icon-s-custom",
|
108
|
+
"el-icon-s-opportunity",
|
109
|
+
"el-icon-s-data",
|
110
|
+
"el-icon-s-check",
|
111
|
+
"el-icon-s-grid",
|
112
|
+
"el-icon-menu",
|
113
|
+
"el-icon-share",
|
114
|
+
"el-icon-d-caret",
|
115
|
+
"el-icon-caret-left",
|
116
|
+
"el-icon-caret-right",
|
117
|
+
"el-icon-caret-bottom",
|
118
|
+
"el-icon-caret-top",
|
119
|
+
"el-icon-bottom-left",
|
120
|
+
"el-icon-bottom-right",
|
121
|
+
"el-icon-back",
|
122
|
+
"el-icon-right",
|
123
|
+
"el-icon-bottom",
|
124
|
+
"el-icon-top",
|
125
|
+
"el-icon-top-left",
|
126
|
+
"el-icon-top-right",
|
127
|
+
"el-icon-arrow-left",
|
128
|
+
"el-icon-arrow-right",
|
129
|
+
"el-icon-arrow-down",
|
130
|
+
"el-icon-arrow-up",
|
131
|
+
"el-icon-d-arrow-left",
|
132
|
+
"el-icon-d-arrow-right",
|
133
|
+
"el-icon-video-pause",
|
134
|
+
"el-icon-video-play",
|
135
|
+
"el-icon-refresh",
|
136
|
+
"el-icon-refresh-right",
|
137
|
+
"el-icon-refresh-left",
|
138
|
+
"el-icon-finished",
|
139
|
+
"el-icon-sort",
|
140
|
+
"el-icon-sort-up",
|
141
|
+
"el-icon-sort-down",
|
142
|
+
"el-icon-rank",
|
143
|
+
"el-icon-loading",
|
144
|
+
"el-icon-view",
|
145
|
+
"el-icon-c-scale-to-original",
|
146
|
+
"el-icon-date",
|
147
|
+
"el-icon-edit",
|
148
|
+
"el-icon-edit-outline",
|
149
|
+
"el-icon-folder",
|
150
|
+
"el-icon-folder-opened",
|
151
|
+
"el-icon-folder-add",
|
152
|
+
"el-icon-folder-remove",
|
153
|
+
"el-icon-folder-delete",
|
154
|
+
"el-icon-folder-checked",
|
155
|
+
"el-icon-tickets",
|
156
|
+
"el-icon-document-remove",
|
157
|
+
"el-icon-document-delete",
|
158
|
+
"el-icon-document-copy",
|
159
|
+
"el-icon-document-checked",
|
160
|
+
"el-icon-document",
|
161
|
+
"el-icon-document-add",
|
162
|
+
"el-icon-printer",
|
163
|
+
"el-icon-paperclip",
|
164
|
+
"el-icon-takeaway-box",
|
165
|
+
"el-icon-search",
|
166
|
+
"el-icon-monitor",
|
167
|
+
"el-icon-attract",
|
168
|
+
"el-icon-mobile",
|
169
|
+
"el-icon-scissors",
|
170
|
+
"el-icon-umbrella",
|
171
|
+
"el-icon-headset",
|
172
|
+
"el-icon-brush",
|
173
|
+
"el-icon-mouse",
|
174
|
+
"el-icon-coordinate",
|
175
|
+
"el-icon-magic-stick",
|
176
|
+
"el-icon-reading",
|
177
|
+
"el-icon-data-line",
|
178
|
+
"el-icon-data-board",
|
179
|
+
"el-icon-pie-chart",
|
180
|
+
"el-icon-data-analysis",
|
181
|
+
"el-icon-collection-tag",
|
182
|
+
"el-icon-film",
|
183
|
+
"el-icon-suitcase",
|
184
|
+
"el-icon-suitcase-1",
|
185
|
+
"el-icon-receiving",
|
186
|
+
"el-icon-collection",
|
187
|
+
"el-icon-files",
|
188
|
+
"el-icon-notebook-1",
|
189
|
+
"el-icon-notebook-2",
|
190
|
+
"el-icon-toilet-paper",
|
191
|
+
"el-icon-office-building",
|
192
|
+
"el-icon-school",
|
193
|
+
"el-icon-table-lamp",
|
194
|
+
"el-icon-house",
|
195
|
+
"el-icon-no-smoking",
|
196
|
+
"el-icon-smoking",
|
197
|
+
"el-icon-shopping-cart-full",
|
198
|
+
"el-icon-shopping-cart-1",
|
199
|
+
"el-icon-shopping-cart-2",
|
200
|
+
"el-icon-shopping-bag-1",
|
201
|
+
"el-icon-shopping-bag-2",
|
202
|
+
"el-icon-sold-out",
|
203
|
+
"el-icon-sell",
|
204
|
+
"el-icon-present",
|
205
|
+
"el-icon-box",
|
206
|
+
"el-icon-bank-card",
|
207
|
+
"el-icon-money",
|
208
|
+
"el-icon-coin",
|
209
|
+
"el-icon-wallet",
|
210
|
+
"el-icon-discount",
|
211
|
+
"el-icon-price-tag",
|
212
|
+
"el-icon-news",
|
213
|
+
"el-icon-guide",
|
214
|
+
"el-icon-male",
|
215
|
+
"el-icon-female",
|
216
|
+
"el-icon-thumb",
|
217
|
+
"el-icon-cpu",
|
218
|
+
"el-icon-link",
|
219
|
+
"el-icon-connection",
|
220
|
+
"el-icon-open",
|
221
|
+
"el-icon-turn-off",
|
222
|
+
"el-icon-set-up",
|
223
|
+
"el-icon-chat-round",
|
224
|
+
"el-icon-chat-line-round",
|
225
|
+
"el-icon-chat-square",
|
226
|
+
"el-icon-chat-dot-round",
|
227
|
+
"el-icon-chat-dot-square",
|
228
|
+
"el-icon-chat-line-square",
|
229
|
+
"el-icon-message",
|
230
|
+
"el-icon-postcard",
|
231
|
+
"el-icon-position",
|
232
|
+
"el-icon-turn-off-microphone",
|
233
|
+
"el-icon-microphone",
|
234
|
+
"el-icon-close-notification",
|
235
|
+
"el-icon-bangzhu",
|
236
|
+
"el-icon-time",
|
237
|
+
"el-icon-odometer",
|
238
|
+
"el-icon-crop",
|
239
|
+
"el-icon-aim",
|
240
|
+
"el-icon-switch-button",
|
241
|
+
"el-icon-full-screen",
|
242
|
+
"el-icon-copy-document",
|
243
|
+
"el-icon-mic",
|
244
|
+
"el-icon-stopwatch",
|
245
|
+
"el-icon-medal-1",
|
246
|
+
"el-icon-medal",
|
247
|
+
"el-icon-trophy",
|
248
|
+
"el-icon-trophy-1",
|
249
|
+
"el-icon-first-aid-kit",
|
250
|
+
"el-icon-discover",
|
251
|
+
"el-icon-place",
|
252
|
+
"el-icon-location",
|
253
|
+
"el-icon-location-outline",
|
254
|
+
"el-icon-location-information",
|
255
|
+
"el-icon-add-location",
|
256
|
+
"el-icon-delete-location",
|
257
|
+
"el-icon-map-location",
|
258
|
+
"el-icon-alarm-clock",
|
259
|
+
"el-icon-timer",
|
260
|
+
"el-icon-watch-1",
|
261
|
+
"el-icon-watch",
|
262
|
+
"el-icon-lock",
|
263
|
+
"el-icon-unlock",
|
264
|
+
"el-icon-key",
|
265
|
+
"el-icon-service",
|
266
|
+
"el-icon-mobile-phone",
|
267
|
+
"el-icon-bicycle",
|
268
|
+
"el-icon-truck",
|
269
|
+
"el-icon-ship",
|
270
|
+
"el-icon-basketball",
|
271
|
+
"el-icon-football",
|
272
|
+
"el-icon-soccer",
|
273
|
+
"el-icon-baseball",
|
274
|
+
"el-icon-wind-power",
|
275
|
+
"el-icon-light-rain",
|
276
|
+
"el-icon-lightning",
|
277
|
+
"el-icon-heavy-rain",
|
278
|
+
"el-icon-sunrise",
|
279
|
+
"el-icon-sunrise-1",
|
280
|
+
"el-icon-sunset",
|
281
|
+
"el-icon-sunny",
|
282
|
+
"el-icon-cloudy",
|
283
|
+
"el-icon-partly-cloudy",
|
284
|
+
"el-icon-cloudy-and-sunny",
|
285
|
+
"el-icon-moon",
|
286
|
+
"el-icon-moon-night",
|
287
|
+
"el-icon-dish",
|
288
|
+
"el-icon-dish-1",
|
289
|
+
"el-icon-food",
|
290
|
+
"el-icon-chicken",
|
291
|
+
"el-icon-fork-spoon",
|
292
|
+
"el-icon-knife-fork",
|
293
|
+
"el-icon-burger",
|
294
|
+
"el-icon-tableware",
|
295
|
+
"el-icon-sugar",
|
296
|
+
"el-icon-dessert",
|
297
|
+
"el-icon-ice-cream",
|
298
|
+
"el-icon-hot-water",
|
299
|
+
"el-icon-water-cup",
|
300
|
+
"el-icon-coffee-cup",
|
301
|
+
"el-icon-cold-drink",
|
302
|
+
"el-icon-goblet",
|
303
|
+
"el-icon-goblet-full",
|
304
|
+
"el-icon-goblet-square",
|
305
|
+
"el-icon-goblet-square-full",
|
306
|
+
"el-icon-refrigerator",
|
307
|
+
"el-icon-grape",
|
308
|
+
"el-icon-watermelon",
|
309
|
+
"el-icon-cherry",
|
310
|
+
"el-icon-apple",
|
311
|
+
"el-icon-pear",
|
312
|
+
"el-icon-orange",
|
313
|
+
"el-icon-coffee",
|
314
|
+
"el-icon-ice-tea",
|
315
|
+
"el-icon-ice-drink",
|
316
|
+
"el-icon-milk-tea",
|
317
|
+
"el-icon-potato-strips",
|
318
|
+
"el-icon-lollipop",
|
319
|
+
"el-icon-ice-cream-square",
|
320
|
+
"el-icon-ice-cream-round"
|
321
|
+
]
|
322
|
+
};
|
323
|
+
},
|
324
|
+
created() {},
|
325
|
+
methods: {
|
326
|
+
handleIconClick(icon) {
|
327
|
+
this.$emit("input", icon);
|
328
|
+
},
|
329
|
+
handleInputClear() {
|
330
|
+
this.$emit("input", "");
|
331
|
+
}
|
332
|
+
}
|
333
|
+
};
|
334
|
+
</script>
|
335
|
+
|
336
|
+
<style lang="less" scoped>
|
337
|
+
.input-prefix {
|
338
|
+
height: 100%;
|
339
|
+
width: 32px;
|
340
|
+
display: flex;
|
341
|
+
align-items: center;
|
342
|
+
.icon {
|
343
|
+
font-size: 20px;
|
344
|
+
}
|
345
|
+
}
|
346
|
+
.th-icons {
|
347
|
+
height: 300px;
|
348
|
+
overflow-y: scroll;
|
349
|
+
.icon {
|
350
|
+
padding: 8px;
|
351
|
+
font-size: 20px;
|
352
|
+
border-radius: 2px;
|
353
|
+
}
|
354
|
+
.icon:hover {
|
355
|
+
cursor: pointer;
|
356
|
+
background-color: #f2f2f2;
|
357
|
+
// transition: .3s;
|
358
|
+
}
|
359
|
+
}
|
360
|
+
</style>
|
@@ -0,0 +1,126 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<template v-for="(item, index) in actions">
|
4
|
+
<el-button
|
5
|
+
v-if="item.act_type === 'edit'"
|
6
|
+
:key="index"
|
7
|
+
:style="{ color: item.btn_disabled ? '' : item.btn_color }"
|
8
|
+
:type="item.btn_type"
|
9
|
+
:icon="item.btn_icon"
|
10
|
+
:disabled="item.btn_disabled"
|
11
|
+
@click="doEdit(item)"
|
12
|
+
>{{ item.btn_name }}</el-button
|
13
|
+
>
|
14
|
+
<el-button
|
15
|
+
v-else-if="item.act_type === 'look'"
|
16
|
+
:key="index"
|
17
|
+
:style="{ color: item.btn_disabled ? '' : item.btn_color }"
|
18
|
+
:type="item.btn_type"
|
19
|
+
:icon="item.btn_icon"
|
20
|
+
:disabled="item.btn_disabled"
|
21
|
+
@click="doLook(item)"
|
22
|
+
>{{ item.btn_name }}</el-button
|
23
|
+
>
|
24
|
+
<el-popover
|
25
|
+
class="action-popover"
|
26
|
+
v-else-if="item.act_type === 'delete'"
|
27
|
+
:key="index"
|
28
|
+
v-model="pop"
|
29
|
+
placement="top"
|
30
|
+
title=""
|
31
|
+
width="180"
|
32
|
+
trigger="manual"
|
33
|
+
>
|
34
|
+
<p>{{ item.btn_delmsg || msg }}</p>
|
35
|
+
<div style="text-align: right; margin: 0">
|
36
|
+
<el-button type="text" :disabled="loadingDel" @click="doCancel"
|
37
|
+
>取消</el-button
|
38
|
+
>
|
39
|
+
<el-button
|
40
|
+
:loading="loadingDel"
|
41
|
+
type="primary"
|
42
|
+
@click="doDelete(item)"
|
43
|
+
>确定</el-button
|
44
|
+
>
|
45
|
+
</div>
|
46
|
+
<el-button
|
47
|
+
:style="{ color: item.btn_disabled ? '' : item.btn_color }"
|
48
|
+
slot="reference"
|
49
|
+
:disabled="loadingDel || item.btn_disabled"
|
50
|
+
:type="item.btn_type"
|
51
|
+
:icon="item.btn_icon"
|
52
|
+
@click="toDelete"
|
53
|
+
>{{ item.btn_name }}</el-button
|
54
|
+
>
|
55
|
+
</el-popover>
|
56
|
+
<el-button
|
57
|
+
v-else
|
58
|
+
:key="index"
|
59
|
+
:style="{ color: item.btn_color }"
|
60
|
+
:type="item.btn_type"
|
61
|
+
:icon="item.btn_icon"
|
62
|
+
:disabled="item.btn_disabled"
|
63
|
+
@click="doEval(item)"
|
64
|
+
>{{ item.btn_name }}</el-button
|
65
|
+
>
|
66
|
+
</template>
|
67
|
+
</div>
|
68
|
+
</template>
|
69
|
+
|
70
|
+
<script>
|
71
|
+
export default {
|
72
|
+
props: {
|
73
|
+
actions: {
|
74
|
+
type: Array,
|
75
|
+
default: () => {
|
76
|
+
return [];
|
77
|
+
},
|
78
|
+
},
|
79
|
+
permission: {
|
80
|
+
type: Object,
|
81
|
+
required: false,
|
82
|
+
},
|
83
|
+
msg: {
|
84
|
+
type: String,
|
85
|
+
default: "确定删除本条数据吗?",
|
86
|
+
},
|
87
|
+
},
|
88
|
+
data() {
|
89
|
+
return {
|
90
|
+
pop: false,
|
91
|
+
loadingDel: false,
|
92
|
+
};
|
93
|
+
},
|
94
|
+
methods: {
|
95
|
+
toDelete() {
|
96
|
+
this.pop = true;
|
97
|
+
},
|
98
|
+
doCancel() {
|
99
|
+
this.pop = false;
|
100
|
+
},
|
101
|
+
doEval(item) {
|
102
|
+
this.$emit("on-eval", item);
|
103
|
+
},
|
104
|
+
doEdit(item) {
|
105
|
+
this.$emit("on-edit", item);
|
106
|
+
},
|
107
|
+
doLook(item) {
|
108
|
+
this.$emit("on-look", item);
|
109
|
+
},
|
110
|
+
doDelete(item) {
|
111
|
+
this.loadingDel = true;
|
112
|
+
const callback = (bool) => {
|
113
|
+
this.loadingDel = false;
|
114
|
+
this.pop = !bool;
|
115
|
+
};
|
116
|
+
this.$emit("on-delete", item, callback);
|
117
|
+
},
|
118
|
+
},
|
119
|
+
};
|
120
|
+
</script>
|
121
|
+
|
122
|
+
<style lang="less">
|
123
|
+
.el-button + .action-popover {
|
124
|
+
margin-left: 10px !important;
|
125
|
+
}
|
126
|
+
</style>
|
@@ -0,0 +1,111 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<template v-for="(item, index) in options">
|
4
|
+
<template v-if="!item.hide">
|
5
|
+
<el-table-column
|
6
|
+
v-if="item.type"
|
7
|
+
:key="index"
|
8
|
+
:type="item.type"
|
9
|
+
:label="item.label"
|
10
|
+
width="50"
|
11
|
+
>
|
12
|
+
</el-table-column>
|
13
|
+
<el-table-column
|
14
|
+
v-else-if="item.children"
|
15
|
+
:key="index"
|
16
|
+
:prop="item.prop"
|
17
|
+
:label="item.label"
|
18
|
+
:width="item.width"
|
19
|
+
:align="item.align"
|
20
|
+
:fixed="item.fixed"
|
21
|
+
:sortable="item.sortable"
|
22
|
+
:sort-method="item.sortMethod"
|
23
|
+
show-overflow-tooltip
|
24
|
+
>
|
25
|
+
<TableColumn :key="index" :options="item.children"></TableColumn>
|
26
|
+
</el-table-column>
|
27
|
+
<el-table-column
|
28
|
+
v-else
|
29
|
+
:key="index"
|
30
|
+
:prop="item.prop"
|
31
|
+
:label="item.label"
|
32
|
+
:width="item.width"
|
33
|
+
:align="item.align"
|
34
|
+
:fixed="item.fixed"
|
35
|
+
:sortable="item.sortable"
|
36
|
+
:sort-method="item.sortMethod"
|
37
|
+
show-overflow-tooltip
|
38
|
+
>
|
39
|
+
<template slot-scope="scope">
|
40
|
+
<slot v-if="item.slot" name="slot" :scope="scope" :option="item" />
|
41
|
+
<div v-else>{{ scope.row[item.prop] }}</div>
|
42
|
+
</template>
|
43
|
+
</el-table-column>
|
44
|
+
</template>
|
45
|
+
</template>
|
46
|
+
</div>
|
47
|
+
</template>
|
48
|
+
|
49
|
+
<script>
|
50
|
+
export default {
|
51
|
+
name: "TableColumn",
|
52
|
+
props: {
|
53
|
+
options: {
|
54
|
+
type: Array,
|
55
|
+
default: () => {
|
56
|
+
return [];
|
57
|
+
},
|
58
|
+
},
|
59
|
+
},
|
60
|
+
created(){
|
61
|
+
/**
|
62
|
+
*
|
63
|
+
* <template v-if={!item.hide}>
|
64
|
+
<el-table-column
|
65
|
+
v-if={item.type}
|
66
|
+
type={item.type}
|
67
|
+
label={item.label}
|
68
|
+
width="50"
|
69
|
+
></el-table-column>
|
70
|
+
<el-table-column
|
71
|
+
v-else-if={item.children}
|
72
|
+
prop={item.prop}
|
73
|
+
label={item.label}
|
74
|
+
width={item.width}
|
75
|
+
align={item.align}
|
76
|
+
fixed={item.fixed}
|
77
|
+
sortable={item.sortable}
|
78
|
+
sort-method={item.sortMethod}
|
79
|
+
show-overflow-tooltip
|
80
|
+
>
|
81
|
+
{this.dynamicItem(item.children)}
|
82
|
+
</el-table-column>
|
83
|
+
<el-table-column
|
84
|
+
v-else
|
85
|
+
prop={item.prop}
|
86
|
+
label={item.label}
|
87
|
+
width={item.width}
|
88
|
+
align={item.align}
|
89
|
+
fixed={item.fixed}
|
90
|
+
sortable={item.sortable}
|
91
|
+
sort-method={item.sortMethod}
|
92
|
+
show-overflow-tooltip
|
93
|
+
>
|
94
|
+
<template slot-scope="scope">
|
95
|
+
<slot
|
96
|
+
v-if={item.slot}
|
97
|
+
name="slot"
|
98
|
+
scope={scope}
|
99
|
+
option={item}
|
100
|
+
/>
|
101
|
+
<div v-else>{scope.row[item.prop]}</div>
|
102
|
+
</template>
|
103
|
+
</el-table-column>
|
104
|
+
</template>
|
105
|
+
*/
|
106
|
+
console.log(this.options)
|
107
|
+
}
|
108
|
+
};
|
109
|
+
</script>
|
110
|
+
|
111
|
+
<style></style>
|