dever 6 yıl önce
ebeveyn
işleme
ed12d0f978
1 değiştirilmiş dosya ile 36 ekleme ve 5 silme
  1. 36 5
      src/Lib/Input.php

+ 36 - 5
src/Lib/Input.php

@@ -199,9 +199,20 @@ class Input
         } else {
             $pic = 'src="" style=display:none;';
         }
-        return '<input type="button" style="width:10%;" class="form-control image_upload" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="选择文件"/>
+        $class = 'width:100px;display:inline;';
+        if (layadmin()) {
+            $class .= 'padding-left:0px;';
+        }
+        return '<input type="button" style="'.$class.'" class="form-control image_upload" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>
+
+        <input type="button" style="'.$class.'" class="form-control upload_show" v="' . $param['name'] . '_' . $param['index'] . '" id="file_show_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="图库"/>
+
+        <div style="margin-top:10px;display:none;" class="layui-progress layui-progress-big" id="file_' . $param['name'] . '_' . $param['index'] . '_progress" lay-filter="file_' . $param['name'] . '_' . $param['index'] . '_progress" lay-showPercent="true">
+          <div class="layui-progress-bar" lay-percent="0%"></div>
+        </div>
+
         <div style="margin:10px;">
-        <img ' . $pic . ' onclick="picDel($(this), \'' . $param['name'] . '_' . $param['index'] . '\', 1);" class="update_value" update_type="src" id="show_' . $param['name'] . '_' . $param['index'] . '" width="150" /></div>
+        <img ' . $pic . ' class="update_value" update_type="src" id="show_' . $param['name'] . '_' . $param['index'] . '" width="150" /></div>
         <input type="text" class="update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" name="' . $param['name'] . '" id="' . $param['name'] . '_' . $param['index'] . '" value="' . (isset($param['value']) ? $param['value'] : (isset($param['default']) ? $param['default'] : '')) . '">';
     }
 
@@ -219,7 +230,14 @@ class Input
                 $pic .= '<a href="javascript:;" title="点此删除" onclick="picDel($(this), \'' . $param['name'] . '_' . $param['index'] . '\')"><img src="' . $v . '" id="show_' . $param['name'] . '_' . $param['index'] . '_' . $k . '" width="150"  style="margin-left:5px;" alt="点此删除"/></a>';
             }
         }
-        return '<input type="button" style="width:10%;" class="form-control image_upload" mul="yes" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="选择文件"/>
+        $class = 'width:100px;display:inline;';
+        if (layadmin()) {
+            $class .= 'padding-left:0px;';
+        }
+        return '<input type="button" style="'.$class.'" class="form-control image_upload" mul="yes" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>
+
+        <input type="button" style="'.$class.'" class="form-control upload_show" mul="yes" v="' . $param['name'] . '_' . $param['index'] . '" id="file_show_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="图库"/>
+
         <div style="margin:10px;" update_type="html"  class="update_value ' . $param['name'] . '_' . $param['index'] . '_mul">' . $pic . '</div>
 
         <input type="text" class="update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" name="' . $param['name'] . '" id="' . $param['name'] . '_' . $param['index'] . '" value="' . (isset($param['value']) ? $param['value'] : (isset($param['default']) ? $param['default'] : '')) . '">';
@@ -232,7 +250,14 @@ class Input
      */
     public static function _upload($param)
     {
-        return '<input type="button" style="width:10%;" class="form-control image_upload" t="file" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="选择文件"/>
+        $class = 'width:100px;display:inline;';
+        if (layadmin()) {
+            $class .= 'padding-left:0px;';
+        }
+        return '<input type="button" style="'.$class.'" class="form-control image_upload" t="file" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>
+
+        <input type="button" style="'.$class.'" class="form-control upload_show" t="file" v="' . $param['name'] . '_' . $param['index'] . '" id="file_show_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="文件库"/>
+
         <div style="margin-top:10px;"><input type="text" class="update_value form-control ' . (isset($param['valid']) ? $param['valid'] : '') . '" name="' . $param['name'] . '" id="' . $param['name'] . '_' . $param['index'] . '" value="' . (isset($param['value']) ? $param['value'] : (isset($param['default']) ? $param['default'] : '')) . '">
         </div>';
         //return '<input type="file" class="form-control" value="' . (isset($param['value']) ? $param['value'] : (isset($param['default']) ? $param['default'] : '')) . '" name="' . $param['name'] . '"/>';
@@ -254,7 +279,13 @@ class Input
             }
         }
 
-        return '<input type="button" style="width:10%;" class="form-control image_upload" t="file" mul="yes" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="选择文件"/>
+        $class = 'width:100px;display:inline;';
+        if (layadmin()) {
+            $class .= 'padding-left:0px;';
+        }
+        return '<input type="button" style="'.$class.'" class="form-control image_upload" t="file" mul="yes" v="' . $param['name'] . '_' . $param['index'] . '" id="file_show_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="本地上传"/>
+
+        <input type="button" style="'.$class.'" class="form-control upload_show" t="file" mul="yes" v="' . $param['name'] . '_' . $param['index'] . '" id="file_' . $param['name'] . '_' . $param['index'] . '" key="' . $param['key'] . '" value="文件库"/>
 
         <ul style="margin:10px;" update_type="html"  class="update_value ' . $param['name'] . '_' . $param['index'] . '_mul">' . $file . '</ul>