提交 0695b4b2 编写于 作者: doc_wei's avatar doc_wei

小程序绑定属性完成,未进行回显绑定

上级 f4b3becd
......@@ -29,4 +29,8 @@ public interface RmGroupMemberDao {
public Map<String, Object> queryRmGroupMemberMationById(Map<String, Object> map) throws Exception;
public int deleteRmGroupMemberAndPropertyMationById(Map<String, Object> map) throws Exception;
public int insertRmGroupMemberAndPropertyMationById(List<Map<String, Object>> beans) throws Exception;
}
......@@ -19,4 +19,6 @@ public interface RmGroupMemberService {
public void editRmGroupMemberMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editRmGroupMemberAndPropertyMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
}
package com.skyeye.smprogram.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -195,5 +197,39 @@ public class RmGroupMemberServiceImpl implements RmGroupMemberService{
}
rmGroupMemberDao.editRmGroupMemberMationById(map);
}
/**
*
* @Title: editRmGroupMemberAndPropertyMationById
* @Description: 编辑小程序组件和标签属性的绑定信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void editRmGroupMemberAndPropertyMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
Map<String, Object> user = inputObject.getLogParams();
String[] propertyIds = map.get("propertyIds").toString().split(",");
List<Map<String, Object>> beans = new ArrayList<>();
Map<String, Object> bean = null;
for(String str : propertyIds){
if(!ToolUtil.isBlank(str)){
bean = new HashMap<>();
bean.put("id", ToolUtil.getSurFaceId());
bean.put("propertyId", str);
bean.put("memberId", map.get("memberId"));
bean.put("createId", user.get("id"));
bean.put("createTime", ToolUtil.getTimeAndToString());
beans.add(bean);
}
}
if(!beans.isEmpty()){
rmGroupMemberDao.deleteRmGroupMemberAndPropertyMationById(map);//删除之前的绑定信息
rmGroupMemberDao.insertRmGroupMemberAndPropertyMationById(beans);//新增绑定信息
}
}
}
......@@ -127,4 +127,20 @@ public class RmGroupMemberController {
rmGroupMemberService.editRmGroupMemberMationById(inputObject, outputObject);
}
/**
*
* @Title: editRmGroupMemberAndPropertyMationById
* @Description: 编辑小程序组件和标签属性的绑定信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/RmGroupMemberController/editRmGroupMemberAndPropertyMationById")
@ResponseBody
public void editRmGroupMemberAndPropertyMationById(InputObject inputObject, OutputObject outputObject) throws Exception{
rmGroupMemberService.editRmGroupMemberAndPropertyMationById(inputObject, outputObject);
}
}
......@@ -156,4 +156,21 @@
WHERE a.id = #{id}
</select>
<delete id="deleteRmGroupMemberAndPropertyMationById" parameterType="java.util.Map">
DELETE
FROM
rm_group_member_property
WHERE
member_id = #{memberId}
</delete>
<insert id="insertRmGroupMemberAndPropertyMationById" parameterType="java.util.Map">
insert into rm_group_member_property
(id, member_id, property_id, create_id, create_time)
values
<foreach collection="list" item="item" index="index" separator="," >
(#{item.id}, #{item.memberId}, #{item.propertyId}, #{item.createId}, #{item.createTime})
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -326,6 +326,10 @@
<property id="pageId" name="pageId" ref="required" var="小程序页面id"/>
<property id="jsonData" name="jsonData" ref="required" var="小程序页面和模块绑定的json字符串"/>
</url>
<url id="rmxcx038" path="/post/RmGroupMemberController/editRmGroupMemberAndPropertyMationById" val="编辑小程序组件和标签属性的绑定信息" allUse="1">
<property id="propertyIds" name="propertyIds" ref="required" var="小程序标签属性id"/>
<property id="rowId" name="memberId" ref="required" var="小程序组件成员id"/>
</url>
<url id="rmproperty001" path="/post/RmPropertyController/queryRmPropertyList" val="获取小程序样式属性列表" allUse="1">
<property id="limit" name="limit" ref="required,num" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required,num" var="分页参数,第几页"/>
......
layui.config({
base: basePath,
version: skyeyeVersion
}).define(['table', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
var $ = layui.$,
form = layui.form;
//标签属性
showGrid({
id: "propertyList",
url: reqBasePath + "rmproperty006",
params: {},
pagination: false,
template: getFileContent('tpl/template/checkbox-property.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render('checkbox');
}
});
//搜索表单
form.render();
form.on('submit(formAddBean)', function (data) {
//表单验证
if (winui.verifyForm(data.elem)) {
var propertyIds = "";
$.each($('input:checkbox:checked'),function(){
propertyIds = propertyIds + $(this).attr("rowId") + ",";
});
if(isNull(propertyIds)){
top.winui.window.msg('请先选择标签属性。', {icon: 2,time: 2000});
}else{
var params = {
rowId: parent.rowId,
propertyIds: propertyIds
};
AjaxPostUtil.request({url:reqBasePath + "rmxcx038", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
}
}
return false;
});
//取消
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
});
\ No newline at end of file
......@@ -116,7 +116,7 @@ layui.config({
{ field: 'groupName', title: '所属分组', width: 120 },
{ field: 'memberUseNum', title: '使用次数', width: 120 },
{ field: 'createTime', title: '创建时间', width: 180 },
{ title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
{ title: '操作', fixed: 'right', align: 'center', width: 300, toolbar: '#tableBar'}
]]
});
......@@ -127,6 +127,8 @@ layui.config({
del(data, obj);
}else if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'bindProperty') { //绑定属性
bindProperty(data);
}else if (layEvent === 'top') { //上移
topOne(data);
}else if (layEvent === 'lower') { //下移
......@@ -286,6 +288,23 @@ layui.config({
}});
}
//绑定属性
function bindProperty(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/rmgroupmember/bindproperty.html",
title: "绑定属性",
pageId: "bindproperty",
callBack: function(refreshCode){
if (refreshCode == '0') {
top.winui.window.msg("操作成功", {icon: 1,time: 2000});
loadTable();
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
}
//刷新数据
$("body").on("click", "#reloadTable", function(){
loadTable();
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<link href="../../assets/winui/weui.css" rel="stylesheet" />
</head>
<body>
<div style="width:600px;margin:0 auto;padding-top:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item">
<label class="layui-form-label">标签属性</label>
<div class="layui-input-block" id="propertyList">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="winui-btn" id="cancle">取消</button>
<button class="winui-btn" lay-submit lay-filter="formAddBean">保存</button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script src="../../assets/winui/jweixin-1.0.0.js"></script>
<script src="../../assets/winui/weui.min.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/rmgroupmember/'}).use('bindproperty');
</script>
</body>
</html>
\ No newline at end of file
......@@ -48,6 +48,7 @@
<a class="layui-btn layui-btn-xs" lay-event="top">上移</a>
<a class="layui-btn layui-btn-xs" lay-event="lower">下移</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-xs" lay-event="bindProperty">绑定属性</a>
{{# if(d.memberUseNum == 0){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{{# } }}
......
{{#each rows}}
<input type="checkbox" name="limitrequire" title="{{name}}" rowId="{{id}}" lay-filter="checkboxProperty" />
{{/each}}
\ No newline at end of file
//展现形式 例如:输入框,选择框
//下拉框模板 展现形式 例如:输入框,选择框
showGrid({
id: "showModel",
url: reqBasePath + "dsform006",
......@@ -12,7 +12,7 @@ showGrid({
}
});
//属性标签
//下拉框模板 属性标签
showGrid({
id: "propertyId",
url: reqBasePath + "rmproperty006",
......@@ -26,3 +26,17 @@ showGrid({
}
});
//多选框模板 属性标签
showGrid({
id: "limitRequire",
url: reqBasePath + "rmproperty006",
params: {},
pagination: false,
template: getFileContent('tpl/template/checkbox-property.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render('checkbox');
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册