zartui 0.1.113 → 1.0.2
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/hierarchy-select/hierarchySelect.js +8 -1
- package/es/hierarchy-select/index.css +1 -1
- package/es/hierarchy-select/index.js +14 -6
- package/es/hierarchy-select/index.less +5 -4
- package/es/hierarchy-select/markList.js +16 -1
- package/es/index.js +4 -3
- package/es/multiple-picker/index.css +1 -1
- package/es/multiple-picker/index.less +2 -0
- package/es/pdf-viewer-v2/index.css +1 -0
- package/es/pdf-viewer-v2/index.js +231 -0
- package/es/pdf-viewer-v2/index.less +40 -0
- package/es/pdf-viewer-v2/style/index.js +8 -0
- package/es/pdf-viewer-v2/style/less.js +8 -0
- package/lib/7893e51cf0a4877dac80.worker.js +10 -0
- package/lib/be09b519a460e229fd8d.worker.js +2527 -0
- package/lib/hierarchy-select/hierarchySelect.js +8 -1
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/hierarchy-select/index.js +15 -6
- package/lib/hierarchy-select/index.less +5 -4
- package/lib/hierarchy-select/markList.js +16 -1
- package/lib/index.css +1 -1
- package/lib/index.js +6 -2
- package/lib/index.less +1 -0
- package/lib/multiple-picker/index.css +1 -1
- package/lib/multiple-picker/index.less +2 -0
- package/lib/pdf-viewer-v2/index.css +1 -0
- package/lib/pdf-viewer-v2/index.js +242 -0
- package/lib/pdf-viewer-v2/index.less +40 -0
- package/lib/pdf-viewer-v2/style/index.js +8 -0
- package/lib/pdf-viewer-v2/style/less.js +8 -0
- package/lib/zart.js +13178 -44157
- package/lib/zart.min.js +4 -4
- package/package.json +6 -5
- package/lib/a037f57fc4d92a8a1f1e.worker.js +0 -60600
- package/lib/b7cf90b4775181215df7.worker.js +0 -10
|
@@ -58,6 +58,12 @@ export default createComponent({
|
|
|
58
58
|
returnChainData: {
|
|
59
59
|
type: Boolean,
|
|
60
60
|
default: false
|
|
61
|
+
},
|
|
62
|
+
confirmedList: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: function _default() {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
},
|
|
63
69
|
data: function data() {
|
|
@@ -148,7 +154,8 @@ export default createComponent({
|
|
|
148
154
|
"resetReplaceCancel": this.resetReplaceCancel,
|
|
149
155
|
"disableParent": this.disableParent,
|
|
150
156
|
"valueKey": this.valueKey,
|
|
151
|
-
"textKey": this.textKey
|
|
157
|
+
"textKey": this.textKey,
|
|
158
|
+
"confirmedList": this.confirmedList
|
|
152
159
|
},
|
|
153
160
|
"on": {
|
|
154
161
|
"clickNext": this.clickNext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zt-hierarchy-select__popup{height:100%}.zt-hierarchy-select__popup .zt-hierarchy-select{background-color:#f5f5ff;height:100%}.zt-hierarchy-select__popup .zt-hierarchy-select__title{height:44px;position:relative;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.1)}.zt-hierarchy-select__popup .zt-hierarchy-select__title i{font-size:14px;position:absolute;left:15px;top:16px}.zt-hierarchy-select__popup .zt-hierarchy-select__title div{line-height:44px;text-align:center;font-weight:700;font-size:18px;color:#142841}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-core .zt-loading{position:absolute;top:50%;left:50%;margin-left:-18px;margin-right:-18px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-core__list span{height:24px;font-size:16px;font-family:PingFangSC,PingFangSC-Semibold;font-weight:600;color:#0091fa;line-height:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-core__list .flex{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;padding:10px 0;background-color:#fff;margin-bottom:16px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__indicator-crumb-list{-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 16px;overflow-x:auto}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__indicator-crumb-list span{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;white-space:nowrap;height:24px;font-size:16px;font-family:PingFangSC,PingFangSC-Regular;text-align:left;color:#000;line-height:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__indicator-crumb-list__icon-arrow{margin:0 4px;width:20px;height:20px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__crumb-item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__fill-blur{position:absolute;top:0;width:16px;height:44px;background:-webkit-gradient(linear,right top,left top,from(rgba(255,255,255,0)),to(#fff))}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__fill-blur:last-child{right:0;top:0;background:-webkit-gradient(linear,right top,left top,from(#fff),to(rgba(255,255,255,0)))}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list{background-color:#fff}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__multiple-button{margin-right:8px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__check-icon{color:#0091fa;font-size:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__uncheck-icon{
|
|
1
|
+
.zt-hierarchy-select__popup{height:100%}.zt-hierarchy-select__popup .zt-hierarchy-select{background-color:#f5f5ff;height:100%}.zt-hierarchy-select__popup .zt-hierarchy-select__title{height:44px;position:relative;background-color:#fff;border-bottom:1px solid rgba(0,0,0,.1)}.zt-hierarchy-select__popup .zt-hierarchy-select__title i{font-size:14px;position:absolute;left:15px;top:16px}.zt-hierarchy-select__popup .zt-hierarchy-select__title div{line-height:44px;text-align:center;font-weight:700;font-size:18px;color:#142841}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-core .zt-loading{position:absolute;top:50%;left:50%;margin-left:-18px;margin-right:-18px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-core__list span{height:24px;font-size:16px;font-family:PingFangSC,PingFangSC-Semibold;font-weight:600;color:#0091fa;line-height:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-core__list .flex{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;padding:10px 0;background-color:#fff;margin-bottom:16px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__indicator-crumb-list{-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 16px;overflow-x:auto}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__indicator-crumb-list span{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;white-space:nowrap;height:24px;font-size:16px;font-family:PingFangSC,PingFangSC-Regular;text-align:left;color:#000;line-height:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__indicator-crumb-list__icon-arrow{margin:0 4px;width:20px;height:20px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__crumb-item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__fill-blur{position:absolute;top:0;width:16px;height:44px;background:-webkit-gradient(linear,right top,left top,from(rgba(255,255,255,0)),to(#fff))}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-select-breadcrumb__fill-blur:last-child{right:0;top:0;background:-webkit-gradient(linear,right top,left top,from(#fff),to(rgba(255,255,255,0)))}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list{background-color:#fff}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__multiple-button{margin-right:8px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__check-icon{color:#0091fa;font-size:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__uncheck-icon{color:#e4e4e4;font-size:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__score-item{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:10px 0;background-color:#fff;margin-left:16px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__score-item:after{content:" ";position:absolute;bottom:0;height:1px;width:100%;background-color:rgba(0,0,0,.1);box-shadow:0 0 0 0 #000 inset}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__item-content{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin-right:16px;width:278px;font-size:16px;font-family:PingFangSC,PingFangSC-Regular;font-weight:400;text-align:left;color:#000;line-height:24px;word-break:break-all}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__item-content span{color:#0091fa}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__item-nav{padding:0 16px;border-left:rgba(0,0,0,.1) 1px solid}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__sub-level{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__sub-level span{color:#0091fa}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__sub-level--disable{opacity:.2}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__sub-icon{margin-right:4px;font-size:0;width:20px;height:20px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__result-box{position:fixed;left:0;bottom:0;background:#fff;width:100%}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__result-list{height:160px;box-shadow:0 -4px 8px 0 rgba(0,0,0,.1);border-radius:8px 8px 0 0;padding:12px 16px;font-size:14px;color:#000;line-height:24px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__operate-box{display:-webkit-box;display:-webkit-flex;display:flex;height:44px;line-height:44px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__selected{border-top:1px solid rgba(0,0,0,.1);display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 16px;-webkit-box-flex:1;-webkit-flex:1;flex:1;height:44px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__selected i{color:#0091fa;font-size:20px;margin-right:4px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__selected span{font-size:14px;color:rgba(0,0,0,.6)}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__selected span.zt-hierarchy-mark-list__blue{color:#0091fa;margin-left:8px}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__line{width:1px;height:24px;background:rgba(0,0,0,.1);-webkit-transform:scaleX(.5);transform:scaleX(.5);border-top:1px solid rgba(0,0,0,.1)}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__reset-button{width:110px;border-top:1px solid rgba(0,0,0,.1);font-size:16px;color:#000;text-align:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__cancel-button{width:110px;border-top:1px solid rgba(0,0,0,.1);font-size:16px;color:#000;text-align:center}.zt-hierarchy-select__popup .zt-hierarchy-select .zt-hierarchy-mark-list__confirm-button{width:110px;border-top:1px solid #0091fa;font-weight:700;font-size:16px;color:#fff;text-align:center;background:#0091fa}
|
|
@@ -10,6 +10,7 @@ import HierarchySelect from './hierarchySelect';
|
|
|
10
10
|
import Popup from '../popup';
|
|
11
11
|
import { PopupMixin } from '../mixins/popup';
|
|
12
12
|
import Icon from "../icon";
|
|
13
|
+
import { deepClone } from '../utils/deep-clone';
|
|
13
14
|
export default createComponent({
|
|
14
15
|
mixins: [PopupMixin()],
|
|
15
16
|
props: {
|
|
@@ -60,7 +61,8 @@ export default createComponent({
|
|
|
60
61
|
},
|
|
61
62
|
data: function data() {
|
|
62
63
|
return {
|
|
63
|
-
showPicker: false
|
|
64
|
+
showPicker: false,
|
|
65
|
+
confirmedList: []
|
|
64
66
|
};
|
|
65
67
|
},
|
|
66
68
|
methods: {
|
|
@@ -85,7 +87,13 @@ export default createComponent({
|
|
|
85
87
|
}
|
|
86
88
|
},
|
|
87
89
|
confirm: function confirm(list) {
|
|
88
|
-
this
|
|
90
|
+
this.confirmedList = deepClone(list);
|
|
91
|
+
this.$emit("confirm", this.confirmedList);
|
|
92
|
+
},
|
|
93
|
+
onBack: function onBack() {
|
|
94
|
+
if (this.$refs.hierarchySelect && this.$refs.hierarchySelect.$refs.markList) {
|
|
95
|
+
this.$refs.hierarchySelect.$refs.markList.cancel();
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
98
|
},
|
|
91
99
|
render: function render(h) {
|
|
@@ -116,11 +124,10 @@ export default createComponent({
|
|
|
116
124
|
"name": "arrow-left"
|
|
117
125
|
},
|
|
118
126
|
"on": {
|
|
119
|
-
"click":
|
|
120
|
-
_this.showPicker = false;
|
|
121
|
-
}
|
|
127
|
+
"click": this.onBack
|
|
122
128
|
}
|
|
123
129
|
}), h("div", [this.title])]), h(HierarchySelect, {
|
|
130
|
+
"ref": "hierarchySelect",
|
|
124
131
|
"attrs": {
|
|
125
132
|
"treeData": this.treeData,
|
|
126
133
|
"disableParent": this.disableParent,
|
|
@@ -129,7 +136,8 @@ export default createComponent({
|
|
|
129
136
|
"multiple": this.multiple,
|
|
130
137
|
"valueKey": this.valueKey,
|
|
131
138
|
"textKey": this.textKey,
|
|
132
|
-
"returnChainData": this.returnChainData
|
|
139
|
+
"returnChainData": this.returnChainData,
|
|
140
|
+
"confirmedList": this.confirmedList
|
|
133
141
|
},
|
|
134
142
|
"on": {
|
|
135
143
|
"selected": this.onSelected,
|
|
@@ -97,16 +97,17 @@
|
|
|
97
97
|
background-color: #fff;
|
|
98
98
|
&__multiple-button {
|
|
99
99
|
margin-right: 8px;
|
|
100
|
+
display: flex;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
align-items: center;
|
|
100
103
|
}
|
|
101
104
|
&__check-icon {
|
|
102
105
|
color: #0091fa;
|
|
103
106
|
font-size: 24px;
|
|
104
107
|
}
|
|
105
108
|
&__uncheck-icon {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
border: 1px solid rgba(0,0,0,.1);
|
|
109
|
-
border-radius: 50%;
|
|
109
|
+
color: #E4E4E4;
|
|
110
|
+
font-size: 24px;
|
|
110
111
|
}
|
|
111
112
|
&__score-item {
|
|
112
113
|
position: relative;
|
|
@@ -36,6 +36,12 @@ export default createComponent({
|
|
|
36
36
|
textKey: {
|
|
37
37
|
type: String,
|
|
38
38
|
default: "name"
|
|
39
|
+
},
|
|
40
|
+
confirmedList: {
|
|
41
|
+
type: Array,
|
|
42
|
+
default: function _default() {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
39
45
|
}
|
|
40
46
|
},
|
|
41
47
|
data: function data() {
|
|
@@ -61,6 +67,11 @@ export default createComponent({
|
|
|
61
67
|
return;
|
|
62
68
|
}
|
|
63
69
|
|
|
70
|
+
if (this.multiple) {
|
|
71
|
+
this.multipleClicked(item);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
64
75
|
this.choosedValue = item[this.valueKey];
|
|
65
76
|
this.$emit('selected', item);
|
|
66
77
|
},
|
|
@@ -71,7 +82,10 @@ export default createComponent({
|
|
|
71
82
|
"name": "checked"
|
|
72
83
|
},
|
|
73
84
|
"class": bem("check-icon")
|
|
74
|
-
}) : h(
|
|
85
|
+
}) : h(Icon, {
|
|
86
|
+
"attrs": {
|
|
87
|
+
"name": "circle"
|
|
88
|
+
},
|
|
75
89
|
"class": bem("uncheck-icon")
|
|
76
90
|
});
|
|
77
91
|
},
|
|
@@ -146,6 +160,7 @@ export default createComponent({
|
|
|
146
160
|
unchecked(array);
|
|
147
161
|
},
|
|
148
162
|
cancel: function cancel() {
|
|
163
|
+
this.checkedList = deepClone(this.confirmedList);
|
|
149
164
|
this.$emit("cancel");
|
|
150
165
|
},
|
|
151
166
|
confirm: function confirm() {
|
package/es/index.js
CHANGED
|
@@ -45,6 +45,7 @@ import NumberKeyboard from './number-keyboard';
|
|
|
45
45
|
import Overlay from './overlay';
|
|
46
46
|
import PasswordInput from './password-input';
|
|
47
47
|
import PdfViewer from './pdf-viewer';
|
|
48
|
+
import PdfViewerV2 from './pdf-viewer-v2';
|
|
48
49
|
import Picker from './picker';
|
|
49
50
|
import Popover from './popover';
|
|
50
51
|
import Popup from './popup';
|
|
@@ -75,10 +76,10 @@ import Tag from './tag';
|
|
|
75
76
|
import Timeline from './timeline';
|
|
76
77
|
import Toast from './toast';
|
|
77
78
|
import Uploader from './uploader';
|
|
78
|
-
var version = '0.
|
|
79
|
+
var version = '1.0.2';
|
|
79
80
|
|
|
80
81
|
function install(Vue) {
|
|
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, PdfViewer, 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, Timeline, Toast, Uploader];
|
|
82
|
+
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, PdfViewer, PdfViewerV2, 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, Timeline, Toast, Uploader];
|
|
82
83
|
components.forEach(function (item) {
|
|
83
84
|
if (item.install) {
|
|
84
85
|
Vue.use(item);
|
|
@@ -92,7 +93,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
92
93
|
install(window.Vue);
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
export { install, version, 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, PdfViewer, 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, Timeline, Toast, Uploader };
|
|
96
|
+
export { install, version, 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, PdfViewer, PdfViewerV2, 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, Timeline, Toast, Uploader };
|
|
96
97
|
export default {
|
|
97
98
|
install: install,
|
|
98
99
|
version: version
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[class*=zt-hairline]::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid rgba(0,0,0,.1);-webkit-transform:scale(.5);transform:scale(.5)}.zt-hairline,.zt-hairline--bottom,.zt-hairline--left,.zt-hairline--right,.zt-hairline--surround,.zt-hairline--top,.zt-hairline--top-bottom{position:relative}.zt-hairline--top::after{border-top-width:1px}.zt-hairline--left::after{border-left-width:1px}.zt-hairline--right::after{border-right-width:1px}.zt-hairline--bottom::after{border-bottom-width:1px}.zt-hairline--top-bottom::after,.zt-hairline-unset--top-bottom::after{border-width:1px 0}.zt-hairline--surround::after{border-width:1px}.zt-multiple-picker{position:relative;background-color:#fff;-webkit-user-select:none;user-select:none}.zt-multiple-picker__toolbar{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;height:44px}.zt-multiple-picker__border{position:relative}.zt-multiple-picker__border::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt-multiple-picker__cancel,.zt-multiple-picker__confirm{height:100%;padding:0 16px;font-size:16px;background-color:transparent;border:none;cursor:pointer}.zt-multiple-picker__cancel:active,.zt-multiple-picker__confirm:active{opacity:.7}.zt-multiple-picker__confirm{color:#0091fa;font-weight:700}.zt-multiple-picker__cancel{color:#000;font-weight:400}.zt-multiple-picker__title{max-width:50%;font-weight:400;font-size:14px;line-height:20px;text-align:center;color:rgba(0,0,0,.4)}.zt-multiple-picker__header{width:100%;height:40px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-size:14px;font-weight:400}.zt-multiple-picker__header>li{-webkit-box-flex:1;-webkit-flex:auto;flex:auto;text-align:center}.zt-multiple-picker__options{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;cursor:grab}.zt-multiple-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#0091fa;background-color:rgba(255,255,255,.9)}.zt-multiple-picker-options{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:scroll;font-size:16px}.zt-multiple-picker-options__wrapper{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;background-color:#fff;padding:12px 16px 4px 16px}.zt-multiple-picker-options__item{color:rgba(0,0,0,.6);padding:0 4px 8px 0;box-sizing:border-box;border-radius:2px;text-align:center;font-size:14px}.zt-multiple-picker-options__item .zt-ellipsis{height:28px;line-height:28px;background-color:rgba(0,0,0,.04)}.zt-multiple-picker-options__item--disabled{cursor:not-allowed;opacity:.3}.zt-multiple-picker-options__item--last{padding-right:0}.zt-multiple-picker-options__item--selected .zt-ellipsis{background:rgba(0,145,250,.1);border:1px solid #0091fa;border-radius:2px;color:#0091fa}
|
|
1
|
+
[class*=zt-hairline]::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid rgba(0,0,0,.1);-webkit-transform:scale(.5);transform:scale(.5)}.zt-hairline,.zt-hairline--bottom,.zt-hairline--left,.zt-hairline--right,.zt-hairline--surround,.zt-hairline--top,.zt-hairline--top-bottom{position:relative}.zt-hairline--top::after{border-top-width:1px}.zt-hairline--left::after{border-left-width:1px}.zt-hairline--right::after{border-right-width:1px}.zt-hairline--bottom::after{border-bottom-width:1px}.zt-hairline--top-bottom::after,.zt-hairline-unset--top-bottom::after{border-width:1px 0}.zt-hairline--surround::after{border-width:1px}.zt-multiple-picker{position:relative;background-color:#fff;-webkit-user-select:none;user-select:none}.zt-multiple-picker__toolbar{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;height:44px}.zt-multiple-picker__border{position:relative}.zt-multiple-picker__border::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt-multiple-picker__cancel,.zt-multiple-picker__confirm{height:100%;padding:0 16px;font-size:16px;background-color:transparent;border:none;cursor:pointer}.zt-multiple-picker__cancel:active,.zt-multiple-picker__confirm:active{opacity:.7}.zt-multiple-picker__confirm{color:#0091fa;font-weight:700}.zt-multiple-picker__cancel{color:#000;font-weight:400}.zt-multiple-picker__title{max-width:50%;font-weight:400;font-size:14px;line-height:20px;text-align:center;color:rgba(0,0,0,.4)}.zt-multiple-picker__header{width:100%;height:40px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-size:14px;font-weight:400}.zt-multiple-picker__header>li{-webkit-box-flex:1;-webkit-flex:auto;flex:auto;text-align:center}.zt-multiple-picker__options{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;cursor:grab}.zt-multiple-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;color:#0091fa;background-color:rgba(255,255,255,.9)}.zt-multiple-picker-options{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:scroll;font-size:16px}.zt-multiple-picker-options__wrapper{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;background-color:#fff;padding:12px 16px 4px 16px}.zt-multiple-picker-options__item{color:rgba(0,0,0,.6);padding:0 4px 8px 0;box-sizing:border-box;border-radius:2px;text-align:center;font-size:14px}.zt-multiple-picker-options__item .zt-ellipsis{height:28px;line-height:28px;background-color:rgba(0,0,0,.04);border:1px solid rgba(0,0,0,.04);border-radius:2px}.zt-multiple-picker-options__item--disabled{cursor:not-allowed;opacity:.3}.zt-multiple-picker-options__item--last{padding-right:0}.zt-multiple-picker-options__item--selected .zt-ellipsis{background:rgba(0,145,250,.1);border:1px solid #0091fa;border-radius:2px;color:#0091fa}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.zt-pdf-viewer-v2{width:100%;height:100%;position:relative}.zt-pdf-viewer-v2::-webkit-scrollbar{width:0;height:0}.zt-pdf-viewer-v2__page-box{width:100%;height:44px;background-color:#fff;position:fixed;bottom:0;left:0;text-align:center;font-size:16px;line-height:44px}.zt-pdf-viewer-v2__page-box .zt-pdf-viewer-v2__next,.zt-pdf-viewer-v2__page-box .zt-pdf-viewer-v2__pre{cursor:pointer;color:#3a90f6}.zt-pdf-viewer-v2__page-box .zt-pdf-viewer-v2__page{margin:0 10px}.zt-pdf-viewer-v2 .zt-loading{position:absolute;top:50%;left:50%;margin-left:-18px;margin-top:-18px}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { createNamespace } from '../utils';
|
|
2
|
+
|
|
3
|
+
var _createNamespace = createNamespace('pdf-viewer-v2'),
|
|
4
|
+
createComponent = _createNamespace[0],
|
|
5
|
+
bem = _createNamespace[1];
|
|
6
|
+
|
|
7
|
+
import Toast from '../toast';
|
|
8
|
+
import Loading from '../loading';
|
|
9
|
+
import { resetObject } from "../utils/index";
|
|
10
|
+
|
|
11
|
+
var defaultData = function defaultData() {
|
|
12
|
+
return {
|
|
13
|
+
pdfDocRef: null,
|
|
14
|
+
totalPage: 0,
|
|
15
|
+
currentPage: 1,
|
|
16
|
+
loading: false,
|
|
17
|
+
PDFJS: null
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default createComponent({
|
|
22
|
+
props: {
|
|
23
|
+
/**
|
|
24
|
+
* pdf地址
|
|
25
|
+
*/
|
|
26
|
+
pdfUrl: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* cMap的url地址(用于解决中文乱码或中文显示为空白的问题). 该资源的物理路径在: node_modules/pdfjs-dist/cmaps
|
|
33
|
+
*/
|
|
34
|
+
cMapUrl: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 携带的特定http请求头
|
|
41
|
+
*/
|
|
42
|
+
httpHeaders: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: function _default() {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
data: function data() {
|
|
50
|
+
return defaultData();
|
|
51
|
+
},
|
|
52
|
+
mounted: function mounted() {
|
|
53
|
+
this.reset();
|
|
54
|
+
this.renderPdf();
|
|
55
|
+
},
|
|
56
|
+
deactivated: function deactivated() {
|
|
57
|
+
this.pdfDocRef.destroy();
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
urlObj: function urlObj() {
|
|
61
|
+
return {
|
|
62
|
+
pdfUrl: this.pdfUrl,
|
|
63
|
+
cMapUrl: this.cMapUrl
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
watch: {
|
|
68
|
+
urlObj: function urlObj() {
|
|
69
|
+
this.reset();
|
|
70
|
+
this.renderPdf();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
reset: function reset() {
|
|
75
|
+
resetObject(this, defaultData());
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 渲染pdf文件的指定页到画板
|
|
80
|
+
* @param pdfViewerDom 承载pdf画板的dom容器
|
|
81
|
+
* @param pdfDoc pdf文件
|
|
82
|
+
* @param pageNum 需要渲染的页码
|
|
83
|
+
*/
|
|
84
|
+
renderPdfOnePage: function renderPdfOnePage(pdfViewerDom, pdfDoc, pageNum) {
|
|
85
|
+
var _this = this;
|
|
86
|
+
|
|
87
|
+
// 创建画布
|
|
88
|
+
var canvas = document.createElement("canvas");
|
|
89
|
+
canvas.id = "pdfCanvas" + pageNum;
|
|
90
|
+
pdfViewerDom.appendChild(canvas); // 获取2d上下文
|
|
91
|
+
|
|
92
|
+
var context = canvas.getContext("2d");
|
|
93
|
+
pdfDoc.getPage(pageNum).then(function (page) {
|
|
94
|
+
// 获取当前pdf页内容, 并设置缩放
|
|
95
|
+
var viewport = page.getViewport({
|
|
96
|
+
scale: 1
|
|
97
|
+
});
|
|
98
|
+
var width = viewport.width;
|
|
99
|
+
|
|
100
|
+
_this.$nextTick(function () {
|
|
101
|
+
var containerWidth = _this.$refs.pdfContainer.offsetWidth;
|
|
102
|
+
var ratio = containerWidth / width;
|
|
103
|
+
viewport = page.getViewport({
|
|
104
|
+
scale: ratio
|
|
105
|
+
}); // @ts-ignore
|
|
106
|
+
|
|
107
|
+
var realCanvas = context.canvas;
|
|
108
|
+
realCanvas.width = viewport.width;
|
|
109
|
+
realCanvas.height = viewport.height; // 将pdf当前页内容画到2d画板中
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
|
|
112
|
+
page.render({
|
|
113
|
+
canvasContext: context,
|
|
114
|
+
viewport: viewport
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 渲染pdf的画布
|
|
122
|
+
* @param pdfViewerDom 承载pdf画布的dom容器
|
|
123
|
+
* @param pdfDoc pdf文档
|
|
124
|
+
*/
|
|
125
|
+
renderPdfCanvas: function renderPdfCanvas(pdfViewerDom, pdfDoc) {
|
|
126
|
+
// 清除原来的pdf画布
|
|
127
|
+
pdfViewerDom.innerHTML = ""; // 获取总页数
|
|
128
|
+
|
|
129
|
+
this.totalPage = pdfDoc.numPages;
|
|
130
|
+
this.loading = false; // 获取显示容器
|
|
131
|
+
|
|
132
|
+
for (var i = 1; i <= this.totalPage; i++) {
|
|
133
|
+
// 循环处理pdf的每页
|
|
134
|
+
this.renderPdfOnePage(pdfViewerDom, pdfDoc, i);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
renderPdf: function renderPdf() {
|
|
138
|
+
var _this2 = this;
|
|
139
|
+
|
|
140
|
+
if (!this.PDFJS) {
|
|
141
|
+
this.PDFJS = window['pdfjs-dist/build/pdf'];
|
|
142
|
+
console.log("window['pdfjs-dist/build/pdf']", window['pdfjs-dist/build/pdf']);
|
|
143
|
+
|
|
144
|
+
if (this.PDFJS && this.PDFJS.GlobalWorkerOptions) {
|
|
145
|
+
this.PDFJS.GlobalWorkerOptions.workerSrc = require("pdfjs-dist/build/pdf.worker.entry");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
this.loading = true;
|
|
150
|
+
var pdfViewerDom = this.$refs.pdfViewerContainer;
|
|
151
|
+
|
|
152
|
+
if (this.pdfUrl) {
|
|
153
|
+
// 获取pdf文件
|
|
154
|
+
var pdfLoadingTask = this.PDFJS.getDocument({
|
|
155
|
+
url: this.pdfUrl,
|
|
156
|
+
withCredentials: true,
|
|
157
|
+
// 携带凭证
|
|
158
|
+
httpHeaders: this.httpHeaders,
|
|
159
|
+
cMapUrl: this.cMapUrl,
|
|
160
|
+
cMapPacked: true
|
|
161
|
+
});
|
|
162
|
+
pdfLoadingTask.promise.then(function (pdfDoc) {
|
|
163
|
+
if (pdfDoc && pdfViewerDom) {
|
|
164
|
+
// 缓存pdf内容
|
|
165
|
+
_this2.pdfDocRef = pdfDoc;
|
|
166
|
+
|
|
167
|
+
_this2.renderPdfCanvas(pdfViewerDom, pdfDoc);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
changePage: function changePage(count) {
|
|
173
|
+
var page = this.currentPage + count;
|
|
174
|
+
|
|
175
|
+
if (page < 1) {
|
|
176
|
+
Toast("已经是首页");
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (page > this.totalPage) {
|
|
181
|
+
Toast("已经是最后一页");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (document.getElementById("pdfCanvas" + page)) {
|
|
186
|
+
document.getElementById("pdfCanvas" + page).scrollIntoView(false);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
this.currentPage = page;
|
|
190
|
+
},
|
|
191
|
+
clickPre: function clickPre() {
|
|
192
|
+
this.changePage(-1);
|
|
193
|
+
},
|
|
194
|
+
clickNext: function clickNext() {
|
|
195
|
+
this.changePage(1);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
render: function render(h) {
|
|
199
|
+
return h("div", {
|
|
200
|
+
"class": bem(),
|
|
201
|
+
"ref": "pdfContainer"
|
|
202
|
+
}, [h(Loading, {
|
|
203
|
+
"directives": [{
|
|
204
|
+
name: "show",
|
|
205
|
+
value: this.loading
|
|
206
|
+
}],
|
|
207
|
+
"class": bem('loading-icon')
|
|
208
|
+
}), h("div", {
|
|
209
|
+
"directives": [{
|
|
210
|
+
name: "show",
|
|
211
|
+
value: !this.loading
|
|
212
|
+
}],
|
|
213
|
+
"ref": "pdfViewerContainer",
|
|
214
|
+
"class": bem("container")
|
|
215
|
+
}), this.totalPage ? h("div", {
|
|
216
|
+
"class": bem("page-box")
|
|
217
|
+
}, [h("span", {
|
|
218
|
+
"class": bem("pre"),
|
|
219
|
+
"on": {
|
|
220
|
+
"click": this.clickPre
|
|
221
|
+
}
|
|
222
|
+
}, ["<"]), h("span", {
|
|
223
|
+
"class": bem("page")
|
|
224
|
+
}, [this.currentPage, "/", this.totalPage]), h("span", {
|
|
225
|
+
"class": bem("next"),
|
|
226
|
+
"on": {
|
|
227
|
+
"click": this.clickNext
|
|
228
|
+
}
|
|
229
|
+
}, [">"])]) : h()]);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import '../style/var';
|
|
2
|
+
.zt-pdf-viewer-v2 {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
&::-webkit-scrollbar {
|
|
8
|
+
width: 0;
|
|
9
|
+
height: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__page-box {
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 44px;
|
|
15
|
+
background-color: #fff;
|
|
16
|
+
position: fixed;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
text-align: center;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
line-height: 44px;
|
|
22
|
+
|
|
23
|
+
.zt-pdf-viewer-v2__pre, .zt-pdf-viewer-v2__next {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
color: #3a90f6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.zt-pdf-viewer-v2__page {
|
|
29
|
+
margin: 0 10px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.zt-loading {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 50%;
|
|
36
|
+
left: 50%;
|
|
37
|
+
margin-left: -18px;
|
|
38
|
+
margin-top: -18px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '../../style/base.less';
|
|
2
|
+
import '../../overlay/index.less';
|
|
3
|
+
import '../../info/index.less';
|
|
4
|
+
import '../../icon/index.less';
|
|
5
|
+
import '../../popup/index.less';
|
|
6
|
+
import '../../loading/index.less';
|
|
7
|
+
import '../../toast/index.less';
|
|
8
|
+
import '../index.less';
|