新增衣服设置优先级,相同衣服id导致优先级相同问题

This commit is contained in:
X1627315083
2023-12-21 17:26:49 +08:00
parent b06ea39f03
commit 70e2fe094b
16 changed files with 99 additions and 60 deletions

View File

@@ -221,6 +221,9 @@ li {
.delete_like_file_block.left {
left: 0rem;
}
.progress_mark .mark_content .ant-progress .ant-progress-text .anticon-check {
color: #7a61dc;
}
.el-popper .el-cascader-panel {
--el-cascader-menu-selected-text-color: #000;
}

View File

@@ -247,6 +247,20 @@ ul,li{
}
}
//design进度100
.progress_mark{
.mark_content{
.ant-progress{
.ant-progress-text{
.anticon-check{
color: #7a61dc;
}
}
}
}
}
.el-popper{
.el-cascader-panel{
--el-cascader-menu-selected-text-color: #000;

View File

@@ -384,24 +384,26 @@ export default defineComponent({
let num = 10
arr.forEach((item)=>{
item.priority = num++
item.similarity = false//新增衣服传的是衣服id会存在两件衣服id相同所以设置为false让每次赋值都是不一样的
})
data.designSingleItemDTOList.forEach((item)=>{
let front = arr
let imageCategory1 = arr[1].imageCategory
arr.forEach((i)=>{
let imageCategory = i.imageCategory.split('_')[0]
if(item.id == i.id){
let y = ((i?.style?.top.replace(/px/g,'')*ratio).toFixed(0) - i?.position[0])
let x = ((i?.style?.left.replace(/px/g,'')*ratio).toFixed(0) - i?.position[1])
let scale = i?.imageSize?Number(((i?.style?.width.replace(/px/g,'')*ratio)/(i?.imageSize[0]/i.scale)).toFixed(2)):1
for (let index = 0; index < arr.length; index++) {
if(item.id == arr[index].id && !arr[index].similarity){
let y = ((arr[index]?.style?.top.replace(/px/g,'')*ratio).toFixed(0) - arr[index]?.position[0])
let x = ((arr[index]?.style?.left.replace(/px/g,'')*ratio).toFixed(0) - arr[index]?.position[1])
let scale = arr[index]?.imageSize?Number(((arr[index]?.style?.width.replace(/px/g,'')*ratio)/(arr[index]?.imageSize[0]/arr[index].scale)).toFixed(2)):1
item.scale = scale
let top = y == 0 ? item.offset[1]:y+item.offset[1]
let left = x == 0 ? item.offset[0]:x+item.offset[0]
item.offset = [left,top]
item.priority = i.priority
// item.offset = [(i?.style?.left.replace(/px/g,'')*ratio).toFixed(0),(i?.style?.top.replace(/px/g,'')*ratio).toFixed(0)]
item.priority = arr[index].priority
arr[index].similarity = true
// item.offset = [(arr[index]?.style?.left.replace(/px/g,'')*ratio).toFixed(0),(i?.style?.top.replace(/px/g,'')*ratio).toFixed(0)]
break
}
})
}
if(item.type == this.capitalizeFirstLetter(imageCategory1)){
item.scale = front?.imageSize?Number(((front?.style?.width.replace(/px/g,'')*ratio)/front?.imageSize[0]).toFixed(2)):1
}

View File

@@ -337,19 +337,19 @@ export default defineComponent({
let isTest = getCookie('isTest')
// console.log(getCookie("token"));
if(JSON.parse(isTest)){
Https.axiosGet(Https.httpUrls.trialUserLogout,).then((rv) => {
await Https.axiosGet(Https.httpUrls.trialUserLogout,).then((rv) => {
Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
this.$router.replace("/login");
WriteCookie("token");
});
})
}else{
Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
await Https.axiosPost(Https.httpUrls.accountLogout, data).then((rv) => {
this.$router.replace("/login");
WriteCookie("token");
});
}
window.location.reload()
},

View File

@@ -313,6 +313,8 @@ export default defineComponent({
color: rgba(0,0,0,.65);
z-index: 2;
align-items: center;
width: 35rem;
justify-content: space-between;
.collection_progress{
width: 8rem;
height: 8rem;
@@ -326,7 +328,7 @@ export default defineComponent({
}
}
.collection_title_text{
margin-right: 4rem;
// margin-right: 4rem;
}
.collection_title_text_intro{
font-size: var(--aida-fsize1-4);

View File

@@ -39,7 +39,7 @@
<div>
<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 class="addLabel" v-show="!openType" @click.stop="newLabel('','')">+</div>
</div>
<div class="started_btn" @click="removeLabel(options)">Delete</div>
</li>
@@ -160,6 +160,7 @@ export default defineComponent({
}
},
clearOpenType(){
this.openType = false
this.options.forEach((optionsItem:any) => {
optionsItem.openType = false
optionsItem.addOpenType = false
@@ -169,7 +170,6 @@ export default defineComponent({
});
}
});
this.openType = false
},
putName(index:number,v:string,item:any){
let e:any = window.event
@@ -186,12 +186,11 @@ export default defineComponent({
input.focus()
})
}else if(v == 'affirm'){
if(index == -1){
if(this.itemName == ''){
message.warning(this.t('setLabel.jsContent1'));
return
}else{
if(this.itemName == ''){
message.warning(this.t('setLabel.jsContent1'));
return
}else{
if(index == -1){
if(item){
item.addOpenType = false
data = {
@@ -205,15 +204,17 @@ export default defineComponent({
parentId:''
}
}
}else{
data = {
id:item.id,
classificationName:this.itemName,
}
item.classificationName = this.itemName
item.openType = false
}
}else{
data = {
id:item.id,
classificationName:this.itemName,
}
item.classificationName = this.itemName
item.openType = false
}
this.addLabel(data)
document.removeEventListener('click',this.clearOpenType)
}
@@ -372,7 +373,8 @@ export default defineComponent({
flex-direction: row;
align-items: center;
padding: .5rem 1rem;
width: 16rem;
// width: 16rem;
width: auto;
margin: 2rem 1rem;
border-radius: 1rem;
justify-content: space-between;
@@ -384,11 +386,19 @@ export default defineComponent({
display: flex;
}
>span{
max-width: 60%;
// max-width: 60%;
margin: 0 2rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
div.setLabel_text{
>input{
margin: 0 2rem;
width: 14rem;
}
}
}
@@ -434,6 +444,7 @@ export default defineComponent({
background: #f0f0f0;
// background: #d5d5d5;
font-size: 1.4rem;
width: 16rem;
label{
transform: scale(.8);
@@ -490,6 +501,7 @@ export default defineComponent({
.newLabel{
text-align: center;
justify-content: center;
width: 16rem;
&.optionsItem_title{
width: 100%;
margin: 0;

View File

@@ -80,7 +80,7 @@ export default {
Name:'名字:',
inputContent3:'输入生成图片的标题',
Cancel:'取消',
Sure:'确定',
Sure:'保存',
Moodboard:'情绪板',
Prints:'印花',
Sketches:'服装',

View File

@@ -80,7 +80,7 @@ export default {
Name:'Name:',
inputContent3:'Enter a new name',
Cancel:'Cancel',
Sure:'Sure',
Sure:'Submit',
Moodboard:'Moodboard',
Prints:'Prints',
Sketches:'Sketches',

View File

@@ -81,7 +81,7 @@ export default {
Name:'Nom:',
inputContent3:'Saisie rapide',
Cancel:'Annuler',
Sure:'Bien sûr',
Sure:'Soumettre',
Moodboard:"Conseil d'humeur",
Prints:'Impressions',
Sketches:'Croquis',

View File

@@ -80,7 +80,7 @@ export default {
Name:'Nome:',
inputContent3:'Immissione rapida',
Cancel:'Annulla',
Sure:'Sicuro',
Sure:'Invia',
Moodboard:"Tavola d'atmosfera",
Prints:'Stampe',
Sketches:'Schizzi',

View File

@@ -80,7 +80,7 @@ export default {
Name:'名前:',
inputContent3:'プロンプト入力',
Cancel:'キャンセル',
Sure:'もちろん',
Sure:'提出す',
Moodboard:'ムードボード',
Prints:'プリント',
Sketches:'スケッチ',

View File

@@ -80,7 +80,7 @@ export default {
Name:'이름:',
inputContent3:'프롬프트 입력',
Cancel:'취소',
Sure:'확신하는',
Sure:'제출하다',
Moodboard:'무드보드',
Prints:'인쇄물',
Sketches:'스케치',

View File

@@ -80,7 +80,7 @@ export default {
Name:'Имя:',
inputContent3:'Быстрый ввод',
Cancel:'Отмена',
Sure:'Конечно',
Sure:'Запись',
Moodboard:'Мудборд',
Prints:'Принты',
Sketches:'Эскизы',

View File

@@ -80,7 +80,7 @@ export default {
Name:'ชื่อ:',
inputContent3:'ป้อนข้อมูลทันที',
Cancel:'ยกเลิก',
Sure:'ได้เลย',
Sure:'บันทึก',
Moodboard:'มูดบอร์ด',
Prints:'พิมพ์',
Sketches:'สเก็ตช์',

View File

@@ -80,7 +80,7 @@ export default {
Name:'Tên:',
inputContent3:'Nhập liệu nhanh chóng',
Cancel:'Hủy bỏ',
Sure:'Chắc chắn',
Sure:'Nộp',
Moodboard:'Bảng tâm trạng',
Prints:'Bản in',
Sketches:'Bản phác thảo',

View File

@@ -723,7 +723,7 @@ export default defineComponent({
},
//确定修改名称
confrimRename(){
async confrimRename(){
let data = {
libraryIds:this.renameType === 'single' ? [this.selectSingleImg.id] : this.selectImgList,
libraryName:this.newPicName,
@@ -748,27 +748,32 @@ export default defineComponent({
"updateTime": "",
"userId": 0
}
Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
(rv: any) => {
if(this.renameType ==='batch'){
this.selectImgList = []
}
Https.axiosPost(Https.httpUrls.relationLibrary, data2).then(
(rv: any) => {
this.getLibraryList()
this.closeRenameModal()
let bor = false
if(this.newPicName){//多选修改名字
await Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
(rv: any) => {
if(this.renameType ==='batch'){
this.selectImgList = []
}
).catch((res)=>{
// this.closeRenameModal()
});
}
).catch((res)=>{
// this.closeRenameModal()
});
bor = true
}
).catch((res)=>{
// this.closeRenameModal()
});
}
if(labelArr.length > 0){//多选修改标签
await Https.axiosPost(Https.httpUrls.relationLibrary, data2).then(
(rv: any) => {
bor = true
}
).catch((res)=>{
// this.closeRenameModal()
});
}
if(bor){
this.getLibraryList()
}
this.closeRenameModal()
},
//打开修改名称弹窗
@@ -792,6 +797,7 @@ export default defineComponent({
"updateTime": "",
"userId": 0
}
this.value.editLabelValue = []
if(type === 'single'){
this.selectSingleImg = data
this.newPicName = data.name