提交 4fd30c49 编写于 作者: JEECG低代码平台's avatar JEECG低代码平台

解决代码生成器模板几个问题:

1.主键换成IdType.ASSIGN_ID
2.生成代码,自定义实体名代码报错问题
3.新模式表单,流程参数个性化定义
上级 37158397
...@@ -48,7 +48,7 @@ public class ${entityName} implements Serializable { ...@@ -48,7 +48,7 @@ public class ${entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
</a-form> </a-form>
</div> </div>
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</a-table> </a-table>
</div> </div>
<${tableName?replace("_","-")}-modal ref="modalForm" @ok="modalFormOk"></${tableName?replace("_","-")}-modal> <${Format.humpToShortbar(entityName)}-modal ref="modalForm" @ok="modalFormOk"></${Format.humpToShortbar(entityName)}-modal>
</a-card> </a-card>
</template> </template>
...@@ -247,7 +247,6 @@ ...@@ -247,7 +247,6 @@
<#if bpm_flag> <#if bpm_flag>
import { postAction } from '@/api/manage' import { postAction } from '@/api/manage'
</#if> </#if>
<#if query_field_select> <#if query_field_select>
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue' import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
</#if> </#if>
...@@ -289,7 +288,7 @@ ...@@ -289,7 +288,7 @@
</#if> </#if>
export default { export default {
name: "${entityName}List", name: '${entityName}List',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: { components: {
<#if query_field_select> <#if query_field_select>
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
</#if> </#if>
export default { export default {
name: "${entityName}Form", name: '${entityName}Form',
components: { components: {
JFormContainer, JFormContainer,
<#if form_date> <#if form_date>
...@@ -218,8 +218,8 @@ ...@@ -218,8 +218,8 @@
default: ()=>{}, default: ()=>{},
required: false required: false
}, },
//表单模式:false流程表单 true普通表单 //表单模式:true流程表单 false普通表单
normal: { formBpm: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false required: false
...@@ -254,25 +254,21 @@ ...@@ -254,25 +254,21 @@
}, },
computed: { computed: {
formDisabled(){ formDisabled(){
if(this.normal===false){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return false return false
}else{
return true
} }
return true
} }
return this.disabled return this.disabled
}, },
showFlowSubmitButton(){ showFlowSubmitButton(){
if(this.normal===false){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return true return true
}else{
return false
} }
}else{
return false
} }
return false
} }
}, },
created () { created () {
...@@ -293,7 +289,7 @@ ...@@ -293,7 +289,7 @@
}, },
//渲染流程表单数据 //渲染流程表单数据
showFlowData(){ showFlowData(){
if(this.normal === false){ if(this.formBpm === true){
let params = {id:this.formData.dataId}; let params = {id:this.formData.dataId};
getAction(this.url.queryById,params).then((res)=>{ getAction(this.url.queryById,params).then((res)=>{
if(res.success){ if(res.success){
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
:visible="visible" :visible="visible"
switchFullscreen switchFullscreen
@ok="handleOk" @ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disablesubmit} }" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel" @cancel="handleCancel"
cancelText="关闭"> cancelText="关闭">
<${tableName?replace("_","-")}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${tableName?replace("_","-")}-form> <${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></${Format.humpToShortbar(entityName)}-form>
</j-modal> </j-modal>
</template> </template>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
import ${entityName}Form from './${entityName}Form' import ${entityName}Form from './${entityName}Form'
export default { export default {
name: "${entityName}Modal", name: '${entityName}Modal',
components: { components: {
${entityName}Form ${entityName}Form
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
:closable="false" :closable="false"
@close="close" @close="close"
:visible="visible"> :visible="visible">
<${tableName?replace("_","-")}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${tableName?replace("_","-")}-form> <${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></${Format.humpToShortbar(entityName)}-form>
<div class="drawer-footer"> <div class="drawer-footer">
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
import ${entityName}Form from './${entityName}Form' import ${entityName}Form from './${entityName}Form'
export default { export default {
name: "${entityName}Modal", name: '${entityName}Modal',
components: { components: {
${entityName}Form ${entityName}Form
}, },
......
...@@ -42,7 +42,7 @@ public class ${entityName} implements Serializable { ...@@ -42,7 +42,7 @@ public class ${entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -43,7 +43,7 @@ public class ${subTab.entityName} implements Serializable { ...@@ -43,7 +43,7 @@ public class ${subTab.entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
</a-table> </a-table>
</div> </div>
<${tableName?replace("_","-")}-modal ref="modalForm" @ok="modalFormOk"/> <${Format.humpToShortbar(entityName)}-modal ref="modalForm" @ok="modalFormOk"/>
</a-card> </a-card>
</template> </template>
......
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
required: false required: false
}, },
//表单模式:false流程表单 true普通表单 //表单模式:false流程表单 true普通表单
normal: { formBpm: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false required: false
...@@ -430,25 +430,21 @@ ...@@ -430,25 +430,21 @@
}, },
computed: { computed: {
formDisabled(){ formDisabled(){
if(this.normal===false){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return false return false
}else{
return true
} }
return true
} }
return this.disabled return this.disabled
}, },
showFlowSubmitButton(){ showFlowSubmitButton(){
if(this.normal===false){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return true return true
}else{
return false
} }
}else{
return false
} }
return false
} }
}, },
created () { created () {
...@@ -456,6 +452,16 @@ ...@@ -456,6 +452,16 @@
this.showFlowData(); this.showFlowData();
}, },
methods: { methods: {
addBefore(){
this.form.resetFields()
<#list subTables as sub><#rt/>
<#if sub.foreignRelationType =='1'>
this.$refs.${sub.entityName?uncap_first}Form.clearFormData()
<#else>
this.${sub.entityName?uncap_first}Table.dataSource=[]
</#if>
</#list>
},
getAllTable() { getAllTable() {
<#if hasOne2Many==true> <#if hasOne2Many==true>
let values = this.tableKeys.map(key => getRefPromise(this, key)) let values = this.tableKeys.map(key => getRefPromise(this, key))
...@@ -505,7 +511,7 @@ ...@@ -505,7 +511,7 @@
}, },
//渲染流程表单数据 //渲染流程表单数据
showFlowData(){ showFlowData(){
if(this.normal === false){ if(this.formBpm === true){
let params = {id:this.formData.dataId}; let params = {id:this.formData.dataId};
getAction(this.url.queryById,params).then((res)=>{ getAction(this.url.queryById,params).then((res)=>{
if(res.success){ if(res.success){
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
@ok="handleOk" @ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"> @cancel="handleCancel">
<${tableName?replace("_","-")}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal/> <${Format.humpToShortbar(entityName)}-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"/>
</j-modal> </j-modal>
</template> </template>
......
...@@ -43,7 +43,7 @@ public class ${entityName} implements Serializable { ...@@ -43,7 +43,7 @@ public class ${entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -42,7 +42,7 @@ public class ${entityName} implements Serializable { ...@@ -42,7 +42,7 @@ public class ${entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -31,7 +31,7 @@ public class ${subTab.entityName} implements Serializable { ...@@ -31,7 +31,7 @@ public class ${subTab.entityName} implements Serializable {
<#list subTab.originalColumns as po> <#list subTab.originalColumns as po>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -42,7 +42,7 @@ public class ${entityName} implements Serializable { ...@@ -42,7 +42,7 @@ public class ${entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
...@@ -44,7 +44,7 @@ public class ${subTab.entityName} implements Serializable { ...@@ -44,7 +44,7 @@ public class ${subTab.entityName} implements Serializable {
</#if> </#if>
/**${po.filedComment}*/ /**${po.filedComment}*/
<#if po.fieldName == primaryKeyField> <#if po.fieldName == primaryKeyField>
@TableId(type = IdType.ID_WORKER_STR) @TableId(type = IdType.ASSIGN_ID)
<#else> <#else>
<#if po.fieldDbType =='Date'> <#if po.fieldDbType =='Date'>
<#if po.classType=='date'> <#if po.classType=='date'>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册