@model Gd.NetSign.Controllers.DTO.SysPamaterDTO
@{
ViewBag.Title = "SysPamatList";
//Layout = "~/Views/Masters/Frame.cshtml";
}
<script type="text/javascript">
//检索
function doSearch() { loading();
$.ajax({
type: "post",
url: '/Spfsz/SysPamatList?SysPamaterName=' + $('#SysPamaterName').val() + "&SysPamaterRemark=" + $('#SysPamaterRemark').val() + "&ParentKeyName=" + "@Model.ParentKeyName",
data: {},
dataType: "html",
error: function (msg) { unloading(); },
success: function (result) {
$("#List").html(result);
unloading(); }
}); }
//-->
//保存
function DoSave() {
loading("数据提交中...请稍后");
var previewOptions = {
url: "/Spfsz/SaveSysPamat?isOder=1&ParentKeyName=" + "@Model.ParentKeyName",
type: 'POST',
//data:_list: _list,
//beforeSubmit: submitCheck,
iframe: false,
success: function (result) {
unloading();
if (result.Success == true) { $.Ok(result.Msg, function () {
loading();
$.ajax({
type: "post",
url: "/Spfsz/SysPamatList?ParentKeyName=" + "@Model.ParentKeyName",
data: {},
dataType: "html",
error: function (msg) { unloading(); },
success: function (result) {
$("#List").html(result);
unloading(); }
});
});
}
if (result.Success == false) {
$.Error(result.Msg);
}
},
error: function () {
unloading();
}
};
$("#OperaForm").ajaxSubmit(previewOptions);
return false;
}
//保存
function DoSaveSingle() {
loading("数据提交中...请稍后");
var previewOptions = {
url: "/Spfsz/SaveSysPamat?ParentKeyName=" + "@Model.ParentKeyName",
type: 'POST',
//data:_list: _list,
//beforeSubmit: submitCheck,
iframe: false,
success: function (result) {
unloading();
if (result.Success == true) { $.Ok(result.Msg, function () {
loading();
$.ajax({
type: "post",
url: "/Spfsz/SysPamatList?ParentKeyName=" + "@Model.ParentKeyName",
data: {},
dataType: "html",
error: function (msg) { unloading(); },
success: function (result) {
$("#List").html(result);
unloading(); }
});
});
}
if (result.Success == false) {
$.Error(result.Msg);
}
},
error: function () {
unloading();
}
};
$("#OperaForm").ajaxSubmit(previewOptions);
return false;
} </script>
<style>
tr input {
border: hidden;
background-color: transparent;
width: 100%;
height: 20px;
margin-left: 2px;
} table tr td {
text-align: left;
}
</style> <div class="div_btnContainer">
<span>参数名:</span><input id="SysPamaterName" class="txt" type="text" value="@Model.SysPamaterName" />
<span>参数说明:</span><input id="SysPamaterRemark" class="txt" type="text" value="@Model.SysPamaterRemark" />
<input type="button" class="btn" value="检索" onclick="doSearch();" /> <input type="button" id="upMove" value="上移" @(Model.IsNullField == 1 ? "class=btn" : " class=btn_disable disabled=disabled") onclick="up_exchange_line();" />
<input type="button" id="DmMove" value="下移" @(Model.IsNullField == 1 ? "class=btn" : " class=btn_disable disabled=disabled ") onclick="down_exchange_line();" />
<input type="button" class="btn" value="保存" @(Model.IsNullField == 1 ? "onclick=DoSave()" : "onclick=DoSaveSingle()") />
</div>
<form id="OperaForm" method="post" action="" enctype="multipart/form-data">
<div class="form">
<table id="floorHouse" cellpadding="1" cellspacing="1" class="tabClass">
<thead>
<tr>
<th style="width: 20px" title="选择">选择</th>
<th style="width: 50px;" title="参数名">参数名</th>
<th style="width: 100px;" title="参数值">参数值</th>
<th style="width: 300px;" title="参数说明">参数说明</th> </tr>
</thead>
<tbody>
@{string line = "";
var listLength = Model.SysPamaterList.Count();
for (int i = 0; i < listLength; i++)
{
line = "line" + (i + 1);
<tr id="@line"> <td>
<input name="[@(i)].NodeIdx" id="subcheck" onclick="chk(this);" type="checkbox" value="@(i+1)" />
<input hidden="hidden" name="[@(i)].NodeIdx" id="NodeIdx" type="text" value="@(i+1)" />
</td>
<td title="@Model.SysPamaterList[i].KeyName" id="cknull">
<input type="text" id="KeyName" readonly="readonly" name="[@(i)].KeyName" value="@Model.SysPamaterList[i].KeyName" />
</td>
<td title="@Model.SysPamaterList[i].KeyValue" id="cknull">
<input type="text" id="KeyValue" name="[@(i)].KeyValue" value="@Model.SysPamaterList[i].KeyValue" />
</td>
<td title="@Model.SysPamaterList[i].KeyDis" id=" cknull">
<input type="text" id="KeyDis" readonly="readonly" name="[@(i)].KeyDis" value="@Model.SysPamaterList[i].KeyDis" />
<input type="text" id="IsNewNetSign" hidden="hidden" name="[@(i)].IsNewNetSign" value="@Model.SysPamaterList[i].IsNewNetSign" /> </td>
</tr>
}
}
</tbody>
</table> </div>
</form> <script language="javascript"> var currentStep = new Array();
var max_line_num = parseInt("@Model.SysPamaterList.Count()");
//上移
function up_exchange_line() {
if (!checks())
return;
//升序
currentStep.sort(function (a, b) { return a > b ? 1 : -1 });
for (var i = 0; i < currentStep.length; i++) {
if (currentStep[i] == 0 || currentStep[i] == null) {
continue;
}
else {
var upStep = currentStep[i] - 1;
if (upStep < 1 || $('#line' + upStep + ' input[type="checkbox"]').attr("checked")) {
continue;
}
//取值
var keynameNext = $("#line" + upStep + " input[id='KeyName']").val();
var keyvalueNext = $("#line" + upStep + " input[id='KeyValue']").val();
var KeyDisNext = $("#line" + upStep + " input[id='KeyDis']").val();
var IsNewNetSignNext = $("#line" + upStep + " input[id='IsNewNetSign']").val();
var keyname = $("#line" + currentStep[i] + " input[id='KeyName']").val();
var keyvalue = $("#line" + currentStep[i] + " input[id='KeyValue']").val();
var KeyDis = $("#line" + currentStep[i] + " input[id='KeyDis']").val();
var IsNewNetSign = $("#line" + currentStep[i] + " input[id='IsNewNetSign']").val();
//换值
$("#line" + upStep + " input[id='KeyName']").val(keyname);
$("#line" + upStep + " input[id='KeyValue']").val(keyvalue);
$("#line" + upStep + " input[id='KeyDis']").val(KeyDis);
$("#line" + upStep + " input[id='IsNewNetSign']").val(IsNewNetSign);
$("#line" + currentStep[i] + " input[id='KeyName']").val(keynameNext);
$("#line" + currentStep[i] + " input[id='KeyValue']").val(keyvalueNext);
$("#line" + currentStep[i] + " input[id='KeyDis']").val(KeyDisNext);
$("#line" + currentStep[i] + " input[id='IsNewNetSign']").val(IsNewNetSignNext);
//修改选中
$('#line' + upStep + ' input[type="checkbox"]').attr("checked", true);
$('#line' + currentStep[i] + ' input[type="checkbox"]').attr("checked", false);
currentStep[i] = upStep; } } }
//下移
function down_exchange_line() {
if (!checks())
return;
//倒序
currentStep.sort(function (a, b) { return a < b ? 1 : -1 });
for (var i = 0; i < currentStep.length; i++) {
if (currentStep[i] == "0" || currentStep[i] == null) {
continue; }
else { var nextStep = parseInt(currentStep[i]) + 1;
if (nextStep > max_line_num || $('#line' + nextStep + ' input[type="checkbox"]').attr("checked")) {
continue;
}
//取值
var keynameNext = $("#line" + nextStep + " input[id='KeyName']").val();
var keyvalueNext = $("#line" + nextStep + " input[id='KeyValue']").val();
var KeyDisNext = $("#line" + nextStep + " input[id='KeyDis']").val();
var IsNewNetSignNext = $("#line" + nextStep + " input[id='IsNewNetSign']").val();
var keyname = $("#line" + currentStep[i] + " input[id='KeyName']").val();
var keyvalue = $("#line" + currentStep[i] + " input[id='KeyValue']").val();
var KeyDis = $("#line" + currentStep[i] + " input[id='KeyDis']").val();
var IsNewNetSign = $("#line" + currentStep[i] + " input[id='IsNewNetSign']").val();
//换值
$("#line" + nextStep + " input[id='KeyName']").val(keyname);
$("#line" + nextStep + " input[id='KeyValue']").val(keyvalue);
$("#line" + nextStep + " input[id='KeyDis']").val(KeyDis);
$("#line" + nextStep + " input[id='IsNewNetSign']").val(IsNewNetSign);
$("#line" + currentStep[i] + " input[id='KeyName']").val(keynameNext);
$("#line" + currentStep[i] + " input[id='KeyValue']").val(keyvalueNext);
$("#line" + currentStep[i] + " input[id='KeyDis']").val(KeyDisNext);
$("#line" + currentStep[i] + " input[id='IsNewNetSign']").val(IsNewNetSignNext);
//修改选中
$('#line' + nextStep + ' input[type="checkbox"]').attr("checked", true);
$('#line' + currentStep[i] + ' input[type="checkbox"]').attr("checked", false);
currentStep[i] = nextStep; }
}
}
//增加减少id值
function chk(box) {
if ($(box).attr("checked") == "checked") {
//currentStep.push($(box).parent().parent().find("td").eq(0).text())
currentStep.push(parseInt($(box).val()));
}
else { for (var i = 0; i < currentStep.length; i++) {
if (currentStep[i] == $(box).val()) {
currentStep.remove(i);
//.remove(i);
} } } }
Array.prototype.remove = function (dx) {
if (isNaN(dx) || dx > this.length) { return false; }
for (var i = 0, n = 0; i < this.length; i++) {
if (this[i] != this[dx]) {
this[n++] = this[i]
}
}
this.length -= 1
}
function checks() {
var chk_value = [];
$('input:checked').each(function () {
chk_value.push($(this).val());
});
if (chk_value.length <= 0) {
//alert("请选择一条数据");
$.Warning('请选择一条数据!');
return false; }
return true;
}
</script>

