zartui 2.0.82 → 2.0.84
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/es/index.js +1 -1
- package/es/media-picker/index.js +68 -53
- package/es/media-picker/wx-util.js +64 -0
- package/es/table/index.js +30 -7
- package/lib/index.js +1 -1
- package/lib/media-picker/index.js +69 -52
- package/lib/media-picker/wx-util.js +78 -0
- package/lib/table/index.js +30 -7
- package/lib/zart.js +165 -62
- package/lib/zart.min.js +1 -1
- package/package.json +1 -1
package/es/index.js
CHANGED
|
@@ -75,7 +75,7 @@ import TextEllipsis from './text-ellipsis';
|
|
|
75
75
|
import Timeline from './timeline';
|
|
76
76
|
import Toast from './toast';
|
|
77
77
|
import Uploader from './uploader';
|
|
78
|
-
var version = '2.0.
|
|
78
|
+
var version = '2.0.84';
|
|
79
79
|
|
|
80
80
|
function install(Vue) {
|
|
81
81
|
var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, TextEllipsis, Timeline, Toast, Uploader];
|
package/es/media-picker/index.js
CHANGED
|
@@ -30,7 +30,9 @@ import DefaultPdfIcon from "./image/DefaultPdfIcon";
|
|
|
30
30
|
import DefaultPptIcon from "./image/DefaultPptIcon";
|
|
31
31
|
import DefaultTextIcon from "./image/DefaultTextIcon";
|
|
32
32
|
import { FRAME_CONTAINER, CERTIFICATE_BACKGROUND, CERTIFICATE_BUTTON } from './image/Img64';
|
|
33
|
-
import { getFileUniqueCode, getUniqueFileName, isAudioType, isImageType, isVideoType, isPdfType, isDocType, isTextType, isPptType, isExcelType } from "./media-util";
|
|
33
|
+
import { getFileUniqueCode, getUniqueFileName, isAudioType, isImageType, isVideoType, isPdfType, isDocType, isTextType, isPptType, isExcelType } from "./media-util";
|
|
34
|
+
import { isWeixin } from '../utils/device';
|
|
35
|
+
import { wxUploadImage } from './wx-util'; // 单个文件最大限制,单位为M(目前限制是100M)
|
|
34
36
|
|
|
35
37
|
var FILE_SIZE_LIMIT = 100;
|
|
36
38
|
|
|
@@ -161,6 +163,10 @@ export default createComponent({
|
|
|
161
163
|
reUploadText: {
|
|
162
164
|
type: String,
|
|
163
165
|
default: '重新拍摄'
|
|
166
|
+
},
|
|
167
|
+
useWx: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: false
|
|
164
170
|
}
|
|
165
171
|
},
|
|
166
172
|
model: {
|
|
@@ -214,6 +220,8 @@ export default createComponent({
|
|
|
214
220
|
},
|
|
215
221
|
methods: {
|
|
216
222
|
mediaPick: function mediaPick(mediaType, mediaAddType) {
|
|
223
|
+
var _this2 = this;
|
|
224
|
+
|
|
217
225
|
if (this.disabled) {
|
|
218
226
|
return;
|
|
219
227
|
}
|
|
@@ -236,10 +244,17 @@ export default createComponent({
|
|
|
236
244
|
fileInput = _this$$refs.fileInput;
|
|
237
245
|
|
|
238
246
|
if (mediaType === MediaType.PHOTO) {
|
|
239
|
-
if (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
247
|
+
if (this.useWx && isWeixin()) {
|
|
248
|
+
var type = mediaAddType === MediaAddType.TAKE ? 'camera' : 'album';
|
|
249
|
+
wxUploadImage(type).then(function (newMedias) {
|
|
250
|
+
_this2.$emit('input', [].concat(_this2.mediaList, newMedias));
|
|
251
|
+
});
|
|
252
|
+
} else {
|
|
253
|
+
if (mediaAddType === MediaAddType.TAKE) {
|
|
254
|
+
this.triggerHiddenInput(cameraInput);
|
|
255
|
+
} else if (mediaAddType === MediaAddType.PICK) {
|
|
256
|
+
this.triggerHiddenInput(imageInput);
|
|
257
|
+
}
|
|
243
258
|
}
|
|
244
259
|
} else if (mediaType === MediaType.VIDEO) {
|
|
245
260
|
if (mediaAddType === MediaAddType.TAKE) {
|
|
@@ -309,7 +324,7 @@ export default createComponent({
|
|
|
309
324
|
}
|
|
310
325
|
},
|
|
311
326
|
handleInputFiles: function handleInputFiles(event) {
|
|
312
|
-
var
|
|
327
|
+
var _this3 = this;
|
|
313
328
|
|
|
314
329
|
var files = event.target.files;
|
|
315
330
|
|
|
@@ -341,9 +356,9 @@ export default createComponent({
|
|
|
341
356
|
if (isPromise(response)) {
|
|
342
357
|
response.then(function (data) {
|
|
343
358
|
if (data) {
|
|
344
|
-
|
|
359
|
+
_this3.readFiles(data);
|
|
345
360
|
} else {
|
|
346
|
-
|
|
361
|
+
_this3.readFiles(files);
|
|
347
362
|
}
|
|
348
363
|
});
|
|
349
364
|
return;
|
|
@@ -353,13 +368,13 @@ export default createComponent({
|
|
|
353
368
|
this.readFiles(files);
|
|
354
369
|
},
|
|
355
370
|
readFiles: function readFiles(files) {
|
|
356
|
-
var
|
|
371
|
+
var _this4 = this;
|
|
357
372
|
|
|
358
373
|
// 处理非图片
|
|
359
374
|
var notImages = files.filter(function (f) {
|
|
360
375
|
return !isImageType(f);
|
|
361
376
|
}).map(function (f) {
|
|
362
|
-
return
|
|
377
|
+
return _this4.transformNotImageFile(f);
|
|
363
378
|
});
|
|
364
379
|
var newMedias = [];
|
|
365
380
|
|
|
@@ -384,14 +399,14 @@ export default createComponent({
|
|
|
384
399
|
newMedias = newMedias.concat(medias);
|
|
385
400
|
}
|
|
386
401
|
}).finally(function () {
|
|
387
|
-
if (
|
|
388
|
-
|
|
402
|
+
if (_this4.pickerMode === "certificate") {
|
|
403
|
+
_this4.$emit('input', [].concat(newMedias));
|
|
389
404
|
} else {
|
|
390
|
-
|
|
405
|
+
_this4.$emit('input', [].concat(_this4.mediaList, newMedias));
|
|
391
406
|
}
|
|
392
407
|
|
|
393
|
-
if (
|
|
394
|
-
|
|
408
|
+
if (_this4.afterRead) {
|
|
409
|
+
_this4.afterRead(newMedias);
|
|
395
410
|
}
|
|
396
411
|
});
|
|
397
412
|
},
|
|
@@ -495,7 +510,7 @@ export default createComponent({
|
|
|
495
510
|
* @return {Promise<[Media]>}
|
|
496
511
|
*/
|
|
497
512
|
transformImageFiles: function transformImageFiles(files) {
|
|
498
|
-
var
|
|
513
|
+
var _this5 = this;
|
|
499
514
|
|
|
500
515
|
var promisesTodo = [];
|
|
501
516
|
var resizeOptions = new ResizeOptions(this.maxImageSideLength);
|
|
@@ -503,19 +518,19 @@ export default createComponent({
|
|
|
503
518
|
|
|
504
519
|
var _loop = function _loop(i) {
|
|
505
520
|
var file = files[i];
|
|
506
|
-
var watermarkEnabled =
|
|
521
|
+
var watermarkEnabled = _this5.watermarkOptions && _this5.watermarkOptions.watermarkConfigString && checkWatermarkConfigSupported(_this5.watermarkOptions.watermarkConfigString);
|
|
507
522
|
var watermarkOpt = void 0;
|
|
508
523
|
|
|
509
524
|
if (watermarkEnabled) {
|
|
510
525
|
watermarkOpt = new WatermarkOptions({
|
|
511
526
|
enabled: true,
|
|
512
|
-
watermarkConfigString: watermarkEnabled ?
|
|
527
|
+
watermarkConfigString: watermarkEnabled ? _this5.watermarkOptions.watermarkConfigString : '',
|
|
513
528
|
context: {
|
|
514
|
-
address:
|
|
515
|
-
humanName:
|
|
516
|
-
projectName:
|
|
517
|
-
logo:
|
|
518
|
-
applicationName:
|
|
529
|
+
address: _this5.watermarkOptions.address || "",
|
|
530
|
+
humanName: _this5.watermarkOptions.humanName || _this5.watermarkOptions.humanname || "",
|
|
531
|
+
projectName: _this5.watermarkOptions.projectName || "",
|
|
532
|
+
logo: _this5.watermarkOptions.logo || "",
|
|
533
|
+
applicationName: _this5.watermarkOptions.applicationName || "",
|
|
519
534
|
watermarkTime: new Date()
|
|
520
535
|
}
|
|
521
536
|
});
|
|
@@ -666,7 +681,7 @@ export default createComponent({
|
|
|
666
681
|
}
|
|
667
682
|
},
|
|
668
683
|
onDelete: function onDelete(media, index) {
|
|
669
|
-
var
|
|
684
|
+
var _this6 = this;
|
|
670
685
|
|
|
671
686
|
if (this.beforeDelete) {
|
|
672
687
|
var response = this.beforeDelete(media);
|
|
@@ -677,7 +692,7 @@ export default createComponent({
|
|
|
677
692
|
|
|
678
693
|
if (isPromise(response)) {
|
|
679
694
|
response.then(function () {
|
|
680
|
-
|
|
695
|
+
_this6.deleteMedia(media, index);
|
|
681
696
|
});
|
|
682
697
|
return;
|
|
683
698
|
}
|
|
@@ -692,7 +707,7 @@ export default createComponent({
|
|
|
692
707
|
this.$emit('delete', media, index);
|
|
693
708
|
},
|
|
694
709
|
hiddenInput: function hiddenInput() {
|
|
695
|
-
var
|
|
710
|
+
var _this7 = this;
|
|
696
711
|
|
|
697
712
|
var h = this.$createElement;
|
|
698
713
|
return [h("input", {
|
|
@@ -706,7 +721,7 @@ export default createComponent({
|
|
|
706
721
|
"on": {
|
|
707
722
|
"change": this.handleInputFiles,
|
|
708
723
|
"click": function click() {
|
|
709
|
-
return
|
|
724
|
+
return _this7.resetInput(MediaType.PHOTO, MediaAddType.TAKE);
|
|
710
725
|
}
|
|
711
726
|
},
|
|
712
727
|
"class": bem('hidden')
|
|
@@ -720,7 +735,7 @@ export default createComponent({
|
|
|
720
735
|
"on": {
|
|
721
736
|
"change": this.handleInputFiles,
|
|
722
737
|
"click": function click() {
|
|
723
|
-
return
|
|
738
|
+
return _this7.resetInput(MediaType.PHOTO, MediaAddType.PICK);
|
|
724
739
|
}
|
|
725
740
|
},
|
|
726
741
|
"class": bem('hidden')
|
|
@@ -734,7 +749,7 @@ export default createComponent({
|
|
|
734
749
|
"on": {
|
|
735
750
|
"change": this.handleInputFiles,
|
|
736
751
|
"click": function click() {
|
|
737
|
-
return
|
|
752
|
+
return _this7.resetInput(MediaType.VIDEO, MediaAddType.TAKE);
|
|
738
753
|
}
|
|
739
754
|
},
|
|
740
755
|
"class": bem('hidden')
|
|
@@ -747,7 +762,7 @@ export default createComponent({
|
|
|
747
762
|
"on": {
|
|
748
763
|
"change": this.handleInputFiles,
|
|
749
764
|
"click": function click() {
|
|
750
|
-
return
|
|
765
|
+
return _this7.resetInput(MediaType.VIDEO, MediaAddType.PICK);
|
|
751
766
|
}
|
|
752
767
|
},
|
|
753
768
|
"class": bem('hidden')
|
|
@@ -761,7 +776,7 @@ export default createComponent({
|
|
|
761
776
|
"on": {
|
|
762
777
|
"change": this.handleInputFiles,
|
|
763
778
|
"click": function click() {
|
|
764
|
-
return
|
|
779
|
+
return _this7.resetInput(MediaType.AUDIO, MediaAddType.TAKE);
|
|
765
780
|
}
|
|
766
781
|
},
|
|
767
782
|
"class": bem('hidden')
|
|
@@ -774,7 +789,7 @@ export default createComponent({
|
|
|
774
789
|
"on": {
|
|
775
790
|
"change": this.handleInputFiles,
|
|
776
791
|
"click": function click() {
|
|
777
|
-
return
|
|
792
|
+
return _this7.resetInput(MediaType.AUDIO, MediaAddType.PICK);
|
|
778
793
|
}
|
|
779
794
|
},
|
|
780
795
|
"class": bem('hidden')
|
|
@@ -787,14 +802,14 @@ export default createComponent({
|
|
|
787
802
|
"on": {
|
|
788
803
|
"change": this.handleInputFiles,
|
|
789
804
|
"click": function click() {
|
|
790
|
-
return
|
|
805
|
+
return _this7.resetInput(MediaType.FILE, MediaAddType.PICK);
|
|
791
806
|
}
|
|
792
807
|
},
|
|
793
808
|
"class": bem('hidden')
|
|
794
809
|
})];
|
|
795
810
|
},
|
|
796
811
|
renderIcon: function renderIcon(mediaType, mediaAddType) {
|
|
797
|
-
var
|
|
812
|
+
var _this8 = this;
|
|
798
813
|
|
|
799
814
|
var h = this.$createElement;
|
|
800
815
|
|
|
@@ -804,7 +819,7 @@ export default createComponent({
|
|
|
804
819
|
"class": bem('button'),
|
|
805
820
|
"on": {
|
|
806
821
|
"click": function click() {
|
|
807
|
-
return
|
|
822
|
+
return _this8.mediaPick(mediaType, mediaAddType);
|
|
808
823
|
}
|
|
809
824
|
}
|
|
810
825
|
});
|
|
@@ -813,7 +828,7 @@ export default createComponent({
|
|
|
813
828
|
"class": bem('button'),
|
|
814
829
|
"on": {
|
|
815
830
|
"click": function click() {
|
|
816
|
-
return
|
|
831
|
+
return _this8.mediaPick(mediaType, mediaAddType);
|
|
817
832
|
}
|
|
818
833
|
}
|
|
819
834
|
});
|
|
@@ -823,7 +838,7 @@ export default createComponent({
|
|
|
823
838
|
"class": bem('button'),
|
|
824
839
|
"on": {
|
|
825
840
|
"click": function click() {
|
|
826
|
-
return
|
|
841
|
+
return _this8.mediaPick(mediaType, mediaAddType);
|
|
827
842
|
}
|
|
828
843
|
}
|
|
829
844
|
});
|
|
@@ -832,7 +847,7 @@ export default createComponent({
|
|
|
832
847
|
"class": bem('button'),
|
|
833
848
|
"on": {
|
|
834
849
|
"click": function click() {
|
|
835
|
-
return
|
|
850
|
+
return _this8.mediaPick(mediaType, mediaAddType);
|
|
836
851
|
}
|
|
837
852
|
}
|
|
838
853
|
});
|
|
@@ -841,7 +856,7 @@ export default createComponent({
|
|
|
841
856
|
"class": bem('button'),
|
|
842
857
|
"on": {
|
|
843
858
|
"click": function click() {
|
|
844
|
-
return
|
|
859
|
+
return _this8.mediaPick(mediaType, mediaAddType);
|
|
845
860
|
}
|
|
846
861
|
}
|
|
847
862
|
});
|
|
@@ -872,7 +887,7 @@ export default createComponent({
|
|
|
872
887
|
}, [label])]);
|
|
873
888
|
},
|
|
874
889
|
renderCertificates: function renderCertificates() {
|
|
875
|
-
var
|
|
890
|
+
var _this9 = this;
|
|
876
891
|
|
|
877
892
|
var h = this.$createElement;
|
|
878
893
|
|
|
@@ -885,9 +900,9 @@ export default createComponent({
|
|
|
885
900
|
"click": function click(event) {
|
|
886
901
|
event.stopPropagation();
|
|
887
902
|
|
|
888
|
-
|
|
903
|
+
_this9.onDelete(media, 0);
|
|
889
904
|
|
|
890
|
-
|
|
905
|
+
_this9.mediaPick(MediaType.PHOTO, MediaAddType.PICK);
|
|
891
906
|
}
|
|
892
907
|
}
|
|
893
908
|
}, [h(ReUploadIcon, {
|
|
@@ -905,7 +920,7 @@ export default createComponent({
|
|
|
905
920
|
"click": function click(event) {
|
|
906
921
|
event.stopPropagation(); // 证件照模式只有一张图片
|
|
907
922
|
|
|
908
|
-
|
|
923
|
+
_this9.previewMedia(media, 0);
|
|
909
924
|
}
|
|
910
925
|
}
|
|
911
926
|
}, [reUpload]);
|
|
@@ -922,7 +937,7 @@ export default createComponent({
|
|
|
922
937
|
},
|
|
923
938
|
"on": {
|
|
924
939
|
"click": function click() {
|
|
925
|
-
|
|
940
|
+
_this9.mediaPick(MediaType.PHOTO, MediaAddType.PICK);
|
|
926
941
|
}
|
|
927
942
|
}
|
|
928
943
|
}), h("span", {
|
|
@@ -1056,7 +1071,7 @@ export default createComponent({
|
|
|
1056
1071
|
}
|
|
1057
1072
|
},
|
|
1058
1073
|
renderMediaList: function renderMediaList() {
|
|
1059
|
-
var
|
|
1074
|
+
var _this10 = this;
|
|
1060
1075
|
|
|
1061
1076
|
var h = this.$createElement;
|
|
1062
1077
|
return this.mediaList.map(function (media, index) {
|
|
@@ -1067,7 +1082,7 @@ export default createComponent({
|
|
|
1067
1082
|
"click": function click(event) {
|
|
1068
1083
|
event.stopPropagation();
|
|
1069
1084
|
|
|
1070
|
-
|
|
1085
|
+
_this10.onDelete(media, index);
|
|
1071
1086
|
}
|
|
1072
1087
|
}
|
|
1073
1088
|
});
|
|
@@ -1077,10 +1092,10 @@ export default createComponent({
|
|
|
1077
1092
|
"click": function click(event) {
|
|
1078
1093
|
event.stopPropagation();
|
|
1079
1094
|
|
|
1080
|
-
|
|
1095
|
+
_this10.previewMedia(media, index);
|
|
1081
1096
|
}
|
|
1082
1097
|
}
|
|
1083
|
-
}, [
|
|
1098
|
+
}, [_this10.renderMediaBox(media), _this10.genThumbnailMask(media), deleteIcon]);
|
|
1084
1099
|
});
|
|
1085
1100
|
},
|
|
1086
1101
|
selectAction: function selectAction(action) {
|
|
@@ -1089,7 +1104,7 @@ export default createComponent({
|
|
|
1089
1104
|
}
|
|
1090
1105
|
},
|
|
1091
1106
|
render: function render() {
|
|
1092
|
-
var
|
|
1107
|
+
var _this11 = this;
|
|
1093
1108
|
|
|
1094
1109
|
var h = arguments[0];
|
|
1095
1110
|
var title = this.showTitle && h("div", {
|
|
@@ -1103,9 +1118,9 @@ export default createComponent({
|
|
|
1103
1118
|
"mediaUrl": this.mediaUrlToPlay
|
|
1104
1119
|
},
|
|
1105
1120
|
"model": {
|
|
1106
|
-
value:
|
|
1121
|
+
value: _this11.mediaPlayerVisible,
|
|
1107
1122
|
callback: function callback($$v) {
|
|
1108
|
-
|
|
1123
|
+
_this11.mediaPlayerVisible = $$v;
|
|
1109
1124
|
}
|
|
1110
1125
|
}
|
|
1111
1126
|
}), h(ZtActionSheet, {
|
|
@@ -1119,9 +1134,9 @@ export default createComponent({
|
|
|
1119
1134
|
"select": this.selectAction
|
|
1120
1135
|
},
|
|
1121
1136
|
"model": {
|
|
1122
|
-
value:
|
|
1137
|
+
value: _this11.actionVisible,
|
|
1123
1138
|
callback: function callback($$v) {
|
|
1124
|
-
|
|
1139
|
+
_this11.actionVisible = $$v;
|
|
1125
1140
|
}
|
|
1126
1141
|
}
|
|
1127
1142
|
}), this.pickerMode === "certificate" ? h("div", {
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { MediaType, MediaUploadStatus } from './type';
|
|
2
|
+
export var chooseImage = function chooseImage(type) {
|
|
3
|
+
return new Promise(function (resolve, reject) {
|
|
4
|
+
window.wx.chooseImage({
|
|
5
|
+
count: 1,
|
|
6
|
+
sizeType: ['original', 'compressed'],
|
|
7
|
+
// 可以指定是原图还是压缩图,默认二者都有
|
|
8
|
+
sourceType: [type],
|
|
9
|
+
// 可以指定来源是相册还是相机,默认二者都有
|
|
10
|
+
success: function success(_ref) {
|
|
11
|
+
var localIds = _ref.localIds;
|
|
12
|
+
resolve(localIds);
|
|
13
|
+
},
|
|
14
|
+
fail: function fail(res) {
|
|
15
|
+
reject(res);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export var uploadImage = function uploadImage(localId) {
|
|
21
|
+
return new Promise(function (resolve, reject) {
|
|
22
|
+
window.wx.uploadImage({
|
|
23
|
+
localId: localId,
|
|
24
|
+
// 需要上传的图片的本地ID,由chooseImage接口获得
|
|
25
|
+
isShowProgressTips: 1,
|
|
26
|
+
// 默认为1,显示进度提示
|
|
27
|
+
success: function success(_ref2) {
|
|
28
|
+
var serverId = _ref2.serverId;
|
|
29
|
+
resolve(serverId);
|
|
30
|
+
},
|
|
31
|
+
fail: function fail(res) {
|
|
32
|
+
reject(res);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export var wxUploadImage = function wxUploadImage(type) {
|
|
38
|
+
return new Promise(function (resolve) {
|
|
39
|
+
var newMedias = [];
|
|
40
|
+
chooseImage(type).then(function (localIds) {
|
|
41
|
+
var time = new Date().getTime().toString();
|
|
42
|
+
var media = {
|
|
43
|
+
type: MediaType.PHOTO,
|
|
44
|
+
uniqueCode: time,
|
|
45
|
+
fileSize: 0,
|
|
46
|
+
lastModified: 0,
|
|
47
|
+
deletable: true,
|
|
48
|
+
status: MediaUploadStatus.DONE
|
|
49
|
+
};
|
|
50
|
+
localIds.forEach(function (localId) {
|
|
51
|
+
media.showSrc = localId;
|
|
52
|
+
media.url = localId;
|
|
53
|
+
uploadImage(localId).then(function (serverId) {
|
|
54
|
+
media.wxServerId = serverId;
|
|
55
|
+
newMedias.push(media);
|
|
56
|
+
|
|
57
|
+
if (newMedias.length === localIds.length) {
|
|
58
|
+
resolve(newMedias);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
};
|
package/es/table/index.js
CHANGED
|
@@ -25,6 +25,10 @@ export default createComponent({
|
|
|
25
25
|
striped: {
|
|
26
26
|
type: Boolean,
|
|
27
27
|
default: false
|
|
28
|
+
},
|
|
29
|
+
hideTableHead: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
data: function data() {
|
|
@@ -106,6 +110,9 @@ export default createComponent({
|
|
|
106
110
|
|
|
107
111
|
var h = this.$createElement;
|
|
108
112
|
|
|
113
|
+
var _ref2 = this,
|
|
114
|
+
slots = _ref2.slots;
|
|
115
|
+
|
|
109
116
|
if ((colData == null ? void 0 : colData.colSpan) !== 0) {
|
|
110
117
|
return h("th", {
|
|
111
118
|
"class": bem({
|
|
@@ -118,7 +125,7 @@ export default createComponent({
|
|
|
118
125
|
"attrs": {
|
|
119
126
|
"colspan": (colData == null ? void 0 : colData.colSpan) !== 1 ? colData == null ? void 0 : colData.colSpan : null
|
|
120
127
|
}
|
|
121
|
-
}, [h("div", {
|
|
128
|
+
}, [slots("head" + colData.id) || h("div", {
|
|
122
129
|
"class": bem('head'),
|
|
123
130
|
"on": {
|
|
124
131
|
"click": function click() {
|
|
@@ -154,6 +161,23 @@ export default createComponent({
|
|
|
154
161
|
}
|
|
155
162
|
},
|
|
156
163
|
onClick: function onClick() {},
|
|
164
|
+
getElement: function getElement(rowData, colData) {
|
|
165
|
+
var h = this.$createElement;
|
|
166
|
+
|
|
167
|
+
var _ref3 = this,
|
|
168
|
+
slots = _ref3.slots;
|
|
169
|
+
|
|
170
|
+
if (rowData[colData.key] && rowData[colData.key].id && slots("data" + rowData[colData.key].id)) {
|
|
171
|
+
return slots("data" + rowData[colData.key].id)[0];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return colData.ellipsis ? h(TextEllipsis, {
|
|
175
|
+
"attrs": {
|
|
176
|
+
"content": rowData[colData.key],
|
|
177
|
+
"expandType": "dialog"
|
|
178
|
+
}
|
|
179
|
+
}) : rowData[colData.key];
|
|
180
|
+
},
|
|
157
181
|
getBody: function getBody(rowData, rowIndex) {
|
|
158
182
|
var _this3 = this;
|
|
159
183
|
|
|
@@ -185,12 +209,7 @@ export default createComponent({
|
|
|
185
209
|
"rowspan": ((_additionalCellProps5 = additionalCellProps) == null ? void 0 : _additionalCellProps5.rowSpan) !== 1 ? (_additionalCellProps6 = additionalCellProps) == null ? void 0 : _additionalCellProps6.rowSpan : null
|
|
186
210
|
},
|
|
187
211
|
"style": style
|
|
188
|
-
}, [
|
|
189
|
-
"attrs": {
|
|
190
|
-
"content": rowData[colData.key],
|
|
191
|
-
"expandType": "dialog"
|
|
192
|
-
}
|
|
193
|
-
}) : rowData[colData.key]]);
|
|
212
|
+
}, [_this3.getElement(rowData, colData)]);
|
|
194
213
|
})]);
|
|
195
214
|
}
|
|
196
215
|
},
|
|
@@ -213,6 +232,10 @@ export default createComponent({
|
|
|
213
232
|
}
|
|
214
233
|
});
|
|
215
234
|
})]), h("thead", {
|
|
235
|
+
"directives": [{
|
|
236
|
+
name: "show",
|
|
237
|
+
value: !this.hideTableHead
|
|
238
|
+
}],
|
|
216
239
|
"class": bem('thead')
|
|
217
240
|
}, [h("tr", [this.formatColumns.map(function (colData) {
|
|
218
241
|
return _this4.getHead(colData);
|
package/lib/index.js
CHANGED
|
@@ -313,7 +313,7 @@ exports.Toast = _toast.default;
|
|
|
313
313
|
var _uploader = _interopRequireDefault(require("./uploader"));
|
|
314
314
|
|
|
315
315
|
exports.Uploader = _uploader.default;
|
|
316
|
-
var version = '2.0.
|
|
316
|
+
var version = '2.0.84';
|
|
317
317
|
exports.version = version;
|
|
318
318
|
|
|
319
319
|
function install(Vue) {
|