样式错乱问题

This commit is contained in:
猴赛雷 2024-05-16 18:05:38 +08:00
parent 5bd999d606
commit 1a4598fbef
10 changed files with 53 additions and 121 deletions

12
package-lock.json generated
View File

@ -1,15 +1,15 @@
{
"name": "ddei-editor",
"version": "1.2.11-6",
"version": "1.2.11-12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ddei-editor",
"version": "1.2.11-6",
"version": "1.2.11-12",
"license": "Apache License 2.0",
"dependencies": {
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-3.tgz"
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-8.tgz"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.0",
@ -518,9 +518,9 @@
"integrity": "sha512-tdMuLdcJyreope1BWfnYqTQaIkSIrU/KtY9yX5mNGd+tYeJ0Y99ARHDuYnEABPX/8yh/r0Kl169v5ODg2vr98g=="
},
"node_modules/ddei-framework": {
"version": "1.2.35-3",
"resolved": "file:../ddei-framework/ddei-framework-1.2.35-3.tgz",
"integrity": "sha512-E6EHBybuiDgMkC1WhZvZ4LkUi2OLAsjBSCHECdUqOlHXCWvw7i1W4aISe8M5BL7pvnFQXPboB9En1q7+6HV1tQ==",
"version": "1.2.35-8",
"resolved": "file:../ddei-framework/ddei-framework-1.2.35-8.tgz",
"integrity": "sha512-MIvzLlyKZlb7+fjFdy3G5/g49pvzmLLw+aC4E4SXKG9vufBYV53bvgreaZQHDaXDEOUgrRH09Q2J8x0XBdG54Q==",
"license": "Apache License 2.0",
"dependencies": {
"ddei-autolink": "^1.1.1",

View File

@ -1,6 +1,6 @@
{
"name": "ddei-editor",
"version": "1.2.11-6",
"version": "1.2.11-19",
"private": false,
"type": "module",
"author": "hoslay <3697355039@qq.com>",
@ -49,7 +49,7 @@
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false"
},
"dependencies": {
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-3.tgz"
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-8.tgz"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.0",

View File

@ -136,7 +136,7 @@ export default {
},
'itemStyle': { width: 80, height: 25, col: 2, row: 0, imgWidth: 20, imgHeight: 20 },
'canSearch': true,
'defaultValue': "Microsoft YaHei",
'defaultValue': "",
},
{
'code': 'mark.font.size',

View File

@ -73,11 +73,13 @@ export default {
left: 0px;
display: none;
bottom: 16px;
height: 34px;
height: 48px;
.icon {
font-size: 18px;
width:18px;
height:18px;
}
.items {

View File

@ -5,7 +5,7 @@
:class="{ 'ddei-core-panel-bottom-changeratio__combox': true,'ddei-core-panel-bottom-changeratio__combox__dialog':dialog}"
@click="dialog && showChangeRatioDialog($event)">
<span>
{{ parseInt(editor?.currentStage?.ratio * 100) }}%
{{ parseInt(currentStage?.ratio * 100) }}%
</span>
<svg v-if="dialog" class="icon expbtn" aria-hidden="true">
<use xlink:href="#icon-a-ziyuan466"></use>
@ -21,7 +21,7 @@
:class="{ 'ddei-core-panel-bottom-changeratio__combox': true, 'ddei-core-panel-bottom-changeratio__combox__dialog': dialog }"
@click="dialog && showChangeRatioDialog($event)">
<span>
{{ parseInt(editor?.currentStage?.ratio * 100) }}%
{{ parseInt(currentStage?.ratio * 100) }}%
</span>
<svg v-if="dialog" class="icon expbtn" aria-hidden="true">
<use xlink:href="#icon-a-ziyuan466"></use>
@ -86,13 +86,14 @@ export default {
ratioInputValue: 0,
stageRatio: 1,
allowStageRatio: true,
currentStage:null,
};
},
computed: {},
watch: {},
created() {
// objprop
this.$watch("editor.currentStage.ratio", function (newVal, oldVal) {
this.$watch("currentStage.ratio", function (newVal, oldVal) {
if (
DDeiEditorUtil.getConfigValue("GLOBAL_ALLOW_STAGE_RATIO", this.editor)
) {
@ -123,8 +124,7 @@ export default {
mounted() {
let file = this.editor?.files[this.editor?.currentFileIndex];
let sheet = file?.sheets[file?.currentSheetIndex];
this.editor.currentStage = sheet?.stage;
this.currentStage = sheet?.stage;
this.allowStageRatio = DDeiEditorUtil.getConfigValue(
"GLOBAL_ALLOW_STAGE_RATIO",
this.editor
@ -134,7 +134,7 @@ export default {
showChangeRatioDialog(evt: Event) {
let srcElement = evt.currentTarget;
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changeratio", {
ratio: this.editor.currentStage?.ratio,
ratio: this.currentStage?.ratio,
callback: {
ok: this.setRatio,
},
@ -152,15 +152,15 @@ export default {
* 增加缩放比率
*/
addRatio(deltaRatio: number) {
let ratio = this.editor.currentStage.getStageRatio();
let ratio = this.currentStage?.getStageRatio();
let newRatio = parseFloat((ratio + deltaRatio).toFixed(2));
if (newRatio < this.min) {
newRatio = this.min
} else if (newRatio > this.max) {
newRatio = this.max;
}
this.editor?.currentStage?.setStageRatio(newRatio);
this.stageRatio = this.editor?.currentStage?.ratio;
this.currentStage?.setStageRatio(newRatio);
this.stageRatio = this.currentStage?.ratio;
this.editor.changeState(DDeiEditorState.DESIGNING);
},
@ -173,20 +173,20 @@ export default {
} else if (ratio > this.max) {
ratio = this.max;
}
this.editor?.currentStage?.setStageRatio(ratio);
this.stageRatio = this.editor?.currentStage?.ratio;
this.currentStage?.setStageRatio(ratio);
this.stageRatio = this.currentStage?.ratio;
},
/**
* 修改当前的全局缩放比率
*/
changeRatio() {
if (this.editor?.currentStage?.ratio || this.editor?.currentStage?.ratio == 0) {
if (this.editor?.currentStage?.oldRatio || this.editor?.currentStage?.oldRatio == 0) {
if (this.currentStage?.ratio || this.currentStage?.ratio == 0) {
if (this.currentStage?.oldRatio || this.currentStage?.oldRatio == 0) {
this.editor?.bus?.push(
DDeiEnumBusCommandType.ChangeStageRatio,
{
oldValue: this.editor.currentStage.oldRatio,
newValue: this.editor.currentStage.ratio,
oldValue: this.currentStage.oldRatio,
newValue: this.currentStage.ratio,
},
null
);
@ -200,10 +200,13 @@ export default {
<style lang="less" scoped>
.expbtn {
width: 14px;
font-size: 14px;
}
.icon {
font-size: 22px;
width:22px;
height:22px;
}
.ddei-core-panel-bottom-changeratio {
flex: 0 0 157px;

View File

@ -31,6 +31,7 @@ export default {
data() {
return {
allowStageRatio: true,
currentStage:null,
};
},
computed: {},
@ -41,6 +42,9 @@ export default {
"GLOBAL_ALLOW_STAGE_RATIO",
this.editor
);
let file = this.editor?.files[this.editor?.currentFileIndex];
let sheet = file?.sheets[file?.currentSheetIndex];
this.currentStage = sheet?.stage;
},
methods:{
/**
@ -95,6 +99,18 @@ export default {
}
}
},
/**
* 设置缩放比率
*/
setRatio(ratio: number) {
if (ratio < this.min) {
ratio = this.min
} else if (ratio > this.max) {
ratio = this.max;
}
this.currentStage?.setStageRatio(ratio);
},
}
};
</script>

View File

@ -167,7 +167,7 @@ export default {
ok: this.changeMode,
}
},
{ type: 2, dy: -el.clientHeight }, el)
{ type: 2 }, el)
},
/**
* 改变模型颜色

View File

@ -12,104 +12,13 @@ export default defineComponent({
const options = markRaw({
config: {
width: 2000,
height:2000,
ratio: 1.5,
theme: "black",
EXT_STAGE_WIDTH:false,
GLOBAL_HELP_LINE_ENABLE:false,
GLOBAL_ALLOW_STAGE_RATIO:false,
GLOBAL_KEYBOARD_ALIGN_ENABLE:false,
GLOBAL_ALLOW_OPEN_MULT_LAYERS:false,
EVENT_CONTROL_SELECT_AFTER: function(){
console.log("select-after")
let rs = DDeiFuncCallResult
rs.state = 1;
return rs
}
},
//
extensions: [
//
DDeiCoreStandLayout.configuration({
//
'top': [DDeiCoreTopMenuPanel],
'middle': [DDeiCoreOpenFilesViewPanel.configuration({
drag: true
}), 'ddei-core-panel-canvasview', 'ddei-core-panel-quickcolorview'],
}),
//
DDeiCoreControls.configuration({
'100002': {
border: { color: 'red', width: 3 }
},
'100001': {
border: { color: 'yellow' }
}
}),
DDeiCoreThemeBlack.configuration({
default: true
}),
//
DDeiCoreHotkeys.configuration({
"ddei-core-keyaction-all-select": {
'keys': [
{ keys: "68" },
]
},
}),
//
DDeiKeyActionAllSelect.configuration({
'keys': [
{
ctrl: 1, keys: "66"
}
]
}),
// DDeiCoreBottomMenuPanel,
DDeiCoreBottomMenuPanel.configuration({
'panels': [DDeiCoreSheetsPanel.configuration({
max: 10
}), , DDeiCoreShapeCountPanel.configuration({
title: "图形数:"
}),
"ddei-core-panel-bottom-managelayers",
DDeiCoreChangeRatioPanel.configuration({
delta: 0.1, min: 1, max: 4, step: 0.2, dialog: true, range: false
})]
}),
DDeiCoreChangeRatioDialog.configuration({
dataSource: [
{ text: "200%", value: 2 },
{ text: "150%", value: 1.5 },
{ text: "125%", value: 1.25 },
{ text: "100%", value: 1 },
{ text: "75%", value: 0.75 },
{ text: "50%", value: 0.5 },
],
input: true,
min: 1, max: 4, title: "缩放比例"
}),
// DDeiCoreToolboxPanel.configuration({
// custom: false,
// search: false,
// // customGroups: [302, 301, 102, 101],
// expand: false
// }),
DDeiCorePropertyViewPanel.configuration({
expand: false
}),
//UML
DDeiExtUML,
//
DDeiExtQuickStyle
],
]
})
const options1 = markRaw({
config: {
@ -271,7 +180,7 @@ export default defineComponent({
<template>
<DDeiEditorView ref="editorViewer1" :options="{}" id="ddei_editor_1"></DDeiEditorView>
<DDeiEditorView ref="editorViewer1" :options="options" id="ddei_editor_1"></DDeiEditorView>
<DDeiEditorView ref="editorViewer2" :options="options1" id="ddei_editor_2"></DDeiEditorView>
<div style="width:400px;height:400px;float:left">
<DDeiEditorView ref="editorViewer3" :options="options2" id="ddei_editor_3"></DDeiEditorView>

View File

@ -8,6 +8,8 @@
.icon {
font-family: "iconfont" !important;
font-size: 26px;
width: 26px;
height: 26px;
color: #424242;
font-style: normal;
-webkit-font-smoothing: antialiased;

View File

@ -202,7 +202,7 @@ export default {
<style lang="less">
.ddei-editor {
position:sticky;
width: 100%;
height:100%;
overflow: auto;