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

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

上级 881ded87
...@@ -4,21 +4,29 @@ layui.config({ ...@@ -4,21 +4,29 @@ layui.config({
version: skyeyeVersion version: skyeyeVersion
}).extend({ }).extend({
window: 'js/winui.window' window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) { }).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) {
winui.renderColor(); winui.renderColor();
layui.use(['form'], function (form) { layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$; var $ = layui.$;
// 初始化上传
$("#logo").upload(systemCommonUtil.uploadCommon003Config('logo', 12, '', 1));
matchingLanguage(); matchingLanguage();
form.render(); form.render();
form.on('submit(formAddBean)', function (data) { form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
desktopName: $("#desktopName").val(), 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.layer.close(index);
parent.refreshCode = '0'; parent.refreshCode = '0';
}}); }});
......
...@@ -4,7 +4,7 @@ layui.config({ ...@@ -4,7 +4,7 @@ layui.config({
version: skyeyeVersion version: skyeyeVersion
}).extend({ }).extend({
window: 'js/winui.window' window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) { }).define(['window', 'jquery', 'winui', 'fileUpload'], function (exports) {
winui.renderColor(); winui.renderColor();
layui.use(['form'], function (form) { layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); var index = parent.layer.getFrameIndex(window.name);
...@@ -13,19 +13,30 @@ layui.config({ ...@@ -13,19 +13,30 @@ layui.config({
showGrid({ showGrid({
id: "showForm", id: "showForm",
url: reqBasePath + "desktop006", url: reqBasePath + "desktop006",
params: {rowId:parent.rowId}, params: {id: parent.rowId},
pagination: false, pagination: false,
method: "GET",
template: $("#beanTemplate").html(), template: $("#beanTemplate").html(),
ajaxSendAfter:function (json) { 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(); matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) { form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var params = { var params = {
rowId: parent.rowId, id: parent.rowId,
desktopName: $("#desktopName").val(), 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.layer.close(index);
parent.refreshCode = '0'; parent.refreshCode = '0';
}}); }});
......
...@@ -25,50 +25,57 @@ layui.config({ ...@@ -25,50 +25,57 @@ layui.config({
limit: getLimit(), limit: getLimit(),
cols: [[ cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'}, { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ field: 'desktopName', title: '桌面名称', align: 'left', width: 120 }, { field: 'desktopName', title: '桌面名称', align: 'left', width: 150 },
{ field: 'desktopCnName', title: '英文名称', align: 'left', width: 120 }, { field: 'desktopCnName', title: '英文名称', align: 'left', width: 150 },
{ field: 'allNum', title: '菜单数量', align: 'center', width: 120 }, { field: 'logo', title: 'LOGO', align: 'center', width: 60, templet: function (d) {
{ field: 'state', title: '状态', width: 120, align: 'center', templet: function (d) { if(isNull(d.logo)){
if(d.state == '3'){ return '<img src="../../assets/images/os_windows.png" class="photo-img">';
return "<span class='state-down'>下线</span>"; } else {
}else if(d.state == '2'){ return '<img src="' + systemCommonUtil.getFilePath(d.logo) + '" class="photo-img" lay-event="logo">';
return "<span class='state-up'>上线</span>"; }
}},
{ 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'){ }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: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 120 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, { 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: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 },
{ field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150}, { 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(); matchingLanguage();
initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入桌面名称", function () {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
});
} }
}); });
table.on('tool(messageTable)', function (obj) { table.on('tool(messageTable)', function (obj) {
var data = obj.data; var data = obj.data;
var layEvent = obj.event; var layEvent = obj.event;
if (layEvent === 'edit') { //编辑 if (layEvent === 'edit') { //编辑
edit(data); edit(data);
}else if (layEvent === 'delet') { //删除 } else if (layEvent === 'delet') { //删除
delet(data); delet(data);
}else if (layEvent === 'up') { //上线 } else if (layEvent === 'upMove') { //上移
up(data); upMove(data);
}else if (layEvent === 'down') { //下线 } else if (layEvent === 'downMove') { //下移
down(data); downMove(data);
}else if (layEvent === 'upMove') { //上移 } else if (layEvent === 'remove') { //一键移除菜单
upMove(data); remove(data);
}else if (layEvent === 'downMove') { //下移 } else if (layEvent === 'logo') { //logo预览
downMove(data); systemCommonUtil.showPicImg(systemCommonUtil.getFilePath(data.logo));
}else if (layEvent === 'remove') { //一键移除菜单 }
remove(data);
}
}); });
//添加 // 添加
$("body").on("click", "#addBean", function() { $("body").on("click", "#addBean", function() {
_openNewWindows({ _openNewWindows({
url: "../../tpl/sysEveDesktop/sysEveDesktopAdd.html", url: "../../tpl/sysEveDesktop/sysEveDesktopAdd.html",
...@@ -81,54 +88,30 @@ layui.config({ ...@@ -81,54 +88,30 @@ layui.config({
}}); }});
}); });
//删除 // 删除
function delet(data){ function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){ layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(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}); winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable(); loadTable();
}}); }});
}); });
} }
//一键移除菜单 // 一键移除菜单
function remove(data){ function remove(data){
var msg = '确认一键移除菜单选择该桌面的所有菜单吗?'; var msg = '确认一键移除菜单选择该桌面的所有菜单吗?';
layer.confirm(msg, { icon: 3, title: '一键移除菜单' }, function (index) { layer.confirm(msg, { icon: 3, title: '一键移除菜单' }, function (index) {
layer.close(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}); winui.window.msg("移除成功", {icon: 1, time: 2000});
loadTable(); 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){ function edit(data){
rowId = data.id; rowId = data.id;
_openNewWindows({ _openNewWindows({
...@@ -143,43 +126,35 @@ layui.config({ ...@@ -143,43 +126,35 @@ layui.config({
}); });
} }
//上移 // 上移
function upMove(data){ 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}); winui.window.msg(systemLanguage["com.skyeye.moveUpOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable(); loadTable();
}}); }});
} }
//下移 // 下移
function downMove(data){ 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}); winui.window.msg(systemLanguage["com.skyeye.moveDownOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable(); loadTable();
}}); }});
} }
//刷新数据 form.render();
// 刷新数据
$("body").on("click", "#reloadTable", function() { $("body").on("click", "#reloadTable", function() {
loadTable(); 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(){ function loadTable(){
table.reload("messageTable", {where: getTableParams()}); table.reload("messageTable", {where: getTableParams()});
} }
function getTableParams() { function getTableParams() {
return { return $.extend(true, {}, initTableSearchUtil.getSearchValue("messageTable"));
desktopName: $("#desktopName").val()
};
} }
exports('sysEveDesktopList', {}); exports('sysEveDesktopList', {});
......
...@@ -17,8 +17,7 @@ layui.config({ ...@@ -17,8 +17,7 @@ layui.config({
form = layui.form, form = layui.form,
table = layui.table, table = layui.table,
soulTable = layui.soulTable; soulTable = layui.soulTable;
var selTemplate = getFileContent('tpl/template/select-option.tpl')
authBtn('1555562812681'); authBtn('1555562812681');
var bodyList = new Array(); var bodyList = new Array();
......
...@@ -12,18 +12,31 @@ ...@@ -12,18 +12,31 @@
<div class="layui-form-item layui-col-xs12"> <div class="layui-form-item layui-col-xs12">
<span class="hr-title">基本信息</span><hr> <span class="hr-title">基本信息</span><hr>
</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> <label class="layui-form-label">中文名称<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="desktopName" name="desktopName" win-verify="required" placeholder="请输入桌面名称" class="layui-input"/> <input type="text" id="desktopName" name="desktopName" win-verify="required" placeholder="请输入桌面名称" class="layui-input"/>
</div> </div>
</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> <label class="layui-form-label">英文名称<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="desktopCnName" name="desktopCnName" win-verify="required" placeholder="请输入英文名称" class="layui-input"/> <input type="text" id="desktopCnName" name="desktopCnName" win-verify="required" placeholder="请输入英文名称" class="layui-input"/>
</div> </div>
</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-form-item layui-col-xs12">
<div class="layui-input-block"> <div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button> <button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
......
...@@ -18,18 +18,31 @@ ...@@ -18,18 +18,31 @@
<div class="layui-form-item layui-col-xs12"> <div class="layui-form-item layui-col-xs12">
<span class="hr-title">基本信息</span><hr> <span class="hr-title">基本信息</span><hr>
</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> <label class="layui-form-label">中文名称<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="desktopName" name="desktopName" win-verify="required" placeholder="请输入桌面名称" class="layui-input" value="{{desktopName}}"/> <input type="text" id="desktopName" name="desktopName" win-verify="required" placeholder="请输入桌面名称" class="layui-input" value="{{desktopName}}"/>
</div> </div>
</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> <label class="layui-form-label">英文名称<i class="red">*</i></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="desktopCnName" name="desktopCnName" win-verify="required" placeholder="请输入英文名称" class="layui-input" value="{{desktopCnName}}"/> <input type="text" id="desktopCnName" name="desktopCnName" win-verify="required" placeholder="请输入英文名称" class="layui-input" value="{{desktopCnName}}"/>
</div> </div>
</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-form-item layui-col-xs12">
<div class="layui-input-block"> <div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button> <button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
......
...@@ -7,41 +7,20 @@ ...@@ -7,41 +7,20 @@
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" /> <link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head> </head>
<body> <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-toolbar">
<div class="winui-tool"> <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="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" auth="1563780633455"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></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> </div>
<div style="margin:auto 10px;"> <div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table> <table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar"> <script type="text/html" id="tableBar">
{{# if(d.state == 2 && auth('1563780674866')){ }} {{# if(auth('1563780633455')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="down">下线</a> <a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# }else if(d.state == 1 || d.state == 3){ }} {{# } }}
{{# if(auth('1563780689514')){ }} {{# if(d.allNum == 0 && auth('1563780647628')){ }}
<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a> <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delet"><language showName="com.skyeye.deleteBtn"></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')){ }} {{# if(auth('1563780703264')){ }}
<a class="layui-btn layui-btn-xs" lay-event="upMove">上移</a> <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.
先完成此消息的编辑!
想要评论请 注册