From dcc1589dd84c458893055b9fd10c46c760fe3c61 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Wed, 7 Feb 2024 14:33:59 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E3=80=90ID1000408=E3=80=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=AE=A1=E7=90=86-=E6=96=B0=E5=A2=9E=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=EF=BC=8CIOT=E4=BB=AA=E5=99=A8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E4=BC=A0=E5=90=AF=E5=8A=A8/=E6=9A=82?= =?UTF-8?q?=E5=81=9C=E5=9B=BE=E7=89=87GIF=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=90=AF?= =?UTF-8?q?=E5=8A=A8/=E6=9A=82=E5=81=9C=E5=9B=BE=E7=89=87GIF=E6=9C=AA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxInstrumentServiceImpl.java | 17 ++++++------- flossom-ui/src/views/system/mode/index.vue | 25 ++++++++++++++++++- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java index a19e0d8..c8b7a39 100644 --- a/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-mini-program/src/main/java/com/flossom/miniProgram/service/impl/WxInstrumentServiceImpl.java @@ -432,24 +432,23 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { List wxModeList = wxModeMapper.selectListByInstrumentId(instrumentId); for (WxMode wxMode : wxModeList) { // 判断每个模式是否加锁 + WxModeRet wxModeRet = new WxModeRet(); WxModeTag wxModeTag = new WxModeTag(); wxModeTag.setModeId(wxMode.getId()); List wxModeTagList = wxModeTagMapper.selectWxModeTagList(wxModeTag); + BeanUtils.copyProperties(wxMode, wxModeRet); + wxModeRet.setModeTime(LocalTime.of(0, wxMode.getModeTime())); + Boolean isLock = false; if (wxModeTagList != null && wxModeTagList.size() > 0) { List modeTagList = wxModeTagList.stream().map(WxModeTag::getTagId).collect(Collectors.toList()); if (userTagIdList == null || userTagIdList.size() == 0 || !userTagIdList.containsAll(modeTagList)) { - WxModeRet wxModeRet = new WxModeRet(); - BeanUtils.copyProperties(wxMode, wxModeRet); wxModeRet.setLock(true); - wxModeRetList.add(wxModeRet); - continue; + isLock = true; } } - WxModeRet wxModeRet = new WxModeRet(); - BeanUtils.copyProperties(wxMode, wxModeRet); - wxModeRet.setLock(false); - wxModeRet.setModeTime(LocalTime.of(0, 10)); - + if (!isLock) { + wxModeRet.setLock(false); + } // 查询 模式组合 WxModeCombineInfo query = new WxModeCombineInfo(); query.setModeId(wxMode.getId()); diff --git a/flossom-ui/src/views/system/mode/index.vue b/flossom-ui/src/views/system/mode/index.vue index f89b339..c48ea16 100644 --- a/flossom-ui/src/views/system/mode/index.vue +++ b/flossom-ui/src/views/system/mode/index.vue @@ -291,6 +291,8 @@ list-type="picture-card" :on-preview="handlePreviewFile" :on-success="uploadServiceSuccess" + :before-upload="limitGifFileType" + accept=".GIF,.gif" > @@ -309,6 +311,8 @@ list-type="picture-card" :on-preview="handlePreviewFile" :on-success="uploadServiceSuccess" + :before-upload="limitGifFileType" + accept=".GIF,.gif" > @@ -728,6 +732,26 @@ export default { handlePreview(file) { console.log(file); }, + limitGifFileType(file) { + const imageType = ['image/gif', 'image/GIF'] + let isVideo = imageType.includes(file.type) + // 检验文件格式 + if (!isVideo) { + this.$message.error(`图片格式错误!`) + return false + } + // 校检文件大小 + let fileSize = 5; + if (fileSize) { + let isLt = file.size / 1024 / 1024 < fileSize + if (!isLt) { + this.$message.error(`上传文件大小不能超过 ${fileSize} MB!`) + return false + } + } + return true; + + }, limitImageFileType(file) { const imageType = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg'] let isVideo = imageType.includes(file.type) @@ -746,7 +770,6 @@ export default { } } return true; - }, limitVideFileType(file) { const videoType = ['video/mp4','video/avi','video/mov','video/rmvb','video/rm','video/flv','video/3gp']