移除旧版表格转卡片;删除layui2.7的遗留问题代码;调整代码格式

This commit is contained in:
2023-09-27 11:00:18 +08:00
parent 7b5560a6a2
commit c77257730c
3 changed files with 13 additions and 143 deletions

View File

@@ -513,94 +513,10 @@ table样式
white-space: nowrap;
}
.data-item {
display: none;
line-height: 28px;
}
@media screen and (max-width: 450px) {
.data-item {
display: block;
}
.layui-form-item .layui-form-label {
float: unset;
text-align: left;
}
.layuimini-form>.layui-form-item .required:after {
right: unset;
left: 0;
margin-left: 0;
}
.layui-input-block {
margin-left: 0;
}
.layui-anim-upbit {
min-width: unset !important;
width: calc(100% - 20px);
overflow: auto
}
.layui-table-page {
overflow: auto;
}
.layui-form-pane .layui-form-item .layui-form-label {
float: left;
}
.layui-table-page {
height: 45px
}
.layui-table-main .layui-table tr {
background-color: #eee;
border-radius: 15px;
padding: 15px;
margin-bottom: 15px;
display: block;
}
.layui-table-main .layui-table {
display: block;
}
.layui-table-main tbody {
display: block;
}
.layui-table-main td {
display: flex;
align-items: flex-start;
justify-content: space-between;
margin-right: 0;
border-bottom: 1px solid #fff;
min-height: 30px;
}
.layui-table-main .layui-table-cell {
width: auto;
padding: 0;
text-align: right;
}
.layuimini-container .layui-table-box {
border: none;
}
.layui-table-header {
display: none;
}
}
.search-hide-item {
display: none;
}
@@ -641,4 +557,7 @@ table样式
[data-toggle="copy-text"].copy-rendered {
cursor: pointer;
}
}
@media (max-width: 768px) {}

View File

@@ -437,15 +437,7 @@ footer a {
width: 58%;
}
@media (max-width: 768px) {
.footer-nav-box {
width: 95%;
}
.footer-proto-box {
width: 95%;
}
}
.site-footer ul,
.site-footer li {
@@ -773,4 +765,12 @@ footer a {
.introduction .bottom .item {
width: 80%;
}
}
.footer-nav-box {
width: 95%;
}
.footer-proto-box {
width: 95%;
}
}

View File

@@ -278,31 +278,6 @@
options.defaultToolbar = defaultToolbar;
}
var table2card = function () {
if (admin.checkMobile()) {
var domTable = $('[lay-id="' + options.id + '"]');
var colsHeader = [];
domTable.find('.layui-table-header').first().find('.layui-table-cell').each(function (index, cell) {
if ($(cell).hasClass('laytable-cell-checkbox')) {
colsHeader.push('选择');
} else {
colsHeader.push($(cell).find('span').first().text());
}
});
domTable.find('.layui-table-main').find('tr').each(function (index, domTr) {
$(domTr).find('td').each(function (indexTd, domTd) {
$('<div class="data-item">' + colsHeader[indexTd] + '</div>').insertBefore($(domTd).find('.layui-table-cell'));
});
});
}
};
@@ -312,7 +287,6 @@
}
options.done = function () {
optionDone();
table2card();
// 监听表格内的复制组件
admin.api.copyText('[lay-id=' + options.id + ']');
@@ -939,29 +913,6 @@
break;
}
}
if (admin.checkMobile()) {
if (val.fixed !== undefined) {
val.fixed = false;
}
}
// 重新整理配置参数兼容templet在edit时缺少LAY_COL的问题如果在layui2.8解决,那么应当删除这些代码
var endVal = { ...col[index] };
endVal.endTemplet = endVal.templet;
endVal.templet = function (data) {
if (!data.LAY_COL) {
data.LAY_COL = this;
}
return this.endTemplet(data);
};
cols[i][index] = endVal;
}
}
return cols;