修改标签名字自动获取焦点
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<div class="icon iconfont icon-fanhui1 operate_icon"></div>
|
||||
<div class="operate_item_des">{{ $t('ModelPlacement.Back') }}</div>
|
||||
</div>
|
||||
<div class="operate_item" @click="restoreLocationList">
|
||||
<div class="operate_item" v-show="!perviewUrl" @click="restoreLocationList">
|
||||
<div class="icon iconfont icon-huifu operate_icon"></div>
|
||||
<div class="operate_item_des">{{ $t('ModelPlacement.Restore') }}</div>
|
||||
</div>
|
||||
@@ -72,12 +72,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="placement_content_operate_list">
|
||||
<!-- <div class="placement_content_operate_list">
|
||||
<div class="placement_content_operate_item" @click="changeRemoveStatus">
|
||||
<div class="placement_remove_point_block"></div>
|
||||
<div class="placement_content_operate_des">{{ $t('ModelPlacement.RemovePoint') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="placement_tip_content">{{ $t('ModelPlacement.mannequinHint') }}</div>
|
||||
|
||||
@@ -277,20 +277,27 @@ export default defineComponent({
|
||||
},
|
||||
setCropperWH(){
|
||||
let cropper:any = this.$refs.cropper
|
||||
if(cropper.h != cropper.cropH){
|
||||
if(cropper.h != cropper.cropH && this.locationList.length < 6){
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
return
|
||||
}else if(cropper.h == cropper.cropH){
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
}
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
|
||||
},
|
||||
realTime(data:any) {
|
||||
clearTimeout(this.cropperTime)
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
this.setImageSize()
|
||||
},100)
|
||||
let cropper:any = this.$refs.cropper
|
||||
// if(cropper.h == cropper.cropH){
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
this.setImageSize()
|
||||
clearTimeout(this.cropperTime)
|
||||
|
||||
},100)
|
||||
// }
|
||||
|
||||
|
||||
},
|
||||
setImageSize(){
|
||||
@@ -544,6 +551,7 @@ export default defineComponent({
|
||||
this.locationList = []
|
||||
this.pointList = JSON.parse(JSON.stringify(this.oldPointList))
|
||||
this.locationList = JSON.parse(JSON.stringify(this.oldLocationList))
|
||||
// this.locationList = JSON.parse(JSON.stringify(this.locationList))
|
||||
},
|
||||
|
||||
submitPlacement(){
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="icon iconfont icon-fanhui1 operate_icon"></div>
|
||||
<div class="operate_item_des">{{ $t('ModelPlacement.Back') }}</div>
|
||||
</div>
|
||||
<div class="operate_item" @click="restoreLocationList">
|
||||
<div class="operate_item" v-show="!perviewUrl" @click="restoreLocationList">
|
||||
<div class="icon iconfont icon-huifu operate_icon"></div>
|
||||
<div class="operate_item_des">{{ $t('ModelPlacement.Restore') }}</div>
|
||||
</div>
|
||||
@@ -72,12 +72,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="placement_content_operate_list">
|
||||
<!-- <div class="placement_content_operate_list">
|
||||
<div class="placement_content_operate_item" @click="changeRemoveStatus">
|
||||
<div class="placement_remove_point_block"></div>
|
||||
<div class="placement_content_operate_des">{{ $t('ModelPlacement.RemovePoint') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="placement_tip_content">{{ $t('ModelPlacement.mannequinHint') }}</div>
|
||||
|
||||
@@ -277,19 +277,20 @@ export default defineComponent({
|
||||
},
|
||||
setCropperWH(){
|
||||
let cropper:any = this.$refs.cropper
|
||||
if(cropper.h != cropper.cropH){
|
||||
if(cropper.h != cropper.cropH && this.locationList.length < 6){
|
||||
this.getDefaultPointList(this.imgBox,' ')
|
||||
return
|
||||
}else if(cropper.h == cropper.cropH){
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
}
|
||||
cropper.cropH = cropper.scale*cropper.trueHeight
|
||||
cropper.cropW = cropper.cropH/2.125
|
||||
cropper.cropOffsertX = cropper.getImgAxis().x1+(cropper.scale*cropper.trueWidth/2-cropper.cropW/2)
|
||||
cropper.cropOffsertY = cropper.getImgAxis().y1
|
||||
},
|
||||
realTime(data:any) {
|
||||
clearTimeout(this.cropperTime)
|
||||
this.cropperTime = setTimeout(()=>{
|
||||
this.setImageSize()
|
||||
clearTimeout(this.cropperTime)
|
||||
},100)
|
||||
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="setLabel_text" :class="{active:optionsItem.checkAll}">
|
||||
<a-checkbox v-model:checked="optionsItem.checkAll" @change="onCheckAllChange(optionsItem)"></a-checkbox>
|
||||
<span v-show="!optionsItem.openType" :title="optionsItem.classificationName">{{ optionsItem.classificationName }}</span>
|
||||
<input v-show="optionsItem.openType" type="text" v-model="itemName" @keydown.enter="putName(optionsIndex,'affirm',optionsItem)">
|
||||
<input v-show="optionsItem.openType" type="text" class="inputName" v-model="itemName" @keydown.enter="putName(optionsIndex,'affirm',optionsItem)">
|
||||
<i v-show="optionsItem.openType" @click.stop="putName(optionsIndex,'affirm',optionsItem)" class="fi fi-br-check"></i>
|
||||
<i v-show="!optionsItem.openType" @click.stop="putName(optionsIndex,'put',optionsItem)" class="fi fi-rr-edit"></i>
|
||||
</div>
|
||||
@@ -24,12 +24,12 @@
|
||||
<li class="childrenItem_title setLabel_text" v-for="childrenItem,childrenIndex in optionsItem.childList" :class="{active:childrenItem.checkAll}" :key="childrenItem.id">
|
||||
<a-checkbox v-model:checked="childrenItem.checkAll" @change="onCheckAllchildrenItem(optionsItem)"></a-checkbox>
|
||||
<span v-show="!childrenItem.openType" :title="childrenItem.classificationName">{{ childrenItem.classificationName }}</span>
|
||||
<input v-show="childrenItem.openType" type="text" v-model="itemName" @keydown.enter="putName(childrenIndex,'affirm',childrenItem)">
|
||||
<input v-show="childrenItem.openType" type="text" class="inputName" v-model="itemName" @keydown.enter="putName(childrenIndex,'affirm',childrenItem)">
|
||||
<i v-show="childrenItem.openType" @click.stop="putName(childrenIndex,'affirm',childrenItem)" class="fi fi-br-check"></i>
|
||||
<i v-show="!childrenItem.openType" @click.stop="putName(childrenIndex,'put',childrenItem)" class="fi fi-rr-edit"></i>
|
||||
</li>
|
||||
<li class="newLabel setLabel_text">
|
||||
<input v-show="optionsItem.addOpenType" type="text" v-model="itemName" @keydown.enter="putName(-1,'affirm',optionsItem)">
|
||||
<input v-show="optionsItem.addOpenType" type="text" class="inputName" v-model="itemName" @keydown.enter="putName(-1,'affirm',optionsItem)">
|
||||
<i @click.stop="putName(-1,'affirm',optionsItem)" v-show="optionsItem.addOpenType" class="fi fi-br-check"></i>
|
||||
<div class="addLabel" v-show="!optionsItem.addOpenType" @click="newLabel(optionsItem,optionsItem.id)">+</div>
|
||||
</li>
|
||||
@@ -37,7 +37,7 @@
|
||||
</li>
|
||||
<li class="newLabel setLabel_text optionsItem_title">
|
||||
<div>
|
||||
<input v-show="openType" type="text" v-model="itemName" @keydown.enter="putName(-1,'affirm','')">
|
||||
<input v-show="openType" type="text" class="inputName" v-model="itemName" @keydown.enter="putName(-1,'affirm','')">
|
||||
<i @click.stop="putName(-1,'affirm','')" v-show="openType" class="fi fi-br-check"></i>
|
||||
<div class="addLabel" v-show="!openType" @click="newLabel('','')">+</div>
|
||||
</div>
|
||||
@@ -91,6 +91,7 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.clearOpenType()
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -172,7 +173,7 @@ export default defineComponent({
|
||||
},
|
||||
putName(index:number,v:string,item:any){
|
||||
let e:any = window.event
|
||||
e.target.parentNode.
|
||||
let input = e.target.parentNode.querySelectorAll('.inputName')[0]
|
||||
let data:any
|
||||
if(v == 'put'){
|
||||
this.clearOpenType()
|
||||
@@ -181,6 +182,9 @@ export default defineComponent({
|
||||
this.itemName = item.classificationName
|
||||
// this.options[index].openType = true
|
||||
// this.itemName = this.workspace.workspaceList[index].workSpaceName
|
||||
nextTick().then(()=>{
|
||||
input.focus()
|
||||
})
|
||||
}else if(v == 'affirm'){
|
||||
if(index == -1){
|
||||
if(this.itemName == ''){
|
||||
@@ -217,12 +221,16 @@ export default defineComponent({
|
||||
newLabel(item:any,id:any){
|
||||
this.itemName = ''
|
||||
this.clearOpenType()
|
||||
|
||||
let e:any = window.event
|
||||
let input = e.target.parentNode.querySelectorAll('.inputName')[0]
|
||||
if(item){
|
||||
item.addOpenType = true
|
||||
}else{
|
||||
this.openType = true
|
||||
}
|
||||
nextTick().then(()=>{
|
||||
input.focus()
|
||||
})
|
||||
},
|
||||
removeLabel(val:any){
|
||||
let data = {
|
||||
|
||||
Reference in New Issue
Block a user