Commit 8e6553ca6c7c85588dcbd0694b4ae58b34859b6b

Authored by zhangdaiscott
1 parent b9822f1e

JImageUpload组件单张无法预览和删除 #2382

online报表配置支持多租户系统变量 issues/I3CL75
JEditableTable组件popup字段设置必填校验有问题
ant-design-vue-jeecg/src/components/jeecg/JEditableTable.vue
@@ -2704,7 +2704,7 @@ @@ -2704,7 +2704,7 @@
2704 } 2704 }
2705 this.setOneValue(this.popupValues, id, popupValue) 2705 this.setOneValue(this.popupValues, id, popupValue)
2706 // 做单个表单验证 2706 // 做单个表单验证
2707 - this.validateOneInput(value, row, column, this.notPassedIds, true, 'change') 2707 + this.validateOneInput(popupValue, row, column, this.notPassedIds, true, 'change')
2708 // 触发valueChange 事件 2708 // 触发valueChange 事件
2709 this.elemValueChange('input', row, column, value) 2709 this.elemValueChange('input', row, column, value)
2710 }, 2710 },
ant-design-vue-jeecg/src/components/jeecg/JImageUpload.vue
@@ -11,13 +11,13 @@ @@ -11,13 +11,13 @@
11 :beforeUpload="beforeUpload" 11 :beforeUpload="beforeUpload"
12 :disabled="disabled" 12 :disabled="disabled"
13 :isMultiple="isMultiple" 13 :isMultiple="isMultiple"
14 - :showUploadList="isMultiple" 14 +
15 @change="handleChange" 15 @change="handleChange"
16 @preview="handlePreview" 16 @preview="handlePreview"
17 - :class="!isMultiple?'imgupload':''">  
18 - <div :style="{'width':(!isMultiple?'104px':'auto'),'height':(!isMultiple?'104px':'auto')}">  
19 - <img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="width:100%;height:100%"/>  
20 - <div v-else class="iconp"> 17 + :class="[!isMultiple?'imgupload':'', (!isMultiple && picUrl)?'image-upload-single-over':'' ]">
  18 + <div>
  19 + <!--<img v-if="!isMultiple && picUrl" :src="getAvatarView()" style="width:100%;height:100%"/>-->
  20 + <div class="iconp">
