Merge remote-tracking branch 'origin/master'

This commit is contained in:
liyawei
2022-06-09 17:08:55 +08:00
13 changed files with 328 additions and 208 deletions
@@ -32,6 +32,8 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
@Value(value = "${jero.path.upload}")
private String uploadpath;
@Value(value = "${jero.path.uploadCos}")
private String uploadCospath;
/**
* 文件后缀黑名单
@@ -188,7 +190,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
OSSFile oSSFile = new OSSFile();
try {
String ctxPath = uploadpath;
String ctxPath = uploadCospath;
String fileName = null;
String fileType = null;
@@ -285,7 +287,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
OSSFile oSSFile = new OSSFile();
try {
String ctxPath = uploadpath;
String ctxPath = uploadCospath;
String fileName = null;
String fileType = null;
File file = new File(ctxPath + File.separator + bizPath + File.separator);
@@ -167,8 +167,8 @@ public class CommonController {
// bizPath = "";
// }
}
OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
// OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos
// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos
if (oConvertUtils.isNotEmpty(oSSFile)) {
result.setResult(oSSFile);
result.setSuccess(true);
@@ -343,7 +343,7 @@ public class CommonController {
* @param request
* @param response
*/
// @GetMapping(value = "/downLoadFile")
@GetMapping(value = "/downLoadFile")
public void downLoadFromCos(String id,HttpServletRequest request, HttpServletResponse response) {
if(StringUtils.isBlank(id)){
throw new JeroBootException("参数信息不全");
@@ -408,7 +408,7 @@ public class CommonController {
* @param request
* @param response
*/
@GetMapping(value = "/downLoadFile")
// @GetMapping(value = "/downLoadFile")
public void downLoadFile(String id,HttpServletRequest request, HttpServletResponse response) {
// 查询数据表数据是否存在
LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
@@ -23,6 +23,7 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryRuleEnum;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.collection.entity.OnlCgformCollection;
@@ -106,6 +107,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.DateFormat;
import java.text.ParseException;
@@ -3905,7 +3907,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
file.mkdirs();
for (OSSFile ossFile : fileInfosList) {
String url = ossFile.getUrl();
copyFile(url, fileNowPath + File.separator + ossFile.getFileName());
//判断文件是否存在
if(StringUtils.isNotBlank(url)){
//判断文件是否存在
boolean b = CosBootUtil.doesObjectExist(url);
if(b){
InputStream download = CosBootUtil.download(url);
copyFile(download, fileNowPath + File.separator + ossFile.getFileName());
}
}
}
}
}
@@ -4353,32 +4363,49 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
}
public static void copyFile(String oldFile, String newFile) throws IOException {
public static void copyFile(InputStream in, String newFile) throws IOException {
File file2 = new File(newFile);
if (!file2.exists()) {
file2.createNewFile();
}
// file2.mkdir();
File temp = new File(oldFile);
if (temp.isFile()) {
try (FileInputStream in = new FileInputStream(temp);
FileOutputStream ou = new FileOutputStream(newFile);) {
byte[] bs = new byte[1024];
int count = 0;
while ((count = in.read(bs, 0, bs.length)) != -1) {
ou.write(bs, 0, count);
}
ou.flush();
} catch (IOException e) {
e.printStackTrace();
throw new IOException("复制文件失败!");
try (FileOutputStream ou = new FileOutputStream(newFile);) {
byte[] bs = new byte[1024];
int count = 0;
while ((count = in.read(bs, 0, bs.length)) != -1) {
ou.write(bs, 0, count);
}
ou.flush();
} catch (IOException e) {
e.printStackTrace();
throw new IOException("复制文件失败!");
}
}
// public static void copyFile(String oldFile, String newFile) throws IOException {
//
// File file2 = new File(newFile);
// if (!file2.exists()) {
// file2.createNewFile();
// }
//// file2.mkdir();
// File temp = new File(oldFile);
//
// if (temp.isFile()) {
// try (FileInputStream in = new FileInputStream(temp);
// FileOutputStream ou = new FileOutputStream(newFile);) {
//
// byte[] bs = new byte[1024];
// int count = 0;
// while ((count = in.read(bs, 0, bs.length)) != -1) {
// ou.write(bs, 0, count);
// }
// ou.flush();
// } catch (IOException e) {
// e.printStackTrace();
// throw new IOException("复制文件失败!");
// }
//
// }
// }
/**
* ocr识别调取已入库文件-中英文切换
@@ -5203,7 +5230,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = iOSSFileService.uploadLocal(multipartFile, "", null,null);
OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null);
if (ObjectUtils.isNotEmpty(ossFile)) {
sb.append(ossFile.getId() + ",");
}
@@ -14,6 +14,7 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
@@ -1476,7 +1477,7 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = iOSSFileService.uploadLocal(multipartFile, "", null,null);
OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null);
if (ObjectUtils.isNotEmpty(ossFile)) {
sb.append(ossFile.getId() + ",");
}
@@ -2204,7 +2205,13 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
file.mkdirs();
for (OSSFile ossFile : oSSFileList) {
String url = ossFile.getUrl();
copyFile(url, fileNowPath + File.separator + ossFile.getFileName());
//判断文件是否存在
boolean b = CosBootUtil.doesObjectExist(url);
if (b) {
//从腾讯云获取文件
InputStream download = CosBootUtil.download(url);
copyFile(download, fileNowPath + File.separator + ossFile.getFileName());
}
}
}
}
@@ -24,6 +24,7 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.DateUtils;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
@@ -3974,7 +3975,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
MultipartFile multipartFile =
new MockMultipartFile(nowFileList.get(0).getName(), nowFileList.get(0).getName(), "text/plain", input);
//文件存入文件表
OSSFile ossFile = iOSSFileService.uploadLocal(multipartFile, "", null,null);
OSSFile ossFile = iOSSFileService.uploadLocalOfCos(multipartFile, "", null,null);
if (ObjectUtils.isNotEmpty(ossFile)) {
sb.append(ossFile.getId() + ",");
}
@@ -4394,7 +4395,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
file.mkdirs();
for (OSSFile ossFile : oSSFileList) {
String url = ossFile.getUrl();
copyFile(url, fileNowPath + File.separator + ossFile.getFileName());
if(StringUtils.isNotBlank(url)){
//判断文件是否存在
boolean b = CosBootUtil.doesObjectExist(url);
if(b){
InputStream download = CosBootUtil.download(url);
copyFile(download, fileNowPath + File.separator + ossFile.getFileName());
}
}
}
}
}
@@ -195,6 +195,7 @@ jero :
splitUrl: http://localhost:8080
path :
#文件上传根目录 设置
uploadCos: /upFiles
upload: D://opt//upFiles
img: D://opt//upFiles/
#webapp文件路径
+1
View File
@@ -712,6 +712,7 @@ module.exports = {
uploadTime: 'Upload time',
enclosure: 'Enclosure',
// 认证
Frozenstatus: 'Frozen status, can only be viewed',
chinese: 'chinese',
integerOrDecimal: 'integer Or Decimal',
OneDecimalPlace: 'One Decimal Place',
+1
View File
@@ -723,6 +723,7 @@ module.exports = {
uploadTime: '上传时间',
enclosure: '附件',
// 认证
Frozenstatus: '冻结状态,仅可以查看',
chinese: '中文',
integerOrDecimal: '整数或小数',
OneDecimalPlace: '一位小数',
+191 -169
View File
@@ -2,8 +2,8 @@
<div style="height: 100%">
<div class='box'>
<!-- 纯文本-->
<div v-if='detailDate.controlType === "1"'>
<div v-for='(item,index) in detailDate.list' :key='index'>
<div v-if='detailDate.controlType === "1"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="text"'>
<!-- 文本校验 分情况-->
<!-- 1 -->
@@ -32,57 +32,62 @@
</div>
<!-- 正整数 -->
<div v-if="item.controlVerify == '3'">
<a-input class="box-input inputWid"
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*$/g,'')"
:max="99999"
:precision="0"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
</div>
<!-- 正浮点书 -->
<div v-if="item.controlVerify == '4'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$/g,'')"
:placeholder="$t('pleaseEnter')+$t('Positivefloatingpointnumber')"
v-model="item.dataValue" />
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$/g,'')"
:placeholder="$t('pleaseEnter')+$t('Positivefloatingpointnumber')"
v-model="item.dataValue" />
</div>
<!-- 整数或小数 -->
<div v-if="item.controlVerify == '5'">
<a-input class="box-input inputWid"
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-|\+)?\d+(\.\d+)?$/g,'')"
:max="99999"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
</div>
<!-- 一位小数 -->
<div v-if="item.controlVerify == '6'">
<a-input class="box-input inputWid"
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{1})$/g,'')"
:max="99999"
:precision="1"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
</div>
<!-- 两位小数-->
<div v-if="item.controlVerify == '7'">
<a-input class="box-input inputWid"
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{2})$/g,'')"
:max="99999"
:precision="2"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 三位小数-->
<div v-if="item.controlVerify == '8'">
<a-input class="box-input inputWid"
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{3})$/g,'')"
:max="99999"
:precision="3"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 四位小数-->
<div v-if="item.controlVerify == '9'">
<a-input class="box-input inputWid"
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{4})$/g,'')"
:max="99999"
:precision="4"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
</div>
@@ -90,9 +95,9 @@
</div>
</div>
<!-- 纯下拉单选-->
<div v-if='detailDate.controlType === "2"'>
<div v-for='(item,index) in detailDate.list' :key='index'>
<div v-if='item.type === "pull"' class='add-width'>
<div v-if='detailDate.controlType === "2"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type === "pull"'>
<a-select v-model="item.dataValue" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(item, key) in item.controlValue" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
@@ -104,9 +109,9 @@
</div>
</div>
<!-- 纯下拉多选-->
<div v-if='detailDate.controlType === "3"'>
<div v-for='(item,index) in detailDate.list' :key='index' style='flex: 1'>
<div v-if='item.type==="pull_more"' class='add-width'>
<div v-if='detailDate.controlType === "3"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' style='flex: 1' class='add-width'>
<div v-if='item.type==="pull_more"'>
<a-select v-model="item.dataValue" mode="multiple" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(item, key) in item.controlValue" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
@@ -118,11 +123,11 @@
</div>
</div>
<!-- 纯附件-->
<div v-if='detailDate.controlType === "4"'>
<div v-for='(item,index) in detailDate.list' :key='index' style='flex: 1'>
<div v-if='item.type==="file"' class='add-width'>
<div v-if='detailDate.controlType === "4"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' style='flex: 1' class='add-width'>
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload(item)" :disabled="item.isLock == '1' ? true: false">
@click="clickButtonToUpload(item)">
{{ (item.dataValue === 'null' || item.dataValue === '' ||
item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
@@ -131,8 +136,8 @@
</div>
<!-- 文本+下拉单选-->
<div v-if='detailDate.controlType === "5"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add_flex_item'>
<div v-if='item.type==="pull"' class='add-width'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="pull"'>
<a-select v-model="item.dataValue" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(itemin, key) in item.controlValue" :key="key" :value="itemin.value">
<span style="display: inline-block;width: 100%" :title=" itemin.label ">
@@ -169,11 +174,12 @@
</div>
<!-- 正整数 -->
<div v-if="item.controlVerify == '3'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*$/g,'')"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="0"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
</div>
<!-- 正浮点书 -->
<div v-if="item.controlVerify == '4'">
@@ -185,50 +191,54 @@
</div>
<!-- 整数或小数 -->
<div v-if="item.controlVerify == '5'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-|\+)?\d+(\.\d+)?$/g,'')"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
</div>
<!-- 一位小数 -->
<div v-if="item.controlVerify == '6'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{1})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="1"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
</div>
<!-- 两位小数-->
<div v-if="item.controlVerify == '7'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{2})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="2"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 三位小数-->
<div v-if="item.controlVerify == '8'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{3})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="3"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 四位小数-->
<div v-if="item.controlVerify == '9'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{4})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="4"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
</div>
</div>
</div>
</div>
<!-- 文本+下拉多选-->
<div v-if='detailDate.controlType === "6"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add_flex_item'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="text"'>
<!-- 文本校验 分情况-->
<!-- 1 无-->
@@ -257,11 +267,12 @@
</div>
<!-- 正整数 -->
<div v-if="item.controlVerify == '3'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*$/g,'')"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="0"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
</div>
<!-- 正浮点书 -->
<div v-if="item.controlVerify == '4'">
@@ -273,46 +284,50 @@
</div>
<!-- 整数或小数 -->
<div v-if="item.controlVerify == '5'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-|\+)?\d+(\.\d+)?$/g,'')"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
</div>
<!-- 一位小数 -->
<div v-if="item.controlVerify == '6'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{1})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="1"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
</div>
<!-- 两位小数-->
<div v-if="item.controlVerify == '7'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{2})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="2"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 三位小数-->
<div v-if="item.controlVerify == '8'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{3})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="3"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 四位小数-->
<div v-if="item.controlVerify == '9'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{4})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="4"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
</div>
</div>
<div v-if='item.type==="pull_more"' class='add-width'>
<div v-if='item.type==="pull_more"'>
<a-select v-model="item.dataValue" mode="multiple" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(item, key) in item.controlValue" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
@@ -325,7 +340,7 @@
</div>
<!-- 文本+附件-->
<div v-if='detailDate.controlType === "7"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add_flex_item'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="text"'>
<!-- 文本校验 分情况-->
<!-- 1 无-->
@@ -354,11 +369,12 @@
</div>
<!-- 正整数 -->
<div v-if="item.controlVerify == '3'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*$/g,'')"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="0"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
</div>
<!-- 正浮点书 -->
<div v-if="item.controlVerify == '4'">
@@ -370,48 +386,52 @@
</div>
<!-- 整数或小数 -->
<div v-if="item.controlVerify == '5'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-|\+)?\d+(\.\d+)?$/g,'')"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
</div>
<!-- 一位小数 -->
<div v-if="item.controlVerify == '6'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{1})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="1"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
</div>
<!-- 两位小数-->
<div v-if="item.controlVerify == '7'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{2})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="2"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 三位小数-->
<div v-if="item.controlVerify == '8'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{3})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="3"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 四位小数-->
<div v-if="item.controlVerify == '9'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{4})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="4"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
</div>
</div>
<div v-if='item.type==="file"' class='add-width'>
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload(item)" :disabled="item.isLock == '1' ? true: false">
@click="clickButtonToUpload(item)">
{{ (item.dataValue === 'null' || item.dataValue === '' ||
item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
@@ -420,8 +440,8 @@
</div>
<!-- 下拉单选+附件-->
<div v-if='detailDate.controlType === "8"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add_flex_item'>
<div v-if='item.type==="pull"' class='add-width'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="pull"'>
<a-select v-model="item.dataValue" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(itemin, key) in item.controlValue" :key="key" :value="itemin.value">
<span style="display: inline-block;width: 100%" :title=" itemin.label ">
@@ -430,9 +450,8 @@
</a-select-option>
</a-select>
</div>
<div v-if='item.type==="file"' class='add-width'>
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
:disabled="item.isLock == '1' ? true: false"
@click="clickButtonToUpload(item)">
{{ (item.dataValue === 'null' || item.dataValue === '' ||
item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
@@ -442,8 +461,8 @@
</div>
<!-- 下拉多选+附件-->
<div v-if='detailDate.controlType === "9"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add_flex_item'>
<div v-if='item.type==="pull_more"' class='add-width'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="pull_more"'>
<a-select v-model="item.dataValue" mode="multiple" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(item, key) in item.controlValue" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
@@ -452,9 +471,8 @@
</a-select-option>
</a-select>
</div>
<div v-if='item.type==="file"' class='add-width'>
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
:disabled="item.isLock == '1' ? true: false"
@click="clickButtonToUpload(item)">
{{ (item.dataValue === 'null' || item.dataValue === '' ||
item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
@@ -464,7 +482,7 @@
</div>
<!-- 文本+下拉单选+附件-->
<div v-if='detailDate.controlType === "10"' class='add_flex'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add_flex_item'>
<div v-for='(item,index) in detailDate.list' :key='index' class='add-width'>
<div v-if='item.type==="pull"'>
<a-select v-model="item.dataValue" class='selectWid' :disabled="item.isLock == '1' ? true: false" allowClear>
<a-select-option v-for="(itemin, key) in item.controlValue" :key="key" :value="itemin.value">
@@ -502,11 +520,12 @@
</div>
<!-- 正整数 -->
<div v-if="item.controlVerify == '3'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^[1-9]\d*$/g,'')"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="0"
:placeholder="$t('enterPositiveInteger')"
v-model="item.dataValue" />
</div>
<!-- 正浮点书 -->
<div v-if="item.controlVerify == '4'">
@@ -518,48 +537,52 @@
</div>
<!-- 整数或小数 -->
<div v-if="item.controlVerify == '5'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-|\+)?\d+(\.\d+)?$/g,'')"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:placeholder="$t('pleaseEnter')+$t('integerOrDecimal')"
v-model="item.dataValue" />
</div>
<!-- 一位小数 -->
<div v-if="item.controlVerify == '6'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{1})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="1"
:placeholder="$t('pleaseEnter')+$t('OneDecimalPlace')"
v-model="item.dataValue" />
</div>
<!-- 两位小数-->
<div v-if="item.controlVerify == '7'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{2})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="2"
:placeholder="$t('pleaseEnter')+$t('TwoDecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 三位小数-->
<div v-if="item.controlVerify == '8'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{3})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="3"
:placeholder="$t('pleaseEnter')+$t('Threedecimalplaces')"
v-model="item.dataValue" />
</div>
<!-- 四位小数-->
<div v-if="item.controlVerify == '9'">
<a-input class="box-input inputWid"
:disabled="item.isLock == '1' ? true: false"
onkeyup="value=value.replace(/^(\-)?\d+(\.\d{4})$/g,'')"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
<a-input-number class="box-input inputWid add--number"
:disabled="item.isLock == '1' ? true: false"
:max="99999"
:precision="4"
:placeholder="$t('pleaseEnter')+$t('FourDecimalplaces')"
v-model="item.dataValue" />
</div>
</div>
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload(item)" :disabled="item.isLock == '1' ? true: false">
@click="clickButtonToUpload(item)">
{{ (item.dataValue === 'null' || item.dataValue === '' ||
item.dataValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
@@ -681,8 +704,7 @@ export default {
}
.add_flex_item{
width: 30%;
/*flex: 1;*/
margin-right: 15px;
flex: 1;
}
.selectWid{
min-width: 150px;
@@ -693,7 +715,7 @@ export default {
.add-width{
width: 30%;
}
/deep/.ant-table-column-sort .ant-table-row-cell-ellipsis{
text-align: left;
.add--number{
width: 101%;
}
</style>
+2 -1
View File
@@ -114,7 +114,7 @@
import { mixinDevice } from '@/utils/mixin.js'
import { getFileAccessHttpUrl, getAction } from '@/api/manage'
import Vue from 'vue'
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import { UI_CACHE_DB_DICT_DATA ,ACCESS_TOKEN} from '@/store/mutation-types'
import moment from 'moment'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import enUS from 'ant-design-vue/es/locale/en_US'
@@ -223,6 +223,7 @@
return that.Logout({}).then(() => {
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
that.$router.push({ path: '/user/login' })
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' + encodeURIComponent('http://grp.nioint.com/dashboard/analysis') + '&response_type=code'
localStorage.removeItem('language')
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
//window.location.reload()
@@ -59,6 +59,7 @@ export default {
}
},
created() {
console.log(this.detailDate,'detailDate')
const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = { 'X-Access-Token': token }
this.containerId = 'container-ty-' + new Date().getTime()
@@ -95,8 +96,6 @@ export default {
}
},
beforeUpload(file) {
console.log(file)
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
this.fileTypeSatus = true
//TODO 客户要求不拦截文件
@@ -125,6 +124,12 @@ export default {
window.open(url, '_blank')
},
handleChange(info) {
// this.detailDate.list.forEach((item) => {
// if(item.isLock === '1'){
// this.$message.warning(this.$t('Frozenstatus'))
// return
// }
// })
if(info.fileList.length > 1) {
this.$message.warning(this.$t('onlyOnefileUploaded'))
return
+49 -4
View File
@@ -4,16 +4,48 @@ import store from './store'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import notification from 'ant-design-vue/es/notification'
import { ACCESS_TOKEN, INDEX_MAIN_PAGE_PATH } from '@/store/mutation-types'
import { ACCESS_TOKEN, USER_NAME, USER_INFO, UI_CACHE_DB_DICT_DATA, INDEX_MAIN_PAGE_PATH } from '@/store/mutation-types'
import { generateIndexRouter } from '@/utils/util'
import { JSEncrypt } from 'jsencrypt'
import { getAction } from '@/api/manage'
import { welcome } from '@/utils/util'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/user/login', '/user/register', '/user/register-result', '/user/alteration'] // no redirect whitelist
const whiteList = ['/user/login', '/user/register', '/user/register-result', '/user/alteration']
// const whiteList = []
// no redirect whitelist
router.beforeEach((to, from, next) => {
NProgress.start() // start progress bar
if (to.query.code) {
getAction(`opensso/callback`, { code: to.query.code }).then(res => {
if (res.success) {
Vue.ls.set(ACCESS_TOKEN, res.result.token, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(USER_NAME, res.result.userInfo.username, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(USER_INFO, res.result.userInfo, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
store.commit('SET_TOKEN', res.result.token)
store.commit('SET_INFO', res.result.userInfo)
store.commit('SET_NAME', {
username: res.result.userInfo.username,
realname: res.result.userInfo.realname,
welcome: welcome()
})
store.commit('SET_AVATAR', res.result.userInfo.avatar)
let fullPath = ''
if (to.fullPath == '/') {
fullPath = INDEX_MAIN_PAGE_PATH
} else {
fullPath = to.path
}
let query = to.query
delete query.code
next({ path: fullPath, query: query })
}
})
return
}
if (Vue.ls.get(ACCESS_TOKEN)) {
/* has token */
if (to.path === '/user/login') {
@@ -52,6 +84,13 @@ router.beforeEach((to, from, next) => {
// query: { redirect: to.fullPath }
store.dispatch('Logout').then(() => {
next({ path: '/user/login', query: { redirect: to.fullPath } })
let fullPath = ''
if (to.fullPath == '/') {
fullPath = INDEX_MAIN_PAGE_PATH
} else {
fullPath = to.fullPath
}
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code'
})
})
} else {
@@ -63,8 +102,14 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入
next()
} else {
next({ path: '/user/login', query: { redirect: to.fullPath } })
let fullPath = ''
if (to.fullPath == '/') {
fullPath = INDEX_MAIN_PAGE_PATH + '?id=123'
} else {
fullPath = to.fullPath
}
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code'
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}
}
+1 -1
View File
@@ -414,7 +414,7 @@
},
//sso登录跳转
ssoLogin(){
window.open('https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F39.98.140.126&response_type=code', '_blank')
window.open('https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fdashboard%2Fanalysis&response_type=code', '_blank')
},
//sso登录
ssoLoginSuccess(){