mm_os 4.3.7 → 5.0.0
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.md +101 -504
- package/index.js +26 -19
- package/lib/loader.js +787 -0
- package/lib/os.js +369 -0
- package/package.json +55 -84
- package/LICENSE +0 -21
- package/README_EN.md +0 -505
- package/adapter/adapter.js +0 -484
- package/adapter/custom_persistence.js +0 -661
- package/adapter/mqtt.js +0 -254
- package/adapter/socket.js +0 -244
- package/adapter/web.js +0 -92
- package/adapter/websocket.js +0 -43
- package/ai.js +0 -130
- package/com/api/README.md +0 -3
- package/com/api/com.json +0 -5
- package/com/api/config.tpl.json +0 -41
- package/com/api/drive.js +0 -732
- package/com/api/index.js +0 -201
- package/com/api/oauth.js +0 -200
- package/com/api/script.tpl.js +0 -32
- package/com/cmd/README.md +0 -11
- package/com/cmd/com.json +0 -5
- package/com/cmd/config.tpl.json +0 -48
- package/com/cmd/drive.js +0 -176
- package/com/cmd/index.js +0 -287
- package/com/cmd/job/config.json +0 -66
- package/com/cmd/job/index.js +0 -241
- package/com/cmd/job/test.js +0 -188
- package/com/cmd/msg.json +0 -48
- package/com/cmd/script.tpl.js +0 -12
- package/com/db/README.md +0 -3
- package/com/db/com.json +0 -5
- package/com/db/drive.js +0 -2206
- package/com/db/index.js +0 -241
- package/com/event/README.md +0 -4
- package/com/event/com.json +0 -5
- package/com/event/config.tpl.json +0 -20
- package/com/event/drive.js +0 -61
- package/com/event/index.js +0 -438
- package/com/event/script.tpl.js +0 -23
- package/com/mqtt/README.md +0 -47
- package/com/mqtt/com.json +0 -5
- package/com/mqtt/config.tpl.json +0 -42
- package/com/mqtt/drive.js +0 -704
- package/com/mqtt/index.js +0 -1052
- package/com/mqtt/index.test.js +0 -503
- package/com/mqtt/script.tpl.js +0 -719
- package/com/nav/README.md +0 -2
- package/com/nav/com.json +0 -5
- package/com/nav/config.tpl.json +0 -84
- package/com/nav/drive.js +0 -702
- package/com/nav/index.js +0 -228
- package/com/nav/tpl/admin_pc/page_channel.vue +0 -305
- package/com/nav/tpl/admin_pc/page_config.vue +0 -280
- package/com/nav/tpl/admin_pc/page_config_form.vue +0 -194
- package/com/nav/tpl/admin_pc/page_default.vue +0 -247
- package/com/nav/tpl/admin_pc/page_form.vue +0 -180
- package/com/nav/tpl/admin_pc/page_lang.vue +0 -264
- package/com/nav/tpl/admin_pc/page_nav.vue +0 -321
- package/com/nav/tpl/admin_pc/page_table.vue +0 -296
- package/com/nav/tpl/admin_pc/page_type.vue +0 -321
- package/com/nav/tpl/admin_pc/page_view.vue +0 -124
- package/com/nav/tpl/dev_pc/page_channel.vue +0 -253
- package/com/nav/tpl/dev_pc/page_config.vue +0 -253
- package/com/nav/tpl/dev_pc/page_default.vue +0 -247
- package/com/nav/tpl/dev_pc/page_form.vue +0 -162
- package/com/nav/tpl/dev_pc/page_nav.vue +0 -253
- package/com/nav/tpl/dev_pc/page_table.vue +0 -247
- package/com/nav/tpl/dev_pc/page_type.vue +0 -313
- package/com/nav/tpl/home_pc/page_channel.vue +0 -234
- package/com/nav/tpl/home_pc/page_default.vue +0 -234
- package/com/nav/tpl/home_pc/page_form.vue +0 -137
- package/com/nav/tpl/home_pc/page_list.vue +0 -234
- package/com/nav/tpl/home_pc/page_nav.vue +0 -221
- package/com/nav/tpl/home_pc/page_type.vue +0 -234
- package/com/nav/tpl/home_pc/page_view.vue +0 -125
- package/com/nav/tpl/home_phone/page_channel.vue +0 -234
- package/com/nav/tpl/home_phone/page_default.vue +0 -234
- package/com/nav/tpl/home_phone/page_form.vue +0 -137
- package/com/nav/tpl/home_phone/page_list.vue +0 -234
- package/com/nav/tpl/home_phone/page_nav.vue +0 -237
- package/com/nav/tpl/home_phone/page_type.vue +0 -234
- package/com/nav/tpl/home_phone/page_view.vue +0 -125
- package/com/nav/viewmodel.js +0 -446
- package/com/param/README.md +0 -2
- package/com/param/com.json +0 -5
- package/com/param/config.tpl.json +0 -136
- package/com/param/drive.js +0 -502
- package/com/param/index.js +0 -158
- package/com/param/script.tpl.js +0 -12
- package/com/pendant/README.md +0 -3
- package/com/pendant/com.json +0 -5
- package/com/pendant/config.tpl.json +0 -32
- package/com/pendant/drive.js +0 -204
- package/com/pendant/index.js +0 -467
- package/com/pendant/pendant.html +0 -16
- package/com/pendant/script.tpl.js +0 -18
- package/com/socket/README.md +0 -47
- package/com/socket/com.json +0 -5
- package/com/socket/config.tpl.json +0 -12
- package/com/socket/drive.js +0 -679
- package/com/socket/index.js +0 -402
- package/com/socket/script.tpl.js +0 -41
- package/com/sql/README.md +0 -3
- package/com/sql/com.json +0 -5
- package/com/sql/config.tpl.json +0 -74
- package/com/sql/drive.js +0 -1328
- package/com/sql/index.js +0 -152
- package/com/sql/script.tpl.js +0 -47
- package/com/static/README.md +0 -2
- package/com/static/com.json +0 -5
- package/com/static/config.tpl.json +0 -24
- package/com/static/drive.js +0 -194
- package/com/static/index.js +0 -237
- package/com/static/script.tpl.js +0 -28
- package/com/task/README.md +0 -3
- package/com/task/com.json +0 -5
- package/com/task/config.tpl.json +0 -24
- package/com/task/drive.js +0 -428
- package/com/task/index.js +0 -159
- package/com/task/script.tpl.js +0 -40
- package/com/template/com.json +0 -5
- package/com/template/config.tpl.json +0 -16
- package/com/template/drive.js +0 -81
- package/com/template/index.js +0 -141
- package/com.js +0 -237
- package/common/README.md +0 -2
- package/common/middleware/web_after/index.js +0 -26
- package/common/middleware/web_after/middleware.json +0 -9
- package/common/middleware/web_base/index.js +0 -113
- package/common/middleware/web_base/middleware.json +0 -19
- package/common/middleware/web_before/index.js +0 -33
- package/common/middleware/web_before/middleware.json +0 -9
- package/common/middleware/web_cors/index.js +0 -87
- package/common/middleware/web_cors/middleware.json +0 -24
- package/common/middleware/web_error/index.js +0 -131
- package/common/middleware/web_error/middleware.json +0 -19
- package/common/middleware/web_ip/index.js +0 -15
- package/common/middleware/web_ip/middleware.json +0 -14
- package/common/middleware/web_logger/index.js +0 -156
- package/common/middleware/web_logger/middleware.json +0 -14
- package/common/middleware/web_main/index.js +0 -26
- package/common/middleware/web_main/middleware.json +0 -9
- package/common/middleware/web_static/index.js +0 -73
- package/common/middleware/web_static/middleware.json +0 -54
- package/common/middleware/web_waf/index.js +0 -395
- package/common/middleware/web_waf/middleware.json +0 -13
- package/core/app/config.tpl.json +0 -67
- package/core/app/index.js +0 -711
- package/core/app/script.tpl.js +0 -52
- package/core/channel/index.js +0 -899
- package/core/channel/matcher.js +0 -585
- package/core/com/config.tpl.json +0 -16
- package/core/com/index.js +0 -77
- package/core/com/script.tpl.js +0 -5
- package/core/component/component.js +0 -42
- package/core/component/config.tpl.json +0 -63
- package/core/component/index.js +0 -273
- package/core/component/script.tpl.js +0 -19
- package/core/controller/config.tpl.json +0 -14
- package/core/controller/index.js +0 -371
- package/core/controller/script.tpl.js +0 -27
- package/core/factory/config.tpl.json +0 -14
- package/core/factory/entity.js +0 -275
- package/core/factory/index.js +0 -241
- package/core/factory/script.tpl.js +0 -16
- package/core/game/bat/index.js +0 -137
- package/core/game/bat/world.js +0 -622
- package/core/game/config.tpl.json +0 -16
- package/core/game/entity_admin.js +0 -230
- package/core/game/index.js +0 -186
- package/core/handler/config.tpl.json +0 -22
- package/core/handler/index.js +0 -181
- package/core/handler/script.tpl.js +0 -23
- package/core/logic/config.tpl.json +0 -14
- package/core/logic/index.js +0 -59
- package/core/logic/script.tpl.js +0 -19
- package/core/middleware/config.tpl.json +0 -16
- package/core/middleware/index.js +0 -117
- package/core/middleware/script.tpl.js +0 -37
- package/core/mod/config.tpl.json +0 -22
- package/core/mod/index.js +0 -136
- package/core/mod/script.tpl.js +0 -34
- package/core/model/config.tpl.json +0 -219
- package/core/model/index.js +0 -272
- package/core/model/model.js +0 -27
- package/core/model/script.tpl.js +0 -20
- package/core/notifier/config.tpl.json +0 -14
- package/core/notifier/index.js +0 -77
- package/core/notifier/script.tpl.js +0 -20
- package/core/plugin/config.tpl.json +0 -36
- package/core/plugin/index.js +0 -267
- package/core/plugin/script.tpl.js +0 -51
- package/core/pusher/config.tpl.json +0 -14
- package/core/pusher/index.js +0 -158
- package/core/pusher/script.tpl.js +0 -20
- package/core/room/bat/index.js +0 -170
- package/core/room/bat/room.js +0 -524
- package/core/room/config.tpl.json +0 -20
- package/core/room/index.js +0 -249
- package/core/room/room.js +0 -61
- package/core/scene/config.tpl.json +0 -14
- package/core/scene/index.js +0 -467
- package/core/scene/loop.js +0 -1306
- package/core/scene/map.js +0 -28
- package/core/scene/script.tpl.js +0 -22
- package/core/sender/config.tpl.json +0 -14
- package/core/sender/index.js +0 -79
- package/core/sender/script.tpl.js +0 -20
- package/core/service/config.tpl.json +0 -14
- package/core/service/index.js +0 -100
- package/core/service/script.tpl.js +0 -25
- package/core/store/config.tpl.json +0 -26
- package/core/store/index.js +0 -1794
- package/core/store/script.tpl.js +0 -22
- package/core/system/config.tpl.json +0 -18
- package/core/system/index.js +0 -312
- package/core/system/script.tpl.js +0 -77
- package/core/view/config.tpl.json +0 -14
- package/core/view/index.js +0 -91
- package/core/view/script.tpl.js +0 -20
- package/core/zone/bat/index.js +0 -744
- package/core/zone/config.tpl.json +0 -54
- package/core/zone/index.js +0 -655
- package/core/zone/script.tpl.js +0 -10
- package/core/zone/zone_bat.js +0 -136
- package/core//345/237/272/347/261/273/346/250/241/345/235/227/346/270/205/345/215/225.md +0 -24
- package/os.js +0 -53
- package/server.js +0 -602
- package/ulits/id_gen.js +0 -134
- package/ulits/word.js +0 -206
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<main id="${id}">
|
|
3
|
-
<div class="mm_warp">
|
|
4
|
-
<div class="mm_container">
|
|
5
|
-
<div class="mm_row">
|
|
6
|
-
<div class="mm_col col-12">
|
|
7
|
-
<div class="mm_card" :class="{ 'hide_filter': !show_filter }">
|
|
8
|
-
<div class="card_head arrow" @click="show_filter = !show_filter">
|
|
9
|
-
<h5>${api.title}</h5>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="card_body">
|
|
12
|
-
<form class="mm_form" class="bar_filter">
|
|
13
|
-
<div class="title">
|
|
14
|
-
<h5><span>筛选条件</span></h5>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="mm_list list-3">
|
|
17
|
-
<!--{loop param.list v idx}-->
|
|
18
|
-
<!--{if(v.name === 'keyword')}-->
|
|
19
|
-
<div class="mm_item">
|
|
20
|
-
<control_input v-model="query.keyword" title="${v.title}"
|
|
21
|
-
desc="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}"
|
|
22
|
-
@blur="search()" />
|
|
23
|
-
</div>
|
|
24
|
-
<!--{/if}-->
|
|
25
|
-
<!--{/loop}-->
|
|
26
|
-
<!--{loop field v idx}-->
|
|
27
|
-
<!--{if(v.show.search)}-->
|
|
28
|
-
<!--{if(v.show.search === "input")}-->
|
|
29
|
-
<div class="mm_item">
|
|
30
|
-
<control_input v-model="query.${v.name}" title="${v.title}"
|
|
31
|
-
@blur="search()" />
|
|
32
|
-
</div>
|
|
33
|
-
<!--{else if(v.show.search === "select")}-->
|
|
34
|
-
<!--{if(v.format.table)}-->
|
|
35
|
-
<div class="mm_item">
|
|
36
|
-
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
37
|
-
<control_select type="list" v-model="query.${v.format.key}"
|
|
38
|
-
title="${v.title}"
|
|
39
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')"
|
|
40
|
-
@change="search()" />
|
|
41
|
-
<!--{else}-->
|
|
42
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}"
|
|
43
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')"
|
|
44
|
-
@change="search()" />
|
|
45
|
-
<!--{/if}-->
|
|
46
|
-
</div>
|
|
47
|
-
<!--{else if(v.format.key.indexOf('user_id') !== -1)}-->
|
|
48
|
-
<div class="mm_item">
|
|
49
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}"
|
|
50
|
-
:options="$to_kv(${v.label})" @change="search()" />
|
|
51
|
-
</div>
|
|
52
|
-
<!--{else}-->
|
|
53
|
-
<div class="mm_item">
|
|
54
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}"
|
|
55
|
-
:options="$to_kv(${v.label})" @change="search()" />
|
|
56
|
-
</div>
|
|
57
|
-
<!--{/if}-->
|
|
58
|
-
<!--{/if}-->
|
|
59
|
-
<!--{/if}-->
|
|
60
|
-
<!--{/loop}-->
|
|
61
|
-
<div class="mm_item">
|
|
62
|
-
<button class="mm_btn btn-primary-x" type="reset"
|
|
63
|
-
@click.native="reset();search()">重置</button>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</form>
|
|
67
|
-
<div class="bar_action">
|
|
68
|
-
<h5><span>操作</span></h5>
|
|
69
|
-
<div class="btns">
|
|
70
|
-
<button class="mm_btn btn-primary-x" url="./${name}_form?">添加</button>
|
|
71
|
-
<button @click.native="show = true" class="mm_btn btn-primary-x"
|
|
72
|
-
v-bind:class="{ 'disabled': !selects }">批量修改</button>
|
|
73
|
-
</div>
|
|
74
|
-
<div class="btn_small">
|
|
75
|
-
<control_file class="btn_default-x" type="excel" :func="import_db"
|
|
76
|
-
v-if="url_import"></control_file>
|
|
77
|
-
<button class="mm_btn btn_default-x" @click.native="export_db()"
|
|
78
|
-
v-if="url_export">导出</button>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="mm_table table-2">
|
|
82
|
-
<table>
|
|
83
|
-
<thead class="table-sm">
|
|
84
|
-
<tr>
|
|
85
|
-
<th class="th_selected"><input type="checkbox" :checked="select_state"
|
|
86
|
-
@click="select_all()" /></th>
|
|
87
|
-
<th class="th_id"><span>#</span></th>
|
|
88
|
-
<!--{loop field v idx}-->
|
|
89
|
-
<!--{if(v.show.table)}-->
|
|
90
|
-
<!--{if(v.name !== sql.key)}-->
|
|
91
|
-
<th class="th_${v.name}">
|
|
92
|
-
<control_reverse title="${v.title}" v-model="query.orderby"
|
|
93
|
-
field="${v.name}" :func="search"></control_reverse>
|
|
94
|
-
</th>
|
|
95
|
-
<!--{/if}-->
|
|
96
|
-
<!--{/if}-->
|
|
97
|
-
<!--{/loop}-->
|
|
98
|
-
<th class="th_handle"><span>操作</span></th>
|
|
99
|
-
</tr>
|
|
100
|
-
</thead>
|
|
101
|
-
<tbody>
|
|
102
|
-
<tr v-for="(o, idx) in list" :key="idx" :class="{'active': select == idx}"
|
|
103
|
-
@click="selected(idx)">
|
|
104
|
-
<th class="th_selected"><input type="checkbox"
|
|
105
|
-
:checked="select_has(o[field])"
|
|
106
|
-
@click="select_change(o[field])" /></th>
|
|
107
|
-
<td>{{ o[field] }}</td>
|
|
108
|
-
<!--{loop field v idx}-->
|
|
109
|
-
<!--{if(v.show.table)}-->
|
|
110
|
-
<!--{if(v.name !== sql.key)}-->
|
|
111
|
-
<td>
|
|
112
|
-
<!--{if(v.dataType === 'tinyint')}-->
|
|
113
|
-
<control_switch v-model="o.${v.name}" @click.native="set(o)" />
|
|
114
|
-
<!--{else if(v.format)}-->
|
|
115
|
-
<!--{if(v.format.table)}-->
|
|
116
|
-
<span>{{ $get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span>
|
|
117
|
-
<!--{else if(v.name == 'state' || v.name == 'status')}-->
|
|
118
|
-
<span
|
|
119
|
-
v-bind:class="arr_color[o.${v.name}]">{{ ${v.label}[o.${v.name}] }}</span>
|
|
120
|
-
<!--{else}-->
|
|
121
|
-
<span>{{ ${v.label}[o.${v.name}] }}</span>
|
|
122
|
-
<!--{/if}-->
|
|
123
|
-
<!--{else if(v.name.indexOf('img') !== -1 || v.name.indexOf('icon') !== -1 || v.name === 'avatar')}-->
|
|
124
|
-
<img class="${v.name}" :src="o.${v.name}" alt="${v.title}" />
|
|
125
|
-
<!--{else if(v.dataType === 'date')}-->
|
|
126
|
-
<span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd') }}</span>
|
|
127
|
-
<!--{else if(v.dataType === 'time')}-->
|
|
128
|
-
<span>{{ o.${v.name} }}</span>
|
|
129
|
-
<!--{else if(v.dataType === 'timestamp' || v.dataType === 'datetime')}-->
|
|
130
|
-
<span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd hh:mm') }}</span>
|
|
131
|
-
<!--{else if(v.name === 'display' || v.name === 'orderby')}-->
|
|
132
|
-
<input class="input_display" v-model.number="o.${v.name}"
|
|
133
|
-
@blur="set(o)" min="0" max="1000" />
|
|
134
|
-
<!--{else}-->
|
|
135
|
-
<span>{{ o.${v.name} }}</span>
|
|
136
|
-
<!--{/if}-->
|
|
137
|
-
</td>
|
|
138
|
-
<!--{/if}-->
|
|
139
|
-
<!--{/if}-->
|
|
140
|
-
<!--{/loop}-->
|
|
141
|
-
<td>
|
|
142
|
-
<a class="mm_btn btn-primary"
|
|
143
|
-
:href="'./${name}_form?${sql.key}=' + o[field]">修改</a>
|
|
144
|
-
<button class="mm_btn btn_warning"
|
|
145
|
-
@click.native="del_show(o, field)">删除</button>
|
|
146
|
-
</td>
|
|
147
|
-
</tr>
|
|
148
|
-
</tbody>
|
|
149
|
-
</table>
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
<div class="card_foot">
|
|
153
|
-
<div class="fl">
|
|
154
|
-
<control_select v-model="query.size" :options="$to_size()" @change="search()" />
|
|
155
|
-
</div>
|
|
156
|
-
<div class="fr">
|
|
157
|
-
<span class="mr">共 {{ count }} 条</span>
|
|
158
|
-
<span>当前</span>
|
|
159
|
-
<input type="number" class="pager_now" v-model.number="page_now"
|
|
160
|
-
@blur="goTo(page_now)" @change="page_change" />
|
|
161
|
-
<span>/{{ page_count }}页</span>
|
|
162
|
-
</div>
|
|
163
|
-
<control_pager display="2" v-model="query.page" :count="count / query.size" :func="goTo"
|
|
164
|
-
:icons="['首页', '上一页', '下一页', '尾页']"></control_pager>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
</div>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
<mm_modal v-model="show" mask="true">
|
|
172
|
-
<div class="mm_card" class="card">
|
|
173
|
-
<div class="card_head">
|
|
174
|
-
<h5>批量修改</h5>
|
|
175
|
-
</div>
|
|
176
|
-
<div class="card_body pa">
|
|
177
|
-
<dl>
|
|
178
|
-
<!--{loop field v idx}-->
|
|
179
|
-
<!--{if(v.show.batch)}-->
|
|
180
|
-
<dt>${v.title}</dt>
|
|
181
|
-
<dd>
|
|
182
|
-
<!--{if(v.show.batch === "input")}-->
|
|
183
|
-
<control_input v-model="form.${v.name}" />
|
|
184
|
-
<!--{else if(v.show.batch === "select")}-->
|
|
185
|
-
<!--{if(v.format.table)}-->
|
|
186
|
-
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
187
|
-
<control_select type="list" v-model="form.${v.format.key}"
|
|
188
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
189
|
-
<!--{else}-->
|
|
190
|
-
<control_select v-model="form.${v.format.key}"
|
|
191
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
192
|
-
<!--{/if}-->
|
|
193
|
-
<!--{else}-->
|
|
194
|
-
<control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
|
|
195
|
-
<!--{/if}-->
|
|
196
|
-
<!--{/if}-->
|
|
197
|
-
</dd>
|
|
198
|
-
<!--{/if}-->
|
|
199
|
-
<!--{/loop}-->
|
|
200
|
-
</dl>
|
|
201
|
-
</div>
|
|
202
|
-
<div class="card_foot">
|
|
203
|
-
<div class="mm_group">
|
|
204
|
-
<button class="mm_btn btn_default" type="reset" @click="show = false">取消</button>
|
|
205
|
-
<button class="mm_btn btn-primary" type="button" @click="batchSet()">提交</button>
|
|
206
|
-
</div>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
</mm_modal>
|
|
210
|
-
</main>
|
|
211
|
-
</template>
|
|
212
|
-
|
|
213
|
-
<script>
|
|
214
|
-
import mixin from '/src/mixins/page.js';
|
|
215
|
-
|
|
216
|
-
export default {
|
|
217
|
-
mixins: [mixin],
|
|
218
|
-
data() {
|
|
219
|
-
return {
|
|
220
|
-
// 列表请求地址
|
|
221
|
-
url_get_list: "${api.path}",
|
|
222
|
-
url_del: "${api.path}?method=del&",
|
|
223
|
-
url_set: "${api.path}?method=set&",
|
|
224
|
-
url_import: "${api.path}?method=import&",
|
|
225
|
-
url_export: "${api.path}?method=export&",
|
|
226
|
-
field: "${sql.key}",
|
|
227
|
-
query_set: {
|
|
228
|
-
"${sql.key}": ""
|
|
229
|
-
},
|
|
230
|
-
// 查询条件
|
|
231
|
-
query: {
|
|
232
|
-
//页码
|
|
233
|
-
page: 1,
|
|
234
|
-
//页面大小
|
|
235
|
-
size: 10,
|
|
236
|
-
/*[loop js.query v idx]*/
|
|
237
|
-
// ${' ' + v.title}
|
|
238
|
-
/*[if v.type === 'number' && !v.select]*/
|
|
239
|
-
'${v.name}': 0,
|
|
240
|
-
/*[else]*/
|
|
241
|
-
'${v.name}': '',
|
|
242
|
-
/*[/if]*/
|
|
243
|
-
/*[/loop]*/
|
|
244
|
-
//排序
|
|
245
|
-
orderby: ""
|
|
246
|
-
},
|
|
247
|
-
form: {},
|
|
248
|
-
//颜色
|
|
249
|
-
arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info',
|
|
250
|
-
'font_default'
|
|
251
|
-
],
|
|
252
|
-
/*[loop js.data v idx]*/
|
|
253
|
-
// ${' ' + v.title}
|
|
254
|
-
'${v.name}': ${@JSON.stringify(v.value)},
|
|
255
|
-
/*[/loop]*/
|
|
256
|
-
// 视图模型
|
|
257
|
-
vm: {}
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
methods: {
|
|
261
|
-
/*[loop js.data v idx]*/
|
|
262
|
-
/*[if(v.path)]*/
|
|
263
|
-
/**
|
|
264
|
-
* 获取 ${v.title}
|
|
265
|
-
* @param {query} 查询条件
|
|
266
|
-
*/
|
|
267
|
-
get_/*[v.basename]*/(query) {
|
|
268
|
-
var _this = this;
|
|
269
|
-
if (!query) {
|
|
270
|
-
query = {
|
|
271
|
-
field: "${v.id},${v.field}${v.father_id ? ',' + v.father_id : '' }${v.title_name ? ',title' : '' }"
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
|
-
this.$get('~${v.path}', query, function(json) {
|
|
275
|
-
if (json.result) {
|
|
276
|
-
_this/*['.' + v.name]*/.clear();
|
|
277
|
-
_this/*['.' + v.name]*/.addList(json.result.list)
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
},
|
|
281
|
-
/*[/if]*/
|
|
282
|
-
/*[/loop]*/
|
|
283
|
-
},
|
|
284
|
-
created() {
|
|
285
|
-
/*[loop js.data v idx]*/
|
|
286
|
-
/*[if(v.path)]*/
|
|
287
|
-
// 获取 ${v.title}
|
|
288
|
-
this.get_/*[v.basename]*/();
|
|
289
|
-
/*[/if]*/
|
|
290
|
-
/*[/loop]*/
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
</script>
|
|
294
|
-
|
|
295
|
-
<style>
|
|
296
|
-
</style>
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<main id="${id}">
|
|
3
|
-
<div class="mm_warp">
|
|
4
|
-
<div class="mm_container">
|
|
5
|
-
<div class="mm_row">
|
|
6
|
-
<div class="mm_col col-12">
|
|
7
|
-
<div class="mm_card" :class="{ 'hide_filter': !show_filter }">
|
|
8
|
-
<div class="card_head arrow" @click="show_filter = !show_filter">
|
|
9
|
-
<h5>${api.title}</h5>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="card_body">
|
|
12
|
-
<form class="mm_form" class="bar_filter">
|
|
13
|
-
<div class="title">
|
|
14
|
-
<h5><span>筛选条件</span></h5>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="mm_list list-3">
|
|
17
|
-
<!--{loop param.list v idx}-->
|
|
18
|
-
<!--{if(v.name === 'keyword')}-->
|
|
19
|
-
<div class="mm_item">
|
|
20
|
-
<control_input v-model="query.keyword" title="${v.title}"
|
|
21
|
-
desc="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}" />
|
|
22
|
-
</div>
|
|
23
|
-
<!--{/if}-->
|
|
24
|
-
<!--{/loop}-->
|
|
25
|
-
<!--{loop field v idx}-->
|
|
26
|
-
<!--{if(v.show.search)}-->
|
|
27
|
-
<!--{if(v.show.search === "input")}-->
|
|
28
|
-
<div class="mm_item">
|
|
29
|
-
<control_input v-model="query.${v.name}" title="${v.title}"
|
|
30
|
-
@blur="search()" />
|
|
31
|
-
</div>
|
|
32
|
-
<!--{else if(v.show.search === "select")}-->
|
|
33
|
-
<!--{if(v.format.table)}-->
|
|
34
|
-
<div class="mm_item">
|
|
35
|
-
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
36
|
-
<control_select type="list" v-model="query.${v.format.key}"
|
|
37
|
-
title="${v.title}"
|
|
38
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')"
|
|
39
|
-
@change="search()" />
|
|
40
|
-
<!--{else}-->
|
|
41
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}"
|
|
42
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')"
|
|
43
|
-
@change="search()" />
|
|
44
|
-
<!--{/if}-->
|
|
45
|
-
</div>
|
|
46
|
-
<!--{else if(v.format.key.indexOf('user_id') !== -1)}-->
|
|
47
|
-
<div class="mm_item">
|
|
48
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}"
|
|
49
|
-
:options="$to_kv(${v.label})" @change="search()" />
|
|
50
|
-
</div>
|
|
51
|
-
<!--{else}-->
|
|
52
|
-
<div class="mm_item">
|
|
53
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}"
|
|
54
|
-
:options="$to_kv(${v.label})" @change="search()" />
|
|
55
|
-
</div>
|
|
56
|
-
<!--{/if}-->
|
|
57
|
-
<!--{/if}-->
|
|
58
|
-
<!--{/if}-->
|
|
59
|
-
<!--{/loop}-->
|
|
60
|
-
<div class="mm_item">
|
|
61
|
-
<button class="mm_btn btn-primary-x" type="reset"
|
|
62
|
-
@click.native="reset();">重置</button>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</form>
|
|
66
|
-
<div class="bar_action">
|
|
67
|
-
<h5><span>操作</span></h5>
|
|
68
|
-
<div class="btns">
|
|
69
|
-
<button class="btn-primary-x" url="./${name}_form?">添加</button>
|
|
70
|
-
<button @click.native="show = true" class="btn-primary-x"
|
|
71
|
-
v-bind:class="{ 'disabled': !selects }">批量修改</button>
|
|
72
|
-
</div>
|
|
73
|
-
<div class="btn_small">
|
|
74
|
-
<control_file class="btn_default-x" type="excel" :func="import_db"
|
|
75
|
-
v-if="url_import"></control_file>
|
|
76
|
-
<button class="btn_default-x" @click.native="export_db()"
|
|
77
|
-
v-if="url_export">导出</button>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
<div class="mm_table table-3">
|
|
81
|
-
<table>
|
|
82
|
-
<thead class="table-sm">
|
|
83
|
-
<tr>
|
|
84
|
-
<th class="th_open"></th>
|
|
85
|
-
<th class="th_selected"><input type="checkbox" :checked="select_state"
|
|
86
|
-
@click="select_all()" /></th>
|
|
87
|
-
<th class="th_id"><span>#</span></th>
|
|
88
|
-
<!--{loop field v idx}-->
|
|
89
|
-
<!--{if(v.show.table)}-->
|
|
90
|
-
<!--{if(v.name !== sql.key)}-->
|
|
91
|
-
<th class="th_${v.name}">
|
|
92
|
-
<span>${v.title}</span>
|
|
93
|
-
</th>
|
|
94
|
-
<!--{/if}-->
|
|
95
|
-
<!--{/if}-->
|
|
96
|
-
<!--{/loop}-->
|
|
97
|
-
<th class="th_handle"><span>操作</span></th>
|
|
98
|
-
</tr>
|
|
99
|
-
</thead>
|
|
100
|
-
<tbody>
|
|
101
|
-
<tr v-for="(o, idx) in list_new" :key="idx"
|
|
102
|
-
:class="{'active': select == idx, sub: o[father_id], open: opens_has(o[field]), no_sub: !opens_has_sub(o[field]) }"
|
|
103
|
-
@click="selected(idx)">
|
|
104
|
-
<th class="th_open"><button class="btn_open"
|
|
105
|
-
:style="'margin-left:' + (1.5 * opens_lv(o[father_id])) + 'rem;'"
|
|
106
|
-
@click="opens_change(o[field])"><i
|
|
107
|
-
class="fa-caret-right"></i></button></th>
|
|
108
|
-
<th class="th_selected"><input type="checkbox"
|
|
109
|
-
:checked="select_has(o[field])"
|
|
110
|
-
@click="select_change(o[field])" /></th>
|
|
111
|
-
<td>{{ o[field] }}</td>
|
|
112
|
-
<!--{loop field v idx}-->
|
|
113
|
-
<!--{if(v.show.table)}-->
|
|
114
|
-
<!--{if(v.name !== sql.key)}-->
|
|
115
|
-
<td>
|
|
116
|
-
<!--{if(v.dataType === 'tinyint')}-->
|
|
117
|
-
<control_switch v-model="o.${v.name}" @click.native="set(o)" />
|
|
118
|
-
<!--{else if(v.format)}-->
|
|
119
|
-
<!--{if(v.format.table)}-->
|
|
120
|
-
<span>{{ $get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span>
|
|
121
|
-
<!--{else if(v.name == 'state' || v.name == 'status')}-->
|
|
122
|
-
<span
|
|
123
|
-
v-bind:class="arr_color[o.${v.name}]">{{ ${v.label}[o.${v.name}] }}</span>
|
|
124
|
-
<!--{else}-->
|
|
125
|
-
<span>{{ ${v.label}[o.${v.name}] }}</span>
|
|
126
|
-
<!--{/if}-->
|
|
127
|
-
<!--{else if(v.name.indexOf('img') !== -1 || v.name.indexOf('icon') !== -1 || v.name === 'avatar')}-->
|
|
128
|
-
<img class="${v.name}" :src="o.${v.name}" alt="${v.title}" />
|
|
129
|
-
<!--{else if(v.dataType === 'date')}-->
|
|
130
|
-
<span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd') }}</span>
|
|
131
|
-
<!--{else if(v.dataType === 'time')}-->
|
|
132
|
-
<span>{{ o.${v.name} }}</span>
|
|
133
|
-
<!--{else if(v.dataType === 'timestamp' || v.dataType === 'datetime')}-->
|
|
134
|
-
<span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd hh:mm') }}</span>
|
|
135
|
-
<!--{else if(v.name === 'display' || v.name === 'orderby')}-->
|
|
136
|
-
<input class="input_display" v-model.number="o.${v.name}"
|
|
137
|
-
@blur="set(o)" min="0" max="1000" />
|
|
138
|
-
<!--{else}-->
|
|
139
|
-
<control_input :auto="true" v-model="o.${v.name}" @blur="set(o)" />
|
|
140
|
-
<!--{/if}-->
|
|
141
|
-
</td>
|
|
142
|
-
<!--{/if}-->
|
|
143
|
-
<!--{/if}-->
|
|
144
|
-
<!--{/loop}-->
|
|
145
|
-
<td>
|
|
146
|
-
<a class="mm_btn btn-primary"
|
|
147
|
-
:href="'./${name}_form?${sql.key}=' + o[field]">修改</a>
|
|
148
|
-
<button class="mm_btn btn_warning"
|
|
149
|
-
@click.native="del_show(o, field)">删除</button>
|
|
150
|
-
</td>
|
|
151
|
-
</tr>
|
|
152
|
-
</tbody>
|
|
153
|
-
</table>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
<mm_modal v-model="show" mask="true">
|
|
162
|
-
<div class="mm_card" class="card">
|
|
163
|
-
<div class="card_head">
|
|
164
|
-
<h5>批量修改</h5>
|
|
165
|
-
</div>
|
|
166
|
-
<div class="card_body pa">
|
|
167
|
-
<dl>
|
|
168
|
-
<!--{loop field v idx}-->
|
|
169
|
-
<!--{if(v.show.batch)}-->
|
|
170
|
-
<dt>${v.title}</dt>
|
|
171
|
-
<dd>
|
|
172
|
-
<!--{if(v.show.batch === "input")}-->
|
|
173
|
-
<control_input v-model="form.${v.name}" />
|
|
174
|
-
<!--{else if(v.show.batch === "select")}-->
|
|
175
|
-
<!--{if(v.format.table)}-->
|
|
176
|
-
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
177
|
-
<control_select type="list" v-model="form.${v.format.key}"
|
|
178
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
179
|
-
<!--{else}-->
|
|
180
|
-
<control_select v-model="form.${v.format.key}"
|
|
181
|
-
:options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
182
|
-
<!--{/if}-->
|
|
183
|
-
<!--{else}-->
|
|
184
|
-
<control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
|
|
185
|
-
<!--{/if}-->
|
|
186
|
-
<!--{/if}-->
|
|
187
|
-
</dd>
|
|
188
|
-
<!--{/if}-->
|
|
189
|
-
<!--{/loop}-->
|
|
190
|
-
</dl>
|
|
191
|
-
</div>
|
|
192
|
-
<div class="card_foot">
|
|
193
|
-
<div class="mm_group">
|
|
194
|
-
<button class="mm_btn btn_default" type="reset" @click="show = false">取消</button>
|
|
195
|
-
<button class="mm_btn btn-primary" type="button" @click="batchSet()">提交</button>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
199
|
-
</mm_modal>
|
|
200
|
-
</main>
|
|
201
|
-
</template>
|
|
202
|
-
|
|
203
|
-
<script>
|
|
204
|
-
import mixin from '/src/mixins/page.js';
|
|
205
|
-
|
|
206
|
-
export default {
|
|
207
|
-
mixins: [mixin],
|
|
208
|
-
data() {
|
|
209
|
-
return {
|
|
210
|
-
// 列表请求地址
|
|
211
|
-
url_get_list: "${api.path}",
|
|
212
|
-
url_del: "${api.path}?method=del&",
|
|
213
|
-
url_set: "${api.path}?method=set&",
|
|
214
|
-
url_import: "${api.path}?method=import&",
|
|
215
|
-
url_export: "${api.path}?method=export&",
|
|
216
|
-
field: "${sql.key}",
|
|
217
|
-
query_set: {
|
|
218
|
-
"${sql.key}": ""
|
|
219
|
-
},
|
|
220
|
-
// 查询条件
|
|
221
|
-
query: {
|
|
222
|
-
//排序
|
|
223
|
-
orderby: "",
|
|
224
|
-
// 上级分类ID
|
|
225
|
-
father_id: '',
|
|
226
|
-
// 关键词
|
|
227
|
-
keyword: ''
|
|
228
|
-
},
|
|
229
|
-
form: {},
|
|
230
|
-
//颜色
|
|
231
|
-
arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info',
|
|
232
|
-
'font_default'
|
|
233
|
-
],
|
|
234
|
-
/*[loop js.data v idx]*/
|
|
235
|
-
// ${' ' + v.title}
|
|
236
|
-
'${v.name}': ${@JSON.stringify(v.value)},
|
|
237
|
-
/*[/loop]*/
|
|
238
|
-
// 视图模型
|
|
239
|
-
vm: {}
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
methods: {
|
|
243
|
-
/*[loop js.data v idx]*/
|
|
244
|
-
/*[if(v.path)]*/
|
|
245
|
-
/**
|
|
246
|
-
* 获取 ${v.title}
|
|
247
|
-
* @param {query} 查询条件
|
|
248
|
-
*/
|
|
249
|
-
get_/*[v.basename]*/(query) {
|
|
250
|
-
var _this = this;
|
|
251
|
-
if (!query) {
|
|
252
|
-
query = {
|
|
253
|
-
field: "${v.id},${v.field}${v.father_id ? ',' + v.father_id : '' }${v.title_name ? ',title' : '' }"
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
this.$get('~${v.path}', query, function(json) {
|
|
257
|
-
if (json.result) {
|
|
258
|
-
_this/*['.' + v.name]*/.clear();
|
|
259
|
-
_this/*['.' + v.name]*/.addList(json.result.list)
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
},
|
|
263
|
-
/*[/if]*/
|
|
264
|
-
/*[/loop]*/
|
|
265
|
-
/**
|
|
266
|
-
* 获取列表之前
|
|
267
|
-
* @param {Object} param 参数
|
|
268
|
-
*/
|
|
269
|
-
get_list_before(param) {
|
|
270
|
-
delete param.page;
|
|
271
|
-
param.size = "0";
|
|
272
|
-
return param;
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
created() {
|
|
276
|
-
/*[loop js.data v idx]*/
|
|
277
|
-
/*[if(v.path)]*/
|
|
278
|
-
// 获取 ${v.title}
|
|
279
|
-
this.get_/*[v.basename]*/();
|
|
280
|
-
/*[/if]*/
|
|
281
|
-
/*[/loop]*/
|
|
282
|
-
},
|
|
283
|
-
computed: {
|
|
284
|
-
list_new() {
|
|
285
|
-
var list = [];
|
|
286
|
-
var {
|
|
287
|
-
keyword,
|
|
288
|
-
father_id
|
|
289
|
-
} = this.query;
|
|
290
|
-
|
|
291
|
-
if (keyword && father_id) {
|
|
292
|
-
return this.list.filter(function(o) {
|
|
293
|
-
return o.father_id == father_id && (o.title.indexOf(keyword) !== -1 || o.name.indexOf(
|
|
294
|
-
keyword) !== -1);
|
|
295
|
-
});
|
|
296
|
-
} else if (father_id) {
|
|
297
|
-
return this.list.filter(function(o) {
|
|
298
|
-
return o.father_id == father_id;
|
|
299
|
-
});
|
|
300
|
-
} else if (keyword) {
|
|
301
|
-
return this.list.filter(function(o) {
|
|
302
|
-
return o.title.indexOf(keyword) !== -1 || o.name.indexOf(keyword) !== -1;
|
|
303
|
-
});
|
|
304
|
-
} else {
|
|
305
|
-
var lt = this.list.toTree(this.field).toList();
|
|
306
|
-
var arr = this.opens;
|
|
307
|
-
for (var i = 0; i < lt.length; i++) {
|
|
308
|
-
var o = lt[i];
|
|
309
|
-
if (this.opens.indexOf(o[this.father_id]) !== -1) {
|
|
310
|
-
list.push(o);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return list;
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
</script>
|
|
319
|
-
|
|
320
|
-
<style>
|
|
321
|
-
</style>
|