| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 | 
							- <?php
 
- namespace App\Admin\Extensions\Field;
 
- use Encore\Admin\Form\Field;
 
- class SyncFile extends Field
 
- {
 
-     protected $view = 'admin.field.sync_file';
 
-     protected static $css = [
 
-         '/vendor/laravel-admin/bootstrap-fileinput/css/fileinput.min.css',
 
-         '/vendor/laravel-admin/bootstrap-fileinput/themes/explorer/theme.min.css',
 
-     ];
 
-     protected static $js = [
 
-         '/vendor/laravel-admin/bootstrap-fileinput/js/plugins/sortable.min.js',
 
-         '/vendor/laravel-admin/bootstrap-fileinput/js/plugins/purify.min.js',
 
-         '/vendor/laravel-admin/bootstrap-fileinput/js/plugins/piexif.min.js',
 
-         '/vendor/laravel-admin/bootstrap-fileinput/js/fileinput.min.js',
 
-         '/vendor/laravel-admin/bootstrap-fileinput/js/locales/zh.js',
 
-         '/vendor/laravel-admin/bootstrap-fileinput/themes/explorer/theme.min.js',
 
-     ];
 
- //    public function placeholder($placeholder = ''): self
 
- //    {
 
- //        if (!empty($placeholder)) {
 
- //            $this->options(['initialCaption' => $placeholder]);
 
- //        }
 
- //        return $this;
 
- //    }
 
-     /**
 
-      * Set default options form image field.
 
-      *
 
-      * @return void
 
-      */
 
-     protected function setupDefaultOptions()
 
-     {
 
-         $defaultOptions = [
 
-             'language'     => 'zh',
 
-            // 'theme'     => 'explorer',
 
-             'uploadUrl' => route('api.fileinput'),
 
-             'initialPreviewAsData'     => true,
 
- //            'initialPreviewAsData' => true,
 
- //            'browseLabel'          => trans('admin.browse'),
 
- //            'showRemove'           => false,
 
- //            'showUpload'           => false,
 
- //            'dropZoneEnabled'      => false,        //dropzone disabled by default for backward compatibility
 
- ////            'initialCaption'       => $this->initialCaption($this->value),
 
- //            'deleteExtraData'      => [
 
- //                $this->formatName($this->column) => static::FILE_DELETE_FLAG,
 
- //                static::FILE_DELETE_FLAG         => '',
 
- //                '_token'                         => csrf_token(),
 
- //                '_method'                        => 'PUT',
 
- //            ],
 
-         ];
 
-         $this->options($defaultOptions);
 
-     }
 
-     /**
 
-      * Render file upload field.
 
-      *
 
-      * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
 
-      */
 
-     public function render()
 
-     {
 
-         $this->options([]);
 
-         $this->setupDefaultOptions();
 
-         $options = json_encode($this->options);
 
-         $this->script = <<<EOT
 
- $("input{$this->getElementClassSelector()}").fileinput({$options});
 
- EOT;
 
-         return parent::render();
 
-     }
 
- }
 
 
  |