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,279 +1,280 @@
1
- <template>
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 }">
8
- <div class="card_head arrow" @click="show_filter = !show_filter">
9
- <h5>${api.title}</h5>
10
- </div>
11
- <div class="card_body">
12
- <mm_form class="bar_filter">
13
- <div class="title">
14
- <h5><span>筛选条件</span></h5>
15
- </div>
16
- <mm_list :col="3">
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
- </mm_item>
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
- </mm_item>
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
- </mm_item>
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
- </mm_item>
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
- </mm_item>
49
- <!--{/if}-->
50
- <!--{/if}-->
51
- <!--{/if}-->
52
- <!--{/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>
58
- <div class="bar_action">
59
- <h5><span>操作</span></h5>
60
- <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>
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
- <mm_btn class="btn_default-x" @click.native="export_db()" v-if="url_export">导出</mm_btn>
67
- </div>
68
- </div>
69
- <mm_table type="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>{{ $to_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_com v-if="o.control == 'number'" tag="number" v-model="o.${v.name}" @change="set(o)" />
115
- <control_com v-else-if="o.control == 'select'" tag="select" v-model="o.${v.name}" :mod="o.model" @change="set(o)" />
116
- <control_com v-else-if="o.control == 'checkbox' || o.control == 'radio'" :tag="o.control" v-model="o.${v.name}" :mod="o.model" @change="set(o)" />
117
- <control_file class="bg_white upload_img" v-else-if="o.control == 'image'" accept="*.jpeg,*.png,*.gif,*.jpg" @change="$setImg(o, $event)">
118
- <img :src="$url(o.${v.name})" /><a class="btn_preview" target="_blank" v-if="o.${v.name}.indexOf('/') === 0" :href="$url(o.${v.name})"><span>预览</span></a>
119
- </control_file>
120
- <control_file class="bg_white" v-else-if="o.control == 'file'" accept="*.*" @change="$setFile(o, $event)">
121
- <span>{{o.${v.name}}}</span><a class="btn" v-if="o.${v.name}.indexOf('/') === 0" :href="$url(o.${v.name})"><span>下载</span></a>
122
- </control_file>
123
- <control_com v-else :auto="true" :tag="o.control" v-model="o.${v.name}" @change="set(o)" />
124
- <!--{else}-->
125
- <span>{{ o.${v.name} }}</span>
126
- <!--{/if}-->
127
- </td>
128
- <!--{/if}-->
129
- <!--{/if}-->
130
- <!--{/loop}-->
131
- <td>
132
- <mm_btn class="btn_primary" :url="'./${name}_form?${sql.key}=' + o[field]">修改</mm_btn>
133
- <mm_btn class="btn_warning" @click.native="del_show(o, field)">删除</mm_btn>
134
- </td>
135
- </tr>
136
- </tbody>
137
- <!-- </draggable> -->
138
- </mm_table>
139
- </div>
140
- </mm_card>
141
- </mm_col>
142
- </mm_row>
143
- </mm_container>
144
- </mm_warp>
145
- <mm_modal v-model="show" mask="true">
146
- <mm_card class="card">
147
- <div class="card_head">
148
- <h5>批量修改</h5>
149
- </div>
150
- <div class="card_body pa">
151
- <dl>
152
- <!--{loop field v idx}-->
153
- <!--{if(v.show.batch)}-->
154
- <dt>${v.title}</dt>
155
- <dd>
156
- <!--{if(v.show.batch === "input")}-->
157
- <control_input v-model="form.${v.name}" />
158
- <!--{else if(v.show.batch === "select")}-->
159
- <!--{if(v.format.table)}-->
160
- <!--{if(v.format.key.endWith('_id') !== -1)}-->
161
- <control_select type="list" v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
162
- <!--{else}-->
163
- <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label}, '${v.format.id || v.format.key}', '${v.format.name}')" />
164
- <!--{/if}-->
165
- <!--{else}-->
166
- <control_select v-model="form.${v.format.key}" :options="$to_kv(${v.label})" />
167
- <!--{/if}-->
168
- <!--{/if}-->
169
- </dd>
170
- <!--{/if}-->
171
- <!--{/loop}-->
172
- </dl>
173
- </div>
174
- <div class="card_foot">
175
- <div class="mm_group">
176
- <button class="btn_default" type="reset" @click="show = false">取消</button>
177
- <button class="btn_primary" type="button" @click="batchSet()">提交</button>
178
- </div>
179
- </div>
180
- </mm_card>
181
- </mm_modal>
182
- </main>
183
- </template>
184
-
185
- <script>
186
- import control_com from '/src/components/control/control_com.vue';
187
- import mixin from '/src/mixins/page.js';
188
-
189
- export default {
190
- mixins: [mixin],
191
- components: {
192
- control_com
193
- },
194
- data() {
195
- return {
196
- // 列表请求地址
197
- url_get_list: "${api.path}",
198
- url_del: "${api.path}?method=del&",
199
- url_set: "${api.path}?method=set&",
200
- url_import: "${api.path}?method=import&",
201
- url_export: "${api.path}?method=export&",
202
- field: "${sql.key}",
203
- query_set: {
204
- "${sql.key}": ""
205
- },
206
- // 查询条件
207
- query: {
208
- //页码
209
- page: 0,
210
- //页面大小
211
- size: '0',
212
- /*[loop js.query v idx]*/
213
- // ${' ' + v.title}
214
- /*[if v.type === 'number' && !v.select]*/
215
- '${v.name}': 0,
216
- /*[else]*/
217
- '${v.name}': '',
218
- /*[/if]*/
219
- /*[/loop]*/
220
- //排序
221
- orderby: ""
222
- },
223
- form: {},
224
- //颜色
225
- arr_color: ['', '', 'font_yellow', 'font_success', 'font_warning', 'font_primary', 'font_info', 'font_default'],
226
- /*[loop js.data v idx]*/
227
- // ${' ' + v.title}
228
- '${v.name}': ${@JSON.stringify(v.value)},
229
- /*[/loop]*/
230
- // 视图模型
231
- vm: {}
232
- }
233
- },
234
- methods: {
235
- /*[loop js.data v idx]*/
236
- /*[if(v.path)]*/
237
- /**
238
- * 获取 ${v.title}
239
- * @param {query} 查询条件
240
- */
241
- get_ /*[v.basename]*/(query) {
242
- var _this = this;
243
- if (!query) {
244
- query = {
245
- field: "${v.id},${v.field}${v.father_id ? ',' + v.father_id : '' }${v.title_name ? ',title' : '' }"
246
- };
247
- }
248
- this.$get('~${v.path}', query, function(json) {
249
- if (json.result) {
250
- _this /*['.' + v.name]*/ .clear();
251
- _this /*['.' + v.name]*/ .addList(json.result.list)
252
- }
253
- });
254
- },
255
- /*[/if]*/
256
- /*[/loop]*/
257
- /**
258
- * 获取列表之前
259
- * @param {Object} param 参数
260
- */
261
- get_list_before(param){
262
- delete param.page;
263
- param.size = "0";
264
- return param;
265
- }
266
- },
267
- created() {
268
- /*[loop js.data v idx]*/
269
- /*[if(v.path)]*/
270
- // 获取 ${v.title}
271
- this.get_ /*[v.basename]*/();
272
- /*[/if]*/
273
- /*[/loop]*/
274
- }
275
- }
276
- </script>
277
-
278
- <style>
279
- </style>
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>