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,159 +1,161 @@
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 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}-->
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
  <!--{/if}-->
46
53
  <!--{/if}-->
47
54
  <!--{/if}-->
48
55
  <!--{/loop}-->
49
- <mm_item>
50
- <mm_btn class="btn_primary-x" type="reset" @click.native="reset();">重置</mm_btn>
51
- </mm_item>
52
- </mm_list>
53
- </mm_form>
56
+ <div class="mm_item">
57
+ <button class="mm_btn btn_primary-x" type="reset"
58
+ @click.native="reset();">重置</button>
59
+ </div>
60
+ </div>
61
+ </form>
54
62
  <div class="bar_action">
55
63
  <h5><span>操作</span></h5>
56
64
  <div class="btns">
57
- <mm_btn class="btn_primary-x" url="./${name}_form?">添加</mm_btn>
58
- <mm_btn @click.native="show = true" class="btn_primary-x" v-bind:class="{ 'disabled': !selects }">批量修改</mm_btn>
65
+ <button class="mm_btn btn_primary-x" url="./${name}_form?">添加</button>
66
+ <button class="mm_btn btn_primary-x" @click.native="show = true"
67
+ v-bind:class="{ 'disabled': !selects }">批量修改</button>
59
68
  </div>
60
69
  <div class="btn_small">
61
- <control_file class="btn_default-x" type="excel" :func="import_db" v-if="url_import"></control_file>
62
- <mm_btn class="btn_default-x" @click.native="export_db()" v-if="url_export">导出</mm_btn>
70
+ <control_file type="excel" :func="import_db" v-if="url_import"></control_file>
71
+ <button class="mm_btn btn_default-x" @click.native="export_db()"
72
+ v-if="url_export">导出</button>
63
73
  </div>
64
74
  </div>
65
- <mm_table type="3">
66
- <thead class="table-sm">
67
- <tr>
68
- <th class="th_open"></th>
69
- <th class="th_selected"><input type="checkbox" :checked="select_state" @click="select_all()" /></th>
70
- <th class="th_id"><span>#</span></th>
71
- <!--{loop field v idx}-->
72
- <!--{if(v.show.table)}-->
73
- <!--{if(v.name !== sql.key)}-->
74
- <th class="td_${v.name}">
75
- <control_reverse title="${v.title}" v-model="query.orderby" field="${v.name}" :func="search"></control_reverse>
76
- </th>
77
- <!--{/if}-->
78
- <!--{/if}-->
79
- <!--{/loop}-->
80
- <th class="th_handle"><span>操作</span></th>
81
- </tr>
82
- </thead>
83
- <tbody>
84
- <!-- <draggable v-model="list" tag="tbody" @change="sort_change"> -->
85
- <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]) }"
86
- @click="selected(idx)">
87
- <th class="th_open"><button class="btn_open" :style="'margin-left:' + (1.5 * opens_lv(o[father_id])) + 'rem;'"
88
- @click="opens_change(o[field])"><i class="fa-caret-right"></i></button></th>
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
- <control_input :auto="true" v-model="o.${v.name}" @blur="set(o)" />
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
- <!--{if param.list.length > 7}-->
131
- <template v-slot:right>
75
+ <div class="mm_table table-3">
76
+ <table>
132
77
  <thead class="table-sm">
133
78
  <tr>
79
+ <th class="th_open"></th>
80
+ <th class="th_selected"><input type="checkbox" :checked="select_state"
81
+ @click="select_all()" /></th>
82
+ <th class="th_id"><span>#</span></th>
83
+ <!--{loop field v idx}-->
84
+ <!--{if(v.show.table)}-->
85
+ <!--{if(v.name !== sql.key)}-->
86
+ <th class="td_${v.name}">
87
+ <control_reverse title="${v.title}" v-model="query.orderby"
88
+ field="${v.name}" :func="search"></control_reverse>
89
+ </th>
90
+ <!--{/if}-->
91
+ <!--{/if}-->
92
+ <!--{/loop}-->
134
93
  <th class="th_handle"><span>操作</span></th>
135
94
  </tr>
136
95
  </thead>
137
96
  <tbody>
138
- <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]) }"
139
- @click="selected(idx)">
97
+ <tr v-for="(o, idx) in list_new" :key="idx"
98
+ :class="{'active': select == idx, sub: o[father_id], open: opens_has(o[field]), no_sub: !opens_has_sub(o[field]) }"
99
+ @click="selected(idx)">
100
+ <th class="th_open"><button class="btn_open"
101
+ :style="'margin-left:' + (1.5 * opens_lv(o[father_id])) + 'rem;'"
102
+ @click="opens_change(o[field])"><i
103
+ class="fa-caret-right"></i></button></th>
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)}-->
140
111
  <td>
