2023-03-16 22:42:05 +08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>新增管理员</title>
|
|
|
|
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
|
|
|
|
</head>
|
|
|
|
<body>
|
2023-03-16 22:40:15 +08:00
|
|
|
|
|
|
|
<div class="layui-form" lay-filter="layuiadmin-form-addons" id="layuiadmin-form-addons" style="padding: 20px 30px 0 0;">
|
|
|
|
{foreach name="formData" item="vo" key="k"}
|
|
|
|
{php}$name = "params[".$k."]";{/php}
|
|
|
|
{switch name="$vo.type"}
|
|
|
|
{case value="text"}
|
|
|
|
{:form_input($name,'text',['label'=>$vo.title,'verify'=>$vo.rule,'tips'=>$vo.tips],$vo.value)}
|
|
|
|
{/case}
|
|
|
|
{case value="textarea"}
|
|
|
|
{:form_textarea($name,['label'=>$vo.title,'tips'=>$vo.tips],$vo.value)}
|
|
|
|
{/case}
|
|
|
|
{case value="password"}
|
|
|
|
{:form_input($name,'password',['label'=>$vo.title,'tips'=>$vo.tips],$vo.value)}
|
|
|
|
{/case}
|
|
|
|
{case value="radio"}
|
|
|
|
{:form_radio($name,$vo.content,['label'=>$vo.title,'tips'=>$vo.tips],$vo.value)}
|
|
|
|
{/case}
|
|
|
|
{case value="checkbox"}
|
|
|
|
{:form_checkbox($name, $vo.content,['label'=>$vo.title, 'verify' =>$vo.rule,'tips'=>$vo.tips,], $vo['value'])};
|
|
|
|
{/case}
|
|
|
|
{case value="switch"}
|
|
|
|
{:form_switch($name, $vo.content,['label'=>$vo.title, 'verify' =>$vo.rule,'tips'=>$vo.tips,], $vo['value'])};
|
|
|
|
{/case}
|
|
|
|
{case value="select"}
|
|
|
|
{:form_select($name,$vo.content,['label'=>$vo.title,'verify'=>$vo.rule,'tips'=>$vo.tips,'search'=>1] ,[],$vo.value)}
|
|
|
|
{/case}
|
|
|
|
{case value="selects"}
|
|
|
|
{:form_select($name,$vo.content,['label'=>$vo.title,'multipsle'=>1.,'verify'=>$vo.rule,'tips'=>$vo.tips,'search'=>1] ,[],$vo.value)}
|
|
|
|
{/case}
|
|
|
|
{case value="image"}
|
|
|
|
{:form_upload($name,$vo.value,['label'=>$vo.title,'tips'=>$vo.tips,'verify'=>$vo.rule,'type'=>'radio','num'=>'1','mime'=>'images'])}
|
|
|
|
{/case}
|
|
|
|
{case value="images"}
|
|
|
|
{:form_upload($name,$vo.value,['label'=>$vo.title,'tips'=>$vo.tips,'verify'=>$vo.rule,'type'=>'checkbox','num'=>$vo.num,'mime'=>'images'])}
|
|
|
|
{/case}
|
|
|
|
{case value="file"}
|
|
|
|
{:form_upload($name,$vo.value,['label'=>$vo.title,'tips'=>$vo.tips,'verify'=>$vo.rule,'type'=>'radio','num'=>$vo.num,'mime'=>'*'])}
|
|
|
|
{/case}
|
|
|
|
{case value="files"}
|
|
|
|
{:form_upload($name,$vo.value,['label'=>$vo.title,'tips'=>$vo.tips,'verify'=>$vo.rule,'type'=>'checkbox','num'=>$vo.num,'mime'=>'*'])}
|
|
|
|
{/case}
|
|
|
|
{case value="editor"}
|
|
|
|
{:form_editor($name,2,['label'=>$vo.title,'tips'=>$vo.tips,'verify'=>$vo.rule])}
|
|
|
|
{/case}
|
|
|
|
{case value="array"}
|
|
|
|
{:form_arrays($name,$vo.value?$vo.value:$vo.content,['label'=>$vo.title,'tips'=>$vo.tips,'verify'=>$vo.rule])}
|
|
|
|
{/case}
|
|
|
|
{/switch}
|
|
|
|
{/foreach}
|
|
|
|
<div class="layui-form-item layui-hide">
|
|
|
|
<input type="hidden" name="name" value="{:input('name')}">
|
|
|
|
<input type="button" lay-submit lay-filter="LAY-addons-config-submit" id="LAY-addons-config-submit" value="确认">
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-16 22:42:05 +08:00
|
|
|
<script src="/static/component/layui/layui.js"></script>
|
|
|
|
<script src="/static/component/pear/pear.js"></script>
|
|
|
|
|
2023-03-16 22:40:15 +08:00
|
|
|
<script>
|
2023-03-16 22:42:05 +08:00
|
|
|
layui.use(['upload','toast'], function(){
|
2023-03-16 22:40:15 +08:00
|
|
|
var $ = layui.$,upload = layui.upload,form = layui.form,notify=layui.notify;
|
|
|
|
//上传头像
|
|
|
|
upload.render({
|
|
|
|
elem: '.upload-select'
|
2023-03-16 22:42:05 +08:00
|
|
|
,url: "{:url('addon.addons/uploads')}"
|
2023-03-16 22:40:15 +08:00
|
|
|
,data: {type:'image'}
|
|
|
|
,accept: 'images'
|
|
|
|
,method: 'get'
|
|
|
|
,acceptMime: 'image/*'
|
|
|
|
,done: function(res){
|
|
|
|
$(this.item).prevAll("input").val(res.url);
|
2023-03-16 22:42:05 +08:00
|
|
|
if(res.status === 0){
|
|
|
|
toast.success({title:"成功",message:res.msg,position: 'topRight'});
|
2023-03-16 22:40:15 +08:00
|
|
|
} else {
|
2023-03-16 22:42:05 +08:00
|
|
|
toast.error({title:"失败",message:res.msg,position: 'topRight'});
|
2023-03-16 22:40:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
</script>
|
2023-03-16 22:42:05 +08:00
|
|
|
</body>
|
|
|
|
</html>
|