123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>LawRuleList</title>
- <link href="~/easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
- <link href="~/easyui/themes/icon.css" rel="stylesheet" />
- <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="~/Content/plugins/ajaxFileUpload/ajaxFileUpload-M.js"></script>
- <script src="~/js/Utils.js"></script>
- <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
- <link href="~/Content/kindeditor-master/themes/default/default.css" rel="stylesheet" />
- <script src="~/Content/kindeditor-master/kindeditor-all.js"></script>
- <script src="~/Content/kindeditor-master/kindeditor-all-min.js"></script>
- <script src="~/Content/kindeditor-master/lang/zh-CN.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" />
- <input id="hid_RuleType" name="hid_RuleType" type="hidden" value="@ViewBag.RuleType" />
- <input id="hid_IsAdd" name="hid_RuleType" type="hidden" value="@ViewBag.IsAdd" />
- <input id="hid_IsUpdate" name="hid_RuleType" type="hidden" value="@ViewBag.IsUpdate" />
- <input id="hid_IsDelete" name="hid_RuleType" type="hidden" value="@ViewBag.IsDelete" />
- </section>
- @*<section class="text-center title">
- <h2>市场信息</h2>
- </section>*@
- <section class="container-fluid" style="height: 95vh; padding-top: 5px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar" id="CurdTool" style="float:left">
- <a href="#" class="easyui-linkbutton" id="btn_Add" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
-
- <a href="#" class="easyui-linkbutton" id="btn_Update" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
-
- <a href="#" class="easyui-linkbutton" id="btn_Delete" iconCls="icon-remove" 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,
- pagination: true,
- pageSize: 25,
- pageList: [15, 25, 50, 100]
- ">
- <thead>
- <tr>
- @*hid_IsLock<th data-options="field:'TradeTypeID'" class="hidden">行业类型</th>*@
- <th data-options="field:'LawRuleName',width:80,align:'center'">标题</th>
- <th data-options="field:'promulgateDate',width:80,align:'center'">发布日期</th>
- <th data-options="field:'lawruleType',width:80,align:'center'">法规类型</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winModal" class="easyui-window winModal" title="法规文本维护" style="width: 650px; height:450px;padding:5px;"
- iconCls="icon-save" data-options="modal:true,closed:true">
- <div class="easyui-layout" data-options="fit:true" style="height:400px">
- <div data-options="region:'center'" style="padding:5px 5px 1px; height:385px">
- <table cellpadding="10" cellspacing="0" style="margin-left:10px">
- <tr>
- <td class="td_1">法规类型</td>
- <td class="td_1">
- <select class="easyui-combobox" id="LawRuleTypeId" name="LawRuleTypeId" style="width:400px;height:20px" >
- @Html.Raw(ViewBag.SelLawRuleType)
- </select>
- </td>
- </tr>
- <tr>
- <td class="td_1">名称</td>
- <td class="td_1">
- <input class="easyui-textbox" type="text" id="LawRuleName" name="LawRuleName" data-options="required:true" style="width:400px;height:20px" />
- </td>
- </tr>
- <tr>
- <td class="td_1">发布日期</td>
- <td class="td_1">
- <input class="laydate-icon" type="text" id="promulgateDate" name="promulgateDate" data-options="required:true" style="width:400px;height:20px" />
- </td>
- </tr>
- <tr>
- <td class="td_1">发 布 者</td>
- <td class="td_1">
- <input class="easyui-textbox" type="text" id="promulgator" name="promulgator" data-options="required:true" style="width:400px;height:20px" />
- </td>
- </tr>
- <tr>
- <td class="td_1">上传附件</td>
- <td class="td_1">
- <input class="easyui-filebox" id="UploadedFile" name="UploadedFile" data-options="prompt:'Choose a file...'" style="width:300px;height:20px" />
-
- </td>
- </tr>
- <tr>
-
- <td colspan="2">
- <label id="DownUrl"></label>
- </td>
- </tr>
- <tr style="color:cornflowerblue">
- <td align="center" colspan="2" style="background-color:lightgray" >
- <span><strong>内容</strong></span>
- </td>
- </tr>
- <tr>
-
- <td class="td_1" colspan="2">
- <textarea id="Content" name="Content" class="easyui-validatebox" data-options="required:true" style="width: 550px; height: 150px;" placeholder="请输入内容"></textarea>
- </td>
- </tr>
- <tr></tr>
- </table>
- </div>
- <div data-options="region:'south',border:false" style="text-align:right; padding: 12px 20px ;height:52px;">
- <a class="easyui-linkbutton" id="Save" 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="$('#winModal').window('close');" style="width:80px">取消</a>
- </div>
- </div>
- </div>
- </section>
- <script>
- function btn_Add() {
- $("#hid_Type").val("Add");
- $("#promulgator").textbox("setValue", "");
- $("#LawRuleName").textbox("setValue", "")
- //ClearFile(getFileElement());
- $('#UploadedFile').filebox('setValue', '');
- $("#DownUrl").html("");
- KindEditor.html('#Content', "");
- $('#winModal').window('open');
- }
- //修改
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- //ClearFile(getFileElement());
- $("#UploadedFile").filebox("setValue", "");
- var row = $('#dgTable').datagrid('getSelected');
- if (row) {
- $("#LawRuleTypeId").combobox("setValue", row.LawRuleTypeId);
- $("#LawRuleName").textbox("setValue", row.LawRuleName)
- $("#promulgateDate").val(row.promulgateDate);
- $("#promulgator").textbox("setValue",row.promulgator);
- $("#DownUrl").html(row.DownUrl);
- KindEditor.html('#Content', row.Content);
- $('#winModal').window('open');
- } else {
- layer.alert('请选择一条记录进行查看', {icon:0, title: '提示信息' });
- }
- }
- function Save(type) {
- type = type || $("#hid_Type").val();
- var LawRuleId = (type === "Edit") ? $('#dgTable').datagrid('getSelections')[0].LawRuleId:"";
- $.ajaxFileUpload({
- url: "@Url.Action("RowAndRuleListOper", "LawAndRule")",
- secureuri: false, //一般设置为false
- fileElementId: getfileelement(),//$("#UploadedFile").filebox('getValue'),
- type: "post",
- dataType: "json",
- data: {
- Type: type,
- UploadFile: "true",
- LawRuleId:LawRuleId,
- LawRuleTypeId: $("#LawRuleTypeId").combobox("getValue"),
- LawRuleName: $("#LawRuleName").textbox("getValue"),
- promulgateDate: $("#promulgateDate").val(),
- promulgator: $("#promulgator").textbox("getValue"),
- Content: $("#Content").val()
- },
- success: function (data) {
- if (CheckAajxData(data) === false) return;
- //$("#UploadedFile").filebox("setValue", "");
- $('#UploadedFile').filebox({
- buttonText: '选择文件...',
- buttonAlign: 'right'
- })
- var msg = data.ErrorInfo;
- if (data.Success === true) {
- LoadTable();
- $("#winModal").window("close");
- layer.alert(msg, { icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg, { icon: 7, title: '提示信息' });
- }
- }
- });
- }
- function btn_Del() {
- $("#hid_Type").val("Del");
- var row = $('#dgTable').datagrid('getSelected');
- if (row) {
- layer.confirm('确认删除这条记录?', {
- btn: ['确认删除', '取消'] //按钮
- }, function () {
- if (row) {
- $.ajax({
- url: "/LawAndRule/RowAndRuleListOper?ran=" + Math.random(),
- type: "POST",
- dataType: "json",
- data: { LawRuleId: row.LawRuleId, Type: 'Del', },
- success: function (data) {
- if (CheckAajxData(data) == false) {
- return;
- }
- var msg = data.ErrorInfo;
- if (data != null && data.Success == true) {
- LoadTable();
- //$('#winSetSysStatusInfo').window('close');
- layer.alert("操作成功!", {icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg, { icon: 2, title: '提示信息' });
- }
- }
- })
- }
- })
- } else {
- layer.alert('请选择一条记录进行查看', { icon: 0, title: '提示信息' });
- }
-
- }
- //加载表格数据
- function LoadTable() {
- $('#dgTable').datagrid({
- url: '@Url.Action("GetLawRuleList", "LawAndRule")',
- onDblClickRow: function () {
- btn_Edit();
- }
- });
- }
- var editor;
-
- $(function () {
- //加载表格数据
- window.LoadTable();
- editor = KindEditor.create('textarea[name="Content"]', {
- resizeType: 1, width: "100%", height: "500px", afterChange: function () {
- this.sync();
- }, afterBlur: function () {
- this.sync();
- }, allowUpload: true, uploadJson: '/SystemModule/UploadImage'
- });
- laydate({
- elem: '#promulgateDate',
- format: "YYYY-MM-DD",
- min: "2000-01-01",
- event: "focus"
- });
- $('#UploadedFile').filebox({
- buttonText: '选择文件...',
- buttonAlign: 'right'
- })
- if ($('#hid_IsAdd').val() == "N") {
- $("#btn_Add").hide();
- }
- if ($('#hid_IsUpdate').val() == "N") {
- $("#btn_Update").hide();
- }
- if ($('#hid_IsDelete').val() == "N") {
- $("#btn_Delete").hide();
- }
- });
- //function ClearFile(idStr) {
- // var file = $(idStr);
- // file.after(file.clone().val(""));
- // file.remove();
- //}
- function getfileelement(uploadedfile) {
- uploadedfile = uploadedfile || "UploadedFile";
- return $('#' + uploadedfile).next().find("input[type='file']").attr("id")
- }
- </script>
- </body>
- </html>
|