提交 a7eda96d 编写于 作者: doc_wei's avatar doc_wei

菜单新增页面类型属性

上级 160d97b9
......@@ -69,19 +69,6 @@ layui.config({
</div>
</div>`,
'customPageUrl': `<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">页面地址<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageUrl" name="pageUrl" placeholder="请输入页面地址" win-verify="required" class="layui-input" maxlength="200"/>
</div>
</div>`,
'dsFormPage': `<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">表单布局<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageUrl" name="pageUrl" placeholder="请选择表单布局" win-verify="required" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseBtn" style="top: 12px;"></i>
</div>
</div>`,
};
var attrHtml = '';
......@@ -124,15 +111,15 @@ layui.config({
} else {
var operateOpenPage = json.bean.operateOpenPage;
$('#eventTypeChangeBox').html(_html['operateOpenPage']);
$('#typeChangeBox').html(_html['customPageUrl']);
$('#typeChangeBox').html(commonHtml['customPageUrl']);
$("#openPageName").val(operateOpenPage.name);
var type = operateOpenPage.type ? "1" : "2";
$("input:radio[name=type][value=" + type + "]").attr("checked", true);
if (type == 1) {
$('#typeChangeBox').html(_html['customPageUrl']);
$('#typeChangeBox').html(commonHtml['customPageUrl']);
$("#pageUrl").val(operateOpenPage.pageUrl);
} else {
$('#typeChangeBox').html(_html['dsFormPage']);
$('#typeChangeBox').html(commonHtml['dsFormPage']);
dsFormUtil.dsFormChooseMation = operateOpenPage.dsFormPage;
var serviceName = operateOpenPage.dsFormPage.serviceBeanCustom.serviceBean.name;
$("#pageUrl").val(serviceName + '' + operateOpenPage.dsFormPage.name + '');
......@@ -182,7 +169,7 @@ layui.config({
} else {
// 新开页面
$('#eventTypeChangeBox').html(_html['operateOpenPage']);
$('#typeChangeBox').html(_html['customPageUrl']);
$('#typeChangeBox').html(commonHtml['customPageUrl']);
loadParamsTable('pageParams');
}
form.render();
......@@ -190,9 +177,9 @@ layui.config({
form.on('radio(type)', function (data) {
if (data.value == 1) {
$('#typeChangeBox').html(_html['customPageUrl']);
$('#typeChangeBox').html(commonHtml['customPageUrl']);
} else {
$('#typeChangeBox').html(_html['dsFormPage']);
$('#typeChangeBox').html(commonHtml['dsFormPage']);
}
});
......
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery'], function (exports) {
winui.renderColor();
var $ = layui.$;
var pageId = GetUrlParam("pageId");
if (isNull(pageId)) {
winui.window.msg("请传入布局id", {icon: 2, time: 2000});
return false;
}
// 获取布局信息
AjaxPostUtil.request({url: reqBasePath + "dsformpage006", params: {id: pageId}, type: 'json', method: 'GET', callback: function (json) {
console.log(json)
}});
exports('pageShow', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/dsFormPage/'}).use('pageShow');
</script>
</body>
</html>
\ No newline at end of file
......@@ -50,15 +50,26 @@ layui.config({
}
form.render('select');
});
$('#typeChangeBox').html(commonHtml['customPageUrl']);
form.on('radio(pageType)', function (data) {
if (data.value == 1) {
$('#typeChangeBox').html(commonHtml['customPageUrl']);
} else {
$('#typeChangeBox').html(commonHtml['dsFormPage']);
}
});
form.on('submit(formAddMenu)', function (data) {
if (winui.verifyForm(data.elem)) {
var level = $("input[name='level']:checked").val();
var pageType = $("input[name='pageType']:checked").val();
var params = {
name: $("#name").val(),
sysWinId: $("#sysWinId").val(),
desktopId: $("#desktop").val(),
pageUrl: $("#pageUrl").val(),
pageType: pageType == 1 ? true : false,
pageUrl: pageType == 1 ? $("#pageUrl").val() : dsFormUtil.dsFormChooseMation.id,
type: $("input[name='type']:checked").val(),
level: level,
parentId: level == 0 ? "0" : $("#menuParent").val(),
......@@ -90,6 +101,13 @@ layui.config({
$("#lockParentSel").append(str);
}, async: false});
}
$("body").on("click", ".chooseBtn", function() {
dsFormUtil.openDsFormPageChoosePage(function (dsFormChoose) {
var serviceName = dsFormChoose.serviceBeanCustom.serviceBean.name;
$("#pageUrl").val(serviceName + '' + dsFormChoose.name + '');
});
});
// 取消
$("body").on("click", "#cancle", function() {
......
......@@ -17,6 +17,27 @@ layui.config({
pagination: false,
method: 'GET',
template: $("#beanTemplate").html(),
ajaxSendLoadBefore: function(hdb, json) {
if (json.bean.pageType) {
json.bean.pageType = '自定义页面';
json.bean.pageName = json.bean.pageUrl;
} else {
json.bean.pageType = '表单布局';
dsFormUtil.dsFormChooseMation = json.bean.dsFormPage;
var serviceName = json.bean.dsFormPage.serviceBeanCustom.serviceBean.name;
json.bean.pageName = serviceName + '' + json.bean.dsFormPage.name + '';
}
if (json.bean.sysType == 1) {
json.bean.sysTypeName = '';
} else {
json.bean.sysTypeName = '';
}
if (json.bean.isShare == 0) {
json.bean.isShareName = '';
} else {
json.bean.isShareName = '';
}
},
ajaxSendAfter:function (json) {
$("#icon").html(systemCommonUtil.initIconShow(json.bean));
......@@ -25,6 +46,7 @@ layui.config({
} else {
$("#level").html( "子菜单");
}
matchingLanguage();
form.render();
}
......
......@@ -58,6 +58,18 @@ layui.config({
$("input:radio[name='sysType'][value='" + json.bean.sysType + "']").attr("checked", true);
$("input:radio[name='isShare'][value='" + json.bean.isShare + "']").attr("checked", true);
var type = json.bean.pageType ? "1" : "2";
$("input:radio[name=pageType][value=" + type + "]").attr("checked", true);
if (type == 1) {
$('#typeChangeBox').html(commonHtml['customPageUrl']);
$("#pageUrl").val(json.bean.pageUrl);
} else {
$('#typeChangeBox').html(commonHtml['dsFormPage']);
dsFormUtil.dsFormChooseMation = json.bean.dsFormPage;
var serviceName = json.bean.dsFormPage.serviceBeanCustom.serviceBean.name;
$("#pageUrl").val(serviceName + '' + json.bean.dsFormPage.name + '');
}
matchingLanguage();
form.render();
......@@ -73,15 +85,25 @@ layui.config({
}
form.render('select');
});
form.on('radio(pageType)', function (data) {
if (data.value == 1) {
$('#typeChangeBox').html(commonHtml['customPageUrl']);
} else {
$('#typeChangeBox').html(commonHtml['dsFormPage']);
}
});
form.on('submit(formEditMenu)', function (data) {
if (winui.verifyForm(data.elem)) {
var level = $("input[name='level']:checked").val();
var pageType = $("input[name='pageType']:checked").val();
var params = {
name: $("#name").val(),
sysWinId: $("#sysWinId").val(),
desktopId: $("#desktop").val(),
pageUrl: $("#pageUrl").val(),
pageType: pageType == 1 ? true : false,
pageUrl: pageType == 1 ? $("#pageUrl").val() : dsFormUtil.dsFormChooseMation.id,
type: $("input[name='type']:checked").val(),
level: level,
parentId: level == 0 ? "0" : $("#menuParent").val(),
......@@ -117,6 +139,13 @@ layui.config({
$("#lockParentSel").append(str);
}, async: false});
}
$("body").on("click", ".chooseBtn", function() {
dsFormUtil.openDsFormPageChoosePage(function (dsFormChoose) {
var serviceName = dsFormChoose.serviceBeanCustom.serviceBean.name;
$("#pageUrl").val(serviceName + '' + dsFormChoose.name + '');
});
});
// 取消
$("body").on("click", "#cancle", function() {
......
......@@ -47,7 +47,6 @@ layui.config({
{ field: 'isShare', title: '共享', align: 'center', width: 80, templet: function (d) {
return d.isShare == 0 ? '' : '';
}},
{ field: 'parentName', title: '父菜单', width: 100 },
{ field: 'pageUrl', title: '菜单链接', width: 160 },
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
......@@ -148,7 +147,7 @@ layui.config({
// 上移
function topOne(data) {
AjaxPostUtil.request({url: reqBasePath + "sys022", params: {rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "sys022", params: {id: data.id}, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
......@@ -156,7 +155,7 @@ layui.config({
// 下移
function lowerOne(data) {
AjaxPostUtil.request({url: reqBasePath + "sys023", params: {rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "sys023", params: {id: data.id}, type: 'json', method: 'POST', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
......
......@@ -18,13 +18,15 @@
<div class="layui-form-item layui-col-xs12" id="iconMation">
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">菜单地址<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageUrl" name="pageUrl" win-verify="required" placeholder="请输入菜单地址" class="layui-input" />
<div class="layui-form-mid layui-word-aux">如果是一级菜单,格式为:--<br>如果是子菜单,格式为:../../tpl/model/modellist.html</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">页面类型<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="pageType" value="1" title="自定义页面" lay-filter="pageType" checked/>
<input type="radio" name="pageType" value="2" title="表单布局" lay-filter="pageType" />
</div>
</div>
<div id="typeChangeBox">
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">所属桌面</label>
<div class="layui-input-block">
......
......@@ -29,22 +29,28 @@
<div class="layui-input-block" id="icon" style="font-size: 60px; display: flex;">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">页面类型</label>
<div class="layui-input-block ver-center">
{{pageType}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">菜单地址</label>
<div class="layui-input-block ver-center">
{{pageUrl}}
{{pageName}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">所属桌面</label>
<div class="layui-input-block ver-center">
{{desktopName}}
{{sysDesktop.name}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">所属服务</label>
<div class="layui-input-block ver-center">
{{sysWinName}}
{{sysWin.name}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
......@@ -56,7 +62,7 @@
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">父菜单</label>
<div class="layui-input-block ver-center">
{{menuParentName}}
{{parentMenu.name}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
......@@ -77,21 +83,6 @@
{{isShareName}}
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">使用信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">角色使用量</label>
<div class="layui-input-block ver-center">
{{roleNum}}
</div>
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">权限点数量</label>
<div class="layui-input-block ver-center">
{{authpointNum}}
</div>
</div>
{{/bean}}
</script>
......
......@@ -24,13 +24,15 @@
<div class="layui-form-item layui-col-xs12" id="iconMation">
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">菜单地址<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageUrl" name="pageUrl" win-verify="required" placeholder="请输入菜单地址" class="layui-input" value="{{pageUrl}}" />
<div class="layui-form-mid layui-word-aux">如果是一级菜单,格式为--<br>如果是子菜单,格式为../../tpl/model/modellist.html</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">页面类型<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="pageType" value="1" title="自定义页面" lay-filter="pageType" checked/>
<input type="radio" name="pageType" value="2" title="表单布局" lay-filter="pageType" />
</div>
</div>
<div id="typeChangeBox">
</div>
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">所属桌面</label>
<div class="layui-input-block">
......
......@@ -37,7 +37,7 @@
{{# if(auth('1552957538820')){ }}
<a class="layui-btn layui-btn-xs" lay-event="lower">下移</a>
{{# } }}
{{# if((d.roleNum == 0 || isNull(d.roleNum)) && auth('1552957567975')){ }}
{{# if(auth('1552957567975')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# if(auth('1552957843505')){ }}
......
......@@ -56,6 +56,8 @@ if(isNull(localStorage.getItem("sysMainMation"))){
initBaseParams();
}
var dsFormPageUrl = "../../tpl/dsFormPage/pageShow.html?pageId=";
var skyeyeVersion;
// 文件路径
var fileBasePath;
......
......@@ -321,6 +321,10 @@ var systemCommonUtil = {
t.next().css("cursor", "not-allowed");
},
checkUrl: function (url) {
return (url.startsWith('../') || url.startsWith('--'));
},
/**
* 对页面url添加版本控制
*
......@@ -1254,4 +1258,24 @@ var desktopMenuUtil = {
return '';
}
};
// 公共的一些html脚本
var commonHtml = {
'customPageUrl': `<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">页面地址<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageUrl" name="pageUrl" placeholder="请输入页面地址" win-verify="required" class="layui-input" maxlength="200"/>
<div class="layui-form-mid layui-word-aux">如果不想跳转,可填写:--<br>如果想跳转,格式为:../../tpl/model/modellist.html</div>
</div>
</div>`,
'dsFormPage': `<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">表单布局<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageUrl" name="pageUrl" placeholder="请选择表单布局" win-verify="required" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseBtn" style="top: 12px;"></i>
</div>
</div>`,
};
\ No newline at end of file
......@@ -952,15 +952,27 @@ layui.config({
var id = $this.attr('win-id');
var type = parseInt($this.attr('win-opentype'));
var maxOpen = parseInt($this.attr('win-maxopen')) || -1;
if (url == 'theme') {
winui.window.openTheme(loadBottomMenuIcon);
return;
}
if (!url || !title || !id) {
winui.window.msg('菜单配置错误(菜单链接、标题、id缺一不可)');
return;
}
url = indexMenu.getUrlPath(url, menuSysWinUrl);
if (!url || !title || !id) {
winui.window.msg('菜单配置错误(菜单链接、标题、id缺一不可)');
return;
}
// 自定义页面
if (url == 'theme') {
winui.window.openTheme(loadBottomMenuIcon);
return;
}
if (systemCommonUtil.checkUrl(url)) {
// 自定义页面
if (url == 'theme') {
winui.window.openTheme(loadBottomMenuIcon);
return;
}
url = indexMenu.getUrlPath(url, menuSysWinUrl);
} else {
url = dsFormPageUrl + url;
}
if (type === 1) {
// 新窗口打开
window.open(url);
......
......@@ -147,7 +147,11 @@ layui.config({
active = {
//在这里给active绑定几项事件,后面可通过active调用这些事件
tabAdd: function(url, id, name) {
url = systemCommonUtil.getHasVersionUrl(url);
if (systemCommonUtil.checkUrl(url)) {
url = systemCommonUtil.getHasVersionUrl(url);
} else {
url = dsFormPageUrl + url;
}
//新增一个Tab项 传入三个参数,分别对应其标题,tab页面的地址,还有一个规定的id,是标签中data-id的属性值
//关于tabAdd的方法所传入的参数可看layui的开发文档中基础方法部分
element.tabAdd('menubox', {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册