@@ -22,18 +22,16 @@ class DLPViewer
22
22
* @param string $title 名称
23
23
* @param array $select 全部选项 [[value=>text],[value=>text]...]
24
24
* @param array $selected 已选择选项 [[value=>text],[value=>text]...]
25
- * @param array $settings 配置项
26
- * $settings = [
27
- * 'strict'=>false, boolean json严格模式消除json敏感字符问题
28
- * 'width'=>'100%' string 容器宽度设置
29
- * 'height'=>'200px', string 容器高度设置
30
- * ]
25
+ * @param array $settings 配置项[setting,...]
26
+ * settings.strict boolean json严格模式消除json敏感字符问题
27
+ * settings.width string 容器宽度设置
28
+ * settings.height string 容器高度设置
31
29
*/
32
30
public static function makeComponentDot (Form $ form , string $ column , string $ title , array $ select = [], array $ selected = [], array $ settings = [])
33
31
{
34
32
$ strict = isset ($ settings ['strict ' ]) && $ settings ['strict ' ] ? true : false ;
35
33
$ width = isset ($ settings ['width ' ]) ? $ settings ['width ' ] : '100% ' ;
36
- $ hight = isset ($ settings ['height ' ]) ? $ settings ['height ' ] : '200px ' ;
34
+ $ height = isset ($ settings ['height ' ]) ? $ settings ['height ' ] : '200px ' ;
37
35
if ($ strict ) {
38
36
$ select = DLPHelper::safeJson ($ select );
39
37
$ selected = DLPHelper::safeJson ($ selected );
@@ -45,7 +43,7 @@ public static function makeComponentDot(Form $form, string $column, string $titl
45
43
new ComponentDot(" {$ column }",JSON.parse(' {$ selected }'),JSON.parse(' {$ select }'));
46
44
EOF
47
45
);
48
- $ form ->html ("<div id=' {$ column }' style='width: {$ width };height: {$ hight };'></div> " , $ title );
46
+ $ form ->html ("<div id=' {$ column }' style='width: {$ width };height: {$ height };'></div> " , $ title );
49
47
}
50
48
51
49
/**
@@ -55,26 +53,26 @@ public static function makeComponentDot(Form $form, string $column, string $titl
55
53
* @param string $title 名称
56
54
* @param string $data json数据
57
55
* @param array $settings 配置项[setting,...]
58
- * $ settings = [
59
- * ' columns'=> [
56
+ * settings.columns array 多列配置项 (必须填)
57
+ * columns = [
60
58
* 'name' => ['name' => '名称', 'type' => 'input'],
61
59
* 'name1' => ['name1' => '名称1', 'type' => 'text', style=>'width:50px'],
62
60
* 'name2' => ['name2' => '名称2', 'type' => 'hidden'],
63
- * ...], array 多列配置项 (必须填)
64
- * ' strict'=>false, boolean json严格模式消除json敏感字符问题 (选填)
65
- * ' width'=>'100%', string 容器宽度设置 (选填)
66
- * ' height'=>'450px', string 容器高度设置 (选填)
67
- * 'options'=>[
68
- * 'sortable'=>true,
69
- * 'delete '=>true
70
- * ] array 多列操作设置 (选填)
71
- * ]
61
+ * ...]
62
+ * settings. strict boolean json严格模式消除json敏感字符问题 (选填)
63
+ * settings. width string 容器宽度设置 (选填)
64
+ * settings. height string 容器高度设置 (选填)
65
+ * settings.options array 多列操作设置 (选填)
66
+ * options = [
67
+ * 'sortable '=>true, 排序操作
68
+ * 'delete'=>true 删除操作
69
+ * ]
72
70
*/
73
71
public static function makeComponentLine (Form $ form , string $ column , string $ title , string $ data , array $ settings = [])
74
72
{
75
73
$ strict = isset ($ settings ['strict ' ]) && $ settings ['strict ' ] ? true : false ;
76
74
$ width = isset ($ settings ['width ' ]) ? $ settings ['width ' ] : '100% ' ;
77
- $ hight = isset ($ settings ['height ' ]) ? $ settings ['height ' ] : '450px ' ;
75
+ $ height = isset ($ settings ['height ' ]) ? $ settings ['height ' ] : '450px ' ;
78
76
$ options = isset ($ settings ['options ' ]) ? json_encode ($ settings ['options ' ]) : '[] ' ;
79
77
if (!isset ($ settings ['columns ' ])) return ;
80
78
$ columns = $ settings ['columns ' ];
@@ -87,21 +85,21 @@ public static function makeComponentLine(Form $form, string $column, string $tit
87
85
new ComponentLine(" {$ column }",JSON.parse(' {$ columns }'),JSON.parse(' {$ data }'),JSON.parse(' {$ options }'));
88
86
EOF
89
87
);
90
- $ form ->html ("<div id=' {$ column }' style='width: {$ width };height: {$ hight };'></div> " , $ title );
88
+ $ form ->html ("<div id=' {$ column }' style='width: {$ width };height: {$ height };'></div> " , $ title );
91
89
}
92
90
93
91
/**
94
92
* 头部-多操作添加
95
93
* @param Grid $grid
96
94
* @param array $settings 配置项[setting,...]
97
- * setting .document_id dom节点id string(必须填)
98
- * setting .title 自定义按钮名 string(必须填)
99
- * setting .url 加载页地址:url/{id}参数匹配id string(必须填)
100
- * setting .xhr_url ajax提交地址rl/{id}参数匹配id string(选填)
101
- * setting .method ajax提交方法:POST PUT... string(选填)
102
- * setting .callback ajax提交回调方法 string(选填)
103
- * setting .options 弹窗配置项 array(选填)
104
- * options = ['W'=>0.8,'H'=>0.8] W宽 H高
95
+ * settings .document_id dom节点id string(必须填)
96
+ * settings .title 自定义按钮名 string(必须填)
97
+ * settings .url 加载页地址:url/{id}参数匹配id string(必须填)
98
+ * settings .xhr_url ajax提交地址rl/{id}参数匹配id string(选填)
99
+ * settings .method ajax提交方法:POST PUT... string(选填)
100
+ * settings .callback ajax提交回调方法 string(选填)
101
+ * settings .options 弹窗配置项 array(选填)
102
+ * options = ['W'=>0.8,'H'=>0.8] W宽 H高
105
103
*/
106
104
public static function makeHeadPlaneAction (Grid $ grid , array $ settings = [])
107
105
{
@@ -146,14 +144,14 @@ public function render()
146
144
* 列-多操作添加
147
145
* @param Grid $grid
148
146
* @param array $settings [setting,...]
149
- * setting .document_class dom节点classname string(必须填)
150
- * setting .title 自定义按钮名 string(必须填)
151
- * setting .url 加载页地址:url/{id}参数匹配id string(必须填)
152
- * setting .xhr_url ajax提交地址:url/{id}加参数匹配id string(选填)
153
- * setting .method ajax提交方法:POST PUT... string(选填)
154
- * setting .callback ajax提交回调方法 string(选填)
155
- * setting .options 弹窗配置项 array(选填)
156
- * options = ['W'=>0.8,'H'=>0.8] W宽 H高
147
+ * settings .document_class dom节点classname string(必须填)
148
+ * settings .title 自定义按钮名 string(必须填)
149
+ * settings .url 加载页地址:url/{id}参数匹配id string(必须填)
150
+ * settings .xhr_url ajax提交地址:url/{id}加参数匹配id string(选填)
151
+ * settings .method ajax提交方法:POST PUT... string(选填)
152
+ * settings .callback ajax提交回调方法 string(选填)
153
+ * settings .options 弹窗配置项 array(选填)
154
+ * options = ['W'=>0.8,'H'=>0.8] W宽 H高
157
155
* @param array $disable ['view','edit','delete'] 禁止操作按钮
158
156
*/
159
157
public static function makeRowPlaneAction (Grid $ grid , array $ settings = [], array $ disable = [])
@@ -206,14 +204,14 @@ public function render()
206
204
* 列-多操作添加 (旧版图标按钮模式)
207
205
* @param Grid $grid
208
206
* @param array $settings [setting,...]
209
- * setting .document_class dom节点classname string(必须填)
210
- * setting .title 自定义按钮名 string(必须填)
211
- * setting .url 加载页地址:url/{id}参数匹配id string(必须填)
212
- * setting .xhr_url ajax提交地址:url/{id}加参数匹配id string(选填)
213
- * setting .method ajax提交方法:POST PUT... string(选填)
214
- * setting .callback ajax提交回调方法 string(选填)
215
- * setting .options 弹窗配置项 array(选填)
216
- * options = ['W'=>0.8,'H'=>0.8] W宽 H高
207
+ * settings .document_class dom节点classname string(必须填)
208
+ * settings .title 自定义按钮名 string(必须填)
209
+ * settings .url 加载页地址:url/{id}参数匹配id string(必须填)
210
+ * settings .xhr_url ajax提交地址:url/{id}加参数匹配id string(选填)
211
+ * settings .method ajax提交方法:POST PUT... string(选填)
212
+ * settings .callback ajax提交回调方法 string(选填)
213
+ * settings .options 弹窗配置项 array(选填)
214
+ * options = ['W'=>0.8,'H'=>0.8] W宽 H高
217
215
* @param array $disable ['view','edit','delete'] 禁止操作按钮
218
216
*/
219
217
public static function _makeRowPlaneAction (Grid $ grid , array $ settings = [], array $ disable = [])
0 commit comments