md-iview 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/package.json +116 -0
- package/src/components/libs/util.js +117 -0
- package/src/components/md-error-page/403.less +92 -0
- package/src/components/md-error-page/403.vue +34 -0
- package/src/components/md-error-page/404.less +60 -0
- package/src/components/md-error-page/404.vue +34 -0
- package/src/components/md-error-page/500.less +73 -0
- package/src/components/md-error-page/500.vue +36 -0
- package/src/components/md-error-page/demo/index.less +22 -0
- package/src/components/md-error-page/demo/index.vue +97 -0
- package/src/components/md-form-item/index.js +3 -0
- package/src/components/md-icon/icon.vue +77 -0
- package/src/components/md-icon/icons.js +5 -0
- package/src/components/md-icon/index.js +11 -0
- package/src/components/md-icon/style/index.less +1 -0
- package/src/components/md-loading/index.js +55 -0
- package/src/components/md-loading/index.vue +53 -0
- package/src/components/md-loading/md-loading.js +38 -0
- package/src/components/md-print/demo/index.vue +260 -0
- package/src/components/md-print/index.js +123 -0
- package/src/components/md-rich-editor/index.vue +69 -0
- package/src/components/md-rich-editor/module/image-extend/index.js +216 -0
- package/src/components/md-scroll-bar/demo/index.vue +102 -0
- package/src/components/md-scroll-bar/index.js +3 -0
- package/src/components/md-scroll-bar/index.less +90 -0
- package/src/components/md-scroll-bar/index.vue +250 -0
- package/src/components/md-select/index.js +7 -0
- package/src/components/md-select/select.vue +841 -0
- package/src/components/md-shrinkable-menu/components/sidebarMenu.vue +167 -0
- package/src/components/md-shrinkable-menu/components/sidebarMenuShrink.vue +119 -0
- package/src/components/md-shrinkable-menu/demo/data/cachePage.js +1 -0
- package/src/components/md-shrinkable-menu/demo/data/currentPath.js +9 -0
- package/src/components/md-shrinkable-menu/demo/data/menu.js +575 -0
- package/src/components/md-shrinkable-menu/demo/data/menu2.js +1017 -0
- package/src/components/md-shrinkable-menu/demo/data/pageTagsList.js +153 -0
- package/src/components/md-shrinkable-menu/demo/index.less +297 -0
- package/src/components/md-shrinkable-menu/demo/index.vue +285 -0
- package/src/components/md-shrinkable-menu/index.vue +112 -0
- package/src/components/md-shrinkable-menu/sidebar.vue +195 -0
- package/src/components/md-shrinkable-menu/styles/menu.less +5 -0
- package/src/components/md-shrinkable-menu/styles/sidebar.less +363 -0
- package/src/components/md-split-pane/demo/index.vue +101 -0
- package/src/components/md-split-pane/index.js +3 -0
- package/src/components/md-split-pane/index.less +93 -0
- package/src/components/md-split-pane/index.vue +230 -0
- package/src/components/md-table/action-tooltip.vue +45 -0
- package/src/components/md-table/can-edit-v2.vue +823 -0
- package/src/components/md-table/can-edit.vue +723 -0
- package/src/components/md-table/custom-cell.vue +71 -0
- package/src/components/md-table/date-picker-cell-v2.vue +48 -0
- package/src/components/md-table/date-picker-cell.vue +39 -0
- package/src/components/md-table/demo/data/search.js +67 -0
- package/src/components/md-table/demo/data/table2csv.js +200 -0
- package/src/components/md-table/demo/data/table2excel.js +239 -0
- package/src/components/md-table/demo/data/table_data.js +251 -0
- package/src/components/md-table/demo/editable-table.vue +144 -0
- package/src/components/md-table/demo/exportable-table.vue +124 -0
- package/src/components/md-table/demo/widgets/header-search.vue +88 -0
- package/src/components/md-table/drop-down-cell-v2.vue +87 -0
- package/src/components/md-table/drop-down-cell.vue +81 -0
- package/src/components/md-table/editable-expand.vue +143 -0
- package/src/components/md-table/expand.vue +97 -0
- package/src/components/md-table/index.vue +53 -0
- package/src/components/md-table/iview-table/cell.vue +99 -0
- package/src/components/md-table/iview-table/expand.js +21 -0
- package/src/components/md-table/iview-table/export-csv.js +76 -0
- package/src/components/md-table/iview-table/header.js +16 -0
- package/src/components/md-table/iview-table/index.js +2 -0
- package/src/components/md-table/iview-table/mixin.js +31 -0
- package/src/components/md-table/iview-table/table-body.vue +101 -0
- package/src/components/md-table/iview-table/table-head.vue +311 -0
- package/src/components/md-table/iview-table/table-tr.vue +31 -0
- package/src/components/md-table/iview-table/table.vue +1026 -0
- package/src/components/md-table/iview-table/util.js +93 -0
- package/src/components/md-table/libs/table2excel.js +100 -0
- package/src/components/md-table/select-cell-v2.vue +64 -0
- package/src/components/md-table/select-cell.vue +46 -0
- package/src/components/md-table/table.less +76 -0
- package/src/components/md-toolbar/index.vue +171 -0
- package/src/components/md-tree/index.js +2 -0
- package/src/components/md-tree/node.vue +238 -0
- package/src/components/md-tree/render.js +17 -0
- package/src/components/md-tree/tree.vue +241 -0
- package/src/components/utilities/can.js +35 -0
- package/src/directives/index.js +34 -0
- package/src/directives/resize.js +27 -0
- package/src/directives/scroll.js +27 -0
- package/src/directives/style/bg-color.js +23 -0
- package/src/directives/style/color.js +23 -0
- package/src/directives/style/font-size.js +23 -0
- package/src/directives/style/height.js +23 -0
- package/src/directives/style/lineHeight.js +23 -0
- package/src/directives/style/margin.js +48 -0
- package/src/directives/style/opacity.js +23 -0
- package/src/directives/style/padding.js +48 -0
- package/src/directives/style/width.js +24 -0
- package/src/index.js +442 -0
- package/src/locale/lang.js +5 -0
- package/src/mixins/colorable.js +51 -0
- package/src/style/color/bezierEasing.less +110 -0
- package/src/style/color/colorPalette.less +75 -0
- package/src/style/color/colors.less +146 -0
- package/src/style/color/tinyColor.less +1184 -0
- package/src/style/common.less +72 -0
- package/src/style/components/_ripple.less +60 -0
- package/src/style/components/_shrinkable-menu.less +46 -0
- package/src/style/components/_toolbar.less +96 -0
- package/src/style/components/index.less +3 -0
- package/src/style/components/rich-editor.less +6 -0
- package/src/style/index.less +10 -0
- package/src/style/theme.less +155 -0
- package/src/utils/color.js +46 -0
- package/src/utils/console.js +105 -0
- package/src/utils/load.js +79 -0
- package/src/utils/mask.js +139 -0
- package/src/utils/mixins.js +5 -0
- package/src/utils/validate.js +271 -0
@@ -0,0 +1,77 @@
|
|
1
|
+
<template>
|
2
|
+
<i :class="classString" @click="$emit('click')" :style="[iconStyle, sizeStyle, colorStyle]">{{ title }}</i>
|
3
|
+
</template>
|
4
|
+
|
5
|
+
<script>
|
6
|
+
import classNames from 'classnames';
|
7
|
+
import './style/index.less';
|
8
|
+
// import './md-font/styles/iconfont.css'
|
9
|
+
// import omit from 'omit.js';
|
10
|
+
import icons from './icons';
|
11
|
+
|
12
|
+
export default {
|
13
|
+
name: "md-icon",
|
14
|
+
computed:{
|
15
|
+
classString() {
|
16
|
+
if (this.isCustom) {
|
17
|
+
return classNames({
|
18
|
+
'ivu-icon': true,
|
19
|
+
"font_family":this.isCustom,
|
20
|
+
"iconfont":this.isCustom,
|
21
|
+
[`${this.type}`]: true,
|
22
|
+
}, this.className)
|
23
|
+
}
|
24
|
+
return classNames({
|
25
|
+
'ivu-icon': true,
|
26
|
+
"font_family":this.isCustom,
|
27
|
+
"iconfont":this.isCustom,
|
28
|
+
[`ivu-icon-${this.type}`]: true,
|
29
|
+
}, this.className)
|
30
|
+
},
|
31
|
+
sizeStyle() {
|
32
|
+
return {
|
33
|
+
fontSize: `${this.size}px`
|
34
|
+
}
|
35
|
+
},
|
36
|
+
isCustom() {
|
37
|
+
if (icons.default.includes(this.type)) {
|
38
|
+
return false
|
39
|
+
} else {
|
40
|
+
return true;
|
41
|
+
}
|
42
|
+
},
|
43
|
+
colorStyle() {
|
44
|
+
return {
|
45
|
+
color:this.color
|
46
|
+
}
|
47
|
+
}
|
48
|
+
},
|
49
|
+
props:{
|
50
|
+
type:String,
|
51
|
+
className:String,
|
52
|
+
title:String,
|
53
|
+
custom:{
|
54
|
+
type:Boolean,
|
55
|
+
default:false,
|
56
|
+
},
|
57
|
+
|
58
|
+
size:{
|
59
|
+
type:Number|String,
|
60
|
+
default:18,
|
61
|
+
},
|
62
|
+
color:{
|
63
|
+
type:String,
|
64
|
+
default:'#000',
|
65
|
+
},
|
66
|
+
iconStyle:Object,
|
67
|
+
},
|
68
|
+
}
|
69
|
+
</script>
|
70
|
+
|
71
|
+
<style scoped>
|
72
|
+
.icon {
|
73
|
+
margin-right: 2px;
|
74
|
+
margin-top: -2px;
|
75
|
+
line-height: 28px;
|
76
|
+
}
|
77
|
+
</style>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
const icons = {
|
2
|
+
default: ["ios-add-circle-outline","ios-add-circle","ios-add","ios-alarm-outline","ios-alarm","ios-albums-outline","ios-albums","ios-alert-outline","ios-alert","ios-american-football-outline","ios-american-football","ios-analytics-outline","ios-analytics","ios-aperture-outline","ios-aperture","ios-apps-outline","ios-apps","ios-appstore-outline","ios-appstore","ios-archive-outline","ios-archive","ios-arrow-back","ios-arrow-down","ios-arrow-dropdown-circle","ios-arrow-dropdown","ios-arrow-dropleft-circle","ios-arrow-dropleft","ios-arrow-dropright-circle","ios-arrow-dropright","ios-arrow-dropup-circle","ios-arrow-dropup","ios-arrow-forward","ios-arrow-round-back","ios-arrow-round-down","ios-arrow-round-forward","ios-arrow-round-up","ios-arrow-up","ios-at-outline","ios-at","ios-attach","ios-backspace-outline","ios-backspace","ios-barcode-outline","ios-barcode","ios-baseball-outline","ios-baseball","ios-basket-outline","ios-basket","ios-basketball-outline","ios-basketball","ios-battery-charging","ios-battery-dead","ios-battery-full","ios-beaker-outline","ios-beaker","ios-beer-outline","ios-beer","ios-bicycle","ios-bluetooth","ios-boat-outline","ios-boat","ios-body-outline","ios-body","ios-bonfire-outline","ios-bonfire","ios-book-outline","ios-book","ios-bookmark-outline","ios-bookmark","ios-bookmarks-outline","ios-bookmarks","ios-bowtie-outline","ios-bowtie","ios-briefcase-outline","ios-briefcase","ios-browsers-outline","ios-browsers","ios-brush-outline","ios-brush","ios-bug-outline","ios-bug","ios-build-outline","ios-build","ios-bulb-outline","ios-bulb","ios-bus-outline","ios-bus","ios-cafe-outline","ios-cafe","ios-calculator-outline","ios-calculator","ios-calendar-outline","ios-calendar","ios-call-outline","ios-call","ios-camera-outline","ios-camera","ios-car-outline","ios-car","ios-card-outline","ios-card","ios-cart-outline","ios-cart","ios-cash-outline","ios-cash","ios-chatboxes-outline","ios-chatboxes","ios-chatbubbles-outline","ios-chatbubbles","ios-checkbox-outline","ios-checkbox","ios-checkmark-circle-outline","ios-checkmark-circle","ios-checkmark","ios-clipboard-outline","ios-clipboard","ios-clock-outline","ios-clock","ios-close-circle-outline","ios-close-circle","ios-close","ios-closed-captioning-outline","ios-closed-captioning","ios-cloud-circle-outline","ios-cloud-circle","ios-cloud-done-outline","ios-cloud-done","ios-cloud-download-outline","ios-cloud-download","ios-cloud-outline","ios-cloud-upload-outline","ios-cloud-upload","ios-cloud","ios-cloudy-night-outline","ios-cloudy-night","ios-cloudy-outline","ios-cloudy","ios-code-download","ios-code-working","ios-code","ios-cog-outline","ios-cog","ios-color-fill-outline","ios-color-fill","ios-color-filter-outline","ios-color-filter","ios-color-palette-outline","ios-color-palette","ios-color-wand-outline","ios-color-wand","ios-compass-outline","ios-compass","ios-construct-outline","ios-construct","ios-contact-outline","ios-contact","ios-contacts-outline","ios-contacts","ios-contract","ios-contrast","ios-copy-outline","ios-copy","ios-create-outline","ios-create","ios-crop-outline","ios-crop","ios-cube-outline","ios-cube","ios-cut-outline","ios-cut","ios-desktop-outline","ios-desktop","ios-disc-outline","ios-disc","ios-document-outline","ios-document","ios-done-all","ios-download-outline","ios-download","ios-easel-outline","ios-easel","ios-egg-outline","ios-egg","ios-exit-outline","ios-exit","ios-expand","ios-eye-off-outline","ios-eye-off","ios-eye-outline","ios-eye","ios-fastforward-outline","ios-fastforward","ios-female","ios-filing-outline","ios-filing","ios-film-outline","ios-film","ios-finger-print","ios-flag-outline","ios-flag","ios-flame-outline","ios-flame","ios-flash-outline","ios-flash","ios-flask-outline","ios-flask","ios-flower-outline","ios-flower","ios-folder-open-outline","ios-folder-open","ios-folder-outline","ios-folder","ios-football-outline","ios-football","ios-funnel-outline","ios-funnel","ios-game-controller-a-outline","ios-game-controller-a","ios-game-controller-b-outline","ios-game-controller-b","ios-git-branch","ios-git-commit","ios-git-compare","ios-git-merge","ios-git-network","ios-git-pull-request","ios-glasses-outline","ios-glasses","ios-globe-outline","ios-globe","ios-grid-outline","ios-grid","ios-hammer-outline","ios-hammer","ios-hand-outline","ios-hand","ios-happy-outline","ios-happy","ios-headset-outline","ios-headset","ios-heart-outline","ios-heart","ios-help-buoy-outline","ios-help-buoy","ios-help-circle-outline","ios-help-circle","ios-help","ios-home-outline","ios-home","ios-ice-cream-outline","ios-ice-cream","ios-image-outline","ios-image","ios-images-outline","ios-images","ios-infinite-outline","ios-infinite","ios-information-circle-outline","ios-information-circle","ios-information","ios-ionic-outline","ios-ionic","ios-ionitron-outline","ios-ionitron","ios-jet-outline","ios-jet","ios-key-outline","ios-key","ios-keypad-outline","ios-keypad","ios-laptop","ios-leaf-outline","ios-leaf","ios-link-outline","ios-link","ios-list-box-outline","ios-list-box","ios-list","ios-locate-outline","ios-locate","ios-lock-outline","ios-lock","ios-log-in","ios-log-out","ios-magnet-outline","ios-magnet","ios-mail-open-outline","ios-mail-open","ios-mail-outline","ios-mail","ios-male","ios-man-outline","ios-man","ios-map-outline","ios-map","ios-medal-outline","ios-medal","ios-medical-outline","ios-medical","ios-medkit-outline","ios-medkit","ios-megaphone-outline","ios-megaphone","ios-menu-outline","ios-menu","ios-mic-off-outline","ios-mic-off","ios-mic-outline","ios-mic","ios-microphone-outline","ios-microphone","ios-moon-outline","ios-moon","ios-more-outline","ios-more","ios-move","ios-musical-note-outline","ios-musical-note","ios-musical-notes-outline","ios-musical-notes","ios-navigate-outline","ios-navigate","ios-no-smoking-outline","ios-no-smoking","ios-notifications-off-outline","ios-notifications-off","ios-notifications-outline","ios-notifications","ios-nuclear-outline","ios-nuclear","ios-nutrition-outline","ios-nutrition","ios-open-outline","ios-open","ios-options-outline","ios-options","ios-outlet-outline","ios-outlet","ios-paper-outline","ios-paper-plane-outline","ios-paper-plane","ios-paper","ios-partly-sunny-outline","ios-partly-sunny","ios-pause-outline","ios-pause","ios-paw-outline","ios-paw","ios-people-outline","ios-people","ios-person-add-outline","ios-person-add","ios-person-outline","ios-person","ios-phone-landscape","ios-phone-portrait","ios-photos-outline","ios-photos","ios-pie-outline","ios-pie","ios-pin-outline","ios-pin","ios-pint-outline","ios-pint","ios-pizza-outline","ios-pizza","ios-plane-outline","ios-plane","ios-planet-outline","ios-planet","ios-play-outline","ios-play","ios-podium-outline","ios-podium","ios-power-outline","ios-power","ios-pricetag-outline","ios-pricetag","ios-pricetags-outline","ios-pricetags","ios-print-outline","ios-print","ios-pulse-outline","ios-pulse","ios-qr-scanner","ios-quote-outline","ios-quote","ios-radio-button-off","ios-radio-button-on","ios-radio-outline","ios-radio","ios-rainy-outline","ios-rainy","ios-recording-outline","ios-recording","ios-redo-outline","ios-redo","ios-refresh-circle-outline","ios-refresh-circle","ios-refresh","ios-remove-circle-outline","ios-remove-circle","ios-remove","ios-reorder","ios-repeat","ios-resize","ios-restaurant-outline","ios-restaurant","ios-return-left","ios-return-right","ios-reverse-camera-outline","ios-reverse-camera","ios-rewind-outline","ios-rewind","ios-ribbon-outline","ios-ribbon","ios-rose-outline","ios-rose","ios-sad-outline","ios-sad","ios-school-outline","ios-school","ios-search-outline","ios-search","ios-send-outline","ios-send","ios-settings-outline","ios-settings","ios-share-alt-outline","ios-share-alt","ios-share-outline","ios-share","ios-shirt-outline","ios-shirt","ios-shuffle","ios-skip-backward-outline","ios-skip-backward","ios-skip-forward-outline","ios-skip-forward","ios-snow-outline","ios-snow","ios-speedometer-outline","ios-speedometer","ios-square-outline","ios-square","ios-star-half","ios-star-outline","ios-star","ios-stats-outline","ios-stats","ios-stopwatch-outline","ios-stopwatch","ios-subway-outline","ios-subway","ios-sunny-outline","ios-sunny","ios-swap","ios-switch-outline","ios-switch","ios-sync","ios-tablet-landscape","ios-tablet-portrait","ios-tennisball-outline","ios-tennisball","ios-text-outline","ios-text","ios-thermometer-outline","ios-thermometer","ios-thumbs-down-outline","ios-thumbs-down","ios-thumbs-up-outline","ios-thumbs-up","ios-thunderstorm-outline","ios-thunderstorm","ios-time-outline","ios-time","ios-timer-outline","ios-timer","ios-train-outline","ios-train","ios-transgender","ios-trash-outline","ios-trash","ios-trending-down","ios-trending-up","ios-trophy-outline","ios-trophy","ios-umbrella-outline","ios-umbrella","ios-undo-outline","ios-undo","ios-unlock-outline","ios-unlock","ios-videocam-outline","ios-videocam","ios-volume-down","ios-volume-mute","ios-volume-off","ios-volume-up","ios-walk","ios-warning-outline","ios-warning","ios-watch","ios-water-outline","ios-water","ios-wifi-outline","ios-wifi","ios-wine-outline","ios-wine","ios-woman-outline","ios-woman","logo-android","logo-angular","logo-apple","logo-bitcoin","logo-buffer","logo-chrome","logo-codepen","logo-css3","logo-designernews","logo-dribbble","logo-dropbox","logo-euro","logo-facebook","logo-foursquare","logo-freebsd-devil","logo-github","logo-google","logo-googleplus","logo-hackernews","logo-html5","logo-instagram","logo-javascript","logo-linkedin","logo-markdown","logo-nodejs","logo-octocat","logo-pinterest","logo-playstation","logo-python","logo-reddit","logo-rss","logo-sass","logo-skype","logo-snapchat","logo-steam","logo-tumblr","logo-tux","logo-twitch","logo-twitter","logo-usd","logo-vimeo","logo-whatsapp","logo-windows","logo-wordpress","logo-xbox","logo-yahoo","logo-yen","logo-youtube","md-add-circle","md-add","md-alarm","md-albums","md-alert","md-american-football","md-analytics","md-aperture","md-apps","md-appstore","md-archive","md-arrow-back","md-arrow-down","md-arrow-dropdown-circle","md-arrow-dropdown","md-arrow-dropleft-circle","md-arrow-dropleft","md-arrow-dropright-circle","md-arrow-dropright","md-arrow-dropup-circle","md-arrow-dropup","md-arrow-forward","md-arrow-round-back","md-arrow-round-down","md-arrow-round-forward","md-arrow-round-up","md-arrow-up","md-at","md-attach","md-backspace","md-barcode","md-baseball","md-basket","md-basketball","md-battery-charging","md-battery-dead","md-battery-full","md-beaker","md-beer","md-bicycle","md-bluetooth","md-boat","md-body","md-bonfire","md-book","md-bookmark","md-bookmarks","md-bowtie","md-briefcase","md-browsers","md-brush","md-bug","md-build","md-bulb","md-bus","md-cafe","md-calculator","md-calendar","md-call","md-camera","md-car","md-card","md-cart","md-cash","md-chatboxes","md-chatbubbles","md-checkbox-outline","md-checkbox","md-checkmark-circle-outline","md-checkmark-circle","md-checkmark","md-clipboard","md-clock","md-close-circle","md-close","md-closed-captioning","md-cloud-circle","md-cloud-done","md-cloud-download","md-cloud-outline","md-cloud-upload","md-cloud","md-cloudy-night","md-cloudy","md-code-download","md-code-working","md-code","md-cog","md-color-fill","md-color-filter","md-color-palette","md-color-wand","md-compass","md-construct","md-contact","md-contacts","md-contract","md-contrast","md-copy","md-create","md-crop","md-cube","md-cut","md-desktop","md-disc","md-document","md-done-all","md-download","md-easel","md-egg","md-exit","md-expand","md-eye-off","md-eye","md-fastforward","md-female","md-filing","md-film","md-finger-print","md-flag","md-flame","md-flash","md-flask","md-flower","md-folder-open","md-folder","md-football","md-funnel","md-game-controller-a","md-game-controller-b","md-git-branch","md-git-commit","md-git-compare","md-git-merge","md-git-network","md-git-pull-request","md-glasses","md-globe","md-grid","md-hammer","md-hand","md-happy","md-headset","md-heart-outline","md-heart","md-help-buoy","md-help-circle","md-help","md-home","md-ice-cream","md-image","md-images","md-infinite","md-information-circle","md-information","md-ionic","md-ionitron","md-jet","md-key","md-keypad","md-laptop","md-leaf","md-link","md-list-box","md-list","md-locate","md-lock","md-log-in","md-log-out","md-magnet","md-mail-open","md-mail","md-male","md-man","md-map","md-medal","md-medical","md-medkit","md-megaphone","md-menu","md-mic-off","md-mic","md-microphone","md-moon","md-more","md-move","md-musical-note","md-musical-notes","md-navigate","md-no-smoking","md-notifications-off","md-notifications-outline","md-notifications","md-nuclear","md-nutrition","md-open","md-options","md-outlet","md-paper-plane","md-paper","md-partly-sunny","md-pause","md-paw","md-people","md-person-add","md-person","md-phone-landscape","md-phone-portrait","md-photos","md-pie","md-pin","md-pint","md-pizza","md-plane","md-planet","md-play","md-podium","md-power","md-pricetag","md-pricetags","md-print","md-pulse","md-qr-scanner","md-quote","md-radio-button-off","md-radio-button-on","md-radio","md-rainy","md-recording","md-redo","md-refresh-circle","md-refresh","md-remove-circle","md-remove","md-reorder","md-repeat","md-resize","md-restaurant","md-return-left","md-return-right","md-reverse-camera","md-rewind","md-ribbon","md-rose","md-sad","md-school","md-search","md-send","md-settings","md-share-alt","md-share","md-shirt","md-shuffle","md-skip-backward","md-skip-forward","md-snow","md-speedometer","md-square-outline","md-square","md-star-half","md-star-outline","md-star","md-stats","md-stopwatch","md-subway","md-sunny","md-swap","md-switch","md-sync","md-tablet-landscape","md-tablet-portrait","md-tennisball","md-text","md-thermometer","md-thumbs-down","md-thumbs-up","md-thunderstorm","md-time","md-timer","md-train","md-transgender","md-trash","md-trending-down","md-trending-up","md-trophy","md-umbrella","md-undo","md-unlock","md-videocam","md-volume-down","md-volume-mute","md-volume-off","md-volume-up","md-walk","md-warning","md-watch","md-water","md-wifi","md-wine","md-woman","ios-loading"],
|
3
|
+
};
|
4
|
+
// icons.default.concat(icons.custom);
|
5
|
+
export default icons;
|
@@ -0,0 +1 @@
|
|
1
|
+
//@import "http://at.alicdn.com/t/font_1236679_6ckej41ansn.css";
|
@@ -0,0 +1,55 @@
|
|
1
|
+
// import Vue from 'vue';
|
2
|
+
// import MdLoading from './index.vue';
|
3
|
+
//
|
4
|
+
// export default {
|
5
|
+
// install(Vue, defaultOptions = {}) {
|
6
|
+
// const CONSTRUCTOR = Vue.extend(MdLoading);
|
7
|
+
// let node = new CONSTRUCTOR;
|
8
|
+
// let vm = node.$mount().$el;
|
9
|
+
//
|
10
|
+
// function loading(show=true) {
|
11
|
+
// node.show = show;
|
12
|
+
// if (node.show) {
|
13
|
+
// document.body.appendChild(vm)
|
14
|
+
// }
|
15
|
+
// }
|
16
|
+
//
|
17
|
+
// Vue.loading = Vue.prototype.$loading = loading;
|
18
|
+
// }
|
19
|
+
// }
|
20
|
+
|
21
|
+
import MdLoading from './md-loading';
|
22
|
+
|
23
|
+
|
24
|
+
let mdLoadingInstance;
|
25
|
+
|
26
|
+
|
27
|
+
function getLoadingInstance (render = undefined) {
|
28
|
+
mdLoadingInstance = mdLoadingInstance || MdLoading.newInstance({
|
29
|
+
render: render
|
30
|
+
});
|
31
|
+
|
32
|
+
return mdLoadingInstance;
|
33
|
+
}
|
34
|
+
|
35
|
+
function loading (options) {
|
36
|
+
const render = ('render' in options) ? options.render : undefined;
|
37
|
+
let instance = getLoadingInstance(render);
|
38
|
+
|
39
|
+
instance.show(options);
|
40
|
+
}
|
41
|
+
|
42
|
+
MdLoading.show = function (props = {}) {
|
43
|
+
return loading(props);
|
44
|
+
};
|
45
|
+
MdLoading.hide = function () {
|
46
|
+
if (!mdLoadingInstance) return false;
|
47
|
+
|
48
|
+
const instance = getLoadingInstance();
|
49
|
+
|
50
|
+
instance.remove(() => {
|
51
|
+
mdLoadingInstance = null;
|
52
|
+
});
|
53
|
+
};
|
54
|
+
|
55
|
+
export default MdLoading
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<template>
|
2
|
+
<Row class="md-loading">
|
3
|
+
<Col class="demo-spin-col" span="8" v-show="show">
|
4
|
+
<Spin fix class="spin">
|
5
|
+
<Icon type="ios-loading" color="#3f51b5" size=50 class="demo-spin-icon-load"></Icon>
|
6
|
+
</Spin>
|
7
|
+
</Col>
|
8
|
+
</Row>
|
9
|
+
</template>
|
10
|
+
|
11
|
+
<script>
|
12
|
+
export default {
|
13
|
+
// props:{
|
14
|
+
// show:{
|
15
|
+
// type:Boolean,
|
16
|
+
// default:false,
|
17
|
+
// },
|
18
|
+
// },
|
19
|
+
name: "loading",
|
20
|
+
data () {
|
21
|
+
return {
|
22
|
+
show:false,
|
23
|
+
}
|
24
|
+
},
|
25
|
+
methods:{
|
26
|
+
}
|
27
|
+
}
|
28
|
+
</script>
|
29
|
+
|
30
|
+
<style lang="scss" less>
|
31
|
+
.demo-spin-icon-load{
|
32
|
+
animation: ani-demo-spin 1s linear infinite;
|
33
|
+
}
|
34
|
+
@keyframes ani-demo-spin {
|
35
|
+
from { transform: rotate(0deg);}
|
36
|
+
50% { transform: rotate(180deg);}
|
37
|
+
to { transform: rotate(360deg);}
|
38
|
+
}
|
39
|
+
.demo-spin-col{
|
40
|
+
height: 100px;
|
41
|
+
/*position: relative;*/
|
42
|
+
/*border: 1px solid #eee;*/
|
43
|
+
|
44
|
+
position: fixed;
|
45
|
+
top: 50%;
|
46
|
+
left: 50%;
|
47
|
+
transform: translate(-50%, -50%);
|
48
|
+
}
|
49
|
+
|
50
|
+
.spin {
|
51
|
+
background: none;
|
52
|
+
}
|
53
|
+
</style>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import Vue from 'vue';
|
2
|
+
import MdLoading from './index.vue';
|
3
|
+
|
4
|
+
MdLoading.newInstance = properties=>{
|
5
|
+
const _props = properties || {};
|
6
|
+
|
7
|
+
const Instance = new Vue({
|
8
|
+
data:Object.assign({}, _props,{}),
|
9
|
+
render(h){
|
10
|
+
return h(MdLoading, {
|
11
|
+
props:_props
|
12
|
+
})
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
const component = Instance.$mount();
|
17
|
+
document.body.appendChild(component.$el);
|
18
|
+
const loading = Instance.$children[0];
|
19
|
+
|
20
|
+
return {
|
21
|
+
show() {
|
22
|
+
loading.show = true;
|
23
|
+
setTimeout(()=>{
|
24
|
+
loading.show = false
|
25
|
+
}, 2000)
|
26
|
+
},
|
27
|
+
remove() {
|
28
|
+
loading.show = false;
|
29
|
+
},
|
30
|
+
component:loading,
|
31
|
+
|
32
|
+
destroy () {
|
33
|
+
document.body.removeChild(document.getElementsByClassName('md-loading')[0]);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
export default MdLoading;
|
@@ -0,0 +1,260 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="print">
|
3
|
+
|
4
|
+
<div id="printMe" ref="print">
|
5
|
+
<!-- ul,li标签 -->
|
6
|
+
<div class="title">ul/li标签</div>
|
7
|
+
<ul class="printBox1">
|
8
|
+
<Col span="8" v-for="(items,key) in basicInfor" :key="key">
|
9
|
+
<li>
|
10
|
+
<Col span="12" class="textRight"><span>{{items.title}}:</span></Col>
|
11
|
+
<Col span="12"><span>{{items.value}}</span></Col>
|
12
|
+
</li>
|
13
|
+
</Col>
|
14
|
+
</ul>
|
15
|
+
<br/>
|
16
|
+
<br/>
|
17
|
+
<div class="title">form表单</div>
|
18
|
+
<!-- 表单 -->
|
19
|
+
<div class="printBox2">
|
20
|
+
<Form :label-width="80">
|
21
|
+
<FormItem :label="items.title" v-for="(items,key) in formInfo" :key="key">
|
22
|
+
<Input v-if="items.type=='input'" v-model="items.value" ></Input>
|
23
|
+
<Select v-if="items.type=='select'" v-model="items.value">
|
24
|
+
<Option :key="i" v-for="(item,i) in items.dropDown" :value="item.value">{{item.label}}</Option>
|
25
|
+
</Select>
|
26
|
+
<RadioGroup v-if="items.type=='radio'" v-model="items.value">
|
27
|
+
<Radio :key="i" v-for="(item,i) in items.dropDown" :label="item.value">{{item.label}}</Radio>
|
28
|
+
</RadioGroup>
|
29
|
+
<DatePicker v-if="items.type=='date'" type="date" v-model="items.value" class="datapick"></DatePicker>
|
30
|
+
<CheckboxGroup v-if="items.type=='checbox'" v-model="items.value">
|
31
|
+
<Checkbox :key="i" v-for="(item,i) in items.dropDown" :label="item.value">{{item.label}}</Checkbox>
|
32
|
+
</CheckboxGroup>
|
33
|
+
<Input v-if="items.type=='textarea'" v-model="items.value" type="textarea"></Input>
|
34
|
+
</FormItem>
|
35
|
+
</Form>
|
36
|
+
</div>
|
37
|
+
<div class="title">表格</div>
|
38
|
+
<!-- 表格 -->
|
39
|
+
<div class="printBox3">
|
40
|
+
<table class="table">
|
41
|
+
<thead>
|
42
|
+
<tr>
|
43
|
+
<th>姓名</th>
|
44
|
+
<th>性别</th>
|
45
|
+
<th>出生日期</th>
|
46
|
+
<th>籍贯</th>
|
47
|
+
<th>婚姻</th>
|
48
|
+
<th>子女</th>
|
49
|
+
</tr>
|
50
|
+
</thead>
|
51
|
+
<tbody>
|
52
|
+
<tr v-for="(items,key) in tableInfo" :key="key">
|
53
|
+
<td v-for="(item,i) in items" :key="i">{{item}}</td>
|
54
|
+
</tr>
|
55
|
+
</tbody>
|
56
|
+
</table>
|
57
|
+
</div>
|
58
|
+
<div class="printBox3">
|
59
|
+
<table class="table">
|
60
|
+
<thead>
|
61
|
+
<tr>
|
62
|
+
<th>姓名</th>
|
63
|
+
<th>性别</th>
|
64
|
+
<th>出生日期</th>
|
65
|
+
<th>籍贯</th>
|
66
|
+
<th>婚姻</th>
|
67
|
+
<th>子女</th>
|
68
|
+
</tr>
|
69
|
+
</thead>
|
70
|
+
<tbody>
|
71
|
+
<tr v-for="(items,key) in tableInfo" :key="key">
|
72
|
+
<td v-for="(item,i) in items" :key="i">{{item}}</td>
|
73
|
+
</tr>
|
74
|
+
</tbody>
|
75
|
+
</table>
|
76
|
+
</div>
|
77
|
+
<div class="printBox3">
|
78
|
+
<table class="table">
|
79
|
+
<thead>
|
80
|
+
<tr>
|
81
|
+
<th>姓名</th>
|
82
|
+
<th>性别</th>
|
83
|
+
<th>出生日期</th>
|
84
|
+
<th>籍贯</th>
|
85
|
+
<th>婚姻</th>
|
86
|
+
<th>子女</th>
|
87
|
+
</tr>
|
88
|
+
</thead>
|
89
|
+
<tbody>
|
90
|
+
<tr v-for="(items,key) in tableInfo" :key="key">
|
91
|
+
<td v-for="(item,i) in items" :key="i">{{item}}</td>
|
92
|
+
</tr>
|
93
|
+
</tbody>
|
94
|
+
</table>
|
95
|
+
</div>
|
96
|
+
<div class="printBox3">
|
97
|
+
<table class="table">
|
98
|
+
<thead>
|
99
|
+
<tr>
|
100
|
+
<th>姓名</th>
|
101
|
+
<th>性别</th>
|
102
|
+
<th>出生日期</th>
|
103
|
+
<th>籍贯</th>
|
104
|
+
<th>婚姻</th>
|
105
|
+
<th>子女</th>
|
106
|
+
</tr>
|
107
|
+
</thead>
|
108
|
+
<tbody>
|
109
|
+
<tr v-for="(items,key) in tableInfo" :key="key">
|
110
|
+
<td v-for="(item,i) in items" :key="i">{{item}}</td>
|
111
|
+
</tr>
|
112
|
+
</tbody>
|
113
|
+
</table>
|
114
|
+
</div>
|
115
|
+
<div class="title">p标签</div>
|
116
|
+
<p>
|
117
|
+
{{detail}}
|
118
|
+
</p>
|
119
|
+
</div>
|
120
|
+
<md-btn type="primary" @click="print" class="btns">打印</md-btn>
|
121
|
+
</div>
|
122
|
+
</template>
|
123
|
+
|
124
|
+
<script>
|
125
|
+
export default {
|
126
|
+
name: "md-print",
|
127
|
+
data(){
|
128
|
+
return {
|
129
|
+
basicInfor:{
|
130
|
+
name:{
|
131
|
+
title:"姓名",
|
132
|
+
value:"张三"
|
133
|
+
},
|
134
|
+
sex:{
|
135
|
+
title:"性别",
|
136
|
+
value:"男"
|
137
|
+
},
|
138
|
+
born:{
|
139
|
+
title:"出生日期",
|
140
|
+
value:"2020.12.12"
|
141
|
+
},
|
142
|
+
address:{
|
143
|
+
title:"籍贯",
|
144
|
+
value:"上海"
|
145
|
+
},
|
146
|
+
marray:{
|
147
|
+
title:"婚姻",
|
148
|
+
value:"已婚"
|
149
|
+
},
|
150
|
+
children:{
|
151
|
+
title:"子女",
|
152
|
+
value:"有"
|
153
|
+
},
|
154
|
+
},
|
155
|
+
tableInfo:[
|
156
|
+
{name:"张三",sex:"男",born:"2020.12.12",address:"上海",marray:"已婚",children:"2"},
|
157
|
+
{name:"李四",sex:"女",born:"2020.12.12",address:"北京",marray:"未婚",children:"0"},
|
158
|
+
{name:"王五",sex:"男",born:"2020.12.12",address:"广州",marray:"已婚",children:"3"},
|
159
|
+
{name:"二流子",sex:"男",born:"2020.12.12",address:"美国",marray:"未婚",children:"0"},
|
160
|
+
],
|
161
|
+
formInfo:{
|
162
|
+
name:{
|
163
|
+
title:"姓名",
|
164
|
+
value:"张三",
|
165
|
+
type:"input",
|
166
|
+
dropDown:[],
|
167
|
+
},
|
168
|
+
address:{
|
169
|
+
title:"籍贯",
|
170
|
+
value:"shanghai",
|
171
|
+
type:"select",
|
172
|
+
dropDown:[],
|
173
|
+
},
|
174
|
+
born:{
|
175
|
+
title:"出生日期",
|
176
|
+
value:"2020.12.12",
|
177
|
+
type:"date",
|
178
|
+
dropDown:[],
|
179
|
+
},
|
180
|
+
sex:{
|
181
|
+
title:"性别",
|
182
|
+
value:"1",
|
183
|
+
type:"radio",
|
184
|
+
dropDown:[],
|
185
|
+
},
|
186
|
+
checbox:{
|
187
|
+
title:"复选框",
|
188
|
+
value:["1","2"],
|
189
|
+
type:"checbox",
|
190
|
+
dropDown:[],
|
191
|
+
},
|
192
|
+
textarea:{
|
193
|
+
title:"富文本",
|
194
|
+
value:"textarea富文本里面的值",
|
195
|
+
type:"textarea",
|
196
|
+
dropDown:[],
|
197
|
+
},
|
198
|
+
},
|
199
|
+
detail:"手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用,手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用,手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用,手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用,手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用,手动控制日期选择器的显示状态,true 为显示,false 为收起。使用该属性后,选择器不会主动关闭。建议配合 slot 及 confirm 和相关事件一起使用"
|
200
|
+
}
|
201
|
+
},
|
202
|
+
mounted(){
|
203
|
+
this.formInfo.address.dropDown=[{label:"北京",value:"beijing"},{label:"上海",value:"shanghai"},{label:"深圳",value:"shenzhen"}];
|
204
|
+
this.formInfo.sex.dropDown=[{label:"男",value:"1"},{label:"女",value:"2"}];
|
205
|
+
this.formInfo.checbox.dropDown=[{label:"复选框1",value:"1"},{label:"复选框2",value:"2"},{label:"复选框3",value:"3"},{label:"复选框4",value:"4"}];
|
206
|
+
},
|
207
|
+
methods:{
|
208
|
+
print(){
|
209
|
+
this.$print(this.$refs.print)
|
210
|
+
}
|
211
|
+
}
|
212
|
+
}
|
213
|
+
</script>
|
214
|
+
|
215
|
+
<style scoped>
|
216
|
+
.print{
|
217
|
+
text-align:left;
|
218
|
+
}
|
219
|
+
.datapick{
|
220
|
+
width: 320px;
|
221
|
+
}
|
222
|
+
.title{
|
223
|
+
font-size:22px;
|
224
|
+
font-weight:bolder;
|
225
|
+
text-align:left;
|
226
|
+
padding-left:50px;
|
227
|
+
}
|
228
|
+
.printBox1 li{
|
229
|
+
list-style: none;
|
230
|
+
line-height:50px;
|
231
|
+
font-size:16px;
|
232
|
+
text-align:left;
|
233
|
+
}
|
234
|
+
.textRight{
|
235
|
+
text-align:right;
|
236
|
+
}
|
237
|
+
.printBox3{
|
238
|
+
margin-top:50px;
|
239
|
+
}
|
240
|
+
.table{
|
241
|
+
width:100%;
|
242
|
+
text-align:center;
|
243
|
+
}
|
244
|
+
.table tr td{
|
245
|
+
line-height:30px;
|
246
|
+
}
|
247
|
+
.printBox2{
|
248
|
+
margin-top:80px;
|
249
|
+
width:400px;
|
250
|
+
margin:0 auto;
|
251
|
+
}
|
252
|
+
p{
|
253
|
+
padding-top:100px;
|
254
|
+
width:800px;
|
255
|
+
margin:0 auto;
|
256
|
+
}
|
257
|
+
.btns{
|
258
|
+
margin:50px 0 50px 300px;
|
259
|
+
}
|
260
|
+
</style>
|
@@ -0,0 +1,123 @@
|
|
1
|
+
// 打印类属性、方法定义
|
2
|
+
/* eslint-disable */
|
3
|
+
const Print =function(dom, options) {
|
4
|
+
if (!(this instanceof Print)) return new Print(dom, options);
|
5
|
+
|
6
|
+
this.options = this.extend({
|
7
|
+
'noPrint': '.no-print'
|
8
|
+
}, options);
|
9
|
+
|
10
|
+
if ((typeof dom) === "string") {
|
11
|
+
this.dom = document.querySelector(dom);
|
12
|
+
} else {
|
13
|
+
this.dom = dom;
|
14
|
+
}
|
15
|
+
|
16
|
+
this.init();
|
17
|
+
};
|
18
|
+
Print.prototype = {
|
19
|
+
init: function () {
|
20
|
+
var content = this.getStyle() + this.getHtml();
|
21
|
+
this.writeIframe(content);
|
22
|
+
},
|
23
|
+
extend: function (obj, obj2) {
|
24
|
+
for (var k in obj2) {
|
25
|
+
obj[k] = obj2[k];
|
26
|
+
}
|
27
|
+
return obj;
|
28
|
+
},
|
29
|
+
|
30
|
+
getStyle: function () {
|
31
|
+
var str = "",
|
32
|
+
styles = document.querySelectorAll('style,link');
|
33
|
+
for (var i = 0; i < styles.length; i++) {
|
34
|
+
str += styles[i].outerHTML;
|
35
|
+
}
|
36
|
+
str += "<style>" + (this.options.noPrint ? this.options.noPrint : '.no-print') + "{display:none;}</style>";
|
37
|
+
|
38
|
+
return str;
|
39
|
+
},
|
40
|
+
|
41
|
+
getHtml: function () {
|
42
|
+
var inputs = document.querySelectorAll('input');
|
43
|
+
var textareas = document.querySelectorAll('textarea');
|
44
|
+
var selects = document.querySelectorAll('select');
|
45
|
+
|
46
|
+
for (var k in inputs) {
|
47
|
+
if (inputs[k].type == "checkbox" || inputs[k].type == "radio") {
|
48
|
+
if (inputs[k].checked == true) {
|
49
|
+
inputs[k].setAttribute('checked', "checked")
|
50
|
+
} else {
|
51
|
+
inputs[k].removeAttribute('checked')
|
52
|
+
}
|
53
|
+
} else if (inputs[k].type == "text") {
|
54
|
+
inputs[k].setAttribute('value', inputs[k].value)
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
for (var k2 in textareas) {
|
59
|
+
if (textareas[k2].type == 'textarea') {
|
60
|
+
textareas[k2].innerHTML = textareas[k2].value
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
for (var k3 in selects) {
|
65
|
+
if (selects[k3].type == 'select-one') {
|
66
|
+
var child = selects[k3].children;
|
67
|
+
for (var i in child) {
|
68
|
+
if (child[i].tagName == 'OPTION') {
|
69
|
+
if (child[i].selected == true) {
|
70
|
+
child[i].setAttribute('selected', "selected")
|
71
|
+
} else {
|
72
|
+
child[i].removeAttribute('selected')
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
return this.dom.outerHTML;
|
80
|
+
},
|
81
|
+
|
82
|
+
writeIframe: function (content) {
|
83
|
+
var w, doc, iframe = document.createElement('iframe'),
|
84
|
+
f = document.body.appendChild(iframe);
|
85
|
+
iframe.id = "myIframe";
|
86
|
+
iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;";
|
87
|
+
|
88
|
+
w = f.contentWindow || f.contentDocument;
|
89
|
+
doc = f.contentDocument || f.contentWindow.document;
|
90
|
+
doc.open();
|
91
|
+
doc.write(content);
|
92
|
+
doc.close();
|
93
|
+
this.toPrint(w);
|
94
|
+
|
95
|
+
setTimeout(function () {
|
96
|
+
document.body.removeChild(iframe)
|
97
|
+
}, 100)
|
98
|
+
},
|
99
|
+
|
100
|
+
toPrint: function (frameWindow) {
|
101
|
+
try {
|
102
|
+
setTimeout(function () {
|
103
|
+
frameWindow.focus();
|
104
|
+
try {
|
105
|
+
if (!frameWindow.document.execCommand('print', false, null)) {
|
106
|
+
frameWindow.print();
|
107
|
+
}
|
108
|
+
} catch (e) {
|
109
|
+
frameWindow.print();
|
110
|
+
}
|
111
|
+
frameWindow.close();
|
112
|
+
}, 10);
|
113
|
+
} catch (err) {
|
114
|
+
console.log('err', err);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
};
|
118
|
+
const MyPlugin = {}
|
119
|
+
MyPlugin.install = function (Vue, options) {
|
120
|
+
// 4. 添加实例方法
|
121
|
+
Vue.prototype.$print = Print
|
122
|
+
}
|
123
|
+
export default MyPlugin
|