2021-08-04 13:44:36 +08:00

118 lines
7.0 KiB
PHP

<form class="layui-form layui-card" action="{:sysuri()}" id="UserForm" data-auto="true" method="post" autocomplete="off">
<div class="layui-card-body padding-left-40">
<fieldset>
<legend><b class="layui-badge think-bg-violet">用户账号</b></legend>
<div class="layui-row layui-col-space15">
<div class="layui-row layui-col-space15">
<div class="layui-col-xs2 text-center">
<input type="hidden" name="headimg" value="{$vo.headimg|default=''}">
<script>$('[name=headimg]').uploadOneImage()</script>
</div>
<div class="layui-col-xs5">
<label class="block relative">
<span class="color-green font-w7">登录账号</span>
<span class="color-desc margin-left-5">Login Username</span>
{if isset($vo) and isset($vo.username)}
<input disabled value='{$vo.username|default=""}' required class="layui-input think-bg-gray">
{else}
<input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入登录账号" class="layui-input">
{/if}
<span class="help-block">登录账号不能重复并且创建后不能再次修改哦。</span>
</label>
</div>
<div class="layui-col-xs5">
<label class="block relative">
<span class="color-green font-w7">用户名称</span>
<span class="color-desc margin-left-5">User Nickname</span>
<input name="nickname" value='{$vo.nickname|default=""}' required placeholder="请输入用户名称" class="layui-input">
<span class="help-block">用于区分用户数据的用户名称,请尽量不要重复。</span>
</label>
</div>
</div>
</div>
</fieldset>
{if !empty($bases) || !empty($authorizes)}
<fieldset>
<legend><b class="layui-badge think-bg-violet">用户权限</b></legend>
{if !empty($bases)}
<div class="layui-form-item">
<span class="color-green font-w7">角色身份</span>
<span class="color-desc margin-left-5">Role Identity</span>
<select class="layui-select" lay-search name="usertype">
<option value="">-- 选择 --</option>
{foreach $bases as $base}{if isset($vo.usertype) and $vo.usertype eq $base.code}
<option selected value="{$base.code}">{$base.name|default=''} ( {$base.code|default=''} )</option>
{else}
<option value="{$base.code}">{$base.name|default=''} ( {$base.code|default=''} )</option>
{/if}{/foreach}
</select>
</div>
{/if}{if !empty($authorizes)}
<div class="layui-form-item">
<span class="color-green font-w7">访问权限</span>
<span class="color-desc margin-left-5">User Permission</span>
<div class="layui-textarea" style="min-height:42px;line-height:28px">
{if isset($vo.username) and $vo.username eq $superName}
<span class="color-desc">超级用户拥所有访问权限,不需要配置权限。</span>
{else}{foreach $authorizes as $authorize}
<label class="think-checkbox layui-unselect margin-top-5">
{if in_array($authorize.id, $vo.authorize)}
<input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore>{$authorize.title}
{else}
<input type="checkbox" name="authorize[]" value="{$authorize.id}" lay-ignore>{$authorize.title}
{/if}
</label>
{/foreach}{/if}
</div>
</div>
{/if}
</fieldset>
{/if}
<fieldset>
<legend><b class="layui-badge think-bg-violet">用户资料</b></legend>
<div class="layui-row layui-col-space15">
<div class="layui-col-xs4">
<label class="relative block">
<span class="color-green font-w7">联系邮箱</span><span class="color-desc margin-left-5">Contact Email</span>
<input name="contact_mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.contact_mail|default=""}' placeholder="请输入联系电子邮箱" class="layui-input">
<span class="color-desc">可选,请填写用户常用的电子邮箱</span>
</label>
</div>
<div class="layui-col-xs4">
<label class="relative block">
<span class="color-green font-w7">联系手机</span><span class="color-desc margin-left-5">Contact Mobile</span>
<input type="tel" maxlength="11" name="contact_phone" value='{$vo.contact_phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入用户联系手机" class="layui-input">
<span class="color-desc">可选,请填写用户常用的联系手机号</span>
</label>
</div>
<div class="layui-col-xs4">
<label class="relative block">
<span class="color-green font-w7">联系QQ</span><span class="color-desc margin-left-5">Contact QQ</span>
<input name="contact_qq" pattern="^\d{6,}$" value='{$vo.contact_qq|default=""}' placeholder="请输入常用的联系QQ" class="layui-input">
<span class="color-desc">可选,请填写用户常用的联系QQ号</span>
</label>
</div>
</div>
<label class="layui-form-item block relative margin-top-10">
<span class="color-green font-w7">用户描述</span><span class="color-desc margin-left-5">User Remark</span>
<textarea placeholder="请输入用户描述" class="layui-textarea" name="describe">{$vo.describe|default=""}</textarea>
</label>
</fieldset>
<div class="hr-line-dashed"></div>
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
<div class="layui-form-item text-center">
<button class="layui-btn" type='submit'>保存数据</button>
<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
</div>
</div>
</form>
<script>
layui.form.render();
$('#UserForm').parent().css('overflow', 'revert');
</script>