diff --git a/mes-module-chemmes/mes-module-chemmes-api/src/main/java/com/ningxia/yunxi/chemmes/module/biz/enums/ErrorCodeConstants.java b/mes-module-chemmes/mes-module-chemmes-api/src/main/java/com/ningxia/yunxi/chemmes/module/biz/enums/ErrorCodeConstants.java index 88829a4..1892b19 100644 --- a/mes-module-chemmes/mes-module-chemmes-api/src/main/java/com/ningxia/yunxi/chemmes/module/biz/enums/ErrorCodeConstants.java +++ b/mes-module-chemmes/mes-module-chemmes-api/src/main/java/com/ningxia/yunxi/chemmes/module/biz/enums/ErrorCodeConstants.java @@ -30,6 +30,7 @@ public interface ErrorCodeConstants { ErrorCode DICT_TYPE_ERROR = new ErrorCode(1_000_003, "无法识别枚举类型"); ErrorCode APP_VERSION_NOT_EXISTS = new ErrorCode(1_000_004, "无可用app版本"); + ErrorCode DATA_NOT_EXISTS = new ErrorCode(1_000_005, "数据不存在"); ErrorCode CN_EN_NOT_EXISTS = new ErrorCode(1_001_022, "中英文对照不存在"); diff --git a/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm b/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm index 66143d2..a0766f6 100644 --- a/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm +++ b/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/java/service/serviceImpl.vm @@ -4,6 +4,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; import org.springframework.transaction.annotation.Transactional; +import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*; import java.util.*; import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; @@ -135,7 +136,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service #set ($ParentJavaField = $treeParentColumn.javaField.substring(0,1).toUpperCase() + ${treeParentColumn.javaField.substring(1)})##首字母大写 // 校验是否有子${table.classComment} if (${classNameVar}Mapper.selectCountBy${ParentJavaField}(id) > 0) { - throw exception(${simpleClassName_underlineCase.toUpperCase()}_EXITS_CHILDREN); + throw exception(DATA_NOT_EXISTS); } #end // 删除 @@ -304,7 +305,7 @@ public class ${table.className}ServiceImpl implements ${table.className}Service private void validate${subSimpleClassName}Exists(${subPrimaryColumn.javaType} id) { if (${subClassNameVar}Mapper.selectById(id) == null) { - throw exception(${simpleClassNameUnderlineCase.toUpperCase()}_NOT_EXISTS); + throw exception(DATA_NOT_EXISTS); } } diff --git a/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm b/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm index 1c15536..3798f69 100644 --- a/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm +++ b/mes-module-infra/mes-module-infra-biz/src/main/resources/codegen/vue3/views/form.vue.vm @@ -1,10 +1,10 @@ #end + #foreach($column in $columns) - #if ($column.listOperationResult) + #if ($column.listOperationResult && $column.javaField != "id")## 排除ID列 #set ($dictType=$column.dictType) #set ($javaField = $column.javaField) #set ($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) @@ -212,7 +214,7 @@ - <${simpleClassName}Form ref="formRef" @success="getList" /> + <${simpleClassName}Form ref="formRef" @success="getList" @close="handleQuery"/> ## 特殊:主子表专属逻辑 #if ( $table.templateType == 11 && $subTables && $subTables.size() > 0 ) @@ -254,7 +256,7 @@ defineOptions({ name: '${table.className}' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 -const loading = ref(true) // 列表的加载中 +const loading = ref(false) // 列表的加载中(默认不加载) const list = ref([]) // 列表的数据 ## 特殊:树表专属逻辑(树不需要分页接口) #if ( $table.templateType != 2 ) @@ -368,6 +370,6 @@ const toggleExpandAll = async () => { /** 初始化 **/ onMounted(() => { - getList() + // 默认不自动查询,需手动点击搜索按钮 }) - \ No newline at end of file + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/biz/customer/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/biz/customer/index.vue index deb50d7..2392efa 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/biz/customer/index.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/biz/customer/index.vue @@ -67,7 +67,7 @@ - + diff --git a/mes-ui/mes-ui-admin-vue3/src/views/biz/inspplan/InspPlanSelect.vue b/mes-ui/mes-ui-admin-vue3/src/views/biz/inspplan/InspPlanSelect.vue index cdcd4fe..8a6d571 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/biz/inspplan/InspPlanSelect.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/biz/inspplan/InspPlanSelect.vue @@ -9,7 +9,7 @@ 重置 - +