diff --git a/public/static/admin/css/public.css b/public/static/admin/css/public.css
index b20384f..0f5d315 100644
--- a/public/static/admin/css/public.css
+++ b/public/static/admin/css/public.css
@@ -585,6 +585,18 @@ table样式
.layuimini-form.multiple-columns .layui-form-item.full-line {
width: calc(100% - 0px);
}
+
+ .layui-table-tool-temp{
+ padding-right: unset;
+ padding-bottom: 40px;
+
+ }
+
+ .layuimini-container .layui-table-tool-self{
+ right: 0;
+ bottom: 10px;
+ top: unset;
+ }
}
.w-e-text-container,
diff --git a/public/static/common/css/theme/index.css b/public/static/common/css/theme/index.css
index a04da56..012cc78 100644
--- a/public/static/common/css/theme/index.css
+++ b/public/static/common/css/theme/index.css
@@ -517,9 +517,6 @@
background-color: rgb(126, 252, 246);
color: rgb(2, 17, 20);
}
-.elem-style-sicfi .layui-layout-admin .layui-header .layuimini-tool i {
- color: rgb(126, 252, 246);
-}
.elem-style-sicfi .color-red {
color: rgb(255, 0, 0) !important;
}
diff --git a/public/static/plugs/ulthon-admin/ulthon-admin.js b/public/static/plugs/ulthon-admin/ulthon-admin.js
index 30650a1..59f3e35 100644
--- a/public/static/plugs/ulthon-admin/ulthon-admin.js
+++ b/public/static/plugs/ulthon-admin/ulthon-admin.js
@@ -12,7 +12,7 @@
};
window.onInitElemStyle();
-
+
const { createEditor, createToolbar } = window.wangEditor;
var lastTableWhere = {};
@@ -41,11 +41,8 @@
var table;
- if (tools.checkMobile()) {
- table = window.uaTable;
- } else {
- table = layui.table;
- }
+ table = layui.table;
+
var extGroup = {
// 图片扩展名数组
@@ -174,11 +171,11 @@
},
error: function (xhr, textstatus, thrown) {
var errorMsg = '';
- if(xhr.responseJSON.message){
+ if (xhr.responseJSON.message) {
errorMsg = xhr.responseJSON.message;
}
loading.hide();
- admin.msg.error('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试!
'+errorMsg, function () {
+ admin.msg.error('Status:' + xhr.status + ',' + xhr.statusText + ',请稍后再试!
' + errorMsg, function () {
ex(this);
});
return false;
@@ -275,6 +272,33 @@
options.headers = admin.headers();
options.page = admin.parame(options.page, true);
options.search = admin.parame(options.search, true);
+ options.layout = admin.parame(options.layout, true);
+ options.layoutList = admin.parame(options.layoutList,
+ [
+ 'table',
+ 'card',
+ {
+ name: 'usercard',
+ // 优先级1
+ tplFunction() {
+
+ },
+ // 优先级3
+ tplVue() {
+
+ },
+ // 优先级2
+ tplLay() {
+
+ },
+ // 优先级4
+ tplLayId: '',
+ // 优先级5
+ tplVueId: ''
+ }
+ ]
+ );
+ options.layoutDefault = admin.parame(options.layoutDefault, true);
options.skin = options.skin || 'line';
options.autoSort = options.autoSort || false;
options.limit = options.limit || 15;
@@ -282,6 +306,14 @@
options.cols = options.cols || [];
var defaultToolbar = ['filter', 'print'];
+ if (options.layout === true) {
+ defaultToolbar.push({
+ title: '视图',
+ layEvent: 'TABLE_LAYOUT',
+ icon: 'layui-icon-template-1',
+ extend: 'data-table-id="' + options.id + '"'
+ });
+ }
if (options.search) {
defaultToolbar.push({
@@ -304,6 +336,7 @@
}
options.done = function (res, curr, count) {
optionDone(res, curr, count);
+ console.log(res, curr, count);
// 监听表格内的复制组件
admin.api.copyText('[lay-id=' + options.id + ']');
@@ -315,21 +348,8 @@
selectConfirmCallback = admin.getQueryVariable('select_confirm_callback', 'onTableDataConfirm');
- // 判断是否为移动端
- if (admin.checkMobile()) {
- options.defaultToolbar = !options.search ? ['filter'] : ['filter', {
- title: '搜索',
- layEvent: 'TABLE_SEARCH',
- icon: 'layui-icon-search',
- extend: 'data-table-id="' + options.id + '"'
- }];
- options.page = {
- layout: ['first', 'prev', 'page', 'next', 'last', 'count']
- };
- }
-
if (selectMode == 'checkbox') {
if (options.cols[0][0].type == 'radio') {
@@ -362,6 +382,12 @@
options = admin.table.renderSearch(options.cols, options.elem, options.id, options);
}
+ // 初始化模板切换
+ if (options.layout === true) {
+
+ options = admin.table.renderLayout(options);
+ }
+
// 初始化表格左上方工具栏
options.toolbar = options.toolbar || ['refresh', 'add', 'delete', 'export'];
@@ -685,6 +711,58 @@
return options;
},
+ renderLayout: function (options) {
+
+ if (!options.layoutList) {
+ return options;
+ }
+
+ var tableId = options.id;
+ var elem = options.elem;
+ console.log(tableId);
+
+
+ // 初始化参数
+ options.labelList = options.layoutList.map((item) => {
+ if (item == 'table') {
+ return {
+ name: 'table',
+ title: '默认表格',
+
+ };
+ }
+ if (item == 'card') {
+ return {
+ name: 'card',
+ title: '默认卡片',
+ 'tplFunction': function (data) {
+ return '';
+ }
+ };
+ }
+ return item;
+ });
+
+ var optionDone = options.done;
+ options.done = function (res, curr, count) {
+ optionDone(res, curr, count);
+
+
+ };
+ // 生成html
+ var layoutElemId = 'layout-list-option-' + tableId;
+ // 构建下拉选择
+ var layoutHtml = '