| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- @using Lottomat.Util
- @{
- ViewBag.Title = "Form";
- Layout = "~/Views/Shared/_Form.cshtml";
- }
- <script type="text/javascript">
- var parentId = request('parentId');
- var moduleButtonId = request('moduleButtonId');
- var moduleId = request('moduleId');
- $(function () {
- initControl();
- })
- var dataJson = top.Form.buttonJson;
- //初始化控件
- function initControl() {
- //上级
- $("#ParentId").ComboBoxTree({
- url: "../../AuthorizeManage/ModuleButton/ListToTreeJson",
- param: { moduleButtonJson: JSON.stringify(dataJson) },
- method: "post",
- description: "==请选择==",
- height: "150px"
- });
- if (!!moduleButtonId) {
- $.each(dataJson, function (i) {
- var row = dataJson[i];
- if (row.ModuleButtonId == moduleButtonId) {
- $("#form1").SetWebControls(row);
- }
- });
- } else {
- $("#ModuleId").val(moduleId);
- if (!!parentId) {
- $("#ParentId").ComboBoxTreeSetValue(parentId);
- } else {
- $("#ParentId").ComboBoxTreeSetValue(0);
- }
- }
- }
- //保存表单
- function AcceptClick(callback) {
- if (!$('#form1').Validform()) {
- return false;
- }
- var data = $("#form1").GetWebControls(moduleButtonId);
- if (data["ParentId"] == "") {
- data["ParentId"] = 0;
- }
- callback(data);
- dialogClose();
- }
- </script>
- <div style="margin-top: 10px; margin-right: 30px;">
- <input id="ModuleButtonId" type="hidden" value="@CommonHelper.GetGuid().ToString()" />
- <input id="ModuleId" type="hidden" />
- <table class="form">
- <tr>
- <th class="formTitle">上级</th>
- <td class="formValue">
- <div id="ParentId" type="selectTree" class="ui-select">
- </div>
- </td>
- </tr>
- <tr>
- <th class="formTitle">编号<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="EnCode" type="text" class="form-control" placeholder="请输入编号" isvalid="yes" checkexpession="NotNull" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">名称<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="FullName" type="text" class="form-control" placeholder="请输入名称" isvalid="yes" checkexpession="NotNull" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">排序<font face="宋体">*</font></th>
- <td class="formValue">
- <input id="SortCode" type="text" class="form-control" placeholder="请输入排序" isvalid="yes" checkexpession="Num" />
- </td>
- </tr>
- <tr>
- <th class="formTitle">地址</th>
- <td class="formValue">
- <input id="ActionAddress" type="text" class="form-control" />
- </td>
- </tr>
- </table>
- </div>
|