From 4d400a369db4fe6f94116e4c6a8c079b22f3569e Mon Sep 17 00:00:00 2001 From: bourne7 Date: Tue, 22 Oct 2019 09:24:04 +0800 Subject: [PATCH 01/37] =?UTF-8?q?table=E7=9A=84=E5=90=88=E8=AE=A1=E8=A1=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=8F=AF=E4=BB=A5=E6=8C=87=E5=AE=9A=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E7=9A=84=E5=B0=8F=E6=95=B0=E7=82=B9=E4=BD=8D=E4=BA=86?= =?UTF-8?q?=E3=80=82=E5=A6=82=E6=9E=9C=E4=B8=8D=E6=8C=87=E5=AE=9A=E7=9A=84?= =?UTF-8?q?=E8=AF=9D=E5=B0=B1=E6=98=AF=E9=BB=98=E8=AE=A4=E7=9A=842?= =?UTF-8?q?=E4=BD=8D=EF=BC=8C=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20totalRowDecimalScale=20=E6=9D=A5=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/table.html | 6 ++++-- src/lay/modules/table.js | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/table.html b/examples/table.html index 5ce2d02a..d31151a5 100644 --- a/examples/table.html +++ b/examples/table.html @@ -177,7 +177,7 @@ body{padding: 20px; /*overflow-y: scroll;*/} - + - + + + + ``` diff --git a/examples/table-test.html b/examples/table-test.html index 377675b1..9d05a5a4 100644 --- a/examples/table-test.html +++ b/examples/table-test.html @@ -136,7 +136,7 @@ layui.use(['table', 'dropdown'], function(){ var td = obj.td(this.field); //获取当前 td return td.find('select').val(); }} - ,{field:'sign', title:'签名'} + ,{field:'sign', title:'签名', edit: 'textarea'} ,{field: 'experience', title: '积分', width:80, sort: true, align:'center', totalRow: '{{ d.TOTAL_NUMS }} 😊', templet: '
{{ d.experience }} 分
'} ,{field:'ip', title:'IP', width: 120} ,{field:'logins', title:'登入次数', width: 100, sort: true, totalRow: '{{ parseInt(d.TOTAL_NUMS) }} 次'} diff --git a/src/modules/lay.js b/src/modules/lay.js index 209f6052..48cf54ba 100644 --- a/src/modules/lay.js +++ b/src/modules/lay.js @@ -419,5 +419,4 @@ }); } -}(window, window.document); - +}(window, window.document); \ No newline at end of file diff --git a/src/modules/table.js b/src/modules/table.js index 32f2ae52..2043fb2f 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1409,12 +1409,12 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ } break; case 'LAYTABLE_PRINT': //打印 - var printWin = window.open('打印窗口', '_blank') + var printWin = window.open('about:blank', '_blank') ,style = [''].join('') ,html = $(that.layHeader.html()); //输出表头 From 9d689b3b8971b5cc05f01901cf0ebc9dd79831dd Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Mon, 20 Jun 2022 23:58:20 +0800 Subject: [PATCH 21/37] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=90=E5=88=97?= =?UTF-8?q?=E6=9C=89=E9=9A=90=E8=97=8F=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=88=97=E5=AE=BD=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/table.js b/src/modules/table.js index 60c52d77..36cb72af 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1914,6 +1914,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){ // 找到它的子列所在cols的下标 var i2 = i1 + (parseInt(item2.rowspan) || 1); layui.each(cols[i2], function (i22, item22) { + if (item22.hide) return; //如果子列已经被标注为{PARENT_COL_INDEX},或者子列累计 colspan 数等于父列定义的 colspan,则跳出当前子列循环 if (item22.PARENT_COL_INDEX || (childIndex >= 1 && childIndex == (item2.colspan || 1))) return; item22.PARENT_COL_INDEX = index; From 7076f801f7e878f4cd2c21731e2def496da2bde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 21 Jun 2022 00:02:39 +0800 Subject: [PATCH 22/37] update --- examples/json/table/demo1.json | 4 ++-- examples/json/table/demo3.json | 2 +- examples/table.html | 4 ++-- package.json | 2 +- src/css/layui.css | 2 +- src/layui.js | 2 +- src/modules/table.js | 10 +++------- 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/examples/json/table/demo1.json b/examples/json/table/demo1.json index 4032e702..1657c779 100644 --- a/examples/json/table/demo1.json +++ b/examples/json/table/demo1.json @@ -3,7 +3,7 @@ ,"msg": "" ,"count": 3000000 ,"totalRow": { - "experience": "666" + "experience": "777" } ,"data": [{ "id": "10001" @@ -34,7 +34,7 @@ ,"email": "test3@email.com" ,"sex": "男" ,"city": "浙江杭州" - ,"sign": "人生恰似一场修行" + ,"sign": "人生恰似一场修行
1
1
1
1
1
1" ,"experience": 8 ,"ip": "192.168.0.8" ,"logins": null diff --git a/examples/json/table/demo3.json b/examples/json/table/demo3.json index dbd785b5..981f046b 100644 --- a/examples/json/table/demo3.json +++ b/examples/json/table/demo3.json @@ -1,7 +1,7 @@ { "status": 200 ,"message": "" - ,"total": 3000000 + ,"total": 333333 ,"data": { "list": [{ "id": "10001" diff --git a/examples/table.html b/examples/table.html index 5b847ec6..d2db47da 100644 --- a/examples/table.html +++ b/examples/table.html @@ -182,7 +182,7 @@ - + @@ -72,4 +72,4 @@ layui 是一套开源的 Web UI 组件库,采用自身经典的模块化规范 layui 原官网已于2021年10月13日下线。详见: > 1. layui 原官网下线公告 2. layui 原官网为什么要下线? -鉴于 layui 相对庞大的受众群体,从此 Github 和 Gitee 平台将支撑起 layui 的后续,**它将继续陪伴着仍然需要它的人**。 +鉴于 Layui 相对庞大的受众群体,从此 Github 和 Gitee 平台将支撑起 Layui 的后续,**它将继续陪伴着仍然需要它的人**。 diff --git a/examples/json/table/demo1.json b/examples/json/table/demo1.json index 1657c779..a9a06a3a 100644 --- a/examples/json/table/demo1.json +++ b/examples/json/table/demo1.json @@ -7,14 +7,14 @@ } ,"data": [{ "id": "10001" - ,"username": "杜甫" + ,"username": "杜甫123" ,"email": "test1@email.com" ,"sex": "" ,"city": "浙江杭州" ,"sign": "鼠标移动到此处,可以通过点击单元格右侧的下拉图标,查看到被隐藏的全部内容。" ,"experience": 7 ,"ip": "192.168.0.8" - ,"logins": null + ,"logins": 0 ,"joinTime": "2016-10-14" }, { "id": "10002" @@ -34,7 +34,7 @@ ,"email": "test3@email.com" ,"sex": "男" ,"city": "浙江杭州" - ,"sign": "人生恰似一场修行
1
1
1
1
1
1" + ,"sign": "人生恰似一场修行" ,"experience": 8 ,"ip": "192.168.0.8" ,"logins": null diff --git a/examples/table-static.html b/examples/table-static.html new file mode 100644 index 00000000..67c20d35 --- /dev/null +++ b/examples/table-static.html @@ -0,0 +1,107 @@ + + + + + + 静态表格 - layui + + + + + + +
+ 表格综合 + 表格操作 + 静态表格 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
人物民族格言
孔子华夏有朋至远方来,不亦乐乎
孟子华夏穷则独善其身,达则兼济天下
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
人物民族格言
孔子华夏有朋至远方来,不亦乐乎
孟子华夏穷则独善其身,达则兼济天下
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
人物民族格言
孔子华夏有朋至远方来,不亦乐乎
孟子华夏穷则独善其身,达则兼济天下
+ + + \ No newline at end of file diff --git a/examples/table-test.html b/examples/table-test.html index 9d05a5a4..0fe08da6 100644 --- a/examples/table-test.html +++ b/examples/table-test.html @@ -1,5 +1,3 @@ - - @@ -8,16 +6,15 @@ 表格操作 - layui -
表格综合 - 表格测试 + 表格操作 静态表格
@@ -25,14 +22,17 @@
- - - - - + + + + +
@@ -73,13 +73,13 @@ diff --git a/examples/table.html b/examples/table.html index d2db47da..f513d76a 100644 --- a/examples/table.html +++ b/examples/table.html @@ -1,5 +1,3 @@ - - @@ -10,14 +8,14 @@
- 表格综合 - 表格测试 + 表格综合 + 表格操作 静态表格
@@ -184,24 +182,10 @@ - - + + + + + ``` From 094cfc03b1127666c0a56010ce0da883a392e78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:40:14 +0800 Subject: [PATCH 27/37] update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ad9fb2c..98cdb739 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Layui 是一套开源的 Web UI 组件库,采用自身经典的模块化规范 开始使用 Layui - + From 37b4c404ea73f1f0fc4395208c870cf1277dbf1e Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Wed, 22 Jun 2022 11:43:18 +0800 Subject: [PATCH 28/37] =?UTF-8?q?carousel=20autoplay=E6=96=B0=E5=A2=9E'alw?= =?UTF-8?q?ays'=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/carousel.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/carousel.js b/src/modules/carousel.js index 6d7b29c6..5ada1181 100644 --- a/src/modules/carousel.js +++ b/src/modules/carousel.js @@ -292,8 +292,10 @@ layui.define('jquery', function(exports){ //移入移出容器 options.elem.on('mouseenter', function(){ + if (that.config.autoplay === 'always') return; clearInterval(that.timer); }).on('mouseleave', function(){ + if (that.config.autoplay === 'always') return; that.autoplay(); }); From 3b8f6a04775857e6b2355adcd1d43508adbc3dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Thu, 23 Jun 2022 00:03:41 +0800 Subject: [PATCH 29/37] update --- README.md | 26 +- examples/carousel.html | 27 +- examples/form.html | 695 ++++++++++++++++++++------------------- examples/table-test.html | 21 +- gulpfile.js | 3 +- package.json | 2 +- src/css/layui.css | 11 +- src/layui.js | 2 +- src/modules/carousel.js | 12 +- src/modules/form.js | 69 ++-- src/modules/laydate.js | 28 +- src/modules/laypage.js | 34 +- src/modules/slider.js | 27 +- src/modules/table.js | 53 +-- src/modules/transfer.js | 4 +- 15 files changed, 545 insertions(+), 469 deletions(-) diff --git a/README.md b/README.md index 98cdb739..ff363c31 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,12 @@ --- -Layui 是一套开源的 Web UI 组件库,采用自身经典的模块化规范,并遵循原生 HTML/CSS/JS 的开发方式,极易上手,拿来即用。其风格简约轻盈,而组件优雅丰盈,从源代码到使用方法的每一处细节都经过精心雕琢,非常适合网页界面的快速开发。Layui 区别于那些基于 MVVM 底层的前端框架,却并非逆道而行,而是信奉返璞归真之道。准确地说,它更多是面向后端开发者,你无需涉足前端的各种工具,只需面对浏览器本身,让一切你所需要的元素与交互,从这里信手拈来。 +Layui 是一套开源的 Web UI 组件库,采用自身轻量级模块化规范,遵循原生态的 HTML/CSS/JavaScript 开发模式,极易上手,拿来即用。其风格简约,而内在丰盈,利于实现网页界面的快速构建。Layui 区别于一众主流的前端框架,却并非逆道而行,而是信奉返璞归真之道。确切地说,它更多是面向于追求简单的务实主义者,他们无需涉足各类构建工具,只需面向浏览器本身,即可轻松掌握页面所需的元素与交互,进而信手拈来。 -## 快速上手 +## ✍ 快速上手 -获得 Layui 后,将其完整地部署到你的静态资源项目目录,你只需要引入下述两个文件: +使用 Layui 只需在页面中引入核心文件即可: ```html @@ -42,8 +42,7 @@ Layui 是一套开源的 Web UI 组件库,采用自身经典的模块化规范 - - + - + + - - -
- - - - - - - - -
- +

原始表单调试:

+
+ +
+ + + + + + + + +
+ diff --git a/examples/table-test.html b/examples/table-test.html index 0fe08da6..cc36cf4a 100644 --- a/examples/table-test.html +++ b/examples/table-test.html @@ -38,7 +38,7 @@ + +
- +