21 <a-icon :type="uploadLoading ? 'loading' : 'plus'" /> 21 <a-icon :type="uploadLoading ? 'loading' : 'plus'" />
22 <div class="ant-upload-text">{{ text }}</div> 22 <div class="ant-upload-text">{{ text }}</div>
23 </div> 23 </div>
@@ -189,7 +189,7 @@ @@ -189,7 +189,7 @@
189 path = '' 189 path = ''
190 } 190 }
191 let arr = []; 191 let arr = [];
192 - if(!this.isMultiple){ 192 + if(!this.isMultiple && uploadFiles.length>0){
193 arr.push(uploadFiles[uploadFiles.length-1].response.message) 193 arr.push(uploadFiles[uploadFiles.length-1].response.message)
194 }else{ 194 }else{
195 for(let a=0;a<uploadFiles.length;a++){ 195 for(let a=0;a<uploadFiles.length;a++){
@@ -231,8 +231,9 @@ @@ -231,8 +231,9 @@
231 * https://github.com/zhangdaiscott/jeecg-boot/issues/1810 231 * https://github.com/zhangdaiscott/jeecg-boot/issues/1810
232 * https://github.com/zhangdaiscott/jeecg-boot/issues/1779 232 * https://github.com/zhangdaiscott/jeecg-boot/issues/1779
233 */ 233 */
234 - /deep/ .imgupload .ant-upload-select{display:block}  
235 - /deep/ .imgupload .ant-upload.ant-upload-select-picture-card{ width:120px;height: 120px;}  
236 - /deep/ .imgupload .iconp{padding:32px;} 234 +
  235 + /deep/ .imgupload .iconp{padding:20px;}
237 /* update--end--autor:lvdandan-----date:20201016------for:j-image-upload图片组件单张图片详情回显空白*/ 236 /* update--end--autor:lvdandan-----date:20201016------for:j-image-upload图片组件单张图片详情回显空白*/
  237 +
  238 + /deep/ .image-upload-single-over .ant-upload-select{display: none}
238 </style> 239 </style>
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/constant/DataBaseConstant.java
@@ -111,4 +111,14 @@ public interface DataBaseConstant { @@ -111,4 +111,14 @@ public interface DataBaseConstant {
111 */ 111 */
112 public static final String BPM_STATUS_TABLE = "bpm_status"; 112 public static final String BPM_STATUS_TABLE = "bpm_status";
113 //*********系统建表标准字段**************************************** 113 //*********系统建表标准字段****************************************
  114 +
  115 +
  116 + /**
  117 + * 租户ID 实体字段名
  118 + */
  119 + String TENANT_ID = "tenantId";
  120 + /**
  121 + * 租户ID 数据库字段名
  122 + */
  123 + String TENANT_ID_TABLE = "tenant_id";
114 } 124 }
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java
@@ -6,12 +6,8 @@ import com.auth0.jwt.algorithms.Algorithm; @@ -6,12 +6,8 @@ import com.auth0.jwt.algorithms.Algorithm;
6 import com.auth0.jwt.exceptions.JWTDecodeException; 6 import com.auth0.jwt.exceptions.JWTDecodeException;
7 import com.auth0.jwt.interfaces.DecodedJWT; 7 import com.auth0.jwt.interfaces.DecodedJWT;
8 import com.google.common.base.Joiner; 8 import com.google.common.base.Joiner;
9 -  
10 -import java.util.Date;  
11 -import javax.servlet.http.HttpServletRequest;  
12 -import javax.servlet.http.HttpSession;  
13 -  
14 import org.apache.shiro.SecurityUtils; 9 import org.apache.shiro.SecurityUtils;
  10 +import org.jeecg.common.constant.CommonConstant;
15 import org.jeecg.common.constant.DataBaseConstant; 11 import org.jeecg.common.constant.DataBaseConstant;
16 import org.jeecg.common.exception.JeecgBootException; 12 import org.jeecg.common.exception.JeecgBootException;
17 import org.jeecg.common.system.vo.LoginUser; 13 import org.jeecg.common.system.vo.LoginUser;
@@ -20,6 +16,10 @@ import org.jeecg.common.util.DateUtils; @@ -20,6 +16,10 @@ import org.jeecg.common.util.DateUtils;
20 import org.jeecg.common.util.SpringContextUtils; 16 import org.jeecg.common.util.SpringContextUtils;
21 import org.jeecg.common.util.oConvertUtils; 17 import org.jeecg.common.util.oConvertUtils;
22 18
  19 +import javax.servlet.http.HttpServletRequest;
  20 +import javax.servlet.http.HttpSession;
  21 +import java.util.Date;
  22 +
23 /** 23 /**
24 * @Author Scott 24 * @Author Scott
25 * @Date 2018-07-12 14:23 25 * @Date 2018-07-12 14:23
@@ -197,6 +197,14 @@ public class JwtUtil { @@ -197,6 +197,14 @@ public class JwtUtil {
197 else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.toLowerCase().equals(DataBaseConstant.BPM_STATUS_TABLE)) { 197 else if (key.equals(DataBaseConstant.BPM_STATUS)|| key.toLowerCase().equals(DataBaseConstant.BPM_STATUS_TABLE)) {
198 returnValue = "1"; 198 returnValue = "1";
199 } 199 }
  200 + //update-begin-author:taoyan date:20210330 for:多租户ID作为系统变量
  201 + else if (key.equals(DataBaseConstant.TENANT_ID) || key.toLowerCase().equals(DataBaseConstant.TENANT_ID_TABLE)){
  202 + returnValue = sysUser.getRelTenantIds();
  203 + if(oConvertUtils.isEmpty(returnValue) || (returnValue!=null && returnValue.indexOf(",")>0)){
  204 + returnValue = SpringContextUtils.getHttpServletRequest().getHeader(CommonConstant.TENANT_ID);
  205 + }
  206 + }
  207 + //update-end-author:taoyan date:20210330 for:多租户ID作为系统变量
200 if(returnValue!=null){returnValue = returnValue + moshi;} 208 if(returnValue!=null){returnValue = returnValue + moshi;}
201 return returnValue; 209 return returnValue;
202 } 210 }
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/CommonController.java
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest; @@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
28 import javax.servlet.http.HttpServletResponse; 28 import javax.servlet.http.HttpServletResponse;
29 import java.io.*; 29 import java.io.*;
30 import java.net.URLDecoder; 30 import java.net.URLDecoder;
  31 +
31 /** 32 /**
32 * <p> 33 * <p>
33 * 用户表 前端控制器 34 * 用户表 前端控制器
@@ -219,7 +220,7 @@ public class CommonController { @@ -219,7 +220,7 @@ public class CommonController {
219 File file = new File(filePath); 220 File file = new File(filePath);
220 if(!file.exists()){ 221 if(!file.exists()){
221 response.setStatus(404); 222 response.setStatus(404);
222 - throw new RuntimeException("文件不存在.."); 223 + throw new RuntimeException("文件["+imgPath+"]不存在..");
223 } 224 }
224 response.setContentType("application/force-download");// 设置强制下载不打开 225 response.setContentType("application/force-download");// 设置强制下载不打开
225 response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1")); 226 response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1"));