\ No newline at end of file
diff --git a/extend/base/admin/view/system/menu/export.js b/extend/base/admin/view/system/menu/export.js
new file mode 100644
index 0000000..4d2e0be
--- /dev/null
+++ b/extend/base/admin/view/system/menu/export.js
@@ -0,0 +1,3 @@
+$(function () {
+ ua.listen();
+});
\ No newline at end of file
diff --git a/extend/base/admin/view/system/menu/import.html b/extend/base/admin/view/system/menu/import.html
new file mode 100644
index 0000000..4880ae1
--- /dev/null
+++ b/extend/base/admin/view/system/menu/import.html
@@ -0,0 +1,22 @@
+
+
+
\ No newline at end of file
diff --git a/extend/base/admin/view/system/menu/import.js b/extend/base/admin/view/system/menu/import.js
new file mode 100644
index 0000000..6b63064
--- /dev/null
+++ b/extend/base/admin/view/system/menu/import.js
@@ -0,0 +1,38 @@
+$(function () {
+ var fileInput = document.getElementById('json-file-input');
+ fileInput.addEventListener('change', function (e) {
+ var files = e.target.files;
+ if (files.length > 0) {
+ var file = files[0];
+ var reader = new FileReader();
+ reader.onload = function (e) {
+ var jsonStr = e.target.result;
+ // 解析json字符串,判断是否出错
+ try {
+ var jsonData = JSON.parse(jsonStr);
+
+ } catch (error) {
+ layer.msg('JSON 解析出错,请检查 JSON 格式是否正确。');
+ return;
+ }
+ $('#data').val(jsonStr);
+ };
+ reader.readAsText(file);
+ }
+ });
+ $('#process-json-file').click(function () {
+
+
+ fileInput.click();
+ });
+
+ ua.listen(function (data) {
+ return data;
+ }, function (res) {
+ ua.msg.success(res.msg, function () {
+ var index = parent.layer.getFrameIndex(window.name);
+ parent.layer.close(index);
+ parent.$('[data-treetable-refresh]').trigger("click");
+ });
+ });
+});
\ No newline at end of file
diff --git a/extend/base/admin/view/system/menu/index.html b/extend/base/admin/view/system/menu/index.html
index 3d7c9a7..8b164c8 100644
--- a/extend/base/admin/view/system/menu/index.html
+++ b/extend/base/admin/view/system/menu/index.html
@@ -21,4 +21,6 @@
+
+
diff --git a/extend/base/common/command/admin/VersionBase.php b/extend/base/common/command/admin/VersionBase.php
index a73d01d..5ebd284 100644
--- a/extend/base/common/command/admin/VersionBase.php
+++ b/extend/base/common/command/admin/VersionBase.php
@@ -12,14 +12,16 @@ use think\console\Output;
class VersionBase extends Command
{
- public const VERSION = 'v2.0.108';
+ public const VERSION = 'v2.0.109';
public const PRODUCT_VERSION = '';
public const LAYUI_VERSION = '2.8.17';
public const COMMENT = [
- '生成数据库迁移文件支持生成更新的迁移文件',
+ '增加菜单到导出和导入',
+ '增加粘贴全局操作',
+ '优化表单错误表现',
'发布新版本',
];
diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js
index 9462612..232ced4 100644
--- a/public/static/plugs/ulthon-admin/ulthon-admin.js
+++ b/public/static/plugs/ulthon-admin/ulthon-admin.js
@@ -171,7 +171,12 @@
}
},
error: function (xhr, textstatus, thrown) {
- admin.msg.error('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试!', function () {
+ var errorMsg = '';
+ if(xhr.responseJSON.message){
+ errorMsg = xhr.responseJSON.message;
+ }
+ loading.hide();
+ admin.msg.error('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试! '+errorMsg, function () {
ex(this);
});
return false;
@@ -1570,6 +1575,9 @@
// 监听点击复制
admin.api.copyText();
+ // 监听点击粘贴
+ admin.api.pasteText();
+
// 监听tab操作
miniTab.listen();
@@ -2414,6 +2422,33 @@
});
});
+ },
+ pasteText(elem) {
+ if (elem == undefined) {
+ elem = 'body';
+ }
+ var list = $(elem).find('[data-toggle="paste-text"]');
+
+ $.each(list, function (i, v) {
+
+ if ($(v).hasClass('paste-rendered')) {
+ return false;
+ }
+ $(v).addClass('paste-rendered');
+
+ var targetElemName = $(v).data('paste-target');
+ $(v).on('click', function () {
+ navigator.clipboard.readText()
+ .then(text => {
+ $(targetElemName).val(text);
+ layer.msg('粘贴成功');
+ })
+ .catch(err => {
+ console.error('Failed to read clipboard contents: ', err);
+ layer.msg('粘贴失败,请手动粘贴');
+ });
+ });
+ });
}
},
getQueryVariable(variable, defaultValue) {