| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.javaweb.common.annotation.Log; |
| | | import com.javaweb.common.enums.BusinessType; |
| | | import com.javaweb.geo.domain.ProjectData; |
| | |
| | | import com.javaweb.common.core.domain.AjaxResult; |
| | | import com.javaweb.common.utils.poi.ExcelUtil; |
| | | import com.javaweb.common.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 项目资料Controller |
| | |
| | | return prefix + "/projectData"; |
| | | } |
| | | |
| | | @RequiresPermissions("geo:projectData:view") |
| | | @GetMapping("/2") |
| | | public String projectData2(String id, String type, ModelMap mmap) { |
| | | mmap.put("projectId", id); |
| | | mmap.put("type", type); |
| | | return prefix + "/projectData2"; |
| | | } |
| | | |
| | | /** |
| | | * 导入压缩包 |
| | | */ |
| | | @GetMapping("/importImg") |
| | | public String importPdf(){ |
| | | return prefix + "/upload"; |
| | | } |
| | | |
| | | /** |
| | | * 图片展示 |
| | | */ |
| | | @GetMapping("/viewImage") |
| | | public String viewImage(ModelMap mmap, @RequestParam("id") String id){ |
| | | ProjectData data = projectDataService.selectProjectDataById(id); |
| | | String path = ""; |
| | | if (!ObjectUtils.isEmpty(data)){ |
| | | path = data.getDataUrl(); |
| | | } |
| | | mmap.put("urlAddress",path); |
| | | return prefix + "/image_view"; |
| | | } |
| | | |
| | | /** |
| | | * 查询项目资料列表 |
| | |
| | | public AjaxResult remove(String ids) { |
| | | return toAjax(projectDataService.deleteProjectDataByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 上传压缩包 |
| | | */ |
| | | @PostMapping("/uploadZIP") |
| | | @ResponseBody |
| | | public AjaxResult uploadZIP(MultipartFile file, HttpServletRequest request){ |
| | | return projectDataService.uploadZIP(file,request); |
| | | } |
| | | |
| | | } |
| | |
| | | @Excel(name = "手机号") |
| | | private String phone; |
| | | |
| | | /** 地址 */ |
| | | @Excel(name = "地址") |
| | | private String address; |
| | | /** 身份证号 */ |
| | | @Excel(name = "身份证号") |
| | | private String idCard; |
| | | |
| | | /** 人员分组 */ |
| | | @Excel(name = "人员分组") |
| | | private String personGroup; |
| | | |
| | | /** 职责 */ |
| | | @Excel(name = "职责") |
| | |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public String getPhone() |
| | | public String getPhone() |
| | | { |
| | | return phone; |
| | | } |
| | | public void setAddress(String address) |
| | | { |
| | | this.address = address; |
| | | |
| | | public String getIdCard() { |
| | | return idCard; |
| | | } |
| | | |
| | | public String getAddress() |
| | | { |
| | | return address; |
| | | public void setIdCard(String idCard) { |
| | | this.idCard = idCard; |
| | | } |
| | | public void setResponsibility(String responsibility) |
| | | |
| | | public String getPersonGroup() { |
| | | return personGroup; |
| | | } |
| | | |
| | | public void setPersonGroup(String personGroup) { |
| | | this.personGroup = personGroup; |
| | | } |
| | | |
| | | public void setResponsibility(String responsibility) |
| | | { |
| | | this.responsibility = responsibility; |
| | | } |
| | |
| | | .append("name", getName()) |
| | | .append("type", getType()) |
| | | .append("phone", getPhone()) |
| | | .append("address", getAddress()) |
| | | .append("responsibility", getResponsibility()) |
| | | .append("status", getStatus()) |
| | | .append("isDeleted", getIsDeleted()) |
| | |
| | | package com.javaweb.geo.service; |
| | | |
| | | import com.javaweb.common.core.domain.AjaxResult; |
| | | import com.javaweb.geo.domain.ProjectData; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteProjectDataById(String id); |
| | | |
| | | /** |
| | | * 上传压缩包 |
| | | */ |
| | | AjaxResult uploadZIP(MultipartFile file, HttpServletRequest request); |
| | | } |
| | |
| | | package com.javaweb.geo.service.impl; |
| | | |
| | | import java.io.File; |
| | | import java.nio.charset.Charset; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.javaweb.common.config.Global; |
| | | import com.javaweb.common.core.domain.AjaxResult; |
| | | import com.javaweb.common.utils.DateUtils; |
| | | import com.javaweb.common.utils.IdGenerate; |
| | | import com.javaweb.common.utils.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.javaweb.geo.mapper.ProjectDataMapper; |
| | |
| | | import com.javaweb.geo.service.IProjectDataService; |
| | | import com.javaweb.common.core.text.Convert; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 项目资料Service业务层处理 |
| | |
| | | */ |
| | | @Service |
| | | public class ProjectDataServiceImpl implements IProjectDataService { |
| | | |
| | | |
| | | private static String manUploadPath = "imgupload"; |
| | | |
| | | private static String imgUploadPath = Global.getProfile() + "\\" + manUploadPath + "\\"; |
| | | |
| | | @Autowired |
| | | private ProjectDataMapper projectDataMapper; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<ProjectData> selectProjectDataList(ProjectData projectData) { |
| | | if (!ObjectUtils.isEmpty(projectData.getDataType()) && projectData.getDataType().endsWith(",")){ |
| | | projectData.setDataType(projectData.getDataType().substring(0,1)); |
| | | if (!ObjectUtils.isEmpty(projectData.getDataType()) && projectData.getDataType().endsWith(",")) { |
| | | projectData.setDataType(projectData.getDataType().substring(0, 1)); |
| | | } |
| | | return projectDataMapper.selectProjectDataList(projectData); |
| | | } |
| | |
| | | public int deleteProjectDataById(String id) { |
| | | return projectDataMapper.deleteProjectDataById(id); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult uploadZIP(MultipartFile file, HttpServletRequest request) { |
| | | String uploadPath = Global.getProfile() + "\\"; |
| | | |
| | | String originalFilename = file.getOriginalFilename(); |
| | | |
| | | String fieldname = request.getParameter("fieldname"); |
| | | if (StringUtils.isEmpty(fieldname)) { |
| | | fieldname = "filename"; |
| | | } |
| | | |
| | | //获取后缀.zip 保存的文件名 |
| | | String substring = originalFilename.substring(originalFilename.lastIndexOf(".")); |
| | | String UID = IdGenerate.nextId(); |
| | | String dFileName = UID + substring; |
| | | |
| | | File file2 = new File(uploadPath + dFileName); |
| | | try { |
| | | file.transferTo(file2); |
| | | } catch (Exception e) { |
| | | return AjaxResult.warn("附件上传失败!"); |
| | | } |
| | | |
| | | //解压缩 |
| | | try { |
| | | ZipUtil.unzip(file2, Charset.forName("GBK")); |
| | | } catch (Exception e) { |
| | | return AjaxResult.warn("附件解压缩失败!"); |
| | | } |
| | | String moveDir = Global.getProfile() + "\\" + UID + "\\" + originalFilename.replace(substring, ""); |
| | | List<String> movedFiles = moveFile(moveDir); |
| | | updateFilePath(fieldname, movedFiles); |
| | | |
| | | FileUtil.del(new File(uploadPath + UID)); |
| | | FileUtil.del(file2); |
| | | return AjaxResult.success("上传成功"); |
| | | } |
| | | |
| | | //移动 文件 |
| | | private List<String> moveFile(String moveDir) { |
| | | List<String> list = new ArrayList<>(); |
| | | File file = new File(moveDir); |
| | | String detpath = imgUploadPath; |
| | | if (file.isDirectory()) { |
| | | File[] files = file.listFiles(); |
| | | int len = files.length; |
| | | for (int i = 0; i < len; i++) { |
| | | String filename = files[i].getName(); |
| | | list.add(filename); |
| | | FileUtil.copy(files[i], new File(detpath + filename), true); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | private void updateFilePath(String filedname, List<String> filesPath) { |
| | | |
| | | for (String fileName : filesPath) { |
| | | String substring = fileName.substring(fileName.lastIndexOf(".")); |
| | | String docFileName = fileName.replace(substring, "").trim(); |
| | | ProjectData param = new ProjectData(); |
| | | |
| | | if (filedname.equals("filename")) { |
| | | param.setName(docFileName); |
| | | } |
| | | |
| | | List<ProjectData> list = projectDataMapper.selectProjectDataList(param); |
| | | if (!ObjectUtils.isEmpty(list)) { |
| | | for (ProjectData item : list) { |
| | | ProjectData entity = new ProjectData(); |
| | | entity.setId(item.getId()); |
| | | entity.setDataUrl(manUploadPath + "/" + fileName); |
| | | projectDataMapper.updateProjectData(entity); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <result property="name" column="name" /> |
| | | <result property="type" column="type" /> |
| | | <result property="phone" column="phone" /> |
| | | <result property="address" column="address" /> |
| | | <result property="idCard" column="id_card" /> |
| | | <result property="personGroup" column="person_group" /> |
| | | <result property="responsibility" column="responsibility" /> |
| | | <result property="status" column="status" /> |
| | | <result property="isDeleted" column="is_deleted" /> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectProjectPersonVo"> |
| | | select ids, project_id, hole_id, name, type, phone, address, responsibility, status, is_deleted, create_by, create_time, update_by, update_time, remark from js_project_person |
| | | select ids, project_id, hole_id, name, type, phone, id_card , person_group , responsibility, status, is_deleted, create_by, create_time, update_by, update_time, remark from js_project_person |
| | | </sql> |
| | | |
| | | <select id="selectProjectPersonList" parameterType="ProjectPerson" resultMap="ProjectPersonResult"> |
| | |
| | | <if test="name != null and name != ''">name,</if> |
| | | <if test="type != null and type != ''">type,</if> |
| | | <if test="phone != null and phone != ''">phone,</if> |
| | | <if test="address != null and address != ''">address,</if> |
| | | <if test="idCard != null and idCard != ''">id_card,</if> |
| | | <if test="personGroup != null and personGroup != ''">person_group,</if> |
| | | <if test="responsibility != null and responsibility != ''">responsibility,</if> |
| | | <if test="status != null and status != ''">status,</if> |
| | | <if test="isDeleted != null and isDeleted != ''">is_deleted,</if> |
| | |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="type != null and type != ''">#{type},</if> |
| | | <if test="phone != null and phone != ''">#{phone},</if> |
| | | <if test="address != null and address != ''">#{address},</if> |
| | | <if test="idCard != null and idCard != ''">#{idCard},</if> |
| | | <if test="personGroup != null and personGroup != ''">#{personGroup},</if> |
| | | <if test="responsibility != null and responsibility != ''">#{responsibility},</if> |
| | | <if test="status != null and status != ''">#{status},</if> |
| | | <if test="isDeleted != null and isDeleted != ''">#{isDeleted},</if> |
| | |
| | | <if test="name != null and name != ''">name = #{name},</if> |
| | | <if test="type != null and type != ''">type = #{type},</if> |
| | | <if test="phone != null and phone != ''">phone = #{phone},</if> |
| | | <if test="address != null and address != ''">address = #{address},</if> |
| | | <if test="idCard != null and idCard != ''">id_card = #{idCard},</if> |
| | | <if test="personGroup != null and personGroup != ''">person_group = #{personGroup},</if> |
| | | <if test="responsibility != null and responsibility != ''">responsibility = #{responsibility},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="isDeleted != null and isDeleted != ''">is_deleted = #{isDeleted},</if> |
| | |
| | | </div> |
| | | <div class="box-header "> |
| | | <div class="box-title"> |
| | | <i class="glyphicon glyphicon-th-list"></i> <a class="afont" th:href="@{/geo/projectData(id=${project.ids},type='3')}" target="mainFrame" onclick="selected(this)">施工现场管理</a> |
| | | <i class="glyphicon glyphicon-th-list"></i> <a class="afont" th:href="@{/geo/projectData/2(id=${project.ids},type='3')}" target="mainFrame" onclick="selected(this)">施工现场管理</a> |
| | | </div> |
| | | </div> |
| | | <div class="box-header "> |
| | |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">文件类型:</label> |
| | | <div th:if="${dataType}=='3'" class="form-group"> |
| | | <label class="col-sm-3 control-label">业务类型:</label> |
| | | <div class="col-sm-8"> |
| | | <select name="fileType" class="form-control m-b" th:with="type=${@dict.getType('project_data_file_type')}"> |
| | | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
| | |
| | | <input name="name" th:field="*{name}" class="form-control" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">资料类型:</label> |
| | | <div class="col-sm-8"> |
| | | <select name="dataType" class="form-control m-b" th:with="type=${@dict.getType('project_data_type')}" required> |
| | | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{dataType}"></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">文件类型:</label> |
| | | <!-- <div class="form-group"> --> |
| | | <!-- <label class="col-sm-3 control-label">资料类型:</label>--> |
| | | <!-- <div class="col-sm-8">--> |
| | | <!-- <select name="dataType" class="form-control m-b" th:with="type=${@dict.getType('project_data_type')}" required>--> |
| | | <!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{dataType}"></option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div th:if="${dataType}=='3'" class="form-group"> |
| | | <label class="col-sm-3 control-label">业务类型类型:</label> |
| | | <div class="col-sm-8"> |
| | | <select name="fileType" class="form-control m-b" th:with="type=${@dict.getType('project_data_file_type')}"> |
| | | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{fileType}"></option> |
New file |
| | |
| | | <!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('查看图片')" /> |
| | | <th:block th:include="include :: bootstrap-fileinput-css" /> |
| | | </head> |
| | | <body class="gray-bg"> |
| | | |
| | | <div class="container-div"> |
| | | <div class="row"> |
| | | <img id="imgId" style="margin-left: 50%;transform: translateX(-50%)" > |
| | | </div> |
| | | </div> |
| | | <th:block th:include="include :: footer" /> |
| | | |
| | | |
| | | <script th:inline="javascript"> |
| | | var urlAddress = [[${urlAddress}]]; |
| | | |
| | | $(document).ready(function(){ |
| | | $("#imgId").attr("src","/bjfw/profile/" + urlAddress); |
| | | }) |
| | | </script> |
| | | |
| | | |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | <div class="row"> |
| | | <div class="col-sm-12 search-collapse"> |
| | | <form id="formId"> |
| | | |
| | | <!-- 条件表达式 --> |
| | | <div th:if="${type}=='3'" class="select-list"> |
| | | <ul> |
| | | <li> |
| | | <p>资料名称:</p> |
| | | <input type="text" name="name"/> |
| | | </li> |
| | | <li> |
| | | <p>业务类型:</p> |
| | | <select name="fileType" th:with="type=${@dict.getType('project_data_file_type')}"> |
| | | <option value="">所有</option> |
| | | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
| | | </select> |
| | | </li> |
| | | <li> |
| | | <p>标签:</p> |
| | | <input type="text" name="labels"/> |
| | | </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> |
| | | <!-- 条件表达式 --> |
| | | <div th:if="${type}!='3'" class="select-list"> |
| | | <div class="select-list"> |
| | | <ul> |
| | | <li> |
| | | <p>资料名称:</p> |
| | |
| | | <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="geo:projectData:export">--> |
| | | <!-- <i class="fa fa-download"></i> 导出--> |
| | | <!-- </a>--> |
| | | <a class="btn btn-danger" data-toggle="modal" onclick="uploadZIP();"> |
| | | <i class="fa fa-upload"></i>上传附件 |
| | | </a> |
| | | </div> |
| | | <div class="col-sm-12 select-table table-striped"> |
| | | <table id="bootstrap-table"></table> |
| | |
| | | visible: false |
| | | }, |
| | | { |
| | | field : 'name', |
| | | field : 'name', |
| | | title : '资料名称' |
| | | }, |
| | | { |
| | | field : 'fileType', |
| | | title : '文件类型', |
| | | formatter: function(value, row, index) { |
| | | return $.table.selectDictLabel(fileTypeDatas, value); |
| | | } |
| | | }, |
| | | { |
| | | field : 'labels', |
| | |
| | | formatter: function(value, row, index) { |
| | | var actions = []; |
| | | actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); |
| | | actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="viewImg(\'' + row.dataUrl + '\' , \'' + row.id + '\')"><i class="glyphicon glyphicon-menu-hamburger"></i>查看附件</a>'); |
| | | return actions.join(''); |
| | | } |
| | | }] |
| | | }; |
| | | $.table.init(options); |
| | | }); |
| | | |
| | | // 上传附件 |
| | | function uploadZIP(){ |
| | | $.modal.open('上传附件', prefix + "/importImg"); |
| | | } |
| | | |
| | | |
| | | // 查看图片详情 |
| | | function viewImg(path, id) { |
| | | if(path === null || path === '' || path === 'null'){ |
| | | $.modal.alertSuccess("文件无法打开!"); |
| | | return; |
| | | } |
| | | var url = prefix + "/viewImage?id=" + id; |
| | | $.modal.open("查看图片", url, 800, 600); |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!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 th:if="${type}=='3'" class="select-list"> |
| | | <ul> |
| | | <li> |
| | | <p>资料名称:</p> |
| | | <input type="text" name="name"/> |
| | | </li> |
| | | <li> |
| | | <p>业务类型:</p> |
| | | <select name="fileType" th:with="type=${@dict.getType('project_data_file_type')}"> |
| | | <option value="">所有</option> |
| | | <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
| | | </select> |
| | | </li> |
| | | <li> |
| | | <p>标签:</p> |
| | | <input type="text" name="labels"/> |
| | | </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="geo:projectData:add"> |
| | | <i class="fa fa-plus"></i> 添加 |
| | | </a> |
| | | <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="geo:projectData:edit"> |
| | | <i class="fa fa-edit"></i> 修改 |
| | | </a> |
| | | <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="geo:projectData:remove"> |
| | | <i class="fa fa-remove"></i> 删除 |
| | | </a> |
| | | <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="geo:projectData:export">--> |
| | | <!-- <i class="fa fa-download"></i> 导出--> |
| | | <!-- </a>--> |
| | | <a class="btn btn-danger" data-toggle="modal" onclick="uploadZIP();"> |
| | | <i class="fa fa-upload"></i>上传附件 |
| | | </a> |
| | | </div> |
| | | <div class="col-sm-12 select-table table-striped"> |
| | | <table id="bootstrap-table"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <th:block th:include="include :: footer" /> |
| | | <script th:inline="javascript"> |
| | | var editFlag = [[${@permission.hasPermi('geo:projectData:edit')}]]; |
| | | var removeFlag = [[${@permission.hasPermi('geo:projectData:remove')}]]; |
| | | var dataTypeDatas = [[${@dict.getType('project_data_type')}]]; |
| | | var fileTypeDatas = [[${@dict.getType('project_data_file_type')}]]; |
| | | var projectId=[[${projectId}]]; |
| | | var type=[[${type}]]; |
| | | var prefix = ctx + "geo/projectData"; |
| | | console.log("type",type); |
| | | |
| | | $(function() { |
| | | var options = { |
| | | url: prefix + "/list?projectId=" + projectId + "&dataType=" + type, |
| | | createUrl: prefix + "/add?projectId=" + projectId + "&dataType=" + type, |
| | | updateUrl: prefix + "/edit/{id}", |
| | | removeUrl: prefix + "/remove", |
| | | exportUrl: prefix + "/export", |
| | | modalName: "项目资料", |
| | | columns: [{ |
| | | checkbox: true |
| | | }, |
| | | { |
| | | field : 'id', |
| | | title : '主键', |
| | | visible: false |
| | | }, |
| | | { |
| | | field : 'name', |
| | | title : '资料名称' |
| | | }, |
| | | { |
| | | field : 'fileType', |
| | | title : '业务类型', |
| | | formatter: function(value, row, index) { |
| | | return $.table.selectDictLabel(fileTypeDatas, value); |
| | | } |
| | | }, |
| | | { |
| | | field : 'labels', |
| | | title : '标签' |
| | | }, |
| | | { |
| | | field : 'remark', |
| | | title : '备注' |
| | | }, |
| | | { |
| | | title: '操作', |
| | | align: 'center', |
| | | formatter: function(value, row, index) { |
| | | var actions = []; |
| | | actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); |
| | | actions.push('<a class="btn btn-info btn-xs ' + '" href="javascript:void(0)" onclick="viewImg(\'' + row.dataUrl + '\' , \'' + row.id + '\')"><i class="glyphicon glyphicon-menu-hamburger"></i>查看附件</a>'); |
| | | return actions.join(''); |
| | | } |
| | | }] |
| | | }; |
| | | $.table.init(options); |
| | | }); |
| | | |
| | | // 上传附件 |
| | | function uploadZIP(){ |
| | | $.modal.open('上传附件', prefix + "/importImg"); |
| | | } |
| | | |
| | | |
| | | // 查看图片详情 |
| | | function viewImg(path, id) { |
| | | if(path === null || path === '' || path === 'null'){ |
| | | $.modal.alertSuccess("文件无法打开!"); |
| | | return; |
| | | } |
| | | var url = prefix + "/viewImage?id=" + id; |
| | | $.modal.open("查看图片", url, 800, 600); |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
New file |
| | |
| | | <!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('文档描述列表')" /> |
| | | <th:block th:include="include :: select2-css" /> |
| | | </head> |
| | | |
| | | <body class="gray-bg"> |
| | | <div class="container-div"> |
| | | <div class="row"> |
| | | <div class="col-sm-12 search-collapse"> |
| | | <form id="formId" enctype="multipart/form-data"> |
| | | <div class="select-list"> |
| | | <ul> |
| | | <li> |
| | | <p>匹配字段:</p> |
| | | <select id="docId" name="docId" class="form-control m-b"> |
| | | <option value="filename">图片名称</option> |
| | | </select> |
| | | </li> |
| | | |
| | | <li> |
| | | <p>压缩包:</p> |
| | | <input type="file" id="file" name="file"/> |
| | | </li> |
| | | |
| | | <li> |
| | | <a class="btn btn-primary btn-rounded btn-sm" onclick="upload()"><i class="fa fa-search"></i> 上传</a> |
| | | </li> |
| | | |
| | | </ul> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <div class="btn-group-sm" id="toolbar" role="group"> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div class="col-sm-12 select-table table-striped"> |
| | | <span>1、单个或者多个文件请以.ZIP压缩包的形式上传<br> </span> |
| | | <span>2、标准文件不允许包含特殊字符:空格 、正反斜线、问号、星号等<br> </span> |
| | | <span>3、上传文件经过了 解压 、 移动 、遍历 、更新数据库等多个步骤,请耐心等待<br> </span> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <th:block th:include="include :: footer" /> |
| | | <th:block th:include="include :: select2-js" /> |
| | | <script th:inline="javascript"> |
| | | |
| | | function upload(){ |
| | | var file = $('#file').val(); |
| | | if (file == '' || (!$.common.endWith(file, '.zip'))){ |
| | | $.modal.msgWarning("请选择压缩包"); |
| | | return false; |
| | | } |
| | | |
| | | var formData = new FormData(); |
| | | formData.append("file", $('#file')[0].files[0]); |
| | | formData.append("fieldname", $('#docId').val()); |
| | | $.modal.loading("数据上传解析中"); |
| | | |
| | | $.ajax({ |
| | | url: ctx + "geo/projectData/uploadZIP", |
| | | data: formData, |
| | | cache: false, |
| | | contentType: false, |
| | | processData: false, |
| | | type: 'POST', |
| | | success: function (result) { |
| | | if (result.code == web_status.SUCCESS) { |
| | | $.modal.closeLoading(); |
| | | $.modal.alertSuccess(result.msg); |
| | | } else if (result.code == web_status.WARNING) { |
| | | |
| | | $.modal.closeLoading(); |
| | | $.modal.alertWarning(result.msg) |
| | | } else { |
| | | |
| | | $.modal.closeLoading(); |
| | | $.modal.alertError(result.msg); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">地址:</label> |
| | | <label class="col-sm-3 control-label">身份证号:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="address" class="form-control" type="text"> |
| | | <input name="idCard" 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="personGroup" class="form-control" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">地址:</label> |
| | | <label class="col-sm-3 control-label">身份证号:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="address" th:field="*{address}" class="form-control" type="text"> |
| | | <input name="idCard" th:field="*{idCard}" 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="personGroup" th:field="*{personGroup}" class="form-control" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | title : '手机号' |
| | | }, |
| | | { |
| | | field : 'address', |
| | | title : '地址' |
| | | field : 'idCard', |
| | | title : '身份证号' |
| | | }, |
| | | { |
| | | field : 'personGroup', |
| | | title : '人员分组' |
| | | }, |
| | | { |
| | | field : 'responsibility', |
| | | title : '职责' |