提交 9c550f1c 编写于 作者: Skyeye云's avatar Skyeye云

编辑小程序页面完成

上级 8a25b0e2
......@@ -17,10 +17,14 @@ public interface SmProjectPageDao {
public Map<String, Object> querySmProjectPageISTopByThisId(Map<String, Object> map) throws Exception;
public void editSmProjectPageSortTopById(Map<String, Object> map) throws Exception;
public int editSmProjectPageSortTopById(Map<String, Object> map) throws Exception;
public Map<String, Object> querySmProjectPageISLowerByThisId(Map<String, Object> map) throws Exception;
public void editSmProjectPageSortLowerById(Map<String, Object> topBean) throws Exception;
public int editSmProjectPageSortLowerById(Map<String, Object> topBean) throws Exception;
public Map<String, Object> querySmProjectPageMationToEditById(Map<String, Object> map) throws Exception;
public int editSmProjectPageMationById(Map<String, Object> map) throws Exception;
}
......@@ -13,4 +13,8 @@ public interface SmProjectPageService {
public void editSmProjectPageSortLowerById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void querySmProjectPageMationToEditById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editSmProjectPageMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
}
......@@ -151,6 +151,40 @@ public class SmProjectPageServiceImpl implements SmProjectPageService{
smProjectPageDao.editSmProjectPageSortLowerById(topBean);
}
}
/**
*
* @Title: queryDsFormLimitRequirementMationToEditById
* @Description: 编辑小程序页面信息时进行回显
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void querySmProjectPageMationToEditById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
Map<String, Object> bean = smProjectPageDao.querySmProjectPageMationToEditById(map);
outputObject.setBean(bean);
outputObject.settotal(1);
}
/**
*
* @Title: editDsFormLimitRequirementMationById
* @Description: 编辑小程序页面信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@Override
public void editSmProjectPageMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
smProjectPageDao.editSmProjectPageMationById(map);
}
......
......@@ -79,5 +79,37 @@ public class SmProjectPageController {
smProjectPageService.editSmProjectPageSortLowerById(inputObject, outputObject);
}
/**
*
* @Title: queryDsFormLimitRequirementMationToEditById
* @Description: 编辑小程序页面信息时进行回显
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/SmProjectPageController/querySmProjectPageMationToEditById")
@ResponseBody
public void querySmProjectPageMationToEditById(InputObject inputObject, OutputObject outputObject) throws Exception{
smProjectPageService.querySmProjectPageMationToEditById(inputObject, outputObject);
}
/**
*
* @Title: editDsFormLimitRequirementMationById
* @Description: 编辑小程序页面信息
* @param @param inputObject
* @param @param outputObject
* @param @throws Exception 参数
* @return void 返回类型
* @throws
*/
@RequestMapping("/post/SmProjectPageController/editSmProjectPageMationById")
@ResponseBody
public void editSmProjectPageMationById(InputObject inputObject, OutputObject outputObject) throws Exception{
smProjectPageService.editSmProjectPageMationById(inputObject, outputObject);
}
}
......@@ -104,5 +104,29 @@
WHERE id = #{id}
</update>
<select id="querySmProjectPageMationToEditById" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.`name` pageName,
a.file_path filePath,
a.file_name fileName
FROM
sm_project_page a
WHERE
a.id = #{id}
</select>
<update id="editSmProjectPageMationById" parameterType="java.util.Map">
UPDATE sm_project_page
<set>
<if test="name != '' and name != null">
`name` = #{name},
</if>
file_path = #{filePath},
file_name = #{fileName},
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
......@@ -307,7 +307,15 @@
<property id="proId" name="proId" ref="required" var="小程序项目id"/>
<property id="rowId" name="id" ref="required" var="页面id"/>
</url>
<url id="rmxcx033" path="/post/SmProjectPageController/querySmProjectPageMationToEditById" val="编辑小程序页面信息时进行回显" allUse="1">
<property id="rowId" name="id" ref="required" var="页面id"/>
</url>
<url id="rmxcx034" path="/post/SmProjectPageController/editSmProjectPageMationById" val="编辑小程序页面信息" allUse="1">
<property id="rowId" name="id" ref="required" var="页面id"/>
<property id="name" name="name" ref="required" var="页面名称"/>
<property id="filePath" name="filePath" ref="" var="文件将来的导出路径"/>
<property id="fileName" name="fileName" ref="" var="文件将来的导出名"/>
</url>
<!-- 小程序系列结束 -->
......
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: "showForm",
url: reqBasePath + "rmxcx033",
params: {rowId: parent.pageId},
pagination: false,
template: getFileContent('tpl/rmmysmpropage/projectpageeditTemplate.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(json){
form.render();
form.on('submit(formEditBean)', function (data) {
//表单验证
if (winui.verifyForm(data.elem)) {
var params = {
name: $("#pageName").val(),
filePath: $("#filePath").val(),
fileName: $("#fileName").val(),
rowId: parent.pageId,
};
AjaxPostUtil.request({url:reqBasePath + "rmxcx034", 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
var proId = "";
var proId = "";//项目id
var pageId = "";//页面id
layui.config({
base: basePath,
......@@ -26,7 +28,19 @@ layui.config({
},
options: {
'click .reName':function(index, row){//重命名
pageId = row.id;
_openNewWindows({
url: "../../tpl/rmmysmpropage/editpagebeanitem.html",
title: "重命名页面",
pageId: "editpagebeanitem",
callBack: function(refreshCode){
if (refreshCode == '0') {
refreshGrid("pageList", {params:{rowId: proId}});
top.winui.window.msg("操作成功", {icon: 1,time: 2000});
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
}
}});
},
'click .toUp':function(index, row){//上移
var params = {
......@@ -35,7 +49,7 @@ layui.config({
};
AjaxPostUtil.request({url:reqBasePath + "rmxcx031", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){
refreshGrid("pageList", {params:{rowId: parent.rowId}});
refreshGrid("pageList", {params:{rowId: proId}});
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
......@@ -48,7 +62,7 @@ layui.config({
};
AjaxPostUtil.request({url:reqBasePath + "rmxcx032", params:params, type:'json', callback:function(json){
if(json.returnCode == 0){
refreshGrid("pageList", {params:{rowId: parent.rowId}});
refreshGrid("pageList", {params:{rowId: proId}});
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
......@@ -227,7 +241,7 @@ layui.config({
pageId: "addpagebeanitem",
callBack: function(refreshCode){
if (refreshCode == '0') {
refreshGrid("pageList", {params:{rowId: parent.rowId}});
refreshGrid("pageList", {params:{rowId: proId}});
top.winui.window.msg("操作成功", {icon: 1,time: 2000});
} else if (refreshCode == '-9999') {
top.winui.window.msg("操作失败", {icon: 2,time: 2000});
......
<!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" />
</head>
<body>
<div style="width:600px;margin:0 auto;padding-top:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/rmmysmpropage/'}).use('editpagebeanitem');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item">
<label class="layui-form-label">页面名称<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="pageName" name="pageName" win-verify="required" placeholder="请输入页面名称" class="layui-input" maxlength="50" value="{{pageName}}"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文件名</label>
<div class="layui-input-block">
<input type="text" id="fileName" name="fileName" placeholder="请输入文件名" class="layui-input" maxlength="50" value="{{fileName}}"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">路径</label>
<div class="layui-input-block">
<input type="text" id="filePath" name="filePath" placeholder="请输入路径" class="layui-input" maxlength="50" value="{{filePath}}"/>
</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="formEditBean">保存</button>
</div>
</div>
{{/bean}}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册