fix: 截图
This commit is contained in:
@@ -24,7 +24,8 @@
|
|||||||
<div v-for="(row, index) in rows" :key="index" class="page-item">
|
<div v-for="(row, index) in rows" :key="index" class="page-item">
|
||||||
<div v-if="row" class="page-item-content">
|
<div v-if="row" class="page-item-content">
|
||||||
<div class="page-item-logo">
|
<div class="page-item-logo">
|
||||||
<img v-if="row.cover" :src="row.cover" alt="">
|
<span v-if="!row.cover">暂无图片</span>
|
||||||
|
<img v-else :src="row.cover" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="page-item-title">
|
<div class="page-item-title">
|
||||||
<div class="pit-row" style="color: #262626;">
|
<div class="pit-row" style="color: #262626;">
|
||||||
@@ -179,9 +180,15 @@ watch(
|
|||||||
}
|
}
|
||||||
.page-item-logo{
|
.page-item-logo{
|
||||||
flex: 10;
|
flex: 10;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
span{
|
||||||
|
display: block;
|
||||||
|
margin-top: 3vw;
|
||||||
|
}
|
||||||
img{
|
img{
|
||||||
max-width: 100%;
|
width: 100%;
|
||||||
max-height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.page-item-title{
|
.page-item-title{
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
<div v-for="(row, index) in rows" :key="index" class="page-item">
|
<div v-for="(row, index) in rows" :key="index" class="page-item">
|
||||||
<div v-if="rows[index]" class="page-item-content">
|
<div v-if="rows[index]" class="page-item-content">
|
||||||
<div class="page-item-logo">
|
<div class="page-item-logo">
|
||||||
|
<span v-if="!row.cover">暂无图片</span>
|
||||||
|
<img v-else :src="row.cover" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="page-item-title">
|
<div class="page-item-title">
|
||||||
<div class="pit-row" style="color: #262626;">
|
<div class="pit-row" style="color: #262626;">
|
||||||
@@ -236,6 +238,16 @@ watch(
|
|||||||
}
|
}
|
||||||
.page-item-logo{
|
.page-item-logo{
|
||||||
flex: 10;
|
flex: 10;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
span{
|
||||||
|
display: block;
|
||||||
|
margin-top: 3vw;
|
||||||
|
}
|
||||||
|
img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.page-item-title{
|
.page-item-title{
|
||||||
flex: 5;
|
flex: 5;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
支持上传glb格式的模型,模型素材包小于500M,建议上传10M以内素材包效果更佳
|
支持上传glb格式的模型,模型素材包小于500M,建议上传10M以内素材包效果更佳
|
||||||
</p>
|
</p>
|
||||||
</a-upload-dragger>
|
</a-upload-dragger>
|
||||||
|
<WareViewer ref="viewerRef" :model="model" style="width: 100%; height: 300px"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item v-if="[THREE_D_TYPE.RING_3D].includes(formData.type)" label="上传图片" style="padding-right: 10%;">
|
<a-form-item v-if="[THREE_D_TYPE.RING_3D].includes(formData.type)" label="上传图片" style="padding-right: 10%;">
|
||||||
@@ -65,6 +66,7 @@ const { ref, reactive }=require("@vue/reactivity");
|
|||||||
import common from "@/api/common.js";
|
import common from "@/api/common.js";
|
||||||
import { createMaterialLibrary } from "../api";
|
import { createMaterialLibrary } from "../api";
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
import WareViewer from "@/views/planetDesign/Design/components/config/Viewer3D/WareViewer.vue";
|
||||||
|
|
||||||
const emit = defineEmits(["complete"]);
|
const emit = defineEmits(["complete"]);
|
||||||
|
|
||||||
@@ -100,6 +102,11 @@ const show = (type) => {
|
|||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const model = ref(null);
|
||||||
|
|
||||||
|
const viewerRef = ref();
|
||||||
|
|
||||||
const onCustomRequest = async (upload) => {
|
const onCustomRequest = async (upload) => {
|
||||||
|
|
||||||
if(formData.value.type == THREE_D_TYPE.SHELF) {
|
if(formData.value.type == THREE_D_TYPE.SHELF) {
|
||||||
@@ -118,10 +125,34 @@ const onCustomRequest = async (upload) => {
|
|||||||
|
|
||||||
const data = await common.cosUpload3D(upload.file);
|
const data = await common.cosUpload3D(upload.file);
|
||||||
upload.onSuccess(data);
|
upload.onSuccess(data);
|
||||||
|
|
||||||
|
if([THREE_D_TYPE.ENV_3D, THREE_D_TYPE.SHELF, THREE_D_TYPE.EXHIBITION_BOOTH, THREE_D_TYPE.WARE].includes(formData.value.type)){
|
||||||
|
|
||||||
|
let reader = new FileReader();
|
||||||
|
reader.addEventListener(
|
||||||
|
"load",
|
||||||
|
(e) => {
|
||||||
|
model.value = {
|
||||||
|
file: {},
|
||||||
|
result: e.target.result,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
reader.readAsArrayBuffer(upload.file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ok = async () => {
|
const ok = async () => {
|
||||||
if(step.value >= 1) {
|
if(step.value >= 1) {
|
||||||
|
|
||||||
|
if([THREE_D_TYPE.ENV_3D, THREE_D_TYPE.SHELF, THREE_D_TYPE.EXHIBITION_BOOTH, THREE_D_TYPE.WARE].includes(formData.value.type)){
|
||||||
|
var blob = await viewerRef.value.snapshot();
|
||||||
|
const data = await common.cosUpload(blob, blob.name, "", () => {});
|
||||||
|
formData.value.cover = data.url;
|
||||||
|
}
|
||||||
|
|
||||||
const data = JSON.parse(JSON.stringify(formData.value));
|
const data = JSON.parse(JSON.stringify(formData.value));
|
||||||
await createMaterialLibrary(buildData(data));
|
await createMaterialLibrary(buildData(data));
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user