From 460e06bdf20ad6f0311d4cb9bd60e5984cde9b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 20 Mar 2025 16:58:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=20layui=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=AF=BC=E8=87=B4=E7=9A=84=20jQuery=20=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-plugs-admin/src/view/api/upload.js | 2 +- .../stc/public/static/admin.js | 16 ++++++++-------- .../src/view/config/options.html | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugin/think-plugs-admin/src/view/api/upload.js b/plugin/think-plugs-admin/src/view/api/upload.js index edf247b8d..e1b1dbc67 100644 --- a/plugin/think-plugs-admin/src/view/api/upload.js +++ b/plugin/think-plugs-admin/src/view/api/upload.js @@ -24,7 +24,7 @@ define(['md5', 'notify'], function (SparkMD5, Notify, allowMime) { this.option.input = $(this.option.elem.data('input')) } else if (this.option.elem.data('field')) { this.option.input = $('input[name="' + this.option.elem.data('field') + '"]:not([type=file])'); - this.option.elem.data('input', this.option.input.size() > 0 ? this.option.input.get(0) : null); + this.option.elem.data('input', this.option.input.length > 0 ? this.option.input.get(0) : null); } /*! 文件选择筛选,使用 MIME 规则过滤文件列表 */ diff --git a/plugin/think-plugs-static/stc/public/static/admin.js b/plugin/think-plugs-static/stc/public/static/admin.js index e46cc8681..6f4bc0cad 100644 --- a/plugin/think-plugs-static/stc/public/static/admin.js +++ b/plugin/think-plugs-static/stc/public/static/admin.js @@ -182,7 +182,7 @@ $(function () { /*! 关闭顶层最新窗口 */ this.closeLastModal = function () { while ($.msg.mdx.length > 0 && (this.tdx = $.msg.mdx.pop()) > 0) { - if ($('#layui-layer' + this.tdx).size()) return layer.close(this.tdx); + if ($('#layui-layer' + this.tdx).length) return layer.close(this.tdx); } }; /*! 关闭消息框 */ @@ -404,15 +404,15 @@ $(function () { this.queryNode = function (uri, node) { // 如果该节点存在直接返回 Node 值 if (/^m-/.test(node = node || location.href.replace(/.*spm=([\d\-m]+).*/ig, '$1'))) { - if ($('[data-menu-node="' + node + '"]').size()) return node; + if ($('[data-menu-node="' + node + '"]').length) return node; } let path = uri.replace(/\.html$/ig, ''); // 尝试通过 URI 查询节点值 let $menu = $('[data-menu-node][data-open*="' + path + '"]'); - if ($menu.size()) return $menu.get(0).dataset.menuNode; + if ($menu.length) return $menu.get(0).dataset.menuNode; // 尝试通过 URL 查询节点值 $menu = $('[data-menu-node][data-open~="#' + path + '"]'); - return $menu.size() ? $menu.get(0).dataset.menuNode : (/^m-/.test(node || '') ? node : ''); + return $menu.length ? $menu.get(0).dataset.menuNode : (/^m-/.test(node || '') ? node : ''); }; /*! 完整 URL 转 URI 地址 */ this.parseUri = function (uri, elem, vars, temp, attrs) { @@ -665,10 +665,10 @@ $(function () { // 默认动态设置页数, 动态设置最大高度 if (option.page === true) option.page = {curr: layui.sessionData('pages')[option.id] || 1}; if (option.width === 'full') option.width = $table.parent().width(); - if (option.height === 'full') if ($table.parents('.iframe-pagination').size()) { + if (option.height === 'full') if ($table.parents('.iframe-pagination').length) { $table.parents('.iframe-pagination').addClass('not-footer'); option.height = $(window).height() - $table.removeClass('layui-hide').offset().top - 20; - } else if ($table.parents('.laytable-pagination').size()) { + } else if ($table.parents('.laytable-pagination').length) { option.height = $table.parents('.laytable-pagination').height() - $table.removeClass('layui-hide').position().top - 20; } else { option.height = $(window).height() - $table.removeClass('layui-hide').offset().top - 35; @@ -814,7 +814,7 @@ $(function () { let type = form.getAttribute('method') || 'POST', href = form.getAttribute('action') || location.href; let dset = form.dataset, tips = dset.tips || undefined, time = dset.time || undefined, taid = dset.tableId || false; let call = window[dset.callable || '_default_callable'] || (taid ? function (ret) { - if (typeof ret === 'object' && ret.code > 0 && $('#' + taid).size() > 0) { + if (typeof ret === 'object' && ret.code > 0 && $('#' + taid).length > 0) { return $.msg.success(ret.info, 3, function () { $.msg.closeLastModal(); (typeof ret.data === 'string' && ret.data) ? $.form.goto(ret.data) : $.layTable.reload(taid); @@ -853,7 +853,7 @@ $(function () { /*! 查找表单元素, 如果没有找到将不会自动写值 */ if (!(this.$elem = $(this)).data('input') && this.$elem.data('field')) { let $input = $('input[name="' + this.$elem.data('field') + '"]:not([type=file])'); - this.$elem.data('input', $input.size() > 0 ? $input.get(0) : null); + this.$elem.data('input', $input.length > 0 ? $input.get(0) : null); } // 单图或多图选择器 ( image|images ) if (typeof this.dataset.file === 'string' && /^images?$/.test(this.dataset.file)) { diff --git a/plugin/think-plugs-wechat/src/view/config/options.html b/plugin/think-plugs-wechat/src/view/config/options.html index 0c04e20f2..33315f422 100644 --- a/plugin/think-plugs-wechat/src/view/config/options.html +++ b/plugin/think-plugs-wechat/src/view/config/options.html @@ -37,7 +37,7 @@ function apply(data) { this.$active = $("[data-wechat-type='" + data.value + "']").trigger('click'); - if (this.$active.size() < 1) $("[data-wechat-type]:first").trigger('click'); + if (this.$active.length < 1) $("[data-wechat-type]:first").trigger('click'); $('[data-type="' + data.value + '"]').show().siblings('[data-type]').hide(); } });