Skip to content

Commit 76b63c9

Browse files
author
hikki
committed
v3.7 bug
1 parent df0e214 commit 76b63c9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

resources/assets/component.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@
292292
display: flex;
293293
justify-content:left;
294294
align-items: baseline;
295-
margin: 10px 3em 5px 10px;
296-
border: 1px solid #ebebeb;
295+
margin: 15px 10px;
297296
}
298297
.dlp-form-row>input,.dlp-form-row>textarea{
299298
flex: auto;

src/Tool/FormPanel.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ public function select(string $column, string $label, array $select, array $sele
8686
* format: [YYYY-MM-DD HH:mm:ss | YYYY-MM-DD | YYYY ]
8787
* locale 语言配置
8888
*/
89-
public function datepicker(string $column, string $label, $value = '',array $settings = ['format'=>"YYYY-MM-DD HH:mm:ss",'locale'=>"zh-CN"])
89+
public function datepicker(string $column, string $label, $value = '',array $settings = [])
9090
{
9191
if (!$value) {
9292
$value = date('Y-m-d H:i:s');
9393
}
94-
$settings = json_encode($settings);
94+
$settings = json_encode(array_merge(['format'=>'YYYY-MM-DD HH:mm:ss','locale'=>'zh-CN'], $settings));
9595
$content = <<<EOF
9696
<input style="width: 160px" type="text" id="{$column}" name="{$column}" value="{$value}" class="dlp-input {$column}" placeholder="输入 {$label}" />
9797
<script>
98-
$('#{$column}').datetimepicker(JSON.parse({$settings}));
98+
$('#{$column}').datetimepicker({$settings});
9999
</script>
100100
EOF;
101101
$this->html .= $this->rowpanel($column, $label, $content);
@@ -158,7 +158,8 @@ public function fileInput(string $column, string $label, array $settings = [], a
158158
}
159159
}
160160
$settings = json_encode(array_merge($file_input_settings, $settings));
161-
$content = `<input class='{$column}' name='{$column}' multiple type='file' {$attribute}>
161+
$content = <<<EOF
162+
<input class='{$column}' name='{$column}' multiple type='file' {$attribute}>
162163
<script>
163164
$('input.{$column}').fileinput(JSON.parse('{$settings}')).on('filebeforedelete', function () {
164165
return new Promise(function(resolve, reject) {
@@ -184,7 +185,8 @@ public function fileInput(string $column, string $label, array $settings = [], a
184185
}).on('fileerror', function (event, data, msg) {
185186
alert(msg);
186187
});
187-
</script>`;
188+
</script>
189+
EOF;
188190

189191
$this->html .= $this->rowpanel($column, $label, $content);
190192
}

0 commit comments

Comments
 (0)