xt-element-ui 1.1.2 → 1.1.4
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/css/2.9f53fb10.css +1 -0
- package/lib/css/3.f955b130.css +1 -0
- package/lib/css/4.04feac2c.css +1 -0
- package/lib/css/5.6a8558e0.css +1 -0
- package/lib/css/6.e474b334.css +1 -0
- package/lib/index.common.0.js +16448 -15696
- package/lib/index.common.2.js +298 -270
- package/lib/index.common.3.js +82 -54
- package/lib/index.common.4.js +519 -489
- package/lib/index.common.5.js +74 -46
- package/lib/index.common.6.js +76 -48
- package/lib/index.common.js +826 -308
- package/lib/index.css +1 -1
- package/lib/index.umd.0.js +16448 -15696
- package/lib/index.umd.2.js +298 -270
- package/lib/index.umd.3.js +82 -54
- package/lib/index.umd.4.js +519 -489
- package/lib/index.umd.5.js +74 -46
- package/lib/index.umd.6.js +76 -48
- package/lib/index.umd.js +832 -313
- package/lib/index.umd.min.0.js +3 -3
- package/lib/index.umd.min.2.js +1 -1
- package/lib/index.umd.min.3.js +1 -1
- package/lib/index.umd.min.4.js +1 -1
- package/lib/index.umd.min.5.js +1 -1
- package/lib/index.umd.min.6.js +1 -1
- package/lib/index.umd.min.js +1 -1
- package/package.json +2 -1
- package/src/components/ex-button/index.js +2 -0
- package/src/components/ex-button/index.vue +61 -0
- package/src/components/ex-button/style/index.scss +31 -0
- package/src/components/ex-card/index.js +7 -0
- package/src/components/ex-card/index.vue +150 -0
- package/src/components/ex-card/style/index.scss +69 -0
- package/src/components/{chart → ex-chart}/ExBar.vue +3 -0
- package/src/components/{chart → ex-chart}/ExLine.vue +3 -0
- package/src/components/{chart → ex-chart}/ExMulti.vue +5 -0
- package/src/components/{chart → ex-chart}/ExPie.vue +3 -0
- package/src/components/{chart → ex-chart}/ExTrend.vue +3 -0
- package/src/components/ex-chart/index.js +2 -0
- package/src/components/ex-chart/index.vue +134 -0
- package/src/components/{chart → ex-chart}/theme/dark.js +1 -1
- package/src/components/{chart → ex-chart}/utils.js +40 -12
- package/src/components/index.scss +13 -7
- package/src/components/{button → xt-button}/index.vue +1 -1
- package/src/components/{card-item → xt-card-item}/index.vue +1 -1
- package/src/components/{config-provider → xt-config-provider}/index.vue +66 -0
- package/src/components/{date-picker → xt-date-picker}/index.vue +1 -1
- package/src/components/{date-picker → xt-date-picker}/quarter.vue +4 -2
- package/src/components/{table → xt-table}/index.vue +48 -107
- package/src/config/element-registry.js +136 -0
- package/src/index.js +56 -32
- package/src/styles/theme/colors.scss +1 -0
- package/lib/css/2.3f7aa432.css +0 -1
- package/lib/css/3.ffcc175d.css +0 -1
- package/lib/css/4.9abd1f2b.css +0 -1
- package/lib/css/5.1a31ed8a.css +0 -1
- package/lib/css/6.c2d0d77e.css +0 -1
- package/src/components/chart/index.js +0 -2
- package/src/components/chart/index.vue +0 -51
- /package/src/components/{chart → ex-chart}/pieList.vue +0 -0
- /package/src/components/{chart → ex-chart}/theme/blue.js +0 -0
- /package/src/components/{chart → ex-chart}/theme/orange.js +0 -0
- /package/src/components/{chart → ex-chart}/theme/starry.js +0 -0
- /package/src/components/{chart → ex-chart}/theme/white.js +0 -0
- /package/src/components/{button → xt-button}/index.js +0 -0
- /package/src/components/{button → xt-button}/style/index.scss +0 -0
- /package/src/components/{card → xt-card}/index.js +0 -0
- /package/src/components/{card → xt-card}/index.vue +0 -0
- /package/src/components/{card → xt-card}/style/index.scss +0 -0
- /package/src/components/{card-item → xt-card-item}/index.js +0 -0
- /package/src/components/{card-item → xt-card-item}/style/index.scss +0 -0
- /package/src/components/{config-provider → xt-config-provider}/index.js +0 -0
- /package/src/components/{config-provider → xt-config-provider}/style/index.scss +0 -0
- /package/src/components/{date-picker → xt-date-picker}/SearchDate.vue +0 -0
- /package/src/components/{date-picker → xt-date-picker}/index.js +0 -0
- /package/src/components/{flex-box → xt-flex-box}/index.js +0 -0
- /package/src/components/{flex-box → xt-flex-box}/index.vue +0 -0
- /package/src/components/{flex-box → xt-flex-box}/style/index.scss +0 -0
- /package/src/components/{grid-box → xt-grid-box}/index.js +0 -0
- /package/src/components/{grid-box → xt-grid-box}/index.vue +0 -0
- /package/src/components/{input → xt-input}/index.js +0 -0
- /package/src/components/{input → xt-input}/index.vue +0 -0
- /package/src/components/{input → xt-input}/style/index.scss +0 -0
- /package/src/components/{layout → xt-layout}/BaseCollapse.vue +0 -0
- /package/src/components/{layout → xt-layout}/ExFieldset.vue +0 -0
- /package/src/components/{page → xt-page}/index.js +0 -0
- /package/src/components/{page → xt-page}/index.vue +0 -0
- /package/src/components/{select-tree → xt-select-tree}/index.js +0 -0
- /package/src/components/{select-tree → xt-select-tree}/index.vue +0 -0
- /package/src/components/{table → xt-table}/ExCell.vue +0 -0
- /package/src/components/{table → xt-table}/ExColumn.vue +0 -0
- /package/src/components/{table → xt-table}/index.js +0 -0
- /package/src/components/{table → xt-table}/processor.js +0 -0
- /package/src/components/{text → xt-text}/index.js +0 -0
- /package/src/components/{text → xt-text}/index.vue +0 -0
- /package/src/components/{text → xt-text}/style/index.scss +0 -0
- /package/src/components/{upload → xt-upload}/index.js +0 -0
- /package/src/components/{upload → xt-upload}/index.vue +0 -0
- /package/src/components/{upload → xt-upload}/preview.vue +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ExTable">
|
|
3
3
|
<slot name="title">
|
|
4
|
-
<
|
|
4
|
+
<XtFlexBox content="between" style="padding: 0 10px;">
|
|
5
5
|
<div class="small-title" style="padding: 10px; 0" v-if="title">{{ title }}</div>
|
|
6
6
|
<el-button size="small" type="primary" plain v-if="toolExport" icon="el-icon-download" @click="exportTableData">导出</el-button>
|
|
7
|
-
</
|
|
7
|
+
</XtFlexBox>
|
|
8
8
|
</slot>
|
|
9
9
|
<el-table
|
|
10
10
|
ref="ExtendTable"
|
|
@@ -79,7 +79,6 @@
|
|
|
79
79
|
</template>
|
|
80
80
|
<template v-slot:empty>
|
|
81
81
|
<div style="text-align:center" v-show="hasLoadData&&!loading">
|
|
82
|
-
<img :src="emptyIcon" height="150px" />
|
|
83
82
|
<div class="empty-title">暂无数据</div>
|
|
84
83
|
<div class="empty-subtitle">{{emptSubTitle}}</div>
|
|
85
84
|
</div>
|
|
@@ -87,7 +86,7 @@
|
|
|
87
86
|
</el-table>
|
|
88
87
|
<div ref="toolBar" class="toolBar left">
|
|
89
88
|
<slot name="pagination">
|
|
90
|
-
<
|
|
89
|
+
<el-pagination v-if="pagination" :total="total" :page-sizes="pageSizes" :page-size="pagination.PageSize" :current-page="pagination.PageNum" @current-change="pageChange" @size-change="sizeChange"></el-pagination>
|
|
91
90
|
</slot>
|
|
92
91
|
</div>
|
|
93
92
|
</div>
|
|
@@ -95,15 +94,14 @@
|
|
|
95
94
|
<script>
|
|
96
95
|
import ExColumn from "./ExColumn";
|
|
97
96
|
import ExCell from "./ExCell";
|
|
98
|
-
import
|
|
99
|
-
import { GetSelfData, SaveIsShowInfo } from "@/api/compreSafeInsIos/common.js";
|
|
97
|
+
import XtFlexBox from "../xt-flex-box";
|
|
100
98
|
export default {
|
|
101
99
|
name: "ExTable",
|
|
102
100
|
components: {
|
|
103
101
|
ExCell,
|
|
104
|
-
ExColumn
|
|
102
|
+
ExColumn,
|
|
103
|
+
XtFlexBox
|
|
105
104
|
},
|
|
106
|
-
mixins: [exportExcell],
|
|
107
105
|
inheritAttrs: false,
|
|
108
106
|
props: {
|
|
109
107
|
tbId: {
|
|
@@ -155,7 +153,6 @@ export default {
|
|
|
155
153
|
return [];
|
|
156
154
|
}
|
|
157
155
|
},
|
|
158
|
-
// 自定义 插入列
|
|
159
156
|
insertColumns: {
|
|
160
157
|
type: Array,
|
|
161
158
|
default() {
|
|
@@ -208,18 +205,12 @@ export default {
|
|
|
208
205
|
spanFields: {
|
|
209
206
|
type: Object
|
|
210
207
|
},
|
|
211
|
-
groupColumns: {
|
|
208
|
+
groupColumns: {
|
|
212
209
|
type: Array,
|
|
213
210
|
default() {
|
|
214
211
|
return [];
|
|
215
212
|
}
|
|
216
213
|
},
|
|
217
|
-
emptyIcon: {
|
|
218
|
-
type: String,
|
|
219
|
-
default: () => {
|
|
220
|
-
return require("@/assets/images/common/noData.png");
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
214
|
title: {},
|
|
224
215
|
emptSubTitle: {},
|
|
225
216
|
toolExport: {
|
|
@@ -232,9 +223,9 @@ export default {
|
|
|
232
223
|
startIndex: 0,
|
|
233
224
|
inTableHeight: 0,
|
|
234
225
|
dropvisible: false,
|
|
235
|
-
hasLoad:
|
|
226
|
+
hasLoad: true,
|
|
236
227
|
hasLoadData: false,
|
|
237
|
-
diyColumns: this.columns || [],
|
|
228
|
+
diyColumns: this.columns || [],
|
|
238
229
|
checkedColumns: [],
|
|
239
230
|
tableColumns: []
|
|
240
231
|
};
|
|
@@ -299,7 +290,6 @@ export default {
|
|
|
299
290
|
},
|
|
300
291
|
mounted() {
|
|
301
292
|
this.$nextTick(() => {
|
|
302
|
-
// 表格高度自适应浏览器大小
|
|
303
293
|
this.changeTableHight();
|
|
304
294
|
if (!this.height) {
|
|
305
295
|
window.onresize = () => {
|
|
@@ -336,41 +326,8 @@ export default {
|
|
|
336
326
|
const _columns = [];
|
|
337
327
|
return new Promise((resolve, reject) => {
|
|
338
328
|
if (!this.hasLoad && this.tbId) {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}).then((res) => {
|
|
342
|
-
const { code, data } = res;
|
|
343
|
-
if (code === 200 && data.Result) {
|
|
344
|
-
const _resColumns = JSON.parse(data.Data);
|
|
345
|
-
// 解决 slotName问题 接口数据根据DATAFIELD 匹配 slotName
|
|
346
|
-
this.columns.map((item, ind) => {
|
|
347
|
-
const _fItem = _resColumns.find(it => item.prop == it.DATAFIELD);
|
|
348
|
-
if (_fItem && item.prop) {
|
|
349
|
-
_columns.push({
|
|
350
|
-
...item,
|
|
351
|
-
label: _fItem.HEADERTEXT,
|
|
352
|
-
show: _fItem.ISSHOW || false,
|
|
353
|
-
OrderNum: _fItem.ORDERNUM || ind
|
|
354
|
-
});
|
|
355
|
-
} else if (item.label == "操作") {
|
|
356
|
-
_columns.push(item);
|
|
357
|
-
} else {
|
|
358
|
-
return item;
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
resolve(_columns.sort((pre, aft) => {
|
|
362
|
-
return pre.OrderNum - aft.OrderNum;
|
|
363
|
-
}));
|
|
364
|
-
} else {
|
|
365
|
-
resolve(this.columns);
|
|
366
|
-
this.$emit("update:showColumsFilter", false);
|
|
367
|
-
}
|
|
368
|
-
this.hasLoad = true;
|
|
369
|
-
}).catch(() => {
|
|
370
|
-
this.hasLoad = true;
|
|
371
|
-
resolve(this.columns);
|
|
372
|
-
this.$emit("update:showColumsFilter", false);
|
|
373
|
-
});
|
|
329
|
+
resolve(this.columns);
|
|
330
|
+
this.$emit("update:showColumsFilter", false);
|
|
374
331
|
} else {
|
|
375
332
|
resolve(this.columns);
|
|
376
333
|
this.$emit("update:showColumsFilter", false);
|
|
@@ -394,7 +351,7 @@ export default {
|
|
|
394
351
|
},
|
|
395
352
|
handleToggle(show, item) {
|
|
396
353
|
if (this.checkedColumns.length === 0) {
|
|
397
|
-
this.$
|
|
354
|
+
this.$message.warning("至少选择一列显示!");
|
|
398
355
|
return;
|
|
399
356
|
}
|
|
400
357
|
this.$emit("update:loading", true);
|
|
@@ -402,29 +359,10 @@ export default {
|
|
|
402
359
|
this.tableColumns = this.diyColumns.filter(item => (item.show === undefined ? true : item.show));
|
|
403
360
|
this.checkedColumns = this.updateCheckColumns(this.tableColumns);
|
|
404
361
|
this.dropvisible = false;
|
|
405
|
-
// 设置定制列
|
|
406
362
|
this.changeTableHight();
|
|
407
363
|
this.$nextTick(() => {
|
|
408
364
|
this.doLayout();
|
|
409
365
|
});
|
|
410
|
-
if (this.tbId) {
|
|
411
|
-
const params = {
|
|
412
|
-
dataField: item.prop,
|
|
413
|
-
isShow: show ? 1 : 0,
|
|
414
|
-
gridviewTypeId: this.tbId
|
|
415
|
-
};
|
|
416
|
-
SaveIsShowInfo(params).then((res) => {
|
|
417
|
-
const { code } = res;
|
|
418
|
-
this.$emit("update:loading", false);
|
|
419
|
-
if (code !== 200) {
|
|
420
|
-
// 取消勾选处理
|
|
421
|
-
} else {
|
|
422
|
-
this.$Message.MessageSuccess("设置成功");
|
|
423
|
-
}
|
|
424
|
-
}).catch(() => {
|
|
425
|
-
this.$emit("update:loading", false);
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
366
|
},
|
|
429
367
|
doLayout() {
|
|
430
368
|
this.$refs.ExtendTable && this.$refs.ExtendTable.doLayout();
|
|
@@ -481,7 +419,6 @@ export default {
|
|
|
481
419
|
|
|
482
420
|
if (rowCount === 0) return spans;
|
|
483
421
|
|
|
484
|
-
// 初始化数组
|
|
485
422
|
for (let i = 0; i < rowCount; i++) {
|
|
486
423
|
spans[i] = [];
|
|
487
424
|
for (let j = 0; j < this.groupColumns.length; j++) {
|
|
@@ -489,8 +426,6 @@ export default {
|
|
|
489
426
|
}
|
|
490
427
|
}
|
|
491
428
|
|
|
492
|
-
// 分级计算合并
|
|
493
|
-
|
|
494
429
|
for (let level = 0; level < this.groupColumns.length; level++) {
|
|
495
430
|
let pos = 0;
|
|
496
431
|
while (pos < rowCount) {
|
|
@@ -499,8 +434,6 @@ export default {
|
|
|
499
434
|
let endPos = startPos;
|
|
500
435
|
const currentValue = this.tableData[startPos][this.groupColumns[level].prop];
|
|
501
436
|
|
|
502
|
-
// 检查上级是否相同
|
|
503
|
-
|
|
504
437
|
let sameParent = true;
|
|
505
438
|
|
|
506
439
|
for (let parentLevel = 0; parentLevel < level; parentLevel++) {
|
|
@@ -571,7 +504,6 @@ export default {
|
|
|
571
504
|
try {
|
|
572
505
|
if (!this.autoSetHeight) return;
|
|
573
506
|
if (this.height) {
|
|
574
|
-
// 如果有传进来高度就取消自适应
|
|
575
507
|
this.inTableHeight = (this.height - 1 - (this.title ? 40 : 0));
|
|
576
508
|
this.$nextTick(() => {
|
|
577
509
|
this.doLayout();
|
|
@@ -579,12 +511,10 @@ export default {
|
|
|
579
511
|
return;
|
|
580
512
|
}
|
|
581
513
|
let tableHeight = window.innerHeight || document.body.clientHeight;
|
|
582
|
-
// 高度设置
|
|
583
514
|
const disTop = this.$refs.ExtendTable.$el;
|
|
584
515
|
tableHeight -= (disTop.getBoundingClientRect().top + 20 + 1);
|
|
585
516
|
tableHeight -= this.$refs.toolBar.offsetHeight;
|
|
586
517
|
this.inTableHeight = tableHeight;
|
|
587
|
-
// 重绘表格
|
|
588
518
|
this.doLayout();
|
|
589
519
|
} catch (err) {
|
|
590
520
|
console.log(err);
|
|
@@ -595,15 +525,11 @@ export default {
|
|
|
595
525
|
if (!options.align) {
|
|
596
526
|
options.align = "center";
|
|
597
527
|
}
|
|
598
|
-
// if (!options.resizable) {
|
|
599
|
-
// options.resizable = true;
|
|
600
|
-
// }
|
|
601
528
|
if (options.showTip) {
|
|
602
529
|
options.showOverflowTooltip = true;
|
|
603
530
|
}
|
|
604
531
|
return { ...options };
|
|
605
532
|
},
|
|
606
|
-
// 排序
|
|
607
533
|
changeTableSort(column) {
|
|
608
534
|
const sortingType = column.order;
|
|
609
535
|
const sidx = sortingType ? column.prop : "";
|
|
@@ -658,8 +584,7 @@ export default {
|
|
|
658
584
|
const obj = { ...r };
|
|
659
585
|
list.push(obj);
|
|
660
586
|
});
|
|
661
|
-
|
|
662
|
-
this.doExport(list, title, null, this.column);
|
|
587
|
+
console.log('Export data:', list, title);
|
|
663
588
|
}
|
|
664
589
|
}
|
|
665
590
|
};
|
|
@@ -679,10 +604,9 @@ export default {
|
|
|
679
604
|
&.right{
|
|
680
605
|
justify-content: flex-end;
|
|
681
606
|
}
|
|
682
|
-
|
|
607
|
+
::v-deep .pagination {
|
|
683
608
|
padding: 15px 10px;
|
|
684
609
|
width: 100%;
|
|
685
|
-
// background-color: #ffffff;
|
|
686
610
|
}
|
|
687
611
|
}
|
|
688
612
|
.drop-body{
|
|
@@ -703,29 +627,46 @@ export default {
|
|
|
703
627
|
color: #999999;
|
|
704
628
|
}
|
|
705
629
|
}
|
|
706
|
-
|
|
707
|
-
color: $color;
|
|
708
|
-
&.effect-light{
|
|
709
|
-
background-color: rgba($color: $color, $alpha: .2);
|
|
710
|
-
}
|
|
711
|
-
&.effect-dark{
|
|
712
|
-
color: #ffffff;
|
|
713
|
-
background-color: $color;
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
/deep/.el-table__cell,/deep/.el-table__row{
|
|
630
|
+
::v-deep .el-table__cell, ::v-deep .el-table__row{
|
|
718
631
|
&.warn{
|
|
719
|
-
|
|
632
|
+
color: #E6A23C;
|
|
633
|
+
&.effect-light{
|
|
634
|
+
background-color: rgba(230, 162, 60, .2);
|
|
635
|
+
}
|
|
636
|
+
&.effect-dark{
|
|
637
|
+
color: #ffffff;
|
|
638
|
+
background-color: #E6A23C;
|
|
639
|
+
}
|
|
720
640
|
}
|
|
721
641
|
&.error{
|
|
722
|
-
|
|
642
|
+
color: #F56C6C;
|
|
643
|
+
&.effect-light{
|
|
644
|
+
background-color: rgba(245, 108, 108, .2);
|
|
645
|
+
}
|
|
646
|
+
&.effect-dark{
|
|
647
|
+
color: #ffffff;
|
|
648
|
+
background-color: #F56C6C;
|
|
649
|
+
}
|
|
723
650
|
}
|
|
724
651
|
&.info{
|
|
725
|
-
|
|
652
|
+
color: #409EFF;
|
|
653
|
+
&.effect-light{
|
|
654
|
+
background-color: rgba(64, 158, 255, .2);
|
|
655
|
+
}
|
|
656
|
+
&.effect-dark{
|
|
657
|
+
color: #ffffff;
|
|
658
|
+
background-color: #409EFF;
|
|
659
|
+
}
|
|
726
660
|
}
|
|
727
661
|
&.success{
|
|
728
|
-
|
|
662
|
+
color: #67C23A;
|
|
663
|
+
&.effect-light{
|
|
664
|
+
background-color: rgba(103, 194, 58, .2);
|
|
665
|
+
}
|
|
666
|
+
&.effect-dark{
|
|
667
|
+
color: #ffffff;
|
|
668
|
+
background-color: #67C23A;
|
|
669
|
+
}
|
|
729
670
|
}
|
|
730
671
|
}
|
|
731
|
-
</style>
|
|
672
|
+
</style>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* XT-UI 组件注册配置文件
|
|
3
|
+
* 用于统一管理 Element UI 组件的自动注册配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// 已存在的 Ex 组件列表(不需要从 Element UI 自动注册)
|
|
7
|
+
export const existingExComponents = [
|
|
8
|
+
'Button', // ExButton 已存在
|
|
9
|
+
'Card', // ExCard 已存在
|
|
10
|
+
'Input', // XtInput 已存在(用户要求不自动注册)
|
|
11
|
+
'Table', // ExTable 已存在(在 xt-table 目录中)
|
|
12
|
+
'TableColumn', // ExColumn 已存在(在 xt-table 目录中)
|
|
13
|
+
'Chart' // ExChart 已存在
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
// Element UI 组件列表(用于自动注册为 Ex 开头,但排除已存在的组件)
|
|
17
|
+
export const elementComponentNames = [
|
|
18
|
+
'Autocomplete',
|
|
19
|
+
'Avatar',
|
|
20
|
+
'Backtop',
|
|
21
|
+
'Badge',
|
|
22
|
+
'Breadcrumb',
|
|
23
|
+
'BreadcrumbItem',
|
|
24
|
+
'ButtonGroup',
|
|
25
|
+
'Calendar',
|
|
26
|
+
'Carousel',
|
|
27
|
+
'CarouselItem',
|
|
28
|
+
'Cascader',
|
|
29
|
+
'Checkbox',
|
|
30
|
+
'CheckboxButton',
|
|
31
|
+
'CheckboxGroup',
|
|
32
|
+
'Col',
|
|
33
|
+
'Collapse',
|
|
34
|
+
'CollapseItem',
|
|
35
|
+
'ColorPicker',
|
|
36
|
+
'Container',
|
|
37
|
+
'DatePicker',
|
|
38
|
+
'Dialog',
|
|
39
|
+
'Divider',
|
|
40
|
+
'Drawer',
|
|
41
|
+
'Dropdown',
|
|
42
|
+
'DropdownItem',
|
|
43
|
+
'DropdownMenu',
|
|
44
|
+
'Footer',
|
|
45
|
+
'Form',
|
|
46
|
+
'FormItem',
|
|
47
|
+
'Header',
|
|
48
|
+
'Icon',
|
|
49
|
+
'Image',
|
|
50
|
+
'InputNumber',
|
|
51
|
+
'Link',
|
|
52
|
+
'Main',
|
|
53
|
+
'Menu',
|
|
54
|
+
'MenuItem',
|
|
55
|
+
'MenuItemGroup',
|
|
56
|
+
'Option',
|
|
57
|
+
'OptionGroup',
|
|
58
|
+
'Pagination',
|
|
59
|
+
'Popconfirm',
|
|
60
|
+
'Popover',
|
|
61
|
+
'Progress',
|
|
62
|
+
'Radio',
|
|
63
|
+
'RadioButton',
|
|
64
|
+
'RadioGroup',
|
|
65
|
+
'Rate',
|
|
66
|
+
'Row',
|
|
67
|
+
'Scrollbar',
|
|
68
|
+
'Select',
|
|
69
|
+
'Slider',
|
|
70
|
+
'Step',
|
|
71
|
+
'Steps',
|
|
72
|
+
'Submenu',
|
|
73
|
+
'Switch',
|
|
74
|
+
'TabPane',
|
|
75
|
+
'Tabs',
|
|
76
|
+
'Tag',
|
|
77
|
+
'TimePicker',
|
|
78
|
+
'TimeSelect',
|
|
79
|
+
'Timeline',
|
|
80
|
+
'TimelineItem',
|
|
81
|
+
'Tooltip',
|
|
82
|
+
'Transfer',
|
|
83
|
+
'Tree',
|
|
84
|
+
'Upload'
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
// Element UI 指令列表
|
|
88
|
+
export const elementDirectives = [
|
|
89
|
+
'Loading',
|
|
90
|
+
'Popover',
|
|
91
|
+
'Tooltip'
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
// 注册 Element UI 组件为 Ex 开头的工具函数
|
|
95
|
+
export function registerElementExComponents(Vue, ElementUI) {
|
|
96
|
+
if (!ElementUI) {
|
|
97
|
+
console.warn('[XT-UI] ElementUI not found, skipping Ex- prefix registration')
|
|
98
|
+
return
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
elementComponentNames.forEach(componentName => {
|
|
102
|
+
// 如果组件已存在于排除列表中,则跳过
|
|
103
|
+
if (existingExComponents.includes(componentName)) {
|
|
104
|
+
console.log(`[XT-UI] ${componentName} already exists, skipping registration`)
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const exComponentName = `Ex${componentName}`
|
|
109
|
+
|
|
110
|
+
// 检查是否已经注册过该组件
|
|
111
|
+
if (Vue.options.components[exComponentName]) {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 注册 Element 的组件为 Ex 开头
|
|
116
|
+
const elementComponent = ElementUI[componentName]
|
|
117
|
+
if (elementComponent) {
|
|
118
|
+
Vue.component(exComponentName, elementComponent)
|
|
119
|
+
console.log(`[XT-UI] Registered Element component as ${exComponentName}`)
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// 注册 Element UI 指令的工具函数
|
|
125
|
+
export function registerElementDirectives(Vue, ElementUI) {
|
|
126
|
+
if (!ElementUI) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
elementDirectives.forEach(directiveName => {
|
|
131
|
+
const directive = ElementUI[directiveName]
|
|
132
|
+
if (directive && directive.install) {
|
|
133
|
+
Vue.use(directive)
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
}
|
package/src/index.js
CHANGED
|
@@ -16,38 +16,44 @@ const utils = utilsModule.default || utilsModule
|
|
|
16
16
|
const { getConfig, setConfig, getTheme, getSize, getPrimaryColor, resetConfig, onConfigChange, setTheme, setSize, setPrimaryColor } = utils
|
|
17
17
|
|
|
18
18
|
// 导入组件
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
19
|
+
import XtButton from './components/xt-button'
|
|
20
|
+
import XtInput from './components/xt-input'
|
|
21
|
+
import XtFlexBox from './components/xt-flex-box'
|
|
22
|
+
import XtCard from './components/xt-card'
|
|
23
|
+
import XtCardItem from './components/xt-card-item'
|
|
24
|
+
import XtConfigProvider from './components/xt-config-provider'
|
|
25
|
+
import XtText from './components/xt-text'
|
|
26
|
+
import XtGridBox from './components/xt-grid-box'
|
|
27
|
+
import XtDatePicker from './components/xt-date-picker'
|
|
28
|
+
import ExButton from './components/ex-button'
|
|
29
|
+
import ExChart from './components/ex-chart' // ExChart 组件(基于 ECharts 封装)
|
|
30
|
+
import ExCard from './components/ex-card'
|
|
31
|
+
|
|
32
|
+
// 导入 Element UI 组件注册配置
|
|
33
|
+
import { registerElementExComponents } from './config/element-registry'
|
|
29
34
|
|
|
30
35
|
// 存储组件列表
|
|
31
36
|
const components = [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
XtButton,
|
|
38
|
+
XtInput,
|
|
39
|
+
XtFlexBox,
|
|
40
|
+
XtCard,
|
|
41
|
+
XtCardItem,
|
|
42
|
+
XtConfigProvider,
|
|
43
|
+
XtText,
|
|
44
|
+
XtGridBox,
|
|
45
|
+
XtDatePicker,
|
|
46
|
+
ExButton,
|
|
47
|
+
ExChart,
|
|
48
|
+
ExCard
|
|
42
49
|
]
|
|
43
50
|
|
|
44
|
-
|
|
45
51
|
// 定义 install 方法,Vue.use() 会自动调用
|
|
46
52
|
const install = function (Vue, options = {}) {
|
|
47
53
|
if (install.installed) return
|
|
48
54
|
install.installed = true
|
|
49
55
|
|
|
50
|
-
//
|
|
56
|
+
// 全局注册所有组件
|
|
51
57
|
components.forEach(component => {
|
|
52
58
|
Vue.component(component.name, component)
|
|
53
59
|
})
|
|
@@ -85,6 +91,18 @@ const install = function (Vue, options = {}) {
|
|
|
85
91
|
setConfig(options.config)
|
|
86
92
|
}
|
|
87
93
|
}
|
|
94
|
+
|
|
95
|
+
// 尝试获取 ElementUI(如果已安装)并注册 Ex 开头的组件
|
|
96
|
+
let ElementUI = null
|
|
97
|
+
try {
|
|
98
|
+
ElementUI = require('element-ui')
|
|
99
|
+
} catch (e) {
|
|
100
|
+
console.warn('[XT-UI] ElementUI not found, skipping Ex- prefix registration for Element components')
|
|
101
|
+
return
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 调用统一的注册函数
|
|
105
|
+
registerElementExComponents(Vue, ElementUI)
|
|
88
106
|
}
|
|
89
107
|
|
|
90
108
|
// 支持全局 script 标签引入
|
|
@@ -95,18 +113,24 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
95
113
|
// 导出
|
|
96
114
|
export default {
|
|
97
115
|
install,
|
|
116
|
+
// 导出组件列表
|
|
117
|
+
components,
|
|
98
118
|
// 按需导出组件
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
XtButton,
|
|
120
|
+
XtInput,
|
|
121
|
+
XtFlexBox,
|
|
122
|
+
XtCard,
|
|
123
|
+
XtCardItem,
|
|
124
|
+
XtConfigProvider,
|
|
125
|
+
XtText,
|
|
126
|
+
XtGridBox,
|
|
127
|
+
XtDatePicker,
|
|
128
|
+
ExButton,
|
|
129
|
+
ExCard
|
|
106
130
|
}
|
|
107
131
|
|
|
108
|
-
//
|
|
109
|
-
export { default as
|
|
132
|
+
// ExChart 组件按需导出(使用时需自行安装 echarts 依赖)
|
|
133
|
+
export { default as ExChart } from './components/ex-chart'
|
|
110
134
|
|
|
111
135
|
// 导出工具函数和变量
|
|
112
136
|
export {
|
|
@@ -123,4 +147,4 @@ export {
|
|
|
123
147
|
setTheme,
|
|
124
148
|
setSize,
|
|
125
149
|
setPrimaryColor
|
|
126
|
-
}
|
|
150
|
+
}
|
package/lib/css/2.3f7aa432.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.bar-box[data-v-730aa873]{position:relative;height:100%;width:100%}
|
package/lib/css/3.ffcc175d.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.line-box[data-v-52e2b0b2]{position:relative;height:100%;width:100%}
|
package/lib/css/4.9abd1f2b.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.multiline-box[data-v-6f25e9c5]{height:100%;width:100%}
|
package/lib/css/5.1a31ed8a.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.pie-box[data-v-6735cf79]{position:relative;height:100%;width:100%}
|
package/lib/css/6.c2d0d77e.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.bar-box[data-v-9e2bb3de]{position:relative}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ex-bar v-if="type=='bar'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-bar>
|
|
3
|
-
<ex-line v-else-if="type=='line'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-line>
|
|
4
|
-
<ex-pie v-else-if="type=='pie'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-pie>
|
|
5
|
-
<ex-multi v-else-if="type=='multi'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-multi>
|
|
6
|
-
<ex-trend v-else-if="type=='trend'" v-bind="$attrs" :theme="myTheme" :size="mySize"></ex-trend>
|
|
7
|
-
</template>
|
|
8
|
-
<script>
|
|
9
|
-
export default {
|
|
10
|
-
name: "XtChart",
|
|
11
|
-
components: {
|
|
12
|
-
ExBar: () => import("./ExBar.vue"),
|
|
13
|
-
ExLine: () => import("./ExLine.vue"),
|
|
14
|
-
ExPie: () => import("./ExPie.vue"),
|
|
15
|
-
ExMulti: () => import("./ExMulti.vue"),
|
|
16
|
-
ExTrend: () => import("./ExTrend.vue")
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
theme: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: ""
|
|
22
|
-
},
|
|
23
|
-
size: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: "medium",
|
|
26
|
-
validator: (value) => {
|
|
27
|
-
return ['small', 'medium', 'large'].includes(value)
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
type: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
default: "bar"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
data() {
|
|
37
|
-
return {
|
|
38
|
-
myTheme: this.theme,
|
|
39
|
-
mySize: this.size
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
watch: {
|
|
43
|
-
theme(newVal) {
|
|
44
|
-
this.myTheme = newVal;
|
|
45
|
-
},
|
|
46
|
-
size(newVal) {
|
|
47
|
-
this.mySize = newVal;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
</script>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|