diff --git a/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue b/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue index c494bf82d..df755b1b3 100644 --- a/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue +++ b/template/admin/src/pages/system/codeGeneration/components/FoundationFor.vue @@ -3,10 +3,16 @@ crud生成说明 @@ -29,11 +35,15 @@
选项,选择的菜单成功后会自动写入到此菜单下
- +
生成菜单为可选项,不填写默认生成的菜单名称将为表名;生成后会把自动生成的权限默认加入该菜单下
+ + +
用于生成模块名称
+
@@ -65,11 +75,7 @@ > @@ -156,6 +138,7 @@ export default { foundationRules: { // pid: [{ required: true, message: '请输入菜单', trigger: 'blur' }], tableName: [{ required: true, message: '请输入表名', trigger: 'blur' }], + modelName: [{ required: true, message: '请输入模块名', trigger: 'blur' }], }, menusList: [], columnTypeList: [], @@ -258,13 +241,13 @@ export default { }, mounted() {}, methods: { - disabledInput(index){ + disabledInput(index) { let fieldInfo = this.tableField[index]; - let res = ['addTimestamps', 'addSoftDelete'].includes(this.tableField[index].field_type) + let res = ['addTimestamps', 'addSoftDelete'].includes(this.tableField[index].field_type); if (fieldInfo.primaryKey) { res = true; } - if (fieldInfo.field==='delete_time' && fieldInfo.field_type === 'timestamp') { + if (fieldInfo.field === 'delete_time' && fieldInfo.field_type === 'timestamp') { res = true; } return res; diff --git a/template/admin/src/pages/system/codeGeneration/index.vue b/template/admin/src/pages/system/codeGeneration/index.vue index c67a53451..6ff0e7ef7 100644 --- a/template/admin/src/pages/system/codeGeneration/index.vue +++ b/template/admin/src/pages/system/codeGeneration/index.vue @@ -59,6 +59,7 @@ export default { foundation: { pid: '', tableName: '', + modelName: '', isTable: 1, menuName: '', }, @@ -87,6 +88,7 @@ export default { if (this.currentTab == 0) { // if (!this.formItem.foundation.pid) return this.$Message.warning('请选择菜单'); if (!this.formItem.foundation.tableName) return this.$Message.warning('请输入表名'); + if (!this.formItem.foundation.modelName) return this.$Message.warning('请输入模块名'); if (!this.formItem.foundation.isTable) { if (!this.$refs.Foundation.tableField.length) return this.$Message.warning('请先添加表数据'); if (this.$refs.Foundation.tableField.length) @@ -109,8 +111,6 @@ export default { ...this.formItem.foundation, filePath: this.formItem.storage, tableField: this.$refs.Foundation.tableField, - // columnField: this.$refs.Field.dataList, - // fromField: this.$refs.FormItem.dataList, }; this.reqloading = true; codeCrud(data) @@ -168,7 +168,10 @@ export default { padding-left: 7px; } /deep/ .ivu-form-item { - margin-bottom: 15px; + margin-bottom: 17px; +} +/deep/ .ivu-form-item-error-tip { + padding-top: 2px; } /deep/ .tip { color: #bbb;