141
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
142
- <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
+ <control_input :auto="true" v-model="o.${v.name}" @blur="set(o)" />
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>
143
146
  </td>
144
147
  </tr>
145
148
  </tbody>
146
- </template>
147
- <!--{/if}-->
148
- </mm_table>
149
+ </table>
150
+ </div>
149
151
  </div>
150
- </mm_card>
151
- </mm_col>
152
- </mm_row>
153
- </mm_container>
154
- </mm_warp>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ </div>
156
+ </div>
155
157
  <mm_modal v-model="show" mask="true">
156
- <mm_card class="card">
158
+ <div class="mm_card">
157
159
  <div class="card_head">
158
160
  <h5>批量修改</h5>
159
161
  </div>
@@ -163,19 +165,21 @@
163
165
  <!--{if(v.show.batch)}-->
164
166
  <dt>${v.title}</dt>
165
167
  <dd>
166
- <!--{if(v.show.batch === "input")}-->
167
- <control_input v-model="form.${v.name}" />
168
- <!--{else if(v.show.batch === "select")}-->
168
+ <!--{if(v.show.batch === "input")}-->
169
+ <control_input v-model="form.${v.name}" />
170
+ <!--{else if(v.show.batch === "select")}-->
169
171
  <!--{if(v.format.table)}-->
170
- <!--{if(v.format.key.endWith('_id') !== -1)}-->
171
- <control_select type="list" v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
172
- <!--{else}-->
173
- <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
174
- <!--{/if}-->
172
+ <!--{if(v.format.key.endWith('_id') !== -1)}-->
173
+ <control_select type="list" v-model="form.${v.format.key}"
174
+ :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
175
+ <!--{else}-->
176
+ <control_select v-model="form.${v.format.key}"
177
+ :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
178
+ <!--{/if}-->
175
179
  <!--{else}-->
176
180
  <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
177
181
  <!--{/if}-->
178
- <!--{/if}-->
182
+ <!--{/if}-->
179
183
  </dd>
180
184
  <!--{/if}-->
181
185
  <!--{/loop}-->
@@ -183,11 +187,11 @@
183
187
  </div>
184
188
  <div class="card_foot">
185
189
  <div class="mm_group">
186
- <button class="btn_default" type="reset" @click="show = false">取消</button>
187
- <button class="btn_primary" type="button" @click="batchSet()">提交</button>
190
+ <button class="mm_btn btn_default" type="reset" @click="show = false">取消</button>
191
+ <button class="mm_btn btn_primary" type="button" @click="batchSet()">提交</button>
188
192
  </div>
189
193
  </div>
190
- </mm_card>
194
+ </div>
191
195
  </mm_modal>
192
196
  </main>
193
197
  </template>
@@ -228,7 +232,9 @@
228
232
  },
229
233
  form: {},
230
234
  //颜色
231
- arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info', 'font_default'],
235
+ arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info',
236
+ 'font_default'
237
+ ],
232
238
  /*[loop js.data v idx]*/
233
239
  // ${' ' + v.title}
234
240
  '${v.name}': ${@JSON.stringify(v.value)},
@@ -244,7 +250,7 @@
244
250
  * 获取 ${v.title}
245
251
  * @param {query} 查询条件
246
252
  */
247
- get_ /*[v.basename]*/(query) {
253
+ get_/*[v.basename]*/(query) {
248
254
  var _this = this;
249
255
  if (!query) {
250
256
  query = {
@@ -253,8 +259,8 @@
253
259
  }
254
260
  this.$get('~${v.path}', query, function(json) {
255
261
  if (json.result) {
256
- _this /*['.' + v.name]*/ .clear();
257
- _this /*['.' + v.name]*/ .addList(json.result.list)
262
+ _this/*['.' + v.name]*/.clear();
263
+ _this/*['.' + v.name]*/.addList(json.result.list)
258
264
  }
259
265
  });
260
266
  },
@@ -264,7 +270,7 @@
264
270
  * 获取列表之前
265
271
  * @param {Object} param 参数
266
272
  */
267
- get_list_before(param){
273
+ get_list_before(param) {
268
274
  delete param.page;
269
275
  param.size = "0";
270
276
  return param;
@@ -274,7 +280,7 @@
274
280
  /*[loop js.data v idx]*/
275
281
  /*[if(v.path)]*/
276
282
  // 获取 ${v.title}
277
- this.get_ /*[v.basename]*/();
283
+ this.get_/*[v.basename]*/();
278
284
  /*[/if]*/
279
285
  /*[/loop]*/
280
286
  },
@@ -296,4 +302,4 @@
296
302
  </script>
297
303
 
298
304
  <style>
299
- </style>
305
+ </style>