forked from github/dataease
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
7871deae45
@ -26,9 +26,11 @@ public class SysLogConstants {
|
||||
|
||||
LOGIN(12, "OPERATE_TYPE_LOGIN"),
|
||||
|
||||
VIEW(13, "OPERATE_TYPE_VIEW"),
|
||||
PC_VIEW(13, "OPERATE_TYPE_PC_VIEW"),
|
||||
|
||||
EXPORT(14, "OPERATE_TYPE_EXPORT");
|
||||
MB_VIEW(14, "OPERATE_TYPE_MB_VIEW"),
|
||||
|
||||
EXPORT(15, "OPERATE_TYPE_EXPORT");
|
||||
private Integer value;
|
||||
private String name;
|
||||
OPERATE_TYPE(Integer value, String name) {
|
||||
|
@ -7,7 +7,7 @@ import io.dataease.auth.annotation.DePermissions;
|
||||
import io.dataease.auth.service.impl.ExtAuthServiceImpl;
|
||||
import io.dataease.commons.constants.PanelConstants;
|
||||
import io.dataease.controller.request.panel.PanelGroupBaseInfoRequest;
|
||||
import io.dataease.plugins.common.base.domain.PanelGroup;
|
||||
import io.dataease.controller.request.panel.PanelViewLogRequest;
|
||||
import io.dataease.commons.constants.DePermissionType;
|
||||
import io.dataease.commons.constants.ResourceAuthLevel;
|
||||
import io.dataease.controller.handler.annotation.I18n;
|
||||
@ -131,13 +131,20 @@ public class PanelGroupController {
|
||||
return panelGroupService.queryPanelComponents(id);
|
||||
}
|
||||
|
||||
@ApiOperation("导出仪表板视图明细")
|
||||
@ApiOperation("公共连接导出仪表板视图明细")
|
||||
@PostMapping("/exportDetails")
|
||||
@I18n
|
||||
public void exportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
||||
panelGroupService.exportPanelViewDetails(request, response);
|
||||
}
|
||||
|
||||
@ApiOperation("站内导出仪表板视图明细")
|
||||
@PostMapping("/innerExportDetails")
|
||||
@I18n
|
||||
public void innerExportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
||||
panelGroupService.exportPanelViewDetails(request, response);
|
||||
}
|
||||
|
||||
@ApiOperation("更新仪表板状态")
|
||||
@PostMapping("/updatePanelStatus/{panelId}")
|
||||
@I18n
|
||||
@ -172,4 +179,10 @@ public class PanelGroupController {
|
||||
public void removePanelCache(@PathVariable String panelId){
|
||||
panelGroupService.removePanelCache(panelId);
|
||||
}
|
||||
|
||||
@ApiIgnore
|
||||
@PostMapping("/viewLog")
|
||||
public void viewLog(@RequestBody PanelViewLogRequest request) {
|
||||
panelGroupService.viewLog(request);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ import java.util.List;
|
||||
@Data
|
||||
public class PanelViewDetailsRequest {
|
||||
|
||||
private String viewId;
|
||||
|
||||
private String viewName;
|
||||
|
||||
private String[] header;
|
||||
|
@ -0,0 +1,12 @@
|
||||
package io.dataease.controller.request.panel;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class PanelViewLogRequest implements Serializable {
|
||||
private String panelId;
|
||||
|
||||
private Boolean mobile = false;
|
||||
}
|
@ -6,9 +6,9 @@ import io.dataease.commons.constants.*;
|
||||
import io.dataease.commons.utils.*;
|
||||
import io.dataease.controller.request.authModel.VAuthModelRequest;
|
||||
import io.dataease.controller.request.dataset.DataSetTableRequest;
|
||||
import io.dataease.controller.request.panel.PanelGroupBaseInfoRequest;
|
||||
import io.dataease.controller.request.panel.PanelGroupRequest;
|
||||
import io.dataease.controller.request.panel.PanelViewDetailsRequest;
|
||||
|
||||
import io.dataease.controller.request.panel.*;
|
||||
|
||||
import io.dataease.dto.PanelGroupExtendDataDTO;
|
||||
import io.dataease.dto.SysLogDTO;
|
||||
import io.dataease.dto.authModel.VAuthModelDTO;
|
||||
@ -620,6 +620,12 @@ public class PanelGroupService {
|
||||
} catch (Exception e) {
|
||||
DataEaseException.throwException(e);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(AuthUtils.getUser())) {
|
||||
String viewId = request.getViewId();
|
||||
ChartViewWithBLOBs chartViewWithBLOBs = chartViewService.get(viewId);
|
||||
String pid = chartViewWithBLOBs.getSceneId();
|
||||
DeLogUtils.save(SysLogConstants.OPERATE_TYPE.EXPORT, SysLogConstants.SOURCE_TYPE.VIEW, viewId,pid, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
public void updatePanelStatus(String panelId, PanelGroupBaseInfoRequest request) {
|
||||
@ -681,4 +687,15 @@ public class PanelGroupService {
|
||||
Object cache = CacheUtils.get(cacheName,cacheId);
|
||||
return cache!=null;
|
||||
}
|
||||
|
||||
public void viewLog(PanelViewLogRequest request) {
|
||||
String panelId = request.getPanelId();
|
||||
Boolean mobile = request.getMobile();
|
||||
PanelGroupWithBLOBs panel = panelGroupMapper.selectByPrimaryKey(panelId);
|
||||
SysLogConstants.OPERATE_TYPE operateType = SysLogConstants.OPERATE_TYPE.PC_VIEW;
|
||||
if (mobile) {
|
||||
operateType = SysLogConstants.OPERATE_TYPE.MB_VIEW;
|
||||
}
|
||||
DeLogUtils.save(operateType, sourceType, panelId, panel.getPid(), null, null);
|
||||
}
|
||||
}
|
||||
|
@ -179,9 +179,43 @@ public class LogService {
|
||||
userLogin.setName(Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||
results.add(userLogin);
|
||||
|
||||
List<FolderItem> folderItems = viewPanelTypes();
|
||||
results.addAll(folderItems);
|
||||
results.addAll(viewRelativeTypes());
|
||||
return results;
|
||||
}
|
||||
|
||||
private List<FolderItem> viewRelativeTypes() {
|
||||
Integer[] opTypes = new Integer[]{15};
|
||||
Integer[] sourceTypes = new Integer[]{4};
|
||||
return typesByArr(opTypes, sourceTypes);
|
||||
}
|
||||
|
||||
private List<FolderItem> typesByArr(Integer[] opTypes, Integer[] sourceTypes) {
|
||||
List<FolderItem> results = new ArrayList<>();
|
||||
for (int i = 0; i < sourceTypes.length; i++) {
|
||||
Integer sourceVal = sourceTypes[i];
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(sourceVal);
|
||||
|
||||
for (int j = 0; j < opTypes.length; j++) {
|
||||
|
||||
Integer operateVal = opTypes[j];
|
||||
|
||||
String operateTypeName = SysLogConstants.operateTypeName(operateVal);
|
||||
FolderItem folderItem = new FolderItem();
|
||||
folderItem.setId(operateVal + "-" + sourceVal);
|
||||
folderItem.setName(Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||
results.add(folderItem);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
private List<FolderItem> viewPanelTypes () {
|
||||
Integer[] opTypes = new Integer[]{13, 14};
|
||||
Integer[] sourceTypes = new Integer[]{3};
|
||||
return typesByArr(opTypes, sourceTypes);
|
||||
}
|
||||
|
||||
public SysLogGridDTO convertDTO(SysLogWithBLOBs vo) {
|
||||
SysLogGridDTO sysLogGridDTO = new SysLogGridDTO();
|
||||
sysLogGridDTO.setOpType(SysLogConstants.operateTypeName(vo.getOperateType()));
|
||||
|
@ -143,6 +143,9 @@ OPERATE_TYPE_DELETELINK=Delete Link
|
||||
OPERATE_TYPE_MODIFYLINK=Modify Link
|
||||
OPERATE_TYPE_UPLOADFILE=Upload
|
||||
OPERATE_TYPE_LOGIN=Login
|
||||
OPERATE_TYPE_PC_VIEW=View with pc
|
||||
OPERATE_TYPE_MB_VIEW=View with mobile device
|
||||
OPERATE_TYPE_EXPORT=Export
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=DATASOURCE
|
||||
SOURCE_TYPE_DATASET=DATASET
|
||||
|
@ -141,6 +141,9 @@ OPERATE_TYPE_DELETELINK=\u5220\u9664\u516C\u5171\u94FE\u63A5
|
||||
OPERATE_TYPE_MODIFYLINK=\u4FEE\u6539\u516C\u5171\u94FE\u63A5
|
||||
OPERATE_TYPE_UPLOADFILE=\u4E0A\u4F20
|
||||
OPERATE_TYPE_LOGIN=\u767B\u5F55
|
||||
OPERATE_TYPE_PC_VIEW=\u4F7F\u7528PC\u67E5\u770B
|
||||
OPERATE_TYPE_MB_VIEW=\u4F7F\u7528\u79FB\u52A8\u7AEF\u67E5\u770B
|
||||
OPERATE_TYPE_EXPORT=\u5BFC\u51FA
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=\u6570\u636E\u6E90
|
||||
SOURCE_TYPE_DATASET=\u6570\u636E\u96C6
|
||||
|
@ -142,6 +142,9 @@ OPERATE_TYPE_DELETELINK=\u522A\u9664\u516C\u5171\u93C8\u63A5
|
||||
OPERATE_TYPE_MODIFYLINK=\u4FEE\u6539\u516C\u5171\u93C8\u63A5
|
||||
OPERATE_TYPE_UPLOADFILE=\u4E0A\u50B3
|
||||
OPERATE_TYPE_LOGIN=\u767B\u9304
|
||||
OPERATE_TYPE_PC_VIEW=\u4F7F\u7528PC\u67E5\u770B
|
||||
OPERATE_TYPE_MB_VIEW=\u4F7F\u7528\u79FB\u52D5\u7AEF\u67E5\u770B
|
||||
OPERATE_TYPE_EXPORT=\u5C0E\u51FA
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=\u6578\u64DA\u6E90
|
||||
SOURCE_TYPE_DATASET=\u6578\u64DA\u96C6
|
||||
|
@ -90,6 +90,15 @@ export function findOne(id) {
|
||||
})
|
||||
}
|
||||
|
||||
export function viewPanelLog(data) {
|
||||
return request({
|
||||
url: 'panel/group/viewLog',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTable(id) {
|
||||
return request({
|
||||
url: '/panel/table/get/' + id,
|
||||
@ -224,6 +233,16 @@ export function exportDetails(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function innerExportDetails(data) {
|
||||
return request({
|
||||
url: 'panel/group/innerExportDetails',
|
||||
method: 'post',
|
||||
data: data,
|
||||
loading: true,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePanelStatus(panelId, param) {
|
||||
return request({
|
||||
url: '/panel/group/updatePanelStatus/' + panelId,
|
||||
|
@ -10,7 +10,7 @@
|
||||
:chart="mapChart || chart"
|
||||
class="chart-class"
|
||||
/>
|
||||
<chart-component :theme-style="element.commonBackground" v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" class="chart-class" :chart="mapChart || chart" />
|
||||
<chart-component v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'echarts'" :theme-style="element.commonBackground" class="chart-class" :chart="mapChart || chart" />
|
||||
<chart-component-g2 v-else-if="!chart.type.includes('text') && chart.type !== 'label' && !chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
|
||||
<chart-component-s2 v-else-if="chart.type.includes('table') && renderComponent() === 'antv'" class="chart-class" :chart="chart" />
|
||||
<label-normal v-else-if="chart.type.includes('text')" :chart="chart" class="table-class" />
|
||||
@ -38,10 +38,11 @@ import ChartComponentG2 from '@/views/chart/components/ChartComponentG2'
|
||||
import PluginCom from '@/views/system/plugin/PluginCom'
|
||||
import ChartComponentS2 from '@/views/chart/components/ChartComponentS2'
|
||||
import LabelNormalText from '@/views/chart/components/normal/LabelNormalText'
|
||||
import { exportDetails } from '@/api/panel/panel'
|
||||
import { exportDetails, innerExportDetails } from '@/api/panel/panel'
|
||||
import html2canvas from 'html2canvasde'
|
||||
import { hexColorToRGBA } from '@/views/chart/chart/util'
|
||||
import { deepCopy, exportImg } from '@/components/canvas/utils/utils'
|
||||
import { getLinkToken, getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'UserViewDialog',
|
||||
components: { LabelNormalText, ChartComponentS2, ChartComponentG2, DeMainContainer, DeContainer, DeAsideContainer, ChartComponent, TableNormal, LabelNormal, PluginCom },
|
||||
@ -187,6 +188,7 @@ export default {
|
||||
const excelData = JSON.parse(JSON.stringify(this.chart.data.tableRow)).map(item => excelHeaderKeys.map(i => item[i]))
|
||||
const excelName = this.chart.name
|
||||
const request = {
|
||||
viewId: this.chart.id,
|
||||
viewName: excelName,
|
||||
header: excelHeader,
|
||||
details: excelData,
|
||||
@ -195,7 +197,13 @@ export default {
|
||||
snapshotWidth: width,
|
||||
snapshotHeight: height
|
||||
}
|
||||
exportDetails(request).then((res) => {
|
||||
let method = innerExportDetails
|
||||
const token = this.$store.getters.token || getToken()
|
||||
const linkToken = this.$store.getters.linkToken || getLinkToken()
|
||||
if (!token && linkToken) {
|
||||
method = exportDetails
|
||||
}
|
||||
method(request).then((res) => {
|
||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
|
@ -71,7 +71,7 @@
|
||||
<script>
|
||||
import { loadTree, loadShareOutTree, removePanelShares } from '@/api/panel/share'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import { initPanelData } from '@/api/panel/panel'
|
||||
import { initPanelData, viewPanelLog } from '@/api/panel/panel'
|
||||
import { proxyInitPanelData } from '@/api/panel/shareProxy'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
@ -134,14 +134,18 @@ 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)
|
||||
viewPanelLog({ panelId: data.id }).then(res => {
|
||||
bus.$emit('set-panel-show-type', 1)
|
||||
bus.$emit('set-panel-share-user', data.userId)
|
||||
})
|
||||
})
|
||||
this.$refs['botTree'].setCurrentKey(null)
|
||||
},
|
||||
viewMyShare(data) {
|
||||
initPanelData(data.id, false, function() {
|
||||
bus.$emit('set-panel-show-type', 2)
|
||||
viewPanelLog({ panelId: data.id }).then(res => {
|
||||
bus.$emit('set-panel-show-type', 2)
|
||||
})
|
||||
})
|
||||
this.$refs['topTree'].setCurrentKey(null)
|
||||
},
|
||||
|
@ -31,7 +31,7 @@
|
||||
<script>
|
||||
import { deleteEnshrine, enshrineList } from '@/api/panel/enshrine'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import { initPanelData } from '@/api/panel/panel'
|
||||
import { initPanelData, viewPanelLog } from '@/api/panel/panel'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
export default {
|
||||
@ -56,7 +56,9 @@ export default {
|
||||
methods: {
|
||||
showPanel(row) {
|
||||
initPanelData(row.panelGroupId, false, function() {
|
||||
bus.$emit('set-panel-show-type', 0)
|
||||
viewPanelLog({ panelId: row.panelGroupId }).then(res => {
|
||||
bus.$emit('set-panel-show-type', 0)
|
||||
})
|
||||
})
|
||||
},
|
||||
resetID(data) {
|
||||
|
@ -228,7 +228,7 @@ import LinkGenerate from '@/views/link/generate'
|
||||
import { uuid } from 'vue-uuid'
|
||||
import bus from '@/utils/bus'
|
||||
import EditPanel from './EditPanel'
|
||||
import { addGroup, delGroup, groupTree, defaultTree, initPanelData, panelUpdate } from '@/api/panel/panel'
|
||||
import { addGroup, delGroup, groupTree, defaultTree, initPanelData, panelUpdate, viewPanelLog } from '@/api/panel/panel'
|
||||
import { mapState } from 'vuex'
|
||||
import {
|
||||
DEFAULT_COMMON_CANVAS_STYLE_STRING
|
||||
@ -675,8 +675,10 @@ export default {
|
||||
// 清理pc布局缓存
|
||||
this.$store.commit('setComponentDataCache', null)
|
||||
initPanelData(data.id, false, function(response) {
|
||||
bus.$emit('set-panel-show-type', 0)
|
||||
data.mobileLayout = response.data.mobileLayout
|
||||
viewPanelLog({ panelId: data.id }).then(res => {
|
||||
bus.$emit('set-panel-show-type', 0)
|
||||
data.mobileLayout = response.data.mobileLayout
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -70,4 +70,13 @@ export function starStatus(panelId) {
|
||||
})
|
||||
}
|
||||
|
||||
export function viewPanelLog(data) {
|
||||
return request({
|
||||
url: 'panel/group/viewLog',
|
||||
method: 'post',
|
||||
loading: true,
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
<script>
|
||||
import {addRecent, getToken} from '@/common/utils'
|
||||
import {linkInfo, switchLink, star, unstar, starStatus} from '@/api/panel'
|
||||
import {linkInfo, switchLink, star, unstar, starStatus, viewPanelLog} from '@/api/panel'
|
||||
const DETAIL_PAGE_PATH = '/pages/tabBar/home/detail'
|
||||
|
||||
// import htmlParser from '@/common/html-parser.js'
|
||||
@ -188,6 +188,10 @@
|
||||
uni.hideLoading()
|
||||
}
|
||||
}, 1000);
|
||||
const param = {panelId: this.banner.id, mobile: true}
|
||||
viewPanelLog(param).then(res => {
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
caclViewHeight() {
|
||||
|
Loading…
Reference in New Issue
Block a user