Commit 3409f5ee by zhuzhequan

处理胡总提出的问题

parent be4f635b
{
"apiApiHost":"https://factory.jomalls.com/api",
"fileApiUrl":"https://factory.jomalls.com/upload/factory",
"visionUrl":"https://console.jomalls.com"
"apiApiHost":"https://factory.jomalls.com/api",
"fileApiUrl":"https://factory.jomalls.com/upload/factory",
"visionUrl":"https://console.jomalls.com"
}
......@@ -13,7 +13,7 @@
>裁切</el-button
> -->
</div>
<el-scrollbar class="scrollbarBox">
<div class="scrollbarBox">
<slot v-if="$slots.mainContent" name="mainContent"></slot>
<!-- <el-checkbox-group
v-if="imglist.length"
......@@ -35,7 +35,7 @@
</el-checkbox></el-checkbox-group
> -->
<el-empty v-else :description="emptyTitle"></el-empty>
</el-scrollbar>
</div>
</div>
</template>
<script>
......@@ -63,6 +63,12 @@ export default {
};
</script>
<style lang="less" scoped>
.scrollbarBox{
overflow-x: auto;
overflow-y: hidden;
width: 100%;
white-space: nowrap;
}
.title {
padding: 10px;
font-size: 20px;
......@@ -70,9 +76,13 @@ export default {
}
.el-scrollbar {
overflow-y: hidden;
:v-deep.el-scrollbar__wrap {
margin-bottom: 0 !important;
}
//::v-deep .el-scrollbar__wrap {
// margin-bottom: 0 !important;
//}
//::v-deep .el-scrollbar__view {
// display: flex;
// flex-wrap: nowrap;
//}
}
::v-deep.el-empty {
padding-top: 0;
......
......@@ -375,12 +375,12 @@ export default {
w = this.numberToStr4(w);
h = this.numberToStr4(h);
console.log("print", w, h);
if (w > 4200 || h > 4700) {
return this.$message.warning(
"打印图片素材宽度不能超过410mm,长度不能超过450mm"
);
}
//
// if (w > 4200 || h > 4700) {
// return this.$message.warning(
// "打印图片素材宽度不能超过410mm,长度不能超过450mm"
// );
// }
r = Number(r).toFixed(0);
const imgFileName = this.imgList[0].fileName;
let position = ""; // 位置
......
......@@ -360,8 +360,9 @@ export default {
},
selectImg(it, i) {
if (this.isView) {
return;
this.isView = false
}
// this.selectImgIndexList.push(i)
let item = this.imgList.find((img) => img.fileName === it.fileName);
if (item) return;
......@@ -373,10 +374,11 @@ export default {
height: this.detail.mssHeight,
};
}
// this.selectImgIndexList = Array.from(new Set(this.selectImgIndexList))
this.getBackFile({ files: [it], size }, (file) => {
this.getBackFile({files:[it],size:this.detail.adjustable}, (file) => {
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
});
})
// this.selectImgIndexList = Array.from(new Set(this.selectImgIndexList))
// this.getBackFile({ files: [it], size });
},
ev(type) {
if (this.selectIndex < 0 && this.imgList.length) {
......@@ -546,14 +548,14 @@ export default {
let that = this;
let bw = document.getElementById("line");
bw = bw.clientWidth;
// bw = Number(bw.replace("px", ""));
this.isView =false
// bw = Number(bw.replsace("px", ""));
for (let i = 0; i < files.length; i++) {
files[i].url = files[i].productionFile || files[i].url;
that.$nextTick(async () => {
let w = bw / 2;
let width_px, height_px, rate, x, y;
if (size) {
if (size && !files[i].isCut) {
width_px = that.WHproportion * mmToPx(size.width);
height_px = that.WHproportion * mmToPx(size.height);
x = w * that.WHproportion;
......@@ -564,8 +566,8 @@ export default {
rate = data.height / data.width;
width_px = bw * (2 / 3);
x = w;
y = height_px / 2;
height_px = width_px * rate;
y = height_px / 2;
}
that.imgList = [];
......@@ -585,6 +587,9 @@ export default {
that.$nextTick(() => {
that.ev("center");
});
setTimeout(()=>{
that.ev("center");
},10000)
if (i === files.length - 1) {
callback && callback();
}
......@@ -696,22 +701,13 @@ export default {
// 图片导出为 png 格式
let imgType = "png";
let imgData = canvas.toDataURL(imgType);
callback && callback(imgData);
};
return img;
},
async cutImgFn() {
if (!this.checkList?.length) return;
if (this.detail.mssHeight && this.detail.mssWidth) {
return this.$confirm(`该生产单为直接打印单不可进行裁切!`, "提示", {
confirmButtonText: "确定",
showCancelButton: false,
type: "warning",
});
}
this.checkList = JSON.parse(JSON.stringify(this.selectImgList))
try {
const processQueue = await Promise.all(
this.checkList.map(async (el) => {
......@@ -742,6 +738,8 @@ export default {
this.selectImgList.forEach((el) => {
if (newMap.has(el.designId)) {
el.fileName = newMap.get(el.designId).fileName;
el.url = newMap.get(el.designId).productionFile;
el.isCut = true
el.productionFile = newMap.get(el.designId).productionFile;
}
});
......@@ -758,8 +756,7 @@ export default {
}
this.checkList = [];
this.selectImg(this.selectImgList[0]);
this.getBackFile({files:[this.selectImgList[0]]})
} catch (error) {
console.error("错误", error);
}
......@@ -774,8 +771,8 @@ export default {
// 确保点击的元素在包含 container 类名的元素内
if (currentElement.closest(".container")) {
// 如果点击的元素不是 boxShaow,执行方法
if (!currentElement.closest(".boxShaow") && !this.isView) {
this.isView = true;
if (!currentElement.closest(".boxShaow")) {
this.isView = !this.isView;
console.log(723, this.isView);
}
}
......@@ -991,6 +988,7 @@ export default {
>
<img width="150px" :src="img.url" />
</div>
</div>
</template>
</PicScrollbarBox>
......@@ -1005,25 +1003,10 @@ export default {
>
</template>
<template #mainContent>
<el-checkbox-group
v-if="selectImgList.length"
v-model="checkList"
style="display: flex;flex-wrap:nowrap;width: 100%;"
>
<el-checkbox
v-for="img in selectImgList"
:key="img.designId"
:class="{
imgchecked: checkList.includes(img),
}"
:label="img"
>
<div class="img-item" @click.stop.prevent="selectImg(img)">
<img style="width:100%" :src="img.productionFile" />
<!-- <span>{{ img.designId }}</span> -->
</div>
</el-checkbox></el-checkbox-group
>
<div v-for="(img,i) in selectImgList" class="img-item" @click.stop.prevent="selectImg(img)">
<img :key="i" style="width:100%" :src="img.productionFile" />
<!-- <span>{{ img.designId }}</span> -->
</div>
</template>
</PicScrollbarBox>
<!-- <div>
......@@ -1161,7 +1144,7 @@ export default {
class="main-bg"
:style="{ 'background-color': !isView ? '#77797a' : '#fff' }"
>
<div class="container">
<div class="container">
<div style="width: 100%;height: 100%; ">
<div v-if="isView" id="img">
<div
......@@ -1190,6 +1173,7 @@ export default {
:angle="item.r / WHproportion"
style="pointer-events: auto;cursor: default"
>
<div
ref="sucaitu-img"
:style="{ zIndex: item.zIndex }"
......@@ -1345,7 +1329,7 @@ export default {
position: absolute;
bottom: 16px;
font-size: 24px;
left: 20%;
left: 25%;
}
.page-main {
display: flex;
......@@ -1369,7 +1353,6 @@ export default {
// z-index: 2;
left: 5%;
top: 50%;
transform: translate(0, -50%);
background-color: #f0f2f6;
}
......@@ -1426,6 +1409,7 @@ export default {
justify-content: center;
// width: auto;
position: absolute;
z-index: 2;
left: 5%;
img {
pointer-events: none;
......@@ -1509,15 +1493,21 @@ img {
.img-item {
// height: 150px;
width: 200px;
max-height: 200px;
overflow: hidden;
padding: 5px;
display: flex;
box-sizing: border-box;
background: #ececec;
display: inline-block;
cursor: pointer;
// margin-bottom: 20px;
border: 2px dashed transparent;
flex-direction: column;
align-items: center;
justify-content: center;
margin-right: 5px;
box-sizing: border-box;
img{
width: 100%;
height: auto;
}
span {
font-size: 14px;
// margin: 5px 0;
......@@ -1623,7 +1613,7 @@ img {
display: flex;
flex: 50%;
font-size: 12px;
margin-bottom: 10px;
margin-bottom: 6px;
.item-label {
flex: 1;
text-align: right;
......@@ -1668,11 +1658,16 @@ img {
.active::before {
display: none;
}
::v-deep .drr:hover:before {
outline: none;
}
//::v-deep .drr:hover:before {
// outline: none;
//}
}
// ::v-deep.el-table thead {
// color: black;
// }
.fixed-border{
position: fixed;
z-index: 69;
}
</style>
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