mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-06 17:18:36 +08:00
commit
42696ee913
@ -10,7 +10,7 @@
|
||||
<meta name="description" content="DDei在线设计器——简单、好用、免费的在线绘图和流程编排工具。流程设计、UML、思维导图、数据库设计、泳道图、时序图、类图、在线绘图、二次开发、API接口、协作!">
|
||||
<meta name="Keywords" content="流程设计,UML,思维导图,数据库设计,泳道图,时序图,类图,在线绘图,免费,二次开发,API接口,协作">
|
||||
<meta name="replace">
|
||||
<title>DDei-在线设计器V1.2.45</title>
|
||||
<title>DDei-在线设计器V1.2.46</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
15
package-lock.json
generated
15
package-lock.json
generated
@ -1,19 +1,21 @@
|
||||
{
|
||||
"name": "ddei-editor",
|
||||
"version": "1.2.45",
|
||||
"version": "1.2.46",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ddei-editor",
|
||||
"version": "1.2.45",
|
||||
"version": "1.2.46",
|
||||
"license": "Apache License 2.0",
|
||||
"dependencies": {
|
||||
"ddei-framework": "^1.2.46"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node18": "^18.2.0",
|
||||
"@types/node": "^18.17.6",
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"ddei-framework": "^1.2.45",
|
||||
"less": "^4.2.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"typescript": "~5.1.6",
|
||||
@ -496,10 +498,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ddei-framework": {
|
||||
"version": "1.2.45",
|
||||
"resolved": "https://registry.npmjs.org/ddei-framework/-/ddei-framework-1.2.45.tgz",
|
||||
"integrity": "sha512-vGhRs6GE1c0ScSKGPxQKmETKZ3G/+OV48pQJYsw0bXCbBpWHpN4N/PH9S9zddx9ZfhLY//OMkbHmpmFSVUumfw==",
|
||||
"dev": true,
|
||||
"version": "1.2.46",
|
||||
"resolved": "https://registry.npmjs.org/ddei-framework/-/ddei-framework-1.2.46.tgz",
|
||||
"integrity": "sha512-jrgZwWvjhtKAUz5K4ktP5PGN/9qXuYGsuG/XkqUq6RfON7Tk0Mg6bFzuO8B0aUusE8uSp7PzuM/x5wS4uNIHug==",
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ddei-editor",
|
||||
"version": "1.2.45",
|
||||
"version": "1.2.46",
|
||||
"private": false,
|
||||
"type": "module",
|
||||
"author": "hoslay <3697355039@qq.com>",
|
||||
@ -60,6 +60,6 @@
|
||||
"vite": "^4.4.6",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vue-tsc": "^1.8.6",
|
||||
"ddei-framework": "^1.2.45"
|
||||
"ddei-framework": "^1.2.46"
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,5 +254,10 @@ export default {
|
||||
LINE_OBI_FILTER: (model, params)=>{
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
menus:[
|
||||
{ name: "ddei-core-menu-disabled-auto-obi" },
|
||||
{ name: "ddei-core-menu-enable-auto-obi" },
|
||||
{ name: "ddei-core-menu-sysdefault-auto-obi" }
|
||||
]
|
||||
}
|
||||
@ -562,6 +562,13 @@ export default {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//如果没有设置自动避障,并且全局也取消自动避障
|
||||
|
||||
if (!line.autoObiPolicy && !model.stage.ddInstance.GLOBAL_AUTO_OBI) {
|
||||
return false;
|
||||
} else if (line.autoObiPolicy == 1){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ class DDeiKeyActionStartQuickEdit extends DDeiKeyAction {
|
||||
dataJson["textStyle"] = { paddingWeight: 0 }
|
||||
if (isLineLM){
|
||||
|
||||
dataJson["fill"] = {type:1 ,color: 'white' }
|
||||
// dataJson["fill"] = {type:1 ,color: 'white' }
|
||||
}
|
||||
for (let i in dataJson) {
|
||||
let value = dataJson[i]
|
||||
|
||||
@ -79,6 +79,9 @@ export default {
|
||||
paper: 'Paper',
|
||||
propertyName: "Property",
|
||||
searchResult: "Search Result",
|
||||
enableAutoObi: "Avoiding Obstacles",
|
||||
disabledAutoObi: "Disable Avoiding Obstacles",
|
||||
sysDefaultAutoObi: "Default Avoiding Obstacles",
|
||||
property: {
|
||||
id: 'id',
|
||||
code: 'Code',
|
||||
|
||||
@ -81,6 +81,9 @@ export default {
|
||||
paper: '纸张',
|
||||
propertyName:"属性",
|
||||
searchResult: "搜索结果",
|
||||
enableAutoObi: "开启避障",
|
||||
disabledAutoObi: "关闭避障",
|
||||
sysDefaultAutoObi: "默认避障",
|
||||
property:{
|
||||
id:'id',
|
||||
code:'编码',
|
||||
|
||||
@ -7,6 +7,9 @@ import MenuMergeCell from "./menu-merge-cell"
|
||||
import MenuRemoveCol from "./menu-remove-col"
|
||||
import MenuRemoveRow from "./menu-remove-row"
|
||||
import MenuRemoveSheet from "./menu-remove-sheet"
|
||||
import MenuDisabledAutoObi from "./menu-disabled-autoobi"
|
||||
import MenuEnableAutoObi from "./menu-enable-autoobi"
|
||||
import MenuSysDefaultAutoObi from "./menu-sysdefault-autoobi"
|
||||
|
||||
|
||||
/**
|
||||
@ -22,7 +25,7 @@ class DDeiCoreMenus extends DDeiPluginBase{
|
||||
|
||||
|
||||
plugins: object[] = [MenuCancelMergeCell, MenuCopySheet, MenuInsertCol, MenuInsertRow,
|
||||
MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet]
|
||||
MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet, MenuDisabledAutoObi, MenuEnableAutoObi, MenuSysDefaultAutoObi]
|
||||
|
||||
|
||||
getMenus(editor){
|
||||
@ -57,6 +60,6 @@ class DDeiCoreMenus extends DDeiPluginBase{
|
||||
}
|
||||
export {
|
||||
DDeiCoreMenus, MenuCancelMergeCell, MenuCopySheet, MenuInsertCol, MenuInsertRow,
|
||||
MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet
|
||||
MenuMergeCell, MenuRemoveCol, MenuRemoveRow, MenuRemoveSheet, MenuDisabledAutoObi, MenuEnableAutoObi, MenuSysDefaultAutoObi
|
||||
}
|
||||
export default DDeiCoreMenus
|
||||
81
plugins/core/menus/menu-disabled-autoobi.ts
Normal file
81
plugins/core/menus/menu-disabled-autoobi.ts
Normal file
@ -0,0 +1,81 @@
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiMenuBase} from "ddei-framework";
|
||||
/**
|
||||
* 取消/开启 自动避障
|
||||
*/
|
||||
class MenuDisabledAutoObi extends DDeiMenuBase {
|
||||
|
||||
|
||||
name: string = "ddei-core-menu-disabled-auto-obi"
|
||||
|
||||
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: MenuDisabledAutoObi = new MenuDisabledAutoObi();
|
||||
|
||||
defaultOptions: object = {
|
||||
'label': 'ddei.disabledAutoObi',
|
||||
'disabled': false
|
||||
}
|
||||
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[MenuDisabledAutoObi.defaultIns.name]) {
|
||||
for (let i in options[MenuDisabledAutoObi.defaultIns.name]) {
|
||||
newOptions[i] = options[MenuDisabledAutoObi.defaultIns.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new MenuDisabledAutoObi(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return MenuDisabledAutoObi;
|
||||
}
|
||||
|
||||
static modify(fn) {
|
||||
return MenuDisabledAutoObi.defaultIns.modify(fn)
|
||||
}
|
||||
/**
|
||||
* 执行的方法
|
||||
*/
|
||||
action(model: object, evt: Event): void {
|
||||
if (model?.baseModelType == 'DDeiLine') {
|
||||
model.autoObiPolicy = 1
|
||||
let ddInstance = model.stage.ddInstance
|
||||
|
||||
model.refreshLinePoints()
|
||||
ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
ddInstance.bus.executeAll();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判定是否显示的方法
|
||||
*/
|
||||
isVisiable(model: object): boolean {
|
||||
//当前控件为表格控件,TODO 或者布局方式为表格的容器控件
|
||||
|
||||
if (!this.disabled && model?.baseModelType == 'DDeiLine'
|
||||
&& ((model.stage.ddInstance.GLOBAL_AUTO_OBI && !model.autoObiPolicy) || (!model.stage.ddInstance.GLOBAL_AUTO_OBI && model.autoObiPolicy == 2))
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MenuDisabledAutoObi;
|
||||
79
plugins/core/menus/menu-enable-autoobi.ts
Normal file
79
plugins/core/menus/menu-enable-autoobi.ts
Normal file
@ -0,0 +1,79 @@
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiMenuBase} from "ddei-framework";
|
||||
/**
|
||||
* 取消/开启 自动避障
|
||||
*/
|
||||
class MenuEnableAutoObi extends DDeiMenuBase {
|
||||
|
||||
|
||||
name: string = "ddei-core-menu-enable-auto-obi"
|
||||
|
||||
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: MenuEnableAutoObi = new MenuEnableAutoObi();
|
||||
|
||||
defaultOptions: object = {
|
||||
'label': 'ddei.enableAutoObi',
|
||||
'disabled': false
|
||||
}
|
||||
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[MenuEnableAutoObi.defaultIns.name]) {
|
||||
for (let i in options[MenuEnableAutoObi.defaultIns.name]) {
|
||||
newOptions[i] = options[MenuEnableAutoObi.defaultIns.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new MenuEnableAutoObi(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return MenuEnableAutoObi;
|
||||
}
|
||||
|
||||
static modify(fn) {
|
||||
return MenuEnableAutoObi.defaultIns.modify(fn)
|
||||
}
|
||||
/**
|
||||
* 执行的方法
|
||||
*/
|
||||
action(model: object, evt: Event): void {
|
||||
if (model?.baseModelType == 'DDeiLine') {
|
||||
model.autoObiPolicy = 2
|
||||
let ddInstance = model.stage.ddInstance
|
||||
|
||||
model.refreshLinePoints()
|
||||
ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
ddInstance.bus.executeAll();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判定是否显示的方法
|
||||
*/
|
||||
isVisiable(model: object): boolean {
|
||||
//当前控件为表格控件,TODO 或者布局方式为表格的容器控件
|
||||
|
||||
if (!this.disabled && model?.baseModelType == 'DDeiLine' && ((model.stage.ddInstance.GLOBAL_AUTO_OBI && model.autoObiPolicy == 1) || (!model.stage.ddInstance.GLOBAL_AUTO_OBI && !model.autoObiPolicy))) {
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MenuEnableAutoObi;
|
||||
78
plugins/core/menus/menu-sysdefault-autoobi.ts
Normal file
78
plugins/core/menus/menu-sysdefault-autoobi.ts
Normal file
@ -0,0 +1,78 @@
|
||||
import {DDeiEnumBusCommandType} from "ddei-framework";
|
||||
import {DDeiMenuBase} from "ddei-framework";
|
||||
/**
|
||||
* 采用系统避障策略
|
||||
*/
|
||||
class MenuSysDefaultAutoObi extends DDeiMenuBase {
|
||||
|
||||
|
||||
name: string = "ddei-core-menu-sysdefault-auto-obi"
|
||||
|
||||
|
||||
/**
|
||||
* 缺省实例
|
||||
*/
|
||||
static defaultIns: MenuSysDefaultAutoObi = new MenuSysDefaultAutoObi();
|
||||
|
||||
defaultOptions: object = {
|
||||
'label': 'ddei.sysDefaultAutoObi',
|
||||
'disabled': false
|
||||
}
|
||||
|
||||
|
||||
|
||||
static configuration(options, fullConfig: boolean = false) {
|
||||
//解析options,只使用自己相关的
|
||||
if (options) {
|
||||
let newOptions = {}
|
||||
if (fullConfig) {
|
||||
if (fullConfig) {
|
||||
if (options[MenuSysDefaultAutoObi.defaultIns.name]) {
|
||||
for (let i in options[MenuSysDefaultAutoObi.defaultIns.name]) {
|
||||
newOptions[i] = options[MenuSysDefaultAutoObi.defaultIns.name][i]
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newOptions = options
|
||||
}
|
||||
if (newOptions && Object.keys(newOptions).length !== 0) {
|
||||
let panels = new MenuSysDefaultAutoObi(newOptions);
|
||||
return panels;
|
||||
}
|
||||
}
|
||||
return MenuSysDefaultAutoObi;
|
||||
}
|
||||
|
||||
static modify(fn) {
|
||||
return MenuSysDefaultAutoObi.defaultIns.modify(fn)
|
||||
}
|
||||
/**
|
||||
* 执行的方法
|
||||
*/
|
||||
action(model: object, evt: Event): void {
|
||||
if (model?.baseModelType == 'DDeiLine') {
|
||||
delete model.autoObiPolicy
|
||||
let ddInstance = model.stage.ddInstance
|
||||
|
||||
model.refreshLinePoints()
|
||||
ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||
ddInstance.bus.executeAll();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判定是否显示的方法
|
||||
*/
|
||||
isVisiable(model: object): boolean {
|
||||
if (!this.disabled && model?.baseModelType == 'DDeiLine'
|
||||
&& ((model.stage.ddInstance.GLOBAL_AUTO_OBI && model.autoObiPolicy == 2) || (!model.stage.ddInstance.GLOBAL_AUTO_OBI && model.autoObiPolicy == 1))) {
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MenuSysDefaultAutoObi;
|
||||
@ -28,7 +28,7 @@ export default defineComponent({
|
||||
]
|
||||
currentLayout = "ddei-core-layout-mobile"
|
||||
}else{
|
||||
exts = [DDeiExtTooltip,
|
||||
exts = [
|
||||
DDeiExtQuickStyle,
|
||||
DDeiCoreCanvasQuickDialog
|
||||
// .configuration({
|
||||
@ -43,6 +43,7 @@ export default defineComponent({
|
||||
config: {
|
||||
ratio: 0.7, //默认缩放比例为120%
|
||||
pixel:2, //调整渲染质量
|
||||
// GLOBAL_AUTO_OBI:false,
|
||||
// readonly:true,
|
||||
// readonly:1,
|
||||
// paper:"A6",
|
||||
@ -113,7 +114,7 @@ export default defineComponent({
|
||||
other: ['ddei-core-panel-toolbox-simple', 'ddei-core-panel-topmenu-simple'],
|
||||
middle: ['ddei-core-panel-canvasview'],
|
||||
right: [],
|
||||
bottom: []
|
||||
bottom: ['ddei-core-panel-bottommenu']
|
||||
}),
|
||||
DDeiExtUML,
|
||||
DDeiExtSearch.modify((plugin)=>{
|
||||
|
||||
@ -119,6 +119,9 @@ export default {
|
||||
}
|
||||
loadControlDefineExt(oldControl)
|
||||
}
|
||||
if (control.viewer) {
|
||||
oldControl.viewer = control.viewer
|
||||
}
|
||||
control = oldControl
|
||||
}
|
||||
this.editor.controls.set(control.id, control);
|
||||
@ -157,16 +160,18 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
this.editor.controls?.forEach(control => {
|
||||
if (control.menus) {
|
||||
if (!editorInstance.menuMapping[control.id]) {
|
||||
editorInstance.menuMapping[control.id] = control.menus
|
||||
|
||||
if (!this.editor.menuMapping[control.id]) {
|
||||
this.editor.menuMapping[control.id] = control.menus
|
||||
}
|
||||
let menus = editorInstance.menuMapping[control.id];
|
||||
let menus = this.editor.menuMapping[control.id];
|
||||
for (let i = 0; i < menus.length; i++) {
|
||||
for (let j in editorInstance.menus) {
|
||||
if (editorInstance.menus[j].name == menus[i].name) {
|
||||
menus[i] = editorInstance.menus[j];
|
||||
for (let j in this.editor.menus) {
|
||||
if (this.editor.menus[j].name == menus[i].name) {
|
||||
menus[i] = this.editor.menus[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user