Skip to content

Commit 7e6c52c

Browse files
committed
1.6
1 parent 018c019 commit 7e6c52c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/DLPViewer.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function makeComponentDot(Form $form, string $column, string $titl
5151
* @param Form $form
5252
* @param string $column 数据字段名
5353
* @param string $title 名称
54-
* @param string $data json数据
54+
* @param array $data 二维结构数据 [[column=>value,...],...]
5555
* @param array $settings 配置项[setting,...]
5656
* settings.columns array 多列配置项 (必须填)
5757
* columns = [
@@ -68,7 +68,7 @@ public static function makeComponentDot(Form $form, string $column, string $titl
6868
* 'delete'=>true 删除操作
6969
* ]
7070
*/
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 = [])
7272
{
7373
$strict = isset($settings['strict']) && $settings['strict'] ? true : false;
7474
$width = isset($settings['width']) ? $settings['width'] : '100%';
@@ -77,8 +77,9 @@ public static function makeComponentLine(Form $form, string $column, string $tit
7777
if (!isset($settings['columns'])) return;
7878
$columns = $settings['columns'];
7979
if ($strict) {
80-
$data = (array)json_decode($data, true);
8180
$data = DLPHelper::safeJson($data);
81+
}else{
82+
$data = json_encode($data, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
8283
}
8384
$columns = json_encode($columns, JSON_UNESCAPED_UNICODE | JSON_HEX_QUOT | JSON_HEX_APOS);
8485
Admin::script(<<<EOF

0 commit comments

Comments
 (0)