mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-05 17:57:13 +00:00
Merge branch 'feat/optimization-lock' into 'develop'
feat: 新增enableLockedNodeSetting,支持设置容器锁定是属性仍然可以设置 新增enableLockedNodeSetting,支持设置容器锁定是属性仍然可以设置; 部分场景在容器锁定后需要对容器的属性做设定;比如卡片锁定后虽然不能修改卡片内部的子节点,但是仍然希望可以设置卡片的标题; See merge request !1455778
This commit is contained in:
commit
5fedc37074
@ -56,6 +56,10 @@ export interface EngineOptions {
|
|||||||
* 打开画布的锁定操作,默认值:false
|
* 打开画布的锁定操作,默认值:false
|
||||||
*/
|
*/
|
||||||
enableCanvasLock?: boolean;
|
enableCanvasLock?: boolean;
|
||||||
|
/**
|
||||||
|
* 容器锁定后,容器本身是否可以设置属性,仅当画布锁定特性开启时生效, 默认值为:false
|
||||||
|
*/
|
||||||
|
enableLockedNodeSetting?: boolean;
|
||||||
/**
|
/**
|
||||||
* 当选中节点切换时,是否停留在相同的设置 tab 上,默认值:false
|
* 当选中节点切换时,是否停留在相同的设置 tab 上,默认值:false
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user