mirror of
https://gitee.com/hoslay/ddei-editor.git
synced 2025-12-07 09:38:41 +08:00
升级版本,修复htmlviewer位置不正确问题
This commit is contained in:
parent
f4da404c82
commit
937e2c5380
12
package-lock.json
generated
12
package-lock.json
generated
@ -1,15 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.41-201",
|
"version": "1.2.41-206",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.41-201",
|
"version": "1.2.41-206",
|
||||||
"license": "Apache License 2.0",
|
"license": "Apache License 2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.41-201.tgz"
|
"ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.41-206.tgz"
|
||||||
},
|
},
|
||||||
"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.41-201",
|
"version": "1.2.41-206",
|
||||||
"resolved": "file:../ddei-framework/ddei-framework-1.2.41-201.tgz",
|
"resolved": "file:../ddei-framework/ddei-framework-1.2.41-206.tgz",
|
||||||
"integrity": "sha512-WKsM8XduU5MruGAgIlH2qIbUCxa+1rQ9yhhBdntcHVhy6U4Q2U0cL+gPbncwjJhooXPCi3vxD8f9zBKRKKzOaA==",
|
"integrity": "sha512-T6L5G7OyuYF1b9WoAAonwSD4NCmBE4I2OQ92mCd1Zp3AckeHYEIYVCFy/f7kEy2YQmmpx4egqkPQtVTMstApdQ==",
|
||||||
"license": "Apache License 2.0",
|
"license": "Apache License 2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ddei-autolink": "^1.1.1",
|
"ddei-autolink": "^1.1.1",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ddei-editor",
|
"name": "ddei-editor",
|
||||||
"version": "1.2.41-202",
|
"version": "1.2.41-206",
|
||||||
"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": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.41-201.tgz"
|
"ddei-framework": "file:///Users/hoslay/work/ddei/ddei-framework/ddei-framework-1.2.41-206.tgz"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node18": "^18.2.0",
|
"@tsconfig/node18": "^18.2.0",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { DDeiLifeCycle, DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult, DDeiEditorState, DDeiEditorEnumBusCommandType } from "ddei-framework";
|
import { DDeiLifeCycle, DDeiFuncData, DDeiEditorUtil, DDeiUtil, DDeiFuncCallResult, DDeiEditorState, DDeiEditorEnumBusCommandType } from "ddei-framework";
|
||||||
import { createVNode,render ,markRaw } from "vue";
|
import { createVNode,toRaw ,markRaw } from "vue";
|
||||||
|
|
||||||
class DDeiExtHtmlViewerLifeCycle extends DDeiLifeCycle {
|
class DDeiExtHtmlViewerLifeCycle extends DDeiLifeCycle {
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class DDeiExtHtmlViewerLifeCycle extends DDeiLifeCycle {
|
|||||||
if (model.render.tempCanvas){
|
if (model.render.tempCanvas){
|
||||||
model.render.tempCanvas.remove()
|
model.render.tempCanvas.remove()
|
||||||
}
|
}
|
||||||
if (model.render.viewerOption != option){
|
if (model.render.viewerOption != option && toRaw(model.render.viewerOption) != option){
|
||||||
//如果已存在则销毁
|
//如果已存在则销毁
|
||||||
DDeiUtil.removeRenderViewer(model)
|
DDeiUtil.removeRenderViewer(model)
|
||||||
model.render.viewerOption = option
|
model.render.viewerOption = option
|
||||||
|
|||||||
84
src/App.vue
84
src/App.vue
@ -20,49 +20,91 @@ export default defineComponent({
|
|||||||
data() {
|
data() {
|
||||||
|
|
||||||
const options = markRaw({
|
const options = markRaw({
|
||||||
|
currentLayout: "ddei-core-layout-simple",
|
||||||
config: {
|
config: {
|
||||||
ratio: 1.3, //默认缩放比例为150%
|
ratio: 1, //默认缩放比例为150%
|
||||||
paper:"A6",
|
paper:"A6",
|
||||||
"mark": "水印文本",
|
"mark": "水印文本",
|
||||||
// EXT_STAGE_WIDTH: false,
|
// EXT_STAGE_WIDTH: false,
|
||||||
// EXT_STAGE_HEIGHT: false,
|
// EXT_STAGE_HEIGHT: false,
|
||||||
// 自定义控件,接收一个object[]。由于定义内容较多,提取到外部,便于维护
|
// 自定义控件,接收一个object[]。由于定义内容较多,提取到外部,便于维护
|
||||||
// controlDefines: ControlDefinesDemo,
|
controlDefines: ControlDefinesDemo,
|
||||||
// 自定义分组,接收一个object[]。由于定义内容较多,提取到外部,便于维护
|
// 自定义分组,接收一个object[]。由于定义内容较多,提取到外部,便于维护
|
||||||
// groupDefines: GroupDefinesDemo,
|
groupDefines: GroupDefinesDemo,
|
||||||
initData: {
|
initData: {
|
||||||
controls: [
|
controls: [
|
||||||
// {
|
// {
|
||||||
// model: "9999002"
|
// model: "9999002"
|
||||||
// },
|
// },
|
||||||
{
|
// {
|
||||||
id: "act_1",
|
// id: "act_1",
|
||||||
model: "102010",
|
// model: "102010",
|
||||||
type: "emp_1",
|
// type: "emp_1",
|
||||||
text: "第一步",
|
// text: "第一步",
|
||||||
border: { color: "yellow", dash: [10, 10, 5, 5], width: 5 },
|
// border: { color: "yellow", dash: [10, 10, 5, 5], width: 5 },
|
||||||
fill: { color: "grey" },
|
// fill: { color: "grey" },
|
||||||
}
|
// }
|
||||||
|
{
|
||||||
|
id: "act_1",
|
||||||
|
model: "102010",
|
||||||
|
type: "emp_1",
|
||||||
|
text: "第一步",
|
||||||
|
border: { color: "yellow", dash: [10, 10, 5, 5], width: 5 },
|
||||||
|
fill: { color: "grey" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "act_2",
|
||||||
|
model: "102010",
|
||||||
|
type: "emp_2",
|
||||||
|
width: 200,
|
||||||
|
height: 100,
|
||||||
|
text: "第二步",
|
||||||
|
offsetY: -70,
|
||||||
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
extensions: [
|
extensions: [
|
||||||
//布局的配置
|
// //布局的配置
|
||||||
DDeiCoreStandLayout.configuration({
|
// DDeiCoreStandLayout.configuration({
|
||||||
//配置插件
|
// //配置插件
|
||||||
// 'top': [],
|
// // 'top': [],
|
||||||
'middle': ['ddei-core-panel-openfilesview', 'ddei-core-panel-canvasview', 'ddei-core-panel-quickcolorview'],// [!code ++]
|
// 'middle': ['ddei-core-panel-openfilesview', 'ddei-core-panel-canvasview', 'ddei-core-panel-quickcolorview'],// [!code ++]
|
||||||
// 'bottom': [],
|
// // 'bottom': [],
|
||||||
// 'left': [],
|
// // 'left': [],
|
||||||
// 'right': []
|
// // 'right': []
|
||||||
|
// }),
|
||||||
|
DDeiCoreSimpleLayout.configuration({
|
||||||
|
other: ['ddei-core-panel-toolbox-simple', 'ddei-core-panel-topmenu-simple'],
|
||||||
|
middle: ['ddei-core-panel-canvasview'],
|
||||||
|
right: [],
|
||||||
|
bottom: []
|
||||||
}),
|
}),
|
||||||
DDeiCoreSimpleLayout,
|
|
||||||
DDeiExtUML,
|
DDeiExtUML,
|
||||||
DDeiExtSearch,
|
DDeiExtSearch,
|
||||||
DDeiExtTooltip,
|
DDeiExtTooltip,
|
||||||
DDeiExtQuickStyle,
|
DDeiExtQuickStyle,
|
||||||
DDeiExtQuickControl,
|
DDeiExtQuickControl,
|
||||||
|
//配置htmlviewer插件,matchField用于声明图形控件中的属性与config中的key对应字段
|
||||||
|
DDeiExtHtmlViewer.configuration({
|
||||||
|
matchField: "type", //匹配字段
|
||||||
|
"emp_1": { //key-value
|
||||||
|
type: "emp_1",
|
||||||
|
name: "张三",
|
||||||
|
viewer: ReplaceDivDemo //HTML模板控件
|
||||||
|
},
|
||||||
|
"emp_2": {
|
||||||
|
type: "emp_2",
|
||||||
|
name: "李四",
|
||||||
|
viewer: ReplaceDivDemo
|
||||||
|
},
|
||||||
|
"emp_3": {
|
||||||
|
type: "emp_3",
|
||||||
|
name: "王五",
|
||||||
|
viewer: ReplaceDivDemo
|
||||||
|
}
|
||||||
|
})
|
||||||
// QuickChooseControlDialog.configuration({ customGroups: ['101', '102'] }),
|
// QuickChooseControlDialog.configuration({ customGroups: ['101', '102'] }),
|
||||||
// DDeiExtTooltip.configuration({
|
// DDeiExtTooltip.configuration({
|
||||||
// 'ddei-ext-dialog-tooltip':{
|
// 'ddei-ext-dialog-tooltip':{
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { DDeiEnumBusCommandType } from 'ddei-framework'
|
|
||||||
export default {
|
export default {
|
||||||
name: "html-viewer-div-demo",
|
name: "html-viewer-div-demo",
|
||||||
props: {
|
props: {
|
||||||
@ -7,16 +6,15 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
},
|
},
|
||||||
editor:{
|
editor: {
|
||||||
type:Object,
|
type: Object,
|
||||||
default:null
|
default: null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div ref="divElement" class="html-demo">
|
||||||
style="display: flex;position:absolute;flex-direction:column;text-align:center;align-items: center;border:1px solid grey;background: white;color:black;display: none;">
|
|
||||||
<div style="width:100%;display: flex;text-align:center;align-items: center;">
|
<div style="width:100%;display: flex;text-align:center;align-items: center;">
|
||||||
<div style="flex:1">ID</div>
|
<div style="flex:1">ID</div>
|
||||||
<div style="flex:1">{{ model.id }}</div>
|
<div style="flex:1">{{ model.id }}</div>
|
||||||
@ -27,3 +25,12 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.html-demo {
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
user-select: none;
|
||||||
|
display: none;
|
||||||
|
border:1px solid grey;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -29,8 +29,7 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div ref="divElement" class="html-demo">
|
||||||
style="display: flex;position:absolute;flex-direction:column;text-align:center;align-items: center;border:1px solid grey;background: white;color:black;display: none;">
|
|
||||||
<div style="width:100%;display: flex;text-align:center;align-items: center;">
|
<div style="width:100%;display: flex;text-align:center;align-items: center;">
|
||||||
<div style="flex:1">ID</div>
|
<div style="flex:1">ID</div>
|
||||||
<div style="flex:1">{{ model.id }}</div>
|
<div style="flex:1">{{ model.id }}</div>
|
||||||
@ -41,3 +40,12 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<style scoped>
|
||||||
|
.html-demo {
|
||||||
|
position: absolute;
|
||||||
|
pointer-events: none;
|
||||||
|
user-select: none;
|
||||||
|
display: none;
|
||||||
|
border: 1px solid grey;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
x
Reference in New Issue
Block a user