|
@@ -32,7 +32,7 @@ function customizeTreeSetting(setting, customDisplay) {
|
|
|
for (const cd of customDisplay) {
|
|
|
for (const c of setting.cols) {
|
|
|
if (cd.fields.indexOf(c.field) !== -1) {
|
|
|
- c.visible = c.defaultVisible === undefined ? cd.visible : c.defaultVisible && cd.visible;
|
|
|
+ c.defaultVisible = cd.visible;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -80,7 +80,7 @@ $(document).ready(() => {
|
|
|
{title: '预估决算|数量1/数量2', colSpan: '3|1', rowSpan: '1|1', field: 'final_dgn_qty', hAlign: 2, width: 80, bc_type: 'number', visible: false},
|
|
|
{title: '|经济指标', colSpan: '|1', rowSpan: '|1', field: 'final_dgn_price', hAlign: 2, width: 80, type: 'Number', bc_type: 'number', visible: false},
|
|
|
{title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'final_tp', hAlign: 2, width: 80, type: 'Number', bc_type: 'number', visible: false},
|
|
|
- {title: '数据对比', colSpan: '1', rowSpan: '2', field: 'stackedBar', hAlign: 0, width: 300, cellType: 'stackedBar', stackedBarCover: false, bc_type: 'grid', visible: false, getTip: getStackedBarTip},
|
|
|
+ {title: '数据对比', colSpan: '1', rowSpan: '2', field: 'stackedBar', hAlign: 0, width: 300, cellType: 'stackedBar', stackedBarCover: false, bc_type: 'grid', defaultVisible: true, visible: false, getTip: getStackedBarTip},
|
|
|
{title: '增幅%|数量1/数量2', colSpan: '2|1', rowSpan: '1|1', field: 'compare_dgn_qty', hAlign: 2, width: 80},
|
|
|
{title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'compare_tp', hAlign: 2, width: 80, type: 'Number'},
|
|
|
],
|
|
@@ -133,11 +133,7 @@ $(document).ready(() => {
|
|
|
}
|
|
|
},
|
|
|
initShowType() {
|
|
|
- const type = this.compareType;
|
|
|
- spreadSetting.cols.forEach(x => {
|
|
|
- if (!x.bc_type) return;
|
|
|
- x.visible = x.bc_type === type;
|
|
|
- });
|
|
|
+ this.reCalcColVisible();
|
|
|
const colIndex = spreadSetting.cols.findIndex(x => { return x.field === 'stackedBar'});
|
|
|
spreadSetting.cols[colIndex].stackedBarCover = parseInt(this.stackedBarCover);
|
|
|
},
|
|
@@ -318,6 +314,13 @@ $(document).ready(() => {
|
|
|
const colIndex = spreadSetting.cols.findIndex(x => { return x.field === 'stackedBar'});
|
|
|
SpreadJsObj.reloadColData(compareSheet, colIndex);
|
|
|
},
|
|
|
+ reCalcColVisible() {
|
|
|
+ const type = this.compareType;
|
|
|
+ spreadSetting.cols.forEach(x => {
|
|
|
+ if (!x.bc_type) return;
|
|
|
+ x.visible = x.bc_type === type && x.defaultVisible;
|
|
|
+ });
|
|
|
+ },
|
|
|
setCompareType(type) {
|
|
|
this.compareType = type || 'number';
|
|
|
$('[name=showType]').removeClass('active');
|
|
@@ -329,10 +332,7 @@ $(document).ready(() => {
|
|
|
$('.ml-grid').hide();
|
|
|
$('.ml-number').show();
|
|
|
}
|
|
|
- spreadSetting.cols.forEach(x => {
|
|
|
- if (!x.bc_type) return;
|
|
|
- x.visible = x.bc_type === type;
|
|
|
- });
|
|
|
+ this.reCalcColVisible();
|
|
|
setLocalCache(compareTypeKey, this.compareType);
|
|
|
},
|
|
|
setStackedBarCover(cover){
|
|
@@ -343,9 +343,9 @@ $(document).ready(() => {
|
|
|
setLocalCache(stackedBarCoverKey, this.stackedBarCover);
|
|
|
}
|
|
|
};
|
|
|
+ customizeTreeSetting(spreadSetting, customColDisplay());
|
|
|
compareObj.loadCacheData();
|
|
|
compareObj.initCompare();
|
|
|
- customizeTreeSetting(spreadSetting, customColDisplay());
|
|
|
SpreadJsObj.initSheet(compareSheet, spreadSetting);
|
|
|
|
|
|
function compareCode(str1, str2, symbol = '-') {
|
|
@@ -564,6 +564,7 @@ $(document).ready(() => {
|
|
|
cd.visible = check;
|
|
|
}
|
|
|
customizeTreeSetting(spreadSetting, customDisplay);
|
|
|
+ compareObj.loadCacheData();
|
|
|
SpreadJsObj.refreshColumnVisible(compareSheet);
|
|
|
Cookies.set(ckColSetting, JSON.stringify(customDisplay), 30*24*60*60*1000);
|
|
|
$('#row-view').modal('hide');
|