Commit d797e6d756beab25e30608d5108bdaf342c535f1

Authored by zhangdaiscott
1 parent fadd87d0

代码生成器,让不对接流程的表单,生成的页面代码更简洁

代码生成器,树列表固定操作列,解决列表分类未翻译问题
代码生成器,树列表新增,会默认加上上次选的父节点问题
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/one/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
... ... @@ -8,6 +8,7 @@
8 8 <#assign form_popup = false>
9 9 <#assign form_cat_tree = false>
10 10 <#assign form_cat_back = "">
  11 +<#assign bpm_flag=false>
11 12 <#assign form_span = 24>
12 13 <#if tableVo.fieldRowNum==2>
13 14 <#assign form_span = 12>
... ... @@ -17,6 +18,9 @@
17 18 <#assign form_span = 6>
18 19 </#if>
19 20 <#list columns as po>
  21 +<#if po.fieldDbName=='bpm_status'>
  22 + <#assign bpm_flag=true>
  23 +</#if>
20 24 <#if po.isShow =='Y' && po.fieldName != 'id'>
21 25 <#assign form_field_dictCode="">
22 26 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
... ... @@ -102,9 +106,11 @@
102 106 </a-col>
103 107 </#if>
104 108 </#list>
  109 + <#if bpm_flag>
105 110 <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center">
106 111 <a-button @click="submitForm">提 交</a-button>
107 112 </a-col>
  113 + </#if>
108 114 </a-row>
109 115 </a-form-model>
110 116 </j-form-container>
... ... @@ -121,6 +127,7 @@
121 127 components: {
122 128 },
123 129 props: {
  130 + <#if bpm_flag>
124 131 //流程表单data
125 132 formData: {
126 133 type: Object,
... ... @@ -133,6 +140,7 @@
133 140 default: false,
134 141 required: false
135 142 },
  143 + </#if>
136 144 //表单禁用
137 145 disabled: {
138 146 type: Boolean,
... ... @@ -164,14 +172,17 @@
164 172 },
165 173 computed: {
166 174 formDisabled(){
  175 + <#if bpm_flag>
167 176 if(this.formBpm===true){
168 177 if(this.formData.disabled===false){
169 178 return false
170 179 }
171 180 return true
172 181 }
  182 + </#if>
173 183 return this.disabled
174 184 },
  185 + <#if bpm_flag>
175 186 showFlowSubmitButton(){
176 187 if(this.formBpm===true){
177 188 if(this.formData.disabled===false){
... ... @@ -180,12 +191,15 @@
180 191 }
181 192 return false
182 193 }
  194 + </#if>
183 195 },
184 196 created () {
185 197 //备份model原始值
186 198 this.modelDefault = JSON.parse(JSON.stringify(this.model));
  199 + <#if bpm_flag>
187 200 //如果是流程中表单,则需要加载流程表单data
188 201 this.showFlowData();
  202 + </#if>
189 203 },
190 204 methods: {
191 205 add () {
... ... @@ -195,6 +209,7 @@
195 209 this.model = Object.assign({}, record);
196 210 this.visible = true;
197 211 },
  212 + <#if bpm_flag>
198 213 //渲染流程表单数据
199 214 showFlowData(){
200 215 if(this.formBpm === true){
... ... @@ -206,6 +221,7 @@
206 221 });
207 222 }
208 223 },
  224 + </#if>
209 225 submitForm () {
210 226 const that = this;
211 227 // 触发表单验证
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/${entityName}List.vuei
... ... @@ -274,6 +274,14 @@
274 274 <#else>
275 275 customRender: (text) => (!text ? "" : (text == "Y" ? "是" : "否"))
276 276 </#if>
  277 + <#elseif po.classType=='cat_tree'>
  278 + <#if list_need_category>
  279 + dataIndex: '${po.fieldName}',
  280 + customRender: (text) => (text ? filterMultiDictText(this.dictOptions['${po.fieldName}'], text) : '')
  281 + <#else>
  282 + dataIndex: '${po.fieldName}',
  283 + customRender: (text, record) => (text ? record['${po.dictText}'] : '')
  284 + </#if>
277 285 <#else>
278 286 dataIndex: '${po.fieldName}'
279 287 </#if>
... ... @@ -285,6 +293,7 @@
285 293 title: '操作',
286 294 dataIndex: 'action',
287 295 align:"center",
  296 + fixed:"right",
288 297 width:147,
289 298 scopedSlots: { customRender: 'action' },
290 299 }
... ...
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/tree/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Modal.vuei
... ... @@ -155,6 +155,7 @@
155 155 },
156 156 methods: {
157 157 add (obj) {
  158 + this.modelDefault.${pidFieldName}=''
158 159 this.edit(Object.assign(this.modelDefault , obj));
159 160 },
160 161 edit (record) {
... ...