mm_os 2.8.7 → 2.8.9
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/core/base/index.js +28 -28
- package/core/base/mqtt/index.js +314 -314
- package/core/base/mqtt/lib.js +39 -39
- package/core/base/web/index.js +109 -109
- package/core/com/mqtt/index.js +2 -6
- package/core/com/nav/tpl/admin_pc/page_channel.vue +137 -131
- package/core/com/nav/tpl/admin_pc/page_config.vue +280 -279
- package/core/com/nav/tpl/admin_pc/page_config_form.vue +194 -194
- package/core/com/nav/tpl/admin_pc/page_default.vue +47 -87
- package/core/com/nav/tpl/admin_pc/page_form.vue +19 -19
- package/core/com/nav/tpl/admin_pc/page_lang.vue +44 -45
- package/core/com/nav/tpl/admin_pc/page_nav.vue +140 -132
- package/core/com/nav/tpl/admin_pc/page_table.vue +135 -124
- package/core/com/nav/tpl/admin_pc/page_type.vue +139 -131
- package/core/com/nav/tpl/admin_pc/page_view.vue +124 -0
- package/core/com/nav/tpl/dev_pc/page_channel.vue +34 -34
- package/core/com/nav/tpl/dev_pc/page_config.vue +26 -26
- package/core/com/nav/tpl/dev_pc/page_default.vue +4 -4
- package/core/com/nav/tpl/dev_pc/page_form.vue +2 -2
- package/core/com/nav/tpl/dev_pc/page_nav.vue +34 -34
- package/core/com/nav/tpl/dev_pc/page_table.vue +34 -34
- package/core/com/nav/tpl/dev_pc/page_type.vue +131 -71
- package/core/com/nav/tpl/home_pc/page_default.vue +2 -2
- package/core/com/nav/tpl/home_pc/page_form.vue +2 -2
- package/core/com/nav/tpl/home_pc/page_view.vue +2 -2
- package/core/com/nav/tpl/home_phone/page_form.vue +2 -2
- package/core/com/nav/tpl/home_phone/page_list.vue +2 -2
- package/core/com/nav/tpl/home_phone/page_view.vue +2 -2
- package/demo/index.js +28 -0
- package/middleware/cors/index.js +84 -84
- package/middleware/cors/middleware.json +6 -6
- package/middleware/log/index.js +20 -20
- package/middleware/log/middleware.json +8 -8
- package/middleware/mqtt_base/index.js +10 -10
- package/middleware/mqtt_base/middleware.json +7 -7
- package/middleware/waf/index.js +64 -64
- package/middleware/waf/middleware.json +8 -8
- package/middleware/waf_ip/index.js +115 -115
- package/middleware/waf_ip/middleware.json +9 -9
- package/middleware/web_base/index.js +65 -65
- package/middleware/web_base/middleware.json +8 -8
- package/middleware/web_event/index.js +412 -412
- package/middleware/web_event/middleware.json +9 -9
- package/middleware/web_proxy/index.js +23 -23
- package/middleware/web_proxy/middleware.json +8 -8
- package/middleware/web_router/index.js +33 -33
- package/middleware/web_router/middleware.json +9 -9
- package/middleware/web_socket/index.js +21 -21
- package/middleware/web_socket/middleware.json +8 -8
- package/middleware/web_static/index.js +25 -25
- package/middleware/web_static/middleware.json +8 -8
- package/package.json +8 -8
- package/static/file/image/user/42/2025_01_02_10_58_15.png +0 -0
|
@@ -1,279 +1,280 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<main id="${id}">
|
|
3
|
-
<mm_warp>
|
|
4
|
-
<mm_container>
|
|
5
|
-
<mm_row>
|
|
6
|
-
<
|
|
7
|
-
<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
|
-
<
|
|
13
|
-
<div class="title">
|
|
14
|
-
<h5><span>筛选条件</span></h5>
|
|
15
|
-
</div>
|
|
16
|
-
<
|
|
17
|
-
<!--{loop param.list v idx}-->
|
|
18
|
-
<!--{if(v.name === 'keyword')}-->
|
|
19
|
-
<mm_item>
|
|
20
|
-
<control_input v-model="query.keyword" title="${v.title}" desc="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}"
|
|
21
|
-
@blur="search()" />
|
|
22
|
-
</
|
|
23
|
-
<!--{/if}-->
|
|
24
|
-
<!--{/loop}-->
|
|
25
|
-
<!--{loop field v idx}-->
|
|
26
|
-
<!--{if(v.show.search)}-->
|
|
27
|
-
<!--{if(v.show.search === "input")}-->
|
|
28
|
-
<mm_item>
|
|
29
|
-
<control_input v-model="query.${v.name}" title="${v.title}" @blur="search()" />
|
|
30
|
-
</
|
|
31
|
-
<!--{else if(v.show.search === "select")}-->
|
|
32
|
-
<!--{if(v.format.table)}-->
|
|
33
|
-
<mm_item>
|
|
34
|
-
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
35
|
-
<control_select type="list" 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()" />
|
|
36
|
-
<!--{else}-->
|
|
37
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')"
|
|
38
|
-
@change="search()" />
|
|
39
|
-
<!--{/if}-->
|
|
40
|
-
</
|
|
41
|
-
<!--{else if(v.format.key.indexOf('user_id') !== -1)}-->
|
|
42
|
-
<mm_item>
|
|
43
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
|
|
44
|
-
</
|
|
45
|
-
<!--{else}-->
|
|
46
|
-
<mm_item>
|
|
47
|
-
<control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
|
|
48
|
-
</
|
|
49
|
-
<!--{/if}-->
|
|
50
|
-
<!--{/if}-->
|
|
51
|
-
<!--{/if}-->
|
|
52
|
-
<!--{/loop}-->
|
|
53
|
-
<mm_item>
|
|
54
|
-
<
|
|
55
|
-
</
|
|
56
|
-
</
|
|
57
|
-
</
|
|
58
|
-
<div class="bar_action">
|
|
59
|
-
<h5><span>操作</span></h5>
|
|
60
|
-
<div class="btns">
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
</div>
|
|
64
|
-
<div class="btn_small">
|
|
65
|
-
<control_file class="btn_default-x" type="excel" :func="import_db" v-if="url_import"></control_file>
|
|
66
|
-
<
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<
|
|
70
|
-
<thead class="table-sm">
|
|
71
|
-
<tr>
|
|
72
|
-
<th class="th_id"><span>#</span></th>
|
|
73
|
-
<!--{loop field v idx}-->
|
|
74
|
-
<!--{if(v.show.table)}-->
|
|
75
|
-
<!--{if(v.name !== sql.key)}-->
|
|
76
|
-
<th class="th_${v.name}">
|
|
77
|
-
<control_reverse title="${v.title}" v-model="query.orderby" field="${v.name}" :func="search"></control_reverse>
|
|
78
|
-
</th>
|
|
79
|
-
<!--{/if}-->
|
|
80
|
-
<!--{/if}-->
|
|
81
|
-
<!--{/loop}-->
|
|
82
|
-
<th class="th_handle"><span>操作</span></th>
|
|
83
|
-
</tr>
|
|
84
|
-
</thead>
|
|
85
|
-
<tbody>
|
|
86
|
-
<!-- <draggable v-model="list" tag="tbody" @change="sort_change"> -->
|
|
87
|
-
<tr v-for="(o, idx) in list" :key="idx" :class="{'active': select == idx}" @click="selected(idx)">
|
|
88
|
-
<td>{{ o[field] }}</td>
|
|
89
|
-
<!--{loop field v idx}-->
|
|
90
|
-
<!--{if(v.show.table)}-->
|
|
91
|
-
<!--{if(v.name !== sql.key)}-->
|
|
92
|
-
<td>
|
|
93
|
-
<!--{if(v.dataType === 'tinyint')}-->
|
|
94
|
-
<control_switch v-model="o.${v.name}" @click.native="set(o)" />
|
|
95
|
-
<!--{else if(v.format)}-->
|
|
96
|
-
<!--{if(v.format.table)}-->
|
|
97
|
-
<span>{{ $get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span>
|
|
98
|
-
<!--{else if(v.name == 'state' || v.name == 'status')}-->
|
|
99
|
-
<span v-bind:class="arr_color[o.${v.name}]">{{ ${v.label}[o.${v.name}] }}</span>
|
|
100
|
-
<!--{else}-->
|
|
101
|
-
<control_select v-model="o.${v.name}" :options="$to_kv(${v.label})" @change.native="set(o)" />
|
|
102
|
-
<!--{/if}-->
|
|
103
|
-
<!--{else if(v.name.indexOf('img') !== -1 || v.name.indexOf('icon') !== -1 || v.name === 'avatar')}-->
|
|
104
|
-
<img class="${v.name}" :src="o.${v.name}" alt="${v.title}" />
|
|
105
|
-
<!--{else if(v.dataType === 'date')}-->
|
|
106
|
-
<span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd') }}</span>
|
|
107
|
-
<!--{else if(v.dataType === 'time')}-->
|
|
108
|
-
<span>{{ o.${v.name} }}</span>
|
|
109
|
-
<!--{else if(v.dataType === 'timestamp' || v.dataType === 'datetime')}-->
|
|
110
|
-
<span>{{
|
|
111
|
-
<!--{else if(v.name === 'display' || v.name === 'orderby')}-->
|
|
112
|
-
<input class="input_display" v-model.number="o.${v.name}" @blur="set(o)" min="0" max="1000" />
|
|
113
|
-
<!--{else if(v.name === 'value')}-->
|
|
114
|
-
<
|
|
115
|
-
<
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<!--{/if}-->
|
|
130
|
-
<!--{/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<!--{
|
|
154
|
-
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
<!--{/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
<button class="
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
</
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
import
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
/*[/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
/*[
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
*
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
_this
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
/*[/
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
*
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
param.
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
/*[
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
/*[
|
|
273
|
-
/*[/
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<main id="${id}">
|
|
3
|
+
<div class="mm_warp">
|
|
4
|
+
<div class="mm_container">
|
|
5
|
+
<div class="mm_row">
|
|
6
|
+
<div class="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 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}" desc="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}"
|
|
21
|
+
@blur="search()" />
|
|
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}" @blur="search()" />
|
|
30
|
+
</div>
|
|
31
|
+
<!--{else if(v.show.search === "select")}-->
|
|
32
|
+
<!--{if(v.format.table)}-->
|
|
33
|
+
<div class="mm_item">
|
|
34
|
+
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
35
|
+
<control_select type="list" 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()" />
|
|
36
|
+
<!--{else}-->
|
|
37
|
+
<control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')"
|
|
38
|
+
@change="search()" />
|
|
39
|
+
<!--{/if}-->
|
|
40
|
+
</div>
|
|
41
|
+
<!--{else if(v.format.key.indexOf('user_id') !== -1)}-->
|
|
42
|
+
<div class="mm_item">
|
|
43
|
+
<control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
|
|
44
|
+
</div>
|
|
45
|
+
<!--{else}-->
|
|
46
|
+
<div class="mm_item">
|
|
47
|
+
<control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
|
|
48
|
+
</div>
|
|
49
|
+
<!--{/if}-->
|
|
50
|
+
<!--{/if}-->
|
|
51
|
+
<!--{/if}-->
|
|
52
|
+
<!--{/loop}-->
|
|
53
|
+
<div class="mm_item">
|
|
54
|
+
<button class="mm_btn btn_primary-x" type="reset" @click="reset();search()">重置</button>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</form>
|
|
58
|
+
<div class="bar_action">
|
|
59
|
+
<h5><span>操作</span></h5>
|
|
60
|
+
<div class="btns">
|
|
61
|
+
<button class="mm_btn btn_primary-x" url="./${name}_form?">添加</button>
|
|
62
|
+
<button @click="show = true" class="mm_btn btn_primary-x" v-bind:class="{ 'disabled': !selects }">批量修改</button>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="btn_small">
|
|
65
|
+
<control_file class="btn_default-x" type="excel" :func="import_db" v-if="url_import"></control_file>
|
|
66
|
+
<button class="mm_btn btn_default-x" @click="export_db()" v-if="url_export">导出</button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="mm_table table-2">
|
|
70
|
+
<thead class="table-sm">
|
|
71
|
+
<tr>
|
|
72
|
+
<th class="th_id"><span>#</span></th>
|
|
73
|
+
<!--{loop field v idx}-->
|
|
74
|
+
<!--{if(v.show.table)}-->
|
|
75
|
+
<!--{if(v.name !== sql.key)}-->
|
|
76
|
+
<th class="th_${v.name}">
|
|
77
|
+
<control_reverse title="${v.title}" v-model="query.orderby" field="${v.name}" :func="search"></control_reverse>
|
|
78
|
+
</th>
|
|
79
|
+
<!--{/if}-->
|
|
80
|
+
<!--{/if}-->
|
|
81
|
+
<!--{/loop}-->
|
|
82
|
+
<th class="th_handle"><span>操作</span></th>
|
|
83
|
+
</tr>
|
|
84
|
+
</thead>
|
|
85
|
+
<tbody>
|
|
86
|
+
<!-- <draggable v-model="list" tag="tbody" @change="sort_change"> -->
|
|
87
|
+
<tr v-for="(o, idx) in list" :key="idx" :class="{'active': select == idx}" @click="selected(idx)">
|
|
88
|
+
<td>{{ o[field] }}</td>
|
|
89
|
+
<!--{loop field v idx}-->
|
|
90
|
+
<!--{if(v.show.table)}-->
|
|
91
|
+
<!--{if(v.name !== sql.key)}-->
|
|
92
|
+
<td>
|
|
93
|
+
<!--{if(v.dataType === 'tinyint')}-->
|
|
94
|
+
<control_switch v-model="o.${v.name}" @click.native="set(o)" />
|
|
95
|
+
<!--{else if(v.format)}-->
|
|
96
|
+
<!--{if(v.format.table)}-->
|
|
97
|
+
<span>{{ $get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span>
|
|
98
|
+
<!--{else if(v.name == 'state' || v.name == 'status')}-->
|
|
99
|
+
<span v-bind:class="arr_color[o.${v.name}]">{{ ${v.label}[o.${v.name}] }}</span>
|
|
100
|
+
<!--{else}-->
|
|
101
|
+
<control_select v-model="o.${v.name}" :options="$to_kv(${v.label})" @change.native="set(o)" />
|
|
102
|
+
<!--{/if}-->
|
|
103
|
+
<!--{else if(v.name.indexOf('img') !== -1 || v.name.indexOf('icon') !== -1 || v.name === 'avatar')}-->
|
|
104
|
+
<img class="${v.name}" :src="o.${v.name}" alt="${v.title}" />
|
|
105
|
+
<!--{else if(v.dataType === 'date')}-->
|
|
106
|
+
<span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd') }}</span>
|
|
107
|
+
<!--{else if(v.dataType === 'time')}-->
|
|
108
|
+
<span>{{ o.${v.name} }}</span>
|
|
109
|
+
<!--{else if(v.dataType === 'timestamp' || v.dataType === 'datetime')}-->
|
|
110
|
+
<span>{{ _time(o.${v.name}, 'yyyy-MM-dd hh:mm') }}</span>
|
|
111
|
+
<!--{else if(v.name === 'display' || v.name === 'orderby')}-->
|
|
112
|
+
<input class="input_display" v-model.number="o.${v.name}" @blur="set(o)" min="0" max="1000" />
|
|
113
|
+
<!--{else if(v.name === 'value')}-->
|
|
114
|
+
<control_number v-if="o.control == 'number'" tag="number" v-model="o.${v.name}" @change="set(o)" />
|
|
115
|
+
<control_select v-else-if="o.control == 'select'" tag="select" v-model="o.${v.name}" :mod="o.model" @change="set(o)" />
|
|
116
|
+
<control_checkbox v-else-if="o.control == 'checkbox' || o.control == 'radio'" :tag="o.control" v-model="o.${v.name}" :mod="o.model" @change="set(o)" />
|
|
117
|
+
<template v-else-if="o.control == 'image'">
|
|
118
|
+
<control_upload_img width="10rem" height="10rem" name="${v.name}" v-model="form.${v.name}"></control_upload_img>
|
|
119
|
+
<control_input class="mt-2" v-model="form.${v.name}" type="text"></control_input>
|
|
120
|
+
</template>
|
|
121
|
+
<control_file class="bg_white" v-else-if="o.control == 'file'" accept="*.*" @change="$setFile(o, $event)">
|
|
122
|
+
<span>{{o.${v.name}}}</span><a class="btn" v-if="o.${v.name}.indexOf('/') === 0" :href="$url(o.${v.name})"><span>下载</span></a>
|
|
123
|
+
</control_file>
|
|
124
|
+
<control_com v-else :auto="true" :tag="o.control" v-model="o.${v.name}" @change="set(o)" />
|
|
125
|
+
<!--{else}-->
|
|
126
|
+
<span>{{ o.${v.name} }}</span>
|
|
127
|
+
<!--{/if}-->
|
|
128
|
+
</td>
|
|
129
|
+
<!--{/if}-->
|
|
130
|
+
<!--{/if}-->
|
|
131
|
+
<!--{/loop}-->
|
|
132
|
+
<td>
|
|
133
|
+
<a class="mm_btn btn_primary" :href="'./${name}_form?${sql.key}=' + o[field]">修改</a>
|
|
134
|
+
<button class="mm_btn btn_warning" @click="del_show(o, field)">删除</button>
|
|
135
|
+
</td>
|
|
136
|
+
</tr>
|
|
137
|
+
</tbody>
|
|
138
|
+
<!-- </draggable> -->
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<mm_modal v-model="show" mask="true">
|
|
147
|
+
<div class="mm_card card">
|
|
148
|
+
<div class="card_head">
|
|
149
|
+
<h5>批量修改</h5>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="card_body pa">
|
|
152
|
+
<dl>
|
|
153
|
+
<!--{loop field v idx}-->
|
|
154
|
+
<!--{if(v.show.batch)}-->
|
|
155
|
+
<dt>${v.title}</dt>
|
|
156
|
+
<dd>
|
|
157
|
+
<!--{if(v.show.batch === "input")}-->
|
|
158
|
+
<control_input v-model="form.${v.name}" />
|
|
159
|
+
<!--{else if(v.show.batch === "select")}-->
|
|
160
|
+
<!--{if(v.format.table)}-->
|
|
161
|
+
<!--{if(v.format.key.endWith('_id') !== -1)}-->
|
|
162
|
+
<control_select type="list" v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
163
|
+
<!--{else}-->
|
|
164
|
+
<control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
|
|
165
|
+
<!--{/if}-->
|
|
166
|
+
<!--{else}-->
|
|
167
|
+
<control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
|
|
168
|
+
<!--{/if}-->
|
|
169
|
+
<!--{/if}-->
|
|
170
|
+
</dd>
|
|
171
|
+
<!--{/if}-->
|
|
172
|
+
<!--{/loop}-->
|
|
173
|
+
</dl>
|
|
174
|
+
</div>
|
|
175
|
+
<div class="card_foot">
|
|
176
|
+
<div class="mm_group">
|
|
177
|
+
<button class="mm_btn btn_default" type="reset" @click="show = false">取消</button>
|
|
178
|
+
<button class="mm_btn btn_primary" type="button" @click="batchSet()">提交</button>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</mm_modal>
|
|
183
|
+
</main>
|
|
184
|
+
</template>
|
|
185
|
+
|
|
186
|
+
<script>
|
|
187
|
+
import control_com from '/src/components/control/control_com.vue';
|
|
188
|
+
import mixin from '/src/mixins/page.js';
|
|
189
|
+
|
|
190
|
+
export default {
|
|
191
|
+
mixins: [mixin],
|
|
192
|
+
components: {
|
|
193
|
+
control_com
|
|
194
|
+
},
|
|
195
|
+
data() {
|
|
196
|
+
return {
|
|
197
|
+
// 列表请求地址
|
|
198
|
+
url_get_list: "${api.path}",
|
|
199
|
+
url_del: "${api.path}?method=del&",
|
|
200
|
+
url_set: "${api.path}?method=set&",
|
|
201
|
+
url_import: "${api.path}?method=import&",
|
|
202
|
+
url_export: "${api.path}?method=export&",
|
|
203
|
+
field: "${sql.key}",
|
|
204
|
+
query_set: {
|
|
205
|
+
"${sql.key}": ""
|
|
206
|
+
},
|
|
207
|
+
// 查询条件
|
|
208
|
+
query: {
|
|
209
|
+
//页码
|
|
210
|
+
page: 0,
|
|
211
|
+
//页面大小
|
|
212
|
+
size: '0',
|
|
213
|
+
/*[loop js.query v idx]*/
|
|
214
|
+
// ${' ' + v.title}
|
|
215
|
+
/*[if v.type === 'number' && !v.select]*/
|
|
216
|
+
'${v.name}': 0,
|
|
217
|
+
/*[else]*/
|
|
218
|
+
'${v.name}': '',
|
|
219
|
+
/*[/if]*/
|
|
220
|
+
/*[/loop]*/
|
|
221
|
+
//排序
|
|
222
|
+
orderby: ""
|
|
223
|
+
},
|
|
224
|
+
form: {},
|
|
225
|
+
//颜色
|
|
226
|
+
arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info', 'font_default'],
|
|
227
|
+
/*[loop js.data v idx]*/
|
|
228
|
+
// ${' ' + v.title}
|
|
229
|
+
'${v.name}': ${@JSON.stringify(v.value)},
|
|
230
|
+
/*[/loop]*/
|
|
231
|
+
// 视图模型
|
|
232
|
+
vm: {}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
methods: {
|
|
236
|
+
/*[loop js.data v idx]*/
|
|
237
|
+
/*[if(v.path)]*/
|
|
238
|
+
/**
|
|
239
|
+
* 获取 ${v.title}
|
|
240
|
+
* @param {query} 查询条件
|
|
241
|
+
*/
|
|
242
|
+
get_/*[v.basename]*/(query) {
|
|
243
|
+
var _this = this;
|
|
244
|
+
if (!query) {
|
|
245
|
+
query = {
|
|
246
|
+
field: "${v.id},${v.field}${v.father_id ? ',' + v.father_id : '' }${v.title_name ? ',title' : '' }"
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
this.$get('~${v.path}', query, function(json) {
|
|
250
|
+
if (json.result) {
|
|
251
|
+
_this/*['.' + v.name]*/.clear();
|
|
252
|
+
_this/*['.' + v.name]*/.addList(json.result.list)
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
},
|
|
256
|
+
/*[/if]*/
|
|
257
|
+
/*[/loop]*/
|
|
258
|
+
/**
|
|
259
|
+
* 获取列表之前
|
|
260
|
+
* @param {Object} param 参数
|
|
261
|
+
*/
|
|
262
|
+
get_list_before(param){
|
|
263
|
+
delete param.page;
|
|
264
|
+
param.size = "0";
|
|
265
|
+
return param;
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
created() {
|
|
269
|
+
/*[loop js.data v idx]*/
|
|
270
|
+
/*[if(v.path)]*/
|
|
271
|
+
// 获取 ${v.title}
|
|
272
|
+
this.get_/*[v.basename]*/();
|
|
273
|
+
/*[/if]*/
|
|
274
|
+
/*[/loop]*/
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
</script>
|
|
278
|
+
|
|
279
|
+
<style>
|
|
280
|
+
</style>
|