@@ -51,7 +51,7 @@ public static function makeComponentDot(Form $form, string $column, string $titl
51
51
* @param Form $form
52
52
* @param string $column 数据字段名
53
53
* @param string $title 名称
54
- * @param string $data json数据
54
+ * @param array $data 二维结构数据 [[column=>value,...],...]
55
55
* @param array $settings 配置项[setting,...]
56
56
* settings.columns array 多列配置项 (必须填)
57
57
* columns = [
@@ -68,7 +68,7 @@ public static function makeComponentDot(Form $form, string $column, string $titl
68
68
* 'delete'=>true 删除操作
69
69
* ]
70
70
*/
71
- public static function makeComponentLine (Form $ form , string $ column , string $ title , string $ data , array $ settings = [])
71
+ public static function makeComponentLine (Form $ form , string $ column , string $ title , array $ data , array $ settings = [])
72
72
{
73
73
$ strict = isset ($ settings ['strict ' ]) && $ settings ['strict ' ] ? true : false ;
74
74
$ width = isset ($ settings ['width ' ]) ? $ settings ['width ' ] : '100% ' ;
@@ -77,8 +77,9 @@ public static function makeComponentLine(Form $form, string $column, string $tit
77
77
if (!isset ($ settings ['columns ' ])) return ;
78
78
$ columns = $ settings ['columns ' ];
79
79
if ($ strict ) {
80
- $ data = (array )json_decode ($ data , true );
81
80
$ data = DLPHelper::safeJson ($ data );
81
+ }else {
82
+ $ data = json_encode ($ data , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS );
82
83
}
83
84
$ columns = json_encode ($ columns , JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS );
84
85
Admin::script (<<<EOF
0 commit comments