缩略图生成问题

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

View File

@ -4,12 +4,12 @@
<div class="title">{{title}}</div> <div class="title">{{title}}</div>
<div class="group"> <div class="group">
<div class="group_content"> <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)"> :class="{ 'item': true, 'item_selected': ratioInputValue / 100 == data.value }" @click="ok(data.value)">
{{ data.text}} {{ data.text}}
</div> </div>
<div v-if="input" class="item" style="flex:1;border-top: 1px solid var(--panel-border)"> <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" />% autocomplete="off" name="ddei_bottom_input" />%
</div> </div>
</div> </div>
@ -66,6 +66,8 @@ export default {
return { return {
dialogId: 'ddei-core-dialog-changeratio', dialogId: 'ddei-core-dialog-changeratio',
ratioInputValue: 100, ratioInputValue: 100,
iMin:0.1,
iMax:10,
}; };
}, },
computed: {}, computed: {},
@ -74,12 +76,28 @@ export default {
created() { }, created() { },
mounted() { mounted() {
this.refreshData() this.refreshData()
}, },
methods: { methods: {
refreshData(){ refreshData(){
if (this.editor?.tempDialogData && this.editor?.tempDialogData[this.dialogId]) { 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> <use xlink:href="#icon-a-ziyuan466"></use>
</svg> </svg>
</div> </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" /> name="ddei-core-panel-bottom-changeratio__range" />
<div @click="addRatio(delta)"> <div @click="addRatio(delta)">
<svg class="icon" aria-hidden="true"> <svg class="icon" aria-hidden="true">
@ -64,10 +64,6 @@ export default {
type: Number, type: Number,
default: 4 default: 4
}, },
step: {
type: Number,
default: 0.1
},
dialog: { dialog: {
type: Boolean, type: Boolean,
default: true default: true
@ -122,6 +118,7 @@ export default {
}); });
}, },
mounted() { mounted() {
this.editor.ddInstance.ratioWatch = true
let file = this.editor?.files[this.editor?.currentFileIndex]; let file = this.editor?.files[this.editor?.currentFileIndex];
let sheet = file?.sheets[file?.currentSheetIndex]; let sheet = file?.sheets[file?.currentSheetIndex];
this.currentStage = sheet?.stage; this.currentStage = sheet?.stage;
@ -135,6 +132,8 @@ export default {
let srcElement = evt.currentTarget; let srcElement = evt.currentTarget;
DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changeratio", { DDeiEditorUtil.showOrCloseDialog(this.editor, "ddei-core-dialog-changeratio", {
ratio: this.currentStage?.ratio, ratio: this.currentStage?.ratio,
min:this.min,
max:this.max,
callback: { callback: {
ok: this.setRatio, ok: this.setRatio,
}, },

View File

@ -25,7 +25,8 @@
<use xlink:href="#icon-a-ziyuan422"></use> <use xlink:href="#icon-a-ziyuan422"></use>
</svg> </svg>
</div> </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> <use xlink:href="#icon-a-ziyuan376"></use>
</svg> </svg>
<div style="flex:1 1 1px"></div> <div style="flex:1 1 1px"></div>
@ -71,9 +72,9 @@ export default {
// //
expand: { expand: {
type: Boolean, type: Boolean,
default: true default: false
}, },
new: { create: {
type: Boolean, type: Boolean,
default: true default: true
}, },
@ -88,6 +89,10 @@ export default {
drag: { drag: {
type: Boolean, type: Boolean,
default: true default: true
},
max:{
type: Number,
default: 0
} }
, editor: { , editor: {
type: DDeiEditor, type: DDeiEditor,

View File

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

View File

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