|
|
@ -4,7 +4,7 @@ import { getdatabyselection, getcellvalue } from '../../global/getdata'; |
|
|
|
import chartInfo from '../../store' |
|
|
|
import formula from '../../global/formula'; |
|
|
|
import { luckysheet_getcelldata } from '../../function/func'; |
|
|
|
import { getSheetIndex, getRangetxt , getvisibledatacolumn , getvisibledatarow } from '../../methods/get' |
|
|
|
import { getSheetIndex, getRangetxt, getvisibledatacolumn, getvisibledatarow } from '../../methods/get' |
|
|
|
import { rowLocation, colLocation, mouseposition } from '../../global/location' |
|
|
|
import { setluckysheet_scroll_status } from '../../methods/set' |
|
|
|
import { |
|
|
@ -36,7 +36,7 @@ const dependLinks = [ |
|
|
|
] |
|
|
|
|
|
|
|
// Initialize the chart component
|
|
|
|
function chart(data , isDemo) { |
|
|
|
function chart(data, isDemo) { |
|
|
|
loadLinks(dependLinks); |
|
|
|
|
|
|
|
seriesLoadScripts(dependScripts, null, function () { |
|
|
@ -44,19 +44,32 @@ function chart(data , isDemo) { |
|
|
|
console.info('chartmix::', chartmix.default) |
|
|
|
|
|
|
|
Vue.use(chartmix.default, { store }) |
|
|
|
let outDom = document.getElementById('luckysheet_info_detail') |
|
|
|
let outDom = document.getElementsByTagName('body')[0] |
|
|
|
chartmix.default.initChart(outDom, chartInfo.lang) |
|
|
|
|
|
|
|
$('.chartSetting').css({ |
|
|
|
top: '1px', |
|
|
|
bottom: '1px', |
|
|
|
position: 'absolute', |
|
|
|
right: 0, |
|
|
|
width: '300px', |
|
|
|
display: 'none', |
|
|
|
right: '0px', |
|
|
|
width: '350px', |
|
|
|
background: '#fff', |
|
|
|
paddingLeft: '10px', |
|
|
|
border: '1px solid #ccc', |
|
|
|
height: 'auto', |
|
|
|
zIndex: 99999999 |
|
|
|
|
|
|
|
border: '1px solid #E5E5E5', |
|
|
|
'z-index': 1004, |
|
|
|
'box-shadow': '0px 2px 4px rgba(0,0,0,0.2)', |
|
|
|
'-webkit-box-shadow': '0px 2px 4px rgba(0,0,0,0.2)', |
|
|
|
'-moz-box-shadow': '0px 2px 4px rgba(0,0,0,0.2)', |
|
|
|
'-moz-user-select': 'none', |
|
|
|
'-khtml-user-select': 'none', |
|
|
|
'-webkit-user-select': 'none', |
|
|
|
'-ms-user-select': 'none', |
|
|
|
'user-select': 'none', |
|
|
|
'padding-left': '30px', |
|
|
|
display: 'none' |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
chartInfo.createChart = chartmix.default.createChart |
|
|
|
chartInfo.highlightChart = chartmix.default.highlightChart |
|
|
|
chartInfo.deleteChart = chartmix.default.deleteChart |
|
|
@ -69,21 +82,28 @@ function chart(data , isDemo) { |
|
|
|
chartInfo.chartparam.changeChartCellData = chartmix.default.changeChartCellData |
|
|
|
chartInfo.chartparam.renderChart = chartmix.default.renderChart |
|
|
|
chartInfo.chartparam.getChartJson = chartmix.default.getChartJson |
|
|
|
chartInfo.chartparam.insertToStore = chartmix.default.insertToStore |
|
|
|
|
|
|
|
// 初始化渲染图表
|
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
|
if (data[i].status == '1') { |
|
|
|
renderCharts(data[i].chart , isDemo) |
|
|
|
renderCharts(data[i].chart, isDemo) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// rendercharts
|
|
|
|
function renderCharts(chartLists , isDemo) { |
|
|
|
function renderCharts(chartLists, isDemo) { |
|
|
|
for (let i = 0; i < chartLists.length; i++) { |
|
|
|
let chart = chartLists[i] |
|
|
|
let chart_id_c = chart.chart_id + '_c' |
|
|
|
|
|
|
|
if (isDemo) { |
|
|
|
chartInfo.chartparam.insertToStore({ chart_id: chart.chart_id, chartOptions: chart.chartOptions }) |
|
|
|
} |
|
|
|
|
|
|
|
let chart_id = chart.chart_id |
|
|
|
let chart_id_c = chart_id + '_c' |
|
|
|
let modelChartShowHTML = |
|
|
|
'<div id="${id}"class="luckysheet-modal-dialog luckysheet-modal-dialog-chart ${addclass}"tabindex="0"role="dialog"aria-labelledby=":41e"dir="ltr"><div class="luckysheet-modal-dialog-resize"><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lt"data-type="lt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mt"data-type="mt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lm"data-type="lm"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rm"data-type="rm"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rt"data-type="rt"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-lb"data-type="lb"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-mb"data-type="mb"></div><div class="luckysheet-modal-dialog-resize-item luckysheet-modal-dialog-resize-item-rb"data-type="rb"></div></div><div class="luckysheet-modal-dialog-controll"><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-update"role="button"tabindex="0"aria-label="修改图表"title="修改图表"><i class="fa fa-pencil"aria-hidden="true"></i></span><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-max"role="butluckysheet_chartIns_indexton"tabindex="0"aria-label="最大化"title="最大化"><i class="fa fa-window-maximize"aria-hidden="true"></i></span><span class="luckysheet-modal-controll-btn luckysheet-modal-controll-del"role="button"tabindex="0"aria-label="删除"title="删除"><i class="fa fa-trash"aria-hidden="true"></i></span></div><div class="luckysheet-modal-dialog-content">${content}</div></div>' |
|
|
|
|
|
|
@ -96,17 +116,136 @@ function renderCharts(chartLists , isDemo) { |
|
|
|
}) |
|
|
|
).appendTo($('.luckysheet-cell-main')) |
|
|
|
|
|
|
|
$(`#${chart_id_c}`).children('.luckysheet-modal-dialog-content')[0].id = chart.chart_id |
|
|
|
$(`#${chart_id_c}`).children('.luckysheet-modal-dialog-content')[0].id = chart_id |
|
|
|
|
|
|
|
let container = document.getElementById(chart_id_c) |
|
|
|
|
|
|
|
|
|
|
|
let chart_json |
|
|
|
if(isDemo){ |
|
|
|
chart_json = chart.chartOptions |
|
|
|
}else{ |
|
|
|
chart_json = chartInfo.chartparam.getChartJson(chart.chart_id) |
|
|
|
} |
|
|
|
chartInfo.chartparam.renderChart({chart_id: chart.chart_id , chartOptions: chart_json}) |
|
|
|
chart_json = chartInfo.chartparam.getChartJson(chart.chart_id) |
|
|
|
|
|
|
|
chartInfo.chartparam.renderChart({ chart_id: chart.chart_id, chartOptions: chart_json }) |
|
|
|
chartInfo.currentChart = chart_json |
|
|
|
|
|
|
|
//处理区域高亮框参数,当前页中,只有当前的图表的needRangShow为true,其他为false
|
|
|
|
showNeedRangeShow(chart_id); |
|
|
|
|
|
|
|
// delete current chart
|
|
|
|
$(`#${chart_id}_c .luckysheet-modal-controll-del`).click(function (e) { |
|
|
|
delChart(chart_id) |
|
|
|
}) |
|
|
|
|
|
|
|
// edit current chart
|
|
|
|
$(`#${chart_id}_c .luckysheet-modal-controll-update`).click(function (e) { |
|
|
|
showChartSettingComponent(chart_id) |
|
|
|
}) |
|
|
|
|
|
|
|
$t.children('.luckysheet-modal-dialog-content').mousedown(function (e) { |
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
|
//当前图表显示区域高亮
|
|
|
|
showNeedRangeShow(chart_id); |
|
|
|
} |
|
|
|
e.stopPropagation() |
|
|
|
}) |
|
|
|
$t.mousedown(function (e) { // move chart
|
|
|
|
|
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
|
//当前图表显示区域高亮
|
|
|
|
showNeedRangeShow(chart_id); |
|
|
|
setluckysheet_scroll_status(true); |
|
|
|
|
|
|
|
//允许拖动渲染框
|
|
|
|
if ( |
|
|
|
!$(e.target).is(".luckysheet-modal-dialog-controll") && |
|
|
|
!$(e.target).is(".luckysheet-modal-controll-btn") && |
|
|
|
!$(e.target).is("i") |
|
|
|
) { |
|
|
|
// Debounce
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveTimeout = setTimeout( |
|
|
|
function () { |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMove = true; |
|
|
|
}, |
|
|
|
100 |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
var toffset = chartInfo.chartparam.luckysheetCurrentChartMoveObj.offset(); |
|
|
|
var tpsition = chartInfo.chartparam.luckysheetCurrentChartMoveObj.position(); |
|
|
|
//luckysheetCurrentChartMoveXy: [鼠标点相对chart框的距离X方向,鼠标点相对chart框的距离Y方向,chart框相对cell-main的距离X方向,chart框相对cell-main的距离Y方向,水平滚动条的位置,垂直滚动条的位置]
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveXy = [ |
|
|
|
e.pageX - toffset.left, |
|
|
|
e.pageY - toffset.top, |
|
|
|
tpsition.left, |
|
|
|
tpsition.top, |
|
|
|
$("#luckysheet-scrollbar-x").scrollLeft(), |
|
|
|
$("#luckysheet-scrollbar-y").scrollTop() |
|
|
|
]; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveWinH = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollHeight; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveWinW = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollWidth; |
|
|
|
|
|
|
|
if ( |
|
|
|
!$(e.target).hasClass("luckysheet-mousedown-cancel") && |
|
|
|
$(e.target).filter("[class*='sp-palette']").length == 0 && |
|
|
|
$(e.target).filter("[class*='sp-thumb']").length == 0 && |
|
|
|
$(e.target).filter("[class*='sp-']").length == 0 |
|
|
|
) { |
|
|
|
$("#luckysheet-rightclick-menu").hide(); |
|
|
|
$("#luckysheet-cols-h-hover").hide(); |
|
|
|
$("#luckysheet-cols-menu-btn").hide(); |
|
|
|
$("#luckysheet-rightclick-menu").hide(); |
|
|
|
$( |
|
|
|
"#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu" |
|
|
|
).hide(); |
|
|
|
$( |
|
|
|
"body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu" |
|
|
|
).hide(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).find(".luckysheet-modal-dialog-resize-item") |
|
|
|
.mousedown(function (e) { |
|
|
|
if (chartInfo.chartparam.luckysheetCurrentChartActive) { |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartResize = $(this).data("type"); //开始状态resize
|
|
|
|
|
|
|
|
var mouse = mouseposition(e.pageX, e.pageY), |
|
|
|
scrollLeft = $("#luckysheet-scrollbar-x").scrollLeft(), |
|
|
|
scrollTop = $("#luckysheet-scrollbar-y").scrollTop(); |
|
|
|
var x = mouse[0] + scrollLeft; |
|
|
|
var y = mouse[1] + scrollTop; |
|
|
|
var position = chartInfo.chartparam.luckysheetCurrentChartResizeObj.position(); |
|
|
|
//参数:x,y:鼠标位置,$t.width(), $t.height(): chart框宽高, position.left + scrollLeft, position.top + scrollTop :chart框位置 ,scrollLeft, scrollTop:滚动条位置
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartResizeXy = [ |
|
|
|
x, |
|
|
|
y, |
|
|
|
$t.width(), |
|
|
|
$t.height(), |
|
|
|
position.left + scrollLeft, |
|
|
|
position.top + scrollTop, |
|
|
|
scrollLeft, |
|
|
|
scrollTop |
|
|
|
]; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartResizeWinH = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollHeight; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartResizeWinW = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollWidth; |
|
|
|
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChart = chart_id; |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let width = chart.width |
|
|
|
let height = chart.height |
|
|
@ -118,8 +257,6 @@ function renderCharts(chartLists , isDemo) { |
|
|
|
container.style.background = '#fff' |
|
|
|
container.style.left = left + 'px' |
|
|
|
container.style.top = top + 'px' |
|
|
|
// render.style.width = '100%'
|
|
|
|
// render.style.height = '100%'
|
|
|
|
container.style.zIndex = chartInfo.zIndex ? chartInfo.zIndex : 15 |
|
|
|
chartInfo.zIndex++ |
|
|
|
} |
|
|
@ -1063,9 +1200,10 @@ function createLuckyChart(width, height, left, top) { |
|
|
|
delChart(chart_id) |
|
|
|
}) |
|
|
|
|
|
|
|
// chartInfo.chartparam.luckysheetCurrentChartMoveObj = $(`#${chart_id}_c `)
|
|
|
|
// chartInfo.chartparam.luckysheetCurrentChartResizeObj = $(`#${chart_id}_c `)
|
|
|
|
// chartInfo.chartparam.luckysheetCurrentChartActive = true
|
|
|
|
// edit current chart
|
|
|
|
$(`#${chart_id}_c .luckysheet-modal-controll-update`).click(function (e) { |
|
|
|
showChartSettingComponent(chart_id) |
|
|
|
}) |
|
|
|
|
|
|
|
$t.children('.luckysheet-modal-dialog-content').mousedown(function (e) { |
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
@ -1074,82 +1212,70 @@ function createLuckyChart(width, height, left, top) { |
|
|
|
} |
|
|
|
e.stopPropagation() |
|
|
|
}) |
|
|
|
$t.dblclick(function (e) { |
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
|
$(this) |
|
|
|
.find('.jfgrid-modal-controll-update') |
|
|
|
.click() |
|
|
|
} else { |
|
|
|
// TODO:全屏关闭
|
|
|
|
// closebtn.click()
|
|
|
|
} |
|
|
|
e.stopPropagation() |
|
|
|
}) |
|
|
|
// move chart
|
|
|
|
.mousedown(function (e) { |
|
|
|
|
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
|
//当前图表显示区域高亮
|
|
|
|
showNeedRangeShow(chart_id); |
|
|
|
setluckysheet_scroll_status(true); |
|
|
|
$t.mousedown(function (e) { //move chart
|
|
|
|
|
|
|
|
//允许拖动渲染框
|
|
|
|
if ( |
|
|
|
!$(e.target).is(".luckysheet-modal-dialog-controll") && |
|
|
|
!$(e.target).is(".luckysheet-modal-controll-btn") && |
|
|
|
!$(e.target).is("i") |
|
|
|
) { |
|
|
|
// Debounce
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveTimeout = setTimeout( |
|
|
|
function () { |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMove = true; |
|
|
|
}, |
|
|
|
100 |
|
|
|
); |
|
|
|
} |
|
|
|
if (!chartInfo.chartparam.luckysheetCurrentChartMaxState) { |
|
|
|
//当前图表显示区域高亮
|
|
|
|
showNeedRangeShow(chart_id); |
|
|
|
setluckysheet_scroll_status(true); |
|
|
|
|
|
|
|
//允许拖动渲染框
|
|
|
|
if ( |
|
|
|
!$(e.target).is(".luckysheet-modal-dialog-controll") && |
|
|
|
!$(e.target).is(".luckysheet-modal-controll-btn") && |
|
|
|
!$(e.target).is("i") |
|
|
|
) { |
|
|
|
// Debounce
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveTimeout = setTimeout( |
|
|
|
function () { |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMove = true; |
|
|
|
}, |
|
|
|
100 |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
var toffset = chartInfo.chartparam.luckysheetCurrentChartMoveObj.offset(); |
|
|
|
var tpsition = chartInfo.chartparam.luckysheetCurrentChartMoveObj.position(); |
|
|
|
//luckysheetCurrentChartMoveXy: [鼠标点相对chart框的距离X方向,鼠标点相对chart框的距离Y方向,chart框相对cell-main的距离X方向,chart框相对cell-main的距离Y方向,水平滚动条的位置,垂直滚动条的位置]
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveXy = [ |
|
|
|
e.pageX - toffset.left, |
|
|
|
e.pageY - toffset.top, |
|
|
|
tpsition.left, |
|
|
|
tpsition.top, |
|
|
|
$("#luckysheet-scrollbar-x").scrollLeft(), |
|
|
|
$("#luckysheet-scrollbar-y").scrollTop() |
|
|
|
]; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveWinH = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollHeight; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveWinW = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollWidth; |
|
|
|
var toffset = chartInfo.chartparam.luckysheetCurrentChartMoveObj.offset(); |
|
|
|
var tpsition = chartInfo.chartparam.luckysheetCurrentChartMoveObj.position(); |
|
|
|
//luckysheetCurrentChartMoveXy: [鼠标点相对chart框的距离X方向,鼠标点相对chart框的距离Y方向,chart框相对cell-main的距离X方向,chart框相对cell-main的距离Y方向,水平滚动条的位置,垂直滚动条的位置]
|
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveXy = [ |
|
|
|
e.pageX - toffset.left, |
|
|
|
e.pageY - toffset.top, |
|
|
|
tpsition.left, |
|
|
|
tpsition.top, |
|
|
|
$("#luckysheet-scrollbar-x").scrollLeft(), |
|
|
|
$("#luckysheet-scrollbar-y").scrollTop() |
|
|
|
]; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveWinH = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollHeight; |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartMoveWinW = $( |
|
|
|
"#luckysheet-cell-main" |
|
|
|
)[0].scrollWidth; |
|
|
|
|
|
|
|
if ( |
|
|
|
!$(e.target).hasClass("luckysheet-mousedown-cancel") && |
|
|
|
$(e.target).filter("[class*='sp-palette']").length == 0 && |
|
|
|
$(e.target).filter("[class*='sp-thumb']").length == 0 && |
|
|
|
$(e.target).filter("[class*='sp-']").length == 0 |
|
|
|
) { |
|
|
|
$("#luckysheet-rightclick-menu").hide(); |
|
|
|
$("#luckysheet-cols-h-hover").hide(); |
|
|
|
$("#luckysheet-cols-menu-btn").hide(); |
|
|
|
$("#luckysheet-rightclick-menu").hide(); |
|
|
|
$( |
|
|
|
"#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu" |
|
|
|
).hide(); |
|
|
|
$( |
|
|
|
"body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu" |
|
|
|
).hide(); |
|
|
|
|
|
|
|
if ( |
|
|
|
!$(e.target).hasClass("luckysheet-mousedown-cancel") && |
|
|
|
$(e.target).filter("[class*='sp-palette']").length == 0 && |
|
|
|
$(e.target).filter("[class*='sp-thumb']").length == 0 && |
|
|
|
$(e.target).filter("[class*='sp-']").length == 0 |
|
|
|
) { |
|
|
|
$("#luckysheet-rightclick-menu").hide(); |
|
|
|
$("#luckysheet-cols-h-hover").hide(); |
|
|
|
$("#luckysheet-cols-menu-btn").hide(); |
|
|
|
$("#luckysheet-rightclick-menu").hide(); |
|
|
|
$( |
|
|
|
"#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu, #luckysheet-user-menu" |
|
|
|
).hide(); |
|
|
|
$( |
|
|
|
"body > .luckysheet-filter-menu, body > .luckysheet-filter-submenu, body > .luckysheet-cols-menu" |
|
|
|
).hide(); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}).find(".luckysheet-modal-dialog-resize-item") |
|
|
|
}).find(".luckysheet-modal-dialog-resize-item") |
|
|
|
.mousedown(function (e) { |
|
|
|
if (chartInfo.chartparam.luckysheetCurrentChartActive) { |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartResize = $(this).data("type"); //开始状态resize
|
|
|
@ -1204,18 +1330,18 @@ 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) {
|
|
|
|
//当前sheet的图表先设置为false
|
|
|
|
chartLists[chartId].needRangeShow = false |
|
|
|
if (chartLists[chartId].chart_id == chart_id) { |
|
|
|
chartLists[chartId].needRangeShow = true; |
|
|
|
//当前sheet的图表先设置为false
|
|
|
|
chartLists[chartId].needRangeShow = false |
|
|
|
if (chartLists[chartId].chart_id == chart_id) { |
|
|
|
chartLists[chartId].needRangeShow = true; |
|
|
|
|
|
|
|
chartInfo.currentChart = chartInfo.getChartJson(chart_id) |
|
|
|
} |
|
|
|
chartInfo.currentChart = chartInfo.getChartJson(chart_id) |
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
@ -1273,7 +1399,7 @@ function selectRangeBorderShow(chart_id) { |
|
|
|
} |
|
|
|
|
|
|
|
// 切换到当前图表设置项
|
|
|
|
chartInfo.highlightChart(chart_id) |
|
|
|
chartInfo.currentChart = chartInfo.highlightChart(chart_id) |
|
|
|
} |
|
|
|
|
|
|
|
//选择区域高亮隐藏
|
|
|
@ -1302,19 +1428,14 @@ function showChartSettingComponent(refresh, chart_id) { |
|
|
|
|
|
|
|
// 切换图表后再打开设置界面时候执行更新DOM
|
|
|
|
if (!!chart_id) { |
|
|
|
chartInfo.highlightChart(chart_id) |
|
|
|
chartInfo.currentChart = chartInfo.highlightChart(chart_id) |
|
|
|
} |
|
|
|
|
|
|
|
$('#luckysheet-cell-main').find('.luckysheet-datavisual-selection-set div').show() |
|
|
|
chartInfo.chartparam.luckysheetCurrentChartActive = true |
|
|
|
if (!isEditMode() && !refresh) { |
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
luckysheetsizeauto() |
|
|
|
}, 0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
luckysheetsizeauto() |
|
|
|
}, 0) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1360,7 +1481,7 @@ function renderChartShow(index) { |
|
|
|
if (chart.needRangeShow == true) { |
|
|
|
//一个sheet页只有一个图表高亮显示,//重要!因为在store了做了存储,所以能在此处找到对应图表设置显示隐藏
|
|
|
|
//操作DOM当前图表选择区域高亮
|
|
|
|
chartInfo.currentChart = chartInfo.getChartJson(chart.chart_id) |
|
|
|
chartInfo.currentChart = chartInfo.getChartJson(chart.chart_id) |
|
|
|
selectRangeBorderShow(chart.chart_id) |
|
|
|
} |
|
|
|
|
|
|
|