diff --git a/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js b/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js index b53273d4e7808c729598bbf66dcfd810048aceaf..87e540829758c35f0d020e3b39c71ecc4e51b5ae 100644 --- a/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js +++ b/common/src/main/resources/template/js/dsFormPage/dsFormPageDesign.js @@ -18,12 +18,18 @@ layui.config({ form = layui.form; authBtn('1567732055673');//保存控件 + var className = GetUrlParam("className"); + if (isNull(className)) { + winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); + return false; + } + + // 加载表单控件 + loadLeftBoxItem(); + // 加载属性 + loadClassAttr(); AjaxPostUtil.request({url: reqBasePath + "dsformpage004", params: {pageId: parent.rowId}, type: 'json', method: 'GET', callback: function (json) { - // 加载表单控件 - loadLeftBoxItem(); - // 加载拖拽 - setup_draggable(); // 加载页面内容 loadPageMation(json); }}); @@ -80,7 +86,7 @@ layui.config({ } // 加载表单控件 - function loadLeftBoxItem(){ + function loadLeftBoxItem() { showGrid({ id: "btnBox", url: reqBasePath + "queryAllDsFormComponentList", @@ -98,36 +104,57 @@ layui.config({ }, ajaxSendAfter:function (json) { form.render(); + $(".draggable").draggable({ + appendTo: "body", + helper: "clone", + drag: function (event, ui) {}, + stop: function () {} + }); + $(".droppable").droppable({ + accept: ".draggable", + helper: "clone", + hoverClass: "droppable-active", + drop: function(event, ui) { + $(".empty-form").remove(); + var _this = $(ui.draggable); + if (!_this.hasClass("dropped")) { + getFormPageControlContent(_this.attr("rowid")); + } else { + if ($(this)[0] != _this.parent()[0]) { + var $el = _this.clone().appendTo(this); + _this.remove() + } + } + } + }).sortable(); } }); } + + // 加载属性 + function loadClassAttr() { + showGrid({ + id: "attrBox", + url: reqBasePath + "queryAttrDefinitionList", + params: {className: className}, + pagination: false, + method: 'POST', + template: $("#leftAttrBoxItem").html(), + ajaxSendLoadBefore: function (hdb, json) { + $.each(json.rows, function (i, item) { + if (isNull(item.dsFormComponent)) { + item.class = "no-choose"; + } else { + item.iLabelClass = "i-label-class"; + } + }); + }, + ajaxSendAfter:function (json) { + + } + }); + } - var setup_draggable = function() { - $(".draggable").draggable({ - appendTo: "body", - helper: "clone", - drag: function (event, ui) {}, - stop: function () {} - }); - $(".droppable").droppable({ - accept: ".draggable", - helper: "clone", - hoverClass: "droppable-active", - drop: function(event, ui) { - $(".empty-form").remove(); - var _this = $(ui.draggable); - if (!_this.hasClass("dropped")) { - getFormPageControlContent(_this.attr("rowid")); - } else { - if ($(this)[0] != _this.parent()[0]) { - var $el = _this.clone().appendTo(this); - _this.remove() - } - } - } - }).sortable(); - }; - function getFormPageControlContent(id) { var linkedData; //控件关联的数据 var defaultData; //选择事件的默认数据 diff --git a/common/src/main/resources/template/js/dsFormPage/pageList.js b/common/src/main/resources/template/js/dsFormPage/pageList.js index 0f8327946a5027dad4c8291bfbae58b9661f44b7..57f75df39e9888e10cb04f5e645fd5a15250b362 100644 --- a/common/src/main/resources/template/js/dsFormPage/pageList.js +++ b/common/src/main/resources/template/js/dsFormPage/pageList.js @@ -84,7 +84,7 @@ layui.config({ function control(data) { rowId = data.id; parent.parent._openNewWindows({ - url: "../../tpl/dsFormPage/dsFormPageDesign.html", + url: "../../tpl/dsFormPage/dsFormPageDesign.html?className=" + objectId, title: "表单设计", pageId: "dsFormPageDesign", area: ['100vw', '100vh'], diff --git a/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.css b/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.css index 9aad2bbef5ad188a8db564479237ffc2672b59d2..91c692762fb1e203150b806ff5483949fd9d1a2f 100644 --- a/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.css +++ b/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.css @@ -10,7 +10,6 @@ display: inline-block; background: #fff; color: #000; - width: 85px; height: 70px; line-height: 1; text-align: center; @@ -18,6 +17,26 @@ z-index: 2; } +.attr-mation { + height: 28px; + line-height: 28px; + text-align: left; + padding: 0px 10px; +} + +.no-choose { + cursor: not-allowed; + color: grey; +} + +.attr-mation .fa { + margin-right: 5px; +} + +.attr-mation .i-label-class { + cursor: move; +} + .btntext:hover { background-color: #2e73ff; color: #ffffff; diff --git a/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.html b/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.html index b53ee9c6337237fd911c8fde0f475ebbb5a7c929..e963608242f6c36d07df4a20f2bc3b3d818927af 100644 --- a/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.html +++ b/common/src/main/resources/template/tpl/dsFormPage/dsFormPageDesign.html @@ -9,13 +9,22 @@ -
+
-
- +
+
+
    +
  • 基本组件
  • +
  • 属性
  • +
+
+
+
+
+
@@ -47,6 +56,16 @@ {{/each}} + +