mm_os 1.3.4 → 1.3.6
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,221 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<main id="${id}">
|
|
3
|
-
<mm_grid>
|
|
4
|
-
<mm_col>
|
|
5
|
-
<mm_view>
|
|
6
|
-
<header class="arrow">
|
|
7
|
-
<h5>${api.title}</h5>
|
|
8
|
-
</header>
|
|
9
|
-
<mm_body>
|
|
10
|
-
<mm_form class="mm_filter">
|
|
11
|
-
<h5><span>筛选条件</span></h5>
|
|
12
|
-
<mm_list col="3">
|
|
13
|
-
<!--{if(param.list)}-->
|
|
14
|
-
<!--{loop param.list v idx}-->
|
|
15
|
-
<!--{if(v.name == 'keyword')}-->
|
|
16
|
-
<mm_col>
|
|
17
|
-
<mm_input v-model="query.keyword" title="${v.title}" desc="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}" @blur="search()" />
|
|
18
|
-
</mm_col>
|
|
19
|
-
<!--{/if}-->
|
|
20
|
-
<!--{/loop}-->
|
|
21
|
-
<!--{/if}-->
|
|
22
|
-
<!--{loop field v idx}-->
|
|
23
|
-
<!--{if(v.format)}-->
|
|
24
|
-
<!--{if(v.format.table)}-->
|
|
25
|
-
<mm_col>
|
|
26
|
-
<mm_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" @change="search()" />
|
|
27
|
-
</mm_col>
|
|
28
|
-
<!--{else}-->
|
|
29
|
-
<mm_col>
|
|
30
|
-
<mm_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
|
|
31
|
-
</mm_col>
|
|
32
|
-
<!--{/if}-->
|
|
33
|
-
<!--{/if}-->
|
|
34
|
-
<!--{/loop}-->
|
|
35
|
-
<mm_col>
|
|
36
|
-
<mm_btn class="btn_primary-x" type="reset" @click.native="reset();search()">重置</mm_btn>
|
|
37
|
-
</mm_col>
|
|
38
|
-
</mm_list>
|
|
39
|
-
</mm_form>
|
|
40
|
-
<div class="mm_action">
|
|
41
|
-
<h5><span>操作</span></h5>
|
|
42
|
-
<div class="">
|
|
43
|
-
<mm_btn class="btn_primary-x" url="./${name}_form">添加</mm_btn>
|
|
44
|
-
<mm_btn @click.native="show = true" class="btn_primary-x" v-bind:class="{ 'disabled': !selects }">批量修改</mm_btn>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<mm_table type="2">
|
|
48
|
-
<thead>
|
|
49
|
-
<tr>
|
|
50
|
-
<th scope="col" class="th_selected"><input type="checkbox" :checked="select_state" @click="select_all()" /></th>
|
|
51
|
-
<th scope="col" class="th_id"><span>#</span></th>
|
|
52
|
-
<!--{loop field v idx}-->
|
|
53
|
-
<!--{if(idx > 0)}-->
|
|
54
|
-
<th scope="col">
|
|
55
|
-
<mm_reverse title="${v.title}" v-model="query.orderby" field="${v.name}" :func="search"></mm_reverse>
|
|
56
|
-
</th>
|
|
57
|
-
<!--{/if}-->
|
|
58
|
-
<!--{/loop}-->
|
|
59
|
-
<th scope="col" class="th_handle"><span>操作</span></th>
|
|
60
|
-
</tr>
|
|
61
|
-
</thead>
|
|
62
|
-
<tbody>
|
|
63
|
-
<tr v-for="(o, idx) in list" :key="idx">
|
|
64
|
-
<th scope="row"><input type="checkbox" :checked="select_has(o[field])" @click="select_change(o[field])" /></th>
|
|
65
|
-
<th scope="row"><span>{{ o[field] }}</span></th>
|
|
66
|
-
<!--{loop field v idx}-->
|
|
67
|
-
<!--{if(v.format)}-->
|
|
68
|
-
<!--{if(v.format.table)}-->
|
|
69
|
-
<td><span>{{ get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span></td>
|
|
70
|
-
<!--{else}-->
|
|
71
|
-
<td><span>{{ ${v.label}[o.${v.name}] }}</span></td>
|
|
72
|
-
<!--{/if}-->
|
|
73
|
-
<!--{else if(v.name.indexOf('time') !== -1 || v.name.indexOf('Time') !== -1)}-->
|
|
74
|
-
<td><span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd hh:mm') }}</span></td>
|
|
75
|
-
<!--{else if(idx > 0)}-->
|
|
76
|
-
<td><span>{{ o.${v.name} }}</span></td>
|
|
77
|
-
<!--{/if}-->
|
|
78
|
-
<!--{/loop}-->
|
|
79
|
-
<td>
|
|
80
|
-
<mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
|
|
81
|
-
<mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
|
|
82
|
-
</td>
|
|
83
|
-
</tr>
|
|
84
|
-
</tbody>
|
|
85
|
-
</mm_table>
|
|
86
|
-
</mm_body>
|
|
87
|
-
<footer>
|
|
88
|
-
<mm_grid class="mm_data_count">
|
|
89
|
-
<mm_col>
|
|
90
|
-
<mm_select v-model="query.size" :options="$to_size()" @change="search()" />
|
|
91
|
-
</mm_col>
|
|
92
|
-
<mm_col width="50" style="min-width: 22.5rem;">
|
|
93
|
-
<mm_pager display="2" v-model="query.page" :count="count / query.size" :func="goTo" :icons="['首页', '上一页', '下一页', '尾页']"></mm_pager>
|
|
94
|
-
</mm_col>
|
|
95
|
-
<mm_col>
|
|
96
|
-
<div class="right plr">
|
|
97
|
-
<span class="mr">共 {{ count }} 条</span>
|
|
98
|
-
<span>当前</span>
|
|
99
|
-
<input class="pager_now" v-model.number="page_now" @blur="goTo(page_now)" @change="page_change" />
|
|
100
|
-
<span>/{{ page_count }}页</span>
|
|
101
|
-
</div>
|
|
102
|
-
</mm_col>
|
|
103
|
-
</mm_grid>
|
|
104
|
-
</footer>
|
|
105
|
-
</mm_view>
|
|
106
|
-
</mm_col>
|
|
107
|
-
</mm_grid>
|
|
108
|
-
<mm_modal v-model="show" mask="true">
|
|
109
|
-
<mm_view class="card bg_no">
|
|
110
|
-
<header class="bg_white">
|
|
111
|
-
<h5>批量修改</h5>
|
|
112
|
-
</header>
|
|
113
|
-
<mm_body>
|
|
114
|
-
<dl>
|
|
115
|
-
<!--{loop field v idx}-->
|
|
116
|
-
<!--{if(v.format)}-->
|
|
117
|
-
<dt>${v.title}</dt>
|
|
118
|
-
<!--{if(v.format.table)}-->
|
|
119
|
-
<dd>
|
|
120
|
-
<mm_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
121
|
-
</dd>
|
|
122
|
-
<!--{else}-->
|
|
123
|
-
<dd>
|
|
124
|
-
<mm_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
|
|
125
|
-
</dd>
|
|
126
|
-
<!--{/if}-->
|
|
127
|
-
<!--{/if}-->
|
|
128
|
-
<!--{/loop}-->
|
|
129
|
-
</dl>
|
|
130
|
-
</mm_body>
|
|
131
|
-
<footer>
|
|
132
|
-
<div class="mm_group">
|
|
133
|
-
<button class="btn_default" type="reset" @click="show = false">取消</button>
|
|
134
|
-
<button class="btn_primary" type="button" @click="batchSet()">提交</button>
|
|
135
|
-
</div>
|
|
136
|
-
</footer>
|
|
137
|
-
</mm_view>
|
|
138
|
-
</mm_modal>
|
|
139
|
-
</main>
|
|
140
|
-
</template>
|
|
141
|
-
|
|
142
|
-
<script>
|
|
143
|
-
import mixin from '/src/mixins/page.js';
|
|
144
|
-
|
|
145
|
-
export default {
|
|
146
|
-
mixins: [mixin],
|
|
147
|
-
data() {
|
|
148
|
-
return {
|
|
149
|
-
// 列表请求地址
|
|
150
|
-
url_get_list: "${api.path}",
|
|
151
|
-
url_del: "${api.path}?method=del&",
|
|
152
|
-
url_set: "${api.path}?method=set&",
|
|
153
|
-
field: "${sql.key}",
|
|
154
|
-
query_set: {
|
|
155
|
-
"${sql.key}": ""
|
|
156
|
-
},
|
|
157
|
-
// 查询条件
|
|
158
|
-
query: {
|
|
159
|
-
//页码
|
|
160
|
-
page: 1,
|
|
161
|
-
//页面大小
|
|
162
|
-
size: 10,
|
|
163
|
-
/*[loop js.query v idx]*/
|
|
164
|
-
// ${' ' + v.title}
|
|
165
|
-
/*[if v.type == 'string']*/
|
|
166
|
-
'${v.name}': '',
|
|
167
|
-
/*[else]*/
|
|
168
|
-
'${v.name}': 0,
|
|
169
|
-
/*[/if]*/
|
|
170
|
-
/*[/loop]*/
|
|
171
|
-
//排序
|
|
172
|
-
orderby: ""
|
|
173
|
-
},
|
|
174
|
-
form: {},
|
|
175
|
-
//颜色
|
|
176
|
-
arr_color: ['', 'font_success', 'font_warning', 'font_yellow', 'font_default'],
|
|
177
|
-
/*[loop js.data v idx]*/
|
|
178
|
-
// ${' ' + v.title}
|
|
179
|
-
'${v.name}': [/*[loop v.value a idx]*//*[if idx == 0]*/'${a}'/*[else]*/,'${a}'/*[/if]*//*[/loop]*/],
|
|
180
|
-
/*[/loop]*/
|
|
181
|
-
// 视图模型
|
|
182
|
-
vm: {}
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
methods: {
|
|
186
|
-
/*[loop js.data v idx]*/
|
|
187
|
-
/*[if(v.path)]*/
|
|
188
|
-
/**
|
|
189
|
-
* 获取 ${v.title}
|
|
190
|
-
* @param {query} 查询条件
|
|
191
|
-
*/
|
|
192
|
-
get_/*[v.basename]*/(query){
|
|
193
|
-
var _this = this;
|
|
194
|
-
if(!query){
|
|
195
|
-
query = {
|
|
196
|
-
field: "${v.id},${v.field}"
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
this.$get('~${v.path}', query, function(json) {
|
|
200
|
-
if (json.result) {
|
|
201
|
-
_this/*['.' + v.name]*/.clear();
|
|
202
|
-
_this/*['.' + v.name]*/.addList(json.result.list)
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
},
|
|
206
|
-
/*[/if]*/
|
|
207
|
-
/*[/loop]*/
|
|
208
|
-
},
|
|
209
|
-
created() {
|
|
210
|
-
/*[loop js.data v idx]*/
|
|
211
|
-
/*[if(v.path)]*/
|
|
212
|
-
// 获取 ${v.title}
|
|
213
|
-
this.get_/*[v.basename]*/();
|
|
214
|
-
/*[/if]*/
|
|
215
|
-
/*[/loop]*/
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
</script>
|
|
219
|
-
|
|
220
|
-
<style>
|
|
221
|
-
</style>
|
package/bin/com/nav/viewmodel.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 视图模型
|
|
3
|
-
* @class
|
|
4
|
-
*/
|
|
5
|
-
class ViewModel {
|
|
6
|
-
/**
|
|
7
|
-
* 配置参数
|
|
8
|
-
* @param {Object} config
|
|
9
|
-
*/
|
|
10
|
-
constructor(config) {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 获取表格所需键值对
|
|
17
|
-
* @param {Object} model 模型
|
|
18
|
-
* @return {Object} 返回视图所用模型
|
|
19
|
-
*/
|
|
20
|
-
ViewModel.prototype.field = async function(model) {
|
|
21
|
-
var list = model.param.list;
|
|
22
|
-
if (!list) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
var field;
|
|
26
|
-
if(model.file.indexOf('_form') !== -1 || model.file.indexOf('_view') !== -1){
|
|
27
|
-
field = model.sql.field_obj || '';
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
field = model.sql.field_default || '';
|
|
31
|
-
}
|
|
32
|
-
var requireds = [];
|
|
33
|
-
var add = model.param.add;
|
|
34
|
-
if(add){
|
|
35
|
-
requireds = add.body_required;
|
|
36
|
-
}
|
|
37
|
-
var arr = field.replace(/`/g, '').split(',');
|
|
38
|
-
var pm = [];
|
|
39
|
-
for (var i = 0; i < list.length; i++) {
|
|
40
|
-
var o = list[i];
|
|
41
|
-
var name = o.name;
|
|
42
|
-
if (arr.indexOf(name) !== -1) {
|
|
43
|
-
var obj = Object.assign({name}, o);
|
|
44
|
-
var format = model.sql.format.getObj({
|
|
45
|
-
key: name
|
|
46
|
-
});
|
|
47
|
-
if (format) {
|
|
48
|
-
obj.title = format.title;
|
|
49
|
-
obj.format = format;
|
|
50
|
-
}
|
|
51
|
-
if(requireds.indexOf(name) !== -1){
|
|
52
|
-
obj.required = true;
|
|
53
|
-
}
|
|
54
|
-
pm.push(obj);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return pm;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* 运算视图模型(css)
|
|
62
|
-
* @param {Object} model 模型
|
|
63
|
-
* @return {Object} 返回视图所用模型
|
|
64
|
-
*/
|
|
65
|
-
ViewModel.prototype.css = async function(model) {
|
|
66
|
-
var css = {};
|
|
67
|
-
return css;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* 运算视图模型(html)
|
|
72
|
-
* @param {Object} model 模型
|
|
73
|
-
* @return {Object} 返回视图所用模型
|
|
74
|
-
*/
|
|
75
|
-
ViewModel.prototype.html = async function(model) {
|
|
76
|
-
var html = {};
|
|
77
|
-
if (!model.sql) {
|
|
78
|
-
return html;
|
|
79
|
-
}
|
|
80
|
-
return html;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 运算视图模型(js)
|
|
85
|
-
* @param {Object} model 模型
|
|
86
|
-
* @return {Object} 返回视图所用模型
|
|
87
|
-
*/
|
|
88
|
-
ViewModel.prototype.js = async function(model) {
|
|
89
|
-
var js = {
|
|
90
|
-
data: [],
|
|
91
|
-
query: []
|
|
92
|
-
};
|
|
93
|
-
var field = model.field;
|
|
94
|
-
var path_start = model.file.indexOf('admin') !== -1 ? '/apis/' : '/api/';
|
|
95
|
-
|
|
96
|
-
for (var i = 0; i < field.length; i++) {
|
|
97
|
-
var o = field[i];
|
|
98
|
-
var format = o.format;
|
|
99
|
-
if (format) {
|
|
100
|
-
if (format.table) {
|
|
101
|
-
var basename = format.table.split('_').splice(1).join('_');
|
|
102
|
-
var name = "list_" + basename;
|
|
103
|
-
var id = format.id || format.key;
|
|
104
|
-
o.label = name;
|
|
105
|
-
var path = path_start + format.table.replace('_', '/') + "?size=0" // &field=" + format.key + "," + format.name;
|
|
106
|
-
js.data.push({
|
|
107
|
-
basename,
|
|
108
|
-
title: format.title,
|
|
109
|
-
id,
|
|
110
|
-
name,
|
|
111
|
-
field: format.name,
|
|
112
|
-
value: [],
|
|
113
|
-
path
|
|
114
|
-
});
|
|
115
|
-
} else {
|
|
116
|
-
var basename = format.key;
|
|
117
|
-
var name = "arr_" + basename;
|
|
118
|
-
o.label = name;
|
|
119
|
-
js.data.push({
|
|
120
|
-
title: format.title,
|
|
121
|
-
name,
|
|
122
|
-
value: format.list
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
var param = model.param;
|
|
128
|
-
if (param && param.get) {
|
|
129
|
-
var arr = param.get.query_required.concat(param.get.query);
|
|
130
|
-
var lt = param.list;
|
|
131
|
-
for (var i = 0; i < arr.length; i++) {
|
|
132
|
-
var o = lt.getObj({
|
|
133
|
-
name: arr[i]
|
|
134
|
-
});
|
|
135
|
-
if (o) {
|
|
136
|
-
js.query.push({
|
|
137
|
-
title: o.title,
|
|
138
|
-
name: o.name,
|
|
139
|
-
type: o.type,
|
|
140
|
-
select: o.description ? (o.description.indexOf('(') !== -1) : false
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return js;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 运算视图模型
|
|
150
|
-
* @param {Object} model 模型
|
|
151
|
-
* @return {Object} 返回视图所用模型
|
|
152
|
-
*/
|
|
153
|
-
ViewModel.prototype.run = async function(model) {
|
|
154
|
-
model.field = await this.field(model);
|
|
155
|
-
model.js = await this.js(model);
|
|
156
|
-
model.html = await this.html(model);
|
|
157
|
-
model.css = await this.css(model);
|
|
158
|
-
return model;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
module.exports = ViewModel;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "示例事件",
|
|
3
|
-
"table": "user",
|
|
4
|
-
"key": "uid",
|
|
5
|
-
"orderby": "{0}",
|
|
6
|
-
"orderby_default": "`uid` desc",
|
|
7
|
-
"field": "{0}",
|
|
8
|
-
"field_obj": "{0}",
|
|
9
|
-
"field_default": "`username`, `name`, `phone`",
|
|
10
|
-
"field_hide": ["*password*", "*token*"],
|
|
11
|
-
"separator": "|",
|
|
12
|
-
"keyword": {
|
|
13
|
-
"table": "table",
|
|
14
|
-
"orderby": "orderby",
|
|
15
|
-
"field": "field",
|
|
16
|
-
"page": "page",
|
|
17
|
-
"size": "size",
|
|
18
|
-
"count": "count",
|
|
19
|
-
"method": "method"
|
|
20
|
-
},
|
|
21
|
-
"method": "add del set get import export",
|
|
22
|
-
"query": {
|
|
23
|
-
"name": "`name` like '%{0}%'"
|
|
24
|
-
},
|
|
25
|
-
"where": {
|
|
26
|
-
"uid": "`uid` = '{0}'"
|
|
27
|
-
},
|
|
28
|
-
"update": {
|
|
29
|
-
"name": "`name` = '{0}'"
|
|
30
|
-
},
|
|
31
|
-
"func_file": "",
|
|
32
|
-
"format": [],
|
|
33
|
-
"del_repeat": {}
|
|
34
|
-
}
|