123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <!--<div class="ibox-title">-->
- <!--<h5>{$meta_title}</h5>-->
- <!--<div class="ibox-tools">-->
- <!--<a class="toback" href="{:url('index')}">-->
- <!--返回上一页-->
- <!--</a>-->
- <!--</div>-->
- <!--</div>-->
- <div class="ibox-content">
- <form method="post" action="{:url('add')}" class="form-horizontal">
- <input type="hidden" name="id" value="{$info['id']|default='0'}">
- <div class="form-group">
- <label class="col-sm-2 control-label">配置标识</label>
- <div class="col-sm-4">
- <input type="text" class="form-control" name="name" value="{$info.name|default=''}">
- <span class="help-block m-b-none">用于config函数调用,只能使用英文且不能重复</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">配置标题</label>
- <div class="col-sm-4">
- <input type="text" class="form-control" name="title" value="{$info.title|default=''}">
- <span class="help-block m-b-none">用于后台显示的配置标题</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">排序</label>
- <div class="col-sm-4">
- <input type="text" class="form-control" name="sort" value="{$info.sort|default=0}">
- <span class="help-block m-b-none">用于分组显示的顺序</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">配置类型</label>
- <div class="col-sm-4">
- <select class="form-control m-b" name="type">
- {volist name="type_list" id="v"}
- <option value="{$key}">{$v}</option>
- {/volist}
- </select>
- <span class="help-block m-b-none">系统会根据不同类型解析配置值</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">配置属性</label>
- <div class="col-sm-4">
- <select class="form-control m-b" name="cate" onchange="changeCate(this)">
- <option value="1">系统配置</option>
- <option value="2">组织配置</option>
- </select>
- <span class="help-block m-b-none">配置属性 用于区分系统配置和组织配置</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">配置分组</label>
- <div class="col-sm-4">
- {if condition="!empty($info)"}
- {if condition="$info['cate'] eq 1"}
- <select class="form-control m-b" id="group" name="group">
- <option value="0">不分组</option>
- {volist name="group_list" id="v"}
- <option value="{$key}">{$v}</option>
- {/volist}
- </select>
- {else /}
- <select class="form-control m-b" id="group" name="group">
- <option value="0">不分组</option>
- {volist name="org_group_list" id="v"}
- <option value="{$key}">{$v}</option>
- {/volist}
- </select>
- {/if}
- {else /}
- <select class="form-control m-b" id="group" name="group">
- <option value="0">不分组</option>
- {volist name="group_list" id="v"}
- <option value="{$key}">{$v}</option>
- {/volist}
- </select>
- {/if}
- <span class="help-block m-b-none">配置分组 用于批量设置 不分组则不会显示在系统设置中</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">配置值</label>
- <div class="col-sm-4">
- <textarea name="value" class="form-control" rows="3">{$info['value']|default=''}</textarea>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">配置项</label>
- <div class="col-sm-4">
- <textarea name="extra" class="form-control" rows="3">{$info['extra']|default=''}</textarea>
- <span class="help-block m-b-none">如果是枚举型 需要配置该项</span>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">说明</label>
- <div class="col-sm-4">
- <textarea name="remark" class="form-control" rows="3">{$info['remark']|default=''}</textarea>
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary ajax-post" target-form="form-horizontal" data-layer_c="1" type="submit">确 定</button>
- <!--<a href="{:url('index')}" class="btn btn-default">取 消</a>-->
- <button class="btn cancel-btn btn-default" type="button">取 消</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(document).ready(function(){
- formSetValue("type", {$info.type|default=0});
- formSetValue("group", {$info.group|default=0});
- formSetValue("cate", {$info.cate|default=1});
- });
- var group = {:json_encode($group_list)};
- var orggroup = {:json_encode($org_group_list)};
- function changeCate(_self) {
- var cate = $(_self).val();
- var str = '<option value="0">不分组</option>';
- if(cate == 1){
- for(let o in group){
- str += '<option value="'+o+'">'+group[o]+'</option>';
- }
- }else{
- for(let o in orggroup){
- str += '<option value="'+o+'">'+orggroup[o]+'</option>';
- }
- }
- $('#group').html(str);
- formSetValue("group", {$info.group|default=0});
- }
- </script>
- {/block}
|