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