【notice】人员选择开发

Signed-off-by: liuhanqing <447067298@qq.com>
pull/65/head
liuhanqing 2021-01-14 21:49:57 +08:00
parent d209613553
commit d7d3d64f57
7 changed files with 123 additions and 42 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,22 +19,16 @@ layui.use(['table', 'form', 'func', 'HttpRequest', 'util'], function () {
{field: 'messageTitle', sort: true, title: '消息标题'},
// {field: 'messageType', sort: true, title: '消息类型'},
// {field: 'priorityLevelValue', sort: true, title: '优先级'},
{field: 'priorityLevel', sort: true, title: '优先级', templet: function (d) {
if (d.priorityLevel === "high") {
return "高";
} else if (d.priorityLevel === "middle") {
return "中";
} else {
return "低";
}
}},
{field: 'readFlag', sort: true, title: '阅读状态', templet: function (d) {
if (d.readFlag === 0) {
return "未读";
} else {
return "已读";
}
}},
{field: 'priorityLevelValue', sort: true, title: '优先级'},
{field: 'readFlagValue', sort: true, title: '阅读状态'
// , templet: function (d) {
// if (d.readFlag === 0) {
// return "未读";
// } else {
// return "已读";
// }
// }
},
{field: 'messageSendTime', sort: true, title: '收到时间'},
{align: 'center', toolbar: '#tableBar', title: '操作'}
]];

View File

@ -1,10 +1,11 @@
layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest'], function () {
layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest', 'xmSelect'], function () {
var $ = layui.jquery;
var HttpRequest = layui.HttpRequest;
var form = layui.form;
var admin = layui.admin;
var layer = layui.layer;
var laydate = layui.laydate;
var xmSelect = layui.xmSelect;
lay('input.date-input').each(function () {
@ -57,8 +58,16 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest'], function () {
}
};*/
$("#test").click(function (){
var select = userSelect.getValue('valueStr');
alert(select)
console.log(select)
return;
})
// 表单提交事件
form.on('submit(btnSubmit)', function (data) {
var request = new HttpRequest(Feng.ctxPath + "/sysNotice/add", 'post', function (data) {
admin.closeThisDialog();
Feng.success("添加成功!");
@ -74,4 +83,63 @@ layui.use(['layer', 'form', 'admin', 'laydate', 'HttpRequest'], function () {
return false;
});
var userSelect = xmSelect.render({
el: '#userSelect',
autoRow: true,
filterable: true,
filterMethod: function (val, item, index, prop) {
if (item.name.indexOf(val) != -1) {//名称中包含的搜索出来
return true;
}
// 添加拼音检索
try {
if (Pinyin.GetJP(item.name).indexOf(val) != -1 || Pinyin.GetQP(item.name).indexOf(val) != -1) {
return true
}
} catch (e) {
console.log(e.message);
}
return false;//不知道的就不管了
},
tree: {
show: true,
showFolderIcon: true,
showLine: true,
indent: 20,
expandedKeys: true,
},
toolbar: {
show: true,
list: ['ALL', 'REVERSE', 'CLEAR']
},
height: 'auto',
data: function () {
return [
{
name: '销售员', value: -1, disabled: true, children: [
{name: '张三1', value: 1, selected: true, children: []},
{name: '李四1', value: 2, selected: true},
{name: '王五1', value: 3, disabled: true},
]
},
{
name: '奖品', value: -2, children: [
{
name: '奖品3', value: -3, children: [
{name: '苹果3', value: 14, selected: true},
{name: '香蕉3', value: 15},
{name: '葡萄3', value: 16},
]
},
{name: '苹果2', value: 4, selected: true, disabled: true},
{name: '香蕉2', value: 5},
{name: '葡萄2', value: 6},
]
},
]
}
})
});

View File

@ -73,6 +73,9 @@ ${layoutContent}
@if(array.contain(plugins,"tinymce")){
<script src="${ctxPath}/assets/common/libs/tinymce/tinymce.min.js"></script>
@}
@if(array.contain(plugins,"pinyin")){
<script type="text/javascript" src="${ctxPath}/assets/common/libs/py/ChinesePY.js"></script>
@}
@}
@if(isNotEmpty(js)){

View File

@ -16,7 +16,7 @@
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">优先级</label>
<div class="layui-input-block">
<input id="priorityLevel" name="priorityLevel" placeholder="请输入优先级" type="text" class="layui-input" lay-verify="" required viewForm="textinput"/>
<input id="priorityLevelValue" name="priorityLevelValue" placeholder="请输入优先级" type="text" class="layui-input" lay-verify="" required viewForm="textinput"/>
</div>
</div>
<div class="layui-inline layui-col-md12">

View File

@ -1,4 +1,4 @@
@layout("/layout/_form.html",{js:["/assets/modular/system/notice/notice_add.js"],plugins:["tinymce"]}){
@layout("/layout/_form.html",{js:["/assets/modular/system/notice/notice_add.js"],plugins:["tinymce","pinyin"]}){
<form class="layui-form" id="noticeForm" lay-filter="noticeForm">
<div class="layui-fluid" style="padding-bottom: 75px;">
@ -49,6 +49,12 @@
<input name="noticeScope" placeholder="请输入通知范围" type="text" class="layui-input" lay-verify="" />
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">通知范围</label>
<div class="layui-input-block">
<div id="userSelect" class="xm-select"></div>
</div>
</div>
<div class="layui-inline layui-col-md12">
<label class="layui-form-label">通知内容</label>
<div class="layui-input-block">
@ -63,6 +69,7 @@
<div class="form-group-bottom text-center">
<button class="layui-btn" lay-filter="btnSubmit" lay-submit>&emsp;提交&emsp;</button>
<button type="reset" class="layui-btn layui-btn-primary" ew-event="closeDialog">&emsp;取消&emsp;</button>
<button id="test" class="layui-btn layui-btn-primary" >&emsp;测试&emsp;</button>
</div>
</form>
@}