Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit122bc1d

Browse files
authored
Merge pull request#34 from zhangchunlin/master
Sync
2 parentse278122 +d8e44ab commit122bc1d

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

‎demo/apps/apijson_demo/templates/index.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
{{use "ui.vue"}}
77
{{use "ui.iview"}}
88

9+
<style>
10+
.notice
11+
{
12+
color:red;
13+
font-size:150%;
14+
}
15+
</style>
16+
917
<divid="app"class='box'>
1018
<divclass="box-body">
1119
<tabsv-model:value="tab_current"type="card":animated="false">
@@ -29,10 +37,10 @@
2937
<i-colspan="8"><i-inputvalue="/apijson/get"readonly/></i-col>
3038
</Row>
3139
<Rowv-if="tab_current==='tab_get'">
32-
<i-colspan="3"><divalign="center"><strong>apijson get</strong> request examples</div></i-col>
40+
<i-colspan="3"><divalign="center"><strong>apijson get</strong> request<spanclass="notice">{request_get.length}</span>examples</div></i-col>
3341
<i-colspan="8">
3442
<i-selectv-model="select_current">
35-
<i-optionv-for="item in request_get":value="item.value":key="item.value">{item.label}</i-option>
43+
<i-optionv-for="(item,index) in request_get":value="item.value":key="item.value">{index+1}. {item.label}</i-option>
3644
</i-select>
3745
</i-col>
3846
</Row>
@@ -42,10 +50,10 @@
4250
<i-colspan="8"><i-inputvalue="/apijson/head"readonly/></i-col>
4351
</Row>
4452
<Rowv-if="tab_current==='tab_head'">
45-
<i-colspan="3"><divalign="center"><strong>apijson head</strong> request examples</div></i-col>
53+
<i-colspan="3"><divalign="center"><strong>apijson head</strong> request<spanclass="notice">{request_head.length}</span>examples</div></i-col>
4654
<i-colspan="8">
4755
<i-selectv-model="select_current">
48-
<i-optionv-for="item in request_head":value="item.value":key="item.value">{item.label}</i-option>
56+
<i-optionv-for="(item,index) in request_head":value="item.value":key="item.value">{index+1}. {item.label}</i-option>
4957
</i-select>
5058
</i-col>
5159
</Row>
@@ -55,10 +63,10 @@
5563
<i-colspan="8"><i-inputvalue="/apijson/post"readonly/></i-col>
5664
</Row>
5765
<Rowv-if="tab_current==='tab_post'">
58-
<i-colspan="3"><divalign="center"><strong>apijson post</strong> request examples</div></i-col>
66+
<i-colspan="3"><divalign="center"><strong>apijson post</strong> request<spanclass="notice">{request_post.length}</span>examples</div></i-col>
5967
<i-colspan="8">
6068
<i-selectv-model="select_current">
61-
<i-optionv-for="item in request_post":value="item.value":key="item.value">{item.label}</i-option>
69+
<i-optionv-for="(item,index) in request_post":value="item.value":key="item.value">{index+1}. {item.label}</i-option>
6270
</i-select>
6371
</i-col>
6472
</Row>
@@ -68,10 +76,10 @@
6876
<i-colspan="8"><i-inputvalue="/apijson/put"readonly/></i-col>
6977
</Row>
7078
<Rowv-if="tab_current==='tab_put'">
71-
<i-colspan="3"><divalign="center"><strong>apijson put</strong> request examples</div></i-col>
79+
<i-colspan="3"><divalign="center"><strong>apijson put</strong> request<spanclass="notice">{request_put.length}</span>examples</div></i-col>
7280
<i-colspan="8">
7381
<i-selectv-model="select_current">
74-
<i-optionv-for="item in request_put":value="item.value":key="item.value">{item.label}</i-option>
82+
<i-optionv-for="(item,index) in request_put":value="item.value":key="item.value">{index+1}. {item.label}</i-option>
7583
</i-select>
7684
</i-col>
7785
</Row>
@@ -81,10 +89,10 @@
8189
<i-colspan="8"><i-inputvalue="/apijson/delete"readonly/></i-col>
8290
</Row>
8391
<Rowv-if="tab_current==='tab_delete'">
84-
<i-colspan="3"><divalign="center"><strong>apijson delete</strong> request examples</div></i-col>
92+
<i-colspan="3"><divalign="center"><strong>apijson delete</strong> request<spanclass="notice">{request_delete.length}</span>examples</div></i-col>
8593
<i-colspan="8">
8694
<i-selectv-model="select_current">
87-
<i-optionv-for="item in request_delete":value="item.value":key="item.value">{item.label}</i-option>
95+
<i-optionv-for="(item,index) in request_delete":value="item.value":key="item.value">{index+1}. {item.label}</i-option>
8896
</i-select>
8997
</i-col>
9098
</Row>

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def fpath(name):
1313
defread(fname,default=''):
1414
filename=fpath(fname)
1515
ifos.path.exists(filename):
16-
returnopen(fpath(fname)).read()
16+
returnopen(fpath(fname),encoding="utf8").read()
1717
else:
1818
returndefault
1919

‎uliweb_apijson/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__='0.1.3'
1+
__version__='0.2.0'
22
__url__='https://github.com/zhangchunlin/uliweb-apijson'
33
__author__='Chunlin Zhang'
44
__email__='zhangchunlin@gmail.com'

‎uliweb_apijson/apijson/templates/vue/inc_apijson_table.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
"@page":thisp.current_page-1,
176176
"@query":2
177177
}
178-
arr_params[this.model_name]={
178+
arr_params[thisp.model_name]={
179179
"@order":thisp.sort_key+thisp.sort_order,
180180
"@role":"{{=role}}"
181181
}
@@ -194,6 +194,10 @@
194194
thisp.loading=false
195195
if(data.code==200){
196196
vararr=data["[]"]
197+
for(vari=0;i<arr.length;i++){
198+
arr[i]=arr[i][thisp.model_name]
199+
}
200+
197201
if(!thisp.tcolumns_init){
198202
if(thisp.config_table_fields!=null){
199203
thisp.tcolumns=thisp.config_table_fields
@@ -210,6 +214,7 @@
210214
varcol={title:k,key:k}
211215
if(typeofitem[k]==="boolean"){
212216
col["width"]=80
217+
col["component"]="checkbox"
213218
}
214219
elseif(typeofitem[k]==="number"){
215220
col["width"]=100

‎uliweb_apijson/apijson/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def _get_array(self,key):
237237
q=q.order_by(getattr(column,sort_order)())
238238

239239
def_get_info(i):
240+
resultd= {}
240241
d=i.to_dict()
241242
ifsecret_fields:
242243
forkinsecret_fields:
@@ -246,7 +247,8 @@ def _get_info(i):
246247
forkinkeys:
247248
ifknotinmodel_column_set:
248249
deld[k]
249-
returnd
250+
resultd[model_name]=d
251+
returnresultd
250252
l= [_get_info(i)foriinq]
251253
self.rdict[key]=l
252254

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp