jqh 5 년 전
부모
커밋
7d89cca68d

+ 2 - 2
resources/assets/dcat/extra/Upload/AddFile.js

@@ -4,8 +4,8 @@ export default class AddFile {
         this.uploader = Uploder;
     }
 
-    // 添加新文件
-    add(file) {
+    // 渲染新文件
+    render(file) {
         let _this = this,
             parent = _this.uploader,
             showImg = parent.isImage(),

+ 3 - 3
resources/assets/dcat/extra/Upload/AddUploadedFile.js

@@ -9,8 +9,8 @@ export default class AddUploadedFile {
         this.init = false;
     }
 
-    // 添加已上传文件
-    add(file) {
+    // 渲染已上传文件
+    render(file) {
         let _this = this,
             parent =  _this.uploader,
             options = parent.options,
@@ -157,7 +157,7 @@ export default class AddUploadedFile {
         }
     }
 
-    push(file) {
+    add(file) {
         if (!file.serverId || this.uploader.helper.searchUploadedFile(file.serverId) !== -1) {
             return;
         }

+ 3 - 3
resources/assets/dcat/extra/upload.js

@@ -206,7 +206,7 @@ import AddUploadedFile from './Upload/AddUploadedFile'
                 }
 
                 // 添加文件
-                _this.addFile.add(file);
+                _this.addFile.render(file);
                 _this.status.switch('ready');
 
                 // 更新进度条
@@ -335,7 +335,7 @@ import AddUploadedFile from './Upload/AddUploadedFile'
             obj.file.serverPath = reason.data.path;
             obj.file.serverUrl = reason.data.url || null;
 
-            _this.addUploadedFile.push(obj.file);
+            _this.addUploadedFile.add(obj.file);
 
             _this.input.add(reason.data.id);
 
@@ -376,8 +376,8 @@ import AddUploadedFile from './Upload/AddUploadedFile'
                 _this.status.switch('decrFileNumLimit');
 
                 // 添加文件到预览区域
+                _this.addUploadedFile.render(file);
                 _this.addUploadedFile.add(file);
-                _this.addUploadedFile.push(file);
             }
         }
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/adminlte/adminlte-blue-light.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/adminlte/adminlte-blue.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/adminlte/adminlte-green.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/adminlte/adminlte.css


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/adminlte/adminlte.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/adminlte/adminlte.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/action.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/grid-extend.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/grid-extend.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/select-table.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/select-table.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/upload.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/extra/upload.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
resources/dist/dcat/js/dcat-app.js.map


+ 18 - 0
src/Grid.php

@@ -498,6 +498,24 @@ class Grid
         );
     }
 
+    /**
+     * @param string $key
+     *
+     * @return string
+     */
+    public function getEditUrl($key)
+    {
+        $url = "{$this->resource()}/{$key}/edit";
+
+        $queryString = '';
+
+        if ($constraints = $this->model()->getConstraints()) {
+            $queryString = http_build_query($constraints);
+        }
+
+        return $url.($queryString ? ('?'.$queryString) : '');
+    }
+
     /**
      * @param \Closure $closure
      *

+ 1 - 1
src/Grid/Actions/Edit.php

@@ -19,6 +19,6 @@ class Edit extends RowAction
      */
     public function href()
     {
-        return "{$this->resource()}/{$this->getKey()}/edit";
+        return $this->parent->getEditUrl($this->getKey());
     }
 }

+ 1 - 1
src/Grid/Displayers/Actions.php

@@ -246,7 +246,7 @@ EOT;
         $label = trans('admin.edit');
 
         return <<<EOT
-<a href="{$this->resource()}/{$this->getKey()}/edit" title="{$label}">
+<a href="{$this->grid->getEditUrl($this->getKey())}" title="{$label}">
     <i class="feather icon-edit-1 grid-action-icon"></i>
 </a>&nbsp;
 EOT;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.