Skip to content

Commit 338a188

Browse files
author
hikki
committed
v5.0
1 parent de17f7e commit 338a188

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/Widget/CascadeDot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function render()
3737
* @param array $style 组件样式设置 宽:width 高:height
3838
* @return string
3939
*/
40-
public static function panel($name, array $select, array $selected, int $limit = 0, array $style = [])
40+
public static function panel($name, array $select, array $selected = [], int $limit = 0, array $style = [])
4141
{
4242
$selected = json_encode($selected, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
4343
$select = json_encode($select, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);

test/china.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/example.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ protected function form($id)
146146
* 链表结构数据辅助组装(例)
147147
* 1.倒排父节点查询 注:id name parent_id 必须命别名 key val par
148148
* $select = Model::orderBy('par','DESC')->select('id as key','name as val','parent_id as par')->get()->toArray();
149-
* 2.辅助函数dimension 组装后的结构参考$this->cascadeData()的示例数据
150-
* DLPHelper::dimension($select);
149+
* 2.辅助函数dimension 组装后的$select结构参考$this->cascadeExampleData()返回数据
150+
* Assistant::dimension($select);
151151
* checked 已选择 一维数组 值类型integer
152152
* attribute.width 设置宽度 默认100%
153153
* attribute.height 设置高度 默认200px
@@ -193,7 +193,7 @@ protected function form($id)
193193
* 1.倒排父节点查询 注:id name parent_id 必须命别名 key val par
194194
* $select = Model::orderBy('parent_id','DESC')->select('id as key','name as val','parent_id as par')->get()->toArray();
195195
* 2.辅助函数dimension 组装后的$select结构参考$this->cascadeExampleData()返回数据
196-
* DLPHelper::dimension($select);
196+
* Assistant::dimension($select);
197197
* xhr 接口地址 编码参见文件:test\CascadeLineController 路由配置$router->resource('xhr地址', 'CascadeLineController')
198198
* attribute.width 设置宽度 默认100%
199199
* attribute.height 设置高度 默认200px

test/index.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
<div id="test2" style="width: 900px;height: 320px;margin: 0 auto"></div>
171171
</div>
172172
</body>
173+
<script src="china.js"></script>
173174
<script>
174175
let test_data = {
175176
"1": "西宮このみ",
@@ -296,16 +297,17 @@
296297
document.getElementById('test3').addEventListener('click', function () {
297298
new ComponentPlane();
298299
});
300+
new ComponentCascadeDot('test4', China, [1050, 1105]);
299301

300-
let cascadeData = [
302+
let cascadeTestData = [
301303
{
302304
"key": 1,
303305
"val": "上装",
304306
"nodes": [
305307
{
306308
"key": 101,
307309
"val": "西服"
308-
},
310+
},
309311
{
310312
"key": 102,
311313
"val": "背心", 'nodes': [
@@ -467,7 +469,7 @@
467469
"key": 1055,
468470
"val": "开档裤"
469471
}
470-
]
472+
]
471473
},
472474
{
473475
"key": 303,
@@ -548,10 +550,6 @@
548550
]
549551
}
550552
];
551-
let cascadeData_copy = JSON.parse(JSON.stringify(cascadeData));
552-
553-
new ComponentCascadeDot('test4', cascadeData, [1050, 1105]);
554-
555-
new ComponentCascadeLine('test5', cascadeData_copy,'http://url...');
553+
new ComponentCascadeLine('test5', cascadeTestData,'http://url...');
556554
</script>
557555
</html>

0 commit comments

Comments
 (0)