metroui
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta charset="utf-8" /> <link href="/static/css/metro.css" rel="stylesheet"> <link href="/static/css/metro-icons.css" rel="stylesheet"> <link href="/static/css/metro-responsive.css" rel="stylesheet"> <link href="/static/css/datatables/autoFill.dataTables.min.css" rel="stylesheet"> <link href="/static/css/datatables/buttons.dataTables.min.css" rel="stylesheet"> <link href="/static/css/datatables/select.dataTables.min.css" rel="stylesheet"> <script src="/static/css/site.css"></script> <script src="/static/js/jquery.min.js"></script> <script src="/static/js/metro.js"></script> <script src="/static/js/datatables/jquery.dataTables.min.js"></script> <script src="/static/js/datatables/dataTables.buttons.min.js"></script> <script src="/static/js/datatables/buttons.flash.min.js"></script> <script src="/static/js/datatables/jszip.min.js"></script> <script src="/static/js/datatables/pdfmake.min.js"></script> <script src="/static/js/datatables/vfs_fonts.js"></script> <script src="/static/js/datatables/buttons.html5.min.js"></script> <script src="/static/js/datatables/buttons.print.min.js"></script> <script src="/static/js/datatables/dataTables.select.min.js"></script> <script src="/static/js/knockout.js"></script> <script src="/static/js/jquery.tmpl.min.js"></script> <script src="/static/js/select2.min.js"></script> <script src="/static/js/site.js"></script> <script src="/static/js/usp.js"></script> </head> <body> <h2>corpAdd <button id="btnBack" data-bind="click: usp.admin.corp.add.goBack" class="button place-right primary"><span class="mif-keyboard-return "></span></button></h2> <hr class="thin bg-grayLighter"> <form data-role="validator" data-hint-mode="hint" data-on-submit="return usp.admin.corp.add.save()"> <div class="grid"> <div class="row cells2"> <div class="cell"> <label>公司名称</label> <div class="input-control text full-size"> <input type="text" data-bind="value:Name" data-validate-func="required" data-validate-hint-position="top" data-validate-hint="不能为空!" /> <span class="input-state-error mif-warning"></span> <span class="input-state-success mif-checkmark"></span> </div> </div> <div class="cell"> <label>Parent</label> <div class="input-control text full-size"> <input type="text" data-bind="value:Type" data-validate-func="required" data-validate-hint-position="top" data-validate-hint="不能为空!" /> <span class="input-state-error mif-warning"></span> <span class="input-state-success mif-checkmark"></span> </div> </div> </div> </div> <button data-bind='click:usp.admin.corp.add.save' class="button place-right primary">保存</button> </form> <script src="/static/js/usp.admin.corp.add.js"></script> <script> $(function() { usp.init() usp.admin.corp.add.init() }) </script> </body> </html>
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
(function() { usp.namespace("usp.admin.corp.add"); usp.admin.corp.add.viewModel = { Name: ko.observable(""), Type: ko.observable(""), adminLoginName: ko.observable(""), adminPassWord: ko.observable(""), }; usp.admin.corp.add.init = function() { ko.applyBindings(usp.admin.corp.add.viewModel); }; usp.admin.corp.add.goBack = function() { window.location.href = "/admin/Corp/List" }; usp.admin.corp.add.save = function() { $.ajax({ url: "Add", data: ko.toJS(usp.admin.corp.add.viewModel), async: false, success: function(data) { if (data.status) { usp.Notify('系统信息', '保存成功', 'success') usp.admin.corp.add.goBack() } else { usp.Notify('系统信息', data.info, 'alert') } } }) return false; } })(this);