parent
9f1d2a6ed5
commit
9d19223afe
7 changed files with 477 additions and 0 deletions
@ -0,0 +1,194 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
||||
<a-button type="primary" icon="download" @click="handleExportXls('制衣模块部件中间表')">导出</a-button> |
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
||||
<a-button type="primary" icon="import">导入</a-button> |
||||
</a-upload> |
||||
<!-- 高级查询区域 --> |
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
||||
<a-dropdown v-if="selectedRowKeys.length > 0"> |
||||
<a-menu slot="overlay"> |
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> |
||||
</a-menu> |
||||
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> |
||||
</a-dropdown> |
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</template> |
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<a @click="handleEdit(record)">编辑</a> |
||||
|
||||
<a-divider type="vertical" /> |
||||
<a-dropdown> |
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
||||
<a-menu slot="overlay"> |
||||
<a-menu-item> |
||||
<a @click="handleDetail(record)">详情</a> |
||||
</a-menu-item> |
||||
<a-menu-item> |
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</a-dropdown> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<zy-cloths-modular-compent-modal ref="modalForm" @ok="modalFormOk"></zy-cloths-modular-compent-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyClothsModularCompentModal from './modules/ZyClothsModularCompentModal' |
||||
|
||||
export default { |
||||
name: 'ZyClothsModularCompentList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyClothsModularCompentModal |
||||
}, |
||||
data () { |
||||
return { |
||||
description: '制衣模块部件中间表管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key:'rowIndex', |
||||
width:60, |
||||
align:"center", |
||||
customRender:function (t,r,index) { |
||||
return parseInt(index)+1; |
||||
} |
||||
}, |
||||
{ |
||||
title:'编码', |
||||
align:"center", |
||||
dataIndex: 'nums' |
||||
}, |
||||
{ |
||||
title:'部件名称', |
||||
align:"center", |
||||
dataIndex: 'partsName' |
||||
}, |
||||
{ |
||||
title:'制衣模块类型', |
||||
align:"center", |
||||
dataIndex: 'modularType' |
||||
}, |
||||
{ |
||||
title:'部件id', |
||||
align:"center", |
||||
dataIndex: 'componentId' |
||||
}, |
||||
{ |
||||
title:'创建时间', |
||||
align:"center", |
||||
dataIndex: 'createTime' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/base/zyClothsModularCompent/list", |
||||
delete: "/base/zyClothsModularCompent/delete", |
||||
deleteBatch: "/base/zyClothsModularCompent/deleteBatch", |
||||
exportXlsUrl: "/base/zyClothsModularCompent/exportXls", |
||||
importExcelUrl: "base/zyClothsModularCompent/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'nums',text:'编码',dictCode:''}) |
||||
fieldList.push({type:'string',value:'partsName',text:'部件名称',dictCode:''}) |
||||
fieldList.push({type:'string',value:'modularType',text:'制衣模块类型',dictCode:''}) |
||||
fieldList.push({type:'string',value:'componentId',text:'部件id',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,155 @@ |
||||
package org.jeecg.modules.demo.base.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; |
||||
import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* @Description: 制衣模块部件中间表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags = "制衣模块部件中间表") |
||||
@RestController |
||||
@RequestMapping("/base/zyClothsModularCompent") |
||||
@Slf4j |
||||
public class ZyClothsModularCompentController extends JeecgController<ZyClothsModularCompent, IZyClothsModularCompentService> { |
||||
@Autowired |
||||
private IZyClothsModularCompentService zyClothsModularCompentService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyClothsModularCompent |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "制衣模块部件中间表-分页列表查询") |
||||
@ApiOperation(value = "制衣模块部件中间表-分页列表查询", notes = "制衣模块部件中间表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyClothsModularCompent zyClothsModularCompent, |
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyClothsModularCompent> queryWrapper = QueryGenerator.initQueryWrapper(zyClothsModularCompent, req.getParameterMap()); |
||||
Page<ZyClothsModularCompent> page = new Page<ZyClothsModularCompent>(pageNo, pageSize); |
||||
IPage<ZyClothsModularCompent> pageList = zyClothsModularCompentService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyClothsModularCompent |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "制衣模块部件中间表-添加") |
||||
@ApiOperation(value = "制衣模块部件中间表-添加", notes = "制衣模块部件中间表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyClothsModularCompent zyClothsModularCompent) { |
||||
zyClothsModularCompentService.save(zyClothsModularCompent); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyClothsModularCompent |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "制衣模块部件中间表-编辑") |
||||
@ApiOperation(value = "制衣模块部件中间表-编辑", notes = "制衣模块部件中间表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyClothsModularCompent zyClothsModularCompent) { |
||||
zyClothsModularCompentService.updateById(zyClothsModularCompent); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "制衣模块部件中间表-通过id删除") |
||||
@ApiOperation(value = "制衣模块部件中间表-通过id删除", notes = "制衣模块部件中间表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
||||
zyClothsModularCompentService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "制衣模块部件中间表-批量删除") |
||||
@ApiOperation(value = "制衣模块部件中间表-批量删除", notes = "制衣模块部件中间表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) { |
||||
this.zyClothsModularCompentService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "制衣模块部件中间表-通过id查询") |
||||
@ApiOperation(value = "制衣模块部件中间表-通过id查询", notes = "制衣模块部件中间表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) { |
||||
ZyClothsModularCompent zyClothsModularCompent = zyClothsModularCompentService.getById(id); |
||||
if (zyClothsModularCompent == null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyClothsModularCompent); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyClothsModularCompent |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyClothsModularCompent zyClothsModularCompent) { |
||||
return super.exportXls(request, zyClothsModularCompent, ZyClothsModularCompent.class, "制衣模块部件中间表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyClothsModularCompent.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,73 @@ |
||||
package org.jeecg.modules.demo.base.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 制衣模块部件中间表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_cloths_modular_compent") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_cloths_modular_compent对象", description="制衣模块部件中间表") |
||||
public class ZyClothsModularCompent implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**编码*/ |
||||
@Excel(name = "编码", width = 15) |
||||
@ApiModelProperty(value = "编码") |
||||
private String nums; |
||||
/**部件名称*/ |
||||
@Excel(name = "部件名称", width = 15) |
||||
@ApiModelProperty(value = "部件名称") |
||||
private String partsName; |
||||
/**制衣模块类型*/ |
||||
@Excel(name = "制衣模块类型", width = 15) |
||||
@ApiModelProperty(value = "制衣模块类型") |
||||
private String modularType; |
||||
/**部件id*/ |
||||
@Excel(name = "部件id", width = 15) |
||||
@ApiModelProperty(value = "部件id") |
||||
private String componentId; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.demo.base.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 制衣模块部件中间表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyClothsModularCompentMapper extends BaseMapper<ZyClothsModularCompent> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.demo.base.service; |
||||
|
||||
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 制衣模块部件中间表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyClothsModularCompentService extends IService<ZyClothsModularCompent> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.base.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.base.entity.ZyClothsModularCompent; |
||||
import org.jeecg.modules.demo.base.mapper.ZyClothsModularCompentMapper; |
||||
import org.jeecg.modules.demo.base.service.IZyClothsModularCompentService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 制衣模块部件中间表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2022-11-11 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyClothsModularCompentServiceImpl extends ServiceImpl<ZyClothsModularCompentMapper, ZyClothsModularCompent> implements IZyClothsModularCompentService { |
||||
|
||||
} |
Loading…
Reference in new issue