最新文章

  1. HDU4738 tarjan割边|割边、割点模板
  2. SQL Server通过File Header Page来进行Crash Recovery
  3. C语言的基本输入与输出函数
  4. windows 环境下wamp环境的搭建。
  5. TimeVal类——Live555源码阅读(一)基本组件类
  6. input , textarea 边框问题
  7. (实用篇)php通过会话控制实现身份验证实例
  8. linux tar命令
  9. 关于一个注册邮箱的demo
  10. mybatis学习笔记第一讲
  11. Python 模块的一般处理
  12. shiro.ini 配置详解
  13. MongoDB学习总结(六) —— 数据库备份和恢复
  14. Java并发包之同步队列SynchronousQueue理解
  15. 乌班图平台kurento +kurento-one2many-call+videojs-panorama+RICOH THETA实现VR直播
  16. EXCLE 导入 或 导出
  17. 栈-&gt;栈的应用
  18. 剑指offer 5.栈和队列 用两个栈实现队列
  19. centos7.4_x86_64安装grafana5.2.1并安装常用zabbix插件
  20. python与redis

热门文章

  1. nodejs 中es5 模块的几种写法
  2. [SOJ] DAG?
  3. ECOS-Ecstore证书生产失效问题排查
  4. uitextfield银行卡加空格
  5. SharpZipLib.dll 压缩文件,可以应用于MVC, webform. C# windows application 等等地方
  6. ionic中$ionicPopover和$ionicModal
  7. Openlayer 3 的点击弹出框
  8. Sql Server尝试读取或写入受保护的内存。这通常指示其他内存已损坏
  9. Spring MVC(一)
  10. 关于并行计算的Scan操作