From edada96c63c6ca961bb0366832e37444bdfc22e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Tue, 26 Jan 2021 22:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=A4=9A=E4=BD=99=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/css/pear-module/cardTable.css | 92 -------- component/pear/modules/cardTable.js | 209 ------------------- component/pear/pear.all.js | 3 +- component/pear/pear.js | 3 +- 4 files changed, 2 insertions(+), 305 deletions(-) delete mode 100644 component/pear/css/pear-module/cardTable.css delete mode 100644 component/pear/modules/cardTable.js diff --git a/component/pear/css/pear-module/cardTable.css b/component/pear/css/pear-module/cardTable.css deleted file mode 100644 index 71449a3..0000000 --- a/component/pear/css/pear-module/cardTable.css +++ /dev/null @@ -1,92 +0,0 @@ -.project-list-item { - background-color: #fff; - border-radius: 4px; - cursor: pointer; - transition: all .2s; -} - -.project-list-item:hover { - box-shadow: 2px 0 4px rgba(0, 21, 41, .35); -} - -.project-list-item .project-list-item-cover { - width: 100%; - height: 180px; - display: block; - border-top-left-radius: 4px; - border-top-right-radius: 4px; -} - -.project-list-item-body { - padding: 20px; - border: 1px solid #e8e8e8; -} - -.project-list-item .project-list-item-body>h2 { - font-size: 16px; - color: #333; - margin-bottom: 12px; -} - -.project-list-item .project-list-item-text { - height: 40px; - overflow: hidden; - margin-bottom: 12px; -} - -.project-list-item .project-list-item-desc { - position: relative; -} - -.project-list-item .project-list-item-desc .time { - color: #999; - font-size: 12px; -} - -.project-list-item .project-list-item-desc .ew-head-list { - position: absolute; - right: 0; - top: 0; -} - -.ew-head-list .ew-head-list-item:first-child { - margin-left: 0; -} - -.ew-head-list .ew-head-list-item { - width: 22px; - height: 22px; - border-radius: 50%; - border: 1px solid #fff; - margin-left: -10px; -} - -.ew-head-list .ew-head-list-item { - width: 22px; - height: 22px; - border-radius: 50%; - border: 1px solid #fff; - margin-left: -10px; -} - -.cloud-card-component { - padding: 20px; -} - -.cloud-card-component .layui-laypage .layui-laypage-curr .layui-laypage-em { - border-radius: 0px !important; -} -.ew-table-loading { - padding: 10px 0; - text-align: center; -} -.ew-table-loading > i { - color: #999; - font-size: 30px; -} -.ew-table-loading.ew-loading-float { - position: absolute; - top: 0; - left: 0; - right: 0; -} \ No newline at end of file diff --git a/component/pear/modules/cardTable.js b/component/pear/modules/cardTable.js deleted file mode 100644 index df9420c..0000000 --- a/component/pear/modules/cardTable.js +++ /dev/null @@ -1,209 +0,0 @@ -layui.define(['table', 'laypage','jquery', 'element'], function(exports) { - "use strict"; - var filePath = layui.cache.modules.cardTable - .substr(0, layui.cache.modules.cardTable.lastIndexOf('/')); - // 引入tablePlug.css - layui.link(filePath + '/cardTable.css'); - var MOD_NAME = 'cardTable', - $ = layui.jquery, - element = layui.element, - laypage = layui.laypage; - var _instances = {}; // 记录所有实例 - /* 默认参数 */ - var defaultOption = { - elem: "#currentTableId",// 构建的模型 - url: "",// 数据 url 连接 - loading: true,//是否加载 - limit: 0, //每页数量默认是每行数量的双倍 - linenum: 4, //每行数量 2,3,4,6 - currentPage: 1,//当前页 - limits:[], //页码 - page: true, //是否分页 - layout: ['count', 'prev', 'page', 'next','limit', 'skip'],//分页控件 - request: { - pageName: 'page' //页码的参数名称,默认:page - , limitName: 'limit' //每页数据量的参数名,默认:limit - , idName: 'id' //主键名称,默认:id - , titleName: 'title' //标题名称,默认:title - , imageName: 'image' //图片地址,默认:image - , remarkName: 'remark' //备注名称,默认:remark - , timeName: 'time' //时间名称,默认:time - }, - response: { - statusName: 'code' //规定数据状态的字段名称,默认:code - , statusCode: 0 //规定成功的状态码,默认:0 - , msgName: 'msg' //规定状态信息的字段名称,默认:msg - , countName: 'count' //规定数据总数的字段名称,默认:count - , dataName: 'data' //规定数据列表的字段名称,默认:data - }, - // 完 成 函 数 - done: function () { - - } - }; - var card = function(opt) { - _instances[opt.elem.substring(1)] = this; - this.reload(opt); - }; - /** 参数设置 */ - card.prototype.initOptions = function (opt) { - this.option = $.extend(true, {}, defaultOption, opt); - if (!this.option.limit || this.option.limit == 0) { - this.option.limit = this.option.linenum * 2; - } - if (!this.option.limits || this.option.limits.length == 0) { - this.option.limits = [this.option.limit]; - } - }; - card.prototype.init = function () { - var option = this.option; - var url = option.url; - var html = ""; - html += option.loading == true ? '
" + data.msg + "
"; - } - else { - option.data = data.data; - option.count = data.count; - // 根据结果进行相应结构的创建 - if (!!option.data && option.data.length > 0) { - html = createComponent(option.elem.substring(1),option.linenum,data.data); - html += ""; - } - else { - html = "没有数据
"; - } - } - } - $(option.elem).html(html); - if (option.page) { - // 初始化分页组件 - laypage.render({ - elem: 'cardpage' - , count: option.count, limit: option.limit, limits:option.limits, curr: option.currentPage - , layout: option.layout - , jump: function (obj, first) { - option.limit = obj.limit; - option.currentPage = obj.curr; - if (!first) { - _instances[option.elem.substring(1)].reload(option); - } - } - }); - } - } - card.prototype.reload = function (opt) { - this.initOptions(this.option ? $.extend(true, this.option, opt) : opt); - this.init(); // 初始化表格 - } - - function createComponent(elem,linenum,data) { - var html = "