This commit is contained in:
wxd
2024-10-02 11:33:14 +08:00
parent 708028c02f
commit 0a273a24dc
10 changed files with 60 additions and 42 deletions

View File

@@ -33,10 +33,11 @@
</div>
</div>
</div>
<div class="plcaement_point_content" v-if="userInfo.userId == 88 || userInfo.userId == 833">
<div class="plcaement_point_content" v-if="userInfo.userId == 88 || userInfo.userId == 83">
<div style="display: flex; align-items: center;">
<div style="display: flex; align-items: center;">
<input type="checkbox" model="false" @click="()=>{modelType = 'System'}">
{{ modelType }}
{{ $t('ModelPlacement.System') }}
</div>
<div style="display: flex; align-items: center;">
@@ -584,7 +585,7 @@ export default defineComponent({
// })
let cropper:any = this.$refs.cropper,
that = this
if((this.modelType == 'System' && this.userInfo.userId == 88) || (this.modelType == 'System' &&this.userInfo.userId == 833)){
if((this.modelType == 'System' && this.userInfo.userId == 88) || (this.modelType == 'System' &&this.userInfo.userId == 83)){
if(this.printObject.templateId){
this.printObject.id = this.printObject.relationId
this.confrimSubmit()
@@ -625,18 +626,19 @@ export default defineComponent({
cropper.changeScale(num);
},
async confrimSubmit(){
let modelType = 'Library'
if(this.userInfo.userId == 88 || this.userInfo.userId == 83){
modelType = this.modelType
}
let param = {
libraryId:this.printObject.id,
templateId:this.printObject.templateId || null,
modelType:'Library',
modelType:modelType,
modelSex:this.sex,
checkMd5:1,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
...await this.getPrintLocation()
}
if(this.userInfo.userId == 88 || this.userInfo.userId == 833){
param.modelType = this.modelType
}
this.isShowMark = true
Https.axiosPost(Https.httpUrls.saveOrEditTemplatePoint, param).then(
@@ -652,19 +654,19 @@ export default defineComponent({
},
customRequest(){
let modelType = 'Library'
if(this.userInfo.userId == 88 || this.userInfo.userId == 83){
modelType = this.modelType
}
let new_data = {
file:this.printObject.file,
level1Type:'Models',
level2Type:'',
checkMd5:1,
sex:this.sex,
modelType:'Library',
modelType:modelType,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
}
if(this.userInfo.userId == 88 || this.userInfo.userId == 833){
new_data.modelType = this.modelType
// new_data.sex = this.sex
}
this.isShowMark = true
return new Promise((resolve,reject)=>{
Https.axiosPost(Https.httpUrls.libraryUpload, new_data,{headers:{'Content-Type': 'multipart/form-data'}}).then(
@@ -710,20 +712,22 @@ export default defineComponent({
},
async getPrintLocation(){
let {width , height} = this.imgBox
if(this.modelType == 'System'){
await new Promise((resolve, reject) => {
let img = new Image()
img.src = this.option.img
img.onload = () => {
width = img.width
height = img.height
resolve(true)
}
})
}
// if(this.modelType == 'System'){
// await new Promise((resolve, reject) => {
// let img = new Image()
// img.src = this.option.img
// img.onload = () => {
// width = img.width
// height = img.height
// resolve(true)
// }
// })
// }
let locationData:any = {}
let returnData:any = {}
let newLocationList = JSON.parse(JSON.stringify(this.locationList))
//进行字段归类
for(let item of newLocationList){
locationData[item.field] = locationData[item.field] || []