翻页列表示例 » 历史记录 » 版本 1
yangdefeng, 2022-06-15 11:47
| 1 | 1 | yangdefeng | h4. %{color:firebrick}翻页列表示例% |
|---|---|---|---|
| 2 | |||
| 3 | *模块说明* |
||
| 4 | 对话框中显示支持翻页的列表 |
||
| 5 | 可自定义列表内容与样式 |
||
| 6 | 可自定义每页显示列表条数 |
||
| 7 | 点击相应按钮可返回点击对象信息 |
||
| 8 | |||
| 9 | |||
| 10 | - |
||
| 11 | - |
||
| 12 | |||
| 13 | h4. *%{color:deepskyblue}特戒引擎脚本示例:%* |
||
| 14 | |||
| 15 | *使用前提1* |
||
| 16 | 请开启配置开关"isUseCustomOKPanel" |
||
| 17 | |配置文件|...\Mir200\Tejieconfig\Tejieconfig.txt | |
||
| 18 | |配置节点|[[tjconfig|[tjconfig]]] | |
||
| 19 | |配置项 |isUseCustomOkPanel=1 | |
||
| 20 | |||
| 21 | *使用前提2* |
||
| 22 | 将附件中的配置文件放入以下目录 |
||
| 23 | ..\Mir200\Envir\QuestDiary\数据文件\ |
||
| 24 | |||
| 25 | - |
||
| 26 | - |
||
| 27 | |||
| 28 | bq. [<notextile>@</notextile>main] |
||
| 29 | %{color:lightGrey};--设定步长(单页条数),推算最大页码--% |
||
| 30 | #act |
||
| 31 | [[mov]] n$步长 5 |
||
| 32 | [[mov]] n$页码 1 |
||
| 33 | goto <notextile>@</notextile>数据加载 |
||
| 34 | [[tbl_size]] tb_g测试表 n$表长 |
||
| 35 | [[div]] n$最大页码 n$表长 n$步长 |
||
| 36 | [[mul]] n$计数 n$最大页码 n$步长 |
||
| 37 | |
||
| 38 | #if |
||
| 39 | [[small]] n$计数 n$表长 |
||
| 40 | #act |
||
| 41 | [[inc]] n$最大页码 1 |
||
| 42 | |
||
| 43 | #if |
||
| 44 | #act |
||
| 45 | goto <notextile>@</notextile>数据分页 |
||
| 46 | |
||
| 47 | [<notextile>@</notextile>数据加载] |
||
| 48 | #act |
||
| 49 | [[tbl_create_global]] tb_g测试表 关键字 字段1 字段2 字段3 |
||
| 50 | [[tbl_load]] tb_g测试表 \数据文件\测试表.csv |
||
| 51 | |
||
| 52 | [<notextile>@</notextile>数据分页] |
||
| 53 | #act |
||
| 54 | [[mov]] n$idx_page <$str(n$页码)> |
||
| 55 | [[dec]] n$idx_page 1 |
||
| 56 | [[mul]] n$idx_page <$str(n$步长)> |
||
| 57 | [[inc]] n$idx_page 1 |
||
| 58 | [[mov]] n$idx <$str(n$idx_page)> |
||
| 59 | [[mov]] s$itemList |
||
| 60 | |
||
| 61 | [[loop|#if loop]] n$步长 |
||
| 62 | %{color:lightGrey};--最后一页处理--% |
||
| 63 | [[not]] [[large]] n$idx n$表长 |
||
| 64 | #act |
||
| 65 | [[tbl_index_key]] tb_g测试表 n$idx s$key |
||
| 66 | [[mov]] s$条目名 <$str(s$key)> |
||
| 67 | [[mov]] s$字段1 <$tbl(tb_g测试表,s$key,字段1)> |
||
| 68 | [[mov]] s$字段2 <$tbl(tb_g测试表,s$key,字段2)> |
||
| 69 | [[mov]] s$字段3 <$tbl(tb_g测试表,s$key,字段3)> |
||
| 70 | goto <notextile>@</notextile>条目模板 |
||
| 71 | [[inc]] s$itemList <$str(s$item)> |
||
| 72 | [[inc]] n$idx 1 |
||
| 73 | |
||
| 74 | #if |
||
| 75 | #act |
||
| 76 | goto <notextile>@</notextile>界面显示 |
||
| 77 | %{color:lightGrey};--print <$str(s$itemList)>--% |
||
| 78 | |
||
| 79 | [<notextile>@</notextile>条目模板] |
||
| 80 | %{color:lightGrey};--此处可自定义条目模板样式--% |
||
| 81 | #act |
||
| 82 | [[mov]] s$item |
||
| 83 | [[inc]] s$item (<itemIndex:<$str(n$idx)>> |
||
| 84 | [[inc]] s$item <img:denglu_liebiao_weixuanzhong:25:25:1:1:950:95> |
||
| 85 | [[inc]] s$item <text:<$str(s$字段1)>{scolor=150}:80:60> |
||
| 86 | [[inc]] s$item <text:<$str(s$字段2)>:300:60> |
||
| 87 | [[inc]] s$item <text:<$str(s$字段3)>:520:60> |
||
| 88 | [[inc]] s$item <text:点击按钮:720:60/<notextile>@</notextile>点击条目(<$str(s$条目名)>)> |
||
| 89 | [[inc]] s$item ) |
||
| 90 | |
||
| 91 | [<notextile>@</notextile>界面显示] |
||
| 92 | #say |
||
| 93 | <[[dlg_panelSize_|panelSize]]:1200:800>\ |
||
| 94 | <[[dlg_itemGrid_|itemGrid]]:<$str(s$itemList)>:分页显示列表,1,0,1:0:0:1000,100:1,1,650,1:0>\ |
||
| 95 | |
||
| 96 | <[[dlg_text_|text]]:上页:100:700/<notextile>@</notextile>翻页(0)> |
||
| 97 | <[[dlg_text_|text]]:~~~当前页:~~~<$str(n$页码)>:230:700> |
||
| 98 | <[[dlg_text_|text]]:下页:400:700/<notextile>@</notextile>翻页(1)> |
||
| 99 | |
||
| 100 | [<notextile>@</notextile>翻页] |
||
| 101 | #if |
||
| 102 | [[large]] n$页码 1 |
||
| 103 | [[equal]] [[CheckScriptParam|<$scriptParam1>]] 0 |
||
| 104 | #act |
||
| 105 | [[dec]] n$页码 1 |
||
| 106 | |
||
| 107 | #if |
||
| 108 | [[small]] n$页码 n$最大页码 |
||
| 109 | [[equal]] [[CheckScriptParam|<$scriptParam1>]] 1 |
||
| 110 | #act |
||
| 111 | [[inc]] n$页码 1 |
||
| 112 | |
||
| 113 | #if |
||
| 114 | #act |
||
| 115 | goto <notextile>@</notextile>数据分页 |
||
| 116 | |
||
| 117 | [<notextile>@</notextile>点击条目] |
||
| 118 | #act |
||
| 119 | [[messageBox]] 点击的是-->[[CheckScriptParam|<$scriptParam1>]] |