mm_os 2.8.7 → 2.8.8

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.
@@ -1,148 +1,153 @@
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
- @blur="search()" />
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
+ @blur="search()" />
23
+ </div>
23
24
  <!--{/if}-->
24
25
  <!--{/loop}-->
25
26
  <!--{loop field v idx}-->
26
27
  <!--{if(v.show.search)}-->
27
28
  <!--{if(v.show.search === "input")}-->
28
- <mm_item>
29
- <control_input v-model="query.${v.name}" title="${v.title}" @blur="search()" />
30
- </mm_item>
29
+ <div class="mm_item">
30
+ <control_input v-model="query.${v.name}" title="${v.title}"
31
+ @blur="search()" />
32
+ </div>
31
33
  <!--{else if(v.show.search === "select")}-->
32
34
  <!--{if(v.format.table)}-->
33
- <mm_item>
35
+ <div class="mm_item">
34
36
  <!--{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()" />
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()" />
36
41
  <!--{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>
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>
41
47
  <!--{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>
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>
45
52
  <!--{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>
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>
49
57
  <!--{/if}-->
50
58
  <!--{/if}-->
51
59
  <!--{/if}-->
52
60
  <!--{/loop}-->
53
- <mm_item>
54
- <mm_btn class="btn_primary-x" type="reset" @click.native="reset();search()">重置</mm_btn>
55
- </mm_item>
56
- </mm_list>
57
- </mm_form>
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>
58
67
  <div class="bar_action">
59
68
  <h5><span>操作</span></h5>
60
69
  <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>
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>
63
73
  </div>
64
74
  <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>
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>
67
79
  </div>
68
80
  </div>
69
- <mm_table type="2">
70
- <thead class="table-sm">
71
- <tr>
72
- <th class="th_selected"><input type="checkbox" :checked="select_state" @click="select_all()" /></th>
73
- <th class="th_id"><span>#</span></th>
74
- <!--{loop field v idx}-->
75
- <!--{if(v.show.table)}-->
76
- <!--{if(v.name !== sql.key)}-->
77
- <th class="th_${v.name}">
78
- <control_reverse title="${v.title}" v-model="query.orderby" field="${v.name}" :func="search"></control_reverse>
79
- </th>
80
- <!--{/if}-->
81
- <!--{/if}-->
82
- <!--{/loop}-->
83
- <th class="th_handle"><span>操作</span></th>
84
- </tr>
85
- </thead>
86
- <tbody>
87
- <!-- <draggable v-model="list" tag="tbody" @change="sort_change"> -->
88
- <tr v-for="(o, idx) in list" :key="idx" :class="{'active': select == idx}" @click="selected(idx)">
89
- <th class="th_selected"><input type="checkbox" :checked="select_has(o[field])" @click="select_change(o[field])" /></th>
90
- <td>{{ o[field] }}</td>
91
- <!--{loop field v idx}-->
92
- <!--{if(v.show.table)}-->
93
- <!--{if(v.name !== sql.key)}-->
94
- <td>
95
- <!--{if(v.dataType === 'tinyint')}-->
96
- <control_switch v-model="o.${v.name}" @click.native="set(o)" />
97
- <!--{else if(v.format)}-->
98
- <!--{if(v.format.table)}-->
99
- <span>{{ $get_name(${v.label}, o.${v.format.key}, '${v.format.id || v.format.key}', '${v.format.name}') }}</span>
100
- <!--{else if(v.name == 'state' || v.name == 'status')}-->
101
- <span v-bind:class="arr_color[o.${v.name}]">{{ ${v.label}[o.${v.name}] }}</span>
102
- <!--{else}-->
103
- <span>{{ ${v.label}[o.${v.name}] }}</span>
104
- <!--{/if}-->
105
- <!--{else if(v.name.indexOf('img') !== -1 || v.name.indexOf('icon') !== -1 || v.name === 'avatar')}-->
106
- <img class="${v.name}" :src="o.${v.name}" alt="${v.title}" />
107
- <!--{else if(v.dataType === 'date')}-->
108
- <span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd') }}</span>
109
- <!--{else if(v.dataType === 'time')}-->
110
- <span>{{ o.${v.name} }}</span>
111
- <!--{else if(v.dataType === 'timestamp' || v.dataType === 'datetime')}-->
112
- <span>{{ $to_time(o.${v.name}, 'yyyy-MM-dd hh:mm') }}</span>
113
- <!--{else if(v.name === 'display' || v.name === 'orderby')}-->
114
- <input class="input_display" v-model.number="o.${v.name}" @blur="set(o)" min="0" max="1000" />
115
- <!--{else}-->
116
- <span>{{ o.${v.name} }}</span>
117
- <!--{/if}-->
118
- </td>
119
- <!--{/if}-->
120
- <!--{/if}-->
121
- <!--{/loop}-->
122
- <td>
123
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
124
- <mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
125
- </td>
126
- </tr>
127
- </tbody>
128
- <!-- </draggable> -->
129
-
130
- <template v-slot:right>
81
+ <div class="mm_table table-2">
82
+ <table>
131
83
  <thead class="table-sm">
132
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}-->
133
98
  <th class="th_handle"><span>操作</span></th>
134
99
  </tr>
135
100
  </thead>
136
101
  <tbody>
137
- <tr v-for="(o, idx) in list" :key="idx" :class="{'active': select == idx}" @click="selected(idx)">
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)}-->
138
111
  <td>
139
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
140
- <mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
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>
141
146
  </td>
142
147
  </tr>
143
148
  </tbody>
144
- </template>
145
- </mm_table>
149
+ </table>
150
+ </div>
146
151
  </div>
147
152
  <div class="card_foot">
148
153
  <div class="fl">
@@ -151,18 +156,20 @@
151
156
  <div class="fr">
152
157
  <span class="mr">共 {{ count }} 条</span>
153
158
  <span>当前</span>
154
- <input type="number" class="pager_now" v-model.number="page_now" @blur="goTo(page_now)" @change="page_change" />
159
+ <input type="number" class="pager_now" v-model.number="page_now"
160
+ @blur="goTo(page_now)" @change="page_change" />
155
161
  <span>/{{ page_count }}页</span>
156
162
  </div>
157
- <control_pager display="2" v-model="query.page" :count="count / query.size" :func="goTo" :icons="['首页', '上一页', '下一页', '尾页']"></control_pager>
163
+ <control_pager display="2" v-model="query.page" :count="count / query.size" :func="goTo"
164
+ :icons="['首页', '上一页', '下一页', '尾页']"></control_pager>
158
165
  </div>
159
- </mm_card>
160
- </mm_col>
161
- </mm_row>
162
- </mm_container>
163
- </mm_warp>
166
+ </div>
167
+ </div>
168
+ </div>
169
+ </div>
170
+ </div>
164
171
  <mm_modal v-model="show" mask="true">
165
- <mm_card class="card">
172
+ <div class="mm_card" class="card">
166
173
  <div class="card_head">
167
174
  <h5>批量修改</h5>
168
175
  </div>
@@ -172,19 +179,21 @@
172
179
  <!--{if(v.show.batch)}-->
173
180
  <dt>${v.title}</dt>
174
181
  <dd>
175
- <!--{if(v.show.batch === "input")}-->
176
- <control_input v-model="form.${v.name}" />
177
- <!--{else if(v.show.batch === "select")}-->
182
+ <!--{if(v.show.batch === "input")}-->
183
+ <control_input v-model="form.${v.name}" />
184
+ <!--{else if(v.show.batch === "select")}-->
178
185
  <!--{if(v.format.table)}-->
179
- <!--{if(v.format.key.endWith('_id') !== -1)}-->
180
- <control_select type="list" v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
181
- <!--{else}-->
182
- <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
183
- <!--{/if}-->
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}-->
184
193
  <!--{else}-->
185
194
  <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
186
195
  <!--{/if}-->
187
- <!--{/if}-->
196
+ <!--{/if}-->
188
197
  </dd>
189
198
  <!--{/if}-->
190
199
  <!--{/loop}-->
@@ -192,11 +201,11 @@
192
201
  </div>
193
202
  <div class="card_foot">
194
203
  <div class="mm_group">
195
- <button class="btn_default" type="reset" @click="show = false">取消</button>
196
- <button class="btn_primary" type="button" @click="batchSet()">提交</button>
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>
197
206
  </div>
198
207
  </div>
199
- </mm_card>
208
+ </div>
200
209
  </mm_modal>
201
210
  </main>
202
211
  </template>
@@ -237,7 +246,9 @@
237
246
  },
238
247
  form: {},
239
248
  //颜色
240
- arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info', 'font_default'],
249
+ arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info',
250
+ 'font_default'
251
+ ],
241
252
  /*[loop js.data v idx]*/
242
253
  // ${' ' + v.title}
243
254
  '${v.name}': ${@JSON.stringify(v.value)},
@@ -282,4 +293,4 @@
282
293
  </script>
283
294
 
284
295
  <style>
285
- </style>
296
+ </style>