|
|
@ -14,6 +14,7 @@ import { |
|
|
|
import { isEditMode } from '../../global/validate'; |
|
|
|
import luckysheetsizeauto from '../../controllers/resize'; |
|
|
|
import { getvisibledatarow, getvisibledatacolumn } from '../../methods/get' |
|
|
|
import { setluckysheet_scroll_status } from '../../methods/set'; |
|
|
|
let _rowLocation = rowLocation |
|
|
|
let _colLocation = colLocation |
|
|
|
|
|
|
@ -24,13 +25,13 @@ const dependScripts = [ |
|
|
|
'https://cdn.bootcdn.net/ajax/libs/element-ui/2.13.2/index.js', |
|
|
|
'https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', |
|
|
|
// 'expendPlugins/chart/chartmix.umd.js'
|
|
|
|
'http://192.168.10.246:8000/chartmix.umd.js' |
|
|
|
'http://26.26.26.1:8000/chartmix.umd.js' |
|
|
|
] |
|
|
|
|
|
|
|
const dependLinks = [ |
|
|
|
'https://cdn.bootcdn.net/ajax/libs/element-ui/2.13.2/theme-chalk/index.css', |
|
|
|
// 'expendPlugins/chart/chartmix.css'
|
|
|
|
'http://192.168.10.246:8000/chartmix.css' |
|
|
|
'http://26.26.26.1:8000/chartmix.css' |
|
|
|
] |
|
|
|
|
|
|
|
// Initialize the chart component
|
|
|
@ -936,6 +937,7 @@ function createLuckyChart(width, height, left, top) { |
|
|
|
|
|
|
|
// insert chartinfo
|
|
|
|
let sheetFile = chartInfo.luckysheetfile[getSheetIndex(chartInfo.currentSheetIndex)]; |
|
|
|
|
|
|
|
if(!sheetFile.chart){ |
|
|
|
sheetFile.chart = []; |
|
|
|
} |
|
|
@ -980,6 +982,12 @@ function createLuckyChart(width, height, left, top) { |
|
|
|
}) |
|
|
|
// move chart
|
|
|
|
.mousedown(function (e) { |
|
|
|
|
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
|
//当前图表显示区域高亮
|
|
|
|
showNeedRangeShow(chart_id); |
|
|
|
setluckysheet_scroll_status(true); |
|
|
|
|
|
|
|
//允许拖动渲染框
|
|
|
|
if ( |
|
|
|
!$(e.target).is(".luckysheet-modal-dialog-controll") && |
|
|
@ -1033,6 +1041,9 @@ function createLuckyChart(width, height, left, top) { |
|
|
|
} |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).find(".luckysheet-modal-dialog-resize-item") |
|
|
|
.mousedown(function (e) { |
|
|
|
if (chartInfo.chartparam.luckysheetCurrentChartActive) { |
|
|
@ -1090,13 +1101,13 @@ function delChart(chart_id) { |
|
|
|
function showNeedRangeShow(chart_id) { |
|
|
|
let chartLists = chartInfo.luckysheetfile[getSheetIndex(chartInfo.currentSheetIndex)].chart; |
|
|
|
for (let chartId in chartLists) { |
|
|
|
if (chartLists[chartId].sheetIndex == chartInfo.currentSheetIndex) { |
|
|
|
// if (chartLists[chartId].sheetIndex == chartInfo.currentSheetIndex) {
|
|
|
|
//当前sheet的图表先设置为false
|
|
|
|
chartLists[chartId].needRangeShow = false |
|
|
|
if (chartLists[chartId].chart_id == chart_id) { |
|
|
|
chartLists[chartId].needRangeShow = true |
|
|
|
} |
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -1107,10 +1118,10 @@ function showNeedRangeShow(chart_id) { |
|
|
|
function hideAllNeedRangeShow() { |
|
|
|
let chartLists = chartInfo.luckysheetfile[getSheetIndex(chartInfo.currentSheetIndex)].chart; |
|
|
|
for (let chartId in chartLists) { |
|
|
|
if (chartLists[chartId].sheetIndex == chartInfo.currentSheetIndex) { |
|
|
|
// if (chartLists[chartId].sheetIndex == chartInfo.currentSheetIndex) {
|
|
|
|
//当前sheet的图表设置为false
|
|
|
|
chartLists[chartId].needRangeShow = false |
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -1171,7 +1182,7 @@ function selectRangeBorderHide(settingShow) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 显示图表设置界面
|
|
|
|
function showChartSettingComponent(refresh, chart_id) { |
|
|
|
if (!$('.chartSetting').is(':visible')) { |
|
|
|
|
|
|
@ -1197,6 +1208,8 @@ function showChartSettingComponent(refresh, chart_id) { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 隐藏图表设置界面
|
|
|
|
function hideChartSettingComponent(refresh) { |
|
|
|
if ($('.chartSetting').is(':visible')) { |
|
|
|
|
|
|
@ -1219,5 +1232,43 @@ function hideChartSettingComponent(refresh) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 隐藏其他sheet的图表,显示当前sheet的图表 chartMix 切换sheet页显示隐藏图表
|
|
|
|
function renderChartShow(index) { |
|
|
|
//传入index,图表显示隐藏
|
|
|
|
selectRangeBorderHide('true') //隐藏数据高亮区域,随意传入一个字符串,表示不处理chartSetting界面
|
|
|
|
|
|
|
|
const luckysheetfile = chartInfo.luckysheetfile; |
|
|
|
luckysheetfile.forEach((file) => { |
|
|
|
//切换当前页的所有图表都显示出来
|
|
|
|
if(file.index == index){ |
|
|
|
|
|
|
|
const chartLists = file.chart || []; |
|
|
|
|
|
|
|
chartLists.forEach((chart)=>{ |
|
|
|
chart.isShow = true; |
|
|
|
$('#' + chart.chart_id + '_c').show(); |
|
|
|
|
|
|
|
if (chart.needRangeShow == true) { |
|
|
|
//一个sheet页只有一个图表高亮显示,//重要!因为在store了做了存储,所以能在此处找到对应图表设置显示隐藏
|
|
|
|
//操作DOM当前图表选择区域高亮
|
|
|
|
selectRangeBorderShow(chart.chart_id) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 隐藏其他页的图表
|
|
|
|
else{ |
|
|
|
const chartLists = file.chart || []; |
|
|
|
|
|
|
|
chartLists.forEach((chart)=>{ |
|
|
|
chart.isShow = false; |
|
|
|
$('#' + chart.chart_id + '_c').hide(); |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
export { chart, createLuckyChart } |
|
|
|
export { chart, createLuckyChart, hideAllNeedRangeShow,renderChartShow } |