!2245 修复:切换配置保存后,刷新网页进来,没自动定位到刚才保存的配置

pull/2241/MERGE
黄诗津 1 year ago committed by ChenX
parent a0b79fd1af
commit 20164f4f61

@ -142,7 +142,7 @@ export class WindowTempSelect extends React.Component<IWindowTempSelectProps, {}
private handleClose = (modalState: ModalState) => private handleClose = (modalState: ModalState) =>
{ {
userConfigStore.SaveConfig(BoardModalType.DatalistStore, datalistStore, { toaster: false }); //保存配置 userConfigStore.SaveConfig(BoardModalType.DatalistStore, datalistStore, { toaster: false, isUploadUserConfigNames: false }); //保存配置
if (this.props.selectDiv) if (this.props.selectDiv)
{ {

@ -317,7 +317,7 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
} }
componentWillUnmount() componentWillUnmount()
{ {
userConfigStore.SaveConfig(BoardModalType.UserConfig, userConfig, { toaster: false }); userConfigStore.SaveConfig(BoardModalType.UserConfig, userConfig, { toaster: false, isUploadUserConfigNames: false });
for (let f of this.removeFuncs) for (let f of this.removeFuncs)
f(); f();
this.removeFuncs.length = 0; this.removeFuncs.length = 0;

@ -146,7 +146,7 @@ export class DataList extends React.Component<IDataListProps> {
private SaveConfig = () => private SaveConfig = () =>
{ {
userConfigStore.SaveConfig(BoardModalType.DatalistStore, datalistStore, { toaster: false }); //保存配置 userConfigStore.SaveConfig(BoardModalType.DatalistStore, datalistStore, { toaster: false, isUploadUserConfigNames: false }); //保存配置
}; };
renderBigData = () => renderBigData = () =>
{ {

@ -348,7 +348,7 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
onChange={(e) => onChange={(e) =>
{ {
commonPanelStore.m_Option.orderType = e.target.value as EOrderType; commonPanelStore.m_Option.orderType = e.target.value as EOrderType;
userConfigStore.SaveConfig(BoardModalType.CommonPanelStore, commonPanelStore, { toaster: false }); //保存配置 userConfigStore.SaveConfig(BoardModalType.CommonPanelStore, commonPanelStore, { toaster: false, isUploadUserConfigNames: false, }); //保存配置
this.handleGetData(); this.handleGetData();
}} }}
/> />
@ -457,7 +457,7 @@ export class CommonPanel extends React.Component<ICommonPanelProps, ICommonPanel
onChange={(e) => onChange={(e) =>
{ {
commonPanelStore.m_Option.orderType = e.target.value as EOrderType; commonPanelStore.m_Option.orderType = e.target.value as EOrderType;
userConfigStore.SaveConfig(BoardModalType.CommonPanelStore, commonPanelStore, { toaster: false }); //保存配置 userConfigStore.SaveConfig(BoardModalType.CommonPanelStore, commonPanelStore, { toaster: false, isUploadUserConfigNames: false, }); //保存配置
this.handleGetData(); this.handleGetData();
}} }}
/> />

@ -50,6 +50,7 @@ interface ISaveOption
isInit?: boolean; isInit?: boolean;
isCheckName?: boolean; isCheckName?: boolean;
toaster?: boolean; toaster?: boolean;
isUploadUserConfigNames?: boolean;
} }
export enum EZengZhiBaoId export enum EZengZhiBaoId
{ {
@ -319,7 +320,7 @@ export class UserConfigStore extends Singleton
} }
async SaveConfig(type: BoardModalType, store: IConfigStore, option: ISaveOption = {}, tagName?: string) async SaveConfig(type: BoardModalType, store: IConfigStore, option: ISaveOption = {}, tagName?: string)
{ {
const { isInit = false, isCheckName = false, toaster = true } = option; const { isInit = false, isCheckName = false, toaster = true, isUploadUserConfigNames = true } = option;
const configName = store.configName; const configName = store.configName;
if (configName === "") if (configName === "")
{ {
@ -390,9 +391,9 @@ export class UserConfigStore extends Singleton
intent: Intent.SUCCESS, intent: Intent.SUCCESS,
}); });
this.UpdateUserConfig(type, newConfig); this.UpdateUserConfig(type, newConfig);
if (userConfig.userConfigName[type] != configName) userConfig.userConfigName[type] = configName;
if (isUploadUserConfigNames)
{ {
userConfig.userConfigName[type] = configName;
await this.UploadUserConfigNames(dbStore); await this.UploadUserConfigNames(dbStore);
} }
} }

Loading…
Cancel
Save