mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-08 01:58:36 +08:00
重新规划样式目录,修复无限联动bug
This commit is contained in:
parent
a8e80d3e72
commit
284c61aa89
12
package-lock.json
generated
12
package-lock.json
generated
@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.7",
|
"version": "1.2.11",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.7",
|
"version": "1.2.11",
|
||||||
"license": "Apache License 2.0",
|
"license": "Apache License 2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ddei-framework": "^1.2.34"
|
"ddei-framework": "^1.2.35"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node18": "^18.2.0",
|
"@tsconfig/node18": "^18.2.0",
|
||||||
@ -518,9 +518,9 @@
|
|||||||
"integrity": "sha512-tdMuLdcJyreope1BWfnYqTQaIkSIrU/KtY9yX5mNGd+tYeJ0Y99ARHDuYnEABPX/8yh/r0Kl169v5ODg2vr98g=="
|
"integrity": "sha512-tdMuLdcJyreope1BWfnYqTQaIkSIrU/KtY9yX5mNGd+tYeJ0Y99ARHDuYnEABPX/8yh/r0Kl169v5ODg2vr98g=="
|
||||||
},
|
},
|
||||||
"node_modules/ddei-framework": {
|
"node_modules/ddei-framework": {
|
||||||
"version": "1.2.34",
|
"version": "1.2.35",
|
||||||
"resolved": "https://registry.npmjs.org/ddei-framework/-/ddei-framework-1.2.34.tgz",
|
"resolved": "https://registry.npmjs.org/ddei-framework/-/ddei-framework-1.2.35.tgz",
|
||||||
"integrity": "sha512-YHkwbf29uAb2dMHr96+PafvWCP+/NiU2bT2nJhb3H4kyKcVPCZ9p8twvAokijqRUCMEvo0nYXjv3EpDH0ntnSw==",
|
"integrity": "sha512-5pIclUdYhYB0nodA+3JTna0ZI/IjbAB+KeYloYLOT4mIEIMMwxZD9hieHUqxEO3rAE5SQp6z1OS4nux7zfGDJg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ddei-autolink": "^1.1.1",
|
"ddei-autolink": "^1.1.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.9",
|
"version": "1.2.11-2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"author": "hoslay <3697355039@qq.com>",
|
"author": "hoslay <3697355039@qq.com>",
|
||||||
@ -49,7 +49,7 @@
|
|||||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ddei-framework": "^1.2.34"
|
"ddei-framework": "^1.2.35"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node18": "^18.2.0",
|
"@tsconfig/node18": "^18.2.0",
|
||||||
@ -64,4 +64,4 @@
|
|||||||
"vite-plugin-compression": "^0.5.1",
|
"vite-plugin-compression": "^0.5.1",
|
||||||
"vue-tsc": "^1.8.6"
|
"vue-tsc": "^1.8.6"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,19 +74,7 @@ export default {
|
|||||||
this.$watch("editor.leftWidth", function (newVal, oldVal) {
|
this.$watch("editor.leftWidth", function (newVal, oldVal) {
|
||||||
this.$refs.left.style.flexBasis = newVal + "px";
|
this.$refs.left.style.flexBasis = newVal + "px";
|
||||||
});
|
});
|
||||||
this.$watch("editor.middleWidth", function (newVal, oldVal) {
|
|
||||||
|
|
||||||
//重新设置画布大小
|
|
||||||
this.editor.ddInstance.render.setSize(
|
|
||||||
this.editor.middleWidth,
|
|
||||||
this.editor.middleHeight,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
this.editor.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape)
|
|
||||||
this.editor.ddInstance.bus.executeAll()
|
|
||||||
this.editor.changeState(DDeiEditorState.DESIGNING);
|
|
||||||
});
|
|
||||||
this.$watch("editor.rightWidth", function (newVal, oldVal) {
|
this.$watch("editor.rightWidth", function (newVal, oldVal) {
|
||||||
this.$refs.right.style.flexBasis = newVal + "px";
|
this.$refs.right.style.flexBasis = newVal + "px";
|
||||||
});
|
});
|
||||||
@ -125,18 +113,12 @@ export default {
|
|||||||
);
|
);
|
||||||
this.editor.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
this.editor.ddInstance.bus.push(DDeiEnumBusCommandType.RefreshShape);
|
||||||
this.editor.ddInstance.bus.executeAll();
|
this.editor.ddInstance.bus.executeAll();
|
||||||
this.editor.leftWidth = this.$refs.left.offsetWidth;
|
|
||||||
this.editor.rightWidth = this.$refs.right.offsetWidth;
|
|
||||||
this.editor.topHeight = this.$refs.top.offsetHeight;
|
|
||||||
this.editor.bottomHeight = this.$refs.bottom.offsetHeight;
|
|
||||||
this.editor.middleWidth = this.$refs.middle.offsetWidth;
|
|
||||||
this.editor.middleHeight = this.$refs.middle.offsetHeight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 开始监听目标元素的大小变化
|
//开始监听目标元素的大小变化
|
||||||
resizeObserver.observe(middleCanvas);
|
resizeObserver.observe(middleCanvas);
|
||||||
|
|
||||||
this.editor.leftWidth = this.$refs.left.offsetWidth;
|
this.editor.leftWidth = this.$refs.left.offsetWidth;
|
||||||
@ -255,7 +237,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.middle {
|
.middle {
|
||||||
flex: 1;
|
flex: 1 1 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -271,8 +271,8 @@ export default defineComponent({
|
|||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<DDeiEditorView ref="editorViewer1" :options="options" id="ddei_editor_1"></DDeiEditorView>
|
<DDeiEditorView ref="editorViewer1" :options="{}" id="ddei_editor_1"></DDeiEditorView>
|
||||||
<DDeiEditorView ref="editorViewer2" :options="options1" id="ddei_editor_2"></DDeiEditorView>
|
<!-- <DDeiEditorView ref="editorViewer2" :options="options1" id="ddei_editor_2"></DDeiEditorView>
|
||||||
<div style="width:400px;height:400px;float:left">
|
<div style="width:400px;height:400px;float:left">
|
||||||
<DDeiEditorView ref="editorViewer3" :options="options2" id="ddei_editor_3"></DDeiEditorView>
|
<DDeiEditorView ref="editorViewer3" :options="options2" id="ddei_editor_3"></DDeiEditorView>
|
||||||
</div>
|
</div>
|
||||||
@ -282,7 +282,7 @@ export default defineComponent({
|
|||||||
</div>
|
</div>
|
||||||
<div style="width:400px;height:400px;float:left">
|
<div style="width:400px;height:400px;float:left">
|
||||||
<DDeiEditorView ref="editorViewer5" :options="options4" id="ddei_editor_5"></DDeiEditorView>
|
<DDeiEditorView ref="editorViewer5" :options="options4" id="ddei_editor_5"></DDeiEditorView>
|
||||||
</div>
|
</div> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
12
src/assets/ddei.css
Normal file
12
src/assets/ddei.css
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
.iconfont {
|
||||||
|
font-family: 'iconfont' !important;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #424242;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont-small {
|
||||||
|
font-size: 6px !important;
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
@ -1 +0,0 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
|
||||||
|
Before Width: | Height: | Size: 276 B |
@ -8,18 +8,6 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-family: 'iconfont' !important;
|
|
||||||
font-size: 24px;
|
|
||||||
color: #424242;
|
|
||||||
font-style: normal;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont-small {
|
|
||||||
font-size: 6px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
[data-dpr="2"] .iconfont {
|
[data-dpr="2"] .iconfont {
|
||||||
|
|||||||
@ -22,13 +22,15 @@ import {DDeiEditorCommandFileDirty} from "ddei-framework";
|
|||||||
import {DDeiEditorCommandAddHistroy} from "ddei-framework";
|
import {DDeiEditorCommandAddHistroy} from "ddei-framework";
|
||||||
import MenuDialog from "./MenuDialog.vue";
|
import MenuDialog from "./MenuDialog.vue";
|
||||||
import {DDeiEditorUtil} from "ddei-framework";
|
import {DDeiEditorUtil} from "ddei-framework";
|
||||||
import { DDeiModelArrtibuteValue } from 'ddei-framework'
|
|
||||||
import DDeiCore from "@ddei/core";
|
import DDeiCore from "@ddei/core";
|
||||||
|
|
||||||
import ICONS from "./icon";
|
import ICONS from "./icon";
|
||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
|
|
||||||
import { Matrix3 ,Vector3} from "three"
|
import '@/assets/ddei.css'
|
||||||
|
import '@/assets/fonts/iconfont/iconfont.css'
|
||||||
|
import '@/assets/fonts/iconfont/iconfont.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "DDei-Editor",
|
name: "DDei-Editor",
|
||||||
extends: null,
|
extends: null,
|
||||||
@ -87,7 +89,6 @@ export default {
|
|||||||
this.editor.extConfig = this.options.config;
|
this.editor.extConfig = this.options.config;
|
||||||
this.editor.ddInstance.applyConfig(this.options.config);
|
this.editor.ddInstance.applyConfig(this.options.config);
|
||||||
}
|
}
|
||||||
window.onbeforeunload = this.beforeUnload;
|
|
||||||
DDeiEditorUtil.ICONS = ICONS;
|
DDeiEditorUtil.ICONS = ICONS;
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -154,21 +155,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
beforeUnload(e) {
|
|
||||||
let files = this.editor?.files
|
|
||||||
|
|
||||||
let hasDirty = false;
|
|
||||||
for (let i = 0; i < files?.length; i++) {
|
|
||||||
if (files[i].state != DDeiFileState.NONE) {
|
|
||||||
hasDirty = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (hasDirty) {
|
|
||||||
var e = window.event || e;
|
|
||||||
e.returnValue = ("确定离开当前页面吗(未保存数据将会丢失)?");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,4 +5,5 @@ export * from "@ddei/uml";
|
|||||||
export * from "@ddei/quickstyle";
|
export * from "@ddei/quickstyle";
|
||||||
export * from "./icon";
|
export * from "./icon";
|
||||||
export * from "ddei-framework"
|
export * from "ddei-framework"
|
||||||
|
export { DDeiEditorView};
|
||||||
export default DDeiEditorView;
|
export default DDeiEditorView;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import './assets/main.css'
|
import './assets/main.css'
|
||||||
import './assets/fonts/iconfont/iconfont.css'
|
// import './assets/fonts/iconfont/iconfont.css'
|
||||||
import './assets/fonts/iconfont/iconfont.js'
|
// import './assets/fonts/iconfont/iconfont.js'
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
|
|
||||||
createApp(App).mount('#app')
|
createApp(App).mount('#app')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user