123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>系统设置表维护</title>
- <link href="~/easyui/themes/default/easyui.css" rel="stylesheet" />
- <link rel="stylesheet" type="text/css" href="~/easyui/themes/icon.css" />
- <link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
- <link href="~/Content/js/plugins/layer/skin/layer.css" rel="stylesheet" />
- <script src="~/Content/js/jquery.min.js"></script>
- <script src="~/Content/js/bootstrap.min.js"></script>
- <script src="~/easyui/jquery.easyui.min.js"></script>
- <script src="~/easyui/jquery.easyui.mobile.js"></script>
- <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
- <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
- <script src="~/Content/js/plugins/layer/layer.min.js"></script>
- <script src="~/js/Utils.js"></script>
- <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
- <script src="~/Content/js/SystemModule/SysSetting.js"></script>
- <style>
- .td_1{
- padding-bottom:5px;
- padding-left:5px
- }
- </style>
- </head>
- <body>
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
-
- </section>
- <section class="container-fluid" style="height: 100vh; padding-top: 20px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar" id="CurdTool" style="float:left">
- <a href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true" id="btnRefresh">强制刷新</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-no" plain="true" onclick="btn_Del()">删除</a>
- </div>
- </div>
- <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- toolbar: '#tbToolBar',
- fitColumns: true,
- @*rownumbers: true,*@
- remoteSort: false,
- loadFilter: pagerFilter,
- onDblClickRow: function () {
- btn_Edit();
- },
- pagination: true,
- pageSize: 100,
- pageList: [15, 25, 50, 100]">
- <thead>
- <tr>
- <th data-options="field:'SysSetCode',width:100">系统设置键</th>
- <th data-options="field:'SysSetValue',width:150">系统设置值</th>
- <th data-options="field:'Remark',width:150,">备注</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winSetSysSettingInfo" class="easyui-window" title="系统配置信息维护" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:600px;height:350px;padding:10px 10px;">
- <div class="easyui-layout" data-options="fit:true">
- <div data-options="region:'center'" style="padding:5px;height:250px">
- <table cellpadding="10" cellspacing="0" style="margin-left:10px">
- <tr>
- <td class="td_1">系统设置键:</td>
- <td class="td_1"><input class="easyui-textbox" type="text" id="SysSetCode" name="SysSetCode" data-options="required:true" style="width:400px" /></td>
- </tr>
- <tr>
- <td class="td_1">系统设置值:</td>
- <td class="td_1"><input class="easyui-textbox" type="text" id="SysSetValue" name="SysSetValue" data-options="required:true" style="width:400px" /></td>
- </tr>
- <tr>
- <td class="td_1">备注说明:</td>
- <td class="td_1"><textarea placeholder="请输入内容" class="easyui-textarea" rows="5" name="Remark" id="Remark" style="width:400px"></textarea></td>
- </tr>
- </table>
- </div>
- <div data-options="region:'south',border:false" style="text-align:right;height:50px;padding-top:5px">
- <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save();" style="width:80px">确认</a>
- <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winSetSysSettingInfo').window('close');" style="width:80px">取消</a>
- </div>
- </div>
- </div>
- </section>
- <script>
- //添加
- function btn_Add() {
- $("#hid_Type").val("Add");
-
- $("#SysSetCode").textbox("enable");
- // $("#modal .modal-title").html("添加");
- //$("#modal").modal("show");
- $("#SysSetCode").textbox('setValue', '');
- $("#SysSetValue").textbox('setValue', '');
- $("#Remark").val('');
- $('#winSetSysSettingInfo').window('open');
- }
- //修改
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- // $("#modal .modal-title").html("修改");
- //window.SetModalVal();
- var row = $('#dgTable').datagrid('getSelected');
- if (row) {
- $("#SysSetCode").textbox('setValue',row.SysSetCode);
- $("#SysSetValue").textbox('setValue', row.SysSetValue);
- $("#Remark").val(row.Remark);
- $("#SysSetCode").textbox("disable");
- $('#winSetSysSettingInfo').window('open');
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- //删除
- function btn_Del() {
- //询问框
- layer.confirm('确认删除这条记录?', {
- btn: ['确认删除', '取消'] //按钮
- }, function () {
- Save('Del');
- })
- }
- //提交
- function Save(type) {
- type = type || $("#hid_Type").val();
- var SysSetCode = (type === "Add" || type === "Edit") ? $("#SysSetCode").textbox('getValue') : $('#dgTable').datagrid('getSelections')[0].SysSetCode;
- $.ajax({
- url: "@Url.Action("SysSettingListOper", "SystemModule")",
- type: "post",
- dataType:'json',
- data: {
- Type: type,
- SysSetCode: SysSetCode,
- SysSetValue: $("#SysSetValue").textbox('getValue'),
- Remark: $("#Remark").val()
- },
- success: function (data) {
- if (CheckAajxData(data) == false) return;
- var msg = data.ErrorInfo;
- if (data.Success === true) {
- LoadTable();
- $("#winSetSysSettingInfo").window("close");
- layer.alert(msg, { icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg, { icon: 7, title: '提示信息' });
- }
- }
- });
- }
- //modal赋值
- function SetModalVal() {
- var rows = $('#dgTable').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- //console.log(row);
- $("#SysSetCode").val(row.SysSetCode).attr("readonly", "readonly");
- $("#SysSetValue").val(row.SysSetValue);
- $("#Remark").val(row.Remark);
- $("#modal").modal("show");
- } else {
- layer.alert('请选择一条记录进行设置', {title:'提示信息'});
- }
- }
- //加载表格数据
- function LoadTable() {
- $('#dgTable').datagrid({
- url: '@Url.Action("GetSysSettingListResult", "SystemModule")'
- });
- }
- $(function () {
- //加载表格数据
- window.LoadTable();
- ////加载日历控件
- //laydate({
- // elem: '#PractiseTime',
- // format: "YYYY-MM-DD",
- // min: "1980-01-01",
- // event: "focus"
- //});
- $("#btnRefresh").click(function () {
- $.ajax({
- url: "@Url.Action("SysSettingListReload", "SystemModule")",
- type: "post",
- dataType:'json',
- success: function (data) {
- if (CheckAajxData(data) == false) return;
- if (data.Success === true) {
- LoadTable();
- $("#winSetSysSettingInfo").window("close");
- layer.alert(msg, { icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg, { icon: 7, title: '提示信息' });
- }
- }
- });
- })
- });
- </script>
- </body>
- </html>
|