升级easyUI到1.9.4版本
This commit is contained in:
@@ -7,12 +7,12 @@
|
||||
<!-- 指定以IE8的方式来渲染 -->
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
|
||||
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui-1.3.5/themes/icon.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui/themes/default/easyui.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/js/easyui/themes/icon.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="/css/common.css"/>
|
||||
<script type="text/javascript" src="/js/jquery-1.8.0.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui/jquery.easyui.min.js"></script>
|
||||
<script type="text/javascript" src="/js/easyui/locale/easyui-lang-zh_CN.js"></script>
|
||||
<script type="text/javascript" src="/js/common/common.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -20,29 +20,26 @@
|
||||
<div id="tablePanel" class="easyui-panel" data-options="fit:true" style="padding:1px;top:300px;" title="收支项目" iconCls="icon-list">
|
||||
<table id="searchTable">
|
||||
<tr>
|
||||
<td>名 称:</td>
|
||||
<td>名称:</td>
|
||||
<td>
|
||||
<input type="text" name="searchName" id="searchName" style="width:70px;"/>
|
||||
<input type="text" name="searchName" id="searchName" class="easyui-textbox" style="width:100px;"/>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchTypeLabel">类 型:</td>
|
||||
<td id="searchTypeLabel">类型:</td>
|
||||
<td>
|
||||
<select name="searchType" id="searchType" style="width:70px;">
|
||||
<select name="searchType" id="searchType" class="easyui-combobox"
|
||||
data-options="panelHeight:'auto'" style="width:100px;">
|
||||
<option value="">全部</option>
|
||||
<option value="收入">收入</option>
|
||||
<option value="支出">支出</option>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td id="searchRemarkLabel">备 注:</td>
|
||||
<td id="searchRemarkLabel">备注:</td>
|
||||
<td>
|
||||
<input type="text" name="searchRemark" id="searchRemark" style="width:70px;"/>
|
||||
<input type="text" name="searchRemark" id="searchRemark" class="easyui-textbox" style="width:100px;"/>
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="searchBtn">查询</a>
|
||||
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-redo" id="searchResetBtn">重置</a>
|
||||
@@ -56,19 +53,20 @@
|
||||
<form id="inOutItemFM" method="post" novalidate>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="nameLabel">名 称</label>
|
||||
<input name="name" id="name" class="easyui-validatebox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width: 230px;height: 20px"/>
|
||||
<input name="name" id="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'length[2,30]'" style="width:230px;"/>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="typeLabel">类 型</label>
|
||||
<select name="type" id="type" style="width:230px;">
|
||||
<select name="type" id="type" class="easyui-combobox"
|
||||
data-options="panelHeight:'auto'" style="width:230px;">
|
||||
<option value="收入">收入</option>
|
||||
<option value="支出">支出</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="fitem" style="padding:5px">
|
||||
<label id="remarkLabel">备 注</label>
|
||||
<textarea name="remark" id="remark" rows="2" cols="2" style="width: 230px;"></textarea>
|
||||
<textarea name="remark" id="remark" class="easyui-textbox" data-options="multiline:true" style="width: 230px;height: 40px;"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -83,27 +81,8 @@
|
||||
$(function () {
|
||||
initTableData();
|
||||
ininPager();
|
||||
browserFit();
|
||||
});
|
||||
|
||||
//浏览器适配
|
||||
function browserFit() {
|
||||
if (getOs() == 'MSIE') {
|
||||
$("#searchTypeLabel").empty().append("类 型:");
|
||||
$("#searchRemarkLabel").empty().append("备 注:");
|
||||
$("#nameLabel").empty().append("名 称");
|
||||
$("#typeLabel").empty().append("类 型");
|
||||
$("#remarkLabel").empty().append("备 注");
|
||||
}
|
||||
else {
|
||||
$("#searchTypeLabel").empty().append("类 型:");
|
||||
$("#searchRemarkLabel").empty().append("备 注:");
|
||||
$("#nameLabel").empty().append("名 称");
|
||||
$("#typeLabel").empty().append("类 型");
|
||||
$("#remarkLabel").empty().append("备 注");
|
||||
}
|
||||
}
|
||||
|
||||
//初始化表格数据
|
||||
function initTableData() {
|
||||
$('#tableData').datagrid({
|
||||
@@ -136,11 +115,10 @@
|
||||
{title: '类型', field: 'type', width: 100, align: "center"},
|
||||
{title: '描述', field: 'remark', width: 200},
|
||||
{
|
||||
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 rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.type + 'AaBb' + rec.remark;
|
||||
str += '<img src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editInOutItem(\'' + rowInfo + '\');"/> <a onclick="editInOutItem(\'' + rowInfo + '\');" 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="deleteInOutItem(\'' + rowInfo + '\');"/> <a onclick="deleteInOutItem(\'' + rowInfo + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
str += '<img src="/js/easyui/themes/icons/pencil.png" style="cursor: pointer;" onclick="editInOutItem(\'' + index + '\');"/> <a onclick="editInOutItem(\'' + index + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">编辑</a> ';
|
||||
str += '<img src="/js/easyui/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteInOutItem(\'' + rec.id + '\');"/> <a onclick="deleteInOutItem(\'' + rec.id + '\');" style="text-decoration:none;color:black;" href="javascript:void(0)">删除</a> ';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
@@ -153,7 +131,7 @@
|
||||
handler: function () {
|
||||
addInOutItem();
|
||||
}
|
||||
},
|
||||
},'-',
|
||||
{
|
||||
id: 'deleteInOutItem',
|
||||
text: '删除',
|
||||
@@ -214,16 +192,15 @@
|
||||
}
|
||||
|
||||
//删除收支项目
|
||||
function deleteInOutItem(inOutItemInfo) {
|
||||
function deleteInOutItem(id) {
|
||||
$.messager.confirm('删除确认', '确定要删除此收支项目吗?', function (r) {
|
||||
if (r) {
|
||||
var inOutItemTotalInfo = inOutItemInfo.split("AaBb");
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/inOutItem/batchDeleteInOutItemByIds",
|
||||
dataType: "json",
|
||||
data: ({
|
||||
ids: inOutItemTotalInfo[0]
|
||||
ids: id
|
||||
}),
|
||||
success: function (res) {
|
||||
if(res && res.code == 200) {
|
||||
@@ -231,7 +208,7 @@
|
||||
} else {
|
||||
if(res && res.code == 601){
|
||||
var jsondata={};
|
||||
jsondata.ids=inOutItemTotalInfo[0];
|
||||
jsondata.ids=id;
|
||||
jsondata.deleteType='2';
|
||||
var type='single';
|
||||
batDeleteInOutItemForceConfirm(res,"/inOutItem/batchDeleteInOutItemByIds",jsondata,type);
|
||||
@@ -349,7 +326,7 @@
|
||||
if(checkPower()){
|
||||
return;
|
||||
}
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/> 增加收支项目');
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/edit_add.png"/> 增加收支项目');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#inOutItemFM').form('clear');
|
||||
|
||||
@@ -396,18 +373,18 @@
|
||||
});
|
||||
|
||||
//编辑收支项目
|
||||
function editInOutItem(inOutItemTotalInfo) {
|
||||
var inOutItemInfo = inOutItemTotalInfo.split("AaBb");
|
||||
function editInOutItem(index) {
|
||||
var rowsdata = $("#tableData").datagrid("getRows")[index];
|
||||
var row = {
|
||||
name: inOutItemInfo[1],
|
||||
type: inOutItemInfo[2],
|
||||
remark: inOutItemInfo[3]
|
||||
name: rowsdata.name,
|
||||
type: rowsdata.type,
|
||||
remark: rowsdata.remark
|
||||
};
|
||||
oldInOutItem = inOutItemInfo[1];
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/pencil.png"/> 编辑收支项目');
|
||||
oldInOutItem = rowsdata.name;
|
||||
$('#inOutItemDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui/themes/icons/pencil.png"/> 编辑收支项目');
|
||||
$(".window-mask").css({width: webW, height: webH});
|
||||
$('#inOutItemFM').form('load', row);
|
||||
inOutItemID = inOutItemInfo[0];
|
||||
inOutItemID = rowsdata.id;
|
||||
//焦点在名称输入框==定焦在输入文字后面
|
||||
$("#inOutItem").val("").focus().val(inOutItemInfo[1]);
|
||||
url = '/inOutItem/update?id=' + inOutItemInfo[0];
|
||||
@@ -501,7 +478,7 @@
|
||||
$("#searchResetBtn").unbind().bind({
|
||||
click: function () {
|
||||
$("#searchName").val("");
|
||||
$("#searchType").val("");
|
||||
$("#searchType").combobox("setValue","");
|
||||
$("#searchRemark").val("");
|
||||
//加载完以后重新初始化
|
||||
$("#searchBtn").click();
|
||||
|
||||
Reference in New Issue
Block a user