From 576e64f01f88f2b3d4cd6bd35f875280f311aa73 Mon Sep 17 00:00:00 2001 From: suerwei <18810552194@163.com> Date: 星期五, 17 五月 2024 16:43:39 +0800 Subject: [PATCH] 人员管理调整字段,附件上传,附件查看功能 --- javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java | 48 ++++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html | 2 javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html | 59 ++--- javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java | 35 ++- javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html | 10 javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml | 14 javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/upload.html | 94 +++++++++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html | 137 +++++++++++++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/edit.html | 20 +- javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectDataServiceImpl.java | 101 +++++++++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/add.html | 4 javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html | 8 javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/image_view.html | 28 ++ javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html | 10 javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectDataService.java | 9 15 files changed, 500 insertions(+), 79 deletions(-) diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java index 7380ad3..f99e75f 100644 --- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java +++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectDataController.java @@ -6,11 +6,8 @@ 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; @@ -19,6 +16,9 @@ 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 @@ -42,7 +42,35 @@ 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"; + } /** * 鏌ヨ椤圭洰璧勬枡鍒楄〃 @@ -121,4 +149,14 @@ 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); + } + } diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java index 2d694c7..4b1904d 100644 --- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java +++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java @@ -36,9 +36,13 @@ @Excel(name = "鎵嬫満鍙�") private String phone; - /** 鍦板潃 */ - @Excel(name = "鍦板潃") - private String address; + /** 韬唤璇佸彿 */ + @Excel(name = "韬唤璇佸彿") + private String idCard; + + /** 浜哄憳鍒嗙粍 */ + @Excel(name = "浜哄憳鍒嗙粍") + private String personGroup; /** 鑱岃矗 */ @Excel(name = "鑱岃矗") @@ -100,20 +104,28 @@ 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; } @@ -150,7 +162,6 @@ .append("name", getName()) .append("type", getType()) .append("phone", getPhone()) - .append("address", getAddress()) .append("responsibility", getResponsibility()) .append("status", getStatus()) .append("isDeleted", getIsDeleted()) diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectDataService.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectDataService.java index 47afa98..1c21d65 100644 --- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectDataService.java +++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectDataService.java @@ -1,6 +1,10 @@ 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; /** @@ -58,4 +62,9 @@ * @return 缁撴灉 */ public int deleteProjectDataById(String id); + + /** + * 涓婁紶鍘嬬缉鍖� + */ + AjaxResult uploadZIP(MultipartFile file, HttpServletRequest request); } diff --git a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectDataServiceImpl.java b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectDataServiceImpl.java index e5a66b5..ba4ecd0 100644 --- a/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectDataServiceImpl.java +++ b/javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectDataServiceImpl.java @@ -1,9 +1,17 @@ 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; @@ -11,6 +19,9 @@ 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涓氬姟灞傚鐞� @@ -20,6 +31,12 @@ */ @Service public class ProjectDataServiceImpl implements IProjectDataService { + + + private static String manUploadPath = "imgupload"; + + private static String imgUploadPath = Global.getProfile() + "\\" + manUploadPath + "\\"; + @Autowired private ProjectDataMapper projectDataMapper; @@ -42,8 +59,8 @@ */ @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); } @@ -96,4 +113,84 @@ 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("闄勪欢涓婁紶澶辫触锛�"); + } + + //瑙e帇缂� + try { + ZipUtil.unzip(file2, Charset.forName("GBK")); + } catch (Exception e) { + return AjaxResult.warn("闄勪欢瑙e帇缂╁け璐ワ紒"); + } + 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); + } + } + + } + + } } diff --git a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml index 800a99a..b878eed 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml +++ b/javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml @@ -11,7 +11,8 @@ <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" /> @@ -23,7 +24,7 @@ </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"> @@ -51,7 +52,8 @@ <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> @@ -68,7 +70,8 @@ <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> @@ -88,7 +91,8 @@ <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> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html index 23dd7ae..d17a8c2 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html @@ -51,7 +51,7 @@ </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 "> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/add.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/add.html index d42906e..f31e8cf 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/add.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/add.html @@ -20,8 +20,8 @@ <!-- </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> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/edit.html index 804b13c..49ec861 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/edit.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/edit.html @@ -13,16 +13,16 @@ <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> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/image_view.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/image_view.html new file mode 100644 index 0000000..d57fba5 --- /dev/null +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/image_view.html @@ -0,0 +1,28 @@ +<!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> \ No newline at end of file diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html index ef289a1..50579ed 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData.html @@ -8,33 +8,7 @@ <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> @@ -67,6 +41,9 @@ <!-- <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> @@ -101,15 +78,8 @@ visible: false }, { - field : 'name', + field : 'name', title : '璧勬枡鍚嶇О' - }, - { - field : 'fileType', - title : '鏂囦欢绫诲瀷', - formatter: function(value, row, index) { - return $.table.selectDictLabel(fileTypeDatas, value); - } }, { field : 'labels', @@ -125,13 +95,30 @@ 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> \ No newline at end of file diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html new file mode 100644 index 0000000..cd45369 --- /dev/null +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/projectData2.html @@ -0,0 +1,137 @@ +<!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> \ No newline at end of file diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/upload.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/upload.html new file mode 100644 index 0000000..5a488e6 --- /dev/null +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/upload.html @@ -0,0 +1,94 @@ +<!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銆佷笂浼犳枃浠剁粡杩囦簡 瑙e帇 銆� 绉诲姩 銆侀亶鍘� 銆佹洿鏂版暟鎹簱绛夊涓楠わ紝璇疯�愬績绛夊緟<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("鏁版嵁涓婁紶瑙f瀽涓�"); + + $.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> \ No newline at end of file diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html index 1e6efd5..e023eaa 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html @@ -27,9 +27,15 @@ </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"> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html index 438156c..252804b 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html @@ -28,9 +28,15 @@ </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"> diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html index f2c1bc0..92f8fe4 100644 --- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html +++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html @@ -93,9 +93,13 @@ title : '鎵嬫満鍙�' }, { - field : 'address', - title : '鍦板潃' + field : 'idCard', + title : '韬唤璇佸彿' }, + { + field : 'personGroup', + title : '浜哄憳鍒嗙粍' + }, { field : 'responsibility', title : '鑱岃矗' -- Gitblit v1.9.1