From c5a091c7324121d0c2b2c49717d4ecdec5dd0db1 Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:20:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4Vue=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E9=A1=B9=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除了`config.js`中的Vue实例创建过程,简化了上传类型的数据绑定。通过直接操作`app.upload_type`来响应上传类型的变化。 --- app/admin/view/system/config/upload.html | 26 ++++++++++++------------ public/static/admin/js/system/config.js | 9 +++++++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/app/admin/view/system/config/upload.html b/app/admin/view/system/config/upload.html index 089c7af..0e2f2e7 100644 --- a/app/admin/view/system/config/upload.html +++ b/app/admin/view/system/config/upload.html @@ -24,7 +24,7 @@ -
+
@@ -32,7 +32,7 @@
-
+
@@ -40,7 +40,7 @@
-
+
@@ -48,7 +48,7 @@
-
+
@@ -56,7 +56,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
@@ -72,7 +72,7 @@
-
+
@@ -80,7 +80,7 @@
-
+
@@ -88,7 +88,7 @@
-
+
@@ -96,7 +96,7 @@
-
+
@@ -104,7 +104,7 @@
-
+
@@ -112,7 +112,7 @@
-
+
@@ -120,7 +120,7 @@
-
+
diff --git a/public/static/admin/js/system/config.js b/public/static/admin/js/system/config.js index 647e194..feae527 100644 --- a/public/static/admin/js/system/config.js +++ b/public/static/admin/js/system/config.js @@ -10,10 +10,17 @@ define(["jquery", "easy-admin", "vue"], function ($, ea, Vue) { _group = $(this).data('group') }); + let _upload_type = upload_type || 'local' + $('.upload_type').addClass('layui-hide') + $('.' + _upload_type).removeClass('layui-hide') + form.on("radio(upload_type)", function (data) { - app.upload_type = this.value; + _upload_type = this.value; + $('.upload_type').addClass('layui-hide') + $('.' + _upload_type).removeClass('layui-hide') }); + form.on("submit", function (data) { data.field['group'] = _group });