升级版本,修复htmlviewer位置不正确问题

This commit is contained in:
猴赛雷 2024-10-15 17:35:24 +08:00
parent f4da404c82
commit 937e2c5380
6 changed files with 98 additions and 41 deletions

12
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -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,
//htmlviewermatchFieldconfigkey
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':{

View File

@ -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>
@ -26,4 +24,13 @@ export default {
<div style="flex:1">{{ model.name }}</div> <div style="flex:1">{{ model.name }}</div>
</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>

View File

@ -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>
@ -40,4 +39,13 @@ export default {
<div style="flex:1">{{ name }}</div> <div style="flex:1">{{ name }}</div>
</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>