缩略图生成问题

This commit is contained in:
猴赛雷 2024-05-17 16:53:48 +08:00
parent 1a4598fbef
commit d5859cb65b
7 changed files with 46 additions and 21 deletions

12
package-lock.json generated
View File

@ -1,15 +1,15 @@
{
"name": "ddei-editor",
"version": "1.2.11-12",
"version": "1.2.11-40",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ddei-editor",
"version": "1.2.11-12",
"version": "1.2.11-40",
"license": "Apache License 2.0",
"dependencies": {
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-8.tgz"
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-29.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-8",
"resolved": "file:../ddei-framework/ddei-framework-1.2.35-8.tgz",
"integrity": "sha512-MIvzLlyKZlb7+fjFdy3G5/g49pvzmLLw+aC4E4SXKG9vufBYV53bvgreaZQHDaXDEOUgrRH09Q2J8x0XBdG54Q==",
"version": "1.2.35-29",
"resolved": "file:../ddei-framework/ddei-framework-1.2.35-29.tgz",
"integrity": "sha512-TuGCqsXiToIohRTFUUQcedgzJYzRve8k+xs+MoIywt5nirZvYpfjgNeG++hgLKUwfAU66w3tBcGG/cmFLchSSg==",
"license": "Apache License 2.0",
"dependencies": {
"ddei-autolink": "^1.1.1",

View File

@ -1,6 +1,6 @@
{
"name": "ddei-editor",
"version": "1.2.11-19",
"version": "1.2.11-40",
"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-8.tgz"
"ddei-framework": "file:../ddei-framework/ddei-framework-1.2.35-29.tgz"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.0",

View File

@ -4,12 +4,12 @@
<div class="title">{{title}}</div>
<div class="group">
<div class="group_content">
<div v-for="data in dataSource" v-show="data?.value >=min && data?.value <=max"
<div v-for="data in dataSource" v-show="data?.value >= iMin && data?.value <=iMax"
:class="{ 'item': true, 'item_selected': ratioInputValue / 100 == data.value }" @click="ok(data.value)">
{{ data.text}}
</div>
<div v-if="input" class="item" style="flex:1;border-top: 1px solid var(--panel-border)">
百分比<input type="number" :min="min*100" :max="max*100" v-model="ratioInputValue" @blur="ratioInputChange()"
百分比<input type="number" :min="iMin*100" :max="iMax*100" v-model="ratioInputValue" @blur="ratioInputChange()"
autocomplete="off" name="ddei_bottom_input" />%
</div>
</div>
@ -66,6 +66,8 @@ export default {
return {
dialogId: 'ddei-core-dialog-changeratio',
ratioInputValue: 100,
iMin:0.1,
iMax:10,
};
},
computed: {},
@ -74,12 +76,28 @@ export default {
created() { },
mounted() {
this.refreshData()
},
methods: {
refreshData(){
if (this.editor?.tempDialogData && this.editor?.tempDialogData[this.dialogId]) {
this.ratioInputValue = this.editor?.tempDialogData[this.dialogId]?.ratio * 100
if (this.editor.tempDialogData[this.dialogId].min || this.editor.tempDialogData[this.dialogId].min == 0) {
this.iMin = this.editor.tempDialogData[this.dialogId].min;
} else if (this.min || this.min == 0){
this.iMin = this.min
}
if (this.editor.tempDialogData[this.dialogId].max || this.editor.tempDialogData[this.dialogId].max == 0) {
this.iMax = this.editor.tempDialogData[this.dialogId].max;
} else if (this.max || this.max == 0){
this.iMax = this.max
}
if (this.editor.tempDialogData[this.dialogId].ratio > this.iMax){
this.ratioInputValue = this.iMax * 100
} else if (this.editor.tempDialogData[this.dialogId].ratio < this.iMin) {
this.ratioInputValue = this.iMin * 100
}else{
this.ratioInputValue = this.editor.tempDialogData[this.dialogId].ratio * 100
}
}
},

View File

@ -27,7 +27,7 @@
<use xlink:href="#icon-a-ziyuan466"></use>
</svg>
</div>
<input v-show="range" type="range" :min="min" :max="max" :step="step" v-model="stageRatio" autocomplete="off"
<input v-show="range" type="range" :min="min" :max="max" :step="delta" v-model="stageRatio" autocomplete="off"
name="ddei-core-panel-bottom-changeratio__range" />
<div @click="addRatio(delta)">
<svg class="icon" aria-hidden="true">
@ -64,10 +64,6 @@ export default {
type: Number,
default: 4
},
step: {
type: Number,
default: 0.1
},
dialog: {
type: Boolean,
default: true
@ -122,6 +118,7 @@ export default {
});
},
mounted() {
this.editor.ddInstance.ratioWatch = true
let file = this.editor?.files[this.editor?.currentFileIndex];
let sheet = file?.sheets[file?.currentSheetIndex];
this.currentStage = sheet?.stage;
@ -135,6 +132,8 @@ export default {
let srcElement = evt.currentTarget;
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changeratio", {
ratio: this.currentStage?.ratio,
min:this.min,
max:this.max,
callback: {
ok: this.setRatio,
},

View File

@ -25,7 +25,8 @@
<use xlink:href="#icon-a-ziyuan422"></use>
</svg>
</div>
<svg class="icon addfile" aria-hidden="true" v-if="new" @click="newFile">
<svg class="icon addfile" aria-hidden="true" v-if="create && (!max || editor?.files?.length <= max)"
@click="newFile">
<use xlink:href="#icon-a-ziyuan376"></use>
</svg>
<div style="flex:1 1 1px"></div>
@ -71,9 +72,9 @@ export default {
//
expand: {
type: Boolean,
default: true
default: false
},
new: {
create: {
type: Boolean,
default: true
},
@ -88,6 +89,10 @@ export default {
drag: {
type: Boolean,
default: true
},
max:{
type: Number,
default: 0
}
, editor: {
type: DDeiEditor,

View File

@ -140,6 +140,7 @@ export default {
},
refreshData(){
this.editor.needControlIcon = true;
this.editor.toolBarViewer = this;
if (this.editor.ddInstance && !this.editor.ddInstance.render) {
this.editor.ddInstance.initRender()

View File

@ -97,7 +97,6 @@ export default {
//
this.editor.bindEvent();
this.editor.changeTheme('');
DDeiEditorUtil.getControlIcons(this.editor);
//
if (this.options?.config?.width) {
@ -143,6 +142,9 @@ export default {
if (!this.editor.setCurrentMenu) {
this.editor.setCurrentMenu = this.setCurrentMenu;
}
if(this.editor.needControlIcon){
DDeiEditorUtil.getControlIcons(this.editor);
}
},
methods: {