Commit 11276510 by linjinhong

图片编辑title添加单位以及添加打印时尺寸提示

parent 37efd092
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "JomallProductionAssistant", "name": "JomallProductionAssistant",
"productName": "JomallProductionAssistant", "productName": "JomallProductionAssistant",
"description": "", "description": "",
"version": "1.0.7", "version": "1.0.8",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
......
...@@ -370,7 +370,13 @@ export default { ...@@ -370,7 +370,13 @@ export default {
y = this.numberToStr4(y); y = this.numberToStr4(y);
w = this.numberToStr4(w); w = this.numberToStr4(w);
h = this.numberToStr4(h); h = this.numberToStr4(h);
console.log("print", x, y, w, h); console.log("print", w, h);
if (w > 4100 || h > 4500) {
return this.$message.warning(
"打印图片素材宽度不能超过410mm,长度不能超过450mm"
);
}
// console.log(x, "x"); // console.log(x, "x");
// console.log(y, "y"); // console.log(y, "y");
......
...@@ -16,27 +16,27 @@ export default { ...@@ -16,27 +16,27 @@ export default {
y: 0, y: 0,
w: 0, w: 0,
h: 0, h: 0,
r: 0 r: 0,
} },
}; };
}, },
props: { props: {
visible: { visible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
item: { item: {
type: Object, type: Object,
default: () => {} default: () => {},
} },
}, },
watch: { watch: {
visible: { visible: {
handler() { handler() {
this.drawerShow = this.visible; this.drawerShow = this.visible;
}, },
immediate: true immediate: true,
}, },
item: { item: {
handler() { handler() {
...@@ -71,8 +71,8 @@ export default { ...@@ -71,8 +71,8 @@ export default {
} }
}, },
immediate: true, immediate: true,
deep: true deep: true,
} },
}, },
methods: { methods: {
pxToUnit, pxToUnit,
...@@ -80,13 +80,12 @@ export default { ...@@ -80,13 +80,12 @@ export default {
formChange(t) { formChange(t) {
if (t && t === "w") { if (t && t === "w") {
this.form.h = this.form.w * this.form.rate; this.form.h = this.form.w * this.form.rate;
} }
if (t && t === "h") { if (t && t === "h") {
this.form.w = this.form.h * this.form.rate; this.form.w = this.form.h * this.form.rate;
} }
this.form.h = this.form.h? Math.abs(this.form.h):this.form.h this.form.h = this.form.h ? Math.abs(this.form.h) : this.form.h;
this.form.w = this.form.w? Math.abs(this.form.w):this.form.w this.form.w = this.form.w ? Math.abs(this.form.w) : this.form.w;
let f = JSON.parse(JSON.stringify(this.form)); let f = JSON.parse(JSON.stringify(this.form));
f.y = Number(f.y) + Number(f.h) / 2; f.y = Number(f.y) + Number(f.h) / 2;
f.x = Number(f.x) + Number(f.w) / 2; f.x = Number(f.x) + Number(f.w) / 2;
...@@ -125,15 +124,15 @@ export default { ...@@ -125,15 +124,15 @@ export default {
this.form.w = this.form.h * this.form.rate; this.form.w = this.form.h * this.form.rate;
} }
this.formChange(); this.formChange();
} },
} },
}; };
</script> </script>
<template> <template>
<div class="drawer" :style="{ animation: `ltr-drawer-in .3s 1ms` }"> <div class="drawer" :style="{ animation: `ltr-drawer-in .3s 1ms` }">
<div class="title"> <div class="title">
图片编辑 图片编辑(单位:{{ $dataStore.get("setting").unit }}
</div> </div>
<div class="img-form"> <div class="img-form">
<el-form <el-form
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment