123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- {% extends "base.html" %}
- {% block title %}
- {% endblock %}
- {% block head %}
- <script type="text/javascript">
- var submitForm = function($dialog, $grid, $pjq, $mainMenu) {
- if ($('form').form('validate')) {
- var url;
- if ($(':input[name="data.id"]').val().length > 0) {
- url = sy.contextPath + '/base/syresource!update.action';
- } else {
- url = sy.contextPath + '/base/syresource!save.action';
- }
- $.post(url, sy.serializeObject($('form')), function(result) {
- if (result.success) {
- $grid.treegrid('reload');
- $dialog.dialog('destroy');
- $mainMenu.tree('reload');
- } else {
- $pjq.messager.alert('提示', result.msg, 'error');
- }
- }, 'json');
- }
- };
- var showIcons = function() {
- var dialog = parent.sy.modalDialog({
- title : '浏览小图标',
- url : sy.contextPath + '/style/icons.jsp',
- buttons : [ {
- text : '确定',
- handler : function() {
- dialog.find('iframe').get(0).contentWindow.selectIcon(dialog, $('#iconCls'));
- }
- } ]
- });
- };
- $(function() {
- if ($(':input[name="data.id"]').val().length > 0) {
- parent.$.messager.progress({
- text : '数据加载中....'
- });
- $.post(sy.contextPath + '/base/syresource!getById.action', {
- id : $(':input[name="data.id"]').val(),
- }, function(result) {
- if (result.id != undefined) {
- $('form').form('load', {
- 'data.id' : result.id,
- 'data.name' : result.name,
- 'data.url' : result.url,
- 'data.syresourcetype.id' : result.syresourcetype.id,
- 'data.description' : result.description,
- 'data.syresource.id' : result.pid,
- 'data.iconCls' : result.iconCls,
- 'data.seq' : result.seq,
- 'data.target' : result.target
- });
- $('#iconCls').attr('class', result.iconCls);//设置背景图标
- }
- parent.$.messager.progress('close');
- }, 'json');
- }
- });
- </script>
- {% endblock %}
- {% block body %}
- <body>
- <form method="post" class="form">
- <fieldset>
- <legend>资源基本信息</legend>
- <table class="table" style="width: 100%;">
- <tr>
- <th>编号</th>
- <td><input name="data.id" value="{{ id }}" readonly="readonly" /></td>
- <th>资源名称</th>
- <td><input name="data.name" class="easyui-validatebox" data-options="required:true" /></td>
- </tr>
- <tr>
- <th>资源路径</th>
- <td><input name="data.url" /></td>
- <th>资源类型</th>
- <td><select name="data.syresourcetype.id" class="easyui-combobox" data-options="required:true,editable:false,valueField:'id',textField:'name',url:'{{ contextPath }}/base/syresourcetype!doNotNeedSecurity_combobox.action',panelHeight:'auto'" style="width: 155px;"></select></td>
- </tr>
- <tr>
- <th>上级资源</th>
- <td><select id="syresource_id" name="data.syresource.id" class="easyui-combotree" data-options="editable:false,idField:'id',textField:'text',parentField:'pid',url:'{{ contextPath }}/base/syresource!doNotNeedSecurity_getMainMenu.action'" style="width: 155px;"></select><img class="iconImg ext-icon-cross" onclick="$('#syresource_id').combotree('clear');" title="清空" /></td>
- <th>资源图标</th>
- <td><input id="iconCls" name="data.iconCls" readonly="readonly" style="padding-left: 18px; width: 134px;" /><img class="iconImg ext-icon-zoom" onclick="showIcons();" title="浏览图标" /> <img class="iconImg ext-icon-cross" onclick="$('#iconCls').val('');$('#iconCls').attr('class','');" title="清空" /></td>
- </tr>
- <tr>
- <th>顺序</th>
- <td><input name="data.seq" class="easyui-numberspinner" data-options="required:true,min:0,max:100000,editable:false" style="width: 155px;" value="100" /></td>
- <th>目标</th>
- <td><input name="data.target" /></td>
- </tr>
- <tr>
- <th>资源描述</th>
- <td><textarea name="data.description"></textarea></td>
- <th></th>
- <td></td>
- </tr>
- </table>
- </fieldset>
- </form>
- </body>
- {% endblock %}
|