2022-10-08-赵玉瑞-1.3.2-修改模块样板管理

zhc4dev
赵玉瑞 2 years ago
parent dde409e8af
commit 040b5e3328
  1. 50
      ant-design-vue-jeecg/src/views/sample/ZyModuleSampleList.vue
  2. 59
      ant-design-vue-jeecg/src/views/sample/modules/ZyModuleSampleForm.vue
  3. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/controller/ZyModuleSampleController.java
  4. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/sample/entity/ZyModuleSample.java

@ -71,7 +71,7 @@
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
@ -83,7 +83,17 @@
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</a-dropdown>-->
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
@ -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'})

@ -3,19 +3,42 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<!--关联服装款式表 zy_cloths_style 关联列名称 传值id-->
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleNames">
<j-dict-select-tag v-model="model.styleNames" placeholder="请输入款式"
dict-code="zy_cloths_style,style_names,style_names"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="成衣样板" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothId">
<j-dict-select-tag v-model="model.clothId" placeholder="请选择成衣样板"
dict-code="zy_cloth_sample,cloth_name,id"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="模块" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleName">
<j-dict-select-tag v-model="model.moduleName" placeholder="请选择模块"
dict-code="zy_cloths_modular,modular_name,id"></j-dict-select-tag>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">
<a-form-model-item label="模块名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="moduleName">
<a-input v-model="model.moduleName" placeholder="请输入模块名称" ></a-input>
</a-form-model-item>
</a-col>-->
<a-col :span="24">
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums">
<a-input v-model="model.nums" placeholder="请输入编号" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="descr">
<a-input v-model="model.descr" placeholder="请输入描述" ></a-input>
<a-textarea v-model="model.descr" placeholder="请输入描述" ></a-textarea>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -23,21 +46,21 @@
<j-image-upload isMultiple v-model="model.url" ></j-image-upload>
</a-form-model-item>
</a-col>
<a-col :span="24">
<!-- <a-col :span="24">
<a-form-model-item label="成衣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clothId">
<j-dict-select-tag type="list" v-model="model.clothId" dictCode="zy_cloth_sample,cloth_name,id" placeholder="请选择成衣" />
</a-form-model-item>
</a-col>
<a-col :span="24">
</a-col>-->
<!-- <a-col :span="24">
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">
<a-input v-model="model.userId" placeholder="请输入用户" ></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
</a-col>-->
<!-- <a-col :span="24">
<a-form-model-item label="用户类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type">
<a-input v-model="model.type" placeholder="请输入用户类型" ></a-input>
</a-form-model-item>
</a-col>
</a-col>-->
</a-row>
</a-form-model>
</j-form-container>
@ -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",

@ -96,6 +96,14 @@ public class ZyModuleSampleController extends JeecgController<ZyModuleSample, IZ
@ApiOperation(value="模块样板表-编辑", notes="模块样板表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@RequestBody ZyModuleSample zyModuleSample) {
List<ZyModuleSample> 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("编辑成功!");
}

@ -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;
}

Loading…
Cancel
Save