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

【桌面管理】桌面管理整改,新增logo属性

上级 881ded87
......@@ -4,21 +4,29 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
// 初始化上传
$("#logo").upload(systemCommonUtil.uploadCommon003Config('logo', 12, '', 1));
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
desktopName: $("#desktopName").val(),
desktopCnName: $("#desktopCnName").val()
desktopCnName: $("#desktopCnName").val(),
state: $("input[name='state']:checked").val(),
logo: $("#logo").find("input[name='upload']").attr("oldurl")
};
AjaxPostUtil.request({url: reqBasePath + "desktop002", params: params, type: 'json', callback: function(json) {
if (isNull(params.logo)) {
winui.window.msg('请上传图片', {icon: 2, time: 2000});
return false;
}
AjaxPostUtil.request({url: reqBasePath + "writeSysEveDesktopMation", params: params, type: 'json', method: "POST", callback: function(json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
......
......@@ -4,7 +4,7 @@ layui.config({
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
}).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
......@@ -13,19 +13,30 @@ layui.config({
showGrid({
id: "showForm",
url: reqBasePath + "desktop006",
params: {rowId:parent.rowId},
params: {id: parent.rowId},
pagination: false,
method: "GET",
template: $("#beanTemplate").html(),
ajaxSendAfter:function (json) {
$("input:radio[name=state][value=" + json.bean.state + "]").attr("checked", true);
// 初始化上传
$("#logo").upload(systemCommonUtil.uploadCommon003Config('logo', 12, json.bean.logo, 1));
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
rowId: parent.rowId,
id: parent.rowId,
desktopName: $("#desktopName").val(),
desktopCnName: $("#desktopCnName").val()
desktopCnName: $("#desktopCnName").val(),
state: $("input[name='state']:checked").val(),
logo: $("#logo").find("input[name='upload']").attr("oldurl")
};
AjaxPostUtil.request({url: reqBasePath + "desktop007", params: params, type: 'json', callback: function (json) {
if (isNull(params.logo)) {
winui.window.msg('请上传图片', {icon: 2, time: 2000});
return false;
}
AjaxPostUtil.request({url: reqBasePath + "writeSysEveDesktopMation", params: params, type: 'json', method: "POST", callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
......
......@@ -25,26 +25,35 @@ layui.config({
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ field: 'desktopName', title: '桌面名称', align: 'left', width: 120 },
{ field: 'desktopCnName', title: '英文名称', align: 'left', width: 120 },
{ field: 'allNum', title: '菜单数量', align: 'center', width: 120 },
{ field: 'state', title: '状态', width: 120, align: 'center', templet: function (d) {
if(d.state == '3'){
return "<span class='state-down'>下线</span>";
}else if(d.state == '2'){
return "<span class='state-up'>上线</span>";
{ field: 'desktopName', title: '桌面名称', align: 'left', width: 150 },
{ field: 'desktopCnName', title: '英文名称', align: 'left', width: 150 },
{ field: 'logo', title: 'LOGO', align: 'center', width: 60, templet: function (d) {
if(isNull(d.logo)){
return '<img src="../../assets/images/os_windows.png" class="photo-img">';
} else {
return '<img src="' + systemCommonUtil.getFilePath(d.logo) + '" class="photo-img" lay-event="logo">';
}
}},
{ field: 'allNum', title: '菜单数量', align: 'center', width: 100 },
{ field: 'orderBy', title: '序号', align: 'center', width: 80 },
{ field: 'state', title: '状态', width: 80, align: 'center', templet: function (d) {
if(d.state == '2'){
return "<span class='state-down'>禁用</span>";
}else if(d.state == '1'){
return "<span class='state-new'>新建</span>";
return "<span class='state-up'>启用</span>";
}
}},
{ field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 },
{ field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 357, toolbar: '#tableBar'}
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar'}
]],
done: function(){
done: function(json) {
matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入桌面名称", function () {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
});
}
});
......@@ -53,22 +62,20 @@ layui.config({
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'delet') { //删除
} else if (layEvent === 'delet') { //删除
delet(data);
}else if (layEvent === 'up') { //上线
up(data);
}else if (layEvent === 'down') { //下线
down(data);
}else if (layEvent === 'upMove') { //上移
} else if (layEvent === 'upMove') { //上移
upMove(data);
}else if (layEvent === 'downMove') { //下移
} else if (layEvent === 'downMove') { //下移
downMove(data);
}else if (layEvent === 'remove') { //一键移除菜单
} else if (layEvent === 'remove') { //一键移除菜单
remove(data);
} else if (layEvent === 'logo') { //logo预览
systemCommonUtil.showPicImg(systemCommonUtil.getFilePath(data.logo));
}
});
//添加
// 添加
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/sysEveDesktop/sysEveDesktopAdd.html",
......@@ -81,54 +88,30 @@ layui.config({
}});
});
//删除
// 删除
function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "desktop003", params:{rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "desktop003", params:{id: data.id}, type: 'json', method: "DELETE", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
//一键移除菜单
// 一键移除菜单
function remove(data){
var msg = '确认一键移除菜单选择该桌面的所有菜单吗?';
layer.confirm(msg, { icon: 3, title: '一键移除菜单' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "desktop012", params:{rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "desktop012", params: {id: data.id}, type: 'json', method: "POST", callback: function (json) {
winui.window.msg("移除成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
//上线
function up(data){
var msg = '确认上线选中数据吗?';
layer.confirm(msg, { icon: 3, title: '上线桌面名称' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "desktop004", params:{rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg("上线成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
//下线
function down(data){
var msg = '确认下线选中数据吗?';
layer.confirm(msg, { icon: 3, title: '下线桌面名称' }, function (index) {
layer.close(index);
AjaxPostUtil.request({url: reqBasePath + "desktop005", params:{rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg("下线成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
//编辑
// 编辑
function edit(data){
rowId = data.id;
_openNewWindows({
......@@ -143,43 +126,35 @@ layui.config({
});
}
//上移
// 上移
function upMove(data){
AjaxPostUtil.request({url: reqBasePath + "desktop008", params:{rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "desktop008", params: {id: data.id}, type: 'json', method: "POST", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
//下移
// 下移
function downMove(data){
AjaxPostUtil.request({url: reqBasePath + "desktop009", params:{rowId: data.id}, type: 'json', callback: function (json) {
AjaxPostUtil.request({url: reqBasePath + "desktop009", params: {id: data.id}, type: 'json', method: "POST", callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
//刷新数据
form.render();
// 刷新数据
$("body").on("click", "#reloadTable", function() {
loadTable();
});
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
}
return false;
});
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function getTableParams() {
return {
desktopName: $("#desktopName").val()
};
return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
}
exports('sysEveDesktopList', {});
......
......@@ -17,7 +17,6 @@ layui.config({
form = layui.form,
table = layui.table,
soulTable = layui.soulTable;
var selTemplate = getFileContent('tpl/template/select-option.tpl')
authBtn('1555562812681');
......
......@@ -12,18 +12,31 @@
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">基本信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">中文名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="desktopName" name="desktopName" win-verify="required" placeholder="请输入桌面名称" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">英文名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="desktopCnName" name="desktopCnName" win-verify="required" placeholder="请输入英文名称" class="layui-input"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">状态<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="state" value="1" title="启用" lay-filter="state" checked="checked" />
<input type="radio" name="state" value="2" title="禁用" lay-filter="state" />
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">logo<i class="red">*</i></label>
<div class="layui-input-block">
<div class="upload" id="logo"></div>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
......
......@@ -18,18 +18,31 @@
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">基本信息</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">中文名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="desktopName" name="desktopName" win-verify="required" placeholder="请输入桌面名称" class="layui-input" value="{{desktopName}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">英文名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="desktopCnName" name="desktopCnName" win-verify="required" placeholder="请输入英文名称" class="layui-input" value="{{desktopCnName}}"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">状态<i class="red">*</i></label>
<div class="layui-input-block winui-radio">
<input type="radio" name="state" value="1" title="启用" lay-filter="state" />
<input type="radio" name="state" value="2" title="禁用" lay-filter="state" />
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">logo<i class="red">*</i></label>
<div class="layui-input-block">
<div class="upload" id="logo"></div>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
......
......@@ -7,42 +7,21 @@
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">名称</label>
<div class="layui-input-inline">
<input type="text" id="desktopName" name="desktopName" placeholder="请输入桌面名称" class="layui-input" />
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn" auth="1563780633455"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
<button id="reloadTable" class="winui-toolbtn search-table-btn-right"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn search-table-btn-right" auth="1563780633455"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.state == 2 && auth('1563780674866')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="down">下线</a>
{{# }else if(d.state == 1 || d.state == 3){ }}
{{# if(auth('1563780689514')){ }}
{{# if(auth('1563780633455')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# if(auth('1563780661048')){ }}
<a class="layui-btn layui-btn-xs" lay-event="up">上线</a>
{{# } }}
{{# if(d.allNum == 0 && auth('1563780647628')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delet"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# } }}
{{# if(auth('1563780703264')){ }}
<a class="layui-btn layui-btn-xs" lay-event="upMove">上移</a>
{{# } }}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册