|
8 | 8 | "custom_tcolumns_render_generator", |
9 | 9 | "hook_init", //hook_init(vm), will invoke in mounted() |
10 | 10 | "hook_ajax_params", //hook_ajax_params(method,action,params), will invoke before ajax action |
11 | | - "hook_add" //hook_add(vm), customize the add action |
| 11 | + "hook_add", //hook_add(vm), customize the add action |
| 12 | + "hook_viewedit" //hook_viewedit(vm), customize the add action |
12 | 13 | ], |
13 | 14 | template: `<div> |
14 | 15 | <div v-if="config_editable && config_add_fields!=null"><i-button type="primary" @click="add">Add</i-button> <br><br> </div> |
15 | 16 | <Spin size="large" fix v-if="loading"></Spin> |
16 | 17 | <i-table stripe border :columns="tcolumns" :data="tlist" @on-sort-change="table_on_sort_change"></i-table> |
17 | 18 | <page :total="total" :page-size="query_count" :current.sync="current_page" :page-size-opts="[10, 20, 50, 100]" show-sizer @on-change="page_on_change" @on-page-size-change="page_on_page_size_change"></page> |
18 | 19 | <modal v-model="modal_add" title="Add"> |
19 | | - <i-form @submit.native.prevent :label-width="80"> |
| 20 | + <i-form @submit.native.prevent :label-width="100"> |
20 | 21 | <form-item v-for="item in add_items" :key="item.key" :label="item.title"> |
21 | 22 | <i-input v-if="item.component=='input'" v-model="item.value"></i-input> |
22 | 23 | <checkbox v-if="item.component=='checkbox'" v-model="item.value"></checkbox> |
|
31 | 32 | </div> |
32 | 33 | </modal> |
33 | 34 | <modal v-model="modal_view" :title="viewedit_label"> |
34 | | - <i-form @submit.native.prevent :label-width="80"> |
| 35 | + <i-form @submit.native.prevent :label-width="100"> |
35 | 36 | <form-item v-for="item in viewedit_items" :key="item.key" :label="item.title"> |
36 | 37 | <i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input> |
37 | 38 | <checkbox v-if="item.component=='checkbox'" v-model="item.value" :disabled="!editable(item)"></checkbox> |
|
246 | 247 | }) |
247 | 248 | }, |
248 | 249 | show: function(params){ |
| 250 | + if (this.hook_viewedit!=null) { |
| 251 | + this.hook_viewedit(this) |
| 252 | + return |
| 253 | + } |
| 254 | + |
249 | 255 | var row = params.row |
250 | 256 | this.viewedit_items = [] |
251 | 257 | if (this.config_viewedit_fields!=null) { |
|
0 commit comments