| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">表单字段信息</div>
- <div class="layui-card-body" pad15>
- <div class="layui-form layui-form-pane" lay-filter="itemform-edit">
- <input type="hidden" name="id" value="{$item.id}">
- {if $item.formid>0}
- <input type="hidden" name="formid" value="{$item.formid}">
- <div class="layui-form-item">
- <label class="layui-form-label">自定义表单</label>
- <div class="layui-input-block">
- <input type="text" name="formtitle" value="{$item.form.title}" placeholder="请输入..." autocomplete="off" readonly="readonly"
- class="layui-input layui-disabled">
- </div>
- </div>
- {else /}
- <div class="layui-form-item">
- <label class="layui-form-label"><span style="color:#f90c05;">*</span>自定义表单</label>
- <div class="layui-input-block">
- <select name="formid" lay-search lay-verify="required">
- <option value="">请选择(可搜索)...</option>
- {volist name="formlist" id="vo"}
- <option value="{$vo.id}" {$item.formid==$vo.id ? 'selected' : '' }>{$vo.title}</option>
- {/volist}
- </select>
- <div class="layui-form-mid layui-word-aux">选择后不可修改,请谨慎选择。</div>
- </div>
- </div>
- {/if}
- <div class="layui-form-item">
- <label class="layui-form-label"><span style="color:#f90c05;">*</span>字段名称</label>
- <div class="layui-input-block">
- <input type="text" name="title" value="{$item.title}" lay-verify="required" placeholder="请输入..." autocomplete="off"
- class="layui-input">
- </div>
- </div>
- <div class="layui-form-item" pane>
- <label class="layui-form-label">是否必填</label>
- <div class="layui-input-block">
- <input type="radio" name="imust" value="1" title="是" {eq name="item.imust|default=1" value="1"}checked{/eq} />
- <input type="radio" name="imust" value="2" title="否" {eq name="item.imust" value="2"}checked{/eq} />
- </div>
- </div>
- <div class="layui-form-item" pane>
- <label class="layui-form-label">类型</label>
- <div class="layui-input-block">
- <input type="radio" name="itype" lay-filter="itype" value="1" title="单行输入框" {eq name="item.itype|default=1" value="1"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="2" title="多行输入框" {eq name="item.itype" value="2"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="3" title="普通选择" {eq name="item.itype" value="3"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="4" title="单选选择" {eq name="item.itype" value="4"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="5" title="多选选择" {eq name="item.itype" value="5"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="6" title="日期选择" {eq name="item.itype" value="6"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="7" title="时间选择" {eq name="item.itype" value="7"}checked{/eq} />
- <input type="radio" name="itype" lay-filter="itype" value="8" title="图片上传" {eq name="item.itype" value="8"}checked{/eq} />
- </div>
- </div>
- <div class="layui-form-item itypebox itypebox3 itypebox4 itypebox5">
- <label class="layui-form-label">选择项集合</label>
- <div class="layui-input-block">
- <textarea name="options" placeholder="请输入..." class="layui-textarea">{$item.options}</textarea>
- <div class="layui-form-mid layui-word-aux">每行一个,并且不要有空行。</div>
- </div>
- </div>
- <div class="layui-form-item itypebox itypebox8">
- <label class="layui-form-label">图片数量</label>
- <div class="layui-input-block">
- <input type="text" name="picnumber" value="{$item.picnumber|default=1}" placeholder="请输入..."
- autocomplete="off" class="layui-input">
- <div class="layui-form-mid layui-word-aux">用户提交图片最多数量。</div>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">字段提示</label>
- <div class="layui-input-block">
- <input type="text" name="placeholder" value="{$item.placeholder}" placeholder="请输入..."
- autocomplete="off" class="layui-input">
- <div class="layui-form-mid layui-word-aux">字段输入提示信息,为空时不显示。</div>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label"><span style="color:#f90c05;">*</span>排序</label>
- <div class="layui-input-block">
- <input type="text" name="priority" value="{$item.priority|default=0}" lay-verify="required" placeholder="请输入排序值(升序,值越小越靠前)"
- autocomplete="off" class="layui-input">
- <div class="layui-form-mid layui-word-aux">升序,值越小越靠前。</div>
- </div>
- </div>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <input type="button" lay-submit lay-filter="itemform-edit-submit" value="确认提交" class="layui-btn">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- layui.config({
- base: '/static/echoui/' //静态资源所在路径
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'set', 'upload'], function() {
- var $ = layui.$,
- setter = layui.setter,
- admin = layui.admin,
- form = layui.form,
- upload = layui.upload;
- form.render();
-
- function itypeChange(value) {
- $(".itypebox").hide();
- $(".itypebox" + value).show();
- }
- itypeChange({$item['itype']|default=1});
- form.on('radio(itype)', function(data) {
- itypeChange(data.value);
- });
- form.on('submit(itemform-edit-submit)', function(obj) {
- var index = parent.layer.getFrameIndex(window.name);
- admin.req({
- url: setter.baseAdminUrl + 'form/edititem',
- data: obj.field,
- done: function(res) {
- layer.msg("提交成功", {
- icon: 1
- });
- parent.layui.table.reload('itemlist-table'); //重载表格
- parent.layer.close(index);
- }
- });
- });
- });
- </script>
|