feat: 新增enableLockedNodeSetting,支持设置容器锁定是属性仍然可以设置

This commit is contained in:
rongbin.arb 2021-11-08 11:22:06 +08:00
parent 8c8d2799d6
commit 09785db2a2
2 changed files with 8 additions and 3 deletions

View File

@ -56,6 +56,10 @@ export interface EngineOptions {
* false * false
*/ */
enableCanvasLock?: boolean; enableCanvasLock?: boolean;
/**
* false
*/
enableLockedNodeSetting?: boolean;
/** /**
* tab false * tab false
*/ */

View File

@ -7,6 +7,7 @@ import { SettingsPane } from './settings-pane';
import { StageBox } from '../stage-box'; import { StageBox } from '../stage-box';
import { SkeletonContext } from '../../context'; import { SkeletonContext } from '../../context';
import { createIcon } from '@ali/lowcode-utils'; import { createIcon } from '@ali/lowcode-utils';
@observer @observer
export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any }, { shouldIgnoreRoot: boolean }> { export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any }, { shouldIgnoreRoot: boolean }> {
state = { state = {
@ -67,7 +68,7 @@ export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any
const designer = editor.get('designer'); const designer = editor.get('designer');
const current = designer?.currentSelection?.getNodes()?.[0]; const current = designer?.currentSelection?.getNodes()?.[0];
let node: Node | null = settings.first; let node: Node | null = settings.first;
const focusNode = node.document.focusNode; const { focusNode } = node.document;
const items = []; const items = [];
let l = 3; let l = 3;
@ -138,7 +139,8 @@ export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any
); );
} }
if (settings.isLocked) { // 当节点被锁定,且未开启锁定后容器可设置属性
if (settings.isLocked && !engineConfig.get('enableLockedNodeSetting', false)) {
return ( return (
<div className="lc-settings-main"> <div className="lc-settings-main">
<div className="lc-settings-notice"> <div className="lc-settings-notice">
@ -147,7 +149,6 @@ export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any
</div> </div>
); );
} }
if (Array.isArray(settings.items) && settings.items.length === 0) { if (Array.isArray(settings.items) && settings.items.length === 0) {
return ( return (
<div className="lc-settings-main"> <div className="lc-settings-main">