Merge branch 'dev' into pr@dev@feat_view_panel_log_pc

This commit is contained in:
fit2cloud-chenyw 2022-08-18 12:22:10 +08:00 committed by GitHub
commit ab34f64b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 11 deletions

View File

@ -16,6 +16,8 @@ public class PanelViewDetailsRequest {
private String[] header;
private Integer[] excelTypes;
private List<String[]> details;
private String snapshot;
@ -25,4 +27,5 @@ public class PanelViewDetailsRequest {
private int snapshotHeight;
}

View File

@ -6,7 +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.*;
import io.dataease.dto.PanelGroupExtendDataDTO;
import io.dataease.dto.SysLogDTO;
import io.dataease.dto.authModel.VAuthModelDTO;
@ -21,6 +23,7 @@ import io.dataease.i18n.Translator;
import io.dataease.listener.util.CacheUtils;
import io.dataease.plugins.common.base.domain.*;
import io.dataease.plugins.common.base.mapper.*;
import io.dataease.plugins.common.constants.DeTypeConstants;
import io.dataease.service.chart.ChartViewService;
import io.dataease.service.dataset.DataSetTableService;
import io.dataease.service.staticResource.StaticResourceService;
@ -546,6 +549,7 @@ public class PanelGroupService {
try {
String snapshot = request.getSnapshot();
List<String[]> details = request.getDetails();
Integer[] excelTypes = request.getExcelTypes();
details.add(0, request.getHeader());
HSSFWorkbook wb = new HSSFWorkbook();
//明细sheet
@ -572,11 +576,22 @@ public class PanelGroupService {
if (rowData != null) {
for (int j = 0; j < rowData.length; j++) {
HSSFCell cell = row.createCell(j);
cell.setCellValue(rowData[j]);
if (i == 0) {// 头部
cell.setCellValue(rowData[j]);
cell.setCellStyle(cellStyle);
//设置列的宽度
detailsSheet.setColumnWidth(j, 255 * 20);
}else{
// with DataType
if((excelTypes[j]== DeTypeConstants.DE_INT || excelTypes[j]== DeTypeConstants.DE_FLOAT)&& StringUtils.isNotEmpty(rowData[j])){
try{
cell.setCellValue(Double.valueOf(rowData[j]));
}catch (Exception e){
LogUtil.warn("export excel data transform error");
}
}else{
cell.setCellValue(rowData[j]);
}
}
}
}

View File

@ -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,

View File

@ -182,6 +182,7 @@ export default {
},
exportExcelDownload(snapshot, width, height) {
const excelHeader = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.name)
const excelTypes = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.deType)
const excelHeaderKeys = JSON.parse(JSON.stringify(this.chart.data.fields)).map(item => item.dataeaseName)
const excelData = JSON.parse(JSON.stringify(this.chart.data.tableRow)).map(item => excelHeaderKeys.map(i => item[i]))
const excelName = this.chart.name
@ -189,6 +190,7 @@ export default {
viewName: excelName,
header: excelHeader,
details: excelData,
excelTypes: excelTypes,
snapshot: snapshot,
snapshotWidth: width,
snapshotHeight: height

View File

@ -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)
},

View File

@ -261,7 +261,8 @@ export default {
this.$confirm(this.$t('panel.theme_change_tips'), this.$t('panel.theme_change_warn'), {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
type: 'warning',
showClose: false
}).then(() => {
this.$store.commit('setCanvasStyle', JSON.parse(this.subjectItem.details))
this.$store.commit('recordSnapshot', 'subjectChange')

View File

@ -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) {

View File

@ -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
})
})
}
},