You've already forked think-plugs-notice
[notice]通知公告
This commit is contained in:
99
src/view/broadcast/form.html
Normal file
99
src/view/broadcast/form.html
Normal file
@@ -0,0 +1,99 @@
|
||||
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="DeptTable">
|
||||
<div class="layui-card-body padding-left-40">
|
||||
<fieldset class="layui-bg-gray">
|
||||
<legend><b class="layui-badge think-bg-violet">基础信息</b></legend>
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="help-label"><b>标题</b></span>
|
||||
<input maxlength="100" class="layui-input" name="title" value='{$vo.title|default=""}' required vali-name="标题" placeholder="请输入标题">
|
||||
</label>
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="help-label"><b>类型</b></span>
|
||||
<select name="type" lay-search="{fuzzy: true}" lay-creatable="" required vali-name="类型" class="layui-select">
|
||||
<option value="">请选择或输入类型</option>
|
||||
{foreach $types as $type}{if isset($vo.type) and $type.type eq $vo.type}
|
||||
<option selected value="{$type.type}">{$type.type}</option>
|
||||
{else}
|
||||
<option value="{$type.type}">{$type.type}</option>
|
||||
{/if}{/foreach}
|
||||
</select>
|
||||
</label>
|
||||
<label class="layui-form-item relative block">
|
||||
<span class="help-label"><b>内容</b></span>
|
||||
<textarea class="layui-textarea" name="content" style="width: 100%" placeholder="请输入内容">
|
||||
{$vo.title|default=""}
|
||||
</textarea>
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset class="layui-bg-gray">
|
||||
<legend><b class="layui-badge think-bg-violet">通知人</b></legend>
|
||||
{notempty name='vo.id'}
|
||||
<input type="checkbox" lay-filter="rebroadcast" lay-skin="tag" lay-text="重新发送通知" name="rebroadcast" value='1'>
|
||||
<script>
|
||||
$(function () {
|
||||
$(".rebroadcast").hide()
|
||||
})
|
||||
</script>
|
||||
{/notempty}
|
||||
|
||||
<div class="layui-form-item rebroadcast">
|
||||
<input type="checkbox" lay-filter="to_all" lay-skin="tag" lay-text="通知所有人" name="to_all" value='1'>
|
||||
</div>
|
||||
<div class="layui-form-item rebroadcast" id="to_depts">
|
||||
<label class="layui-form-label"><span class="help-label"><b>通知部门</b></span></label>
|
||||
<div class="layui-input-block">
|
||||
{foreach $depts as $dept}
|
||||
<input type="checkbox" lay-filter="to_depts" lay-skin="tag" lay-text="{$dept.name}" name="to_depts[]" value='{$dept.id}'>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="hr-line-dashed"></div>
|
||||
{notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
|
||||
<input type="hidden" name="to" value='{$vo.to|default=""}'>
|
||||
|
||||
<div class="layui-form-item text-center">
|
||||
<button class="layui-btn" type='submit'>{:lang('保存数据')}</button>
|
||||
<button class="layui-btn layui-btn-danger" type='button' data-confirm="{:lang('确定要取消编辑吗?')}" data-close>{:lang('取消编辑')}</button>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$(function () {
|
||||
layui.use(['form'], function () {
|
||||
const Form = layui.form;
|
||||
Form.on('checkbox(to_all)', function (data) {
|
||||
if (data.elem.checked) {
|
||||
$('input[name="to"]').val('所有人')
|
||||
$('#to_depts').hide()
|
||||
$('select[name="to_depts"]').attr('disabled', true)
|
||||
} else {
|
||||
$('input[name="to"]').val(
|
||||
$('input[lay-filter="to_depts"]').filter(function (index, element) {
|
||||
return element.checked;
|
||||
}).map(function (index,element) {
|
||||
return $(element).attr('title')
|
||||
}).toArray().join(',')
|
||||
)
|
||||
$('#to_depts').show()
|
||||
}
|
||||
})
|
||||
Form.on('checkbox(to_depts)', function (data) {
|
||||
$('input[name="to"]').val(
|
||||
$('input[lay-filter="to_depts"]').filter(function (index, element) {
|
||||
return element.checked;
|
||||
}).map(function (index,element) {
|
||||
return $(element).attr('title')
|
||||
}).toArray().join(',')
|
||||
)
|
||||
})
|
||||
Form.on('checkbox(rebroadcast)', function (data) {
|
||||
if (data.elem.checked) {
|
||||
$('.rebroadcast').show()
|
||||
} else {
|
||||
$('.rebroadcast').hide()
|
||||
}
|
||||
})
|
||||
});
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user