mm_os 1.3.3 → 1.3.5
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/README.en.md +36 -0
- package/README.md +25 -166
- package/conf.json +3 -0
- package/core/base/index.js +29 -0
- package/core/base/mqtt/index.js +268 -0
- package/core/base/mqtt/lib.js +40 -0
- package/core/base/web/index.js +110 -0
- package/core/com/api/com.json +4 -0
- package/{bin → core}/com/api/config.tpl.json +9 -7
- package/{bin → core}/com/api/drive.js +239 -64
- package/{bin → core}/com/api/index.js +8 -9
- package/{bin → core}/com/api/oauth.js +23 -14
- package/core/com/api/script.js +32 -0
- package/core/com/db/com.json +4 -0
- package/{bin → core}/com/db/drive.js +99 -65
- package/{bin → core}/com/db/index.js +2 -2
- package/core/com/event/com.json +4 -0
- package/{bin → core}/com/event/config.tpl.json +2 -2
- package/core/com/event/drive.js +125 -0
- package/{bin → core}/com/event/index.js +5 -10
- package/core/com/event/script.js +26 -0
- package/core/com/eventer/com.js +450 -0
- package/core/com/eventer/com.json +4 -0
- package/core/com/middleware/com.js +128 -0
- package/core/com/middleware/com.json +4 -0
- package/core/com/middleware/config.tpl.json +8 -0
- package/core/com/middleware/script.js +9 -0
- package/core/com/mqtt/com.json +4 -0
- package/core/com/mqtt/config.tpl.json +12 -0
- package/core/com/mqtt/drive.js +139 -0
- package/core/com/mqtt/index.js +138 -0
- package/core/com/mqtt/script.js +33 -0
- package/core/com/msg/com.js +296 -0
- package/core/com/msg/com.json +4 -0
- package/{bin → core}/com/nav/drive.js +42 -17
- package/{bin → core}/com/nav/index.js +4 -4
- package/core/com/nav/tpl/admin_pc/page_channel.vue +299 -0
- package/core/com/nav/tpl/admin_pc/page_config.vue +279 -0
- package/core/com/nav/tpl/admin_pc/page_config_form.vue +194 -0
- package/core/com/nav/tpl/admin_pc/page_default.vue +287 -0
- package/core/com/nav/tpl/admin_pc/page_form.vue +180 -0
- package/core/com/nav/tpl/admin_pc/page_lang.vue +265 -0
- package/core/com/nav/tpl/admin_pc/page_nav.vue +313 -0
- package/core/com/nav/tpl/admin_pc/page_table.vue +285 -0
- package/core/com/nav/tpl/admin_pc/page_type.vue +313 -0
- package/core/com/nav/tpl/dev_pc/page_channel.vue +253 -0
- package/core/com/nav/tpl/dev_pc/page_config.vue +253 -0
- package/core/com/nav/tpl/dev_pc/page_default.vue +247 -0
- package/core/com/nav/tpl/dev_pc/page_form.vue +162 -0
- package/core/com/nav/tpl/dev_pc/page_nav.vue +253 -0
- package/core/com/nav/tpl/dev_pc/page_table.vue +247 -0
- package/core/com/nav/tpl/dev_pc/page_type.vue +253 -0
- package/{bin/com/nav/tpl/home_phone → core/com/nav/tpl/home_pc}/page_channel.vue +231 -231
- package/{bin/com/nav/tpl/home_phone → core/com/nav/tpl/home_pc}/page_default.vue +231 -231
- package/{bin → core}/com/nav/tpl/home_pc/page_form.vue +9 -9
- package/{bin → core}/com/nav/tpl/home_pc/page_list.vue +231 -231
- package/{bin → core}/com/nav/tpl/home_pc/page_nav.vue +221 -221
- package/{bin/com/nav/tpl/home_phone → core/com/nav/tpl/home_pc}/page_type.vue +231 -231
- package/{bin → core}/com/nav/tpl/home_pc/page_view.vue +8 -8
- package/{bin/com/nav/tpl/home_pc → core/com/nav/tpl/home_phone}/page_channel.vue +231 -231
- package/{bin/com/nav/tpl/home_pc → core/com/nav/tpl/home_phone}/page_default.vue +231 -231
- package/{bin → core}/com/nav/tpl/home_phone/page_form.vue +9 -9
- package/{bin → core}/com/nav/tpl/home_phone/page_list.vue +231 -231
- package/{bin/com/nav/tpl/admin_pc → core/com/nav/tpl/home_phone}/page_nav.vue +236 -220
- package/{bin/com/nav/tpl/home_pc → core/com/nav/tpl/home_phone}/page_type.vue +231 -231
- package/{bin → core}/com/nav/tpl/home_phone/page_view.vue +8 -8
- package/core/com/nav/viewmodel.js +296 -0
- package/{bin → core}/com/param/config.tpl.json +24 -0
- package/{bin → core}/com/param/drive.js +47 -15
- package/core/com/plugin/com.json +4 -0
- package/core/com/plugin/config.tpl.json +20 -0
- package/{bin → core}/com/plugin/drive.js +5 -8
- package/{bin → core}/com/plugin/index.js +11 -56
- package/core/com/socket/README.md +47 -0
- package/core/com/socket/com.json +4 -0
- package/core/com/socket/config.tpl.json +14 -0
- package/{bin → core}/com/socket/drive.js +74 -51
- package/{bin → core}/com/socket/index.js +4 -2
- package/{bin → core}/com/socket/script.js +8 -6
- package/core/com/sql/config.tpl.json +70 -0
- package/{bin → core}/com/sql/drive.js +281 -58
- package/core/com/static/com.json +4 -0
- package/core/com/static/config.tpl.json +20 -0
- package/{bin → core}/com/static/drive.js +6 -4
- package/{bin → core}/com/static/index.js +5 -1
- package/core/com/task/com.json +4 -0
- package/core/com/task/config.tpl.json +24 -0
- package/core/com/task/drive.js +374 -0
- package/{bin → core}/com/task/index.js +14 -20
- package/core/com/task/script.js +37 -0
- package/core/com/timer/com.js +217 -0
- package/core/com/timer/com.json +4 -0
- package/core/com/tpl/com.js +19 -0
- package/core/com/tpl/com.json +4 -0
- package/index.js +161 -740
- package/lib/actions.js +50 -0
- package/lib/app.js +73 -0
- package/lib/base.js +355 -0
- package/lib/com.js +31 -0
- package/lib/game.js +31 -0
- package/lib/ref.js +121 -0
- package/middleware/cors/index.js +57 -0
- package/middleware/cors/middleware.json +7 -0
- package/middleware/mqtt_base/index.js +10 -0
- package/middleware/mqtt_base/middleware.json +8 -0
- package/{waf.js → middleware/waf/index.js} +12 -2
- package/middleware/waf/middleware.json +9 -0
- package/middleware/web_base/index.js +67 -0
- package/middleware/web_base/middleware.json +9 -0
- package/middleware/web_event/index.js +411 -0
- package/middleware/web_event/middleware.json +10 -0
- package/middleware/web_proxy/index.js +24 -0
- package/middleware/web_proxy/middleware.json +9 -0
- package/middleware/web_router/index.js +33 -0
- package/middleware/web_router/middleware.json +10 -0
- package/middleware/web_socket/index.js +21 -0
- package/middleware/web_socket/middleware.json +9 -0
- package/middleware/web_static/index.js +26 -0
- package/middleware/web_static/middleware.json +9 -0
- package/nodemon.json +12 -2
- package/package.json +56 -66
- package/.gitattributes +0 -5
- package/bin/com/README.md +0 -2
- package/bin/com/api/script.js +0 -14
- package/bin/com/cmd/README.md +0 -3
- package/bin/com/cmd/config.tpl.json +0 -41
- package/bin/com/cmd/drive.js +0 -512
- package/bin/com/cmd/index.js +0 -213
- package/bin/com/cmd/old/5w2h.js +0 -54
- package/bin/com/cmd/old/drive.js +0 -423
- package/bin/com/cmd/script.js +0 -11
- package/bin/com/event/drive.js +0 -69
- package/bin/com/event/script.js +0 -12
- package/bin/com/nav/tpl/admin_pc/page_channel.vue +0 -234
- package/bin/com/nav/tpl/admin_pc/page_default.vue +0 -236
- package/bin/com/nav/tpl/admin_pc/page_form.vue +0 -152
- package/bin/com/nav/tpl/admin_pc/page_table.vue +0 -236
- package/bin/com/nav/tpl/admin_pc/page_type.vue +0 -234
- package/bin/com/nav/tpl/home_phone/page_nav.vue +0 -221
- package/bin/com/nav/viewmodel.js +0 -161
- package/bin/com/plugin/config.tpl.json +0 -11
- package/bin/com/socket/config.tpl.json +0 -8
- package/bin/com/sql/config.tpl.json +0 -34
- package/bin/com/static/config.tpl.json +0 -11
- package/bin/com/task/config.tpl.json +0 -13
- package/bin/com/task/drive.js +0 -288
- package/bin/com/task/script.js +0 -38
- package/bin/com.js +0 -74
- package/bin/mm.conf +0 -48
- package/bin/static/404.html +0 -52
- package/bin/static/README.md +0 -1
- package/bin/static/css/font-awesome.min.css +0 -7
- package/bin/static/css/mm_base.css +0 -220
- package/bin/static/css/mm_common.css +0 -518
- package/bin/static/css/mm_component.css +0 -307
- package/bin/static/css/mm_expand.css +0 -634
- package/bin/static/css/mm_theme.css +0 -291
- package/bin/static/css/new_file.css +0 -79
- package/bin/static/css/swiper.min.css +0 -12
- package/bin/static/favicon.ico +0 -0
- package/bin/static/font/FontAwesome.otf +0 -0
- package/bin/static/font/HelveticaNeue.eot +0 -0
- package/bin/static/font/HelveticaNeue.otf +0 -0
- package/bin/static/font/HelveticaNeue.svg +0 -1273
- package/bin/static/font/HelveticaNeue.woff +0 -0
- package/bin/static/font/HelveticaNeue.woff2 +0 -0
- package/bin/static/font/fontawesome-webfont.eot +0 -0
- package/bin/static/font/fontawesome-webfont.svg +0 -2671
- package/bin/static/font/fontawesome-webfont.ttf +0 -0
- package/bin/static/font/fontawesome-webfont.woff +0 -0
- package/bin/static/font/fontawesome-webfont.woff2 +0 -0
- package/bin/static/h5.html +0 -325
- package/bin/static/highlight/highlight.pack.js +0 -2
- package/bin/static/highlight/styles/a11y-dark.css +0 -99
- package/bin/static/highlight/styles/a11y-light.css +0 -99
- package/bin/static/highlight/styles/agate.css +0 -108
- package/bin/static/highlight/styles/an-old-hope.css +0 -89
- package/bin/static/highlight/styles/androidstudio.css +0 -66
- package/bin/static/highlight/styles/arduino-light.css +0 -88
- package/bin/static/highlight/styles/arta.css +0 -73
- package/bin/static/highlight/styles/ascetic.css +0 -45
- package/bin/static/highlight/styles/atelier-cave-dark.css +0 -83
- package/bin/static/highlight/styles/atelier-cave-light.css +0 -85
- package/bin/static/highlight/styles/atelier-dune-dark.css +0 -69
- package/bin/static/highlight/styles/atelier-dune-light.css +0 -69
- package/bin/static/highlight/styles/atelier-estuary-dark.css +0 -84
- package/bin/static/highlight/styles/atelier-estuary-light.css +0 -84
- package/bin/static/highlight/styles/atelier-forest-dark.css +0 -69
- package/bin/static/highlight/styles/atelier-forest-light.css +0 -69
- package/bin/static/highlight/styles/atelier-heath-dark.css +0 -69
- package/bin/static/highlight/styles/atelier-heath-light.css +0 -69
- package/bin/static/highlight/styles/atelier-lakeside-dark.css +0 -69
- package/bin/static/highlight/styles/atelier-lakeside-light.css +0 -69
- package/bin/static/highlight/styles/atelier-plateau-dark.css +0 -84
- package/bin/static/highlight/styles/atelier-plateau-light.css +0 -84
- package/bin/static/highlight/styles/atelier-savanna-dark.css +0 -84
- package/bin/static/highlight/styles/atelier-savanna-light.css +0 -84
- package/bin/static/highlight/styles/atelier-seaside-dark.css +0 -69
- package/bin/static/highlight/styles/atelier-seaside-light.css +0 -69
- package/bin/static/highlight/styles/atelier-sulphurpool-dark.css +0 -69
- package/bin/static/highlight/styles/atelier-sulphurpool-light.css +0 -69
- package/bin/static/highlight/styles/atom-one-dark-reasonable.css +0 -77
- package/bin/static/highlight/styles/atom-one-dark.css +0 -96
- package/bin/static/highlight/styles/atom-one-light.css +0 -96
- package/bin/static/highlight/styles/brown-paper.css +0 -64
- package/bin/static/highlight/styles/brown-papersq.png +0 -0
- package/bin/static/highlight/styles/codepen-embed.css +0 -60
- package/bin/static/highlight/styles/color-brewer.css +0 -71
- package/bin/static/highlight/styles/darcula.css +0 -77
- package/bin/static/highlight/styles/dark.css +0 -63
- package/bin/static/highlight/styles/darkula.css +0 -6
- package/bin/static/highlight/styles/default.css +0 -99
- package/bin/static/highlight/styles/docco.css +0 -97
- package/bin/static/highlight/styles/dracula.css +0 -76
- package/bin/static/highlight/styles/far.css +0 -71
- package/bin/static/highlight/styles/foundation.css +0 -88
- package/bin/static/highlight/styles/github-gist.css +0 -79
- package/bin/static/highlight/styles/github.css +0 -99
- package/bin/static/highlight/styles/gml.css +0 -78
- package/bin/static/highlight/styles/googlecode.css +0 -89
- package/bin/static/highlight/styles/grayscale.css +0 -101
- package/bin/static/highlight/styles/gruvbox-dark.css +0 -108
- package/bin/static/highlight/styles/gruvbox-light.css +0 -108
- package/bin/static/highlight/styles/hopscotch.css +0 -83
- package/bin/static/highlight/styles/hybrid.css +0 -102
- package/bin/static/highlight/styles/idea.css +0 -97
- package/bin/static/highlight/styles/ir-black.css +0 -73
- package/bin/static/highlight/styles/isbl-editor-dark.css +0 -112
- package/bin/static/highlight/styles/isbl-editor-light.css +0 -112
- package/bin/static/highlight/styles/kimbie.dark.css +0 -74
- package/bin/static/highlight/styles/kimbie.light.css +0 -74
- package/bin/static/highlight/styles/lightfair.css +0 -87
- package/bin/static/highlight/styles/magula.css +0 -70
- package/bin/static/highlight/styles/mono-blue.css +0 -59
- package/bin/static/highlight/styles/monokai-sublime.css +0 -83
- package/bin/static/highlight/styles/monokai.css +0 -70
- package/bin/static/highlight/styles/nord.css +0 -309
- package/bin/static/highlight/styles/obsidian.css +0 -88
- package/bin/static/highlight/styles/ocean.css +0 -74
- package/bin/static/highlight/styles/paraiso-dark.css +0 -72
- package/bin/static/highlight/styles/paraiso-light.css +0 -72
- package/bin/static/highlight/styles/pojoaque.css +0 -83
- package/bin/static/highlight/styles/pojoaque.jpg +0 -0
- package/bin/static/highlight/styles/purebasic.css +0 -96
- package/bin/static/highlight/styles/qtcreator_dark.css +0 -83
- package/bin/static/highlight/styles/qtcreator_light.css +0 -83
- package/bin/static/highlight/styles/railscasts.css +0 -106
- package/bin/static/highlight/styles/rainbow.css +0 -85
- package/bin/static/highlight/styles/routeros.css +0 -108
- package/bin/static/highlight/styles/school-book.css +0 -69
- package/bin/static/highlight/styles/school-book.png +0 -0
- package/bin/static/highlight/styles/shades-of-purple.css +0 -97
- package/bin/static/highlight/styles/solarized-dark.css +0 -84
- package/bin/static/highlight/styles/solarized-light.css +0 -84
- package/bin/static/highlight/styles/sunburst.css +0 -102
- package/bin/static/highlight/styles/tomorrow-night-blue.css +0 -75
- package/bin/static/highlight/styles/tomorrow-night-bright.css +0 -74
- package/bin/static/highlight/styles/tomorrow-night-eighties.css +0 -74
- package/bin/static/highlight/styles/tomorrow-night.css +0 -75
- package/bin/static/highlight/styles/tomorrow.css +0 -72
- package/bin/static/highlight/styles/vs.css +0 -68
- package/bin/static/highlight/styles/vs2015.css +0 -115
- package/bin/static/highlight/styles/xcode.css +0 -104
- package/bin/static/highlight/styles/xt256.css +0 -92
- package/bin/static/highlight/styles/zenburn.css +0 -80
- package/bin/static/highlight/vue-highlight.js +0 -29
- package/bin/static/ifame.html +0 -24
- package/bin/static/img/add.png +0 -0
- package/bin/static/img/avatar.png +0 -0
- package/bin/static/img/banner_2.png +0 -0
- package/bin/static/img/default.png +0 -0
- package/bin/static/img/loading.svg +0 -1
- package/bin/static/img/logo.png +0 -0
- package/bin/static/img/logo1.png +0 -0
- package/bin/static/img/logo_gray.png +0 -0
- package/bin/static/img/logo_round.png +0 -0
- package/bin/static/img/mm.ico +0 -0
- package/bin/static/img/mm.jpg +0 -0
- package/bin/static/img/select.png +0 -0
- package/bin/static/img/web.png +0 -0
- package/bin/static/index.html +0 -12
- package/bin/static/js/clipboard.min.js +0 -257
- package/bin/static/js/css.min.js +0 -1
- package/bin/static/js/echarts.js +0 -22
- package/bin/static/js/html5.min.js +0 -1
- package/bin/static/js/jquery.lazyload.min.js +0 -2
- package/bin/static/js/jquery.min.js +0 -4189
- package/bin/static/js/jquery.scrollstop.min.js +0 -2
- package/bin/static/js/mm-requirejs-vue.js +0 -283
- package/bin/static/js/mm_check.js +0 -490
- package/bin/static/js/mm_flexble.js +0 -112
- package/bin/static/js/mm_picker.js +0 -1417
- package/bin/static/js/mm_pinyinlite.js +0 -873
- package/bin/static/js/mm_sdk.js +0 -2841
- package/bin/static/js/mm_ui_expand.js +0 -468
- package/bin/static/js/mm_vue.js +0 -376
- package/bin/static/js/mm_vue_ui.js +0 -2375
- package/bin/static/js/mm_websocket.js +0 -145
- package/bin/static/js/require.js +0 -5
- package/bin/static/js/sortable.min.js +0 -3
- package/bin/static/js/swiper.min.js +0 -13
- package/bin/static/js/text.min.js +0 -1
- package/bin/static/js/vue-router.min.js +0 -6
- package/bin/static/js/vue.js +0 -12338
- package/bin/static/js/vuedraggable.min.js +0 -2
- package/bin/static/js/vuex.min.js +0 -6
- package/bin/static/src/components/bar/mm_action.vue +0 -19
- package/bin/static/src/components/bar/mm_buy.vue +0 -19
- package/bin/static/src/components/bar/mm_chat.vue +0 -18
- package/bin/static/src/components/bar/mm_count.vue +0 -18
- package/bin/static/src/components/bar/mm_filter.vue +0 -18
- package/bin/static/src/components/bar/mm_search.vue +0 -18
- package/bin/static/src/components/bar/mm_sort.vue +0 -18
- package/bin/static/src/components/bar/mm_tag.vue +0 -18
- package/bin/static/src/components/bar/mm_title.vue +0 -19
- package/bin/static/src/components/content/mm_pre.vue +0 -70
- package/bin/static/src/components/expand/mm_drag.vue +0 -39
- package/bin/static/src/components/item/mm_article.vue +0 -115
- package/bin/static/src/components/item/mm_base.vue +0 -26
- package/bin/static/src/components/item/mm_contact.vue +0 -25
- package/bin/static/src/components/item/mm_goods.vue +0 -23
- package/bin/static/src/components/item/mm_img.vue +0 -21
- package/bin/static/src/components/item/mm_media.vue +0 -18
- package/bin/static/src/components/item/mm_message.vue +0 -18
- package/bin/static/src/components/item/mm_music.vue +0 -95
- package/bin/static/src/components/item/mm_news.vue +0 -22
- package/bin/static/src/components/item/mm_number.vue +0 -26
- package/bin/static/src/components/item/mm_question.vue +0 -35
- package/bin/static/src/components/item/mm_user.vue +0 -22
- package/bin/static/src/components/item/mm_video.vue +0 -95
- package/bin/static/src/components/slide/mm_slide_card.vue +0 -64
- package/bin/static/src/components/slide/mm_slide_img.vue +0 -47
- package/bin/static/src/components/slide/mm_slide_page.vue +0 -8
- package/bin/static/src/components/slide/mm_slide_text.vue +0 -54
- package/bin/static/src/main.js +0 -84
- package/bin/static/src/mixins/form.js +0 -223
- package/bin/static/src/mixins/item.js +0 -242
- package/bin/static/src/mixins/list.js +0 -244
- package/bin/static/src/mixins/page.js +0 -1011
- package/bin/static/src/mm_component.js +0 -74
- package/bin/static/src/router.js +0 -72
- package/bin/static/src/store/user.js +0 -75
- package/bin/static/src/store/web.js +0 -50
- package/bin/static/user/1/number_info.xlsx +0 -0
- package/bin/static/w3c.html +0 -94
- package/init.js +0 -55
- package/update.md +0 -1
- /package/{bin → core}/com/api/README.md +0 -0
- /package/{bin → core}/com/api/rpc.js +0 -0
- /package/{bin → core}/com/db/README.md +0 -0
- /package/{bin → core}/com/event/README.md +0 -0
- /package/{bin/com/socket → core/com/mqtt}/README.md +0 -0
- /package/{bin → core}/com/nav/README.md +0 -0
- /package/{bin → core}/com/nav/config.tpl.json +0 -0
- /package/{bin → core}/com/param/README.md +0 -0
- /package/{bin → core}/com/param/index.js +0 -0
- /package/{bin → core}/com/param/script.js +0 -0
- /package/{bin → core}/com/param/test.js +0 -0
- /package/{bin → core}/com/plugin/README.md +0 -0
- /package/{bin → core}/com/plugin/script.js +0 -0
- /package/{bin → core}/com/sql/README.md +0 -0
- /package/{bin → core}/com/sql/index.js +0 -0
- /package/{bin → core}/com/sql/script.js +0 -0
- /package/{bin → core}/com/static/README.md +0 -0
- /package/{bin → core}/com/static/script.js +0 -0
- /package/{bin → core}/com/task/README.md +0 -0
- /package/{bin/rps.bat → rps.bat} +0 -0
- /package/{bin/tps.bat → tps.bat} +0 -0
|
@@ -1,2375 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function import_picker($) {
|
|
3
|
-
"use strict";
|
|
4
|
-
var Picker = function (params) {
|
|
5
|
-
var p = this;
|
|
6
|
-
var defaults = {
|
|
7
|
-
updateValuesOnMomentum: false,
|
|
8
|
-
updateValuesOnTouchmove: true,
|
|
9
|
-
rotateEffect: false,
|
|
10
|
-
momentumRatio: 7,
|
|
11
|
-
freeMode: false,
|
|
12
|
-
// Common settings
|
|
13
|
-
scrollToInput: true,
|
|
14
|
-
inputReadOnly: true,
|
|
15
|
-
toolbar: true,
|
|
16
|
-
toolbarCloseText: '确定',
|
|
17
|
-
toolbarTemplate: '<header class="bar bar-nav">\
|
|
18
|
-
<nav>\
|
|
19
|
-
<div class="fr">\
|
|
20
|
-
<button class="btn btn-link pull-right close-picker">确定</button>\
|
|
21
|
-
</div>\
|
|
22
|
-
<div class="fm">请选择</div>\
|
|
23
|
-
</nav>\
|
|
24
|
-
</header>',
|
|
25
|
-
};
|
|
26
|
-
params = params || {};
|
|
27
|
-
for (var def in defaults) {
|
|
28
|
-
if (typeof params[def] === 'undefined') {
|
|
29
|
-
params[def] = defaults[def];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
p.params = params;
|
|
33
|
-
p.cols = [];
|
|
34
|
-
p.initialized = false;
|
|
35
|
-
|
|
36
|
-
// Inline flag
|
|
37
|
-
p.inline = p.params.container ? true : false;
|
|
38
|
-
|
|
39
|
-
// 3D Transforms origin bug, only on safari
|
|
40
|
-
var originBug = $.device.ios || (navigator.userAgent.toLowerCase().indexOf('safari') >= 0 && navigator.userAgent.toLowerCase().indexOf('chrome') < 0) && !$.device.android;
|
|
41
|
-
|
|
42
|
-
// Value
|
|
43
|
-
p.setValue = function (arrValues, transition) {
|
|
44
|
-
var valueIndex = 0;
|
|
45
|
-
for (var i = 0; i < p.cols.length; i++) {
|
|
46
|
-
if (p.cols[i] && !p.cols[i].divider) {
|
|
47
|
-
p.cols[i].setValue(arrValues[valueIndex], transition);
|
|
48
|
-
valueIndex++;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
p.updateValue = function () {
|
|
53
|
-
var newValue = [];
|
|
54
|
-
var newDisplayValue = [];
|
|
55
|
-
for (var i = 0; i < p.cols.length; i++) {
|
|
56
|
-
if (!p.cols[i].divider) {
|
|
57
|
-
newValue.push(p.cols[i].value);
|
|
58
|
-
newDisplayValue.push(p.cols[i].displayValue);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (newValue.indexOf(undefined) >= 0) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
p.value = newValue;
|
|
65
|
-
p.displayValue = newDisplayValue;
|
|
66
|
-
if (p.params.onChange) {
|
|
67
|
-
p.params.onChange(p, p.value, p.displayValue);
|
|
68
|
-
}
|
|
69
|
-
if (p.input && p.input.length > 0) {
|
|
70
|
-
$(p.input).val(p.params.formatValue ? p.params.formatValue(p, p.value, p.displayValue) : p.value.join(' '));
|
|
71
|
-
$(p.input).trigger('change');
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// Columns Handlers
|
|
76
|
-
p.initPickerCol = function (colElement, updateItems) {
|
|
77
|
-
var colContainer = $(colElement);
|
|
78
|
-
var colIndex = colContainer.index();
|
|
79
|
-
var col = p.cols[colIndex];
|
|
80
|
-
if (col.divider) return;
|
|
81
|
-
col.container = colContainer;
|
|
82
|
-
col.wrapper = col.container.find('.picker-items-col-wrapper');
|
|
83
|
-
col.items = col.wrapper.find('.picker-item');
|
|
84
|
-
|
|
85
|
-
var i, j;
|
|
86
|
-
var wrapperHeight, itemHeight, itemsHeight, minTranslate, maxTranslate;
|
|
87
|
-
col.replaceValues = function (values, displayValues) {
|
|
88
|
-
col.destroyEvents();
|
|
89
|
-
col.values = values;
|
|
90
|
-
col.displayValues = displayValues;
|
|
91
|
-
var newItemsHTML = p.columnHTML(col, true);
|
|
92
|
-
col.wrapper.html(newItemsHTML);
|
|
93
|
-
col.items = col.wrapper.find('.picker-item');
|
|
94
|
-
col.calcSize();
|
|
95
|
-
col.setValue(col.values[0], 0, true);
|
|
96
|
-
col.initEvents();
|
|
97
|
-
};
|
|
98
|
-
col.calcSize = function () {
|
|
99
|
-
if (p.params.rotateEffect) {
|
|
100
|
-
col.container.removeClass('picker-items-col-absolute');
|
|
101
|
-
if (!col.width) col.container.css({width:''});
|
|
102
|
-
}
|
|
103
|
-
var colWidth, colHeight;
|
|
104
|
-
colWidth = 0;
|
|
105
|
-
colHeight = col.container[0].offsetHeight;
|
|
106
|
-
wrapperHeight = col.wrapper[0].offsetHeight;
|
|
107
|
-
itemHeight = col.items[0].offsetHeight;
|
|
108
|
-
itemsHeight = itemHeight * col.items.length;
|
|
109
|
-
minTranslate = colHeight / 2 - itemsHeight + itemHeight / 2;
|
|
110
|
-
maxTranslate = colHeight / 2 - itemHeight / 2;
|
|
111
|
-
if (col.width) {
|
|
112
|
-
colWidth = col.width;
|
|
113
|
-
if (parseInt(colWidth, 10) === colWidth) colWidth = colWidth + 'px';
|
|
114
|
-
col.container.css({width: colWidth});
|
|
115
|
-
}
|
|
116
|
-
if (p.params.rotateEffect) {
|
|
117
|
-
if (!col.width) {
|
|
118
|
-
col.items.each(function () {
|
|
119
|
-
var item = $(this);
|
|
120
|
-
item.css({width:'auto'});
|
|
121
|
-
colWidth = Math.max(colWidth, item[0].offsetWidth);
|
|
122
|
-
item.css({width:''});
|
|
123
|
-
});
|
|
124
|
-
col.container.css({width: (colWidth + 2) + 'px'});
|
|
125
|
-
}
|
|
126
|
-
col.container.addClass('picker-items-col-absolute');
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
col.calcSize();
|
|
130
|
-
|
|
131
|
-
col.wrapper.transform('translate3d(0,' + maxTranslate + 'px,0)').transition(0);
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var activeIndex = 0;
|
|
135
|
-
var animationFrameId;
|
|
136
|
-
|
|
137
|
-
// Set Value Function
|
|
138
|
-
col.setValue = function (newValue, transition, valueCallbacks) {
|
|
139
|
-
if (typeof transition === 'undefined') transition = '';
|
|
140
|
-
var newActiveIndex = col.wrapper.find('.picker-item[data-picker-value="' + newValue + '"]').index();
|
|
141
|
-
if(typeof newActiveIndex === 'undefined' || newActiveIndex === -1) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
var newTranslate = -newActiveIndex * itemHeight + maxTranslate;
|
|
145
|
-
// Update wrapper
|
|
146
|
-
col.wrapper.transition(transition);
|
|
147
|
-
col.wrapper.transform('translate3d(0,' + (newTranslate) + 'px,0)');
|
|
148
|
-
|
|
149
|
-
// Watch items
|
|
150
|
-
if (p.params.updateValuesOnMomentum && col.activeIndex && col.activeIndex !== newActiveIndex ) {
|
|
151
|
-
$.cancelAnimationFrame(animationFrameId);
|
|
152
|
-
col.wrapper.transitionEnd(function(){
|
|
153
|
-
$.cancelAnimationFrame(animationFrameId);
|
|
154
|
-
});
|
|
155
|
-
updateDuringScroll();
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Update items
|
|
159
|
-
col.updateItems(newActiveIndex, newTranslate, transition, valueCallbacks);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
col.updateItems = function (activeIndex, translate, transition, valueCallbacks) {
|
|
163
|
-
if (typeof translate === 'undefined') {
|
|
164
|
-
translate = $.getTranslate(col.wrapper[0], 'y');
|
|
165
|
-
}
|
|
166
|
-
if(typeof activeIndex === 'undefined') activeIndex = -Math.round((translate - maxTranslate)/itemHeight);
|
|
167
|
-
if (activeIndex < 0) activeIndex = 0;
|
|
168
|
-
if (activeIndex >= col.items.length) activeIndex = col.items.length - 1;
|
|
169
|
-
var previousActiveIndex = col.activeIndex;
|
|
170
|
-
col.activeIndex = activeIndex;
|
|
171
|
-
/*
|
|
172
|
-
col.wrapper.find('.picker-selected, .picker-after-selected, .picker-before-selected').removeClass('picker-selected picker-after-selected picker-before-selected');
|
|
173
|
-
|
|
174
|
-
col.items.transition(transition);
|
|
175
|
-
var selectedItem = col.items.eq(activeIndex).addClass('picker-selected').transform('');
|
|
176
|
-
var prevItems = selectedItem.prevAll().addClass('picker-before-selected');
|
|
177
|
-
var nextItems = selectedItem.nextAll().addClass('picker-after-selected');
|
|
178
|
-
*/
|
|
179
|
-
//去掉 .picker-after-selected, .picker-before-selected 以提高性能
|
|
180
|
-
col.wrapper.find('.picker-selected').removeClass('picker-selected');
|
|
181
|
-
if (p.params.rotateEffect) {
|
|
182
|
-
col.items.transition(transition);
|
|
183
|
-
}
|
|
184
|
-
var selectedItem = col.items.eq(activeIndex).addClass('picker-selected').transform('');
|
|
185
|
-
|
|
186
|
-
if (valueCallbacks || typeof valueCallbacks === 'undefined') {
|
|
187
|
-
// Update values
|
|
188
|
-
col.value = selectedItem.attr('data-picker-value');
|
|
189
|
-
col.displayValue = col.displayValues ? col.displayValues[activeIndex] : col.value;
|
|
190
|
-
// On change callback
|
|
191
|
-
if (previousActiveIndex !== activeIndex) {
|
|
192
|
-
if (col.onChange) {
|
|
193
|
-
col.onChange(p, col.value, col.displayValue);
|
|
194
|
-
}
|
|
195
|
-
p.updateValue();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Set 3D rotate effect
|
|
200
|
-
if (!p.params.rotateEffect) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
var percentage = (translate - (Math.floor((translate - maxTranslate)/itemHeight) * itemHeight + maxTranslate)) / itemHeight;
|
|
204
|
-
|
|
205
|
-
col.items.each(function () {
|
|
206
|
-
var item = $(this);
|
|
207
|
-
var itemOffsetTop = item.index() * itemHeight;
|
|
208
|
-
var translateOffset = maxTranslate - translate;
|
|
209
|
-
var itemOffset = itemOffsetTop - translateOffset;
|
|
210
|
-
var percentage = itemOffset / itemHeight;
|
|
211
|
-
|
|
212
|
-
var itemsFit = Math.ceil(col.height / itemHeight / 2) + 1;
|
|
213
|
-
|
|
214
|
-
var angle = (-18*percentage);
|
|
215
|
-
if (angle > 180) angle = 180;
|
|
216
|
-
if (angle < -180) angle = -180;
|
|
217
|
-
// Far class
|
|
218
|
-
if (Math.abs(percentage) > itemsFit) item.addClass('picker-item-far');
|
|
219
|
-
else item.removeClass('picker-item-far');
|
|
220
|
-
// Set transform
|
|
221
|
-
item.transform('translate3d(0, ' + (-translate + maxTranslate) + 'px, ' + (originBug ? -110 : 0) + 'px) rotateX(' + angle + 'deg)');
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
function updateDuringScroll() {
|
|
226
|
-
animationFrameId = $.requestAnimationFrame(function () {
|
|
227
|
-
col.updateItems(undefined, undefined, 0);
|
|
228
|
-
updateDuringScroll();
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Update items on init
|
|
233
|
-
if (updateItems) col.updateItems(0, maxTranslate, 0);
|
|
234
|
-
|
|
235
|
-
var allowItemClick = true;
|
|
236
|
-
var isTouched, isMoved, touchStartY, touchCurrentY, touchStartTime, touchEndTime, startTranslate, returnTo, currentTranslate, prevTranslate, velocityTranslate, velocityTime;
|
|
237
|
-
function handleTouchStart (e) {
|
|
238
|
-
if (isMoved || isTouched) return;
|
|
239
|
-
e.preventDefault();
|
|
240
|
-
isTouched = true;
|
|
241
|
-
touchStartY = touchCurrentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
|
242
|
-
touchStartTime = (new Date()).getTime();
|
|
243
|
-
|
|
244
|
-
allowItemClick = true;
|
|
245
|
-
startTranslate = currentTranslate = $.getTranslate(col.wrapper[0], 'y');
|
|
246
|
-
}
|
|
247
|
-
function handleTouchMove (e) {
|
|
248
|
-
if (!isTouched) return;
|
|
249
|
-
e.preventDefault();
|
|
250
|
-
allowItemClick = false;
|
|
251
|
-
touchCurrentY = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
|
252
|
-
if (!isMoved) {
|
|
253
|
-
// First move
|
|
254
|
-
$.cancelAnimationFrame(animationFrameId);
|
|
255
|
-
isMoved = true;
|
|
256
|
-
startTranslate = currentTranslate = $.getTranslate(col.wrapper[0], 'y');
|
|
257
|
-
col.wrapper.transition(0);
|
|
258
|
-
}
|
|
259
|
-
e.preventDefault();
|
|
260
|
-
|
|
261
|
-
var diff = touchCurrentY - touchStartY;
|
|
262
|
-
currentTranslate = startTranslate + diff;
|
|
263
|
-
returnTo = undefined;
|
|
264
|
-
|
|
265
|
-
// Normalize translate
|
|
266
|
-
if (currentTranslate < minTranslate) {
|
|
267
|
-
currentTranslate = minTranslate - Math.pow(minTranslate - currentTranslate, 0.8);
|
|
268
|
-
returnTo = 'min';
|
|
269
|
-
}
|
|
270
|
-
if (currentTranslate > maxTranslate) {
|
|
271
|
-
currentTranslate = maxTranslate + Math.pow(currentTranslate - maxTranslate, 0.8);
|
|
272
|
-
returnTo = 'max';
|
|
273
|
-
}
|
|
274
|
-
// Transform wrapper
|
|
275
|
-
col.wrapper.transform('translate3d(0,' + currentTranslate + 'px,0)');
|
|
276
|
-
|
|
277
|
-
// Update items
|
|
278
|
-
col.updateItems(undefined, currentTranslate, 0, p.params.updateValuesOnTouchmove);
|
|
279
|
-
|
|
280
|
-
// Calc velocity
|
|
281
|
-
velocityTranslate = currentTranslate - prevTranslate || currentTranslate;
|
|
282
|
-
velocityTime = (new Date()).getTime();
|
|
283
|
-
prevTranslate = currentTranslate;
|
|
284
|
-
}
|
|
285
|
-
function handleTouchEnd (e) {
|
|
286
|
-
if (!isTouched || !isMoved) {
|
|
287
|
-
isTouched = isMoved = false;
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
isTouched = isMoved = false;
|
|
291
|
-
col.wrapper.transition('');
|
|
292
|
-
if (returnTo) {
|
|
293
|
-
if (returnTo === 'min') {
|
|
294
|
-
col.wrapper.transform('translate3d(0,' + minTranslate + 'px,0)');
|
|
295
|
-
}
|
|
296
|
-
else col.wrapper.transform('translate3d(0,' + maxTranslate + 'px,0)');
|
|
297
|
-
}
|
|
298
|
-
touchEndTime = new Date().getTime();
|
|
299
|
-
var velocity, newTranslate;
|
|
300
|
-
if (touchEndTime - touchStartTime > 300) {
|
|
301
|
-
newTranslate = currentTranslate;
|
|
302
|
-
}
|
|
303
|
-
else {
|
|
304
|
-
velocity = Math.abs(velocityTranslate / (touchEndTime - velocityTime));
|
|
305
|
-
newTranslate = currentTranslate + velocityTranslate * p.params.momentumRatio;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
newTranslate = Math.max(Math.min(newTranslate, maxTranslate), minTranslate);
|
|
309
|
-
|
|
310
|
-
// Active Index
|
|
311
|
-
var activeIndex = -Math.floor((newTranslate - maxTranslate)/itemHeight);
|
|
312
|
-
|
|
313
|
-
// Normalize translate
|
|
314
|
-
if (!p.params.freeMode) newTranslate = -activeIndex * itemHeight + maxTranslate;
|
|
315
|
-
|
|
316
|
-
// Transform wrapper
|
|
317
|
-
col.wrapper.transform('translate3d(0,' + (parseInt(newTranslate,10)) + 'px,0)');
|
|
318
|
-
|
|
319
|
-
// Update items
|
|
320
|
-
col.updateItems(activeIndex, newTranslate, '', true);
|
|
321
|
-
|
|
322
|
-
// Watch items
|
|
323
|
-
if (p.params.updateValuesOnMomentum) {
|
|
324
|
-
updateDuringScroll();
|
|
325
|
-
col.wrapper.transitionEnd(function(){
|
|
326
|
-
$.cancelAnimationFrame(animationFrameId);
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// Allow click
|
|
331
|
-
setTimeout(function () {
|
|
332
|
-
allowItemClick = true;
|
|
333
|
-
}, 100);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
function handleClick(e) {
|
|
337
|
-
if (!allowItemClick) return;
|
|
338
|
-
$.cancelAnimationFrame(animationFrameId);
|
|
339
|
-
/*jshint validthis:true */
|
|
340
|
-
var value = $(this).attr('data-picker-value');
|
|
341
|
-
col.setValue(value);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
col.initEvents = function (detach) {
|
|
345
|
-
var method = detach ? 'off' : 'on';
|
|
346
|
-
col.container[method]($.touchEvents.start, handleTouchStart);
|
|
347
|
-
col.container[method]($.touchEvents.move, handleTouchMove);
|
|
348
|
-
col.container[method]($.touchEvents.end, handleTouchEnd);
|
|
349
|
-
col.items[method]('click', handleClick);
|
|
350
|
-
};
|
|
351
|
-
col.destroyEvents = function () {
|
|
352
|
-
col.initEvents(true);
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
col.container[0].f7DestroyPickerCol = function () {
|
|
356
|
-
col.destroyEvents();
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
col.initEvents();
|
|
360
|
-
|
|
361
|
-
};
|
|
362
|
-
p.destroyPickerCol = function (colContainer) {
|
|
363
|
-
colContainer = $(colContainer);
|
|
364
|
-
if ('f7DestroyPickerCol' in colContainer[0]) colContainer[0].f7DestroyPickerCol();
|
|
365
|
-
};
|
|
366
|
-
// Resize cols
|
|
367
|
-
function resizeCols() {
|
|
368
|
-
if (!p.opened) return;
|
|
369
|
-
for (var i = 0; i < p.cols.length; i++) {
|
|
370
|
-
if (!p.cols[i].divider) {
|
|
371
|
-
p.cols[i].calcSize();
|
|
372
|
-
p.cols[i].setValue(p.cols[i].value, 0, false);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
$(window).on('resize', resizeCols);
|
|
377
|
-
|
|
378
|
-
// HTML Layout
|
|
379
|
-
p.columnHTML = function (col, onlyItems) {
|
|
380
|
-
var columnItemsHTML = '';
|
|
381
|
-
var columnHTML = '';
|
|
382
|
-
if (col.divider) {
|
|
383
|
-
columnHTML += '<div class="picker-items-col picker-items-col-divider ' + (col.textAlign ? 'picker-items-col-' + col.textAlign : '') + ' ' + (col.cssClass || '') + '">' + col.content + '</div>';
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
for (var j = 0; j < col.values.length; j++) {
|
|
387
|
-
columnItemsHTML += '<div class="picker-item" data-picker-value="' + col.values[j] + '">' + (col.displayValues ? col.displayValues[j] : col.values[j]) + '</div>';
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
columnHTML += '<div class="picker-items-col ' + (col.textAlign ? 'picker-items-col-' + col.textAlign : '') + ' ' + (col.cssClass || '') + '"><div class="picker-items-col-wrapper">' + columnItemsHTML + '</div></div>';
|
|
391
|
-
}
|
|
392
|
-
return onlyItems ? columnItemsHTML : columnHTML;
|
|
393
|
-
};
|
|
394
|
-
p.layout = function () {
|
|
395
|
-
var pickerHTML = '';
|
|
396
|
-
var pickerClass = '';
|
|
397
|
-
var i;
|
|
398
|
-
p.cols = [];
|
|
399
|
-
var colsHTML = '';
|
|
400
|
-
for (i = 0; i < p.params.cols.length; i++) {
|
|
401
|
-
var col = p.params.cols[i];
|
|
402
|
-
colsHTML += p.columnHTML(p.params.cols[i]);
|
|
403
|
-
p.cols.push(col);
|
|
404
|
-
}
|
|
405
|
-
pickerClass = 'picker-modal picker-columns ' + (p.params.cssClass || '') + (p.params.rotateEffect ? ' picker-3d' : '');
|
|
406
|
-
pickerHTML =
|
|
407
|
-
'<div class="' + (pickerClass) + '">' +
|
|
408
|
-
(p.params.toolbar ? p.params.toolbarTemplate.replace(/{{closeText}}/g, p.params.toolbarCloseText) : '') +
|
|
409
|
-
'<div class="picker-modal-inner picker-items">' +
|
|
410
|
-
colsHTML +
|
|
411
|
-
'<div class="picker-center-highlight"></div>' +
|
|
412
|
-
'</div>' +
|
|
413
|
-
'</div>';
|
|
414
|
-
|
|
415
|
-
p.pickerHTML = pickerHTML;
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
// Input Events
|
|
419
|
-
function openOnInput(e) {
|
|
420
|
-
e.preventDefault();
|
|
421
|
-
// 安卓微信webviewreadonly的input依然弹出软键盘问题修复
|
|
422
|
-
if ($.device.isWeixin && $.device.android && p.params.inputReadOnly) {
|
|
423
|
-
/*jshint validthis:true */
|
|
424
|
-
this.focus();
|
|
425
|
-
this.blur();
|
|
426
|
-
}
|
|
427
|
-
if (p.opened) return;
|
|
428
|
-
p.open();
|
|
429
|
-
if (p.params.scrollToInput) {
|
|
430
|
-
var pageContent = p.input.parents('.content');
|
|
431
|
-
if (pageContent.length === 0) return;
|
|
432
|
-
|
|
433
|
-
var paddingTop = parseInt(pageContent.css('padding-top'), 10),
|
|
434
|
-
paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),
|
|
435
|
-
pageHeight = pageContent[0].offsetHeight - paddingTop - p.container.height(),
|
|
436
|
-
pageScrollHeight = pageContent[0].scrollHeight - paddingTop - p.container.height(),
|
|
437
|
-
newPaddingBottom;
|
|
438
|
-
var inputTop = p.input.offset().top - paddingTop + p.input[0].offsetHeight;
|
|
439
|
-
if (inputTop > pageHeight) {
|
|
440
|
-
var scrollTop = pageContent.scrollTop() + inputTop - pageHeight;
|
|
441
|
-
if (scrollTop + pageHeight > pageScrollHeight) {
|
|
442
|
-
newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom;
|
|
443
|
-
if (pageHeight === pageScrollHeight) {
|
|
444
|
-
newPaddingBottom = p.container.height();
|
|
445
|
-
}
|
|
446
|
-
pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'});
|
|
447
|
-
}
|
|
448
|
-
pageContent.scrollTop(scrollTop, 300);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
function closeOnHTMLClick(e) {
|
|
453
|
-
if (!p.opened) return;
|
|
454
|
-
if (p.input && p.input.length > 0) {
|
|
455
|
-
if (e.target !== p.input[0] && $(e.target).parents('.picker-modal').length === 0) p.close();
|
|
456
|
-
}
|
|
457
|
-
else {
|
|
458
|
-
if ($(e.target).parents('.picker-modal').length === 0) p.close();
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
if (p.params.input) {
|
|
463
|
-
p.input = $(p.params.input);
|
|
464
|
-
if (p.input.length > 0) {
|
|
465
|
-
if (p.params.inputReadOnly) p.input.prop('readOnly', true);
|
|
466
|
-
if (!p.inline) {
|
|
467
|
-
p.input.on('click', openOnInput);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
if (!p.inline) $('html').on('click', closeOnHTMLClick);
|
|
473
|
-
|
|
474
|
-
// Open
|
|
475
|
-
function onPickerClose() {
|
|
476
|
-
p.opened = false;
|
|
477
|
-
if (p.input && p.input.length > 0) p.input.parents('.content').css({'padding-bottom': ''});
|
|
478
|
-
if (p.params.onClose) p.params.onClose(p);
|
|
479
|
-
|
|
480
|
-
// Destroy events
|
|
481
|
-
p.container.find('.picker-items-col').each(function () {
|
|
482
|
-
p.destroyPickerCol(this);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
p.opened = false;
|
|
487
|
-
p.open = function () {
|
|
488
|
-
if (!p.opened) {
|
|
489
|
-
|
|
490
|
-
// Layout
|
|
491
|
-
p.layout();
|
|
492
|
-
|
|
493
|
-
// Append
|
|
494
|
-
if (p.inline) {
|
|
495
|
-
p.container = $(p.pickerHTML);
|
|
496
|
-
p.container.addClass('picker-modal-inline');
|
|
497
|
-
$(p.params.container).append(p.container);
|
|
498
|
-
p.opened = true;
|
|
499
|
-
}
|
|
500
|
-
else {
|
|
501
|
-
p.container = $($.pickerModal(p.pickerHTML));
|
|
502
|
-
$(p.container)
|
|
503
|
-
.one('opened', function() {
|
|
504
|
-
p.opened = true;
|
|
505
|
-
})
|
|
506
|
-
.on('close', function () {
|
|
507
|
-
onPickerClose();
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
// Store picker instance
|
|
512
|
-
p.container[0].f7Picker = p;
|
|
513
|
-
|
|
514
|
-
// Init Events
|
|
515
|
-
p.container.find('.picker-items-col').each(function () {
|
|
516
|
-
var updateItems = true;
|
|
517
|
-
if ((!p.initialized && p.params.value) || (p.initialized && p.value)) updateItems = false;
|
|
518
|
-
p.initPickerCol(this, updateItems);
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
// Set value
|
|
522
|
-
if (!p.initialized) {
|
|
523
|
-
if (p.params.value) {
|
|
524
|
-
p.setValue(p.params.value, 0);
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
else {
|
|
528
|
-
if (p.value) p.setValue(p.value, 0);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
// Set flag
|
|
533
|
-
p.initialized = true;
|
|
534
|
-
|
|
535
|
-
if (p.params.onOpen) p.params.onOpen(p);
|
|
536
|
-
};
|
|
537
|
-
|
|
538
|
-
// Close
|
|
539
|
-
p.close = function () {
|
|
540
|
-
if (!p.opened || p.inline) return;
|
|
541
|
-
$.closeModal(p.container);
|
|
542
|
-
return;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
// Destroy
|
|
546
|
-
p.destroy = function () {
|
|
547
|
-
p.close();
|
|
548
|
-
if (p.params.input && p.input.length > 0) {
|
|
549
|
-
p.input.off('click', openOnInput);
|
|
550
|
-
}
|
|
551
|
-
$('html').off('click', closeOnHTMLClick);
|
|
552
|
-
$(window).off('resize', resizeCols);
|
|
553
|
-
};
|
|
554
|
-
|
|
555
|
-
if (p.inline) {
|
|
556
|
-
p.open();
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
return p;
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
$(document).on("click", ".close-picker", function() {
|
|
563
|
-
var pickerToClose = $('.picker-modal.modal-in');
|
|
564
|
-
$.closeModal(pickerToClose);
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
$.fn.picker = function(params) {
|
|
568
|
-
var args = arguments;
|
|
569
|
-
return this.each(function() {
|
|
570
|
-
if(!this) return;
|
|
571
|
-
var $this = $(this);
|
|
572
|
-
|
|
573
|
-
var picker = $this.data("picker");
|
|
574
|
-
if(!picker) {
|
|
575
|
-
var p = $.extend({
|
|
576
|
-
input: this,
|
|
577
|
-
value: $this.val() ? $this.val().split(' ') : ''
|
|
578
|
-
}, params);
|
|
579
|
-
picker = new Picker(p);
|
|
580
|
-
$this.data("picker", picker);
|
|
581
|
-
}
|
|
582
|
-
if(typeof params === typeof "a") {
|
|
583
|
-
picker[params].apply(picker, Array.prototype.slice.call(args, 1));
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
};
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
function import_datetimePicker($) {
|
|
590
|
-
"use strict";
|
|
591
|
-
|
|
592
|
-
var today = new Date();
|
|
593
|
-
|
|
594
|
-
var getDays = function(max) {
|
|
595
|
-
var days = [];
|
|
596
|
-
for (var i = 1; i <= (max || 31); i++) {
|
|
597
|
-
days.push(i < 10 ? "0" + i : i);
|
|
598
|
-
}
|
|
599
|
-
return days;
|
|
600
|
-
};
|
|
601
|
-
|
|
602
|
-
var getDaysByMonthAndYear = function(month, year) {
|
|
603
|
-
var int_d = new Date(year, parseInt(month) + 1 - 1, 1);
|
|
604
|
-
var d = new Date(int_d - 1);
|
|
605
|
-
return getDays(d.getDate());
|
|
606
|
-
};
|
|
607
|
-
|
|
608
|
-
var formatNumber = function(n) {
|
|
609
|
-
return n < 10 ? "0" + n : n;
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
var initMonthes = ('01 02 03 04 05 06 07 08 09 10 11 12').split(' ');
|
|
613
|
-
|
|
614
|
-
var initYears = (function() {
|
|
615
|
-
var arr = [];
|
|
616
|
-
for (var i = 1950; i <= 2050; i++) {
|
|
617
|
-
arr.push(i);
|
|
618
|
-
}
|
|
619
|
-
return arr;
|
|
620
|
-
})();
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
var defaults = {
|
|
624
|
-
|
|
625
|
-
rotateEffect: false, //为了性能
|
|
626
|
-
|
|
627
|
-
value: [today.getFullYear(), formatNumber(today.getMonth() + 1), formatNumber(today.getDate()), today.getHours(),
|
|
628
|
-
formatNumber(today.getMinutes())
|
|
629
|
-
],
|
|
630
|
-
|
|
631
|
-
onChange: function(picker, values, displayValues) {
|
|
632
|
-
var days = getDaysByMonthAndYear(picker.cols[1].value, picker.cols[0].value);
|
|
633
|
-
var currentValue = picker.cols[2].value;
|
|
634
|
-
if (currentValue > days.length) currentValue = days.length;
|
|
635
|
-
picker.cols[2].setValue(currentValue);
|
|
636
|
-
},
|
|
637
|
-
|
|
638
|
-
formatValue: function(p, values, displayValues) {
|
|
639
|
-
return displayValues[0] + '-' + values[1] + '-' + values[2] + ' ' + values[3] + ':' + values[4];
|
|
640
|
-
},
|
|
641
|
-
|
|
642
|
-
cols: [
|
|
643
|
-
// Years
|
|
644
|
-
{
|
|
645
|
-
values: initYears
|
|
646
|
-
},
|
|
647
|
-
// Months
|
|
648
|
-
{
|
|
649
|
-
values: initMonthes
|
|
650
|
-
},
|
|
651
|
-
// Days
|
|
652
|
-
{
|
|
653
|
-
values: getDays()
|
|
654
|
-
},
|
|
655
|
-
|
|
656
|
-
// Space divider
|
|
657
|
-
{
|
|
658
|
-
divider: true,
|
|
659
|
-
content: ' '
|
|
660
|
-
},
|
|
661
|
-
// Hours
|
|
662
|
-
{
|
|
663
|
-
values: (function() {
|
|
664
|
-
var arr = [];
|
|
665
|
-
for (var i = 0; i <= 23; i++) {
|
|
666
|
-
arr.push(i);
|
|
667
|
-
}
|
|
668
|
-
return arr;
|
|
669
|
-
})(),
|
|
670
|
-
},
|
|
671
|
-
// Divider
|
|
672
|
-
{
|
|
673
|
-
divider: true,
|
|
674
|
-
content: ':'
|
|
675
|
-
},
|
|
676
|
-
// Minutes
|
|
677
|
-
{
|
|
678
|
-
values: (function() {
|
|
679
|
-
var arr = [];
|
|
680
|
-
for (var i = 0; i <= 59; i++) {
|
|
681
|
-
arr.push(i < 10 ? '0' + i : i);
|
|
682
|
-
}
|
|
683
|
-
return arr;
|
|
684
|
-
})(),
|
|
685
|
-
}
|
|
686
|
-
]
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
$.fn.datetimePicker = function(params) {
|
|
690
|
-
return this.each(function() {
|
|
691
|
-
if (!this) return;
|
|
692
|
-
var p = $.extend(defaults, params);
|
|
693
|
-
$(this).picker(p);
|
|
694
|
-
if (params.value) $(this).val(p.formatValue(p, p.value, p.value));
|
|
695
|
-
});
|
|
696
|
-
};
|
|
697
|
-
};
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
function _defineProperty(obj, key, value) {
|
|
701
|
-
if (key in obj) {
|
|
702
|
-
Object.defineProperty(obj, key, {
|
|
703
|
-
value: value,
|
|
704
|
-
enumerable: true,
|
|
705
|
-
configurable: true,
|
|
706
|
-
writable: true
|
|
707
|
-
});
|
|
708
|
-
} else {
|
|
709
|
-
obj[key] = value;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
return obj;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
define(['jquery'], function(jquery) {
|
|
716
|
-
import_picker(jquery);
|
|
717
|
-
import_datetimePicker(jquery);
|
|
718
|
-
"use strict";
|
|
719
|
-
/* 动效API */
|
|
720
|
-
|
|
721
|
-
var _props;
|
|
722
|
-
|
|
723
|
-
function __dealCssEvent(eventNameArr, callback) {
|
|
724
|
-
var events = eventNameArr,
|
|
725
|
-
i,
|
|
726
|
-
dom = this;
|
|
727
|
-
|
|
728
|
-
function fireCallBack(e) {
|
|
729
|
-
if (e.target !== this) return;
|
|
730
|
-
callback.call(this, e);
|
|
731
|
-
|
|
732
|
-
for (i = 0; i < events.length; i++) {
|
|
733
|
-
dom.off(events[i], fireCallBack);
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
if (callback) {
|
|
738
|
-
for (i = 0; i < events.length; i++) {
|
|
739
|
-
dom.on(events[i], fireCallBack);
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
jquery.fn.dataset = function() {
|
|
745
|
-
var dataset = {},
|
|
746
|
-
ds = this[0].dataset;
|
|
747
|
-
|
|
748
|
-
for (var key in ds) {
|
|
749
|
-
var item = dataset[key] = ds[key];
|
|
750
|
-
if (item === "false") dataset[key] = false;
|
|
751
|
-
else if (item === "true") dataset[key] = true;
|
|
752
|
-
else if (parseFloat(item) === item * 1) dataset[key] = item * 1;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
return jquery.extend({}, dataset, this[0].__eleData);
|
|
756
|
-
};
|
|
757
|
-
|
|
758
|
-
jquery.fn.animationEnd = function(callback) {
|
|
759
|
-
__dealCssEvent.call(this, ["webkitAnimationEnd", "animationend"], callback);
|
|
760
|
-
|
|
761
|
-
return this;
|
|
762
|
-
};
|
|
763
|
-
|
|
764
|
-
jquery.fn.transitionEnd = function(callback) {
|
|
765
|
-
__dealCssEvent.call(this, ["webkitTransitionEnd", "transitionend"], callback);
|
|
766
|
-
|
|
767
|
-
return this;
|
|
768
|
-
};
|
|
769
|
-
|
|
770
|
-
jquery.fn.transition = function(duration) {
|
|
771
|
-
if (typeof duration !== "string") {
|
|
772
|
-
duration = duration + "ms";
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
for (var i = 0; i < this.length; i++) {
|
|
776
|
-
var elStyle = this[i].style;
|
|
777
|
-
elStyle.webkitTransitionDuration = elStyle.MozTransitionDuration = elStyle.transitionDuration = duration;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
return this;
|
|
781
|
-
};
|
|
782
|
-
|
|
783
|
-
jquery.fn.transform = function(transform) {
|
|
784
|
-
for (var i = 0; i < this.length; i++) {
|
|
785
|
-
var elStyle = this[i].style;
|
|
786
|
-
elStyle.webkitTransform = elStyle.MozTransform = elStyle.transform = transform;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
return this;
|
|
790
|
-
};
|
|
791
|
-
|
|
792
|
-
(function($) {
|
|
793
|
-
var _modalTemplateTempDiv = document.createElement("div");
|
|
794
|
-
|
|
795
|
-
$.modalStack = [];
|
|
796
|
-
|
|
797
|
-
$.modalStackClearQueue = function() {
|
|
798
|
-
if ($.modalStack.length) {
|
|
799
|
-
$.modalStack.shift()();
|
|
800
|
-
}
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
$.modal = function(params) {
|
|
804
|
-
params = params || {};
|
|
805
|
-
var modalHTML = "";
|
|
806
|
-
var buttonsHTML = "";
|
|
807
|
-
|
|
808
|
-
if (params.buttons && params.buttons.length > 0) {
|
|
809
|
-
for (var i = 0; i < params.buttons.length; i++) {
|
|
810
|
-
buttonsHTML += "<span class=\"modal-button" + (params.buttons[i].bold ? " modal-button-bold" : "") + "\">" +
|
|
811
|
-
params.buttons[i].text + "</span>";
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
var extraClass = params.extraClass || "";
|
|
816
|
-
var titleHTML = params.title ? "<div class=\"modal-title\">" + params.title + "</div>" : "";
|
|
817
|
-
var textHTML = params.text ? "<div class=\"modal-text\">" + params.text + "</div>" : "";
|
|
818
|
-
var afterTextHTML = params.afterText ? params.afterText : "";
|
|
819
|
-
var noButtons = !params.buttons || params.buttons.length === 0 ? "modal-no-buttons" : "";
|
|
820
|
-
var verticalButtons = params.verticalButtons ? "modal-buttons-vertical" : "";
|
|
821
|
-
modalHTML = "<div class=\"modal " + extraClass + " " + noButtons + "\"><div class=\"modal-inner\">" + (titleHTML +
|
|
822
|
-
textHTML + afterTextHTML) + "</div><div class=\"modal-buttons " + verticalButtons + "\">" + buttonsHTML +
|
|
823
|
-
"</div></div>";
|
|
824
|
-
_modalTemplateTempDiv.innerHTML = modalHTML;
|
|
825
|
-
var modal = $(_modalTemplateTempDiv).children();
|
|
826
|
-
$(defaults.modalContainer).append(modal[0]);
|
|
827
|
-
modal.find(".modal-button").each(function(index, el) {
|
|
828
|
-
$(el).on("click", function(e) {
|
|
829
|
-
if (params.buttons[index].close !== false) $.closeModal(modal);
|
|
830
|
-
if (params.buttons[index].onClick) params.buttons[index].onClick(modal, e);
|
|
831
|
-
if (params.onClick) params.onClick(modal, index);
|
|
832
|
-
});
|
|
833
|
-
});
|
|
834
|
-
$.openModal(modal);
|
|
835
|
-
return modal[0];
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
$.alert = function(text, title, callbackOk) {
|
|
839
|
-
if (typeof title === "function") {
|
|
840
|
-
callbackOk = arguments[1];
|
|
841
|
-
title = undefined;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
return $.modal({
|
|
845
|
-
text: text || "",
|
|
846
|
-
title: typeof title === "undefined" ? defaults.modalTitle : title,
|
|
847
|
-
buttons: [{
|
|
848
|
-
text: defaults.modalButtonOk,
|
|
849
|
-
bold: true,
|
|
850
|
-
onClick: callbackOk
|
|
851
|
-
}]
|
|
852
|
-
});
|
|
853
|
-
};
|
|
854
|
-
|
|
855
|
-
$.confirm = function(text, title, callbackOk, callbackCancel) {
|
|
856
|
-
if (typeof title === "function") {
|
|
857
|
-
callbackCancel = arguments[2];
|
|
858
|
-
callbackOk = arguments[1];
|
|
859
|
-
title = undefined;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
return $.modal({
|
|
863
|
-
text: text || "",
|
|
864
|
-
title: typeof title === "undefined" ? defaults.modalTitle : title,
|
|
865
|
-
buttons: [{
|
|
866
|
-
text: defaults.modalButtonCancel,
|
|
867
|
-
onClick: callbackCancel
|
|
868
|
-
}, {
|
|
869
|
-
text: defaults.modalButtonOk,
|
|
870
|
-
bold: true,
|
|
871
|
-
onClick: callbackOk
|
|
872
|
-
}]
|
|
873
|
-
});
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
$.prompt = function(text, title, callbackOk, callbackCancel) {
|
|
877
|
-
if (typeof title === "function") {
|
|
878
|
-
callbackCancel = arguments[2];
|
|
879
|
-
callbackOk = arguments[1];
|
|
880
|
-
title = undefined;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
return $.modal({
|
|
884
|
-
text: text || "",
|
|
885
|
-
title: typeof title === "undefined" ? defaults.modalTitle : title,
|
|
886
|
-
afterText: "<input type=\"text\" class=\"modal-text-input\">",
|
|
887
|
-
buttons: [{
|
|
888
|
-
text: defaults.modalButtonCancel
|
|
889
|
-
}, {
|
|
890
|
-
text: defaults.modalButtonOk,
|
|
891
|
-
bold: true
|
|
892
|
-
}],
|
|
893
|
-
onClick: function onClick(modal, index) {
|
|
894
|
-
if (index === 0 && callbackCancel) callbackCancel($(modal).find(".modal-text-input").val());
|
|
895
|
-
if (index === 1 && callbackOk) callbackOk($(modal).find(".modal-text-input").val());
|
|
896
|
-
}
|
|
897
|
-
});
|
|
898
|
-
};
|
|
899
|
-
|
|
900
|
-
$.modalLogin = function(text, title, callbackOk, callbackCancel) {
|
|
901
|
-
if (typeof title === "function") {
|
|
902
|
-
callbackCancel = arguments[2];
|
|
903
|
-
callbackOk = arguments[1];
|
|
904
|
-
title = undefined;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
return $.modal({
|
|
908
|
-
text: text || "",
|
|
909
|
-
title: typeof title === "undefined" ? defaults.modalTitle : title,
|
|
910
|
-
afterText: "<input type=\"text\" name=\"modal-username\" placeholder=\"" + defaults.modalUsernamePlaceholder +
|
|
911
|
-
"\" class=\"modal-text-input modal-text-input-double\"><input type=\"password\" name=\"modal-password\" placeholder=\"" +
|
|
912
|
-
defaults.modalPasswordPlaceholder + "\" class=\"modal-text-input modal-text-input-double\">",
|
|
913
|
-
buttons: [{
|
|
914
|
-
text: defaults.modalButtonCancel
|
|
915
|
-
}, {
|
|
916
|
-
text: defaults.modalButtonOk,
|
|
917
|
-
bold: true
|
|
918
|
-
}],
|
|
919
|
-
onClick: function onClick(modal, index) {
|
|
920
|
-
var username = $(modal).find(".modal-text-input[name=\"modal-username\"]").val();
|
|
921
|
-
var password = $(modal).find(".modal-text-input[name=\"modal-password\"]").val();
|
|
922
|
-
if (index === 0 && callbackCancel) callbackCancel(username, password);
|
|
923
|
-
if (index === 1 && callbackOk) callbackOk(username, password);
|
|
924
|
-
}
|
|
925
|
-
});
|
|
926
|
-
};
|
|
927
|
-
|
|
928
|
-
$.modalPassword = function(text, title, callbackOk, callbackCancel) {
|
|
929
|
-
if (typeof title === "function") {
|
|
930
|
-
callbackCancel = arguments[2];
|
|
931
|
-
callbackOk = arguments[1];
|
|
932
|
-
title = undefined;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
return $.modal({
|
|
936
|
-
text: text || "",
|
|
937
|
-
title: typeof title === "undefined" ? defaults.modalTitle : title,
|
|
938
|
-
afterText: "<input type=\"password\" name=\"modal-password\" placeholder=\"" + defaults.modalPasswordPlaceholder +
|
|
939
|
-
"\" class=\"modal-text-input\">",
|
|
940
|
-
buttons: [{
|
|
941
|
-
text: defaults.modalButtonCancel
|
|
942
|
-
}, {
|
|
943
|
-
text: defaults.modalButtonOk,
|
|
944
|
-
bold: true
|
|
945
|
-
}],
|
|
946
|
-
onClick: function onClick(modal, index) {
|
|
947
|
-
var password = $(modal).find(".modal-text-input[name=\"modal-password\"]").val();
|
|
948
|
-
if (index === 0 && callbackCancel) callbackCancel(password);
|
|
949
|
-
if (index === 1 && callbackOk) callbackOk(password);
|
|
950
|
-
}
|
|
951
|
-
});
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
$.showPreloader = function(title) {
|
|
955
|
-
$.hidePreloader();
|
|
956
|
-
$.showPreloader.preloaderModal = $.modal({
|
|
957
|
-
title: title || defaults.modalPreloaderTitle,
|
|
958
|
-
text: "<div class=\"preloader\"></div>"
|
|
959
|
-
});
|
|
960
|
-
return $.showPreloader.preloaderModal;
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
$.hidePreloader = function() {
|
|
964
|
-
$.showPreloader.preloaderModal && $.closeModal($.showPreloader.preloaderModal);
|
|
965
|
-
};
|
|
966
|
-
|
|
967
|
-
$.showIndicator = function() {
|
|
968
|
-
if ($(".preloader-indicator-modal")[0]) return;
|
|
969
|
-
$(defaults.modalContainer).append(
|
|
970
|
-
"<div class=\"preloader-indicator-overlay\"></div><div class=\"preloader-indicator-modal\"><span class=\"preloader preloader-white\"></span></div>"
|
|
971
|
-
);
|
|
972
|
-
};
|
|
973
|
-
|
|
974
|
-
$.hideIndicator = function() {
|
|
975
|
-
$(".preloader-indicator-overlay, .preloader-indicator-modal").remove();
|
|
976
|
-
};
|
|
977
|
-
|
|
978
|
-
$.showIndicatorDiy = function(htmlcontent) {
|
|
979
|
-
if ($(".preloader-indicator-modal")[0]) return;
|
|
980
|
-
$(defaults.modalContainer).append(
|
|
981
|
-
"<div class=\"preloader-indicator-overlay\"></div><div class=\"preloader-indicator-modal\">" + htmlcontent +
|
|
982
|
-
"</div>");
|
|
983
|
-
};
|
|
984
|
-
|
|
985
|
-
$.hideIndicatorDiy = function() {
|
|
986
|
-
$(".preloader-indicator-overlay, .preloader-indicator-modal").remove();
|
|
987
|
-
};
|
|
988
|
-
|
|
989
|
-
$.actions = function(params) {
|
|
990
|
-
var modal, groupSelector, buttonSelector;
|
|
991
|
-
params = params || [];
|
|
992
|
-
|
|
993
|
-
if (params.length > 0 && !$.isArray(params[0])) {
|
|
994
|
-
params = [params];
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
var modalHTML;
|
|
998
|
-
var buttonsHTML = "";
|
|
999
|
-
|
|
1000
|
-
for (var i = 0; i < params.length; i++) {
|
|
1001
|
-
for (var j = 0; j < params[i].length; j++) {
|
|
1002
|
-
if (j === 0) buttonsHTML += "<div class=\"actions-modal-group\">";
|
|
1003
|
-
var button = params[i][j];
|
|
1004
|
-
var buttonClass = button.label ? "actions-modal-label" : "actions-modal-button";
|
|
1005
|
-
if (button.bold) buttonClass += " actions-modal-button-bold";
|
|
1006
|
-
if (button.color) buttonClass += " font_" + button.color;
|
|
1007
|
-
if (button.bg) buttonClass += " bg_" + button.bg;
|
|
1008
|
-
if (button.disabled) buttonClass += " disabled";
|
|
1009
|
-
buttonsHTML += "<span class=\"" + buttonClass + "\">" + button.text + "</span>";
|
|
1010
|
-
if (j === params[i].length - 1) buttonsHTML += "</div>";
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
modalHTML = "<div class=\"actions-modal\">" + buttonsHTML + "</div>";
|
|
1015
|
-
_modalTemplateTempDiv.innerHTML = modalHTML;
|
|
1016
|
-
modal = $(_modalTemplateTempDiv).children();
|
|
1017
|
-
$(defaults.modalContainer).append(modal[0]);
|
|
1018
|
-
groupSelector = ".actions-modal-group";
|
|
1019
|
-
buttonSelector = ".actions-modal-button";
|
|
1020
|
-
var groups = modal.find(groupSelector);
|
|
1021
|
-
groups.each(function(index, el) {
|
|
1022
|
-
var groupIndex = index;
|
|
1023
|
-
$(el).children().each(function(index, el) {
|
|
1024
|
-
var buttonIndex = index;
|
|
1025
|
-
var buttonParams = params[groupIndex][buttonIndex];
|
|
1026
|
-
var clickTarget;
|
|
1027
|
-
if ($(el).is(buttonSelector)) clickTarget = $(el);
|
|
1028
|
-
|
|
1029
|
-
if (clickTarget) {
|
|
1030
|
-
clickTarget.on("click", function(e) {
|
|
1031
|
-
if (buttonParams.close !== false) $.closeModal(modal);
|
|
1032
|
-
if (buttonParams.onClick) buttonParams.onClick(modal, e);
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
});
|
|
1036
|
-
});
|
|
1037
|
-
$.openModal(modal);
|
|
1038
|
-
return modal[0];
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
$.popup = function(modal, removeOnClose) {
|
|
1042
|
-
if (typeof removeOnClose === "undefined") removeOnClose = true;
|
|
1043
|
-
|
|
1044
|
-
if (typeof modal === "string" && modal.indexOf("<") >= 0) {
|
|
1045
|
-
var _modal = document.createElement("div");
|
|
1046
|
-
|
|
1047
|
-
_modal.innerHTML = modal.trim();
|
|
1048
|
-
|
|
1049
|
-
if (_modal.childNodes.length > 0) {
|
|
1050
|
-
modal = _modal.childNodes[0];
|
|
1051
|
-
if (removeOnClose) modal.classList.add("remove-on-close");
|
|
1052
|
-
$(defaults.modalContainer).append(modal);
|
|
1053
|
-
} else return false;
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
modal = $(modal);
|
|
1057
|
-
if (modal.length === 0) return false;
|
|
1058
|
-
modal.show();
|
|
1059
|
-
modal.find(".content").scroller("refresh");
|
|
1060
|
-
|
|
1061
|
-
if (modal.find("." + defaults.viewClass).length > 0) {
|
|
1062
|
-
$.sizeNavbars(modal.find("." + defaults.viewClass)[0]);
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
$.openModal(modal);
|
|
1066
|
-
return modal[0];
|
|
1067
|
-
};
|
|
1068
|
-
|
|
1069
|
-
$.pickerModal = function(pickerModal, removeOnClose) {
|
|
1070
|
-
if (typeof removeOnClose === "undefined") removeOnClose = true;
|
|
1071
|
-
|
|
1072
|
-
if (typeof pickerModal === "string" && pickerModal.indexOf("<") >= 0) {
|
|
1073
|
-
pickerModal = $(pickerModal);
|
|
1074
|
-
|
|
1075
|
-
if (pickerModal.length > 0) {
|
|
1076
|
-
if (removeOnClose) pickerModal.addClass("remove-on-close");
|
|
1077
|
-
$(defaults.modalContainer).append(pickerModal[0]);
|
|
1078
|
-
} else return false;
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
pickerModal = $(pickerModal);
|
|
1082
|
-
if (pickerModal.length === 0) return false;
|
|
1083
|
-
pickerModal.show();
|
|
1084
|
-
$.openModal(pickerModal);
|
|
1085
|
-
return pickerModal[0];
|
|
1086
|
-
};
|
|
1087
|
-
|
|
1088
|
-
$.loginScreen = function(modal) {
|
|
1089
|
-
if (!modal) modal = ".login-screen";
|
|
1090
|
-
modal = $(modal);
|
|
1091
|
-
if (modal.length === 0) return false;
|
|
1092
|
-
modal.show();
|
|
1093
|
-
|
|
1094
|
-
if (modal.find("." + defaults.viewClass).length > 0) {
|
|
1095
|
-
$.sizeNavbars(modal.find("." + defaults.viewClass)[0]);
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
$.openModal(modal);
|
|
1099
|
-
return modal[0];
|
|
1100
|
-
};
|
|
1101
|
-
|
|
1102
|
-
$.toast = function(msg, duration, extraclass) {
|
|
1103
|
-
var $toast = $("<div class=\"modal toast " + (extraclass || "") + "\">" + msg + "</div>").appendTo(document.body);
|
|
1104
|
-
$.openModal($toast, function() {
|
|
1105
|
-
setTimeout(function() {
|
|
1106
|
-
$.closeModal($toast);
|
|
1107
|
-
}, duration || 2000);
|
|
1108
|
-
});
|
|
1109
|
-
};
|
|
1110
|
-
|
|
1111
|
-
$.openModal = function(modal, cb) {
|
|
1112
|
-
modal = $(modal);
|
|
1113
|
-
var isModal = modal.hasClass("modal"),
|
|
1114
|
-
isNotToast = !modal.hasClass("toast");
|
|
1115
|
-
|
|
1116
|
-
if ($(".modal.modal-in:not(.modal-out)").length && defaults.modalStack && isModal && isNotToast) {
|
|
1117
|
-
$.modalStack.push(function() {
|
|
1118
|
-
$.openModal(modal, cb);
|
|
1119
|
-
});
|
|
1120
|
-
return;
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
var isPopup = modal.hasClass("popup");
|
|
1124
|
-
var isLoginScreen = modal.hasClass("login-screen");
|
|
1125
|
-
var isPickerModal = modal.hasClass("picker-modal");
|
|
1126
|
-
var isToast = modal.hasClass("toast");
|
|
1127
|
-
|
|
1128
|
-
if (isModal) {
|
|
1129
|
-
modal.show();
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
var overlay;
|
|
1133
|
-
|
|
1134
|
-
if (!isLoginScreen && !isPickerModal && !isToast) {
|
|
1135
|
-
if ($(".modal-overlay").length === 0 && !isPopup) {
|
|
1136
|
-
$(defaults.modalContainer).append("<div class=\"modal-overlay\"></div>");
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
if ($(".popup-overlay").length === 0 && isPopup) {
|
|
1140
|
-
$(defaults.modalContainer).append("<div class=\"popup-overlay\"></div>");
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
overlay = isPopup ? $(".popup-overlay") : $(".modal-overlay");
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
var clientLeft = modal[0].clientLeft;
|
|
1147
|
-
modal.trigger("open");
|
|
1148
|
-
|
|
1149
|
-
if (isPickerModal) {
|
|
1150
|
-
$(defaults.modalContainer).addClass("with-picker-modal");
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
if (!isLoginScreen && !isPickerModal && !isToast) overlay.addClass("modal-overlay-visible");
|
|
1154
|
-
modal.removeClass("modal-out").addClass("modal-in").transitionEnd(function(e) {
|
|
1155
|
-
if (modal.hasClass("modal-out")) modal.trigger("closed");
|
|
1156
|
-
else modal.trigger("opened");
|
|
1157
|
-
});
|
|
1158
|
-
|
|
1159
|
-
if (typeof cb === "function") {
|
|
1160
|
-
cb.call(this);
|
|
1161
|
-
}
|
|
1162
|
-
|
|
1163
|
-
return true;
|
|
1164
|
-
};
|
|
1165
|
-
|
|
1166
|
-
$.closeModal = function(modal) {
|
|
1167
|
-
modal = $(modal || ".modal-in");
|
|
1168
|
-
|
|
1169
|
-
if (typeof modal !== "undefined" && modal.length === 0) {
|
|
1170
|
-
return;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
var isModal = modal.hasClass("modal"),
|
|
1174
|
-
isPopup = modal.hasClass("popup"),
|
|
1175
|
-
isToast = modal.hasClass("toast"),
|
|
1176
|
-
isLoginScreen = modal.hasClass("login-screen"),
|
|
1177
|
-
isPickerModal = modal.hasClass("picker-modal"),
|
|
1178
|
-
removeOnClose = modal.hasClass("remove-on-close"),
|
|
1179
|
-
overlay = isPopup ? $(".popup-overlay") : $(".modal-overlay");
|
|
1180
|
-
|
|
1181
|
-
if (isPopup) {
|
|
1182
|
-
if (modal.length === $(".popup.modal-in").length) {
|
|
1183
|
-
overlay.removeClass("modal-overlay-visible");
|
|
1184
|
-
}
|
|
1185
|
-
} else if (!(isPickerModal || isToast)) {
|
|
1186
|
-
overlay.removeClass("modal-overlay-visible");
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
modal.trigger("close");
|
|
1190
|
-
|
|
1191
|
-
if (isPickerModal) {
|
|
1192
|
-
$(defaults.modalContainer).removeClass("with-picker-modal");
|
|
1193
|
-
$(defaults.modalContainer).addClass("picker-modal-closing");
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
modal.removeClass("modal-in").addClass("modal-out").transitionEnd(function(e) {
|
|
1197
|
-
if (modal.hasClass("modal-out")) modal.trigger("closed");
|
|
1198
|
-
else modal.trigger("opened");
|
|
1199
|
-
|
|
1200
|
-
if (isPickerModal) {
|
|
1201
|
-
$(defaults.modalContainer).removeClass("picker-modal-closing");
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
if (isPopup || isLoginScreen || isPickerModal) {
|
|
1205
|
-
modal.removeClass("modal-out").hide();
|
|
1206
|
-
|
|
1207
|
-
if (removeOnClose && modal.length > 0) {
|
|
1208
|
-
modal.remove();
|
|
1209
|
-
}
|
|
1210
|
-
} else {
|
|
1211
|
-
modal.remove();
|
|
1212
|
-
}
|
|
1213
|
-
});
|
|
1214
|
-
|
|
1215
|
-
if (isModal && defaults.modalStack) {
|
|
1216
|
-
$.modalStackClearQueue();
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
return true;
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
|
-
function handleClicks(e) {
|
|
1223
|
-
var clicked = $(this);
|
|
1224
|
-
var url = clicked.attr("href");
|
|
1225
|
-
var clickedData = clicked.dataset();
|
|
1226
|
-
var popup;
|
|
1227
|
-
|
|
1228
|
-
if (clicked.hasClass("open-popup")) {
|
|
1229
|
-
if (clickedData.popup) {
|
|
1230
|
-
popup = clickedData.popup;
|
|
1231
|
-
} else popup = ".popup";
|
|
1232
|
-
|
|
1233
|
-
$.popup(popup);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
if (clicked.hasClass("close-popup")) {
|
|
1237
|
-
if (clickedData.popup) {
|
|
1238
|
-
popup = clickedData.popup;
|
|
1239
|
-
} else popup = ".popup.modal-in";
|
|
1240
|
-
|
|
1241
|
-
$.closeModal(popup);
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
if (clicked.hasClass("modal-overlay")) {
|
|
1245
|
-
if ($(".modal.modal-in").length > 0 && defaults.modalCloseByOutside) $.closeModal(".modal.modal-in");
|
|
1246
|
-
if ($(".actions-modal.modal-in").length > 0 && defaults.actionsCloseByOutside) $.closeModal(
|
|
1247
|
-
".actions-modal.modal-in");
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
if (clicked.hasClass("popup-overlay")) {
|
|
1251
|
-
if ($(".popup.modal-in").length > 0 && defaults.popupCloseByOutside) $.closeModal(".popup.modal-in");
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
$(document).on("click", " .modal-overlay, .popup-overlay, .close-popup, .open-popup, .close-picker", handleClicks);
|
|
1256
|
-
var defaults = $.modal.prototype.defaults = {
|
|
1257
|
-
modalStack: true,
|
|
1258
|
-
modalButtonOk: "确定",
|
|
1259
|
-
modalButtonCancel: "取消",
|
|
1260
|
-
modalPreloaderTitle: "加载中",
|
|
1261
|
-
modalContainer: document.body
|
|
1262
|
-
};
|
|
1263
|
-
})(jquery);
|
|
1264
|
-
/* 组件 */
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
var form_mixin = {
|
|
1268
|
-
model: {
|
|
1269
|
-
prop: 'value',
|
|
1270
|
-
event: 'input'
|
|
1271
|
-
},
|
|
1272
|
-
props: (_props = {
|
|
1273
|
-
// 宽度
|
|
1274
|
-
width: {
|
|
1275
|
-
type: String,
|
|
1276
|
-
default: ''
|
|
1277
|
-
},
|
|
1278
|
-
height: {
|
|
1279
|
-
type: String,
|
|
1280
|
-
default: ''
|
|
1281
|
-
},
|
|
1282
|
-
// 类型
|
|
1283
|
-
type: {
|
|
1284
|
-
type: String,
|
|
1285
|
-
default: 'text'
|
|
1286
|
-
},
|
|
1287
|
-
// 选项
|
|
1288
|
-
options: {
|
|
1289
|
-
type: Array,
|
|
1290
|
-
default: function _default() {
|
|
1291
|
-
return [];
|
|
1292
|
-
}
|
|
1293
|
-
},
|
|
1294
|
-
// 赋值
|
|
1295
|
-
value: {
|
|
1296
|
-
type: [String, Number, Boolean]
|
|
1297
|
-
},
|
|
1298
|
-
// 回调函数
|
|
1299
|
-
func: {
|
|
1300
|
-
type: Function,
|
|
1301
|
-
default: function _default(fun, param1, param2) {
|
|
1302
|
-
return null;
|
|
1303
|
-
}
|
|
1304
|
-
},
|
|
1305
|
-
// 显示方式
|
|
1306
|
-
display: {
|
|
1307
|
-
type: String,
|
|
1308
|
-
default: "1"
|
|
1309
|
-
},
|
|
1310
|
-
// 显示隐藏
|
|
1311
|
-
show: {
|
|
1312
|
-
type: Boolean,
|
|
1313
|
-
default: false
|
|
1314
|
-
},
|
|
1315
|
-
// 标题
|
|
1316
|
-
title: {
|
|
1317
|
-
type: String,
|
|
1318
|
-
default: ""
|
|
1319
|
-
},
|
|
1320
|
-
// 图标
|
|
1321
|
-
icon: {
|
|
1322
|
-
type: String,
|
|
1323
|
-
default: ''
|
|
1324
|
-
},
|
|
1325
|
-
// 单位
|
|
1326
|
-
unit: {
|
|
1327
|
-
type: String,
|
|
1328
|
-
default: ''
|
|
1329
|
-
},
|
|
1330
|
-
// 描述
|
|
1331
|
-
desc: {
|
|
1332
|
-
type: String,
|
|
1333
|
-
default: ""
|
|
1334
|
-
},
|
|
1335
|
-
// 错误提示
|
|
1336
|
-
tip: {
|
|
1337
|
-
type: String,
|
|
1338
|
-
default: ""
|
|
1339
|
-
},
|
|
1340
|
-
// 最小值
|
|
1341
|
-
min: {
|
|
1342
|
-
type: Number,
|
|
1343
|
-
default: 0
|
|
1344
|
-
},
|
|
1345
|
-
// 最大值
|
|
1346
|
-
max: {
|
|
1347
|
-
type: Number,
|
|
1348
|
-
default: 0
|
|
1349
|
-
},
|
|
1350
|
-
// 最小长度
|
|
1351
|
-
min_length: {
|
|
1352
|
-
type: Number,
|
|
1353
|
-
default: 0
|
|
1354
|
-
},
|
|
1355
|
-
// 最大长度
|
|
1356
|
-
max_length: {
|
|
1357
|
-
type: Number,
|
|
1358
|
-
default: 65535
|
|
1359
|
-
},
|
|
1360
|
-
// 主键
|
|
1361
|
-
field: {
|
|
1362
|
-
type: String,
|
|
1363
|
-
default: "value"
|
|
1364
|
-
}
|
|
1365
|
-
}, _defineProperty(_props, "type", {
|
|
1366
|
-
type: String,
|
|
1367
|
-
default: "text"
|
|
1368
|
-
}), _defineProperty(_props, "num", {
|
|
1369
|
-
type: Number,
|
|
1370
|
-
default: 1
|
|
1371
|
-
}), _defineProperty(_props, "text", {
|
|
1372
|
-
type: String,
|
|
1373
|
-
default: ""
|
|
1374
|
-
}), _defineProperty(_props, "disabled", {
|
|
1375
|
-
type: Boolean,
|
|
1376
|
-
default: false
|
|
1377
|
-
}), _defineProperty(_props, "url", {
|
|
1378
|
-
type: String,
|
|
1379
|
-
default: ""
|
|
1380
|
-
}), _defineProperty(_props, "user_group", {
|
|
1381
|
-
type: Array,
|
|
1382
|
-
default: function _default() {
|
|
1383
|
-
return [];
|
|
1384
|
-
}
|
|
1385
|
-
}), _defineProperty(_props, "user_admin", {
|
|
1386
|
-
type: Array,
|
|
1387
|
-
default: function _default() {
|
|
1388
|
-
return [];
|
|
1389
|
-
}
|
|
1390
|
-
}), _defineProperty(_props, "vip", {
|
|
1391
|
-
type: Number,
|
|
1392
|
-
default: 0
|
|
1393
|
-
}), _defineProperty(_props, "gm", {
|
|
1394
|
-
type: Number,
|
|
1395
|
-
default: 0
|
|
1396
|
-
}), _defineProperty(_props, "oauth", {
|
|
1397
|
-
type: Boolean,
|
|
1398
|
-
default: false
|
|
1399
|
-
}), _props),
|
|
1400
|
-
data: function data() {
|
|
1401
|
-
return {
|
|
1402
|
-
// 显示方式
|
|
1403
|
-
dy: this.display,
|
|
1404
|
-
// 显示隐藏
|
|
1405
|
-
sw: this.show,
|
|
1406
|
-
// 加载中
|
|
1407
|
-
load: this.loading,
|
|
1408
|
-
// 列表
|
|
1409
|
-
oj: this.obj,
|
|
1410
|
-
// 数量
|
|
1411
|
-
nm: this.num,
|
|
1412
|
-
// 文本
|
|
1413
|
-
txt: this.text,
|
|
1414
|
-
// 值
|
|
1415
|
-
val: this.value,
|
|
1416
|
-
// 禁用
|
|
1417
|
-
dd: this.disabled
|
|
1418
|
-
};
|
|
1419
|
-
},
|
|
1420
|
-
methods: {
|
|
1421
|
-
/// 可更改其他属性,默认绑定回调函数
|
|
1422
|
-
/// fun: 函数名
|
|
1423
|
-
/// param1: 参数1
|
|
1424
|
-
/// param2: 参数2
|
|
1425
|
-
/// param3: 参数3
|
|
1426
|
-
run: function run(fun, param1, param2, param3) {
|
|
1427
|
-
if (this.func) {
|
|
1428
|
-
return this.func(param1, param2, param3);
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
return null;
|
|
1432
|
-
},
|
|
1433
|
-
// 删除
|
|
1434
|
-
/// query: 查询条件
|
|
1435
|
-
del: function del() {
|
|
1436
|
-
var query = {};
|
|
1437
|
-
query[this.field] = this.id;
|
|
1438
|
-
this.run('del', query);
|
|
1439
|
-
},
|
|
1440
|
-
// 修改
|
|
1441
|
-
/// query: 查询条件
|
|
1442
|
-
/// obj: 修改的对象
|
|
1443
|
-
set: function set(obj) {
|
|
1444
|
-
var query = {};
|
|
1445
|
-
query[this.field] = this.id;
|
|
1446
|
-
this.run('set', query, obj);
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
};
|
|
1450
|
-
var mm_btn = {
|
|
1451
|
-
template: "<!-- \u6309\u94AE --><button :type=\"type\" class=\"mm_btn\" v-if=\"!url\" @click=\"click_down()\"><slot></slot></button><button class=\"mm_btn\" @click=\"openBrowser()\" v-else-if=\"url.indexOf('http:') === 0 || url.indexOf('https:') === 0\"><slot></slot></button><router-link class=\"mm_btn\" :to=\"url\" v-else><slot></slot></router-link>",
|
|
1452
|
-
props: {
|
|
1453
|
-
url: {
|
|
1454
|
-
type: String,
|
|
1455
|
-
default: ""
|
|
1456
|
-
},
|
|
1457
|
-
type: {
|
|
1458
|
-
type: String,
|
|
1459
|
-
default: "button"
|
|
1460
|
-
},
|
|
1461
|
-
func: {
|
|
1462
|
-
type: Function,
|
|
1463
|
-
default: function _default() {}
|
|
1464
|
-
}
|
|
1465
|
-
},
|
|
1466
|
-
methods: {
|
|
1467
|
-
openBrowser: function openBrowser() {
|
|
1468
|
-
if (window) {
|
|
1469
|
-
window.open(this.url);
|
|
1470
|
-
}
|
|
1471
|
-
},
|
|
1472
|
-
click_down: function click_down() {
|
|
1473
|
-
if (this.func) {
|
|
1474
|
-
this.func();
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
};
|
|
1479
|
-
var mm_icon = {
|
|
1480
|
-
template: "<!-- \u56FE\u6807 --><figure class=\"mm_icon\" v-if=\"src.indexOf('<') !== -1\" v-html=\"src\"></figure><figure class=\"mm_icon\" v-else-if=\"src\" :style=\"'background-image: url(' + src + ');'\"><img :src=\"src\" :alt=\"alt\" mode=\"mode\" /><figcaption><slot></slot></figcaption></figure><figure class=\"mm_icon\" v-else></figure>",
|
|
1481
|
-
props: {
|
|
1482
|
-
src: {
|
|
1483
|
-
type: String,
|
|
1484
|
-
default: ""
|
|
1485
|
-
},
|
|
1486
|
-
height: {
|
|
1487
|
-
type: String,
|
|
1488
|
-
default: ""
|
|
1489
|
-
},
|
|
1490
|
-
auto: {
|
|
1491
|
-
type: String,
|
|
1492
|
-
default: ""
|
|
1493
|
-
},
|
|
1494
|
-
alt: {
|
|
1495
|
-
type: String,
|
|
1496
|
-
default: "图片"
|
|
1497
|
-
}
|
|
1498
|
-
},
|
|
1499
|
-
data: function data() {
|
|
1500
|
-
var mode = "";
|
|
1501
|
-
|
|
1502
|
-
if (this.auto) {
|
|
1503
|
-
mode = "widthFix";
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
return {
|
|
1507
|
-
mode: mode
|
|
1508
|
-
};
|
|
1509
|
-
}
|
|
1510
|
-
};
|
|
1511
|
-
var mm_loading = {
|
|
1512
|
-
template: "<div class=\"mm_loading\"><div class=\"load\"><slot><img src=\"/img/loading.svg\" :style=\"'width:' + wh + ';height:' + ht\" v-if=\"display == '1'\" /><div class=\"progress\" :style=\"'width:' + wh + ';height:' + ht\" v-else></div></slot></div><div class=\"state\">{{ title }}<span class=\"value\" v-show=\"value\"> {{ value }}</span></div></div>",
|
|
1513
|
-
props: {
|
|
1514
|
-
value: {
|
|
1515
|
-
type: Number,
|
|
1516
|
-
default: 0
|
|
1517
|
-
},
|
|
1518
|
-
title: {
|
|
1519
|
-
type: String,
|
|
1520
|
-
default: "加载中"
|
|
1521
|
-
},
|
|
1522
|
-
width: {
|
|
1523
|
-
type: String,
|
|
1524
|
-
default: ""
|
|
1525
|
-
},
|
|
1526
|
-
height: {
|
|
1527
|
-
type: String,
|
|
1528
|
-
default: ""
|
|
1529
|
-
},
|
|
1530
|
-
display: {
|
|
1531
|
-
type: String,
|
|
1532
|
-
default: "1"
|
|
1533
|
-
}
|
|
1534
|
-
},
|
|
1535
|
-
data: function data() {
|
|
1536
|
-
var wh = "";
|
|
1537
|
-
var ht = "";
|
|
1538
|
-
|
|
1539
|
-
if (this.width) {
|
|
1540
|
-
wh = this.width;
|
|
1541
|
-
} else {
|
|
1542
|
-
if (this.display === "1") {
|
|
1543
|
-
wh = "1.5rem";
|
|
1544
|
-
} else if (this.display === "2") {
|
|
1545
|
-
wh = "100%";
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
if (this.height) {
|
|
1550
|
-
wh = this.height;
|
|
1551
|
-
} else {
|
|
1552
|
-
if (this.display === "1") {
|
|
1553
|
-
ht = "auto";
|
|
1554
|
-
} else if (this.display === "2") {
|
|
1555
|
-
ht = "4px";
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
return {
|
|
1560
|
-
ht: ht,
|
|
1561
|
-
wh: wh
|
|
1562
|
-
};
|
|
1563
|
-
}
|
|
1564
|
-
};
|
|
1565
|
-
var mm_body = {
|
|
1566
|
-
template: "<!-- \u5757\u4E3B\u4F53 --><div class=\"mm_body\"><slot></slot></div>"
|
|
1567
|
-
};
|
|
1568
|
-
var mm_col = {
|
|
1569
|
-
template: "<!-- \u683C\u5B50 --><div :class=\"'mm_col' + this.wh\"><slot></slot></div>",
|
|
1570
|
-
props: {
|
|
1571
|
-
width: {
|
|
1572
|
-
type: String,
|
|
1573
|
-
default: ""
|
|
1574
|
-
}
|
|
1575
|
-
},
|
|
1576
|
-
data: function data() {
|
|
1577
|
-
return {
|
|
1578
|
-
wh: this.width
|
|
1579
|
-
};
|
|
1580
|
-
},
|
|
1581
|
-
created: function created() {
|
|
1582
|
-
var wh = this.wh;
|
|
1583
|
-
if (wh) {
|
|
1584
|
-
if (wh.indexOf("_") == -1) {
|
|
1585
|
-
this.wh = "_" + wh;
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
}
|
|
1589
|
-
};
|
|
1590
|
-
var mm_foot = {
|
|
1591
|
-
template: "<!-- \u5757\u5C3E --><footer class=\"mm_foot\"><slot></slot></footer>"
|
|
1592
|
-
};
|
|
1593
|
-
var mm_grid = {
|
|
1594
|
-
template: "<!-- \u6805\u683C --><div :class=\"'mm_grid' + cl\"><slot></slot></div>",
|
|
1595
|
-
props: {
|
|
1596
|
-
col: {
|
|
1597
|
-
type: String,
|
|
1598
|
-
default: ""
|
|
1599
|
-
}
|
|
1600
|
-
},
|
|
1601
|
-
computed: {
|
|
1602
|
-
cl: function cl() {
|
|
1603
|
-
var cl = this.col;
|
|
1604
|
-
|
|
1605
|
-
if (cl && cl.indexOf("_") == -1) {
|
|
1606
|
-
cl = "_" + cl;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
return cl;
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
|
-
};
|
|
1613
|
-
var mm_group = {
|
|
1614
|
-
template: "<!-- \u7EC4\u5408\u6846 --><div class=\"mm_group\"><slot></slot></div>"
|
|
1615
|
-
};
|
|
1616
|
-
var mm_head = {
|
|
1617
|
-
template: "<!-- \u5757\u5934 --><header class=\"mm_head\"><slot></slot></header>"
|
|
1618
|
-
};
|
|
1619
|
-
var mm_item = {
|
|
1620
|
-
template: "<!-- \u9879\u76EE\u5757 --><div class=\"mm_item\" v-if=\"!url\"><slot></slot></div><div class=\"mm_item\" @click=\"openBrowser()\" v-else-if=\"url.indexOf('http:') === 0 || url.indexOf('https:') === 0\"><slot></slot></div><router-link class=\"mm_item\" :to=\"url\" v-else><slot></slot></router-link>",
|
|
1621
|
-
props: {
|
|
1622
|
-
url: {
|
|
1623
|
-
type: String,
|
|
1624
|
-
default: ""
|
|
1625
|
-
},
|
|
1626
|
-
type: {
|
|
1627
|
-
type: String,
|
|
1628
|
-
default: ""
|
|
1629
|
-
}
|
|
1630
|
-
},
|
|
1631
|
-
methods: {
|
|
1632
|
-
openBrowser: function openBrowser() {
|
|
1633
|
-
if (window) {
|
|
1634
|
-
window.open(this.url);
|
|
1635
|
-
}
|
|
1636
|
-
}
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
var mm_list = {
|
|
1640
|
-
template: "<!-- \u5217\u8868 --><nav :class=\"'mm_list' + cl\"><slot></slot></nav>",
|
|
1641
|
-
props: {
|
|
1642
|
-
col: {
|
|
1643
|
-
type: String,
|
|
1644
|
-
default: ""
|
|
1645
|
-
}
|
|
1646
|
-
},
|
|
1647
|
-
computed: {
|
|
1648
|
-
cl: function cl() {
|
|
1649
|
-
var cl = this.col;
|
|
1650
|
-
|
|
1651
|
-
if (cl && cl.indexOf("_") == -1) {
|
|
1652
|
-
cl = "_" + cl;
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
return cl;
|
|
1656
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
};
|
|
1659
|
-
var mm_main = {
|
|
1660
|
-
template: "<div class=\"mm_main\"><slot></slot></div>"
|
|
1661
|
-
};
|
|
1662
|
-
var mm_modal = {
|
|
1663
|
-
template: "<!-- \u6A21\u6001\u7A97 --><div class=\"mm_modal\" v-bind:class=\"{ 'show' : show }\"><div v-bind:class=\"'from_' + display\"><slot></slot></div><!-- \u906E\u7F69 --><div class=\"mask\" v-if=\"mask && mask != 'false'\" @click=\"close()\"></div></div>",
|
|
1664
|
-
props: {
|
|
1665
|
-
display: {
|
|
1666
|
-
type: String,
|
|
1667
|
-
default: "default"
|
|
1668
|
-
},
|
|
1669
|
-
show: {
|
|
1670
|
-
type: Boolean,
|
|
1671
|
-
default: false
|
|
1672
|
-
},
|
|
1673
|
-
mask: {
|
|
1674
|
-
type: String,
|
|
1675
|
-
default: ""
|
|
1676
|
-
}
|
|
1677
|
-
},
|
|
1678
|
-
model: {
|
|
1679
|
-
prop: "show",
|
|
1680
|
-
event: "input"
|
|
1681
|
-
},
|
|
1682
|
-
methods: {
|
|
1683
|
-
close: function close() {
|
|
1684
|
-
this.$emit("input", false);
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
};
|
|
1688
|
-
var mm_movable = {
|
|
1689
|
-
template: "<!-- \u62D6\u52A8\u5BB9\u5668 --><div class=\"mm_movable\"><slot></slot></div>"
|
|
1690
|
-
};
|
|
1691
|
-
var mm_page = {
|
|
1692
|
-
template: "<!-- \u9875\u9762 --><div class=\"mm_page\"><slot></slot></div>",
|
|
1693
|
-
props: {
|
|
1694
|
-
fun: {
|
|
1695
|
-
type: Function,
|
|
1696
|
-
default: function _default() {}
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
};
|
|
1700
|
-
var mm_view = {
|
|
1701
|
-
template: "<!-- \u5757 --><div class=\"mm_view\" v-if=\"!url\"><slot></slot></div><div class=\"mm_view\" @click=\"openBrowser()\" v-else-if=\"url.indexOf('http:') === 0 || url.indexOf('https:') === 0\"><slot></slot></div><router-link class=\"mm_view\" :to=\"url\" v-else><slot></slot></router-link>",
|
|
1702
|
-
props: {
|
|
1703
|
-
url: {
|
|
1704
|
-
type: String,
|
|
1705
|
-
default: ""
|
|
1706
|
-
},
|
|
1707
|
-
type: {
|
|
1708
|
-
type: String,
|
|
1709
|
-
default: ""
|
|
1710
|
-
}
|
|
1711
|
-
},
|
|
1712
|
-
methods: {
|
|
1713
|
-
openBrowser: function openBrowser() {
|
|
1714
|
-
if (window) {
|
|
1715
|
-
window.open(this.url);
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
};
|
|
1720
|
-
|
|
1721
|
-
function bindResize(tag, target, func) {
|
|
1722
|
-
var width_init = $(target).width();
|
|
1723
|
-
var el = $(tag);
|
|
1724
|
-
var x = 0;
|
|
1725
|
-
var y = 0;
|
|
1726
|
-
el.mousedown(function(e) {
|
|
1727
|
-
x = e.clientX - el.offset().left;
|
|
1728
|
-
el.setCapture ? (el.setCapture(), el.onmousemove = function(ev) {
|
|
1729
|
-
mouseMove(ev || event);
|
|
1730
|
-
}, el.onmouseup = mouseUp) : $(document).bind("mousemove", mouseMove).bind("mouseup", mouseUp);
|
|
1731
|
-
e.preventDefault();
|
|
1732
|
-
});
|
|
1733
|
-
|
|
1734
|
-
function mouseMove(e) {
|
|
1735
|
-
var width = e.clientX - x;
|
|
1736
|
-
|
|
1737
|
-
if (width >= width_init) {
|
|
1738
|
-
$(target).width(width + "px");
|
|
1739
|
-
|
|
1740
|
-
if (func) {
|
|
1741
|
-
func(width);
|
|
1742
|
-
}
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
function mouseUp() {
|
|
1747
|
-
el.releaseCapture ? (el.releaseCapture(), el.onmousemove = el.onmouseup = null) : $(document).unbind("mousemove",
|
|
1748
|
-
mouseMove).unbind("mouseup", mouseUp);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
var mm_side = {
|
|
1753
|
-
template: "<div class=\"mm_side\" :id=\"side_id\"><slot></slot><div class=\"line\"></div></div>",
|
|
1754
|
-
props: {
|
|
1755
|
-
id: {
|
|
1756
|
-
type: String,
|
|
1757
|
-
default: ""
|
|
1758
|
-
},
|
|
1759
|
-
func: {
|
|
1760
|
-
type: Function,
|
|
1761
|
-
default: function _default(width) {}
|
|
1762
|
-
}
|
|
1763
|
-
},
|
|
1764
|
-
data: function data() {
|
|
1765
|
-
var id = this.id;
|
|
1766
|
-
|
|
1767
|
-
if (!id) {
|
|
1768
|
-
id = "mm_side" + parseInt(Math.random() * 1000 + 1, 10);
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
return {
|
|
1772
|
-
side_id: id
|
|
1773
|
-
};
|
|
1774
|
-
},
|
|
1775
|
-
mounted: function mounted() {
|
|
1776
|
-
var target = "#" + this.id;
|
|
1777
|
-
bindResize(target + " .line", target, this.func);
|
|
1778
|
-
}
|
|
1779
|
-
};
|
|
1780
|
-
var mm_table = {
|
|
1781
|
-
template: "<div :class=\"'mm_table_' + type\"><table><slot></slot></table></div>",
|
|
1782
|
-
props: {
|
|
1783
|
-
type: {
|
|
1784
|
-
type: String,
|
|
1785
|
-
default: "1"
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
};
|
|
1789
|
-
var mm_warp = {
|
|
1790
|
-
template: "<!-- \u9875\u5916\u5957 --><div class=\"mm_warp\"><slot></slot></div>"
|
|
1791
|
-
};
|
|
1792
|
-
var mm_checkbox = {
|
|
1793
|
-
template: "<!-- \u590D\u9009\u6846 --><div class=\"mm_checkbox\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><label v-for=\"(o, idx) in options\" :key=\"idx\" :class=\"{ 'active': has(o[field]), 'disabled': o.disabled }\" @click=\"selected(o[field])\"><span class=\"figure\"></span><span class=\"name\">{{ o.name }}</span></label></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
1794
|
-
mixins: [form_mixin],
|
|
1795
|
-
methods: {
|
|
1796
|
-
selected: function selected(val) {
|
|
1797
|
-
var arr = this.value.split(",");
|
|
1798
|
-
var idx = arr.indexOf(val);
|
|
1799
|
-
|
|
1800
|
-
if (idx !== -1) {
|
|
1801
|
-
arr.splice(idx, 1);
|
|
1802
|
-
} else {
|
|
1803
|
-
arr.push(val);
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
var val = arr.join(",");
|
|
1807
|
-
|
|
1808
|
-
if (val.indexOf(",") === 0) {
|
|
1809
|
-
val = val.substring(1);
|
|
1810
|
-
}
|
|
1811
|
-
|
|
1812
|
-
this.$emit("input", val);
|
|
1813
|
-
},
|
|
1814
|
-
has: function has(val) {
|
|
1815
|
-
var arr = this.value.split(",");
|
|
1816
|
-
return arr.indexOf(val) !== -1;
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
};
|
|
1820
|
-
var mm_code = {
|
|
1821
|
-
template: "<!-- \u9A8C\u8BC1\u7801 --><div class=\"mm_code\"><mm_icon :icon=\"icon\"></mm_icon><div class=\"title\" v-if=\"title\">{{ title }}</div><slot><mm_group><input type=\"text\" :value=\"value\" :placeholder=\"desc || placeholder\" @input=\"$emit('input', $event.target.value)\"></input><button :class=\"'btn-' + type\" v-html=\"btn\"></button></mm_group></slot><div class=\"tip\" v-if=\"tip\" v-html=\"tip\"></div></div>",
|
|
1822
|
-
mixins: [form_mixin],
|
|
1823
|
-
props: {
|
|
1824
|
-
placeholder: {
|
|
1825
|
-
type: String
|
|
1826
|
-
}
|
|
1827
|
-
},
|
|
1828
|
-
props: {
|
|
1829
|
-
btn: {
|
|
1830
|
-
type: String,
|
|
1831
|
-
default: "发送验证码"
|
|
1832
|
-
}
|
|
1833
|
-
},
|
|
1834
|
-
computed: {
|
|
1835
|
-
ds: function ds() {
|
|
1836
|
-
if (this.btn.indexOf("s") == -1) {
|
|
1837
|
-
return false;
|
|
1838
|
-
} else {
|
|
1839
|
-
return true;
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
};
|
|
1844
|
-
|
|
1845
|
-
var mm_input = {
|
|
1846
|
-
template: "<!-- \u8F93\u5165\u6846 --><div class=\"mm_input\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><input :type=\"type\" :value=\"value\" :min=\"min\" :max=\"max\" :minlength=\"min_length\" :maxlength=\"max_length\" :placeholder=\"desc || placeholder\" @input=\"set\" :disabled=\"disabled\" :required=\"required\" @blur=\"$emit('blur')\" /><slot><span class=\"unit\" v-if=\"unit\">{{ unit }}</span></slot></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
1847
|
-
mixins: [form_mixin],
|
|
1848
|
-
props: {
|
|
1849
|
-
placeholder: {
|
|
1850
|
-
type: String
|
|
1851
|
-
},
|
|
1852
|
-
required: {
|
|
1853
|
-
type: Boolean,
|
|
1854
|
-
default: false
|
|
1855
|
-
}
|
|
1856
|
-
},
|
|
1857
|
-
methods: {
|
|
1858
|
-
set: function set(e) {
|
|
1859
|
-
if (this.type === "number") {
|
|
1860
|
-
var value = e.target.value ? e.target.value : "0";
|
|
1861
|
-
|
|
1862
|
-
if (value.length > this.max_length && this.max_length !== 0) {
|
|
1863
|
-
value = value.substring(0, this.max_length);
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
var num = Number(value);
|
|
1867
|
-
|
|
1868
|
-
if (num > this.max && this.max !== 0) {
|
|
1869
|
-
num = this.max;
|
|
1870
|
-
} else if (num < this.min) {
|
|
1871
|
-
num = this.min;
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
e.target.value = num.toString();
|
|
1875
|
-
this.$emit("input", num);
|
|
1876
|
-
} else {
|
|
1877
|
-
this.$emit("input", e.target.value);
|
|
1878
|
-
}
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
};
|
|
1882
|
-
var mm_number = {
|
|
1883
|
-
template: "<!-- \u6570\u5B57\u6846 --><div class=\"mm_number\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><mm_btn class=\"btn_primary btn_del\" @click.native=\"del\"><span></span></mm_btn><input type=\"number\" :value.number=\"value\" :min=\"min\" :max=\"max\" @input=\"set\" @blur=\"setInt\" :disabled=\"disabled\"/><mm_btn class=\"btn_primary btn_add\" @click.native=\"add\"><span></span></mm_btn></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
1884
|
-
mixins: [form_mixin],
|
|
1885
|
-
methods: {
|
|
1886
|
-
setInt: function setInt(e) {
|
|
1887
|
-
var value = e.target.value ? e.target.value : "0";
|
|
1888
|
-
var num = Number(value);
|
|
1889
|
-
this.call(num);
|
|
1890
|
-
},
|
|
1891
|
-
add: function add() {
|
|
1892
|
-
this.call(this.value + this.num);
|
|
1893
|
-
},
|
|
1894
|
-
del: function del() {
|
|
1895
|
-
this.call(this.value - this.num);
|
|
1896
|
-
},
|
|
1897
|
-
set: function set(e) {
|
|
1898
|
-
var value = e.target.value ? e.target.value : "0";
|
|
1899
|
-
if(value == '-' || value.endsWith('.')){
|
|
1900
|
-
|
|
1901
|
-
}
|
|
1902
|
-
else if(value == '0-'){
|
|
1903
|
-
e.target.value = '-';
|
|
1904
|
-
}
|
|
1905
|
-
else {
|
|
1906
|
-
var num = Number(value);
|
|
1907
|
-
e.target.value = this.call(num);
|
|
1908
|
-
}
|
|
1909
|
-
},
|
|
1910
|
-
call: function call(num) {
|
|
1911
|
-
if (num > this.max && this.max !== 0) {
|
|
1912
|
-
num = this.max;
|
|
1913
|
-
} else if (num < this.min) {
|
|
1914
|
-
num = this.min;
|
|
1915
|
-
}
|
|
1916
|
-
this.$emit("input", num);
|
|
1917
|
-
return num;
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
};
|
|
1921
|
-
var mm_pager = {
|
|
1922
|
-
template: "<!-- \u5206\u9875\u5668 --><div class=\"mm_pager\"><nav><a href=\"javascript:void(0);\" v-if=\"display === '2'\" class=\"first\" @click=\"first\" v-bind:class=\"{ 'disabled': page === 1 }\"><span v-html=\"icons[0]\"></span></a><a href=\"javascript:void(0);\" class=\"previous\" @click=\"previous\" v-bind:class=\"{ 'disabled' : page <= 1 }\"><span v-html=\"icons[1]\"></span></a><a href=\"javascript:void(0);\" v-for=\"(p, i) in pages\" :key=\"i\" v-bind:class=\"{'active': page == p }\" @click=\"set(p)\">{{ p }}</a><a href=\"javascript:void(0);\" class=\"next\" v-bind:class=\"{ 'disabled': page >= ct }\" @click=\"next\"><span v-html=\"icons[2]\"></span></a><a href=\"javascript:void(0);\" v-if=\"display === '2'\" class=\"last\" v-bind:class=\"{ 'disabled': page == ct }\" @click=\"last\"><span v-html=\"icons[3]\"></span></a></nav><slot></slot></div>",
|
|
1923
|
-
model: {
|
|
1924
|
-
prop: "page",
|
|
1925
|
-
event: "input"
|
|
1926
|
-
},
|
|
1927
|
-
props: {
|
|
1928
|
-
display: {
|
|
1929
|
-
type: String,
|
|
1930
|
-
default: "1"
|
|
1931
|
-
},
|
|
1932
|
-
count: {
|
|
1933
|
-
type: Number,
|
|
1934
|
-
default: 1
|
|
1935
|
-
},
|
|
1936
|
-
num: {
|
|
1937
|
-
type: Number,
|
|
1938
|
-
default: 5
|
|
1939
|
-
},
|
|
1940
|
-
page: {
|
|
1941
|
-
type: Number,
|
|
1942
|
-
default: 1
|
|
1943
|
-
},
|
|
1944
|
-
func: {
|
|
1945
|
-
type: Function,
|
|
1946
|
-
default: function _default(page) {}
|
|
1947
|
-
},
|
|
1948
|
-
icons: {
|
|
1949
|
-
type: Array,
|
|
1950
|
-
default: function _default() {
|
|
1951
|
-
return ["<<", "<", ">", ">>"];
|
|
1952
|
-
}
|
|
1953
|
-
}
|
|
1954
|
-
},
|
|
1955
|
-
data: function data() {
|
|
1956
|
-
return {
|
|
1957
|
-
pe: this.page
|
|
1958
|
-
};
|
|
1959
|
-
},
|
|
1960
|
-
computed: {
|
|
1961
|
-
ct: function ct() {
|
|
1962
|
-
var c = this.count ? this.count : 1;
|
|
1963
|
-
return Math.ceil(c);
|
|
1964
|
-
},
|
|
1965
|
-
pages: function pages() {
|
|
1966
|
-
var pe = this.page;
|
|
1967
|
-
var arr = [pe];
|
|
1968
|
-
var len = this.num;
|
|
1969
|
-
var end = this.ct;
|
|
1970
|
-
|
|
1971
|
-
for (var i = 0; i < len; i++) {
|
|
1972
|
-
var right = pe + i + 1;
|
|
1973
|
-
|
|
1974
|
-
if (right <= end) {
|
|
1975
|
-
arr.push(right);
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
|
-
var left = pe - i - 1;
|
|
1979
|
-
|
|
1980
|
-
if (left > 0) {
|
|
1981
|
-
arr.push(left);
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
return arr.splice(0, len).sort(function(a, b) {
|
|
1986
|
-
return a - b;
|
|
1987
|
-
});
|
|
1988
|
-
}
|
|
1989
|
-
},
|
|
1990
|
-
methods: {
|
|
1991
|
-
goTo: function goTo(page) {
|
|
1992
|
-
if (this.func) {
|
|
1993
|
-
this.func(page);
|
|
1994
|
-
}
|
|
1995
|
-
this.$emit("input", page);
|
|
1996
|
-
},
|
|
1997
|
-
first: function first() {
|
|
1998
|
-
this.pe = 1;
|
|
1999
|
-
this.goTo(this.pe);
|
|
2000
|
-
},
|
|
2001
|
-
previous: function previous() {
|
|
2002
|
-
this.pe = this.page - 1;
|
|
2003
|
-
|
|
2004
|
-
if (this.pe < 1) {
|
|
2005
|
-
this.pe = 1;
|
|
2006
|
-
}
|
|
2007
|
-
this.goTo(this.pe);
|
|
2008
|
-
},
|
|
2009
|
-
set: function set(p) {
|
|
2010
|
-
this.pe = p;
|
|
2011
|
-
this.goTo(this.pe);
|
|
2012
|
-
},
|
|
2013
|
-
next: function next() {
|
|
2014
|
-
this.pe = this.page + 1;
|
|
2015
|
-
if (this.pe > this.ct) {
|
|
2016
|
-
this.pe = this.ct;
|
|
2017
|
-
}
|
|
2018
|
-
this.goTo(this.pe);
|
|
2019
|
-
},
|
|
2020
|
-
last: function last() {
|
|
2021
|
-
this.pe = this.ct;
|
|
2022
|
-
this.goTo(this.pe);
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
|
-
};
|
|
2026
|
-
var mm_radio = {
|
|
2027
|
-
template: "<!-- \u5355\u9009\u6846 --><div class=\"mm_radio\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><label v-for=\"(o, idx) in options\" :key=\"idx\" :class=\"{ 'active': value == o[field] }\" @click=\"$emit('input', $event.target.value)\"><input type=\"radio\" :name=\"name\" :value=\"o[field]\" /><span class=\"figure\"></span><span class=\"name\">{{ o.name }}</span></label></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
2028
|
-
mixins: [form_mixin],
|
|
2029
|
-
data: function data() {
|
|
2030
|
-
var name = this.name;
|
|
2031
|
-
|
|
2032
|
-
if (!name) {
|
|
2033
|
-
name = $.md5(Math.random().toString()).substring(0, 8);
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
return {
|
|
2037
|
-
name: name
|
|
2038
|
-
};
|
|
2039
|
-
}
|
|
2040
|
-
};
|
|
2041
|
-
var mm_reverse = {
|
|
2042
|
-
template: "<div class=\"mm_reverse\"><div class=\"title\" v-if=\"title\" v-html=\"title\" @click=\"set\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><slot><div class=\"figure\" v-bind:class=\"{ 'reverse_arrow' : display !== '1' }\" @click=\"set\"><span class=\"up\" v-bind:class=\"{'active': selected === 0 }\"></span><span class=\"down\" v-bind:class=\"{'active': selected === 1 }\"></span></div></slot></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
2043
|
-
mixins: [form_mixin],
|
|
2044
|
-
methods: {
|
|
2045
|
-
set: function set() {
|
|
2046
|
-
var n = this.selected;
|
|
2047
|
-
n += 1;
|
|
2048
|
-
var lt = this.ops;
|
|
2049
|
-
var v = "";
|
|
2050
|
-
|
|
2051
|
-
if (n < lt.length) {
|
|
2052
|
-
v = lt[n];
|
|
2053
|
-
} else if (n > lt.length) {
|
|
2054
|
-
n = 0;
|
|
2055
|
-
v = lt[0];
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
var val = this.value;
|
|
2059
|
-
var has = false;
|
|
2060
|
-
|
|
2061
|
-
for (var i = 0; i < lt.length; i++) {
|
|
2062
|
-
var o = lt[i];
|
|
2063
|
-
|
|
2064
|
-
if (val.indexOf(o) !== -1) {
|
|
2065
|
-
val = val.replace(o, v);
|
|
2066
|
-
has = true;
|
|
2067
|
-
val = val.replace(",,", ",");
|
|
2068
|
-
break;
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
if (!has) {
|
|
2073
|
-
val += "," + v;
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
if (val.indexOf(",") === 0) {
|
|
2077
|
-
val = val.substring(1);
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
this.$emit("input", val.trim(','));
|
|
2081
|
-
|
|
2082
|
-
if (this.func) {
|
|
2083
|
-
this.func(val);
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
},
|
|
2087
|
-
computed: {
|
|
2088
|
-
ops: function ops() {
|
|
2089
|
-
var o = this.options;
|
|
2090
|
-
if (o) {
|
|
2091
|
-
if (typeof(o) === 'string') {
|
|
2092
|
-
return ["`" + o + "` asc", "`" + o + "` desc"]
|
|
2093
|
-
} else if (typeof(o) === 'object' && o.length > 1) {
|
|
2094
|
-
return o;
|
|
2095
|
-
} else if (this.field) {
|
|
2096
|
-
var f = this.field;
|
|
2097
|
-
return ["`" + f + "` asc", "`" + f + "` desc"]
|
|
2098
|
-
}
|
|
2099
|
-
}
|
|
2100
|
-
return ["asc", "desc"]
|
|
2101
|
-
},
|
|
2102
|
-
selected: function selected() {
|
|
2103
|
-
if (this.ops) {
|
|
2104
|
-
var lt = this.ops;
|
|
2105
|
-
var val = this.value;
|
|
2106
|
-
var selected = 2;
|
|
2107
|
-
|
|
2108
|
-
for (var i = 0; i < lt.length; i++) {
|
|
2109
|
-
var o = lt[i];
|
|
2110
|
-
|
|
2111
|
-
if (val.indexOf(o) !== -1) {
|
|
2112
|
-
selected = i;
|
|
2113
|
-
break;
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
return selected;
|
|
2118
|
-
} else {
|
|
2119
|
-
return 0;
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
}
|
|
2123
|
-
};
|
|
2124
|
-
var mm_select = {
|
|
2125
|
-
template: "<!-- \u9009\u62E9\u6846 --><div class=\"mm_select\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><select v-if=\"type === 'text'\" :value=\"value\" @change=\"set\" :disabled=\"disabled\"><option v-for=\"(o, idx) in options\" :key=\"idx\" :value=\"o[field]\">{{ o.name }}</option></select><select v-else-if=\"type === 'multiple'\" :value=\"value\" @change=\"set\" :disabled=\"disabled\" multiple><option v-for=\"(o, idx) in options\" :key=\"idx\" :value=\"o[field]\">{{ o.name }}</option></select><a href=\"javascript:void(0)\" class=\"click\" v-else-if=\"type === 'click'\" v-bind:class=\"{ 'current': sw }\"><div :class=\"{'selected': !$slots.default}\" @click=\"sw = !sw\"><slot>{{ val_name }}</slot></div><div class=\"mm_box\"><ul><li v-for=\"(o, idx) in options\" :key=\"idx\" @click=\"click_fun(o[field]);sw = false\" :class=\"{ 'active': value === o[field] }\">{{ o.name }}</li></ul></div></a><a href=\"javascript:void(0)\" v-bind:class=\"type\" v-else><div class=\"selected\"><slot>{{ val_name }}</slot></div><div class=\"mm_box\"><ul><li v-for=\"(o, idx) in options\" :key=\"idx\" @click=\"click_fun(o[field])\" :class=\"{ 'active': value === o[field] }\">{{ o.name }}</li></ul></div></a></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
2126
|
-
mixins: [form_mixin],
|
|
2127
|
-
methods: {
|
|
2128
|
-
set: function set(e) {
|
|
2129
|
-
var value = e.target.value;
|
|
2130
|
-
this.$emit("input", value);
|
|
2131
|
-
if (this.value !== value) {
|
|
2132
|
-
this.$emit("change");
|
|
2133
|
-
}
|
|
2134
|
-
},
|
|
2135
|
-
click_fun: function click_fun(value) {
|
|
2136
|
-
this.$emit("input", value);
|
|
2137
|
-
this.func(value);
|
|
2138
|
-
}
|
|
2139
|
-
},
|
|
2140
|
-
computed: {
|
|
2141
|
-
val_name: function val_name() {
|
|
2142
|
-
var k = this.field;
|
|
2143
|
-
var v = this.value;
|
|
2144
|
-
var lt = this.options;
|
|
2145
|
-
var name = "";
|
|
2146
|
-
|
|
2147
|
-
for (var i = 0; i < lt.length; i++) {
|
|
2148
|
-
var o = lt[i];
|
|
2149
|
-
|
|
2150
|
-
if (o[k] === v) {
|
|
2151
|
-
name = o.name;
|
|
2152
|
-
break;
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
return name;
|
|
2157
|
-
}
|
|
2158
|
-
}
|
|
2159
|
-
};
|
|
2160
|
-
var mm_switch = {
|
|
2161
|
-
template: "<!-- \u5F00\u5173 --><div class=\"mm_switch\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><label :class=\"{ 'active': value === 1 }\" @click=\"set\"><div class=\"onoff\"><span class=\"on\" v-if=\"display === '1'\"></span><span class=\"off\" v-if=\"display === '1'\"></span></div></label></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
2162
|
-
mixins: [form_mixin],
|
|
2163
|
-
methods: {
|
|
2164
|
-
set: function set() {
|
|
2165
|
-
var val = 0;
|
|
2166
|
-
|
|
2167
|
-
if (this.value === 0) {
|
|
2168
|
-
val = 1;
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
this.$emit("input", val);
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
};
|
|
2175
|
-
var mm_nav = {
|
|
2176
|
-
template: "<nav class=\"mm_nav\"><ul><li v-for=\"(o, index) in list\" :key=\"index\"><a :href=\"o.url\" v-if=\"o.url.indexOf('http:') === 0 || o.url.indexOf('https:') === 0\">{{ o.title }}<span class=\"message\" v-show=\"o.message > 0\">{{ o.message }}</span></a><router-link :to=\"o.url\" v-else>{{ o.title }}<span class=\"message\" v-show=\"o.message > 0\">{{ o.message }}</span></router-link></li></ul></nav>",
|
|
2177
|
-
props: {
|
|
2178
|
-
list: {
|
|
2179
|
-
type: Array,
|
|
2180
|
-
default: function _default() {
|
|
2181
|
-
return [];
|
|
2182
|
-
}
|
|
2183
|
-
},
|
|
2184
|
-
vm: {
|
|
2185
|
-
type: Object,
|
|
2186
|
-
default: function _default() {
|
|
2187
|
-
return {
|
|
2188
|
-
icon: "icon",
|
|
2189
|
-
title: "title",
|
|
2190
|
-
desc: "desc",
|
|
2191
|
-
url: "url",
|
|
2192
|
-
name: "name",
|
|
2193
|
-
tip: "tip"
|
|
2194
|
-
};
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
};
|
|
2199
|
-
|
|
2200
|
-
var mm_title = {
|
|
2201
|
-
template: "<div class=\"mm_title\"><slot></slot></div>",
|
|
2202
|
-
props: {}
|
|
2203
|
-
};
|
|
2204
|
-
var mm_content = {
|
|
2205
|
-
template: "<div class=\"mm_content\"><slot></slot></div>",
|
|
2206
|
-
props: {}
|
|
2207
|
-
};
|
|
2208
|
-
var mm_form = {
|
|
2209
|
-
template: "<form class=\"mm_form\"><slot></slot></form>",
|
|
2210
|
-
props: {}
|
|
2211
|
-
};
|
|
2212
|
-
|
|
2213
|
-
var mm_upload_img = {
|
|
2214
|
-
template: "<!-- \u56FE\u7247\u4E0A\u4F20\u5668 --><div class=\"mm_upload_img\" v-bind:class=\"{ 'upload_add': !bg && !value }\">\t<div @click=\"choose()\"><mm_icon :src=\"value\" :style=\"'width:' + width + other\"></mm_icon>\t<slot></slot>\t<input type=\"file\" hidden @change=\"addImg\" :id=\"name\" accept=\"image/*\"/></div><div class=\"btns\"><mm_btn class='btn_default-x btn_link' v-if=\"value\" @click.native=\"preview = true\">预览</mm_btn><mm_btn class='btn_warning-x btn_link' v-if=\"value\" @click.native=\"$emit('input','')\">删除</mm_btn></div><mm_modal v-model=\"preview\" mask=\"true\"><div><img :src=\"value\" style=\"max-width:100%\" :alt=\"name\" /></div><mm_btn class=\"btn_close\" @click.native=\"preview = false\"><i class=\"fa-close\"></i></mm_btn></mm_modal></div>",
|
|
2215
|
-
model: {
|
|
2216
|
-
prop: 'value',
|
|
2217
|
-
event: 'input'
|
|
2218
|
-
},
|
|
2219
|
-
props: {
|
|
2220
|
-
name: {
|
|
2221
|
-
type: String,
|
|
2222
|
-
required: true
|
|
2223
|
-
},
|
|
2224
|
-
value: {
|
|
2225
|
-
type: String,
|
|
2226
|
-
default: ''
|
|
2227
|
-
},
|
|
2228
|
-
// 显示方式
|
|
2229
|
-
display: {
|
|
2230
|
-
type: String,
|
|
2231
|
-
default: '1'
|
|
2232
|
-
},
|
|
2233
|
-
// 显示隐藏
|
|
2234
|
-
show: {
|
|
2235
|
-
type: Boolean,
|
|
2236
|
-
default: false
|
|
2237
|
-
},
|
|
2238
|
-
func: {
|
|
2239
|
-
type: Function,
|
|
2240
|
-
default: function _default(obj) {}
|
|
2241
|
-
},
|
|
2242
|
-
width: {
|
|
2243
|
-
type: String,
|
|
2244
|
-
default: '5rem'
|
|
2245
|
-
},
|
|
2246
|
-
height: {
|
|
2247
|
-
type: String,
|
|
2248
|
-
default: ''
|
|
2249
|
-
},
|
|
2250
|
-
bg: {
|
|
2251
|
-
type: String,
|
|
2252
|
-
default: ''
|
|
2253
|
-
}
|
|
2254
|
-
},
|
|
2255
|
-
data: function data() {
|
|
2256
|
-
var other = this.bg ? '; background: url(' + this.bg + ') center center no-repeat; background-size:100%' : '';
|
|
2257
|
-
|
|
2258
|
-
if (this.height) {
|
|
2259
|
-
other += ';height:' + this.height;
|
|
2260
|
-
}
|
|
2261
|
-
|
|
2262
|
-
return {
|
|
2263
|
-
other: other,
|
|
2264
|
-
preview: false
|
|
2265
|
-
};
|
|
2266
|
-
},
|
|
2267
|
-
methods: {
|
|
2268
|
-
choose: function choose() {
|
|
2269
|
-
this.$('.mm_upload_img #' + this.name).click();
|
|
2270
|
-
},
|
|
2271
|
-
addImg: function addImg(e) {
|
|
2272
|
-
var _this = this;
|
|
2273
|
-
|
|
2274
|
-
var src,
|
|
2275
|
-
url = window.URL || window.webkitURL || window.mozURL,
|
|
2276
|
-
files = e.target.files;
|
|
2277
|
-
|
|
2278
|
-
if (files.length > 0) {
|
|
2279
|
-
var file = files[0];
|
|
2280
|
-
var reader = new FileReader();
|
|
2281
|
-
reader.readAsDataURL(file);
|
|
2282
|
-
|
|
2283
|
-
reader.onload = function(e) {
|
|
2284
|
-
src = this.result;
|
|
2285
|
-
|
|
2286
|
-
_this.$emit('input', src);
|
|
2287
|
-
|
|
2288
|
-
if (_this.func) {
|
|
2289
|
-
_this.func(src, file);
|
|
2290
|
-
}
|
|
2291
|
-
};
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
};
|
|
2296
|
-
|
|
2297
|
-
var mm_time = {
|
|
2298
|
-
template: "<!-- \u65F6\u95F4\u8F93\u5165\u6846 --><div class=\"mm_time\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><input :type=\"type || 'datetime'\" :value=\"value\" @blur=\"set\" :disabled=\"disabled\"></select></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
2299
|
-
mixins: [form_mixin],
|
|
2300
|
-
methods: {
|
|
2301
|
-
set: function set(e) {
|
|
2302
|
-
this.$emit("input", e.target.value);
|
|
2303
|
-
}
|
|
2304
|
-
},
|
|
2305
|
-
watch: {
|
|
2306
|
-
value: function value(e){
|
|
2307
|
-
if(this.type === 'date'){
|
|
2308
|
-
this.$emit("input", new Date(this.value).toStr('yyyy-MM-dd'));
|
|
2309
|
-
}
|
|
2310
|
-
else if(this.type === 'datetime-local'){
|
|
2311
|
-
this.$emit("input", new Date(this.value).toStr('yyyy-MM-ddThh:mm:ss'));
|
|
2312
|
-
}
|
|
2313
|
-
else if(this.value.indexOf('Z') !== -1){
|
|
2314
|
-
this.$emit("input", new Date(this.value).toStr('yyyy-MM-ddThh:mm'));
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
};
|
|
2319
|
-
|
|
2320
|
-
var mm_textarea = {
|
|
2321
|
-
template: "<!-- \u65F6\u95F4\u8F93\u5165\u6846 --><div class=\"mm_textarea\"><div class=\"title\" v-if=\"title\" v-html=\"title\"></div><div class=\"value\" v-bind:class=\"{'disabled': disabled }\"><textarea :value=\"value\" @blur=\"set\" :disabled=\"disabled\" :placeholder=\"desc || placeholder\" v-if=\"type == 'text'\"></textarea></div><div class=\"tip\" v-if=\"tip\">{{ tip }}</div></div>",
|
|
2322
|
-
mixins: [form_mixin],
|
|
2323
|
-
props: {
|
|
2324
|
-
placeholder: {
|
|
2325
|
-
type: String
|
|
2326
|
-
}
|
|
2327
|
-
},
|
|
2328
|
-
methods: {
|
|
2329
|
-
set: function set(e) {
|
|
2330
|
-
this.$emit("input", e.target.value);
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
};
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
return {
|
|
2337
|
-
install: function install(Vue, options) {
|
|
2338
|
-
Vue.component("mm_icon", mm_icon);
|
|
2339
|
-
Vue.component("mm_btn", mm_btn);
|
|
2340
|
-
Vue.component("mm_loading", mm_loading);
|
|
2341
|
-
Vue.component("mm_body", mm_body);
|
|
2342
|
-
Vue.component("mm_col", mm_col);
|
|
2343
|
-
Vue.component("mm_foot", mm_foot);
|
|
2344
|
-
Vue.component("mm_grid", mm_grid);
|
|
2345
|
-
Vue.component("mm_group", mm_group);
|
|
2346
|
-
Vue.component("mm_head", mm_head);
|
|
2347
|
-
Vue.component("mm_item", mm_item);
|
|
2348
|
-
Vue.component("mm_list", mm_list);
|
|
2349
|
-
Vue.component("mm_main", mm_main);
|
|
2350
|
-
Vue.component("mm_modal", mm_modal);
|
|
2351
|
-
Vue.component("mm_movable", mm_movable);
|
|
2352
|
-
Vue.component("mm_page", mm_page);
|
|
2353
|
-
Vue.component("mm_view", mm_view);
|
|
2354
|
-
Vue.component("mm_side", mm_side);
|
|
2355
|
-
Vue.component("mm_table", mm_table);
|
|
2356
|
-
Vue.component("mm_warp", mm_warp);
|
|
2357
|
-
Vue.component("mm_title", mm_title);
|
|
2358
|
-
Vue.component("mm_content", mm_content);
|
|
2359
|
-
Vue.component("mm_form", mm_form);
|
|
2360
|
-
Vue.component("mm_checkbox", mm_checkbox);
|
|
2361
|
-
Vue.component("mm_code", mm_code);
|
|
2362
|
-
Vue.component("mm_input", mm_input);
|
|
2363
|
-
Vue.component("mm_number", mm_number);
|
|
2364
|
-
Vue.component("mm_time", mm_time);
|
|
2365
|
-
Vue.component("mm_textarea", mm_textarea);
|
|
2366
|
-
Vue.component("mm_pager", mm_pager);
|
|
2367
|
-
Vue.component("mm_radio", mm_radio);
|
|
2368
|
-
Vue.component("mm_reverse", mm_reverse);
|
|
2369
|
-
Vue.component("mm_select", mm_select);
|
|
2370
|
-
Vue.component("mm_switch", mm_switch);
|
|
2371
|
-
Vue.component("mm_nav", mm_nav);
|
|
2372
|
-
Vue.component("mm_upload_img", mm_upload_img);
|
|
2373
|
-
}
|
|
2374
|
-
};
|
|
2375
|
-
});
|