diff --git a/skyeye-dao/src/main/java/com/skyeye/smprogram/dao/SmProjectPageDao.java b/skyeye-dao/src/main/java/com/skyeye/smprogram/dao/SmProjectPageDao.java index 13b2ad3a2b49b8bebcfdd9b9b644512c5bd8c5b0..4063fd6634e2af69d81b1cf038a2bda76c13d899 100644 --- a/skyeye-dao/src/main/java/com/skyeye/smprogram/dao/SmProjectPageDao.java +++ b/skyeye-dao/src/main/java/com/skyeye/smprogram/dao/SmProjectPageDao.java @@ -15,4 +15,12 @@ public interface SmProjectPageDao { public int insertProPageMationByProId(Map map) throws Exception; + public Map querySmProjectPageISTopByThisId(Map map) throws Exception; + + public void editSmProjectPageSortTopById(Map map) throws Exception; + + public Map querySmProjectPageISLowerByThisId(Map map) throws Exception; + + public void editSmProjectPageSortLowerById(Map topBean) throws Exception; + } diff --git a/skyeye-service/src/main/java/com/skyeye/smprogram/service/SmProjectPageService.java b/skyeye-service/src/main/java/com/skyeye/smprogram/service/SmProjectPageService.java index 0cbb23d4930fa615c94e3cecf4e8ec681e187883..ec5beb6de2a32bf4c97a9cd7e5c9f81eff8a40ca 100644 --- a/skyeye-service/src/main/java/com/skyeye/smprogram/service/SmProjectPageService.java +++ b/skyeye-service/src/main/java/com/skyeye/smprogram/service/SmProjectPageService.java @@ -9,4 +9,8 @@ public interface SmProjectPageService { public void insertProPageMationByProId(InputObject inputObject, OutputObject outputObject) throws Exception; + public void editSmProjectPageSortTopById(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void editSmProjectPageSortLowerById(InputObject inputObject, OutputObject outputObject) throws Exception; + } diff --git a/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/SmProjectPageServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/SmProjectPageServiceImpl.java index 1f4fe3ee3501f054e69eeae8b67589cd3a086e79..4a9f6237dd2cd9032a18c913fb83b849fae4112b 100644 --- a/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/SmProjectPageServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/smprogram/service/impl/SmProjectPageServiceImpl.java @@ -103,6 +103,54 @@ public class SmProjectPageServiceImpl implements SmProjectPageService{ map.put("createTime", ToolUtil.getTimeAndToString()); smProjectPageDao.insertProPageMationByProId(map); } + + /** + * + * @Title: editSmProjectPageSortTopById + * @Description: 小程序页面展示顺序上移 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editSmProjectPageSortTopById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map topBean = smProjectPageDao.querySmProjectPageISTopByThisId(map);//根据排序获取这条数据的上一条数据 + if(topBean == null){ + outputObject.setreturnMessage("已经是最靠前页面,无法移动。"); + }else{ + map.put("sort", topBean.get("sort")); + topBean.put("sort", topBean.get("thisSort")); + smProjectPageDao.editSmProjectPageSortTopById(map); + smProjectPageDao.editSmProjectPageSortTopById(topBean); + } + } + + /** + * + * @Title: editSmProjectPageSortLowerById + * @Description: 小程序页面展示顺序下移 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void editSmProjectPageSortLowerById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map topBean = smProjectPageDao.querySmProjectPageISLowerByThisId(map);//根据排序获取这条数据的上一条数据 + if(topBean == null){ + outputObject.setreturnMessage("已经是最靠后页面,无法移动。"); + }else{ + map.put("sort", topBean.get("sort")); + topBean.put("sort", topBean.get("thisSort")); + smProjectPageDao.editSmProjectPageSortLowerById(map); + smProjectPageDao.editSmProjectPageSortLowerById(topBean); + } + } diff --git a/skyeye-web/src/main/java/com/skyeye/smprogram/controller/SmProjectPageController.java b/skyeye-web/src/main/java/com/skyeye/smprogram/controller/SmProjectPageController.java index 935621f704fd515fc2f41c76254e311e3ef0a9fd..a6c1cc6aea85d547b77e01be7342ab62ef34c116 100644 --- a/skyeye-web/src/main/java/com/skyeye/smprogram/controller/SmProjectPageController.java +++ b/skyeye-web/src/main/java/com/skyeye/smprogram/controller/SmProjectPageController.java @@ -47,5 +47,37 @@ public class SmProjectPageController { smProjectPageService.insertProPageMationByProId(inputObject, outputObject); } + /** + * + * @Title: editSmProjectPageSortTopById + * @Description: 小程序页面展示顺序上移 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SmProjectPageController/editSmProjectPageSortTopById") + @ResponseBody + public void editSmProjectPageSortTopById(InputObject inputObject, OutputObject outputObject) throws Exception{ + smProjectPageService.editSmProjectPageSortTopById(inputObject, outputObject); + } + + /** + * + * @Title: editSmProjectPageSortLowerById + * @Description: 小程序页面展示顺序下移 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SmProjectPageController/editSmProjectPageSortLowerById") + @ResponseBody + public void editSmProjectPageSortLowerById(InputObject inputObject, OutputObject outputObject) throws Exception{ + smProjectPageService.editSmProjectPageSortLowerById(inputObject, outputObject); + } + } diff --git a/skyeye-web/src/main/resources/dbmapper/SmProjectPageMapper.xml b/skyeye-web/src/main/resources/dbmapper/SmProjectPageMapper.xml index 0d2113502fb03bed1a93cd08480280e0f3018ed2..af2671bacf62b6fce5e2ca2311f0ec21fa42d68b 100644 --- a/skyeye-web/src/main/resources/dbmapper/SmProjectPageMapper.xml +++ b/skyeye-web/src/main/resources/dbmapper/SmProjectPageMapper.xml @@ -54,4 +54,55 @@ (#{id}, #{name}, #{filePath}, #{fileName}, #{defaultFilePath}, #{defaultFileName}, #{defaultFilePathNum}, #{defaultFileNameNum}, #{proId}, #{sort}, #{createId}, #{createTime}) + + + + UPDATE sm_project_page + + sort = #{sort}, + + WHERE id = #{id} + + + + + + UPDATE sm_project_page + + sort = #{sort}, + + WHERE id = #{id} + + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index 3b825209fbd13cf2a212c1d603617cbdf3ae2a2f..cabdcd1e05d5727fc03abdb912756012c0f09813 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -299,6 +299,14 @@ + + + + + + + + diff --git a/skyeye-web/src/main/webapp/assets/lib/layui/custom.js b/skyeye-web/src/main/webapp/assets/lib/layui/custom.js index 7b392f90477e8241b41b2811fcc2e8d61116ea92..476c4e91ee1c969102e702b3b74a257b64f6af8b 100644 --- a/skyeye-web/src/main/webapp/assets/lib/layui/custom.js +++ b/skyeye-web/src/main/webapp/assets/lib/layui/custom.js @@ -196,10 +196,10 @@ dataGrid.prototype = { } layui.$("#" + this._id + "").empty().html(myTemplate(json)); this.registermousehover(); + this.customClickPage(json); if(typeof(_op.settings.ajaxSendAfter) == "function") { _op.settings.ajaxSendAfter(json); } - this.customClickPage(json); }, //循环添加行 createBody: function(pn) { @@ -233,10 +233,10 @@ dataGrid.prototype = { } layui.$("#" + _op.settings.id + "showBody").empty().html(myTemplate(json)); this.registermousehover(); + this.customClickPage(json); if(typeof(_op.settings.ajaxSendAfter) == "function") { _op.settings.ajaxSendAfter(json); } - this.customClickPage(json); }, //初始化分页 createFoot: function() { diff --git a/skyeye-web/src/main/webapp/js/rmmysmpropage/mysmpropagelist.js b/skyeye-web/src/main/webapp/js/rmmysmpropage/mysmpropagelist.js index f87e870a149a22199fb9a459a44438f42fdc0907..5ad5427d75cbeadcf5100a9a8de761629967e414 100644 --- a/skyeye-web/src/main/webapp/js/rmmysmpropage/mysmpropagelist.js +++ b/skyeye-web/src/main/webapp/js/rmmysmpropage/mysmpropagelist.js @@ -29,10 +29,30 @@ layui.config({ }, 'click .toUp':function(index, row){//上移 - + var params = { + proId: proId, + rowId: row.id, + }; + AjaxPostUtil.request({url:reqBasePath + "rmxcx031", params:params, type:'json', callback:function(json){ + if(json.returnCode == 0){ + refreshGrid("pageList", {params:{rowId: parent.rowId}}); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); }, 'click .toDown':function(index, row){//下移 - + var params = { + proId: proId, + rowId: row.id, + }; + AjaxPostUtil.request({url:reqBasePath + "rmxcx032", params:params, type:'json', callback:function(json){ + if(json.returnCode == 0){ + refreshGrid("pageList", {params:{rowId: parent.rowId}}); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); }, 'click .copyPage':function(index, row){//复制 diff --git a/skyeye-web/src/main/webapp/tpl/rmmysmpropage/pageTemplate.tpl b/skyeye-web/src/main/webapp/tpl/rmmysmpropage/pageTemplate.tpl index 4143b43b852a92035e6ff92a82ad1f996d2b66bb..294d431b66a65220e6e361c8a94a95bc7afdba75 100644 --- a/skyeye-web/src/main/webapp/tpl/rmmysmpropage/pageTemplate.tpl +++ b/skyeye-web/src/main/webapp/tpl/rmmysmpropage/pageTemplate.tpl @@ -1,9 +1,9 @@ {{#each rows}}
  • -
    +
    {{name}}
    -
    +