2023-10-27
上传模特截取模特图片大小功能
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="models_placement_content" @touchmove="startMove($event)">
|
||||
<div class="plcaement_point_content">
|
||||
<div class="plcaement_point_content" v-if="userInfo.userId == 88 || userInfo.userId == 83">
|
||||
<div class="placement_point_item" v-for="(point,index) in pointList" :key="index" >
|
||||
<div class="ponit_title">{{point.title}}</div>
|
||||
<div class="point_list">
|
||||
@@ -74,6 +74,7 @@
|
||||
import { defineComponent,ref,createVNode} from 'vue'
|
||||
import { Https } from "@/tool/https";
|
||||
import { useStore } from "vuex";
|
||||
import { getCookie } from "@/tool/cookie";
|
||||
import { Modal,message } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
export default defineComponent({
|
||||
@@ -88,6 +89,8 @@ export default defineComponent({
|
||||
let oldPointList:any = ref([]) //备份点
|
||||
let pointList:any = ref([])
|
||||
let isSubmit:any = ref(false) //判断历史是否有提交过
|
||||
let manager:any = ref(false)
|
||||
let userInfo:any = ref()
|
||||
return {
|
||||
store,
|
||||
oldLocationList,
|
||||
@@ -98,7 +101,9 @@ export default defineComponent({
|
||||
currentSign,
|
||||
oldPointList,
|
||||
pointList,
|
||||
isSubmit
|
||||
isSubmit,
|
||||
manager,
|
||||
userInfo
|
||||
}
|
||||
},
|
||||
data(){
|
||||
@@ -111,8 +116,18 @@ export default defineComponent({
|
||||
placement_sacle:30,
|
||||
perviewUrl:'',//预览的图片地址
|
||||
isShowMark:false,
|
||||
modelType:'Library',
|
||||
sex:'Male',
|
||||
sexList: [
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
let userInfo:any = getCookie("userInfo")
|
||||
this.userInfo = JSON.parse(userInfo);
|
||||
this.getSex()
|
||||
},
|
||||
methods:{
|
||||
formatter(value:number){
|
||||
return `${value}%`;
|
||||
@@ -136,7 +151,22 @@ export default defineComponent({
|
||||
this.getDefaultPointList(this.imgBox)
|
||||
},400)
|
||||
},
|
||||
|
||||
getSex(){
|
||||
Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'Sex'}}).then((rv: any) => {
|
||||
if (rv) {
|
||||
let arr:any = []
|
||||
rv.forEach((item:any) => {
|
||||
let obj = {
|
||||
value:item.name,
|
||||
label:item.name,
|
||||
}
|
||||
arr.push(obj)
|
||||
});
|
||||
this.sex = arr[0].value
|
||||
this.sexList = arr
|
||||
}
|
||||
})
|
||||
},
|
||||
//初始化可以使用的点位
|
||||
getDefaultPointList(imgBox:any){
|
||||
this.isSubmit = false
|
||||
@@ -324,9 +354,14 @@ export default defineComponent({
|
||||
let param = {
|
||||
libraryId:this.printObject.id,
|
||||
templateId:this.printObject.templateId || null,
|
||||
modelType:'Library',
|
||||
checkMd5:1,
|
||||
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
...this.getPrintLocation()
|
||||
}
|
||||
if(this.userInfo.userId == 88 || this.userInfo.userId == 83){
|
||||
param.modelType = this.modelType
|
||||
}
|
||||
this.isShowMark = true
|
||||
Https.axiosPost(Https.httpUrls.saveOrEditTemplatePoint, param).then(
|
||||
(rv: any) => {
|
||||
@@ -343,25 +378,59 @@ export default defineComponent({
|
||||
customRequest(){
|
||||
let new_data = {
|
||||
file:this.printObject.file,
|
||||
checkMd5:1,
|
||||
level1Type:'Models',
|
||||
sex:'',
|
||||
sex:this.sex,
|
||||
modelType:'',
|
||||
level2Type:'',
|
||||
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
}
|
||||
this.isShowMark = true
|
||||
if(this.userInfo.userId == 88 || this.userInfo.userId == 83){
|
||||
new_data.modelType = this.modelType
|
||||
new_data.sex = this.sex
|
||||
}
|
||||
return new Promise((resolve,reject)=>{
|
||||
Https.axiosPost(Https.httpUrls.libraryUpload, new_data,{headers:{'Content-Type': 'multipart/form-data'}}).then(
|
||||
(rv: any) => {
|
||||
resolve(rv)
|
||||
// resolve(rv)
|
||||
if(!rv.checkMd5){
|
||||
resolve(this.affirmCstomRequest(new_data))
|
||||
}else{
|
||||
resolve(rv)
|
||||
}
|
||||
}
|
||||
).catch((res)=>{
|
||||
reject(res)
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
affirmCstomRequest(data:any){
|
||||
let _this = this
|
||||
return new Promise((resolve,reject)=>{
|
||||
Modal.confirm({
|
||||
title: 'This picture has been uploaded whether to continue uploading? ',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
onOk() {
|
||||
data.checkMd5 = 0
|
||||
Https.axiosPost(Https.httpUrls.libraryUpload, data,{headers:{'Content-Type': 'multipart/form-data'}}).then(
|
||||
(rv: any) => {
|
||||
_this.isShowMark = false
|
||||
resolve(rv)
|
||||
}
|
||||
).catch((res)=>{
|
||||
reject(res)
|
||||
});
|
||||
},
|
||||
onCancel(){
|
||||
_this.isShowMark = false
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
getPrintLocation(){
|
||||
let {width , height} = this.imgBox
|
||||
|
||||
Reference in New Issue
Block a user