@@ -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>
100100EOF ;
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