From 040b5e33281c0151775f3a389e91ccba5b5482b2 Mon Sep 17 00:00:00 2001
From: mors <3067699729@qq.com>
Date: Sat, 8 Oct 2022 15:30:17 +0800
Subject: [PATCH] =?UTF-8?q?2022-10-08-=E8=B5=B5=E7=8E=89=E7=91=9E-1.3.2-?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E5=9D=97=E6=A0=B7=E6=9D=BF=E7=AE=A1?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/views/sample/ZyModuleSampleList.vue | 50 +++++++++++-----
.../sample/modules/ZyModuleSampleForm.vue | 59 ++++++++++++++++---
.../controller/ZyModuleSampleController.java | 8 +++
.../modules/sample/entity/ZyModuleSample.java | 10 +++-
4 files changed, 100 insertions(+), 27 deletions(-)
diff --git a/ant-design-vue-jeecg/src/views/sample/ZyModuleSampleList.vue b/ant-design-vue-jeecg/src/views/sample/ZyModuleSampleList.vue
index 99a8c0f3..24fb9bfc 100644
--- a/ant-design-vue-jeecg/src/views/sample/ZyModuleSampleList.vue
+++ b/ant-design-vue-jeecg/src/views/sample/ZyModuleSampleList.vue
@@ -71,7 +71,7 @@
编辑
-
+
+
+
+ 详情
+
+
+ handleDelete(record.id)">
+ 删除
+
+
+
@@ -128,36 +138,42 @@
dataIndex: 'nums'
},
{
- title:'模块名称',
+ title:'成衣样板',
align:"center",
- dataIndex: 'moduleName'
+ dataIndex: 'clothId_dictText'
},
{
- title:'描述',
+ title:'模块',
align:"center",
- dataIndex: 'descr'
+ dataIndex: 'moduleName_dictText'
},
{
+ title: '创建时间',
+ align: "center",
+ dataIndex: 'createTime'
+ },
+ /*{
+ title:'描述',
+ align:"center",
+ dataIndex: 'descr'
+ },*/
+ /*{
title:'图片',
align:"center",
dataIndex: 'url',
scopedSlots: {customRender: 'imgSlot'}
- },
- {
- title:'成衣',
- align:"center",
- dataIndex: 'clothId_dictText'
- },
- {
+ },*/
+
+ /*{
title:'用户',
align:"center",
dataIndex: 'userId'
- },
- {
+ },*/
+ /*{
title:'用户类型',
align:"center",
dataIndex: 'type'
- },
+ },*/
{
title: '操作',
dataIndex: 'action',
@@ -180,6 +196,7 @@
}
},
created() {
+
this.getSuperFieldList();
},
computed: {
@@ -194,6 +211,7 @@
let fieldList=[];
fieldList.push({type:'string',value:'nums',text:'编号',dictCode:''})
fieldList.push({type:'string',value:'moduleName',text:'模块名称',dictCode:''})
+ fieldList.push({type:'string',value:'styleNames',test:'款式名称',dictCode:''})
fieldList.push({type:'string',value:'descr',text:'描述',dictCode:''})
fieldList.push({type:'string',value:'url',text:'图片',dictCode:''})
fieldList.push({type:'string',value:'clothId',text:'成衣',dictCode:'zy_cloth_sample,cloth_name,id'})
diff --git a/ant-design-vue-jeecg/src/views/sample/modules/ZyModuleSampleForm.vue b/ant-design-vue-jeecg/src/views/sample/modules/ZyModuleSampleForm.vue
index 3457f806..5b561a89 100644
--- a/ant-design-vue-jeecg/src/views/sample/modules/ZyModuleSampleForm.vue
+++ b/ant-design-vue-jeecg/src/views/sample/modules/ZyModuleSampleForm.vue
@@ -3,19 +3,42 @@
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -23,21 +46,21 @@
-
+
+
+
@@ -75,6 +98,24 @@
},
confirmLoading: false,
validatorRules: {
+ styleNames: [
+ { required: true, message: '不能为空'}
+ ],
+ styleId: [
+ { required: true, message: '不能为空'}
+ ],
+ moduleName: [
+ { required: true, message: '不能为空'}
+ ],
+ // .,;,。;!?\\-
+ // [\\pP\\p{Punct}]
+ nums: [
+ { required: true, message: '不能为空'},
+ { pattern: /^[0-9A-Za-z]{0,10}$/, message: '编号太长'},
+ ],
+ descr : [
+ {pattern: /^[0-9A-Za-z\u4e00-\u9fa5.,;,。;、!?]{0,200}$/, message: '文本长度过长'},
+ ]
},
url: {
add: "/sample/zyModuleSample/add",
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/controller/ZyModuleSampleController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/controller/ZyModuleSampleController.java
index af6f64bb..7b671a85 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/controller/ZyModuleSampleController.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/controller/ZyModuleSampleController.java
@@ -96,6 +96,14 @@ public class ZyModuleSampleController extends JeecgController edit(@RequestBody ZyModuleSample zyModuleSample) {
+ List zyModuleSampleList = zyModuleSampleService.list();
+ ZyModuleSample moduleSample = zyModuleSampleService.getById(zyModuleSample.getId());
+ zyModuleSampleList.remove(moduleSample);
+ for (ZyModuleSample sample: zyModuleSampleList) {
+ if (sample.getNums().equals(zyModuleSample.getNums())){
+ return Result.error("编号重复,请重新输入");
+ }
+ }
zyModuleSampleService.updateById(zyModuleSample);
return Result.OK("编辑成功!");
}
diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/entity/ZyModuleSample.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/entity/ZyModuleSample.java
index 7ca463d9..42bf1378 100644
--- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/entity/ZyModuleSample.java
+++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/entity/ZyModuleSample.java
@@ -42,7 +42,13 @@ public class ZyModuleSample implements Serializable {
/**模块名称*/
@Excel(name = "模块名称", width = 15)
@ApiModelProperty(value = "模块名称")
+ @Dict(dicCode = "id",dictTable = "zy_cloths_modular",dicText = "modular_name")
private String moduleName;
+ /**款式名称*/
+ @Excel(name = "款式名称", width = 15)
+ @ApiModelProperty(value = "款式名称")
+ //@Dict(dicCode = "id",dictTable = "zy_cloths_modular",dicText = "modular_name")
+ private String styleNames;
/**描述*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述")
@@ -65,8 +71,8 @@ public class ZyModuleSample implements Serializable {
@ApiModelProperty(value = "用户类型")
private String type;
/**创建时间*/
- @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
- @DateTimeFormat(pattern="yyyy-MM-dd")
+ @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
}