Skip to content

Commit 6d83456

Browse files
author
hikki
committed
v3
1 parent deabcd0 commit 6d83456

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

src/DLPServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public function boot()
2121
]);
2222

2323
Admin::booting(function () {
24-
Admin::css('vendor/dlp/component.min.css?v2.9');
25-
Admin::headerJs('vendor/dlp/component.min.js?v2.9');
24+
Admin::css('vendor/dlp/component.min.css?v3');
25+
Admin::headerJs('vendor/dlp/component.min.js?v3');
2626
Form::extend('Dot', Dot::class);
2727
Form::extend('CascadeDot', CascadeDot::class);
2828
Form::extend('Linear', Linear::class);

test/example.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,16 @@ protected function form($id)
142142
* 链表结构数据辅助组装
143143
* 1.倒排父节点查询
144144
* $select = Model::orderBy('parent_id','DESC')->select('id as key','name as val','parent_id as par')->get()->toArray();
145-
* 2.辅助函数dimension 组装后的$select结构参考$this->cascadeExampleData()返回数据
145+
* 2.辅助函数dimension 组装后的结构参考$this->cascadeData()的示例数据
146146
* DLPHelper::dimension($select);
147147
* checked 已选择 一维数组 值类型integer
148148
* attribute.height 设置高度 默认200px
149149
*/
150150
$form->CascadeDot('cascadeDot','级联标签选择器')
151-
->options($this->cascadeExampleData())
151+
->options($this->cascadeData())
152152
->checked([614,550,543])
153153
->attribute(['height'=>'200px']);
154154

155-
156155
/**
157156
* 线组件
158157
* columns 设置列表head名称 row字段输出格式input,text,hidden
@@ -173,6 +172,21 @@ protected function form($id)
173172
['name'=>'01','meta'=>'test info1','url'=>'1','time'=>'2021-05-15 00:00:00','is-small'=>1,'is-warning'=>1],
174173
['name'=>'02','meta'=>'test info2','url'=>'2','time'=>'2021-05-15 00:00:00','is-small'=>1,'is-warning'=>1],
175174
['name'=>'03','meta'=>'test info3','url'=>'3','time'=>'2021-05-15 00:00:00','is-small'=>1,'is-warning'=>1]]);
175+
176+
/**
177+
* 级联线组件
178+
* options 设置数据集 多维数组 格式[[key=>key1,val=>value1,nodes=>[...]],...]
179+
* 链表结构数据辅助组装
180+
* 1.倒排父节点查询
181+
* $select = Model::orderBy('parent_id','DESC')->select('id as key','name as val','parent_id as par')->get()->toArray();
182+
* 2.辅助函数dimension 组装后的$select结构参考$this->cascadeExampleData()返回数据
183+
* DLPHelper::dimension($select);
184+
* xhr 接口地址 编码参见:test\CascadeLineController
185+
* attribute.height 设置高度 默认200px
186+
*/
187+
$form->CascadeLine('cascadeLine','级联标签管理器')
188+
->options($this->cascadeExampleData())
189+
->xhr('route-to-CascadeLineController');
176190
return $form;
177191
}
178192

@@ -183,7 +197,7 @@ public function blank()
183197
return Plane::html($html);
184198
}
185199

186-
private function cascadeExampleData()
200+
private function cascadeData()
187201
{
188202
return [
189203
["key" => "3", "val" => "基本", "nodes" => [

0 commit comments

Comments
 (0)