Skip to content

Commit 4afd300

Browse files
authored
Merge pull request #47 from zhangchunlin/master
Sync
2 parents c8d4516 + 3e0bf9c commit 4afd300

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, Chunlin Zhang
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

demo/apps/tables/templates/Tables/list.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<card>
88
<div style="min-height: 600px;">
99
{{if role!="ADMIN":}}
10-
<div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_apps.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
10+
<div class="alert alert-warning" role="alert">You should <a class="btn btn-primary btn-sm" href="{{=url_for('uliweb_comapps.auth.login.views.login')}}" role="button">login</a> with user <strong>admin</strong> to view all the tables</div>
1111
{{pass #if}}
1212
<div id="app" class='box'>
1313
<div class="box-body">

uliweb_apijson/apijson/templates/vue/inc_apijson_table.html

+9-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
"custom_tcolumns_render_generator",
99
"hook_init", //hook_init(vm), will invoke in mounted()
1010
"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
1213
],
1314
template: `<div>
1415
<div v-if="config_editable && config_add_fields!=null"><i-button type="primary" @click="add">Add</i-button> <br><br> </div>
1516
<Spin size="large" fix v-if="loading"></Spin>
1617
<i-table stripe border :columns="tcolumns" :data="tlist" @on-sort-change="table_on_sort_change"></i-table>
1718
<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>
1819
<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">
2021
<form-item v-for="item in add_items" :key="item.key" :label="item.title">
2122
<i-input v-if="item.component=='input'" v-model="item.value"></i-input>
2223
<checkbox v-if="item.component=='checkbox'" v-model="item.value"></checkbox>
@@ -31,7 +32,7 @@
3132
</div>
3233
</modal>
3334
<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">
3536
<form-item v-for="item in viewedit_items" :key="item.key" :label="item.title">
3637
<i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input>
3738
<checkbox v-if="item.component=='checkbox'" v-model="item.value" :disabled="!editable(item)"></checkbox>
@@ -246,6 +247,11 @@
246247
})
247248
},
248249
show: function(params){
250+
if (this.hook_viewedit!=null) {
251+
this.hook_viewedit(this)
252+
return
253+
}
254+
249255
var row = params.row
250256
this.viewedit_items = []
251257
if (this.config_viewedit_fields!=null) {

uliweb_apijson/apijson/templates/vue/inc_apijson_viewedit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<i-input v-if="item.component=='input'" v-model="item.value" :readonly="!editable(item)"></i-input>
1616
<checkbox v-if="item.component=='checkbox'" v-model="item.value" :disabled="!editable(item)"></checkbox>
1717
<i-input v-if="item.component=='textarea'" v-model="item.value" type="textarea" :autosize="{minRows: 2,maxRows: 5}"></i-input>
18-
{{block custom_viewedit_componet}}{{end custom_viewedit_componet}}
18+
{{block custom_viewedit_component}}{{end custom_viewedit_component}}
1919
</form-item>
2020
<form-item v-if="config_editable" label="Action">
2121
<i-button type="info" icon="ios-download" size="large" @click="save">Save</i-button>

0 commit comments

Comments
 (0)