!1579 开发:增强:对某些帐号关闭<共享模块>功能

pull/1582/MERGE
林三 3 years ago committed by ChenX
parent b20e144837
commit b9326d496f

@ -240,6 +240,7 @@ import { BuyMaterial } from './../Add-on/BuyMaterial';
import { Interfere } from './../Add-on/interfere';
import { ShowKinfeManageModal } from './../Add-on/showModal/ShowKnifeManageModal';
import { commandMachine } from './CommandMachine';
import { userConfig } from "./UserConfig";
export function registerCommand()
{
commandMachine.RegisterCommand(CommandNames.Puge, new Command_Purge());
@ -541,7 +542,6 @@ export function registerCommand()
//Template
commandMachine.RegisterCommand(CommandNames.Template, new ShowTemplate());
commandMachine.RegisterCommand(CommandNames.TemplateDesign, new ShowTemplateDesign());
commandMachine.RegisterCommand(CommandNames.TemplateSearch, new Command_TemplateSearch());
commandMachine.RegisterCommand("templateDelete", new Command_DeleteTemplate());
commandMachine.RegisterCommand(CommandNames.TemplateCheck, new Command_TemplateSearch(true));
commandMachine.RegisterCommand(CommandNames.SpliteTemplate, new Command_SplitTemplate());
@ -680,6 +680,12 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.ParseBoardName, new Command_ParseBoardName());
}
export async function LimitCommand()
{
if (userConfig.showShareModule)
commandMachine.RegisterCommand(CommandNames.TemplateSearch, new Command_TemplateSearch());
}
export async function RegistCustomCommand()
{
let commandList: ICommand[] = [];

@ -111,6 +111,7 @@ export class UserConfig implements IConfigStore
noNeedAngle: false,
textHight: 30,
};
showShareModule: boolean = false;
constructor()
{
this.Init();

@ -6,6 +6,7 @@ import { end } from 'xaop';
import { app } from '../../../ApplicationServices/Application';
import { KeyCode } from '../../../Common/KeyEnum';
import { CommandServer } from '../../../DatabaseServices/CommandServer';
import { userConfig } from '../../../Editor/UserConfig';
import { Sleep } from '../../../Nest/Common/Sleep';
import { CommandItem } from './CommandItem';
import { CommandList, ICommand } from './CommandList';
@ -237,6 +238,9 @@ export class CommandPanel extends React.Component<{}, CommandPanelState>
this.searchRes
.map((command) =>
{
if (command.command === "TEMPLATESEARCH")
if (!userConfig.showShareModule) return;
if (id !== command.typeId)
{
id = command.typeId;

@ -2,19 +2,19 @@ import { Button, InputGroup, Intent } from '@blueprintjs/core';
import { observable } from 'mobx';
import { inject, observer } from 'mobx-react';
import * as React from 'react';
import { ResourcesCDN_HOST, SignUrl, CURRENT_HOST } from '../../../Common/HostUrl';
import { app } from '../../../ApplicationServices/Application';
import { appCache } from '../../../Common/AppCache';
import { CURRENT_HOST, ResourcesCDN_HOST, SignUrl } from '../../../Common/HostUrl';
import { KeyBoard } from '../../../Common/KeyEnum';
import { IResponseData, PostJson, RequestStatus } from '../../../Common/Request';
import { Sleep } from '../../../Common/Sleep';
import { StoreageKeys } from "../../../Common/StoreageKeys";
import { FileServer } from '../../../DatabaseServices/FileServer';
import { userConfig } from '../../../Editor/UserConfig';
import { TopPanelStore } from '../../Store/TopPanelStore';
import { PostJson, RequestStatus, IResponseData } from '../../../Common/Request';
import { userConfigStore } from '../../Store/UserConfigStore';
import { appCache } from '../../../Common/AppCache';
import { userConfig } from '../../../Editor/UserConfig';
import { app } from '../../../ApplicationServices/Application';
import { AppToaster } from '../Toaster';
import { AppConfirm } from '../Common/Confirm';
import { FileServer } from '../../../DatabaseServices/FileServer';
import { Sleep } from '../../../Common/Sleep';
import { AppToaster } from '../Toaster';
interface ILoginState
{
@ -35,6 +35,7 @@ export function saveLoginInfos(data: IResponseData)
userConfig.isAdmin = data.ext_info.if_admin === 1;
userConfig.isMaster = data.ext_info.if_master === 1;
userConfig.rights = data.ext_info.rights;
userConfig.showShareModule = data.ext_info.ssm === "1";
//剩余天数
let retDate = new Date(data.ext_info.exp_date).getTime() - Date.now();

@ -120,6 +120,15 @@ export class ToolsBlock extends React.Component<ToolsBlockProps, {}>
}
execFun(cmd);
};
display = (cmd: ICommandIconInfo) =>
{
if (cmd.command === CommandNames.TemplateCheck && !userConfig.isAdmin)
return true;
if (cmd.command === CommandNames.TemplateSearch && !userConfig.showShareModule)
return true;
return false;
};
renderMainList = () =>
{
return (

@ -13,7 +13,7 @@ import { GetIndexDBID } from "../../Common/Utils";
import { CADFiler } from "../../DatabaseServices/CADFiler";
import { CommandServer } from "../../DatabaseServices/CommandServer";
import { FileServer } from "../../DatabaseServices/FileServer";
import { RegistCustomCommand, RemoveCustonCommand } from "../../Editor/CommandRegister";
import { LimitCommand, RegistCustomCommand, RemoveCustonCommand } from "../../Editor/CommandRegister";
import { userConfig } from "../../Editor/UserConfig";
import { RenderType } from "../../GraphicsSystem/RenderType";
import { IndexedDbStore, StoreName } from "../../IndexedDb/IndexedDbStore";
@ -168,6 +168,7 @@ export class UserConfigStore extends Singleton
await this.InitBBSTabIndex();
await (DownPanelStore.GetInstance() as DownPanelStore).Update();
await RegistCustomCommand();
await LimitCommand();
AppToaster.show({
message: "数据加载完成!",

Loading…
Cancel
Save