修改功能管理js效率低下的问题
This commit is contained in:
@@ -173,11 +173,11 @@
|
|||||||
},
|
},
|
||||||
{title: '类型', field: 'type', width: 50},
|
{title: '类型', field: 'type', width: 50},
|
||||||
{
|
{
|
||||||
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec) {
|
title: '操作', field: 'op', align: "center", width: 130, formatter: function (value, rec,index) {
|
||||||
var str = '';
|
var str = '';
|
||||||
var rowInfo = rec.id + 'AaBb' + rec.number + 'AaBb' + rec.name + 'AaBb' + rec.pnumber + 'AaBb' + rec.url
|
// var rowInfo = rec.id + 'AaBb' + rec.number + 'AaBb' + rec.name + 'AaBb' + rec.pnumber + 'AaBb' + rec.url
|
||||||
+ 'AaBb' + rec.state + 'AaBb' + rec.sort + 'AaBb' + rec.enabled + 'AaBb' + rec.type + 'AaBb' + rec.pushbtn;
|
// + 'AaBb' + rec.state + 'AaBb' + rec.sort + 'AaBb' + rec.enabled + 'AaBb' + rec.type + 'AaBb' + rec.pushbtn;
|
||||||
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editFunctions(\'' + rowInfo + '\');"/> <a onclick="editFunctions(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editFunctions(\'' + index + '\');"/> <a onclick="editFunctions(\'' + index + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||||
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteFunctions(' + rec.id + ');"/> <a onclick="deleteFunctions(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
str += '<img src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteFunctions(' + rec.id + ');"/> <a onclick="deleteFunctions(' + rec.id + ');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
@@ -386,19 +386,20 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//编辑信息
|
//编辑信息
|
||||||
function editFunctions(functionsTotalInfo) {
|
function editFunctions(index) {
|
||||||
var functionsInfo = functionsTotalInfo.split("AaBb");
|
// var functionsInfo = functionsTotalInfo.split("AaBb");
|
||||||
|
var rowsdata = $("#tableData").datagrid("getRows")[index];
|
||||||
$("#Number").focus().val(functionsInfo[1]);
|
$("#Number").focus().val(rowsdata.number);
|
||||||
$("#Name").focus().val(functionsInfo[2]);
|
$("#Name").focus().val(rowsdata.name);
|
||||||
$("#PNumber").focus().val(functionsInfo[3]);
|
$("#PNumber").focus().val(rowsdata.pnumber);
|
||||||
$("#URL").focus().val(functionsInfo[4]);
|
$("#URL").focus().val(rowsdata.url);
|
||||||
$("#State").attr("checked", functionsInfo[5] == 'true' ? true : false);
|
$("#State").attr("checked", rowsdata.state === true ? true : false);
|
||||||
$("#Sort").focus().val(functionsInfo[6]);
|
$("#Sort").focus().val(rowsdata.sort);
|
||||||
$("#Enabled").attr("checked", functionsInfo[7] == 'true' ? true : false);
|
$("#Enabled").attr("checked", rowsdata.enabled === true ? true : false);
|
||||||
$("#Type").focus().val(functionsInfo[8]);
|
$("#Type").focus().val(rowsdata.type);
|
||||||
if (functionsInfo[9] !== "undefined" && functionsInfo[9] !== "") {
|
var pushbtn=rowsdata.pushbtn;
|
||||||
var arr = functionsInfo[9].split(",");
|
if (pushbtn !== "undefined" && pushbtn !== "") {
|
||||||
|
var arr = pushbtn.split(",");
|
||||||
var pushBtnArray = [];
|
var pushBtnArray = [];
|
||||||
for (var i = 0; i < arr.length; i++) {
|
for (var i = 0; i < arr.length; i++) {
|
||||||
if (arr[i]) {
|
if (arr[i]) {
|
||||||
@@ -413,13 +414,13 @@
|
|||||||
$("#PushBtn").combobox('setValues', '');
|
$("#PushBtn").combobox('setValues', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
oldFunctions = functionsInfo[2];
|
oldFunctions = rowsdata.name;
|
||||||
$('#functionsDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑功能信息');
|
$('#functionsDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑功能信息');
|
||||||
$(".window-mask").css({width: webW, height: webH});
|
$(".window-mask").css({width: webW, height: webH});
|
||||||
functionsID = functionsInfo[0];
|
functionsID = rowsdata.id;
|
||||||
//焦点在名称输入框==定焦在输入文字后面
|
//焦点在名称输入框==定焦在输入文字后面
|
||||||
$("#Name").val("").focus().val(functionsInfo[2]);
|
$("#Name").val("").focus().val(rowsdata.name);
|
||||||
url = '/functions/update?id=' + functionsInfo[0];
|
url = '/functions/update?id=' + rowsdata.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
//检查名称是否存在 ++ 重名无法提示问题需要跟进
|
||||||
|
|||||||
Reference in New Issue
Block a user