Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c98b18

Browse files
author
minjk-bl
committed
Reshape fix
1 parentf95bd5a commit3c98b18

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

‎src/common/component/vpMultiSelector.js‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ define([
5858
// configuration
5959
this.config=config;
6060

61-
var{ mode, type, parent, selectedList=[], includeList=[]}=config;
61+
var{ mode, type, parent, selectedList=[], includeList=[], excludeList=[]}=config;
6262
this.mode=mode;
6363
this.parent=parent;
6464
this.selectedList=selectedList;
6565
this.includeList=includeList;
66+
this.excludeList=excludeList;
6667

6768
this.dataList=[];
6869
this.pointer={start:-1,end:-1};
@@ -84,12 +85,13 @@ define([
8485
}
8586

8687
_executeCallback(dataList){
87-
this.dataList=dataList;
8888
if(this.includeList&&this.includeList.length>0){
89-
this.dataList=dataList.filter(data=>this.includeList.includes(data.code));
90-
}else{
91-
this.dataList=dataList;
89+
dataList=dataList.filter(data=>this.includeList.includes(data.code));
9290
}
91+
if(this.excludeList&&this.excludeList.length>0){
92+
dataList=dataList.filter(data=>!this.excludeList.includes(data.code));
93+
}
94+
this.dataList=dataList;
9395

9496
// load
9597
this.load();

‎src/common/vpReshape.js‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -354,29 +354,29 @@ define([
354354
/**
355355
* Render column selector using ColumnSelector module
356356
*@param {Array<string>} previousList previous selected columns
357-
*@param {Array<string>}includeList columns toinclude
357+
*@param {Array<string>}excludeList columns toexclude
358358
*/
359-
renderColumnSelector(targetVariable,previousList,includeList){
359+
renderColumnSelector(targetVariable,previousList,excludeList){
360360
this.popup.ColSelector=newvpMultiSelector(
361361
this._wrapSelector('.'+APP_POPUP_BODY),
362-
{mode:'columns',parent:targetVariable,selectedList:previousList,includeList:includeList}
362+
{mode:'columns',parent:targetVariable,selectedList:previousList,excludeList:excludeList}
363363
);
364364
}
365365

366366
/**
367367
* Open Inner popup page for column selection
368368
*@param {Object} targetSelector
369369
*@param {string} title
370-
*@param {Array<string>}includeList
370+
*@param {Array<string>}excludeList
371371
*/
372-
openInnerPopup(targetVariable,targetSelector,title='Select columns',includeList=[]){
372+
openInnerPopup(targetVariable,targetSelector,title='Select columns',excludeList=[]){
373373
this.popup.targetVariable=targetVariable;
374374
this.popup.targetSelector=targetSelector;
375375
varpreviousList=this.popup.targetSelector.data('list');
376376
if(previousList){
377377
previousList=previousList.map(col=>col.code)
378378
}
379-
this.renderColumnSelector(targetVariable,previousList,includeList);
379+
this.renderColumnSelector(targetVariable,previousList,excludeList);
380380

381381
// set title
382382
$(this._wrapSelector('.'+APP_POPUP_BOX+' .'+APP_TITLE)).text(title);
@@ -508,7 +508,8 @@ define([
508508
// index select button event
509509
$(document).on('click',this._wrapSelector('#vp_rsIndexSelect'),function(){
510510
vartargetVariable=[that.state.variable];
511-
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsIndex')),'Select columns');
511+
varexcludeList=[ ...that.state.pivot.columns, ...that.state.pivot.values].map(obj=>obj.code);
512+
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsIndex')),'Select columns',excludeList);
512513
});
513514

514515
// columns change event
@@ -520,7 +521,8 @@ define([
520521
// columns select button event
521522
$(document).on('click',this._wrapSelector('#vp_rsColumnsSelect'),function(){
522523
vartargetVariable=[that.state.variable];
523-
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsColumns')),'Select columns');
524+
varexcludeList=[ ...that.state.pivot.index, ...that.state.pivot.values].map(obj=>obj.code);
525+
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsColumns')),'Select columns',excludeList);
524526
});
525527

526528
// values change event
@@ -532,7 +534,8 @@ define([
532534
// values select button event
533535
$(document).on('click',this._wrapSelector('#vp_rsValuesSelect'),function(){
534536
vartargetVariable=[that.state.variable];
535-
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsValues')),'Select columns');
537+
varexcludeList=[ ...that.state.pivot.index, ...that.state.pivot.columns].map(obj=>obj.code);
538+
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsValues')),'Select columns',excludeList);
536539
});
537540

538541
// id vars change event
@@ -544,7 +547,8 @@ define([
544547
// id vars select button event
545548
$(document).on('click',this._wrapSelector('#vp_rsIdVarsSelect'),function(){
546549
vartargetVariable=[that.state.variable];
547-
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsIdVars')),'Select columns');
550+
varexcludeList=that.state.melt.valueVars.map(obj=>obj.code);
551+
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsIdVars')),'Select columns',excludeList);
548552
});
549553

550554
// value vars change event
@@ -556,7 +560,8 @@ define([
556560
// value vars select button event
557561
$(document).on('click',this._wrapSelector('#vp_rsValueVarsSelect'),function(){
558562
vartargetVariable=[that.state.variable];
559-
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsValueVars')),'Select columns');
563+
varexcludeList=that.state.melt.idVars.map(obj=>obj.code);
564+
that.openInnerPopup(targetVariable,$(that._wrapSelector('#vp_rsValueVars')),'Select columns',excludeList);
560565
});
561566

562567
// allocateTo event

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp