diff --git a/app/admin/service/curd/templates/view/module/file.code b/app/admin/service/curd/templates/view/module/file.code index b6f5acc..a045801 100644 --- a/app/admin/service/curd/templates/view/module/file.code +++ b/app/admin/service/curd/templates/view/module/file.code @@ -4,7 +4,7 @@
- 上传 + 上传 选择
diff --git a/app/admin/service/curd/templates/view/module/files.code b/app/admin/service/curd/templates/view/module/files.code index 383200b..f343dfe 100644 --- a/app/admin/service/curd/templates/view/module/files.code +++ b/app/admin/service/curd/templates/view/module/files.code @@ -4,7 +4,7 @@
- 上传 + 上传 选择
diff --git a/app/admin/view/mall/goods/add.html b/app/admin/view/mall/goods/add.html index 986d76d..1781d8f 100644 --- a/app/admin/view/mall/goods/add.html +++ b/app/admin/view/mall/goods/add.html @@ -79,7 +79,23 @@ - +
+ +
+ +
+
+
+ +
+ + +
+
+
diff --git a/app/admin/view/mall/goods/edit.html b/app/admin/view/mall/goods/edit.html index 99fe43d..ff4fbbd 100644 --- a/app/admin/view/mall/goods/edit.html +++ b/app/admin/view/mall/goods/edit.html @@ -78,6 +78,22 @@
+
+ +
+ +
+
+
+ +
+ + +
+
diff --git a/config/database.php b/config/database.php index 181d6f7..ac314d0 100644 --- a/config/database.php +++ b/config/database.php @@ -37,7 +37,7 @@ return [ // 数据库连接参数 'params' => [], // 数据库编码默认采用utf8 - 'charset' => Env::get('database.charset', 'utf8'), + 'charset' => Env::get('database.charset', 'utf8mb4'), // 数据库表前缀 'prefix' => Env::get('database.prefix', 'ul_'), diff --git a/public/static/plugs/easy-admin/easy-admin.js b/public/static/plugs/easy-admin/easy-admin.js index 3fec874..db5379d 100644 --- a/public/static/plugs/easy-admin/easy-admin.js +++ b/public/static/plugs/easy-admin/easy-admin.js @@ -263,7 +263,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick options.limit = options.limit || 15; options.limits = options.limits || [10, 15, 20, 25, 50, 100]; options.cols = options.cols || []; - + var defaultToolbar = ['filter', 'print']; if (options.search) { @@ -1859,12 +1859,12 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick // url :'system.menu/index?id=1' // } // ea.api.reloadTable('currentTableRenderId',options) - reloadTable:function(tableName, options,mode){ + reloadTable: function (tableName, options, mode) { tableName = tableName || 'currentTableRenderId'; if (mode == 'table') { - table.reload(tableName,options); + table.reload(tableName, options); } else { - table.reloadData(tableName,options); + table.reloadData(tableName, options); } }, formRequired: function () { @@ -2028,10 +2028,14 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick uploadSign = $(this).attr('data-upload-sign') || '|', uploadAccept = $(this).attr('data-upload-accept') || 'file', uploadAcceptMime = $(this).attr('data-upload-mimetype') || '', - disablePreview = $(this).attr('data-disable-preview') || '', + uploadDisablePreview = $(this).attr('data-upload-disable-preview') || '0', + uploadFilenameField = $(this).attr('data-upload-filename-field') || '', elem = "input[name='" + uploadName + "']", - uploadElem = this; + uploadElem = this; + if (uploadFilenameField) { + var elemFilenameField = "input[name='" + uploadFilenameField + "']"; + } if (uploadExts == '*') { uploadExts = init.upload_exts; } else if (uploadExts.charAt(0) == '*') { @@ -2053,11 +2057,22 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick done: function (res) { if (res.code === 1) { var url = res.data.url; + var filename = res.data.original_name; if (uploadNumber !== 'one') { var oldUrl = $(elem).val(); if (oldUrl !== '') { url = oldUrl + uploadSign + url; } + if (elemFilenameField) { + var oldFilename = $(elemFilenameField).val(); + if (oldFilename !== '') { + filename = oldFilename + uploadSign + filename; + } + + } + } + if (elemFilenameField) { + $(elemFilenameField).val(filename); } $(elem).val(url); $(elem).trigger("input"); @@ -2069,7 +2084,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick } }); - if (disablePreview == 0) { + if (uploadDisablePreview == 0) { // 监听上传input值变化 $(elem).bind("input propertychange", function (event) { var urlString = $(this).val(), @@ -2141,6 +2156,11 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick var uploadName = $(this).attr('data-upload-select'), uploadNumber = $(this).attr('data-upload-number') || 'one', uploadSign = $(this).attr('data-upload-sign') || '|'; + uploadFilenameField = $(this).attr('data-upload-filename-field') || ''; + + if (uploadFilenameField) { + var elemFilenameField = "input[name='" + uploadFilenameField + "']"; + } var selectCheck = uploadNumber === 'one' ? 'radio' : 'checkbox'; var elem = "input[name='" + uploadName + "']", @@ -2166,12 +2186,18 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick }, done: function (e, data) { var urlArray = []; + var filenameArray = []; $.each(data.data, function (index, val) { urlArray.push(val.url) + filenameArray.push(val.original_name) }); var url = urlArray.join(uploadSign); + var filename = filenameArray.join(uploadSign); admin.msg.success('选择成功', function () { $(elem).val(url); + if (uploadFilenameField) { + $(elemFilenameField).val(filename); + } $(elem).trigger("input"); }); }