9 changed files with 0 additions and 912 deletions
@ -1,178 +0,0 @@ |
|||
package com.ruoyi.system.controller; |
|||
|
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.config.RuoYiConfig; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.common.utils.file.FileUploadUtils; |
|||
import com.ruoyi.common.utils.file.FileUtils; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.system.domain.SysDrawing; |
|||
import com.ruoyi.system.service.ISysDrawingService; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 图纸资料Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-10-26 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/system/drawing") |
|||
public class SysDrawingController extends BaseController |
|||
{ |
|||
private String prefix = "system/drawing"; |
|||
|
|||
@Autowired |
|||
private ISysDrawingService sysDrawingService; |
|||
|
|||
@RequiresPermissions("system:drawing:view") |
|||
@GetMapping() |
|||
public String drawing() |
|||
{ |
|||
return prefix + "/drawing"; |
|||
} |
|||
|
|||
/** |
|||
* 查询图纸资料列表 |
|||
*/ |
|||
@RequiresPermissions("system:drawing:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(SysDrawing sysDrawing) |
|||
{ |
|||
startPage(); |
|||
List<SysDrawing> list = sysDrawingService.selectSysDrawingList(sysDrawing); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出图纸资料列表 |
|||
*/ |
|||
@RequiresPermissions("system:drawing:export") |
|||
@Log(title = "图纸资料", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(SysDrawing sysDrawing) |
|||
{ |
|||
List<SysDrawing> list = sysDrawingService.selectSysDrawingList(sysDrawing); |
|||
ExcelUtil<SysDrawing> util = new ExcelUtil<SysDrawing>(SysDrawing.class); |
|||
return util.exportExcel(list, "图纸资料数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增图纸资料 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存图纸资料 |
|||
*/ |
|||
@RequiresPermissions("system:drawing:add") |
|||
@Log(title = "图纸资料", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(SysDrawing sysDrawing) |
|||
{ |
|||
return toAjax(sysDrawingService.insertSysDrawing(sysDrawing)); |
|||
} |
|||
|
|||
/** |
|||
* 修改图纸资料 |
|||
*/ |
|||
@GetMapping("/edit/{drawingId}") |
|||
public String edit(@PathVariable("drawingId") Long drawingId, ModelMap mmap) |
|||
{ |
|||
SysDrawing sysDrawing = sysDrawingService.selectSysDrawingById(drawingId); |
|||
mmap.put("sysDrawing", sysDrawing); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存图纸资料 |
|||
*/ |
|||
@RequiresPermissions("system:drawing:edit") |
|||
@Log(title = "图纸资料", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(SysDrawing sysDrawing) |
|||
{ |
|||
return toAjax(sysDrawingService.updateSysDrawing(sysDrawing)); |
|||
} |
|||
|
|||
/** |
|||
* 删除图纸资料 |
|||
*/ |
|||
@RequiresPermissions("system:drawing:remove") |
|||
@Log(title = "图纸资料", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(sysDrawingService.deleteSysDrawingByIds(ids)); |
|||
} |
|||
|
|||
@PostMapping("/upload") |
|||
@ResponseBody |
|||
public AjaxResult uploadFile(MultipartFile file) throws Exception |
|||
{ |
|||
try |
|||
{ |
|||
// 上传文件路径
|
|||
String filePath = RuoYiConfig.getUploadPath(); |
|||
String modalName = prefix.substring(prefix.lastIndexOf("/")+1); |
|||
String filePathNow = filePath + "/" + modalName; |
|||
// 上传并返回新文件名称
|
|||
String fileName = FileUploadUtils.upload(filePathNow, file); |
|||
String url = filePathNow + fileName; |
|||
AjaxResult ajax = AjaxResult.success(); |
|||
ajax.put("fileName", fileName); |
|||
ajax.put("url", url); |
|||
return ajax; |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
return AjaxResult.error(e.getMessage()); |
|||
} |
|||
} |
|||
|
|||
|
|||
@RequestMapping ("/downloadFile") |
|||
public void downloadFile(String filepath, HttpServletResponse response, |
|||
HttpServletRequest request) throws Exception |
|||
{ |
|||
String fileNameNow = filepath.substring(filepath.lastIndexOf("/")+1); |
|||
|
|||
try |
|||
{ |
|||
// System.out.println(fileName);
|
|||
String filePath = filepath; |
|||
|
|||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
|||
FileUtils.setAttachmentResponseHeader(response, fileNameNow); |
|||
FileUtils.writeBytes(filePath, response.getOutputStream()); |
|||
|
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
System.out.println("fail"); |
|||
} |
|||
} |
|||
|
|||
} |
@ -1,132 +0,0 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 图纸资料对象 sys_drawing |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-10-26 |
|||
*/ |
|||
public class SysDrawing extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 图纸id */ |
|||
private Long drawingId; |
|||
|
|||
/** 图纸编码 */ |
|||
@Excel(name = "图纸编码") |
|||
private String drawingCode; |
|||
|
|||
/** 图纸类别 */ |
|||
@Excel(name = "图纸类别") |
|||
private String drawingMaterialCategory; |
|||
|
|||
/** 备注 */ |
|||
@Excel(name = "备注") |
|||
private String drawingRemarks; |
|||
|
|||
/** 图纸上传 */ |
|||
@Excel(name = "图纸上传") |
|||
private String drawingUpload; |
|||
|
|||
/** 上传人 */ |
|||
@Excel(name = "图纸上传") |
|||
private String uploadPerson; |
|||
|
|||
/** 录入时间 */ |
|||
@Excel(name = "录入时间") |
|||
private String firstAddTime; |
|||
|
|||
/** 修改时间 */ |
|||
@Excel(name = "修改时间") |
|||
private String updateInfoTime; |
|||
|
|||
public void setDrawingId(Long drawingId) |
|||
{ |
|||
this.drawingId = drawingId; |
|||
} |
|||
|
|||
public Long getDrawingId() |
|||
{ |
|||
return drawingId; |
|||
} |
|||
public void setDrawingCode(String drawingCode) |
|||
{ |
|||
this.drawingCode = drawingCode; |
|||
} |
|||
|
|||
public String getDrawingCode() |
|||
{ |
|||
return drawingCode; |
|||
} |
|||
public void setDrawingMaterialCategory(String drawingMaterialCategory) |
|||
{ |
|||
this.drawingMaterialCategory = drawingMaterialCategory; |
|||
} |
|||
|
|||
public String getDrawingMaterialCategory() |
|||
{ |
|||
return drawingMaterialCategory; |
|||
} |
|||
public void setDrawingRemarks(String drawingRemarks) |
|||
{ |
|||
this.drawingRemarks = drawingRemarks; |
|||
} |
|||
|
|||
public String getDrawingRemarks() |
|||
{ |
|||
return drawingRemarks; |
|||
} |
|||
public void setDrawingUpload(String drawingUpload) |
|||
{ |
|||
this.drawingUpload = drawingUpload; |
|||
} |
|||
|
|||
public String getDrawingUpload() |
|||
{ |
|||
return drawingUpload; |
|||
} |
|||
|
|||
public String getUploadPerson() { |
|||
return uploadPerson; |
|||
} |
|||
|
|||
public void setUploadPerson(String uploadPerson) { |
|||
this.uploadPerson = uploadPerson; |
|||
} |
|||
|
|||
public String getFirstAddTime() { |
|||
return firstAddTime; |
|||
} |
|||
|
|||
public void setFirstAddTime(String firstAddTime) { |
|||
this.firstAddTime = firstAddTime; |
|||
} |
|||
|
|||
public String getUpdateInfoTime() { |
|||
return updateInfoTime; |
|||
} |
|||
|
|||
public void setUpdateInfoTime(String updateInfoTime) { |
|||
this.updateInfoTime = updateInfoTime; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("drawingId", getDrawingId()) |
|||
.append("drawingCode", getDrawingCode()) |
|||
.append("drawingMaterialCategory", getDrawingMaterialCategory()) |
|||
.append("drawingRemarks", getDrawingRemarks()) |
|||
.append("drawingUpload", getDrawingUpload()) |
|||
.append("uploadPerson", getUploadPerson()) |
|||
.append("firstAddTime", getFirstAddTime()) |
|||
.append("updateInfoTime", getUpdateInfoTime()) |
|||
.toString(); |
|||
} |
|||
} |
@ -1,61 +0,0 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysDrawing; |
|||
|
|||
/** |
|||
* 图纸资料Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-10-26 |
|||
*/ |
|||
public interface SysDrawingMapper |
|||
{ |
|||
/** |
|||
* 查询图纸资料 |
|||
* |
|||
* @param drawingId 图纸资料ID |
|||
* @return 图纸资料 |
|||
*/ |
|||
public SysDrawing selectSysDrawingById(Long drawingId); |
|||
|
|||
/** |
|||
* 查询图纸资料列表 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 图纸资料集合 |
|||
*/ |
|||
public List<SysDrawing> selectSysDrawingList(SysDrawing sysDrawing); |
|||
|
|||
/** |
|||
* 新增图纸资料 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysDrawing(SysDrawing sysDrawing); |
|||
|
|||
/** |
|||
* 修改图纸资料 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysDrawing(SysDrawing sysDrawing); |
|||
|
|||
/** |
|||
* 删除图纸资料 |
|||
* |
|||
* @param drawingId 图纸资料ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysDrawingById(Long drawingId); |
|||
|
|||
/** |
|||
* 批量删除图纸资料 |
|||
* |
|||
* @param drawingIds 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysDrawingByIds(String[] drawingIds); |
|||
} |
@ -1,61 +0,0 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysDrawing; |
|||
|
|||
/** |
|||
* 图纸资料Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-10-26 |
|||
*/ |
|||
public interface ISysDrawingService |
|||
{ |
|||
/** |
|||
* 查询图纸资料 |
|||
* |
|||
* @param drawingId 图纸资料ID |
|||
* @return 图纸资料 |
|||
*/ |
|||
public SysDrawing selectSysDrawingById(Long drawingId); |
|||
|
|||
/** |
|||
* 查询图纸资料列表 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 图纸资料集合 |
|||
*/ |
|||
public List<SysDrawing> selectSysDrawingList(SysDrawing sysDrawing); |
|||
|
|||
/** |
|||
* 新增图纸资料 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysDrawing(SysDrawing sysDrawing); |
|||
|
|||
/** |
|||
* 修改图纸资料 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysDrawing(SysDrawing sysDrawing); |
|||
|
|||
/** |
|||
* 批量删除图纸资料 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysDrawingByIds(String ids); |
|||
|
|||
/** |
|||
* 删除图纸资料信息 |
|||
* |
|||
* @param drawingId 图纸资料ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysDrawingById(Long drawingId); |
|||
} |
@ -1,95 +0,0 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import com.ruoyi.common.core.text.Convert; |
|||
import com.ruoyi.system.domain.SysDrawing; |
|||
import com.ruoyi.system.mapper.SysDrawingMapper; |
|||
import com.ruoyi.system.service.ISysDrawingService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 图纸资料Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-10-26 |
|||
*/ |
|||
@Service |
|||
public class SysDrawingServiceImpl implements ISysDrawingService |
|||
{ |
|||
@Autowired |
|||
private SysDrawingMapper sysDrawingMapper; |
|||
|
|||
/** |
|||
* 查询图纸资料 |
|||
* |
|||
* @param drawingId 图纸资料ID |
|||
* @return 图纸资料 |
|||
*/ |
|||
@Override |
|||
public SysDrawing selectSysDrawingById(Long drawingId) |
|||
{ |
|||
return sysDrawingMapper.selectSysDrawingById(drawingId); |
|||
} |
|||
|
|||
/** |
|||
* 查询图纸资料列表 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 图纸资料 |
|||
*/ |
|||
@Override |
|||
public List<SysDrawing> selectSysDrawingList(SysDrawing sysDrawing) |
|||
{ |
|||
return sysDrawingMapper.selectSysDrawingList(sysDrawing); |
|||
} |
|||
|
|||
/** |
|||
* 新增图纸资料 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSysDrawing(SysDrawing sysDrawing) |
|||
{ |
|||
return sysDrawingMapper.insertSysDrawing(sysDrawing); |
|||
} |
|||
|
|||
/** |
|||
* 修改图纸资料 |
|||
* |
|||
* @param sysDrawing 图纸资料 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSysDrawing(SysDrawing sysDrawing) |
|||
{ |
|||
return sysDrawingMapper.updateSysDrawing(sysDrawing); |
|||
} |
|||
|
|||
/** |
|||
* 删除图纸资料对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysDrawingByIds(String ids) |
|||
{ |
|||
return sysDrawingMapper.deleteSysDrawingByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除图纸资料信息 |
|||
* |
|||
* @param drawingId 图纸资料ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysDrawingById(Long drawingId) |
|||
{ |
|||
return sysDrawingMapper.deleteSysDrawingById(drawingId); |
|||
} |
|||
} |
@ -1,78 +0,0 @@ |
|||
<?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="com.ruoyi.system.mapper.SysDrawingMapper"> |
|||
|
|||
<resultMap type="SysDrawing" id="SysDrawingResult"> |
|||
<result property="drawingId" column="drawing_id" /> |
|||
<result property="drawingCode" column="drawing_code" /> |
|||
<result property="drawingMaterialCategory" column="drawing_material_category" /> |
|||
<result property="drawingRemarks" column="drawing_remarks" /> |
|||
<result property="drawingUpload" column="drawing_upload" /> |
|||
<result property="uploadPerson" column="upload_person" /> |
|||
<result property="firstAddTime" column="first_add_time" /> |
|||
<result property="updateInfoTime" column="update_info_time" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSysDrawingVo"> |
|||
select drawing_id, drawing_code, drawing_material_category, drawing_remarks, drawing_upload, upload_person, first_add_time, update_info_time from sys_drawing |
|||
</sql> |
|||
|
|||
<select id="selectSysDrawingList" parameterType="SysDrawing" resultMap="SysDrawingResult"> |
|||
<include refid="selectSysDrawingVo"/> |
|||
<where> |
|||
<if test="drawingCode != null and drawingCode != ''"> and drawing_code = #{drawingCode}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSysDrawingById" parameterType="Long" resultMap="SysDrawingResult"> |
|||
<include refid="selectSysDrawingVo"/> |
|||
where drawing_id = #{drawingId} |
|||
</select> |
|||
|
|||
<insert id="insertSysDrawing" parameterType="SysDrawing" useGeneratedKeys="true" keyProperty="drawingId"> |
|||
insert into sys_drawing |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="drawingCode != null">drawing_code,</if> |
|||
<if test="drawingMaterialCategory != null">drawing_material_category,</if> |
|||
<if test="drawingRemarks != null">drawing_remarks,</if> |
|||
<if test="drawingUpload != null">drawing_upload,</if> |
|||
<if test="uploadPerson != null">upload_person,</if> |
|||
first_add_time, |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="drawingCode != null">#{drawingCode},</if> |
|||
<if test="drawingMaterialCategory != null">#{drawingMaterialCategory},</if> |
|||
<if test="drawingRemarks != null">#{drawingRemarks},</if> |
|||
<if test="drawingUpload != null">#{drawingUpload},</if> |
|||
<if test="uploadPerson != null">#{uploadPerson},</if> |
|||
now(), |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSysDrawing" parameterType="SysDrawing"> |
|||
update sys_drawing |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="drawingCode != null">drawing_code = #{drawingCode},</if> |
|||
<if test="drawingMaterialCategory != null">drawing_material_category = #{drawingMaterialCategory},</if> |
|||
<if test="drawingRemarks != null">drawing_remarks = #{drawingRemarks},</if> |
|||
<if test="drawingUpload != null">drawing_upload = #{drawingUpload},</if> |
|||
<if test="uploadPerson != null">upload_person = #{uploadPerson},</if> |
|||
update_info_time = CONCAT_WS(',',NOW(),update_info_time), |
|||
</trim> |
|||
where drawing_id = #{drawingId} |
|||
</update> |
|||
|
|||
<delete id="deleteSysDrawingById" parameterType="Long"> |
|||
delete from sys_drawing where drawing_id = #{drawingId} |
|||
</delete> |
|||
|
|||
<delete id="deleteSysDrawingByIds" parameterType="String"> |
|||
delete from sys_drawing where drawing_id in |
|||
<foreach item="drawingId" collection="array" open="(" separator="," close=")"> |
|||
#{drawingId} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
</mapper> |
@ -1,90 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增图纸资料')" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-css"/> |
|||
</head> |
|||
<style> |
|||
.m{ |
|||
display: block; |
|||
} |
|||
.m .form-group{ |
|||
width: 100%; |
|||
} |
|||
.col-sm-3 { |
|||
width: 20%; |
|||
} |
|||
</style> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-drawing-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">图纸编码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="drawingCode" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">图纸类别:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="drawingMaterialCategory" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="drawingRemarks" class="form-control"></textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">上传人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="uploadPerson" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">图纸上传:</label> |
|||
<div class="col-sm-8"> |
|||
<input type="hidden" name="drawingUpload"> |
|||
<div class="file-loading"> |
|||
<input class="form-control file-upload" id="drawingUpload" name="file" type="file"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-js"/> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/drawing" |
|||
$("#form-drawing-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-drawing-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
let userName = [[${@permission.getPrincipalProperty('userName')}]]; |
|||
$("#form-drawing-add input[name='uploadPerson']").val(userName) |
|||
|
|||
$(".file-upload").fileinput({ |
|||
uploadUrl: prefix + '/upload', |
|||
maxFileCount: 1, |
|||
autoReplace: true, |
|||
overwriteInitial: false, |
|||
initialPreviewAsData: true, |
|||
}).on('fileuploaded', function (event, data, previewId, index) { |
|||
// console.log(event.currentTarget.id) |
|||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url) |
|||
}).on('fileremoved', function (event, id, index) { |
|||
$("input[name='" + event.currentTarget.id + "']").val('') |
|||
}) |
|||
|
|||
|
|||
</script> |
|||
|
|||
</body> |
|||
</html> |
@ -1,128 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('图纸资料列表')" /> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>图纸编码:</label> |
|||
<input type="text" name="drawingCode"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:drawing:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:drawing:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:drawing:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:drawing:export">--> |
|||
<!-- <i class="fa fa-download"></i> 导出--> |
|||
<!-- </a>--> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var editFlag = [[${@permission.hasPermi('system:drawing:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('system:drawing:remove')}]]; |
|||
var prefix = ctx + "system/drawing"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
removeUrl: prefix + "/remove", |
|||
exportUrl: prefix + "/export", |
|||
clickToSelect: true, |
|||
modalName: "图纸资料", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
field: 'drawingId', |
|||
title: '图纸id', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'drawingCode', |
|||
title: '图纸编码' |
|||
}, |
|||
{ |
|||
field: 'drawingMaterialCategory', |
|||
title: '图纸类别' |
|||
}, |
|||
{ |
|||
field: 'drawingRemarks', |
|||
title: '备注' |
|||
}, |
|||
{ |
|||
field: 'drawingUpload', |
|||
title: '图纸上传', |
|||
formatter: function(value, row, index) { |
|||
var filepath = value.substring(value.lastIndexOf("/")+1) |
|||
var actions = []; |
|||
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> '); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
{ |
|||
field: 'uploadPerson', |
|||
title: '上传人' |
|||
}, |
|||
{ |
|||
field: 'firstAddTime', |
|||
title: '录入时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
return value; |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
field: 'updateInfoTime', |
|||
title: '上次修改时间', |
|||
formatter: function (value, row, index) { |
|||
if (value == null) { |
|||
return " "; |
|||
} else { |
|||
var vArr = value.split(',') |
|||
return vArr[0]; |
|||
} |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
|
|||
/*下载*/ |
|||
function downloadFile(filepath) { |
|||
window.location.href =prefix + "/downloadFile?filepath="+ filepath; |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,89 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改图纸资料')" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-css"/> |
|||
</head> |
|||
<style> |
|||
.m{ |
|||
display: block; |
|||
} |
|||
.m .form-group{ |
|||
width: 100%; |
|||
} |
|||
.col-sm-3 { |
|||
width: 20%; |
|||
} |
|||
</style> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-drawing-edit" th:object="${sysDrawing}"> |
|||
<input name="drawingId" th:field="*{drawingId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">图纸编码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="drawingCode" th:field="*{drawingCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">图纸类别:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="drawingMaterialCategory" th:field="*{drawingMaterialCategory}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<textarea name="drawingRemarks" class="form-control">[[*{drawingRemarks}]]</textarea> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">上传人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="uploadPerson" th:field="*{uploadPerson}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">图纸上传:</label> |
|||
<div class="col-sm-8"> |
|||
<input type="hidden" name="drawingUpload" th:field="*{drawingUpload}"> |
|||
<div class="file-loading"> |
|||
<input class="form-control file-upload" id="drawingUpload" name="file" type="file"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-js"/> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/drawing"; |
|||
$("#form-drawing-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-drawing-edit').serialize()); |
|||
} |
|||
} |
|||
|
|||
$(".file-upload").each(function (i) { |
|||
var val = $("input[name='" + this.id + "']").val() |
|||
$(this).fileinput({ |
|||
'uploadUrl': prefix + '/upload', |
|||
initialPreviewAsData: true, |
|||
initialPreview: [val], |
|||
maxFileCount: 1, |
|||
autoReplace: true, |
|||
showPreview: true, |
|||
}).on('fileuploaded', function (event, data, previewId, index) { |
|||
$("input[name='" + event.currentTarget.id + "']").val(data.response.url) |
|||
}).on('fileremoved', function (event, id, index) { |
|||
$("input[name='" + event.currentTarget.id + "']").val('') |
|||
}) |
|||
$(this).fileinput('_initFileActions'); |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue