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.
Files changed (53) hide show
  1. package/core/base/index.js +28 -28
  2. package/core/base/mqtt/index.js +314 -314
  3. package/core/base/mqtt/lib.js +39 -39
  4. package/core/base/web/index.js +109 -109
  5. package/core/com/mqtt/index.js +2 -6
  6. package/core/com/nav/tpl/admin_pc/page_channel.vue +137 -131
  7. package/core/com/nav/tpl/admin_pc/page_config.vue +280 -279
  8. package/core/com/nav/tpl/admin_pc/page_config_form.vue +194 -194
  9. package/core/com/nav/tpl/admin_pc/page_default.vue +47 -87
  10. package/core/com/nav/tpl/admin_pc/page_form.vue +19 -19
  11. package/core/com/nav/tpl/admin_pc/page_lang.vue +44 -45
  12. package/core/com/nav/tpl/admin_pc/page_nav.vue +140 -132
  13. package/core/com/nav/tpl/admin_pc/page_table.vue +135 -124
  14. package/core/com/nav/tpl/admin_pc/page_type.vue +139 -131
  15. package/core/com/nav/tpl/admin_pc/page_view.vue +124 -0
  16. package/core/com/nav/tpl/dev_pc/page_channel.vue +34 -34
  17. package/core/com/nav/tpl/dev_pc/page_config.vue +26 -26
  18. package/core/com/nav/tpl/dev_pc/page_default.vue +4 -4
  19. package/core/com/nav/tpl/dev_pc/page_form.vue +2 -2
  20. package/core/com/nav/tpl/dev_pc/page_nav.vue +34 -34
  21. package/core/com/nav/tpl/dev_pc/page_table.vue +34 -34
  22. package/core/com/nav/tpl/dev_pc/page_type.vue +131 -71
  23. package/core/com/nav/tpl/home_pc/page_default.vue +2 -2
  24. package/core/com/nav/tpl/home_pc/page_form.vue +2 -2
  25. package/core/com/nav/tpl/home_pc/page_view.vue +2 -2
  26. package/core/com/nav/tpl/home_phone/page_form.vue +2 -2
  27. package/core/com/nav/tpl/home_phone/page_list.vue +2 -2
  28. package/core/com/nav/tpl/home_phone/page_view.vue +2 -2
  29. package/demo/index.js +28 -0
  30. package/middleware/cors/index.js +84 -84
  31. package/middleware/cors/middleware.json +6 -6
  32. package/middleware/log/index.js +20 -20
  33. package/middleware/log/middleware.json +8 -8
  34. package/middleware/mqtt_base/index.js +10 -10
  35. package/middleware/mqtt_base/middleware.json +7 -7
  36. package/middleware/waf/index.js +64 -64
  37. package/middleware/waf/middleware.json +8 -8
  38. package/middleware/waf_ip/index.js +115 -115
  39. package/middleware/waf_ip/middleware.json +9 -9
  40. package/middleware/web_base/index.js +65 -65
  41. package/middleware/web_base/middleware.json +8 -8
  42. package/middleware/web_event/index.js +412 -412
  43. package/middleware/web_event/middleware.json +9 -9
  44. package/middleware/web_proxy/index.js +23 -23
  45. package/middleware/web_proxy/middleware.json +8 -8
  46. package/middleware/web_router/index.js +33 -33
  47. package/middleware/web_router/middleware.json +9 -9
  48. package/middleware/web_socket/index.js +21 -21
  49. package/middleware/web_socket/middleware.json +8 -8
  50. package/middleware/web_static/index.js +25 -25
  51. package/middleware/web_static/middleware.json +8 -8
  52. package/package.json +8 -8
  53. package/static/file/image/user/42/2025_01_02_10_58_15.png +0 -0
@@ -1,161 +1,165 @@
1
1
  <template>
2
2
  <main id="${id}">
3
- <mm_warp>
4
- <mm_container>
5
- <mm_row>
6
- <mm_col class="col-12">
7
- <mm_card :class="{ 'hide_filter': !show_filter }">
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
8
  <div class="card_head arrow" @click="show_filter = !show_filter">
