Commit 2ed0388c authored by 赵啸非's avatar 赵啸非

引入新的表单生成器

parent e92e7d49
...@@ -180,6 +180,7 @@ export default { ...@@ -180,6 +180,7 @@ export default {
}, },
methods: { methods: {
preview(){ preview(){
console.log("list",this.list)
const clone = JSON.parse(JSON.stringify(this.list)) const clone = JSON.parse(JSON.stringify(this.list))
this.itemList = clone; this.itemList = clone;
this.previewVisible= true; this.previewVisible= true;
......
...@@ -170,6 +170,12 @@ export default { ...@@ -170,6 +170,12 @@ export default {
const jsonObject = JSON.parse(json); const jsonObject = JSON.parse(json);
this.designList = []; this.designList = [];
this.designList = this.designList.concat(jsonObject.list); this.designList = this.designList.concat(jsonObject.list);
},
refresh(value){
console.log("value",value)
const formData = JSON.parse(value);
this.designList= formData.list;
this.formConfig = formData.config;
} }
}, },
computed:{ computed:{
...@@ -193,7 +199,9 @@ export default { ...@@ -193,7 +199,9 @@ export default {
}, },
watch:{ watch:{
value(newVal){ value(newVal){
if(newVal !==''){ if(newVal !==''){
console.log("newVal",newVal)
const formData = JSON.parse(newVal); const formData = JSON.parse(newVal);
this.designList= formData.list; this.designList= formData.list;
this.formConfig = formData.config; this.formConfig = formData.config;
......
<template> <template>
<div class="page"> <div class="page">
<form-designer ref="formDesigner" :value="tmp" v-model="form1.fdForm"></form-designer> <form-designer ref="formDesigner" :value=tmp v-model="form1.fdForm"></form-designer>
</div> </div>
</template> </template>
...@@ -13,11 +13,15 @@ ...@@ -13,11 +13,15 @@
created() { created() {
console.log("form",this.form) console.log("form",this.form)
console.log("tmp",this.tmp)
this.$ref.formDesigner
}, },
methods: { methods: {
beforeRender(data) { beforeRender(data) {
this.tmp=data.entity.formContent this.tmp=data.entity.formContent
console.log("data",data) this.$refs.formDesigner.refresh(this.tmp);
return data return data
}, },
......
...@@ -3510,7 +3510,7 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0: ...@@ -3510,7 +3510,7 @@ debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0:
dependencies: dependencies:
ms "2.1.2" ms "2.1.2"
debuglog@*, debuglog@^1.0.1: debuglog@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.npmmirror.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" resolved "https://registry.npmmirror.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
integrity sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw== integrity sha512-syBZ+rnAK3EgMsH2aYEOLUW7mZSY9Gb+0wUMCFsZvcmiz+HigA0LOcq/HoQqVuGG+EKykunc7QG2bzrponfaSw==
...@@ -5687,7 +5687,7 @@ import-local@^2.0.0: ...@@ -5687,7 +5687,7 @@ import-local@^2.0.0:
pkg-dir "^3.0.0" pkg-dir "^3.0.0"
resolve-cwd "^2.0.0" resolve-cwd "^2.0.0"
imurmurhash@*, imurmurhash@^0.1.4: imurmurhash@^0.1.4:
version "0.1.4" version "0.1.4"
resolved "https://registry.nlark.com/imurmurhash/download/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" resolved "https://registry.nlark.com/imurmurhash/download/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
...@@ -6775,11 +6775,6 @@ lockfile@^1.0.4: ...@@ -6775,11 +6775,6 @@ lockfile@^1.0.4:
dependencies: dependencies:
signal-exit "^3.0.2" signal-exit "^3.0.2"
lodash._baseindexof@*:
version "3.1.0"
resolved "https://registry.npmmirror.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
integrity sha512-bSYo8Pc/f0qAkr8fPJydpJjtrHiSynYfYBjtANIgXv5xEf1WlTC63dIDlgu0s9dmTvzRu1+JJTxcIAHe+sH0FQ==
lodash._baseuniq@~4.6.0: lodash._baseuniq@~4.6.0:
version "4.6.0" version "4.6.0"
resolved "https://registry.npmmirror.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" resolved "https://registry.npmmirror.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
...@@ -6788,33 +6783,11 @@ lodash._baseuniq@~4.6.0: ...@@ -6788,33 +6783,11 @@ lodash._baseuniq@~4.6.0:
lodash._createset "~4.0.0" lodash._createset "~4.0.0"
lodash._root "~3.0.0" lodash._root "~3.0.0"
lodash._bindcallback@*:
version "3.0.1"
resolved "https://registry.npmmirror.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
integrity sha512-2wlI0JRAGX8WEf4Gm1p/mv/SZ+jLijpj0jyaE/AXeuQphzCgD8ZQW4oSpoN8JAopujOFGU3KMuq7qfHBWlGpjQ==
lodash._cacheindexof@*:
version "3.0.2"
resolved "https://registry.npmmirror.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
integrity sha512-S8dUjWr7SUT/X6TBIQ/OYoCHo1Stu1ZRy6uMUSKqzFnZp5G5RyQizSm6kvxD2Ewyy6AVfMg4AToeZzKfF99T5w==
lodash._createcache@*:
version "3.1.2"
resolved "https://registry.npmmirror.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
integrity sha512-ev5SP+iFpZOugyab/DEUQxUeZP5qyciVTlgQ1f4Vlw7VUcCD8fVnyIqVUEIaoFH9zjAqdgi69KiofzvVmda/ZQ==
dependencies:
lodash._getnative "^3.0.0"
lodash._createset@~4.0.0: lodash._createset@~4.0.0:
version "4.0.3" version "4.0.3"
resolved "https://registry.npmmirror.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" resolved "https://registry.npmmirror.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
integrity sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA== integrity sha512-GTkC6YMprrJZCYU3zcqZj+jkXkrXzq3IPBcF/fIPpNEAB4hZEtXU8zp/RwKOvZl43NUmwDbyRk3+ZTbeRdEBXA==
lodash._getnative@*, lodash._getnative@^3.0.0:
version "3.9.1"
resolved "https://registry.npmmirror.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
integrity sha512-RrL9VxMEPyDMHOd9uFbvMe8X55X16/cGM5IgOKgRElQZutpX89iS6vwl64duTV1/16w5JY7tuFNXqoekmh1EmA==
lodash._root@~3.0.0: lodash._root@~3.0.0:
version "3.0.1" version "3.0.1"
resolved "https://registry.npmmirror.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" resolved "https://registry.npmmirror.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
...@@ -6860,11 +6833,6 @@ lodash.padend@4.6.1: ...@@ -6860,11 +6833,6 @@ lodash.padend@4.6.1:
resolved "https://registry.npm.taobao.org/lodash.padend/download/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e" resolved "https://registry.npm.taobao.org/lodash.padend/download/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e"
integrity sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4= integrity sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=
lodash.restparam@*:
version "3.6.1"
resolved "https://registry.npmmirror.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
integrity sha512-L4/arjjuq4noiUJpt3yS6KIKDtJwNe2fIYgMqyYYKoeIfV1iEqvPwhCx23o+R9dzouGihDAPN1dTIRWa7zk8tw==
lodash.transform@^4.6.0: lodash.transform@^4.6.0:
version "4.6.0" version "4.6.0"
resolved "https://registry.nlark.com/lodash.transform/download/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0" resolved "https://registry.nlark.com/lodash.transform/download/lodash.transform-4.6.0.tgz#12306422f63324aed8483d3f38332b5f670547a0"
......
...@@ -9,7 +9,7 @@ import lombok.Data; ...@@ -9,7 +9,7 @@ import lombok.Data;
public class ColumnsItem { public class ColumnsItem {
@JSONField(name = "labelWidth") @JSONField(name = "labelWidth")
private int labelWidth; private Integer labelWidth;
@JSONField(name = "rules") @JSONField(name = "rules")
private List<RulesItem> rules; private List<RulesItem> rules;
...@@ -18,10 +18,10 @@ public class ColumnsItem { ...@@ -18,10 +18,10 @@ public class ColumnsItem {
private String compName; private String compName;
@JSONField(name = "showLabel") @JSONField(name = "showLabel")
private boolean showLabel; private Boolean showLabel;
@JSONField(name = "required") @JSONField(name = "required")
private boolean required; private Boolean required;
@JSONField(name = "compType") @JSONField(name = "compType")
private String compType; private String compType;
...@@ -36,7 +36,7 @@ public class ColumnsItem { ...@@ -36,7 +36,7 @@ public class ColumnsItem {
private String action; private String action;
@JSONField(name = "disabled") @JSONField(name = "disabled")
private boolean disabled; private Boolean disabled;
@JSONField(name = "id") @JSONField(name = "id")
private String id; private String id;
...@@ -54,22 +54,22 @@ public class ColumnsItem { ...@@ -54,22 +54,22 @@ public class ColumnsItem {
private String ele; private String ele;
@JSONField(name = "filterable") @JSONField(name = "filterable")
private boolean filterable; private Boolean filterable;
@JSONField(name = "clearable") @JSONField(name = "clearable")
private boolean clearable; private Boolean clearable;
@JSONField(name = "plain") @JSONField(name = "plain")
private boolean plain; private Boolean plain;
@JSONField(name = "round") @JSONField(name = "round")
private boolean round; private Boolean round;
@JSONField(name = "circle") @JSONField(name = "circle")
private boolean circle; private Boolean circle;
@JSONField(name = "loading") @JSONField(name = "loading")
private boolean loading; private Boolean loading;
@JSONField(name = "icon") @JSONField(name = "icon")
private String icon; private String icon;
...@@ -87,10 +87,10 @@ public class ColumnsItem { ...@@ -87,10 +87,10 @@ public class ColumnsItem {
private String dataType; private String dataType;
@JSONField(name = "multiple") @JSONField(name = "multiple")
private boolean multiple; private Boolean multiple;
@JSONField(name = "collapse-tags") @JSONField(name = "collapse-tags")
private boolean collapseTags; private Boolean collapseTags;
@JSONField(name = "label") @JSONField(name = "label")
private String label; private String label;
...@@ -99,7 +99,7 @@ public class ColumnsItem { ...@@ -99,7 +99,7 @@ public class ColumnsItem {
private String layout; private String layout;
@JSONField(name = "gutter") @JSONField(name = "gutter")
private int gutter; private Integer gutter;
@JSONField(name = "ruleError") @JSONField(name = "ruleError")
private String ruleError; private String ruleError;
...@@ -123,22 +123,22 @@ public class ColumnsItem { ...@@ -123,22 +123,22 @@ public class ColumnsItem {
private String _id; private String _id;
@JSONField(name = "config") @JSONField(name = "config")
private boolean config; private Boolean config;
@JSONField(name = "border") @JSONField(name = "border")
private boolean border; private Boolean border;
@JSONField(name = "show-word-limit") @JSONField(name = "show-word-limit")
private boolean showWordLimit; private Boolean showWordLimit;
@JSONField(name = "maxLength") @JSONField(name = "maxLength")
private int maxLength; private Integer maxLength;
@JSONField(name = "rows") @JSONField(name = "rows")
private int rows; private Integer rows;
@JSONField(name = "span") @JSONField(name = "span")
private int span; private Integer span;
@JSONField(name = "rulesType") @JSONField(name = "rulesType")
private String rulesType; private String rulesType;
...@@ -150,7 +150,7 @@ public class ColumnsItem { ...@@ -150,7 +150,7 @@ public class ColumnsItem {
private String prefixIcon; private String prefixIcon;
@JSONField(name = "readonly") @JSONField(name = "readonly")
private boolean readonly; private Boolean readonly;
@JSONField(name = "suffix-icon") @JSONField(name = "suffix-icon")
private String suffixIcon; private String suffixIcon;
......
...@@ -10,7 +10,7 @@ public class FormDesignConfig { ...@@ -10,7 +10,7 @@ public class FormDesignConfig {
private String formRef; private String formRef;
@JSONField(name="gutter") @JSONField(name="gutter")
private int gutter; private Integer gutter;
@JSONField(name="size") @JSONField(name="size")
private String size; private String size;
...@@ -22,16 +22,16 @@ public class FormDesignConfig { ...@@ -22,16 +22,16 @@ public class FormDesignConfig {
private String labelPosition; private String labelPosition;
@JSONField(name="dynamicTableAllowed") @JSONField(name="dynamicTableAllowed")
private boolean dynamicTableAllowed; private Boolean dynamicTableAllowed;
@JSONField(name="rules") @JSONField(name="rules")
private String rules; private String rules;
@JSONField(name="labelWidth") @JSONField(name="labelWidth")
private int labelWidth; private Integer labelWidth;
@JSONField(name="disabled") @JSONField(name="disabled")
private boolean disabled; private Boolean disabled;
@JSONField(name="formModel") @JSONField(name="formModel")
private String formModel; private String formModel;
...@@ -39,7 +39,6 @@ public class FormDesignConfig { ...@@ -39,7 +39,6 @@ public class FormDesignConfig {
@JSONField(name="version") @JSONField(name="version")
private String version; private String version;
public void initAttribute() { public void initAttribute() {
this.formRef = "elForm"; this.formRef = "elForm";
this.formModel="form"; this.formModel="form";
...@@ -50,6 +49,7 @@ public class FormDesignConfig { ...@@ -50,6 +49,7 @@ public class FormDesignConfig {
this.formRules="rules"; this.formRules="rules";
this.gutter=15; this.gutter=15;
this.disabled = false; this.disabled = false;
this.dynamicTableAllowed=true;
this.version = "1.10"; this.version = "1.10";
} }
......
...@@ -8,22 +8,22 @@ import lombok.Data; ...@@ -8,22 +8,22 @@ import lombok.Data;
public class ListItem{ public class ListItem{
@JSONField(name="showIndex") @JSONField(name="showIndex")
private boolean showIndex; private Boolean showIndex;
@JSONField(name="visible") @JSONField(name="visible")
private boolean visible; private Boolean visible;
@JSONField(name="multiCheck") @JSONField(name="multiCheck")
private boolean multiCheck; private Boolean multiCheck;
@JSONField(name="columns") @JSONField(name="columns")
private List<ColumnsItem> columns; private List<ColumnsItem> columns;
@JSONField(name="buttonDel") @JSONField(name="buttonDel")
private boolean buttonDel; private Boolean buttonDel;
@JSONField(name="labelWidth") @JSONField(name="labelWidth")
private int labelWidth; private Integer labelWidth;
@JSONField(name="summary-text") @JSONField(name="summary-text")
private String summaryText; private String summaryText;
...@@ -32,10 +32,10 @@ public class ListItem{ ...@@ -32,10 +32,10 @@ public class ListItem{
private String compName; private String compName;
@JSONField(name="showLabel") @JSONField(name="showLabel")
private boolean showLabel; private Boolean showLabel;
@JSONField(name="show-summary") @JSONField(name="show-summary")
private boolean showSummary; private Boolean showSummary;
@JSONField(name="layout") @JSONField(name="layout")
private String layout; private String layout;
...@@ -53,13 +53,13 @@ public class ListItem{ ...@@ -53,13 +53,13 @@ public class ListItem{
private String compIcon; private String compIcon;
@JSONField(name="config") @JSONField(name="config")
private boolean config; private Boolean config;
@JSONField(name="ele") @JSONField(name="ele")
private String ele; private String ele;
@JSONField(name="buttonAdd") @JSONField(name="buttonAdd")
private boolean buttonAdd; private Boolean buttonAdd;
@JSONField(name="sum-text") @JSONField(name="sum-text")
private String sumText; private String sumText;
...@@ -74,10 +74,10 @@ public class ListItem{ ...@@ -74,10 +74,10 @@ public class ListItem{
private String label; private String label;
@JSONField(name="displayValue") @JSONField(name="displayValue")
private boolean displayValue; private Boolean displayValue;
@JSONField(name="form") @JSONField(name="form")
private boolean form; private Boolean form;
@JSONField(name="background") @JSONField(name="background")
private String background; private String background;
...@@ -89,16 +89,16 @@ public class ListItem{ ...@@ -89,16 +89,16 @@ public class ListItem{
private String width; private String width;
@JSONField(name="fontSize") @JSONField(name="fontSize")
private int fontSize; private Integer fontSize;
@JSONField(name="value") @JSONField(name="value")
private String value; private String value;
@JSONField(name="span") @JSONField(name="span")
private int span; private Integer span;
@JSONField(name="height") @JSONField(name="height")
private int height; private Integer height;
@JSONField(name="content-position") @JSONField(name="content-position")
private String contentPosition; private String contentPosition;
...@@ -113,28 +113,28 @@ public class ListItem{ ...@@ -113,28 +113,28 @@ public class ListItem{
private String type; private String type;
@JSONField(name="loading") @JSONField(name="loading")
private boolean loading; private Boolean loading;
@JSONField(name="size") @JSONField(name="size")
private String size; private String size;
@JSONField(name="round") @JSONField(name="round")
private boolean round; private Boolean round;
@JSONField(name="plain") @JSONField(name="plain")
private boolean plain; private Boolean plain;
@JSONField(name="disabled") @JSONField(name="disabled")
private boolean disabled; private Boolean disabled;
@JSONField(name="circle") @JSONField(name="circle")
private boolean circle; private Boolean circle;
@JSONField(name="closable") @JSONField(name="closable")
private boolean closable; private Boolean closable;
@JSONField(name="center") @JSONField(name="center")
private boolean center; private Boolean center;
@JSONField(name="description") @JSONField(name="description")
private String description; private String description;
...@@ -143,7 +143,7 @@ public class ListItem{ ...@@ -143,7 +143,7 @@ public class ListItem{
private String title; private String title;
@JSONField(name="show-icon") @JSONField(name="show-icon")
private boolean showIcon; private Boolean showIcon;
@JSONField(name="effect") @JSONField(name="effect")
private String effect; private String effect;
...@@ -155,16 +155,16 @@ public class ListItem{ ...@@ -155,16 +155,16 @@ public class ListItem{
private String color; private String color;
@JSONField(name="show") @JSONField(name="show")
private boolean show; private Boolean show;
@JSONField(name="bold") @JSONField(name="bold")
private int bold; private Integer bold;
@JSONField(name="align") @JSONField(name="align")
private String align; private String align;
@JSONField(name="underline") @JSONField(name="underline")
private boolean underline; private Boolean underline;
@JSONField(name="target") @JSONField(name="target")
private String target; private String target;
...@@ -176,10 +176,10 @@ public class ListItem{ ...@@ -176,10 +176,10 @@ public class ListItem{
private String colConf; private String colConf;
@JSONField(name="required") @JSONField(name="required")
private boolean required; private Boolean required;
@JSONField(name="multi") @JSONField(name="multi")
private boolean multi; private Boolean multi;
@JSONField(name="dval") @JSONField(name="dval")
private String dval; private String dval;
...@@ -191,7 +191,7 @@ public class ListItem{ ...@@ -191,7 +191,7 @@ public class ListItem{
private String action; private String action;
@JSONField(name="gutter") @JSONField(name="gutter")
private int gutter; private Integer gutter;
@JSONField(name="list-type") @JSONField(name="list-type")
private String listType; private String listType;
...@@ -200,22 +200,22 @@ public class ListItem{ ...@@ -200,22 +200,22 @@ public class ListItem{
private String tips; private String tips;
@JSONField(name="show-file-list") @JSONField(name="show-file-list")
private boolean showFileList; private Boolean showFileList;
@JSONField(name="buttonText") @JSONField(name="buttonText")
private String buttonText; private String buttonText;
@JSONField(name="showTip") @JSONField(name="showTip")
private boolean showTip; private Boolean showTip;
@JSONField(name="multiple") @JSONField(name="multiple")
private boolean multiple; private Boolean multiple;
@JSONField(name="accept") @JSONField(name="accept")
private String accept; private String accept;
@JSONField(name="fileSize") @JSONField(name="fileSize")
private int fileSize; private Integer fileSize;
@JSONField(name="name") @JSONField(name="name")
private String name; private String name;
...@@ -233,22 +233,22 @@ public class ListItem{ ...@@ -233,22 +233,22 @@ public class ListItem{
private String placeholder; private String placeholder;
@JSONField(name="china-area-data") @JSONField(name="china-area-data")
private boolean chinaAreaData; private Boolean chinaAreaData;
@JSONField(name="color-format") @JSONField(name="color-format")
private String colorFormat; private String colorFormat;
@JSONField(name="show-alpha") @JSONField(name="show-alpha")
private boolean showAlpha; private Boolean showAlpha;
@JSONField(name="predefine") @JSONField(name="predefine")
private List<Object> predefine; private List<Object> predefine;
@JSONField(name="validateMaxText") @JSONField(name="validateMaxText")
private boolean validateMaxText; private Boolean validateMaxText;
@JSONField(name="max") @JSONField(name="max")
private int max; private Integer max;
@JSONField(name="customRules") @JSONField(name="customRules")
private List<RulesItem> customRules; private List<RulesItem> customRules;
...@@ -260,16 +260,16 @@ public class ListItem{ ...@@ -260,16 +260,16 @@ public class ListItem{
private List<RulesItem> rules; private List<RulesItem> rules;
@JSONField(name="readonly") @JSONField(name="readonly")
private boolean readonly; private Boolean readonly;
@JSONField(name="arrow-control") @JSONField(name="arrow-control")
private boolean arrowControl; private Boolean arrowControl;
@JSONField(name="is-range") @JSONField(name="is-range")
private boolean isRange; private Boolean isRange;
@JSONField(name="clearable") @JSONField(name="clearable")
private boolean clearable; private Boolean clearable;
@JSONField(name="range-separator") @JSONField(name="range-separator")
private String rangeSeparator; private String rangeSeparator;
...@@ -278,7 +278,7 @@ public class ListItem{ ...@@ -278,7 +278,7 @@ public class ListItem{
private String valueFormat; private String valueFormat;
@JSONField(name="maxLength") @JSONField(name="maxLength")
private int maxLength; private Integer maxLength;
@JSONField(name="start-placeholder") @JSONField(name="start-placeholder")
private String startPlaceholder; private String startPlaceholder;
...@@ -287,46 +287,46 @@ public class ListItem{ ...@@ -287,46 +287,46 @@ public class ListItem{
private String endPlaceholder; private String endPlaceholder;
@JSONField(name="show-score") @JSONField(name="show-score")
private boolean showScore; private Boolean showScore;
@JSONField(name="allow-half") @JSONField(name="allow-half")
private boolean allowHalf; private Boolean allowHalf;
@JSONField(name="show-stops") @JSONField(name="show-stops")
private boolean showStops; private Boolean showStops;
@JSONField(name="range") @JSONField(name="range")
private boolean range; private Boolean range;
@JSONField(name="show-tooltip") @JSONField(name="show-tooltip")
private boolean showTooltip; private Boolean showTooltip;
@JSONField(name="min") @JSONField(name="min")
private int min; private Integer min;
@JSONField(name="step") @JSONField(name="step")
private int step; private Integer step;
@JSONField(name="maxlength") @JSONField(name="maxlength")
private int maxlength; private Integer maxlength;
@JSONField(name="rows") @JSONField(name="rows")
private int rows; private Integer rows;
@JSONField(name="ruleError") @JSONField(name="ruleError")
private String ruleError; private String ruleError;
@JSONField(name="show-word-limit") @JSONField(name="show-word-limit")
private boolean showWordLimit; private Boolean showWordLimit;
@JSONField(name="status") @JSONField(name="status")
private String status; private String status;
@JSONField(name="step-strictly") @JSONField(name="step-strictly")
private boolean stepStrictly; private Boolean stepStrictly;
@JSONField(name="precision") @JSONField(name="precision")
private int precision; private Integer precision;
@JSONField(name="controls-position") @JSONField(name="controls-position")
private String controlsPosition; private String controlsPosition;
...@@ -347,19 +347,19 @@ public class ListItem{ ...@@ -347,19 +347,19 @@ public class ListItem{
private String inactiveValue; private String inactiveValue;
@JSONField(name="vertical") @JSONField(name="vertical")
private boolean vertical; private Boolean vertical;
@JSONField(name="optionType") @JSONField(name="optionType")
private String optionType; private String optionType;
@JSONField(name="border") @JSONField(name="border")
private boolean border; private Boolean border;
@JSONField(name="filterable") @JSONField(name="filterable")
private boolean filterable; private Boolean filterable;
@JSONField(name="collapse-tags") @JSONField(name="collapse-tags")
private boolean collapseTags; private Boolean collapseTags;
@JSONField(name="rulesType") @JSONField(name="rulesType")
private String rulesType; private String rulesType;
......
...@@ -14,7 +14,7 @@ public class OptionsItem{ ...@@ -14,7 +14,7 @@ public class OptionsItem{
private String value; private String value;
@JSONField(name="disabled") @JSONField(name="disabled")
private boolean disabled; private Boolean disabled;
@JSONField(name="children") @JSONField(name="children")
private List<ChildrenItem> children; private List<ChildrenItem> children;
......
...@@ -7,13 +7,13 @@ import lombok.Data; ...@@ -7,13 +7,13 @@ import lombok.Data;
public class Props{ public class Props{
@JSONField(name="filterable") @JSONField(name="filterable")
private boolean filterable; private Boolean filterable;
@JSONField(name="clearable") @JSONField(name="clearable")
private boolean clearable; private Boolean clearable;
@JSONField(name="show-all-levels") @JSONField(name="show-all-levels")
private boolean showAllLevels; private Boolean showAllLevels;
@JSONField(name="separator") @JSONField(name="separator")
private String separator; private String separator;
...@@ -25,10 +25,10 @@ public class Props{ ...@@ -25,10 +25,10 @@ public class Props{
private String children; private String children;
@JSONField(name="multiple") @JSONField(name="multiple")
private boolean multiple; private Boolean multiple;
@JSONField(name="checkStrictly") @JSONField(name="checkStrictly")
private boolean checkStrictly; private Boolean checkStrictly;
@JSONField(name="label") @JSONField(name="label")
private String label; private String label;
......
package com.mortals.xhx.common.formdesign; package com.mortals.xhx.common.formdesign;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
@Data
public class RulesItem { public class RulesItem {
@JSONField(name="msg") @JSONField(name="msg")
......
...@@ -57,7 +57,7 @@ public class DesignDynamicTableComponent extends DesignComponent { ...@@ -57,7 +57,7 @@ public class DesignDynamicTableComponent extends DesignComponent {
//创建输入框出初始值 //创建输入框出初始值
columnsItem.setId(item.getVal()); columnsItem.setId(item.getVal());
columnsItem.set_id(item.getVal()); columnsItem.set_id(item.getVal());
columnsItem.setCompType("input"); columnsItem.setCompType("el-input");
columnsItem.setCompName("单行文本"); columnsItem.setCompName("单行文本");
columnsItem.setCompIcon("input"); columnsItem.setCompIcon("input");
columnsItem.setViewType("text"); columnsItem.setViewType("text");
...@@ -66,7 +66,7 @@ public class DesignDynamicTableComponent extends DesignComponent { ...@@ -66,7 +66,7 @@ public class DesignDynamicTableComponent extends DesignComponent {
columnsItem.setShowLabel(true); columnsItem.setShowLabel(true);
columnsItem.setLabel(item.getLabel()); columnsItem.setLabel(item.getLabel());
columnsItem.setLabelWidth(120); columnsItem.setLabelWidth(120);
columnsItem.setPlaceholder("请输入" + cons.getLabel()); columnsItem.setPlaceholder("请输入" + item.getLabel());
columnsItem.setRequired(false); columnsItem.setRequired(false);
columnsItem.setMaxLength(50); columnsItem.setMaxLength(50);
columnsItem.setGutter(15); columnsItem.setGutter(15);
...@@ -83,6 +83,57 @@ public class DesignDynamicTableComponent extends DesignComponent { ...@@ -83,6 +83,57 @@ public class DesignDynamicTableComponent extends DesignComponent {
columnsItem.setAppend(""); columnsItem.setAppend("");
columnsItem.setPrepend(""); columnsItem.setPrepend("");
columnsItem.setLayout("colItem"); columnsItem.setLayout("colItem");
}else if(item.getColType().equals(ComponentEnum.TEXTAREA.getValue())){
columnsItem.setId(item.getVal());
columnsItem.set_id(item.getVal());
columnsItem.setCompType("textarea");
columnsItem.setEle("el-input");
columnsItem.setCompName("多行文本");
columnsItem.setCompIcon("textarea");
columnsItem.setViewType("text");
columnsItem.setType("textarea");
columnsItem.setConfig(true);
columnsItem.setShowLabel(true);
columnsItem.setLabel(item.getLabel());
columnsItem.setLabelWidth(120);
columnsItem.setPlaceholder("请输入" + item.getLabel());
columnsItem.setRequired(false);
columnsItem.setMaxLength(200);
columnsItem.setShowWordLimit(true);
columnsItem.setGutter(15);
columnsItem.setSpan(24);
columnsItem.setClearable(true);
columnsItem.setDisabled(false);
columnsItem.setReadonly(false);
columnsItem.setRows(4);
columnsItem.setStatus("normal");
columnsItem.setValue(""); //设置默认值
columnsItem.setRules(Lists.newArrayList());
columnsItem.setRuleError("该字段不能为空");
columnsItem.setRulesType("default");
columnsItem.setLayout("colItem");
}else if(item.getColType().equals(ComponentEnum.DATE.getValue())){
columnsItem.setId(item.getVal());
columnsItem.set_id(item.getVal());
columnsItem.setCompType("date");
columnsItem.setEle("el-date-picker");
columnsItem.setCompName("日期");
columnsItem.setCompIcon("date");
columnsItem.setViewType("text");
columnsItem.setConfig(true);
columnsItem.setShowLabel(true);
columnsItem.setLabel(item.getLabel());
columnsItem.setLabelWidth(120);
columnsItem.setType("date");
columnsItem.setPlaceholder("请选择" + item.getLabel());
columnsItem.setRequired(false);
columnsItem.setMaxLength(50);
columnsItem.setGutter(15);
columnsItem.setSpan(12);
columnsItem.setRangeSeparator(" ");
columnsItem.setFormat("yyyy 年 MM 月 dd 日");
columnsItem.setValueFormat("yyyy 年 MM 月 dd 日");
columnsItem.setLayout("colItem");
} }
return columnsItem; return columnsItem;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
......
...@@ -32,7 +32,7 @@ public class DesignInputComponent extends DesignComponent { ...@@ -32,7 +32,7 @@ public class DesignInputComponent extends DesignComponent {
columnsItem.setCompType("input"); columnsItem.setCompType("input");
columnsItem.setCompName(cons.getLabel()); columnsItem.setCompName(cons.getLabel());
columnsItem.setCompIcon("input"); columnsItem.setCompIcon("input");
columnsItem.setEle("input"); columnsItem.setEle("el-input");
columnsItem.setViewType("text"); columnsItem.setViewType("text");
columnsItem.setConfig(true); columnsItem.setConfig(true);
columnsItem.setShowLabel(true); columnsItem.setShowLabel(true);
......
...@@ -31,7 +31,7 @@ public class DesignTextAreaComponent extends DesignComponent { ...@@ -31,7 +31,7 @@ public class DesignTextAreaComponent extends DesignComponent {
columnsItem.set_id(cons.getVal()); columnsItem.set_id(cons.getVal());
columnsItem.setCompType("textarea"); columnsItem.setCompType("textarea");
columnsItem.setEle("el-input"); columnsItem.setEle("el-input");
columnsItem.setCompName(cons.getLabel()); columnsItem.setCompName("多行文本");
columnsItem.setCompIcon("textarea"); columnsItem.setCompIcon("textarea");
columnsItem.setViewType("text"); columnsItem.setViewType("text");
columnsItem.setType("textarea"); columnsItem.setType("textarea");
......
...@@ -82,7 +82,7 @@ public class DocBaseinfoServiceImpl extends AbstractCRUDServiceImpl<DocBaseinfoD ...@@ -82,7 +82,7 @@ public class DocBaseinfoServiceImpl extends AbstractCRUDServiceImpl<DocBaseinfoD
String newName = RandomUtil.randomNumbers(12) + ".jpg"; String newName = RandomUtil.randomNumbers(12) + ".jpg";
String filePathAll = filePath + newName; String filePathAll = filePath + newName;
//WordUtil.convertWordToJPEG(samplePath, filePathAll); WordUtil.convertWordToJPEG(samplePath, filePathAll);
entity.setPreViewPath(prePath + newName); entity.setPreViewPath(prePath + newName);
//校验模板变量正确性 todo //校验模板变量正确性 todo
......
...@@ -48,7 +48,6 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD ...@@ -48,7 +48,6 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD
@Autowired @Autowired
private DocFormService docFormService; private DocFormService docFormService;
@Value("${upload.path}") @Value("${upload.path}")
private String filePath; private String filePath;
...@@ -249,7 +248,6 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD ...@@ -249,7 +248,6 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD
builderTable.buildGramer("[", "]"); builderTable.buildGramer("[", "]");
XWPFTemplate templateTable = XWPFTemplate.compile(filepath, builderTable.build()); XWPFTemplate templateTable = XWPFTemplate.compile(filepath, builderTable.build());
templateTable.getElementTemplates().forEach(col -> { templateTable.getElementTemplates().forEach(col -> {
String colVal = StrUtil.strip(col.variable(), "[", "]"); String colVal = StrUtil.strip(col.variable(), "[", "]");
List<String> colKeys = StrSplitter.split(colVal, "_", true, true); List<String> colKeys = StrSplitter.split(colVal, "_", true, true);
if (colKeys.size() > 2) { if (colKeys.size() > 2) {
...@@ -275,24 +273,6 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD ...@@ -275,24 +273,6 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD
} }
} }
root.setList(collect); root.setList(collect);
// Component component = Component.createType(type);
// FieldsItem fieldItem = component.buildDefaultComponent(cons);
// //显示的label
// fieldItem.getConfig().setLabel(cons.getLabel());
// Integer formId = 100 + i + j;
// fieldItem.getConfig().setFormId(formId);
// fieldItem.getConfig().setRenderKey(formId + RandomUtil.randomNumbers(13));
// //设定输入框绑定的key
// fieldItem.setVModel(cons.getVal());
// root.getFields().add(fieldItem);
// }
//
// //data.put(item.variable(), item.variable());
// return null;
//
// }).collect(Collectors.toList());
DocFormEntity docFormEntity = docFormService.selectOne(new DocFormQuery().templateId(docTemplateEntity.getId())); DocFormEntity docFormEntity = docFormService.selectOne(new DocFormQuery().templateId(docTemplateEntity.getId()));
if (ObjectUtils.isEmpty(docFormEntity)) { if (ObjectUtils.isEmpty(docFormEntity)) {
docFormEntity = new DocFormEntity(); docFormEntity = new DocFormEntity();
...@@ -309,41 +289,7 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD ...@@ -309,41 +289,7 @@ public class DocTemplateServiceImpl extends AbstractCRUDServiceImpl<DocTemplateD
docFormEntity.setUpdateUser(context.getUser().getLoginName()); docFormEntity.setUpdateUser(context.getUser().getLoginName());
docFormService.update(docFormEntity, context); docFormService.update(docFormEntity, context);
} }
//template.render(data);
} }
public List<OptionsItem> initYears() {
List<OptionsItem> list = new ArrayList<>();
for (int i = 2020; i < 2030; i++) {
OptionsItem optionsItem = new OptionsItem();
optionsItem.setLabel(i + "");
optionsItem.setValue(i + "");
list.add(optionsItem);
}
return list;
}
public List<OptionsItem> initMonths() {
List<OptionsItem> list = new ArrayList<>();
for (int i = 1; i <= 12; i++) {
OptionsItem optionsItem = new OptionsItem();
optionsItem.setLabel(i + "");
optionsItem.setValue(i + "");
list.add(optionsItem);
}
return list;
}
public List<OptionsItem> initDays() {
List<OptionsItem> list = new ArrayList<>();
for (int i = 1; i <= 31; i++) {
OptionsItem optionsItem = new OptionsItem();
optionsItem.setLabel(i + "");
optionsItem.setValue(i + "");
list.add(optionsItem);
}
return list;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment