123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>SysHelpesList</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" />
- <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>
- </head>
- <body>
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
- </section>
- @*<section class="text-center title">
- <h2>市场信息</h2>
- </section>*@
- <section class="container-fluid" style="height: 100vh; padding-top: 5px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar" id="CurdTool" style="float:left">
-
- <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:'HelpId',width:100">编号</th>
- <th data-options="field:'FunctionId',width:150">菜单编号</th>
- <th data-options="field:'HelpTitle',width:150,">标题</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winSetSysHelpesInfo" class="easyui-window" title="功能菜单维护" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:700px;height:550px;padding:10px 10px;">
- <div class="easyui-layout" data-options="fit:true">
- <div data-options="region:'center'" style="padding:1px;height:650px">
- <form id="ff" method="post">
- <div style="padding-bottom:10px;margin-top:2px">
- <div style="float:left">
- <label for="txtFunctionId">功能编号:</label>
-
- <input class="easyui-combotree" id="txtFunctionId" name="txtFunctionId" data-options="url:'/SystemModule/GetFunctionForEasyUITree',method:'post',loadFilter: function (rows) {
- return convert(rows);
- },required:false,
- onClick: function (node) {
-
- }" style="width:450px;height:22px" />
- </div>
-
- </div>
- <div style="padding-bottom:10px;margin-top:10px">
- <div style="float:left;">
- <label for="txtHelpTitle">标题:</label>
- <input class="easyui-textbox" type="text" id="txtHelpTitle" name="txtHelpTitle" data-options="required:true" style="width:450px;height:22px" />
- </div>
- </div>
- <div style="padding-bottom:10px;margin-top:10px">
- <div style="float:left;">
- <label for="txtHelpKeyWords">关键字:</label>
- <input class="easyui-textbox" type="text" id="txtHelpKeyWords" name="txtHelpKeyWords" style="width:450px;height:22px" />
- </div>
- </div>
- <div style="padding-bottom:10px;margin-top:10px">
- <div style="float:left">
- <label for="txtSequence">顺序:</label>
- <input class="easyui-textbox" type="text" id="txtSequence" name="txtSequence" data-options="required:true" style="width:450px;height:22px"/>
- </div>
- </div>
- <div style="padding-bottom:10px;margin-top:10px">
- <div style="float:left">
- <textarea id="txtHelpContent" name="txtHelpContent" class="easyui-validatebox" data-options="required:true" style="width: 550px; height: 150px;" placeholder="请输入内容"></textarea>
-
- </div>
- </div>
- </form>
- </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="$('#winSetSysHelpesInfo').window('close');" style="width:80px">取消</a>
- </div>
- </div>
- </div>
- </section>
- <script>
- //提交
- function Save(type) {
- type = type || $("#hid_Type").val();
- var HelpId = type === "Edit"? $('#dgTable').datagrid('getSelections')[0].HelpId:"";
- $.ajax({
- url: "@Url.Action("SysHelpsListOper", "SystemModule")",
- type: "post",
- data: {
- Type: type,
- HelpId: HelpId,
- FunctionId: $("#txtFunctionId").textbox("getValue"),
- HelpTitle: $("#txtHelpTitle").textbox("getValue"),
- HelpKeyWords: $("#txtHelpKeyWords").textbox("getValue"),
- Sequence: $("#txtSequence").textbox("getValue"),
- HelpContent: $("#txtHelpContent").val()
- },
- success: function (data) {
- if (CheckAajxData(data) == false) {
- return;
- }
- var msg = JSON.parse(data);
- if (msg != null && msg.Success == true) {
- LoadTable();
- $('#winSetSysHelpesInfo').window('close');
- layer.alert("操作成功!", { icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg.ErrorInfo, { icon: 2, title: '提示信息' });
- }
-
- }
- });
- }
- function btn_Add() {
- $("#hid_Type").val("Add");
- $("#txtFunctionId").textbox("setValue", "");
- $("#txtHelpTitle").textbox("setValue", "");
- $("#txtHelpKeyWords").textbox("setValue", "");
- $("#txtSequence").textbox("setValue", "");
- KindEditor.html('#txtHelpContent', "");
- $('#winSetSysHelpesInfo').window('open');
- }
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- var row = $('#dgTable').datagrid('getSelected');
- if (row) {
- $.ajax({
- url: "/SystemModule/GetSysHelpeByID?ran=" + Math.random(),
- type: "POST",
- dataType: "json",
- data: { ID: row.HelpId },
- success: function (data) {
- $("#txtFunctionId").combotree("setValue", data[0].FunctionId);
- $("#txtHelpTitle").textbox("setValue", data[0].HelpTitle);
- $("#txtHelpKeyWords").textbox("setValue", data[0].HelpKeyWords);
- $("#txtSequence").textbox("setValue", data[0].Sequence);
- //$("#txtHelpContent").val(data[0].HelpContent);
- KindEditor.html('#txtHelpContent', data[0].HelpContent);
- $('#winSetSysHelpesInfo').window('open');
- }
- })
- $('#winSetSysHelpesInfo').window('open');
- } else {
- layer.alert('请选择一条记录进行设置', { 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: "/SystemModule/SysHelpsListOper?ran=" + Math.random(),
- type: "POST",
- dataType: "json",
- data: { HelpId: row.HelpId, 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: '提示信息' });
- }
- }
- })
- }
- })
- }
- }
- //加载表格数据
- function LoadTable() {
- $('#dgTable').datagrid({
- url: '@Url.Action("GetSysHelpesList", "SystemModule")'
- });
- }
- var editor;
- $(function () {
- //加载表格数据
- window.LoadTable();
- editor = KindEditor.create('textarea[name="txtHelpContent"]', {
- resizeType: 1, width: "100%", height: "500px", afterChange: function () {
- this.sync();
- }, afterBlur: function () {
- this.sync();
- }, allowUpload: true, uploadJson: '/SystemModule/UploadImage'
- });
-
- ////加载日历控件
- //laydate({
- // elem: '#PractiseTime',
- // format: "YYYY-MM-DD",
- // min: "1980-01-01",
- // event: "focus"
- //});
-
- });
- function convert(rows) {
- function exists(rows, parentId) {
- for (var i = 0; i < rows.length; i++) {
- if (rows[i].id == parentId) return true;
- }
- return false;
- }
- var nodes = [];
- // get the top level nodes
- for (var i = 0; i < rows.length; i++) {
- var row = rows[i];
- if (!exists(rows, row.parentId)) {
- nodes.push({
- id: row.id,
- text: row.name
- });
- }
- }
- var toDo = [];
- for (var i = 0; i < nodes.length; i++) {
- toDo.push(nodes[i]);
- }
- while (toDo.length) {
- var node = toDo.shift(); // the parent node
- // get the children nodes
- for (var i = 0; i < rows.length; i++) {
- var row = rows[i];
- if (row.parentId == node.id) {
- var child = { id: row.id, text: row.name };
- if (node.children) {
- node.children.push(child);
- } else {
- node.children = [child];
- }
- toDo.push(child);
- }
- }
- }
- return nodes;
- }
- </script>
- </body>
- </html>
|