From 4a1e2fddae5ec6e90a9b8491680c858533dfbf50 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 27 Jun 2022 11:34:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/view/api/upload/document.html | 12 +++++++----- app/admin/view/api/upload/image.html | 2 +- app/admin/view/api/upload/video.html | 20 +++++++++++--------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/admin/view/api/upload/document.html b/app/admin/view/api/upload/document.html index 010eccf9c..028ed6b4e 100644 --- a/app/admin/view/api/upload/document.html +++ b/app/admin/view/api/upload/document.html @@ -9,7 +9,7 @@
-
+

@@ -82,19 +82,21 @@ el: '#ImageDialog', data: { page: 1, - keys: '', limit: 15, - items: [], + show: false, $btn: null, + keys: '', + items: [], }, created: function () { - this.$btn = $('#{$get.id}'); + this.$btn = $('#{$get.id|default=""}'); this.loadPage(); }, methods: { // 创建分页工具条 addPage: function (count) { var that = this; + this.show = true; layui.laypage.render({ curr: this.page, count: count, limit: that.limit, layout: ['count', 'prev', 'page', 'next', 'refresh'], @@ -110,7 +112,7 @@ }, // 设置选择数据 setValue: function (url) { - this.$btn = $('#{$get.id}').trigger('change', url); + this.$btn.trigger('choose', url); if (this.$btn.data('input')) $(this.$btn.data('input')).val(url).trigger('change', url); $('#ImageDialog').parents('.layui-layer-content').next().find('.layui-layer-close').trigger('click'); }, diff --git a/app/admin/view/api/upload/image.html b/app/admin/view/api/upload/image.html index d4da9ad2b..028ed6b4e 100644 --- a/app/admin/view/api/upload/image.html +++ b/app/admin/view/api/upload/image.html @@ -112,7 +112,7 @@ }, // 设置选择数据 setValue: function (url) { - this.$btn = $('#{$get.id}').trigger('change', url); + this.$btn.trigger('choose', url); if (this.$btn.data('input')) $(this.$btn.data('input')).val(url).trigger('change', url); $('#ImageDialog').parents('.layui-layer-content').next().find('.layui-layer-close').trigger('click'); }, diff --git a/app/admin/view/api/upload/video.html b/app/admin/view/api/upload/video.html index af76501e3..028ed6b4e 100644 --- a/app/admin/view/api/upload/video.html +++ b/app/admin/view/api/upload/video.html @@ -9,7 +9,7 @@
-
+

@@ -82,19 +82,21 @@ el: '#ImageDialog', data: { page: 1, - keys: '', limit: 15, - items: [], + show: false, $btn: null, + keys: '', + items: [], }, created: function () { - this.$btn = $('#{$get.id}'); + this.$btn = $('#{$get.id|default=""}'); this.loadPage(); }, methods: { // 创建分页工具条 addPage: function (count) { var that = this; + this.show = true; layui.laypage.render({ curr: this.page, count: count, limit: that.limit, layout: ['count', 'prev', 'page', 'next', 'refresh'], @@ -110,7 +112,7 @@ }, // 设置选择数据 setValue: function (url) { - this.$btn = $('#{$get.id}').trigger('change', url); + this.$btn.trigger('choose', url); if (this.$btn.data('input')) $(this.$btn.data('input')).val(url).trigger('change', url); $('#ImageDialog').parents('.layui-layer-content').next().find('.layui-layer-close').trigger('click'); }, @@ -143,8 +145,8 @@ \ No newline at end of file