From ccba5bdce5402441a563b9609f7a6e845dd9efbb Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 22 Mar 2022 12:56:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=8F=82=E6=95=B0-=E6=98=BE=E7=A4=BA=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/constants/ParamConstants.java | 10 ++++--- .../controller/sys/response/BasicInfo.java | 6 +++-- .../system/SystemParameterService.java | 26 +++++++++++++------ .../main/resources/db/migration/V33__1.9.sql | 2 +- frontend/src/lang/en.js | 6 ++--- frontend/src/lang/tw.js | 2 +- frontend/src/lang/zh.js | 2 +- .../views/system/SysParam/BasicSetting.vue | 12 ++++++++- 8 files changed, 45 insertions(+), 21 deletions(-) diff --git a/backend/src/main/java/io/dataease/commons/constants/ParamConstants.java b/backend/src/main/java/io/dataease/commons/constants/ParamConstants.java index 745b7e274a..f3a3eae415 100644 --- a/backend/src/main/java/io/dataease/commons/constants/ParamConstants.java +++ b/backend/src/main/java/io/dataease/commons/constants/ParamConstants.java @@ -1,6 +1,5 @@ package io.dataease.commons.constants; - public interface ParamConstants { String getValue(); @@ -50,7 +49,6 @@ public interface ParamConstants { } } - enum Registry implements ParamConstants { URL("registry.url"), REPO("registry.repo"), @@ -89,7 +87,7 @@ public interface ParamConstants { } } - enum MAIL implements ParamConstants{ + enum MAIL implements ParamConstants { SERVER("smtp.host"), PORT("smtp.port"), ACCOUNT("smtp.account"), @@ -111,11 +109,15 @@ public interface ParamConstants { enum BASIC implements ParamConstants { FRONT_TIME_OUT("basic.frontTimeOut"), - MSG_TIME_OUT("basic.msgTimeOut"); + MSG_TIME_OUT("basic.msgTimeOut"), + OPEN_HOME_PAGE("ui.openHomePage"); + private String value; + public String getValue() { return this.value; } + private BASIC(String value) { this.value = value; } diff --git a/backend/src/main/java/io/dataease/controller/sys/response/BasicInfo.java b/backend/src/main/java/io/dataease/controller/sys/response/BasicInfo.java index 19df51477f..bd1cf46d52 100644 --- a/backend/src/main/java/io/dataease/controller/sys/response/BasicInfo.java +++ b/backend/src/main/java/io/dataease/controller/sys/response/BasicInfo.java @@ -6,11 +6,13 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data -public class BasicInfo implements Serializable{ +public class BasicInfo implements Serializable { @ApiModelProperty("请求超时时间") private String frontTimeOut; @ApiModelProperty("消息保留时间") private String msgTimeOut; - + @ApiModelProperty("显示首页") + private String openHomePage; + } diff --git a/backend/src/main/java/io/dataease/service/system/SystemParameterService.java b/backend/src/main/java/io/dataease/service/system/SystemParameterService.java index 3e5b3925c3..2efb9197d0 100644 --- a/backend/src/main/java/io/dataease/service/system/SystemParameterService.java +++ b/backend/src/main/java/io/dataease/service/system/SystemParameterService.java @@ -41,7 +41,10 @@ public class SystemParameterService { public BasicInfo basicInfo() { List paramList = this.getParamList("basic"); + List homePageList = this.getParamList("ui.openHomePage"); + paramList.addAll(homePageList); BasicInfo result = new BasicInfo(); + result.setOpenHomePage("true"); if (!CollectionUtils.isEmpty(paramList)) { for (SystemParameter param : paramList) { if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.FRONT_TIME_OUT.getValue())) { @@ -50,6 +53,10 @@ public class SystemParameterService { if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.MSG_TIME_OUT.getValue())) { result.setMsgTimeOut(param.getParamValue()); } + if (StringUtils.equals(param.getParamKey(), ParamConstants.BASIC.OPEN_HOME_PAGE.getValue())) { + boolean open = StringUtils.equals("true", param.getParamValue()); + result.setOpenHomePage(open ? "true" : "false"); + } } } return result; @@ -137,12 +144,13 @@ public class SystemParameterService { return dtoList; } - public void saveUIInfo(Map> request, List bodyFiles) throws IOException { + public void saveUIInfo(Map> request, List bodyFiles) + throws IOException { List parameters = request.get("systemParams"); if (null != bodyFiles) for (MultipartFile multipartFile : bodyFiles) { if (!multipartFile.isEmpty()) { - //防止添加非图片文件 + // 防止添加非图片文件 try (InputStream input = multipartFile.getInputStream()) { try { // It's an image (only BMP, GIF, JPG and PNG are recognized). @@ -154,10 +162,12 @@ public class SystemParameterService { } String multipartFileName = multipartFile.getOriginalFilename(); String[] split = Objects.requireNonNull(multipartFileName).split(","); - parameters.stream().filter(systemParameterDTO -> systemParameterDTO.getParamKey().equalsIgnoreCase(split[1])).forEach(systemParameterDTO -> { - systemParameterDTO.setFileName(split[0]); - systemParameterDTO.setFile(multipartFile); - }); + parameters.stream() + .filter(systemParameterDTO -> systemParameterDTO.getParamKey().equalsIgnoreCase(split[1])) + .forEach(systemParameterDTO -> { + systemParameterDTO.setFileName(split[0]); + systemParameterDTO.setFile(multipartFile); + }); } } for (SystemParameterDTO systemParameter : parameters) { @@ -168,7 +178,8 @@ public class SystemParameterService { } if (file != null) { fileService.deleteFileById(systemParameter.getParamValue()); - FileMetadata fileMetadata = fileService.saveFile(systemParameter.getFile(), systemParameter.getFileName()); + FileMetadata fileMetadata = fileService.saveFile(systemParameter.getFile(), + systemParameter.getFileName()); systemParameter.setParamValue(fileMetadata.getId()); } if (file == null && systemParameter.getFileName() == null) { @@ -181,5 +192,4 @@ public class SystemParameterService { } - } diff --git a/backend/src/main/resources/db/migration/V33__1.9.sql b/backend/src/main/resources/db/migration/V33__1.9.sql index f3b12126df..3f89c8546e 100644 --- a/backend/src/main/resources/db/migration/V33__1.9.sql +++ b/backend/src/main/resources/db/migration/V33__1.9.sql @@ -86,4 +86,4 @@ CREATE TABLE `de_engine` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.mobileBG', NULL, 'file', 0); +INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.mobileBG', NULL, 'file', 14); diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 1222f6d698..515a63644f 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1632,7 +1632,8 @@ export default { themeLight: 'Light', themeDark: 'Dark', themeCustom: 'Custom', - openHomePage: 'Show Home Page' + openHomePage: 'Show Home Page', + mobileBG: 'Mobile Login page BG' }, auth: { @@ -1888,8 +1889,7 @@ export default { cmonth: 'This Month', cquarter: 'This Quarter', cyear: 'This Year', - openHomePage: 'Show Home Page', - mobileBG: 'Mobile BG' + openHomePage: 'Show Home Page' }, dynamic_year: { fix: 'Fixed Year', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 66db858159..1d2826763c 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1643,7 +1643,7 @@ export default { themeCustom: '自定義', openHomePage: '顯示首頁', - mobileBG: '移動端背景' + mobileBG: '移動端登錄頁背景' }, auth: { diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 8907f20014..fc2d222f20 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1651,7 +1651,7 @@ export default { themeDark: '深色', themeCustom: '自定义', openHomePage: '显示首页', - mobileBG: '移动端背景' + mobileBG: '移动端登录页背景' }, auth: { diff --git a/frontend/src/views/system/SysParam/BasicSetting.vue b/frontend/src/views/system/SysParam/BasicSetting.vue index f29e560d02..f1bf557778 100644 --- a/frontend/src/views/system/SysParam/BasicSetting.vue +++ b/frontend/src/views/system/SysParam/BasicSetting.vue @@ -31,7 +31,16 @@ + + + + + + + + +
{{ $t('commons.edit') }} @@ -103,7 +112,8 @@ export default { save(formInline) { const param = [ { paramKey: 'basic.frontTimeOut', paramValue: this.formInline.frontTimeOut, type: 'text', sort: 1 }, - { paramKey: 'basic.msgTimeOut', paramValue: this.formInline.msgTimeOut, type: 'text', sort: 2 } + { paramKey: 'basic.msgTimeOut', paramValue: this.formInline.msgTimeOut, type: 'text', sort: 2 }, + { paramKey: 'ui.openHomePage', paramValue: this.formInline.openHomePage, type: 'text', sort: 13 } ] From 3749e9c0d403968684a0f7b3f1cf5c13ab1fc5e1 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 22 Mar 2022 15:20:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=88=86=E4=BA=AB=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/base/mapper/ext/HomeMapper.java | 5 +- .../dataease/base/mapper/ext/HomeMapper.xml | 7 +- .../java/io/dataease/mobile/api/HomeApi.java | 3 + .../dataease/mobile/dto/HomeItemShareDTO.java | 11 +++ .../io/dataease/mobile/server/HomeServer.java | 8 +- .../dataease/mobile/service/HomeService.java | 44 ++++++----- frontend/src/api/panel/shareProxy.js | 2 +- .../canvas/components/Editor/PreviewEject.vue | 78 ++++++++++++------- .../src/views/panel/GrantAuth/shareTree.vue | 1 + .../src/views/panel/list/PanelViewShow.vue | 18 ++++- mobile/src/api/panel.js | 6 +- mobile/src/pages/tabBar/dir/folder.vue | 3 +- mobile/src/pages/tabBar/dir/index.vue | 3 +- mobile/src/pages/tabBar/dir/search.vue | 3 +- mobile/src/pages/tabBar/home/detail.nvue | 10 ++- mobile/src/pages/tabBar/home/index.nvue | 7 +- 16 files changed, 140 insertions(+), 69 deletions(-) create mode 100644 backend/src/main/java/io/dataease/mobile/dto/HomeItemShareDTO.java diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.java b/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.java index c0fbb65c81..6302950598 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.java +++ b/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.java @@ -1,15 +1,16 @@ package io.dataease.base.mapper.ext; import io.dataease.mobile.dto.HomeItemDTO; +import io.dataease.mobile.dto.HomeItemShareDTO; + import java.util.List; import java.util.Map; public interface HomeMapper { - List queryStore(Map param); List queryHistory(); - List queryShare(Map param); + List queryShare(Map param); } diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.xml index b29bcc5ef3..0d574ba434 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/HomeMapper.xml @@ -18,14 +18,17 @@ order by s.create_time desc - select distinct(s.panel_group_id) as id, g.name as title, - s.create_time as `time` + s.create_time as `time`, + u.nick_name, + u.user_id from panel_share s inner join panel_group g on s.panel_group_id = g.id + left join sys_user u on u.username = IFNULL(s.granter,g.create_by) where g.mobile_layout = 1 and ( ( s.target_id = #{userId} and s.type = 0 ) or diff --git a/backend/src/main/java/io/dataease/mobile/api/HomeApi.java b/backend/src/main/java/io/dataease/mobile/api/HomeApi.java index 4d1e36b95a..782094431a 100644 --- a/backend/src/main/java/io/dataease/mobile/api/HomeApi.java +++ b/backend/src/main/java/io/dataease/mobile/api/HomeApi.java @@ -2,6 +2,7 @@ package io.dataease.mobile.api; import io.dataease.commons.utils.Pager; import io.dataease.mobile.dto.HomeItemDTO; +import io.dataease.mobile.dto.HomeItemShareDTO; import io.dataease.mobile.dto.HomeRequest; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -15,6 +16,8 @@ public interface HomeApi { @PostMapping("/query") Pager> query(@RequestBody HomeRequest request); + @PostMapping("/queryShares") + Pager> queryShares(@RequestBody HomeRequest request); @PostMapping("/detail/{id}") Object detail(@PathVariable String id); diff --git a/backend/src/main/java/io/dataease/mobile/dto/HomeItemShareDTO.java b/backend/src/main/java/io/dataease/mobile/dto/HomeItemShareDTO.java new file mode 100644 index 0000000000..0121edee11 --- /dev/null +++ b/backend/src/main/java/io/dataease/mobile/dto/HomeItemShareDTO.java @@ -0,0 +1,11 @@ +package io.dataease.mobile.dto; + +import lombok.Data; + +@Data +public class HomeItemShareDTO extends HomeItemDTO { + + private String nickName; + + private Long userId; +} diff --git a/backend/src/main/java/io/dataease/mobile/server/HomeServer.java b/backend/src/main/java/io/dataease/mobile/server/HomeServer.java index 822b8483b9..78bb474633 100644 --- a/backend/src/main/java/io/dataease/mobile/server/HomeServer.java +++ b/backend/src/main/java/io/dataease/mobile/server/HomeServer.java @@ -3,6 +3,7 @@ package io.dataease.mobile.server; import io.dataease.commons.utils.Pager; import io.dataease.mobile.api.HomeApi; import io.dataease.mobile.dto.HomeItemDTO; +import io.dataease.mobile.dto.HomeItemShareDTO; import io.dataease.mobile.dto.HomeRequest; import io.dataease.mobile.service.HomeService; import org.springframework.web.bind.annotation.RestController; @@ -15,8 +16,6 @@ public class HomeServer implements HomeApi { @Resource private HomeService homeService; - - @Override public Pager> query(HomeRequest request) { return homeService.query(request); @@ -27,5 +26,10 @@ public class HomeServer implements HomeApi { return null; } + @Override + public Pager> queryShares(HomeRequest request) { + + return homeService.queryShares(request); + } } diff --git a/backend/src/main/java/io/dataease/mobile/service/HomeService.java b/backend/src/main/java/io/dataease/mobile/service/HomeService.java index 6bd2f80124..f1227c6f30 100644 --- a/backend/src/main/java/io/dataease/mobile/service/HomeService.java +++ b/backend/src/main/java/io/dataease/mobile/service/HomeService.java @@ -8,6 +8,7 @@ import io.dataease.commons.utils.AuthUtils; import io.dataease.commons.utils.PageUtils; import io.dataease.commons.utils.Pager; import io.dataease.mobile.dto.HomeItemDTO; +import io.dataease.mobile.dto.HomeItemShareDTO; import io.dataease.base.mapper.ext.HomeMapper; import io.dataease.mobile.dto.HomeRequest; import org.springframework.stereotype.Service; @@ -29,27 +30,28 @@ public class HomeService { Map param = new HashMap<>(); param.put("userId", user.getUserId()); - switch (request.getType()){ - - - case 2: - - Long deptId = user.getDeptId(); - List roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList()); - - param.put("deptId", deptId); - param.put("roleIds", roleIds); - if (null != request.getLastTime()) { - param.put("lastTime", request.getLastTime()); - } - - return PageUtils.setPageInfo(page, homeMapper.queryShare(param)); - default: - param.put("userId", user.getUserId()); - if (null != request.getLastTime()) { - param.put("lastTime", request.getLastTime()); - } - return PageUtils.setPageInfo(page, homeMapper.queryStore(param)); + param.put("userId", user.getUserId()); + if (null != request.getLastTime()) { + param.put("lastTime", request.getLastTime()); } + return PageUtils.setPageInfo(page, homeMapper.queryStore(param)); + } + + public Pager> queryShares(HomeRequest request) { + CurrentUserDto user = AuthUtils.getUser(); + Page page = PageHelper.startPage(1, 13, true); + + Map param = new HashMap<>(); + param.put("userId", user.getUserId()); + Long deptId = user.getDeptId(); + List roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList()); + + param.put("deptId", deptId); + param.put("roleIds", roleIds); + if (null != request.getLastTime()) { + param.put("lastTime", request.getLastTime()); + } + + return PageUtils.setPageInfo(page, homeMapper.queryShare(param)); } } diff --git a/frontend/src/api/panel/shareProxy.js b/frontend/src/api/panel/shareProxy.js index bb6977faba..53a6049cd6 100644 --- a/frontend/src/api/panel/shareProxy.js +++ b/frontend/src/api/panel/shareProxy.js @@ -22,7 +22,7 @@ export function proxyInitPanelData(panelId, proxy, callback) { queryPanelJumpInfo(panelId, proxy).then(rsp => { store.commit('setNowPanelJumpInfo', rsp.data) }) - callback(response) + callback && callback(response) }) } diff --git a/frontend/src/components/canvas/components/Editor/PreviewEject.vue b/frontend/src/components/canvas/components/Editor/PreviewEject.vue index 6c23856e7f..3a1a9c8794 100644 --- a/frontend/src/components/canvas/components/Editor/PreviewEject.vue +++ b/frontend/src/components/canvas/components/Editor/PreviewEject.vue @@ -8,6 +8,7 @@ import Preview from './Preview' import { uuid } from 'vue-uuid' import { initPanelData } from '@/api/panel/panel' import { queryTargetPanelJumpInfo } from '@/api/panel/linkJump' +import { proxyInitPanelData } from '@/api/panel/shareProxy' export default { components: { Preview }, @@ -15,12 +16,8 @@ export default { return { dataLoading: false, backScreenShot: false, - mainHeight: '100vh!important' - } - }, - watch: { - '$route.params.reportId': function() { - this.restore() + mainHeight: '100vh!important', + shareUserId: null } }, computed: { @@ -37,6 +34,7 @@ export default { this.restore() } }, + mounted() { this.restore() }, @@ -45,35 +43,59 @@ export default { this.mainHeight = mainHeight }, restore() { + debugger const _this = this _this.dataLoading = true - _this.panelId = this.$route.params.reportId + if (!this.$route.params.reportId) { + return + } + const arr = this.$route.params.reportId.split('|') + if (!arr || arr.length === 0) { + return + } + _this.panelId = arr[0] + + if (arr.length > 1) { + this.shareUserId = arr[1] + } + if (_this.$route.params.backScreenShot !== undefined) { _this.backScreenShot = _this.$route.params.backScreenShot } // 加载视图数据 - initPanelData(this.panelId, function() { - _this.dataLoading = false - // 如果含有跳转参数 进行触发 - const tempParam = localStorage.getItem('jumpInfoParam') - if (tempParam) { - localStorage.removeItem('jumpInfoParam') - const jumpParam = JSON.parse(tempParam) - const jumpRequestParam = { - sourcePanelId: jumpParam.sourcePanelId, - sourceViewId: jumpParam.sourceViewId, - sourceFieldId: jumpParam.sourceFieldId, - targetPanelId: _this.panelId - } - _this.dataLoading = true - // 刷新跳转目标仪表板联动信息 - queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => { - _this.dataLoading = false - _this.$store.commit('setNowTargetPanelJumpInfo', rsp.data) - _this.$store.commit('addViewTrackFilter', jumpParam) - }) + if (this.shareUserId !== null) { + const param = { userId: this.shareUserId } + proxyInitPanelData(this.panelId, param, () => { + this.initCallBack() + }) + } else { + initPanelData(this.panelId, () => { + this.initCallBack() + }) + } + }, + + initCallBack() { + this.dataLoading = false + // 如果含有跳转参数 进行触发 + const tempParam = localStorage.getItem('jumpInfoParam') + if (tempParam) { + localStorage.removeItem('jumpInfoParam') + const jumpParam = JSON.parse(tempParam) + const jumpRequestParam = { + sourcePanelId: jumpParam.sourcePanelId, + sourceViewId: jumpParam.sourceViewId, + sourceFieldId: jumpParam.sourceFieldId, + targetPanelId: this.panelId } - }) + this.dataLoading = true + // 刷新跳转目标仪表板联动信息 + queryTargetPanelJumpInfo(jumpRequestParam).then(rsp => { + this.dataLoading = false + this.$store.commit('setNowTargetPanelJumpInfo', rsp.data) + this.$store.commit('addViewTrackFilter', jumpParam) + }) + } }, resetID(data) { if (data) { diff --git a/frontend/src/views/panel/GrantAuth/shareTree.vue b/frontend/src/views/panel/GrantAuth/shareTree.vue index 2d34b3faad..de3dca3c45 100644 --- a/frontend/src/views/panel/GrantAuth/shareTree.vue +++ b/frontend/src/views/panel/GrantAuth/shareTree.vue @@ -110,6 +110,7 @@ export default { const param = { userId: data.userId } proxyInitPanelData(data.id, param, function() { bus.$emit('set-panel-show-type', 1) + bus.$emit('set-panel-share-user', data.userId) }) this.$refs['botTree'].setCurrentKey(null) }, diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 06537cb697..9ff03807e4 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -137,7 +137,7 @@ import bus from '@/utils/bus' import { queryAll } from '@/api/panel/pdfTemplate' import ShareHead from '@/views/panel/GrantAuth/ShareHead' import { initPanelData } from '@/api/panel/panel' - +import { proxyInitPanelData } from '@/api/panel/shareProxy' export default { name: 'PanelViewShow', components: { Preview, SaveToTemplate, PDFPreExport, ShareHead }, @@ -162,7 +162,8 @@ export default { snapshotInfo: '', showType: 0, dataLoading: false, - exporting: false + exporting: false, + shareUserId: null } }, computed: { @@ -214,6 +215,9 @@ export default { bus.$on('set-panel-show-type', type => { this.showType = type || 0 }) + bus.$on('set-panel-share-user', userId => { + this.shareUserId = userId + }) this.initPdfTemplate() }, methods: { @@ -227,7 +231,10 @@ export default { this.fullscreen = true }, newTab() { - const url = '#/preview/' + this.$store.state.panel.panelInfo.id + let url = '#/preview/' + this.$store.state.panel.panelInfo.id + if (this.showType === 1 && this.shareUserId !== null) { + url += ('|' + this.shareUserId) + } window.open(url, '_blank') }, saveToTemplate() { @@ -344,7 +351,10 @@ export default { this.$emit('editPanel') }, refreshPanel() { - initPanelData(this.panelInfo.id) + if (this.showType === 1 && this.shareUserId !== null) { + const param = { userId: this.shareUserId } + proxyInitPanelData(this.panelInfo.id, param, null) + } else { initPanelData(this.panelInfo.id) } } } } diff --git a/mobile/src/api/panel.js b/mobile/src/api/panel.js index 8e3bdd1728..5e867aa354 100644 --- a/mobile/src/api/panel.js +++ b/mobile/src/api/panel.js @@ -1,8 +1,12 @@ import request from '@/common/js/request' export function requestHome(data) { + let url = '/mobile/home/query' + if (data && data.type === 2) { + url = 'mobile/home/queryShares' + } return request({ - url: '/mobile/home/query', + url: url, method: 'post', loading: true, data diff --git a/mobile/src/pages/tabBar/dir/folder.vue b/mobile/src/pages/tabBar/dir/folder.vue index 5d653bed1e..c18e814a33 100644 --- a/mobile/src/pages/tabBar/dir/folder.vue +++ b/mobile/src/pages/tabBar/dir/folder.vue @@ -75,7 +75,8 @@ export default { const param = { id: node.id, title: node.text, - index: 4 + index: 4, + userId: node.userId } if(node.type === 'panel') { diff --git a/mobile/src/pages/tabBar/dir/index.vue b/mobile/src/pages/tabBar/dir/index.vue index 0e2df49164..d760fca796 100644 --- a/mobile/src/pages/tabBar/dir/index.vue +++ b/mobile/src/pages/tabBar/dir/index.vue @@ -72,7 +72,8 @@ export default { const param = { id: node.id, title: node.text, - index: 4 + index: 4, + userId: node.userId } if(node.type === 'panel') { diff --git a/mobile/src/pages/tabBar/dir/search.vue b/mobile/src/pages/tabBar/dir/search.vue index aad3bb30a2..c9dba01034 100644 --- a/mobile/src/pages/tabBar/dir/search.vue +++ b/mobile/src/pages/tabBar/dir/search.vue @@ -101,7 +101,8 @@ export default { const param = { id: node.id, title: node.text, - index: 4 + index: 4, + userId: node.userId } if(node.type === 'panel') { diff --git a/mobile/src/pages/tabBar/home/detail.nvue b/mobile/src/pages/tabBar/home/detail.nvue index bb212b927c..c163c2c1a3 100644 --- a/mobile/src/pages/tabBar/home/detail.nvue +++ b/mobile/src/pages/tabBar/home/detail.nvue @@ -133,7 +133,7 @@ methods: { addRecent() { - const item = {id: this.banner.id, title: this.banner.title, index: this.banner.index} + const item = {id: this.banner.id, title: this.banner.title, index: this.banner.index, userId: this.banner.userId} addRecent(item) }, enshrine() { @@ -167,9 +167,11 @@ }) }, loadLinkUrl() { - - - this.url = process.env.VUE_APP_BASE_API + 'tempMobileLink/' + this.banner.id + "/" + getToken() + this.url = process.env.VUE_APP_BASE_API + 'tempMobileLink/' + this.banner.id + "/" + getToken() + if (this.banner.index && this.banner.index === 2 && this.banner.userId) { + this.url = process.env.VUE_APP_BASE_API + 'tempMobileLink/' + this.banner.id + '|' + this.banner.userId + "/" + getToken() + } + const url = this.url /* uni.hideLoading() */ setTimeout(() => { diff --git a/mobile/src/pages/tabBar/home/index.nvue b/mobile/src/pages/tabBar/home/index.nvue index 28a61b0528..8f99107019 100644 --- a/mobile/src/pages/tabBar/home/index.nvue +++ b/mobile/src/pages/tabBar/home/index.nvue @@ -118,6 +118,9 @@ datas.forEach(item => { item.article_type = 1 item.image_url = '../../../static/yibiaobans.png' + if(item.nickName) { + item.title += ('(' + item.nickName + ')') + } if(item.time) item.rightText = formatHistoryDate(item.time) }) @@ -151,10 +154,12 @@ const param = { id: node.id, title: node.title, - index: this.tabIndex + index: this.tabIndex, + userId: node.userId } if(this.tabIndex === 1) { param.index = node.index + param.userId = node.userId } uni.navigateTo({