master
关凯 2023-07-19 16:44:37 +08:00
parent 1b3632b002
commit 9220e21be4
25 changed files with 15689 additions and 15599 deletions

View File

@ -164,5 +164,13 @@
overflowToDisk="false"
statistics="false">
</cache>
<cache name="apiCache"
maxEntriesLocalHeap="200000"
eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="1"
overflowToDisk="false"
statistics="false">
</cache>
</ehcache>

View File

@ -1,12 +1,12 @@
layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exports) {
var $ = layui.jquery,
let $ = layui.jquery,
element = layui.element,
laytpl = layui.laytpl,
zlPinYin = layui.zlPinYin,
common = layui.common,
admin = layui.admin;
var THEME = {
let THEME = {
defaulStyles: [
{ name: '亮色风格', value: "light", color: '#f0f2f5' },
{ name: '暗色风格', value: "dark", color: 'rgba(0,21,41,.85)' }
@ -29,7 +29,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* 默认主题
*/
getDefaulThemeObj() {
var ColorBase = '#1890ff';
let ColorBase = '#1890ff';
return {
'theme_title': "黑色主题",
'theme_title-py': 'HeiSeZhuTi',
@ -100,7 +100,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* @param {*} colorBase 基本颜色
*/
mergerExtendData(themeObj) {
var ColorBase = themeObj.color || THEME.getDefaulThemeObj().color;
let ColorBase = themeObj.color || THEME.getDefaulThemeObj().color;
if (!themeObj.kd_color_0) {
return $.extend(themeObj, {
/**
@ -257,7 +257,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
},
/**
* 设置主题, 设置保存当前页面的主题,并创建css 的样式节点
* @param {*} theme 主题对象
* @param {*} themeObj 主题对象
* @param {*} isBroadcast 是否广播消息
*/
setTheme: function (themeObj, isBroadcast = true) {
@ -266,10 +266,11 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
},
/**
* 给当前的docoment增加主题的styleSheet
* @param {*} themeObj 主题对象
*/
renderCssStyle(themeObj) {
if (themeObj && themeObj.childMenuBgInput && themeObj.childMenuBgInput.indexOf('.') != -1 && themeObj.childMenuBgInput.indexOf(',') != -1) {
var arr = themeObj.childMenuBgInput.split(',');
let arr = themeObj.childMenuBgInput.split(',');
arr.pop();
themeObj.childMenuTipsBgInput = arr.join() + ')';
}
@ -281,243 +282,239 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
THEME.mergerExtendData(themeObj)
var
styleid = 'kd-theme-style',
let styleid = 'kd-theme-style',
style = document.createElement('style'),
styleElem = document.getElementById(styleid),
styleText = laytpl(
`
:root{
--kd-color: {{d.kd_color_3}} !important;
styleText = `:root{
--kd-color: ${themeObj.kd_color_3} !important;
}
.layui-nav{
background-color:${themeObj.navBgInput};
}
#loader-wrapper .loader-section{
background:let(--kd-color) !important;
}
.layui-layer .layui-layer-title,
.layui-layer-iframe .layui-layer-title {
background-color:${themeObj.layerTitleBgInput} !important;
color:${themeObj.layerTitleFontColorInput};
}
.layui-layer-setwin .layui-layer-min cite {
background-color:${themeObj.layerMinBtnColor};
}
.layui-layer-setwin .layui-layer-max {
background-position:${themeObj.layerMaxBtnColor}px -40px;
}
.layui-layer-setwin .layui-layer-max.layui-layer-maxmin {
background-position:${themeObj.layerMaxMinBtnColor}px -40px;
}
.layui-layer-setwin .layui-layer-close1 {
background-position:${themeObj.layerCloseBtnColor}px -40px;
}
.layui-btn {
background-color:${themeObj.btnBgInput};
color:${themeObj.btnFontColorInput};
font-family:${themeObj.btnFont} !important;
}
.layui-btn i {
color:${themeObj.btnIconColorInput} !important;
}
.layui-btn.layui-btn-danger {
background-color:${themeObj.dangerBtnBgInput};
color:${themeObj.dangerBtnFontColorInput};
font-family:${themeObj.dangerBtnFont} !important;
}
.layui-btn.layui-btn-danger i {
color:${themeObj.dangerBtnIconColorInput} !important;
}
.layui-form-switch.layui-form-onswitch {
border-color:${themeObj.switchBgInput};
background-color:${themeObj.switchBgInput};
}
.layui-form-switch.layui-form-onswitch em {
color:${themeObj.switchFontColorInput} !important;
}
.layui-unselect.layui-form-switch em {
font-family:${themeObj.switchFont} !important;
}
.layui-form-switch.layui-form-onswitch i {
background-color:${themeObj.switchFontColorInput};
}
.layui-form-checkbox.layui-form-checked {
border-color:${themeObj.checkBoxBgInput};
}
.layui-unselect.layui-form-checkbox {
font-family:${themeObj.checkboxFont} !important;
}
.layui-form-checkbox.layui-form-checked span {
background-color:${themeObj.checkBoxBgInput};
color:${themeObj.checkBoxFontColorInput};
}
.layui-form-checkbox.layui-form-checked i {
color:${themeObj.checkBoxBgInput};
}
.layui-form-checkbox[lay-skin="primary"]:hover i {
border-color: ${themeObj.checkBoxBgInput};
}
.layui-nav{
background-color:{{d.navBgInput}};
}
#loader-wrapper .loader-section{
background:var(--kd-color) !important;
}
.layui-layer .layui-layer-title,
.layui-layer-iframe .layui-layer-title {
background-color:{{d.layerTitleBgInput}} !important;
color:{{d.layerTitleFontColorInput}};
}
.layui-layer-setwin .layui-layer-min cite {
background-color:{{d.layerMinBtnColor}};
}
.layui-layer-setwin .layui-layer-max {
background-position:{{d.layerMaxBtnColor}}px -40px;
}
.layui-layer-setwin .layui-layer-max.layui-layer-maxmin {
background-position:{{d.layerMaxMinBtnColor}}px -40px;
}
.layui-layer-setwin .layui-layer-close1 {
background-position:{{d.layerCloseBtnColor}}px -40px;
}
.layui-btn {
background-color:{{d.btnBgInput}};
color:{{d.btnFontColorInput}};
font-family:{{d.btnFont}} !important;
}
.layui-btn i {
color:{{d.btnIconColorInput}} !important;
}
.layui-btn.layui-btn-danger {
background-color:{{d.dangerBtnBgInput}};
color:{{d.dangerBtnFontColorInput}};
font-family:{{d.dangerBtnFont}} !important;
}
.layui-btn.layui-btn-danger i {
color:{{d.dangerBtnIconColorInput}} !important;
}
.layui-form-switch.layui-form-onswitch {
border-color:{{d.switchBgInput}};
background-color:{{d.switchBgInput}};
}
.layui-form-switch.layui-form-onswitch em {
color:{{d.switchFontColorInput}} !important;
}
.layui-unselect.layui-form-switch em {
font-family:{{d.switchFont}} !important;
}
.layui-form-switch.layui-form-onswitch i {
background-color:{{d.switchFontColorInput}};
}
.layui-form-checkbox.layui-form-checked {
border-color:{{d.checkBoxBgInput}};
}
.layui-unselect.layui-form-checkbox {
font-family:{{d.checkboxFont}} !important;
}
.layui-form-checkbox.layui-form-checked span {
background-color:{{d.checkBoxBgInput}};
color:{{d.checkBoxFontColorInput}};
}
.layui-form-checkbox.layui-form-checked i {
color:{{d.checkBoxBgInput}};
}
.layui-form-checkbox[lay-skin="primary"]:hover i {
border-color: {{d.checkBoxBgInput}};
}
.layui-form-checkbox.layui-form-checked[lay-skin="primary"] i {
border-color:{{d.originCheckBoxBgInput}};
background-color:{{d.originCheckBoxBgInput}};
color:{{d.originCheckBoxFontColorInput}};
}
.layui-form-checkbox.layui-form-checked[lay-skin="primary"] span {
color: #666;
background: none !important;
}
.layui-form-radio.layui-form-radioed i {
color:{{d.radioBgInput}};
}
.layui-form-radioed>i, .layui-form-radio>i:hover{
color: {{d.radioBgInput}};
}
.layui-form-select dl dd.layui-this {
background-color:var(--kd-color);
color: {{d.kd_color_11}};
}
.kdayun-menu {
font-family:{{d.menuFont}} !important;
background-color:{{d.menuBgInput}}!important;
}
.layui-form-checkbox.layui-form-checked[lay-skin="primary"] i {
border-color:${themeObj.originCheckBoxBgInput};
background-color:${themeObj.originCheckBoxBgInput};
color:${themeObj.originCheckBoxFontColorInput};
}
.layui-form-checkbox.layui-form-checked[lay-skin="primary"] span {
color: #666;
background: none !important;
}
.layui-form-radio.layui-form-radioed i {
color:${themeObj.radioBgInput};
}
.layui-form-radioed>i, .layui-form-radio>i:hover{
color: ${themeObj.radioBgInput};
}
.layui-form-select dl dd.layui-this {
background-color:let(--kd-color);
color: ${themeObj.kd_color_11};
}
.kdayun-menu {
font-family:${themeObj.menuFont} !important;
background-color:${themeObj.menuBgInput}!important;
}
.kdayun-menu-item {
font-family:{{d.menuFont}} !important;
background-color:{{d.menuBgInput}}!important;
}
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul .kdayun-menu-child {
background-color:{{d.menuBgInput}}!important;
}
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul li:hover,
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul li li:hover>a:first-child:nth-last-child(2),
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul>li:hover>a:first-child:nth-last-child(2) {
background-color: {{d.menuBgInput}}!important;
}
.kdayun-menu-item {
font-family:${themeObj.menuFont} !important;
background-color:${themeObj.menuBgInput}!important;
}
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul .kdayun-menu-child {
background-color:${themeObj.menuBgInput}!important;
}
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul li:hover,
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul li li:hover>a:first-child:nth-last-child(2),
.kdayun-app-layout-top .kdayun-menu-container .kdayun-menu-ul>li:hover>a:first-child:nth-last-child(2) {
background-color: ${themeObj.menuBgInput}!important;
}
.navbar-side-search {
background-color:{{d.menuBgInput}}!important;
}
.navbar-side-search input {
background-color:{{d.searchBoxBgInput}}!important;
border-color:{{d.searchBoxBgInput}}!important;
color:{{d.searchBoxFontColorInput}}!important;
}
.navbar-side-search input:hover {
border-color:{{d.searchBoxBgInput}}!important;
}
.navbar-side-search input:focus {
border-color:{{d.searchBoxBgInput}}!important;
}
.navbar-side-search input::-webkit-input-placeholder {
color:{{d.searchBoxFontColorInput}}!important;
}
.navbar-side-search input::-moz-placeholder {
color:{{d.searchBoxFontColorInput}}!important;
}
.navbar-side-search input::-ms-input-placeholder {
color:{{d.searchBoxFontColorInput}}!important;
}
.kdayun-menu-ul a,
.kdayun-menu-ul i.layui-icon {
color:{{d.menuFontColorInput}} !important;
}
.kdayun-menu-ul {
border-top:{{d.menuItemBorderColorInput}};
}
.kdayun-menu-ul li.kdayun-menu-item {
border-bottom:{{d.menuItemBorderColorInput}};
}
.kdayun-app-layout .kdayun-header .layui-nav-child dd.layui-this {
background-color: `+ (themeObj.menuSelectedBgInput || themeObj.kd_color_5) + `!important;
color: `+ (themeObj.menuSelectedFontColorInput || themeObj.kd_color_10) + `!important;
}
.kdayun-app-layout .kdayun-header .layui-nav-child dd.layui-this a {
background-color: `+ (themeObj.menuSelectedBgInput || themeObj.kd_color_5) + `!important;
color: `+ (themeObj.menuSelectedFontColorInput || themeObj.kd_color_10) + `!important;
}
.kdayun-menu-ul span.kdayun-menu-more {
border-top-color:{{d.menuFontColorInput}} !important;
border-bottom-color:rgba(255,0,0,0) !important;
}
.kdayun-menu-ul .kdayun-menu-item-expand>a span.kdayun-menu-more {
border-top-color:rgba(255,0,0,0) !important;
border-bottom-color:{{d.menuFontColorInput}} !important;
}
.kdayun-menu-item-expand>.kdayun-menu-child {
background-color:{{d.childMenuBgInput}} !important;
}
.kdayun-menu-ul .layui-this a,
.kdayun-menu-ul .layui-nav-bar {
background-color:{{d.menuSelectedBgInput}} !important;
color:{{d.menuSelectedFontColorInput||'var(--kd-color)'}} !important;
}
.layui-nav-bar{
background-color: {{d.menuSelectedBgInput||'var(--kd-color)'}}!important;
}
.kdayun-app-layout .layui-header {
font-family:{{d.navFont}} !important;
background-color:{{d.navBgInput}};
}
.kdayun-app-layout .layui-header a:hover {
color:{{d.navFontColorInput}};
}
.kdayun-app-layout .layui-header a cite {
color:{{d.navFontColorInput}};
}
.kdayun-app-layout .layui-header a i.layui-icon,
.kdayun-app-layout .layui-header a i.zlui-icon,
.kdayun-app-layout .layui-header a i.fa {
color:{{d.navIconColorInput}};
}
.kdayun-app-layout .layui-header a span.layui-nav-more {
border-top-color:{{d.navIconColorInput}} !important;
border-bottom-color:rgba(255,0,0,0) !important;
}
.kdayun-app-layout .layui-header a span.layui-nav-mored {
border-top-color:rgba(255,0,0,0) !important;
border-bottom-color:{{d.navIconColorInput}} !important;
}
.kdayun-app-layout .layui-logo {
background-color:{{d.logoBgInput}};
color:{{d.logoFontColorInput}};
}
.layadmin-pagetabs .layui-tab-title li:after,
.layadmin-pagetabs .layui-tab-title li.layui-this:after {
background-color:{{d.menuSelectedBgInput||'var(--kd-color)'}};
}
.layui-tab-brief>.layui-tab-title .layui-this:after,
.layui-tab-brief>.layui-tab-more li.layui-this:after {
border-color:`+ themeObj.kd_color_1 + `;
}
.layui-table tbody tr:hover,.layui-table-hover,.layui-table-click{
background-color:`+ (themeObj.kd_color_10 || '#f2f2f2') + `;
}
.layui-layer-tips.menuTips .layui-layer-content {
background-color:`+ (themeObj.menuBgInput || THEME.colorReverse(themeObj.menuFontColorInput || "#000000")) + `;
color:`+ (themeObj.menuFontColorInput || "#FFFFFF") + `;
}
.layui-layer-tips.menuTips .layui-layer-content i {
border-bottom-color:`+ (themeObj.menuBgInput || THEME.getDarkColor(themeObj.menuFontColorInput || "#000000")) + `;
}
.layui-input:hover,
.layui-textarea:hover,
.layui-select:hover {
border-color:`+ themeObj.kd_color_1 + `!important;
outline: 0;
}
.layui-input:focus,
.layui-textarea:focus,
.layui-select:focus {
border-color:`+ (themeObj.kd_color_1) + `!important;
border-right-width: 1px!important;
outline: 0;
box-shadow : 0 0 0 2px `+ THEME.rgba(themeObj.kd_color_1, .2) + `;
}
.layui-card {
box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
}
`).render(themeObj);
.navbar-side-search {
background-color:${themeObj.menuBgInput}!important;
}
.navbar-side-search input {
background-color:${themeObj.searchBoxBgInput}!important;
border-color:${themeObj.searchBoxBgInput}!important;
color:${themeObj.searchBoxFontColorInput}!important;
}
.navbar-side-search input:hover {
border-color:${themeObj.searchBoxBgInput}!important;
}
.navbar-side-search input:focus {
border-color:${themeObj.searchBoxBgInput}!important;
}
.navbar-side-search input::-webkit-input-placeholder {
color:${themeObj.searchBoxFontColorInput}!important;
}
.navbar-side-search input::-moz-placeholder {
color:${themeObj.searchBoxFontColorInput}!important;
}
.navbar-side-search input::-ms-input-placeholder {
color:${themeObj.searchBoxFontColorInput}!important;
}
.kdayun-menu-ul a,
.kdayun-menu-ul i.layui-icon {
color:${themeObj.menuFontColorInput} !important;
}
.kdayun-menu-ul {
border-top:${themeObj.menuItemBorderColorInput};
}
.kdayun-menu-ul li.kdayun-menu-item {
border-bottom:${themeObj.menuItemBorderColorInput};
}
.kdayun-app-layout .kdayun-header .layui-nav-child dd.layui-this {
background-color: ${(themeObj.menuSelectedBgInput || themeObj.kd_color_5)}!important;
color: ${(themeObj.menuSelectedFontColorInput || themeObj.kd_color_10)}!important;
}
.kdayun-app-layout .kdayun-header .layui-nav-child dd.layui-this a {
background-color: ${(themeObj.menuSelectedBgInput || themeObj.kd_color_5)}!important;
color: ${(themeObj.menuSelectedFontColorInput || themeObj.kd_color_10)}!important;
}
.kdayun-menu-ul span.kdayun-menu-more {
border-top-color:${themeObj.menuFontColorInput} !important;
border-bottom-color:rgba(255,0,0,0) !important;
}
.kdayun-menu-ul .kdayun-menu-item-expand>a span.kdayun-menu-more {
border-top-color:rgba(255,0,0,0) !important;
border-bottom-color:${themeObj.menuFontColorInput} !important;
}
.kdayun-menu-item-expand>.kdayun-menu-child {
background-color:${themeObj.childMenuBgInput} !important;
}
.kdayun-menu-ul .layui-this a,
.kdayun-menu-ul .layui-nav-bar {
background-color:${themeObj.menuSelectedBgInput} !important;
color:${themeObj.menuSelectedFontColorInput || 'let(--kd-color)'} !important;
}
.layui-nav-bar{
background-color: ${themeObj.menuSelectedBgInput || 'let(--kd-color)'}!important;
}
.kdayun-app-layout .layui-header {
font-family:${themeObj.navFont} !important;
background-color:${themeObj.navBgInput};
}
.kdayun-app-layout .layui-header a:hover {
color:${themeObj.navFontColorInput};
}
.kdayun-app-layout .layui-header a cite {
color:${themeObj.navFontColorInput};
}
.kdayun-app-layout .layui-header a i.layui-icon,
.kdayun-app-layout .layui-header a i.zlui-icon,
.kdayun-app-layout .layui-header a i.fa {
color:${themeObj.navIconColorInput};
}
.kdayun-app-layout .layui-header a span.layui-nav-more {
border-top-color:${themeObj.navIconColorInput} !important;
border-bottom-color:rgba(255,0,0,0) !important;
}
.kdayun-app-layout .layui-header a span.layui-nav-mored {
border-top-color:rgba(255,0,0,0) !important;
border-bottom-color:${themeObj.navIconColorInput} !important;
}
.kdayun-app-layout .layui-logo {
background-color:${themeObj.logoBgInput};
color:${themeObj.logoFontColorInput};
}
.layadmin-pagetabs .layui-tab-title li:after,
.layadmin-pagetabs .layui-tab-title li.layui-this:after {
background-color:${themeObj.menuSelectedBgInput || 'let(--kd-color)'};
}
.layui-tab-brief>.layui-tab-title .layui-this:after,
.layui-tab-brief>.layui-tab-more li.layui-this:after {
border-color:${themeObj.kd_color_1};
}
.layui-table tbody tr:hover,.layui-table-hover,.layui-table-click{
background-color:${(themeObj.kd_color_10 || '#f2f2f2')};
}
.layui-layer-tips.menuTips .layui-layer-content {
background-color:${(themeObj.menuBgInput || THEME.colorReverse(themeObj.menuFontColorInput || "#000000"))};
color:${(themeObj.menuFontColorInput || "#FFFFFF")};
}
.layui-layer-tips.menuTips .layui-layer-content i {
border-bottom-color:${(themeObj.menuBgInput || THEME.getDarkColor(themeObj.menuFontColorInput || "#000000"))};
}
.layui-input:hover,
.layui-textarea:hover,
.layui-select:hover {
border-color:${themeObj.kd_color_1}!important;
outline: 0;
}
.layui-input:focus,
.layui-textarea:focus,
.layui-select:focus {
border-color:${(themeObj.kd_color_1)}!important;
border-right-width: 1px!important;
outline: 0;
box-shadow : 0 0 0 2px ${THEME.rgba(themeObj.kd_color_1, .2)};
}
.layui-card {
box-shadow: 0 3px 1px -2px rgb(0 0 0 / 20%), 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%);
}`;
if ('styleSheet' in style) {
style.setAttribute('type', 'text/css');
@ -531,13 +528,13 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
$('body')[0].appendChild(style);
$('body').attr('layadmin-themealias', themeObj["theme_title-py"]);
var iframes = $(".layadmin-iframe").contents();
let iframes = $(".layadmin-iframe").contents();
function setIframeTheme(iframes) {
for (var i = 0; i < iframes.length; i++) {
var $iframe = $(iframes[i]),
for (let i = 0; i < iframes.length; i++) {
let $iframe = $(iframes[i]),
$iframeBody = $(iframes[i]).find("body"),
iframeBodyElemt = $iframeBody[0];
var c_style = $iframe[0].createElement('style'),
let c_style = $iframe[0].createElement('style'),
c_styleElem = $iframe[0].getElementById(styleid);
if ('styleSheet' in c_style) {
c_style.setAttribute('type', 'text/css');
@ -725,18 +722,18 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* 开始渲染主题
*/
render(isServer, isDefalut) {
var themeObj = THEME.getTheme(isServer);
let themeObj = THEME.getTheme(isServer);
if (isDefalut) {
var leftThemeRender = new LeftTheme(themeObj);
let leftThemeRender = new LeftTheme(themeObj);
leftThemeRender.render();
return;
}
if (themeObj.layout == 'top') {
var topThemeRender = new TopTheme(themeObj);
let topThemeRender = new TopTheme(themeObj);
topThemeRender.render();
} else {
var leftThemeRender = new LeftTheme(themeObj);
let leftThemeRender = new LeftTheme(themeObj);
leftThemeRender.render();
}
}
@ -752,7 +749,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* 主题渲染类
* @param {*} config
*/
var ThemeRenderBase = function (config) {
let ThemeRenderBase = function (config) {
this.config = {
$elem: $('#kdayun-app'), //主容器
$headerElem: $('.layui-header'),
@ -764,7 +761,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
}
ThemeRenderBase.prototype.constructor = ThemeRenderBase;
ThemeRenderBase.prototype.render = function () {
var that = this;
let that = this;
that.config.$elem.empty();
that.renderHeader();
that.renderMenus();
@ -773,20 +770,20 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
element.init();
};
ThemeRenderBase.prototype.renderHeader = function () {
var that = this;
let that = this;
that.config.$headerElem = $($('#tpl-header').html());
that.config.$elem.append(that.config.$headerElem);
that.config.$headerElem.append($('#tpl-header-left-tools').html());
that.config.$headerElem.append($('#tpl-header-right-tools').html())
};
ThemeRenderBase.prototype.renderMenus = function () {
var that = this;
let that = this;
that.config.$menuElem = $($('#tpl-left-side').html())
that.config.$elem.append(that.config.$menuElem);
that.config.$menuElem.append($('#tpl-search').html())
that.config.$menuElem.find('.navbar-side-search').before($('#tpl-logo').html())
that.config.$menuElem.find('.navbar-side-search').after($('#tpl-menu').html())
var menuRender = new LeftMenuRender()
let menuRender = new LeftMenuRender()
menuRender.set({
spreadOne: true,
elem: '#admin-navbar-menu',
@ -797,10 +794,10 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
menuRender.render();
};
ThemeRenderBase.prototype.renderFoot = function () {
var that = this;
let that = this;
};
ThemeRenderBase.prototype.renderBody = function () {
var that = this;
let that = this;
that.config.$menuElem = $($('#tpl-body').html())
that.config.$elem.append(that.config.$menuElem);
};
@ -811,17 +808,17 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
/**
* 菜单靠左的布局
*/
var LeftTheme = function (config) {
let LeftTheme = function (config) {
ThemeRenderBase.call(this, config);
};
(function () {
var Super = function () { };
let Super = function () { };
Super.prototype = ThemeRenderBase.prototype;
LeftTheme.prototype = new Super();
})();
LeftTheme.prototype.constructor = LeftTheme;
LeftTheme.prototype.render = function () {
var that = this;
let that = this;
this.config.$elem.removeClass('kdayun-app-layout-top').addClass('kdayun-app-layout-left')
ThemeRenderBase.prototype.render.call(this)
@ -829,30 +826,30 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
/**
* 菜单是在头部
*/
var TopTheme = function (config) {
let TopTheme = function (config) {
ThemeRenderBase.call(this, config);
};
(function () {
var Super = function () { };
let Super = function () { };
Super.prototype = ThemeRenderBase.prototype;
TopTheme.prototype = new Super();
})();
TopTheme.prototype.constructor = TopTheme;
TopTheme.prototype.render = function () {
var that = this;
let that = this;
this.config.$elem.removeClass('kdayun-app-layout-left').addClass('kdayun-app-layout-top')
ThemeRenderBase.prototype.render.call(this)
this.config.$elem.find('a').removeAttr('lay-tips')
}
TopTheme.prototype.renderMenus = function () {
var that = this;
let that = this;
that.config.$headerElem.find('.layui-layout-left').remove();
that.config.$headerElem.append($('#tpl-logo').html());
that.config.$headerElem.append($('#tpl-menu').html());
that.config.$menuElem = $('#admin-navbar-menu')
// that.config.$menuElem.after($('#tpl-search').html())
var menuRender = new TopMenuRender();
let menuRender = new TopMenuRender();
menuRender.set({
spreadOne: true,
elem: '#admin-navbar-menu',
@ -863,7 +860,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
menuRender.render();
};
var MenuRenderBase = function (config) {
let MenuRenderBase = function (config) {
/**
* 默认配置
*/
@ -880,12 +877,12 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* 渲染菜单
*/
MenuRenderBase.prototype.render = function () {
var that = this;
var _config = that.config;
let that = this;
let _config = that.config;
if (typeof (_config.elem) !== 'string' && typeof (_config.elem) !== 'object') {
common.throwError('MenuRender error: elem参数未定义或设置出错具体设置格式请参考文档API.');
}
var $container;
let $container;
if (typeof (_config.elem) === 'string') {
$container = $('' + _config.elem + '');
}
@ -899,10 +896,9 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
common.throwError('MenuRender error:请为Navbar配置数据源.')
}
if (_config.data !== undefined && typeof (_config.data) === 'object') {
var html = that.getHtml(_config.data);
let html = that.getHtml(_config.data);
$container.html(html);
that.iniEvent();
that.config.elem = $container;
} else {
$.ajax({
@ -911,7 +907,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
async: false, //_config.async,
dataType: 'json',
success: function (result, status, xhr) {
var html = that.getHtml(result.obj);
let html = that.getHtml(result.obj);
$container.html(html);
},
error: function (xhr, status, error) {
@ -922,14 +918,12 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
}
});
}
//只展开一个二级菜单
if (_config.spreadOne) {
var $ul = $container.children('ul');
let $ul = $container.children('ul');
$ul.find('li.kdayun-menu-item').each(function () {
});
}
this.iniEvent();
return that;
};
@ -938,43 +932,52 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
this.iniSearchEvent();
};
MenuRenderBase.prototype.iniMenuClickEvent = function () {
var that = this;
let that = this;
that.config.elem.on('click', "a", function (e) {
var othis = $(this)
, parents = othis.parents('.kdayun-menu-ul')
, filter = parents.attr('lay-filter')
, parent = othis.parent()
, child = othis.siblings('.kdayun-menu-child');
var shrinkParents = othis.parents('.layadmin-side-shrink');
if (shrinkParents.length > 0) {
var iconElem = $('#kdayun-app-flexible'),
isSpread = iconElem.hasClass('layui-icon-spread-left');
layui.admin.sideFlexible(isSpread ? 'spread' : null);
}
//如果是垂直菜单
if (child[0]) {
parent[child.css('display') === 'none' ? 'addClass' : 'removeClass']('kdayun-menu-item-expand');
if (parents.attr('lay-shrink') === 'all') {
parent.siblings().removeClass('kdayun-menu-item-expand');
}
}
href = othis.attr('yh-href'),
text = othis.attr('lay-text'),
resid = othis.attr('resid'),
searchBox = othis.parents('div#admin-navbar-menu').siblings('div.navbar-side-search');
searchBox.find('ul.navbarSearchResult ').removeClass('layui-show').addClass('layui-hide');
searchBox.find('input#navbarSearchValue').val('');
common.tabsPage.elem = othis;
if (!common.isEmpty(href)) {
common.openTabsPage(href, text || othis.text(), resid);
parent.addClass('layui-this');
}
common.sendTo(filter, 'MENU_CLICK', othis)
that.activeMenu($(this), true)
e.stopPropagation();
})
}
MenuRenderBase.prototype.activeMenu = function ($a, isOpen) {
let parents = $a.parents('.kdayun-menu-ul')
, filter = parents.attr('lay-filter')
, parent = $a.parent()
, child = $a.siblings('.kdayun-menu-child');
let shrinkParents = $a.parent().parent();
if (shrinkParents.hasClass('kdayun-menu-ul') && $a.parents('.layadmin-side-shrink')[0]) {
let iconElem = $('#kdayun-app-flexible'),
isSpread = iconElem.hasClass('layui-icon-spread-left');
layui.admin.sideFlexible(isSpread ? 'spread' : null);
}
//如果是垂直菜单
if (child[0]) {
parent[child.css('display') === 'none' ? 'addClass' : 'removeClass']('kdayun-menu-item-expand');
if (parents.attr('lay-shrink') === 'all') {
parent.siblings().removeClass('kdayun-menu-item-expand');
}
}
let href = $a.attr('yh-href'),
text = $a.attr('lay-text'),
resid = $a.attr('resid'),
searchBox = $a.parents('div#admin-navbar-menu').siblings('div.navbar-side-search');
searchBox.find('ul.navbarSearchResult ').removeClass('layui-show').addClass('layui-hide');
searchBox.find('input#navbarSearchValue').val('');
common.tabsPage.elem = $a;
if (!common.isEmpty(href) && isOpen) {
common.openTabsPage(href, text || $a.text(), resid);
}
if (!common.isEmpty(href)) {
$('.kdayun-menu-container li.layui-this').removeClass('layui-this');
if (parent.parents('.kdayun-menu-container')[0]) {
$('.kdayun-menu-container .kdayun-menu-item-expand').removeClass('kdayun-menu-item-expand');
parent.parents('.kdayun-menu-child').parent().addClass('kdayun-menu-item-expand');
parent.addClass('layui-this');
}
}
isOpen && common.sendTo(filter, 'MENU_CLICK', $a)
}
MenuRenderBase.prototype.iniSearchEvent = function () {
$('#navbarSearchValue').on('keyup', function (e) {
navbarSeacherHandle($(this).val(), this)
@ -984,7 +987,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
});
// 点击搜索项
$('ul.navbarSearchResult').on('click', 'li', function () {
var value = $(this).find('cite').html();
let value = $(this).find('cite').html();
$('ul.navbarSearchResult').removeClass('layui-show').addClass('layui-hide');
$(this).parent().siblings('input').val('');
if (!$('#admin-navbar-menu').find('a[lay-tips="' + value + '"]').parent().hasClass('kdayun-menu-item-expand')) {
@ -993,7 +996,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
})
function navbarSeacherHandle(value, dom) {
var targetData = $(dom).parent('div.navbar-side-search').siblings('div#admin-navbar-menu').find('a'),
let targetData = $(dom).parent('div.navbar-side-search').siblings('div#admin-navbar-menu').find('a'),
ulItem = $(dom).siblings('ul.navbarSearchResult'),
num = 0;
ulItem.html(' ');
@ -1001,8 +1004,8 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
ulItem.addClass('layui-hide').removeClass('layui-show');
return;
}
for (var i = 0; i < targetData.length; i++) {
var matchingTarget = $(targetData[i]).find('cite').html(),
for (let i = 0; i < targetData.length; i++) {
let matchingTarget = $(targetData[i]).find('cite').html(),
imgHtml = $(targetData[i]).find('img').length > 0 ? $(targetData[i]).find('img')[0].outerHTML : '<i class="fa fa-file"></i>';
if (matchingTarget.indexOf(value) != -1 || zlPinYin.A(matchingTarget).toLowerCase().indexOf(value.toLowerCase()) != -1) {
@ -1021,8 +1024,8 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* @param {Object} data 菜单的项数组
*/
MenuRenderBase.prototype.getHtml = function (data) {
var ulHtml = '<ul class="kdayun-menu-ul" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">';
for (var i = 0; i < data.length; i++) {
let ulHtml = '<ul class="kdayun-menu-ul" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">';
for (let i = 0; i < data.length; i++) {
if (data[i].spread) {
ulHtml += '<li class="kdayun-menu-item kdayun-menu-item-expand">';
} else {
@ -1048,18 +1051,18 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* @param {*} item
*/
MenuRenderBase.prototype.getItemHtml = function (item) {
var ulHtml = '';
var url = item.href;
let ulHtml = '';
let url = item.href;
if (url != null) {
url = url.replace(/#{contentpath}/i, layui.cache['contentPath']);
}
var iconUrl = layui.cache['contentPath'] + item.icon;
var svgOnLoad = ''
let iconUrl = layui.cache['contentPath'] + item.icon;
let svgOnLoad = ''
if (iconUrl && (iconUrl.indexOf('.svg') != -1 || iconUrl.indexOf('.SVG') != -1)) {
svgOnLoad = 'onload = "SVGInject(this)" fill="currentColor"'
}
var layhref = (url !== undefined && url !== '' && url !== null) ? 'yh-href="' + url + '"' : '';
let layhref = (url !== undefined && url !== '' && url !== null) ? 'yh-href="' + url + '"' : '';
ulHtml += '<a href="javascript:;" ' + layhref + ' lay-text="' + item.title + '" lay-tips="' + item.title + '" lay-direction="2" resId=' + item.resid + ' >';
if (item.icon != undefined && item.icon != '') {
ulHtml += '<img src="' + layui.cache['contentPath'] + item.icon + '" ' + svgOnLoad + ' style="width:16px;height:16px;vertical-align: text-bottom;">';
@ -1072,7 +1075,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
ulHtml += '<span class="kdayun-menu-more"></span>'
ulHtml += '</a>';
ulHtml += '<ul class="kdayun-menu-child">'
for (var j = 0; j < item.children.length; j++) {
for (let j = 0; j < item.children.length; j++) {
ulHtml += '<li>';
if (item.children !== undefined && item.children.length > 0)
ulHtml += this.getItemHtml(item.children[j]);
@ -1090,7 +1093,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* @param {Object} options
*/
MenuRenderBase.prototype.set = function (options) {
var that = this;
let that = this;
that.config.data = undefined;
$.extend(true, that.config, options);
return that;
@ -1101,27 +1104,27 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
* @param {Function} callback
*/
MenuRenderBase.prototype.on = function (events, callback) {
var that = this;
var _con = that.config.elem;
let that = this;
let _con = that.config.elem;
if (typeof (events) !== 'string') {
common.throwError('MenuRender error:事件名配置出错请参考API文档.');
}
var lIndex = events.indexOf('(');
var eventName = events.substr(0, lIndex);
var filter = events.substring(lIndex + 1, events.indexOf(')'));
let lIndex = events.indexOf('(');
let eventName = events.substr(0, lIndex);
let filter = events.substring(lIndex + 1, events.indexOf(')'));
if (eventName === 'click') {
if (_con.attr('lay-filter') !== undefined) {
_con.children('ul').find('li').each(function () {
var $this = $(this);
let $this = $(this);
if ($this.find('ul').length > 0) {
var $li = $this.find('li').each(function () {
let $li = $this.find('li').each(function () {
$(this).on('click', function () {
var $a = $(this).children('a');
var href = $a.data('url');
var icon = $a.children('i:first').data('icon');
var title = $a.children('cite').text();
let $a = $(this).children('a');
let href = $a.data('url');
let icon = $a.children('i:first').data('icon');
let title = $a.children('cite').text();
if (href) {
var data = {
let data = {
elem: $a,
field: {
href: href,
@ -1135,12 +1138,12 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
});
} else {
$this.on('click', function () {
var $a = $this.children('a');
var href = $a.data('url');
var icon = $a.children('i:first').data('icon');
var title = $a.children('cite').text();
let $a = $this.children('a');
let href = $a.data('url');
let icon = $a.children('i:first').data('icon');
let title = $a.children('cite').text();
if (href) {
var data = {
let data = {
elem: $a,
field: {
href: href,
@ -1163,11 +1166,11 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
};
var TopMenuRender = function () {
let TopMenuRender = function () {
MenuRenderBase.call(this);
};
(function () {
var Super = function () { };
let Super = function () { };
Super.prototype = MenuRenderBase.prototype;
TopMenuRender.prototype = new Super();
})();
@ -1182,12 +1185,23 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
/**
* 菜单的渲染器
*/
var LeftMenuRender = function () {
let LeftMenuRender = function () {
MenuRenderBase.call(this);
let that = this;
common.on('TAB_ACTIVE', function (event) {
let resid = event.params;
console.info(resid);
if (resid) {
let $a = $(`a[resid='${resid}']`)
if ($a.length !== 0) {
that.activeMenu($a, false)
}
}
})
};
(function () {
var Super = function () { };
let Super = function () { };
Super.prototype = MenuRenderBase.prototype;
LeftMenuRender.prototype = new Super();
})();
@ -1195,7 +1209,7 @@ layui.define(['laytpl', 'element', 'layer', 'zlPinYin', 'common'], function (exp
!function () {
common.on('setTheme', function (event) {
var themeObj = JSON.parse(event.params);
let themeObj = JSON.parse(event.params);
if (themeObj) {
THEME.renderCssStyle(themeObj);
}

View File

@ -282,7 +282,7 @@ layui.define(['form', 'zlConfig', 'element', 'zlContext', 'laydate', 'table', 'u
//创建zTree组件
var setting = {
view: {
showLine: true
showLine: false
},
async: {
enable: true,

View File

@ -54,7 +54,7 @@ layui.define(['zlContext', 'table', 'layer', 'zlConfig', 'tree'], function (expo
chkStyle: "checkbox",
}
, view: {
showLine: true
showLine: false
}
, async: {
enable: true,
@ -402,7 +402,7 @@ layui.define(['zlContext', 'table', 'layer', 'zlConfig', 'tree'], function (expo
chkStyle: "checkbox",
}
, view: {
showLine: true
showLine: false
}
, async: {
enable: true,

View File

@ -598,7 +598,7 @@ layui.define(['zlContext', 'zlDynamicCondition', 'table', 'layer', 'zlConfig'],
chkStyle: "checkbox",
},
view: {
showLine: true
showLine: false
},
async: {
enable: true,
@ -661,7 +661,7 @@ layui.define(['zlContext', 'zlDynamicCondition', 'table', 'layer', 'zlConfig'],
chkStyle: "checkbox",
},
view: {
showLine: true
showLine: false
},
async: {
enable: true,

View File

@ -56,7 +56,7 @@ layui.define(['zlContext', 'layer', 'zlConfig', 'form'], function (exports) {
chkStyle: "checkbox",
},
view: {
showLine: true
showLine: false
},
async: {
enable: true,

View File

@ -65,7 +65,7 @@ layui.define(['zlContext', 'layer', 'zlConfig'], function (exports) {
zltreemenu.filterCallback[id] = filterCallback
var zltreeSetting = {
view: {
showLine: true,
showLine: false,
fontCss: zltreemenu.options[id].fontCss ? zltreemenu.options[id].fontCss : {},
nameIsHTML: true
},
@ -188,7 +188,7 @@ layui.define(['zlContext', 'layer', 'zlConfig'], function (exports) {
var pNodes = treeObj.getNodesByParam("isParent", true);
pNodes.sort(compare('level'))
for (var i = 0; i < pNodes.length; i++) {
var node=pNodes[i];
var node = pNodes[i];
if (node.children.length != 0) {
var hideNum = 0;
for (var k = 0; k < node.children.length; k++) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -10806,6 +10806,18 @@ SYS_SORT: string
SYS_STATUS: number
}
/**
*组件支持数据库事务的接口
*/
interface ITransaction {
/**
* 处理数据库提交的参数
* @param callback 处理回调* @returns 返回是否成功,或者参数数组
*/
processPostParam(callback: SqlWritercallback): boolean | any[]
}
/**
*内存数据源(静态数据源)
*/
class MemoryDataSetBase extends DataSourceBase {
@ -11169,6 +11181,24 @@ class SortTypes {
}
/**
*数据库事务管理组件
*/
class SqlTransation extends InvisibleBase {
/**
* 在一个事务内提交修改的数据
* @param callback
*/
commit(callback: SqlTransationcallback): void
}
/**
*事务回调
*/
declare type SqlTransationcallback = (err: string) => void
/**
*Url数据源基类
数据查询,更新,新增,删除
*/
@ -17503,7 +17533,7 @@ static openNewTabPageByMenuCode(menuCode: string,param: object): void
static openNewTabPageByPageCode(pageModelCode: string,title: string,resid: string,param: object): void
/**
* 通过表单编号在系统最顶层弹出一个页面
* 通过表单编号在系统最顶层弹出一个页面
如果遇到无权限 必须加上resid(如:菜单id等资源ID) 才能调用
* @param pageModelCode 表单唯一编号(表单管理内必须保证编号的唯一性)
* @param title 可选参数。页签的标题也可以在 formConfig内的title设置弹出标题
@ -17514,6 +17544,18 @@ static openNewTabPageByPageCode(pageModelCode: string,title: string,resid: strin
*/
static openNewTopPageByPageCode(pageModelCode: string,title: string,resid: string,pageCoinfg: IPageFormOptions,param: any): void
/**
* 通过表单id在系统最顶层弹出一个页面
如果遇到无权限 必须加上resid(如:菜单id等资源ID) 才能调用
* @param pageModelId 表单唯一编号(表单管理内必须保证编号的唯一性)
* @param title 可选参数。页签的标题也可以在 formConfig内的title设置弹出标题
* @param resid 可选参数。资源ID. 与资源权限相关. 一般是:菜单资源id
* @param pageCoinfg 可选参数。类型IFormOptions 可以设置弹出的窗口大各种属性 例如: pageCoinfg={title:'窗口标题' ,area:['100px','200px']}
* @param param 可选参数。附带参数,param ={ xxx:xxxyyyy,aaabbb:cccddd} 注意:这个参数的长度受浏览器的请求地址最大长度限制.
*/
static openNewTopPageByPageId(pageModelId: string,title: string,resid: string,pageCoinfg: IPageFormOptions,param: any): void
/**
* 在浏览器新的页签打开页面
注意:这种方式开启页面如果页面包含有资源权限组件时候是不生效的
@ -17625,14 +17667,14 @@ moveOut: boolean
offset: 'auto' 默认坐标,即垂直水平居中
offset: '100px' 只定义top坐标水平保持居中
offset: ['100px', '50px'] 同时定义top、left坐标
offset: 't' 快捷设置顶部坐标
offset: 'r' 快捷设置右边缘坐标
offset: 'b' 快捷设置底部坐标
offset: 'l' 快捷设置左边缘坐标
offset: 'lt' 快捷设置左上角
offset: 'lb' 快捷设置左下角
offset: 'rt' 快捷设置右上角
offset: 'rb' 快捷设置右下角
offset: 't' 顶部停靠
offset: 'r' 右边停靠
offset: 'b' 底部停靠
offset: 'l' 左边停靠
offset: 'lt' 左上角
offset: 'lb' 左下角
offset: 'rt' 右上角
offset: 'rb' 右下角
*/
offset: string
/**
@ -23755,6 +23797,7 @@ class WorkFlow extends InvisibleBase {
* @param finishCallBack 完成回调 function (audFlag, audName, auditMemo, error) 如果 error是非空说明有错误发生.
* @param wfParams 可选参数,传递参数到流程参数
* @param attachment 可选参数, 附件. 字符串格式如: '{ "newFileName": "xxxxx/yyyyy/ssss.png", "oldFileName": "yyy/old.png" }'
* @param pageConfig 可选参数, 流程审核的弹出窗口的配置参数.详情见IPageFormOptions 接口说明 http://help.kdayun.com/api/component/interfaces/yh_designer_src_services_pageservice.ipageformoptions.html
例如:
```javascript
function Button13_onClickScript(cxt: ScriptContext, btn: Button) {
@ -23776,7 +23819,7 @@ btn.getPage().components.Table1.loadData();
```
*/
confirm(finishCallBack: WorkflowCallBack,wfParams: object,attachment: string): void
confirm(finishCallBack: WorkflowCallBack,wfParams: object,attachment: string,pageConfig: IPageFormOptions): void
/**
* 通过行直接审核行并提交到后台. 会弹出指定的审核表单
@ -23853,6 +23896,7 @@ confirmAndPostByRowDirect(row: Row,audFlag: WorkflowConfirmResult,auditMemo: str
* @param finishCallBack 审核完成的事件回调 function (audFlag, audName, auditMemo, error) 如果 error是非空说明有错误发生.
* @param wfParams 流程变量 传递到流程引擎内的变量(例如:传递一个变量来会影响线路的路径)
* @param attachment 可选参数, 附件 字符串格式如: '{ "newFileName": "xxxxx/yyyyy/ssss.png", "oldFileName": "yyy/old.png" }'
* @param pageConfig 可选参数, 流程审核的弹出窗口的配置参数.详情见IPageFormOptions 接口说明 http://help.kdayun.com/api/component/interfaces/yh_designer_src_services_pageservice.ipageformoptions.html
例如:
```javascript
function Button13_onClickScript(cxt: ScriptContext, btn: Button) {
@ -23880,7 +23924,7 @@ btn.getPage().components.Table1.loadData();
```
*/
confirmByRow(row: Row,finishCallBack: WorkflowCallBack,wfParams: object,attachment: string): void
confirmByRow(row: Row,finishCallBack: WorkflowCallBack,wfParams: object,attachment: string,pageConfig: IPageFormOptions): void
/**
* 得到关联数据源实例
@ -23937,6 +23981,7 @@ setCopyRead(processId: string,comment: string,callback: WofkFlowCallbackHandle):
* @param finishCallBack 完成回调函数 function (audFlag, audName, auditMemo, error) 如果 error是非空说明有错误发生.
* @param wfParams 可选参数,传递参数到后台
* @param attachment 可选参数, 附件 字符串格式如: '{ "newFileName": "xxxxx/yyyyy/ssss.png", "oldFileName": "yyy/old.png" }'
* @param pageConfig 可选参数, 流程审核的弹出窗口的配置参数.详情见IPageFormOptions 接口说明 http://help.kdayun.com/api/component/interfaces/yh_designer_src_services_pageservice.ipageformoptions.html
例如:
```javascript
function Button13_onClickScript(cxt: ScriptContext, btn: Button) {
@ -23964,7 +24009,7 @@ btn.getPage().components.Table1.loadData();
```
*/
start(finishCallBack: WorkflowCallBack,wfParams: object,attachment: string): void
start(finishCallBack: WorkflowCallBack,wfParams: object,attachment: string,pageConfig: IPageFormOptions): void
/**
* 通过行直接启动流程并提交到后台. 会弹出指定的审核表单
@ -24035,6 +24080,7 @@ startAndPostByRowDirect(row: Row,auditMemo: string,wfParams: object,finishCallBa
* @param finishCallBack 完成的回调函数 function (audFlag, audName, auditMemo, error) 如果 error是非空说明有错误发生
* @param wfParams 可选参数,传递参数到流程参数
* @param attachment 可选参数, 附件 字符串格式如: '{ "newFileName": "xxxxx/yyyyy/ssss.png", "oldFileName": "yyy/old.png" }'
* @param pageConfig 可选参数, 流程审核的弹出窗口的配置参数. 详情见IPageFormOptions 接口说明 http://help.kdayun.com/api/component/interfaces/yh_designer_src_services_pageservice.ipageformoptions.html
例如:
```javascript
function Button13_onClickScript(cxt: ScriptContext, btn: Button) {
@ -24061,7 +24107,7 @@ btn.getPage().components.Table1.loadData();
```
*/
startByRow(row: Row,finishCallBack: WorkflowCallBack,wfParams: object,attachment: string): void
startByRow(row: Row,finishCallBack: WorkflowCallBack,wfParams: object,attachment: string,pageConfig: IPageFormOptions): void
}
/**
@ -25226,9 +25272,9 @@ class MobelPageService extends InvisibleBase {
getCode(format: string,orgid: string): string
/**
* 通过菜单的编号打开页面 与 openPage的差别在于,这个与菜单关联受权限的管理 openPage无权限管理
* 通过菜单的编号打开页面 与 openPageByPageModelCode的差别在于,这个与菜单关联受权限的管理 openPageByPageModelCode无权限管理
页面会带上对应tokenId
* @param menuCode 表单模型的编号
* @param menuCode 菜单编号
* @param param 附带参数对象
*/

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -28,6 +28,7 @@ layui.config({}).use(['element', 'zlExcel', 'zlConfig', 'zlContext', 'zltreemenu
customCurr = 1,
zlExcel = layui.zlExcel,
cols,
zlpoptree = layui.zlpoptree,
sortcols,
setsing,
viewpicture,
@ -1016,6 +1017,9 @@ layui.config({}).use(['element', 'zlExcel', 'zlConfig', 'zlContext', 'zltreemenu
if (fields.TOUX == '') {
fields.TOUX = '/static/image/userImg.png';
}
if (fields.TOUX) {
fields.TOUX = fields.TOUX.replace(layui.cache['contentPath'], '');
}
zlContext.put(layui.cache['contentPath'] + '/admin/coreuser/add', fields, function (result) {
if (result[statusName] == OK) {
gridAction.refreshGrid(editType, result[dataName]);
@ -1029,6 +1033,9 @@ layui.config({}).use(['element', 'zlExcel', 'zlConfig', 'zlContext', 'zltreemenu
});
}
if (editType == 'edit') {
if (fields.TOUX) {
fields.TOUX = fields.TOUX.replace(layui.cache['contentPath'], '');
}
zlContext.post(layui.cache['contentPath'] + '/admin/coreuser/modify', fields, function (result) {
if (result[statusName] == OK) {
gridAction.refreshGrid(editType, fields);
@ -1125,7 +1132,7 @@ layui.config({}).use(['element', 'zlExcel', 'zlConfig', 'zlContext', 'zltreemenu
var usesetting = {
formtitle: "修改部门",
view: {
showLine: true
showLine: false
},
async: {
enable: true,

View File

@ -121,7 +121,7 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
var authshowsetting = {
formtitle: "查看权限",
view: {
showLine: true
showLine: false
},
async: {
enable: true,
@ -263,7 +263,7 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
area: ['100%', '100%'],
success: function (index) {
$('input[name="edittype"]').val('add');
$('select[name="ROLELEV"]').val(0);
$('input[name="ORGID"]').val(orgid);
// 非通用机构
if (orgid != '9C876276D8884BFF94DF343E2A4EED7D') {
@ -279,6 +279,7 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
$('input[name="OBJNAME"]').attr('lay-verify', 'required');
$('input[name="OBJCODE"]').attr('lay-verify', 'required');
$('SELECT[name="ROLELEV"]').attr('lay-verify', 'required');
} else {
$('.layui-form-item').not('.roletype,.btn').hide();
$('SELECT[name="MXRWID"]').attr('lay-verify', 'required');
@ -366,16 +367,21 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
$('input[name="VISIBILITY"]').val(roleNode[0].VISIBILITY);
$('select[name="ROLELEV"]').addClass('layui-disabled');
$('select[name="DATARIGHTLEV"]').addClass('layui-disabled');
if (orgNode.length > 0 && roleNode[0].VISIBILITY == 1 && orgNode[0].RWID != "9C876276D8884BFF94DF343E2A4EED7D") {
$('select[name="ROLELEV"]').attr('disabled', "disabled");
$('select[name="DATARIGHTLEV"]').attr('disabled', "disabled");
$('input[name="DES"]').addClass('layui-disabled');
$('input[name="DES"]').attr('disabled', "disabled");
$('input[name="OBJCODE"]').addClass('layui-disabled');
$('input[name="OBJCODE"]').attr('disabled', "disabled");
}
form.render();
$('select[name="ROLELEV"]').val(roleNode[0].ROLELEV);
$('select[name="DATARIGHTLEV"]').val(roleNode[0].DATARIGHTLEV);
form.render('select');
},
cancel: function (index, layero) {
@ -642,7 +648,7 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
// 数据表格中 对应账号编辑权限弹窗的 树结构渲染所需配置
var usesetting = {
view: {
showLine: true
showLine: false
},
async: {
enable: true,
@ -945,9 +951,9 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
, ' </div>'
, ' </div>'
, ' </div>'
, ' <div class="layui-form-item">'
, ' <div class="layui-form-item layui-hide">'
, ' <div class="layui-col-md12">'
, ' <label class="layui-form-label">角色级别</label>'
, ' <label class="layui-form-label">角色类型</label>'
, ' <div class="layui-input-block">'
, ' <select lay-verify="required" name="ROLELEV">'
, ' <option value=""></option>'
@ -957,6 +963,19 @@ layui.use(['element', 'table', 'tree', 'zltreemenu', 'zlSelectEx', 'zlpoptree',
, ' </div>'
, ' </div>'
, ' </div>'
, ' <div class="layui-form-item">'
, ' <div class="layui-col-md12">'
, ' <label class="layui-form-label">数据权限</label>'
, ' <div class="layui-input-block">'
, ' <select name="DATARIGHTLEV">'
, ' <option value=""></option>'
, ' <option value="1">机构(能看到机构内的任何人建立的业务单据)</option>'
, ' <option value="2">部门(能看到部门内的任何人建立的业务单据.含子部门)</option>'
, ' <option value="3">个人(只能看到个人建立的业务单据)</option>'
, ' </select>'
, ' </div>'
, ' </div>'
, ' </div>'
, ' <div class="layui-form-item selRole" style="display:none">'
, ' <div class="layui-col-md12">'
, ' <label class="layui-form-label">选择已删除角色</label>'

View File

@ -17,7 +17,7 @@ layui.use(['element', 'table', 'tree', 'zlpoptree', 'zlContext', 'zlConfig', 'tr
, fullheight = zlContext.setMaxHeihgt(0);
var setting = {
view: {
showLine: true
showLine: false
},
async: {
enable: true,

View File

@ -21,7 +21,7 @@ layui.use(['element', 'table', 'tree', 'zlpoptree', 'zlContext', 'zlConfig', 'tr
var setting = {
view: {
showLine: true
showLine: false
},
async: {
enable: true,
@ -372,7 +372,7 @@ layui.use(['element', 'table', 'tree', 'zlpoptree', 'zlContext', 'zlConfig', 'tr
}
var syssetting = {
view: {
showLine: true
showLine: false
},
data: {
key: {

View File

@ -557,7 +557,7 @@ layui.config({
//创建zTree组件
var setting = {
view: {
showLine: true,
showLine: false,
nameIsHTML: true
},
check: {

View File

@ -164,7 +164,6 @@ layui.define(['view', 'theme', 'common'], function (exports) {
element.tabChange(FILTER_TAB_TBAS, options.url);
admin.tabsBody(index).addClass(SHOW).siblings().removeClass(SHOW);
events.rollPage('auto', index);
},
//resize事件管理
@ -228,23 +227,23 @@ layui.define(['view', 'theme', 'common'], function (exports) {
isSpread = iconElem.hasClass(ICON_SPREAD);
admin.sideFlexible(isSpread ? 'spread' : null);
},
clearCache:function(){
$.ajax({
url: layui.cache['contentPath'] + '/core/cache/clear',
type: 'get',
async: false,
dataType: 'json',
contentType: "application/json",
success: function (result) {
if (result.state == 'OK')
alert('清理服务器缓存完毕!');
else
alert('清理服务器缓存出错:' + result.msg)
},
error: function (xhr, textStatus, errorThrown) {
alert('请求异常! ' + xhr.responseText);
}
});
clearCache: function () {
$.ajax({
url: layui.cache['contentPath'] + '/core/cache/clear',
type: 'get',
async: false,
dataType: 'json',
contentType: "application/json",
success: function (result) {
if (result.state == 'OK')
alert('清理服务器缓存完毕!');
else
alert('清理服务器缓存出错:' + result.msg)
},
error: function (xhr, textStatus, errorThrown) {
alert('请求异常! ' + xhr.responseText);
}
});
},
/**
* 刷新
@ -570,71 +569,18 @@ layui.define(['view', 'theme', 'common'], function (exports) {
//监听 tab 组件切换,同步 index
element.on('tab(' + FILTER_TAB_TBAS + ')', function (data) {
common.tabsPage.index = data.index;
let $el = data.elem.children('.layui-tab-title').find('>li').eq(data.index)
common.send('TAB_ACTIVE', $el.attr('lay-id'));
});
//监听选项卡切换,改变菜单状态
admin.on('tabsPage(setMenustatus)', function (router) {
var pathURL = router.url,
getData = function (item) {
return {
list: item.children('.yh-menu-child'),
a: item.children('*[yh-href]')
}
},
sideMenu = $('#' + SIDE_MENU),
SIDE_NAV_ITEMD = 'layui-nav-itemed',
//捕获对应菜单
matchMenu = function (list) {
list.each(function (index1, item1) {
var othis1 = $(item1),
data1 = getData(othis1),
listChildren1 = data1.list.children('dd'),
matched1 = pathURL === data1.a.attr('resid');
listChildren1.each(function (index2, item2) {
var othis2 = $(item2),
data2 = getData(othis2),
listChildren2 = data2.list.children('dd'),
matched2 = pathURL === data2.a.attr('resid');
listChildren2.each(function (index3, item3) {
var othis3 = $(item3),
data3 = getData(othis3),
matched3 = pathURL === data3.a.attr('resid');
if (matched3) {
var selected = data3.list[0] ? SIDE_NAV_ITEMD : THIS;
othis3.parents('dd').addClass(SIDE_NAV_ITEMD).siblings().removeClass(SIDE_NAV_ITEMD);
othis3.parents('li.layui-nav-item').addClass(SIDE_NAV_ITEMD).siblings().removeClass(SIDE_NAV_ITEMD);
othis3.addClass(selected).siblings().removeClass(selected); //标记选择器
return false;
}
});
if (matched2) {
var selected = data2.list[0] ? SIDE_NAV_ITEMD : THIS;
othis2.parents('li.layui-nav-item').addClass(SIDE_NAV_ITEMD).siblings().removeClass(SIDE_NAV_ITEMD);
othis2.addClass(selected).siblings().removeClass(selected); //标记选择器
return false
}
});
if (matched1) {
var selected = data1.list[0] ? SIDE_NAV_ITEMD : THIS;
othis1.addClass(selected).siblings().removeClass(selected); //标记选择器
return false;
}
});
}
var sideMenu = $('#' + SIDE_MENU);
//重置状态
sideMenu.find('.' + THIS).removeClass(THIS);
//移动端点击菜单时自动收缩
// 移动端点击菜单时自动收缩
if (admin.screen() < 2) admin.sideFlexible();
//开始捕获
matchMenu(sideMenu.children('li'));
});
//监听侧边导航点击事件
@ -670,10 +616,6 @@ layui.define(['view', 'theme', 'common'], function (exports) {
dd.removeClass(THIS);
dd.parent().removeClass(SHOW);
});
// $body.on('click', '#kd-tabs-select', function (e) {
// var child = $(e.currentTarget).find('.layui-nav-child')
// child.addClass(SHOW);
// })
//同步路由