pref: 增加服务类优化UI版面
@@ -409,7 +409,7 @@ a {
|
||||
}
|
||||
|
||||
.layui-tree-iconClick .layui-icon {
|
||||
font-size: 16px!important;
|
||||
font-size: 14px!important;
|
||||
}
|
||||
|
||||
.layui-tree-txt {
|
||||
@@ -1312,10 +1312,6 @@ a {
|
||||
right: 0
|
||||
}
|
||||
|
||||
.layui-tree-subtraction .layui-form-checkbox[lay-skin=primary] i.layui-icon-ok:before {
|
||||
content: "\e67e";
|
||||
}
|
||||
|
||||
.swiftadmin-tabs-select.layui-nav {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
@@ -2233,22 +2229,18 @@ a {
|
||||
}
|
||||
|
||||
.layui-form-onswitch {
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
min-width: 28px;
|
||||
margin-top: 6px;
|
||||
background-color: #1890ff;
|
||||
border: 1px solid #1890ff;
|
||||
}
|
||||
|
||||
.layui-form-switch i {
|
||||
top: 2px;
|
||||
top: 1px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.layui-form-onswitch i {
|
||||
margin-left: -18px;
|
||||
margin-left: -16px;
|
||||
}
|
||||
|
||||
/* 拖拽上传 */
|
||||
@@ -2437,6 +2429,24 @@ a {
|
||||
.layui-table-view .layui-form-checkbox[lay-skin=primary] i {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.layui-form-checkbox[lay-skin="primary"] > .layui-icon-indeterminate {
|
||||
border-color: #1890ff;
|
||||
color: #fff;
|
||||
background-color: #1890ff;
|
||||
}
|
||||
|
||||
.layui-form-checkbox[lay-skin="primary"] > .layui-icon-indeterminate:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
width: 50%;
|
||||
height: 1px;
|
||||
margin: -1px auto 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em {
|
||||
|
||||
@@ -12,7 +12,6 @@ layui.config({
|
||||
iconPicker: 'iconPicker/iconPicker',
|
||||
echarts: "echarts/echarts",
|
||||
xmselect: 'xmselect/xmselect',
|
||||
treetable: 'treetable/treetable',
|
||||
tableSelect: 'tableSelect/tableSelect',
|
||||
formDesign: 'formDesign/formDesign',
|
||||
soulTable: 'soulTable/soulTable',
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:13px}.layui-code-title{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-title>.layui-code-about{position:absolute;right:10px;top:0;color:#b7b7b7}.layui-code-about>a{padding-left:10px}.layui-code-view>.layui-code-ol,.layui-code-view>.layui-code-ul{position:relative;overflow:auto}.layui-code-view>.layui-code-ol>li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view>.layui-code-ol>li:first-child,.layui-code-view>.layui-code-ul>li:first-child{padding-top:10px}.layui-code-view>.layui-code-ol>li:last-child,.layui-code-view>.layui-code-ul>li:last-child{padding-bottom:10px}.layui-code-view>.layui-code-ul>li{position:relative;line-height:20px;padding:0 10px;list-style-type:none;*list-style-type:none;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-dark{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-dark>.layui-code-title{border-bottom:none}.layui-code-dark>.layui-code-ol>li,.layui-code-dark>.layui-code-ul>li{background-color:#3f3f3f;border-left:none}.layui-code-dark>.layui-code-ul>li{margin-left:6px}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
@@ -1,16 +0,0 @@
|
||||
/** 图标字体 **/
|
||||
@font-face {font-family: 'laydate-icon';
|
||||
src: url('./font/iconfont.eot');
|
||||
src: url('./font/iconfont.eot#iefix') format('embedded-opentype'),
|
||||
url('./font/iconfont.svg#iconfont') format('svg'),
|
||||
url('./font/iconfont.woff') format('woff'),
|
||||
url('./font/iconfont.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.laydate-icon{
|
||||
font-family:"laydate-icon" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
@@ -1 +0,0 @@
|
||||
.layui-tags{border:1px solid #e3e7f1;height:29px;line-height:1.3;background-color:#fff;border-radius:2px;padding-left:10px}.layui-tags input{width:90px;font-family:helvetica;font-size:13px;border:1px solid transparent;background:0 0;color:#000;outline:0;height:28px;float:left}.layui-tags .tag-elem{float:left;height:25px;font-size:12px;box-sizing:border-box;margin-right:5px;padding:5px;margin-top:2px;-moz-border-radius:2px;-webkit-border-radius:2px;font-family:helvetica;color:#1890ff;background:#e6f7ff;border:1px solid #91d5ff}.layui-tags span.tag-elem i{font-family:Verdana;color:#0084ff;margin-left:5px;font-size:12px;cursor:pointer}#layui-tags-ajax li b,.layui-tags span.tag-elem i:hover{color:red}#layui-tags-ajax{text-align:left;cursor:default;background:#fff;border:1px solid rgba(0,0,0,.15);border-radius:2px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);-moz-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box;position:absolute;display:none;z-index:1029;max-height:254px;overflow:hidden;overflow-y:auto;width:138px;box-sizing:border-box}#layui-tags-ajax li{position:relative;line-height:20px;overflow:hidden;text-overflow:ellipsis;font-size:1em;color:#333;padding:5px 10px;cursor:pointer;white-space:nowrap}#layui-tags-ajax .layui-tag-this,#layui-tags-ajax li:hover{background:#f0f0f0}
|
||||
|
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 322 KiB |
@@ -3,12 +3,13 @@
|
||||
* by meystack to www.swiftadmin.net
|
||||
* Apache2.0 Licensed
|
||||
*/
|
||||
layui.define(['laypage'], function (exports) {
|
||||
layui.define(['laypage','dropdown'], function (exports) {
|
||||
"use strict";
|
||||
|
||||
var $ = layui.$
|
||||
|
||||
, laypage = layui.laypage
|
||||
, dropdown = layui.dropdown
|
||||
//模块名
|
||||
, MOD_NAME = 'fileManager'
|
||||
, MOD_INDEX = 'layui_' + MOD_NAME + '_index' //模块索引名
|
||||
@@ -238,7 +239,7 @@ layui.define(['laypage'], function (exports) {
|
||||
});
|
||||
}
|
||||
|
||||
layui.dropdown.render({
|
||||
dropdown.render({
|
||||
elem: item
|
||||
, trigger: 'contextmenu'
|
||||
, id: 'file' + index
|
||||
|
||||
@@ -5,6 +5,7 @@ layui.define(['i18n'], function (exports) {
|
||||
var table = layui.table;
|
||||
var i18n = layui.i18n;
|
||||
var form = layui.form;
|
||||
var notice = layui.notice;
|
||||
|
||||
i18n.render(layui.admin.getStorage('language') || 'zh-CN');
|
||||
var area = [$(window).width() > 800 ? '660px' : '85%', $(window).height() > 800 ? '680px' : '85%'];
|
||||
@@ -61,8 +62,9 @@ layui.define(['i18n'], function (exports) {
|
||||
top.layui.admin.reloadLayout();
|
||||
|
||||
} else {
|
||||
|
||||
layer.msg(res.msg, 'error');
|
||||
notice.error({
|
||||
message: res.msg,
|
||||
})
|
||||
// 登录超时
|
||||
if (res.code === -101) {
|
||||
plugin.login();
|
||||
@@ -111,7 +113,9 @@ layui.define(['i18n'], function (exports) {
|
||||
layer.closeAll();
|
||||
plugin.againClick();
|
||||
} else {
|
||||
layer.msg(res.msg, 'error');
|
||||
notice.error({
|
||||
message: res.msg,
|
||||
})
|
||||
}
|
||||
}, 'json')
|
||||
|
||||
@@ -185,7 +189,9 @@ layui.define(['i18n'], function (exports) {
|
||||
delete window.plugins[name];
|
||||
$(elems).find('td:last').children('div').html(html);
|
||||
} else {
|
||||
layer.msg(i18n.prop(res.msg), 'error');
|
||||
notice.error({
|
||||
message: res.msg,
|
||||
})
|
||||
}
|
||||
|
||||
layer.close(window.unIndex);
|
||||
@@ -211,7 +217,7 @@ layui.define(['i18n'], function (exports) {
|
||||
html += '<div class="layui-form-item">';
|
||||
html += '<label class="layui-form-label">用户邮箱</label>';
|
||||
html += '<div class="layui-input-block">';
|
||||
html += '<input type="text" name="nickname" style="width:330px;" lay-verify="required" placeholder="请输入邮箱或手机号" autocomplete="off" class="layui-input" >';
|
||||
html += '<input type="text" name="nickname" style="width:330px;" lay-verify="required" placeholder="请输入邮箱或用户名" autocomplete="off" class="layui-input" >';
|
||||
html += '</div></div>';
|
||||
html += '<div class="layui-form-item"><label class="layui-form-label">密码</label>';
|
||||
html += '<div class="layui-input-block">';
|
||||
@@ -270,7 +276,7 @@ layui.define(['i18n'], function (exports) {
|
||||
let name = plugin.getTableData(this)['name'];
|
||||
layui.sessionData('api_install_index', {
|
||||
key: 'index',
|
||||
value: plugin.getTableData(this)['LAY_TABLE_INDEX'],
|
||||
value: plugin.getTableData(this)['LAY_INDEX'],
|
||||
});
|
||||
plugin.request(name, null, plugin.getUrl('Plugin', 'install'));
|
||||
})
|
||||
@@ -291,7 +297,9 @@ layui.define(['i18n'], function (exports) {
|
||||
error: function (res) {
|
||||
$(obj.elem).prop('checked', !obj.elem.checked);
|
||||
form.render('checkbox');
|
||||
layer.msg(res.msg, 'error');
|
||||
notice.error({
|
||||
message: res.msg,
|
||||
})
|
||||
},
|
||||
success: function (res) {
|
||||
layer.msg(res.msg);
|
||||
@@ -335,7 +343,7 @@ layui.define(['i18n'], function (exports) {
|
||||
html += '</div></form> ';
|
||||
layui.sessionData('api_install_index', {
|
||||
key: 'index',
|
||||
value: plugin.getTableData(this)['LAY_TABLE_INDEX'],
|
||||
value: plugin.getTableData(this)['LAY_INDEX'],
|
||||
});
|
||||
layer.open({
|
||||
type: 1,
|
||||
@@ -388,7 +396,9 @@ layui.define(['i18n'], function (exports) {
|
||||
layer.msg(res.msg);
|
||||
layer.close(confirm);
|
||||
} else {
|
||||
layer.msg(res.msg, 'error');
|
||||
notice.error({
|
||||
message: res.msg,
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
.treeTable-empty {
|
||||
width: 20px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.treeTable-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table .treeTable-icon i.layui-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.treeTable-icon .layui-icon-right:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.treeTable-icon.open .layui-icon-right:before {
|
||||
content: "\e61a";
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
@@ -1,223 +0,0 @@
|
||||
layui.define(['layer', 'table'], function (exports) {
|
||||
var $ = layui.jquery;
|
||||
var layer = layui.layer;
|
||||
var table = layui.table;
|
||||
|
||||
var treetable = {
|
||||
// 渲染树形表格
|
||||
render: function (param) {
|
||||
// 检查参数
|
||||
if (!treetable.checkParam(param)) {
|
||||
return;
|
||||
}
|
||||
// 获取数据
|
||||
if (param.data) {
|
||||
treetable.init(param, param.data);
|
||||
} else {
|
||||
$.getJSON(param.url, param.where, function (res) {
|
||||
treetable.init(param, res.data);
|
||||
});
|
||||
}
|
||||
},
|
||||
// 渲染表格
|
||||
init: function (param, data) {
|
||||
|
||||
var mData = [];
|
||||
var doneCallback = param.done;
|
||||
if (typeof data.item !== 'undefined') {
|
||||
for (let name in data) {
|
||||
if (name != 'item') {
|
||||
table.cache[name] = data[name];
|
||||
}
|
||||
}
|
||||
data = data.item;
|
||||
}
|
||||
var tNodes = data;
|
||||
// 补上id和pid字段
|
||||
for (var i = 0; i < tNodes.length; i++) {
|
||||
var tt = tNodes[i];
|
||||
if (!tt.id) {
|
||||
if (!param.treeIdName) {
|
||||
layer.msg('参数treeIdName不能为空', {icon: 5});
|
||||
return;
|
||||
}
|
||||
tt.id = tt[param.treeIdName];
|
||||
}
|
||||
if (!tt.pid) {
|
||||
if (!param.treePidName) {
|
||||
layer.msg('参数treePidName不能为空', {icon: 5});
|
||||
return;
|
||||
}
|
||||
tt.pid = tt[param.treePidName];
|
||||
}
|
||||
}
|
||||
|
||||
// 对数据进行排序
|
||||
var sort = function (s_pid, data) {
|
||||
for (var i = 0; i < data.length; i++) { // 排序
|
||||
if (data[i].pid == s_pid) {
|
||||
var len = mData.length;
|
||||
if (len > 0 && mData[len - 1].id == s_pid) {
|
||||
mData[len - 1].isParent = true; // 是否为父类
|
||||
}
|
||||
mData.push(data[i]);
|
||||
sort(data[i].id, data);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sort(param.treeSpid, tNodes); // -1
|
||||
// 重写参数
|
||||
param.url = undefined;
|
||||
param.data = mData;
|
||||
param.page = {
|
||||
count: param.data.length,
|
||||
limit: param.data.length
|
||||
};
|
||||
param.cols[0][param.treeColIndex].templet = function (d) {
|
||||
var mId = d.id;
|
||||
var mPid = d.pid;
|
||||
var isDir = d.isParent;
|
||||
var emptyNum = treetable.getEmptyNum(mPid, mData);
|
||||
|
||||
var iconHtml = '';
|
||||
for (var i = 0; i < emptyNum; i++) {
|
||||
iconHtml += '<span class="treeTable-empty"></span>';
|
||||
}
|
||||
|
||||
// 设置图标
|
||||
if (isDir) {
|
||||
iconHtml += '<i class="layui-icon layui-icon-right"></i>';
|
||||
if (d.icons) {
|
||||
iconHtml += ' <i class="layui-icon '+ d.icons +'"></i>';
|
||||
}
|
||||
} else {
|
||||
iconHtml += '<i class="layui-icon '+ d.icons +'"></i>';
|
||||
}
|
||||
|
||||
iconHtml += ' ';
|
||||
|
||||
var ttype = isDir ? 'dir' : 'file';
|
||||
var vg = '<span class="treeTable-icon open" lay-tid="' + mId + '" lay-tpid="' + mPid + '" lay-ttype="' + ttype + '">';
|
||||
return vg + iconHtml + d[param.cols[0][param.treeColIndex].field] + '</span>'
|
||||
};
|
||||
|
||||
param.done = function (res, curr, count) {
|
||||
$(param.elem).next().addClass('treeTable');
|
||||
$('.treeTable .layui-table-page').css('display', 'none');
|
||||
$(param.elem).next().attr('treeLinkage', param.treeLinkage);
|
||||
// 绑定事件换成对body绑定
|
||||
/*$('.treeTable .treeTable-icon').click(function () {
|
||||
treetable.toggleRows($(this), param.treeLinkage);
|
||||
});*/
|
||||
if (param.treeDefaultClose) {
|
||||
treetable.foldAll(param.elem);
|
||||
}
|
||||
if (doneCallback) {
|
||||
doneCallback(res, curr, count);
|
||||
}
|
||||
};
|
||||
|
||||
// 渲染表格
|
||||
table.render(param);
|
||||
},
|
||||
// 计算缩进的数量
|
||||
getEmptyNum: function (pid, data) {
|
||||
var num = 0;
|
||||
if (!pid) {
|
||||
return num;
|
||||
}
|
||||
var tPid;
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (pid == data[i].id) {
|
||||
num += 1;
|
||||
tPid = data[i].pid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return num + treetable.getEmptyNum(tPid, data);
|
||||
},
|
||||
// 展开/折叠行
|
||||
toggleRows: function ($dom, linkage) {
|
||||
var type = $dom.attr('lay-ttype');
|
||||
if ('file' == type) {
|
||||
return;
|
||||
}
|
||||
var mId = $dom.attr('lay-tid');
|
||||
var isOpen = $dom.hasClass('open');
|
||||
if (isOpen) {
|
||||
$dom.removeClass('open');
|
||||
} else {
|
||||
$dom.addClass('open');
|
||||
}
|
||||
$dom.closest('tbody').find('tr').each(function () {
|
||||
var $ti = $(this).find('.treeTable-icon');
|
||||
var pid = $ti.attr('lay-tpid');
|
||||
var ttype = $ti.attr('lay-ttype');
|
||||
var tOpen = $ti.hasClass('open');
|
||||
if (mId == pid) {
|
||||
if (isOpen) {
|
||||
$(this).hide();
|
||||
if ('dir' == ttype && tOpen == isOpen) {
|
||||
$ti.trigger('click');
|
||||
}
|
||||
} else {
|
||||
$(this).show();
|
||||
if (linkage && 'dir' == ttype && tOpen == isOpen) {
|
||||
$ti.trigger('click');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 检查参数
|
||||
checkParam: function (param) {
|
||||
if (!param.treeSpid && param.treeSpid != 0) {
|
||||
layer.msg('参数treeSpid不能为空');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!param.treeColIndex && param.treeColIndex != 0) {
|
||||
layer.msg('参数treeColIndex不能为空');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 展开所有
|
||||
expandAll: function (dom) {
|
||||
$(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () {
|
||||
var $ti = $(this).find('.treeTable-icon');
|
||||
var ttype = $ti.attr('lay-ttype');
|
||||
var tOpen = $ti.hasClass('open');
|
||||
if ('dir' == ttype && !tOpen) {
|
||||
$ti.trigger('click');
|
||||
}
|
||||
});
|
||||
},
|
||||
// 折叠所有
|
||||
foldAll: function (dom) {
|
||||
$(dom).next('.treeTable').find('.layui-table-body tbody tr').each(function () {
|
||||
var $ti = $(this).find('.treeTable-icon');
|
||||
var ttype = $ti.attr('lay-ttype');
|
||||
var tOpen = $ti.hasClass('open');
|
||||
if ('dir' == ttype && tOpen) {
|
||||
$ti.trigger('click');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
layui.link(layui.cache.base + 'treetable/treetable.css');
|
||||
|
||||
// 给图标列绑定事件
|
||||
$('body').on('click', '.treeTable .treeTable-icon', function () {
|
||||
var treeLinkage = $(this).parents('.treeTable').attr('treeLinkage');
|
||||
if ('true' == treeLinkage) {
|
||||
treetable.toggleRows($(this), true);
|
||||
} else {
|
||||
treetable.toggleRows($(this), false);
|
||||
}
|
||||
});
|
||||
|
||||
exports('treetable', treetable);
|
||||
});
|
||||