9
9
  <h5>${api.title}</h5>
10
10
  </div>
11
11
  <div class="card_body">
12
- <mm_form class="bar_filter">
12
+ <form class="mm_form" class="bar_filter">
13
13
  <div class="title">
14
14
  <h5><span>筛选条件</span></h5>
15
15
  </div>
16
- <mm_list :col="3">
16
+ <div class="mm_list list-3">
17
17
  <!--{loop param.list v idx}-->
18
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
- />
22
- </mm_item>
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
23
  <!--{/if}-->
24
24
  <!--{/loop}-->
25
25
  <!--{loop field v idx}-->
26
26
  <!--{if(v.show.search)}-->
27
27
  <!--{if(v.show.search === "input")}-->
28
- <mm_item>
29
- <control_input v-model="query.${v.name}" title="${v.title}" @blur="search()" />
30
- </mm_item>
28
+ <div class="mm_item">
29
+ <control_input v-model="query.${v.name}" title="${v.title}"
30
+ @blur="search()" />
31
+ </div>
31
32
  <!--{else if(v.show.search === "select")}-->
32
33
  <!--{if(v.format.table)}-->
33
- <mm_item>
34
+ <div class="mm_item">
34
35
  <!--{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
+ <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()" />
36
40
  <!--{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
- </mm_item>
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>
41
46
  <!--{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
- </mm_item>
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>
45
51
  <!--{else}-->
46
- <mm_item>
47
- <control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
48
- </mm_item>
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>
49
56
  <!--{/if}-->
50
57
  <!--{/if}-->
51
58
  <!--{/if}-->
52
59
  <!--{/loop}-->
53
- <mm_item>
54
- <mm_btn class="btn_primary-x" type="reset" @click.native="reset();">重置</mm_btn>
55
- </mm_item>
56
- </mm_list>
57
- </mm_form>
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>
58
66
  <div class="bar_action">
59
67
  <h5><span>操作</span></h5>
60
68
  <div class="btns">
61
- <mm_btn class="btn_primary-x" url="./${name}_form?">添加</mm_btn>
62
- <mm_btn @click.native="show = true" class="btn_primary-x" v-bind:class="{ 'disabled': !selects }">批量修改</mm_btn>
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>
63
72
  </div>
64
73
  <div class="btn_small">
65
- <control_file class="btn_default-x" type="excel" :func="import_db" v-if="url_import"></control_file>
66
- <mm_btn class="btn_default-x" @click.native="export_db()" v-if="url_export">导出</mm_btn>
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>
67
78
  </div>
68
79
  </div>
69
- <mm_table type="3">
70
- <thead class="table-sm">
71
- <tr>
72
- <th class="th_open"></th>
73
- <th class="th_selected"><input type="checkbox" :checked="select_state" @click="select_all()" /></th>
74
- <th class="th_id"><span>#</span></th>
75
- <!--{loop field v idx}-->
76
- <!--{if(v.show.table)}-->
77
- <!--{if(v.name !== sql.key)}-->
78
- <th class="th_${v.name}">
79
- <span>${v.title}</span>
80
- </th>
81
- <!--{/if}-->
82
- <!--{/if}-->
83
- <!--{/loop}-->
84
- <th class="th_handle"><span>操作</span></th>
85
- </tr>
86
- </thead>
87
- <tbody>
88
- <!-- <draggable v-model="list" tag="tbody" @change="sort_change"> -->
89
- <tr v-for="(o, idx) in list_new" :key="idx" :class="{'active': select == idx, sub: o[father_id], open: opens_has(o[field]), no_sub: !opens_has_sub(o[field]) }"
90
- @click="selected(idx)">
91
- <th class="th_open"><button class="btn_open" :style="'margin-left:' + (1.5 * opens_lv(o[father_id])) + 'rem;'"
92
- @click="opens_change(o[field])"><i class="fa-caret-right"></i></button></th>
93
- <th class="th_selected"><input type="checkbox" :checked="select_has(o[field])" @click="select_change(o[field])" /></th>
94
- <td>{{ o[field] }}</td>
95
- <!--{loop field v idx}-->
96
- <!--{if(v.show.table)}-->
97
- <!--{if(v.name !== sql.key)}-->
98
- <td>
99
- <!--{if(v.dataType === 'tinyint')}-->
100
- <control_switch v-model="o.${v.name}" @click.native="set(o)" />
101
- <!--{else if(v.format)}-->
102
- <!--{if(v.format.table)}-->
103
- <span>{{ $get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span>
104
- <!--{else if(v.name == 'state' || v.name == 'status')}-->
105
- <span v-bind:class="arr_color[o.${v.name}]">{{ ${v.label}[o.${v.name}] }}</span>
106
- <!--{else}-->
107
- <span>{{ ${v.label}[o.${v.name}] }}</span>
108
- <!--{/if}-->
109
- <!--{else if(v.name.indexOf('img') !== -1 || v.name.indexOf('icon') !== -1 || v.name === 'avatar')}-->
110
- <img class="${v.name}" :src="o.${v.name}" alt="${v.title}" />
111
- <!--{else if(v.dataType === 'date')}-->
112
- <span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd') }}</span>
113
- <!--{else if(v.dataType === 'time')}-->
114
- <span>{{ o.${v.name} }}</span>
115
- <!--{else if(v.dataType === 'timestamp' || v.dataType === 'datetime')}-->
116
- <span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd hh:mm') }}</span>
117
- <!--{else if(v.name === 'display' || v.name === 'orderby')}-->
118
- <input class="input_display" v-model.number="o.${v.name}" @blur="set(o)" min="0" max="1000" />
119
- <!--{else}-->
120
- <control_input :auto="true" v-model="o.${v.name}" @blur="set(o)" />
121
- <!--{/if}-->
122
- </td>
123
- <!--{/if}-->
124
- <!--{/if}-->
125
- <!--{/loop}-->
126
- <td>
127
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
128
- <mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
129
- </td>
130
- </tr>
131
- </tbody>
132
- <!-- </draggable> -->
133
-
134
- <template v-slot:right>
80
+ <div class="mm_table table-3">
81
+ <table>
135
82
  <thead class="table-sm">
136
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}-->
137
97
  <th class="th_handle"><span>操作</span></th>
138
98
  </tr>
139
99
  </thead>
140
100
  <tbody>
141
- <tr v-for="(o, idx) in list_new" :key="idx" :class="{'active': select == idx, sub: o[father_id], open: opens_has(o[field]), no_sub: !opens_has_sub(o[field]) }"
142
- @click="selected(idx)">
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}-->
143
145
  <td>
144
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
145
- <mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
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>
146
150
  </td>
147
151
  </tr>
148
152
  </tbody>
149
- </template>
150
- </mm_table>
153
+ </table>
154
+ </div>
151
155
  </div>
152
- </mm_card>
153
- </mm_col>
154
- </mm_row>
155
- </mm_container>
156
- </mm_warp>
156
+ </div>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
157
161
  <mm_modal v-model="show" mask="true">
158
- <mm_card class="card">
162
+ <div class="mm_card" class="card">
159
163
  <div class="card_head">
160
164
  <h5>批量修改</h5>
161
165
  </div>
@@ -165,19 +169,21 @@
165
169
  <!--{if(v.show.batch)}-->
166
170
  <dt>${v.title}</dt>
167
171
  <dd>
168
- <!--{if(v.show.batch === "input")}-->
169
- <control_input v-model="form.${v.name}" />
170
- <!--{else if(v.show.batch === "select")}-->
172
+ <!--{if(v.show.batch === "input")}-->
173
+ <control_input v-model="form.${v.name}" />
174
+ <!--{else if(v.show.batch === "select")}-->
171
175
  <!--{if(v.format.table)}-->
172
- <!--{if(v.format.key.endWith('_id') !== -1)}-->
173
- <control_select type="list" v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
174
- <!--{else}-->
175
- <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
176
- <!--{/if}-->
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}-->
177
183
  <!--{else}-->
178
184
  <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
179
185
  <!--{/if}-->
180
- <!--{/if}-->
186
+ <!--{/if}-->
181
187
  </dd>
182
188
  <!--{/if}-->
183
189
  <!--{/loop}-->
@@ -185,11 +191,11 @@
185
191
  </div>
186
192
  <div class="card_foot">
187
193
  <div class="mm_group">
188
- <button class="btn_default" type="reset" @click="show = false">取消</button>
189
- <button class="btn_primary" type="button" @click="batchSet()">提交</button>
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>
190
196
  </div>
191
197
  </div>
192
- </mm_card>
198
+ </div>
193
199
  </mm_modal>
194
200
  </main>
195
201
  </template>
@@ -222,7 +228,9 @@
222
228
  },
223
229
  form: {},
224
230
  //颜色
225
- arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info', 'font_default'],
231
+ arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info',
232
+ 'font_default'
233
+ ],
226
234
  /*[loop js.data v idx]*/
227
235
  // ${' ' + v.title}
228
236
  '${v.name}': ${@JSON.stringify(v.value)},
@@ -238,7 +246,7 @@
238
246
  * 获取 ${v.title}
239
247
  * @param {query} 查询条件
240
248
  */
241
- get_ /*[v.basename]*/(query) {
249
+ get_/*[v.basename]*/(query) {
242
250
  var _this = this;
243
251
  if (!query) {
244
252
  query = {
@@ -258,7 +266,7 @@
258
266
  * 获取列表之前
259
267
  * @param {Object} param 参数
260
268
  */
261
- get_list_before(param){
269
+ get_list_before(param) {
262
270
  delete param.page;
263
271
  param.size = "0";
264
272
  return param;
@@ -268,7 +276,7 @@
268
276
  /*[loop js.data v idx]*/
269
277
  /*[if(v.path)]*/
270
278
  // 获取 ${v.title}
271
- this.get_ /*[v.basename]*/();
279
+ this.get_/*[v.basename]*/();
272
280
  /*[/if]*/
273
281
  /*[/loop]*/
274
282
  },
@@ -279,7 +287,7 @@
279
287
  keyword,
280
288
  father_id
281
289
  } = this.query;
282
-
290
+
283
291
  if (keyword && father_id) {
284
292
  return this.list.filter(function(o) {
285
293
  return o.father_id == father_id && (o.title.indexOf(keyword) !== -1 || o.name.indexOf(
@@ -310,4 +318,4 @@
310
318
  </script>
311
319
 
312
320
  <style>
313
- </style>
321
+ </style>
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <main id="${id}">
3
+ <div class="mm_grid">
4
+ <div class="mm_col">
5
+ <form class="mm_form card">
6
+ <header class="arrow">
7
+ <h5>{{ form[field] ? '修改' : '创建' }}${api.title}</h5>
8
+ </header>
9
+ <dl>
10
+ <!--{loop field v idx}-->
11
+ <!--{if idx > 0}-->
12
+ <dt>${v.title}</dt>
13
+ <!--{if(v.format)}-->
14
+ <!--{if(v.format.table)}-->
15
+ <dd>
16
+ <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
17
+ </dd>
18
+ <!--{else}-->
19
+ <dd>
20
+ <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
21
+ </dd>
22
+ <!--{/if}-->
23
+ <!--{else if(v.dataType.indexOf('time') !== -1 || v.dataType.indexOf('date') !== -1)}-->
24
+ <dd>
25
+ <control_input v-model="form.${v.name}" type="datetime" />
26
+ </dd>
27
+ <!--{else if(v.dataType.indexOf('tinyint') !== -1)}-->
28
+ <dd>
29
+ <control_switch v-model="form.${v.name}" />
30
+ </dd>
31
+ <!--{else if(v.dataType.indexOf('text') !== -1)}-->
32
+ <dd>
33
+ <control_textarea v-model="form.${v.name}" type="text" placeholder="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}" />
34
+ </dd>
35
+ <!--{else if(v.type === 'number' && v.name.indexOf('id') === -1)}-->
36
+ <dd>
37
+ <control_number v-model="form.${v.name}" :min="0" :max="${v.number ? v.number.max : 0}" />
38
+ </dd>
39
+ <!--{else}-->
40
+ <dd>
41
+ <control_input v-model="form.${v.name}" :minlength="0" :maxlength="${v.string ? v.string.max : 0}" placeholder="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}" />
42
+ </dd>
43
+ <!--{/if}-->
44
+ <!--{/if}-->
45
+ <!--{/loop}-->
46
+ </dl>
47
+ <footer>
48
+ <div class="mm_group">
49
+ <button class="mm_btn btn_default" type="button" @click="cancel()">返回</button>
50
+ <button class="mm_btn btn_primary" type="button" @click="submit()">提交</button>
51
+ </div>
52
+ </footer>
53
+ </form>
54
+ </div>
55
+ </div>
56
+ </main>
57
+ </template>
58
+
59
+ <script>
60
+ import mixin from '/src/mixins/page.js';
61
+
62
+ export default {
63
+ mixins: [mixin],
64
+ components: {},
65
+ data() {
66
+ return {
67
+ url_submit: "${api.path}?",
68
+ url_get_obj: "${api.path}?method=get_obj",
69
+ field: "${sql.key}",
70
+ query: {
71
+ "${sql.key}": 0
72
+ },
73
+ form: {
74
+ /*[loop field v idx]*/
75
+ /*[if v.type === 'number']*/
76
+ "${v.name}": 0,
77
+ /*[else]*/
78
+ "${v.name}": '',
79
+ /*[/if]*/
80
+ /*[/loop]*/
81
+ },
82
+ /*[loop js.data v idx]*/
83
+ // ${' ' + v.title}
84
+ '${v.name}': [/*[loop v.value a idx]*//*[if idx == 0]*/'${a}'/*[else]*/,'${a}'/*[/if]*//*[/loop]*/],
85
+ /*[/loop]*/
86
+ }
87
+ },
88
+ methods: {
89
+ /*[loop js.data v idx]*/
90
+ /*[if(v.path)]*/
91
+ /**
92
+ * 获取 ${v.title}
93
+ * @param {query} 查询条件
94
+ */
95
+ get_/*[v.basename]*/(query){
96
+ var _this = this;
97
+ if(!query){
98
+ query = {
99
+ field: "${v.id},${v.field}"
100
+ };
101
+ }
102
+ this.$get('~${v.path}', query, function(json) {
103
+ if (json.result) {
104
+ _this/*['.' + v.name]*/.clear();
105
+ _this/*['.' + v.name]*/.addList(json.result.list)
106
+ }
107
+ });
108
+ },
109
+ /*[/if]*/
110
+ /*[/loop]*/
111
+ },
112
+ created() {
113
+ /*[loop js.data v idx]*/
114
+ /*[if(v.path)]*/
115
+ // 获取 ${v.title}
116
+ this.get_/*[v.basename]*/();
117
+ /*[/if]*/
118
+ /*[/loop]*/
119
+ }
120
+ }
121
+ </script>
122
+
123
+ <style>
124
+ </style>
@@ -1,60 +1,60 @@
1
1
  <template>
2
2
  <main id="${id}">
3
- <mm_warp>
4
- <mm_container>
5
- <mm_row>
6
- <mm_col class="col-12">
7
- <mm_card>
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">
8
8
  <div class="card_head arrow">
9
9
  <h5>${api.title}</h5>
10
10
  </div>
11
11
  <div class="card_body">
12
- <mm_form class="bar_filter">
12
+ <div class="mm_form" class="bar_filter">
13
13
  <div class="title">
14
14
  <h5><span>筛选条件</span></h5>
15
15
  </div>
16
- <mm_list :col="3">
16
+ <div class="mm_list list-3">
17
17
  <!--{if(param.list)}-->
18
18
  <!--{loop param.list v idx}-->
19
19
  <!--{if(v.name == 'keyword')}-->
20
- <mm_item>
20
+ <div class="mm_item">
21
21
  <control_input v-model="query.keyword" title="${v.title}" desc="${v.description.replace(/\([0-9A-Za-z_]+\)/g, '').replace('用于搜索', '').replace(/、/g, ' / ')}"
22
22
  @blur="search()" />
23
- </mm_item>
23
+ </div>
24
24
  <!--{/if}-->
25
25
  <!--{/loop}-->
26
26
  <!--{/if}-->
27
27
  <!--{loop field v idx}-->
28
28
  <!--{if(v.format)}-->
29
29
  <!--{if(v.format.table)}-->
30
- <mm_item>
30
+ <div class="mm_item">
31
31
  <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}')"
32
32
  @change="search()" />
33
- </mm_item>
33
+ </div>
34
34
  <!--{else}-->
35
- <mm_item>
35
+ <div class="mm_item">
36
36
  <control_select v-model="query.${v.format.key}" title="${v.title}" :options="$to_kv(${v.label})" @change="search()" />
37
- </mm_item>
37
+ </div>
38
38
  <!--{/if}-->
39
39
  <!--{/if}-->
40
40
  <!--{/loop}-->
41
- <mm_item>
42
- <mm_btn class="btn_primary-x" type="reset" @click.native="reset();search()">重置</mm_btn>
43
- </mm_item>
44
- </mm_list>
45
- </mm_form>
41
+ <div class="mm_item">
42
+ <button class="btn_primary-x" type="reset" @click.native="reset();search()">重置</button>
43
+ </div>
44
+ </div>
45
+ </div>
46
46
  <div class="bar_action">
47
47
  <h5><span>操作</span></h5>
48
48
  <div class="btns">
49
- <mm_btn class="btn_primary-x" url="./${name}_form?">添加</mm_btn>
50
- <mm_btn @click.native="show = true" class="btn_primary-x" v-bind:class="{ 'disabled': !selects }">批量修改</mm_btn>
49
+ <button class="btn_primary-x" url="./${name}_form?">添加</button>
50
+ <button @click.native="show = true" class="btn_primary-x" v-bind:class="{ 'disabled': !selects }">批量修改</button>
51
51
  </div>
52
52
  <div class="btn_small">
53
53
  <control_file class="btn_default-x" type="excel" :func="import_db" v-if="url_import"></control_file>
54
- <mm_btn class="btn_default-x" @click.native="export_db()" v-if="url_export">导出</mm_btn>
54
+ <button class="btn_default-x" @click.native="export_db()" v-if="url_export">导出</button>
55
55
  </div>
56
56
  </div>
57
- <mm_table type="3">
57
+ <div class="mm_table table-3">
58
58
  <thead class="table-sm">
59
59
  <tr>
60
60
  <th class="th_open"></th>
@@ -108,21 +108,21 @@
108
108
  <!--{/if}-->
109
109
  <!--{/loop}-->
110
110
  <td>
111
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
112
- <mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
111
+ <button class="mm_btn btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</button>
112
+ <button class="mm_btn btn_warning" @click.native="del_show(o, field)">删除</button>
113
113
  </td>
114
114
  </tr>
115
115
  </tbody>
116
116
  <!-- </draggable> -->
117
- </mm_table>
117
+ </div>
118
118
  </div>
119
- </mm_card>
120
- </mm_col>
121
- </mm_row>
122
- </mm_container>
123
- </mm_warp>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+ </div>
124
124
  <mm_modal v-model="show" mask="true">
125
- <mm_card class="card">
125
+ <div class="mm_card" class="card">
126
126
  <div class="card_head">
127
127
  <h5>批量修改</h5>
128
128
  </div>
@@ -146,11 +146,11 @@
146
146
  </div>
147
147
  <div class="card_foot">
148
148
  <div class="mm_group">
149
- <button class="btn_default" type="reset" @click="show = false">取消</button>
150
- <button class="btn_primary" type="button" @click="batchSet()">提交</button>
149
+ <button class="mm_btn btn_default" type="reset" @click="show = false">取消</button>
150
+ <button class="mm_btn btn_primary" type="button" @click="batchSet()">提交</button>
151
151
  </div>
152
152
  </div>
153
- </mm_card>
153
+ </div>
154
154
  </mm_modal>
155
155
  </main>
156
156
  </template>