调整多选修改标签功能

This commit is contained in:
X1627315083
2024-01-04 14:51:57 +08:00
parent 21c5fad138
commit 6abd6816d9
10 changed files with 150 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
NODE_ENV = 'development'
VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk'
# VUE_APP_BASE_URL = 'http://18.167.251.121:10086'
# VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk'
VUE_APP_BASE_URL = 'http://18.167.251.121:10086'
# VUE_APP_BASE_URL = 'http://192.168.1.6:5567'

View File

@@ -197,6 +197,24 @@ li {
:not(body):has(>.driver-active-element) {
overflow: initial !important;
}
.driver-close__ {
position: absolute;
top: 2rem;
right: 2rem;
z-index: 99999;
color: #fff;
font-size: 4rem;
width: 2rem;
height: 2rem;
border: 0.5rem solid;
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem;
border-radius: 0.5rem;
cursor: pointer;
pointer-events: auto !important;
}
.delete_like_file_block {
display: none;
width: 2.5rem;
@@ -699,7 +717,7 @@ i {
border: 1px solid rgba(0, 0, 0, 0.15);
padding-left: 1.5rem;
border: 0.1rem solid #F1F1F1;
font-size: 1.2rem;
font-size: 1.6rem;
font-weight: 400;
}
.collection_modal_body .input_box inputinput:-moz-placeholder,

View File

@@ -215,9 +215,29 @@ ul,li{
}
}
}
:not(body):has(>.driver-active-element){
overflow: initial !important;
}
//自定义关闭按钮
.driver-close__{
position: absolute;
top: 2rem;
right: 2rem;
z-index: 99999;
color: #fff;
font-size: 4rem;
width: 2rem;
height: 2rem;
border: .5rem solid;
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem;
border-radius: .5rem;
cursor: pointer;
pointer-events: auto !important;
}
//爱心
.delete_like_file_block{
display: none;
@@ -797,13 +817,12 @@ i{
padding-bottom: 2rem;
z-index: 2;
input{
font-size: 1.2rem;
border-radius: .5rem;
width: 70%;
border: 1px solid rgba(0,0,0,.15);
padding-left: 1.5rem;
border: 0.1rem solid #F1F1F1;
font-size: 1.2rem;
font-size: 1.6rem;
font-weight: 400;
&input:-moz-placeholder{
color: rgba(0,0,0,.15);

View File

@@ -1,7 +1,7 @@
<template>
<div class="generate">
<div v-if="type_.type2 == 'Sketchboard'|| type_.type2 == 'Printboard'" class="generate_checkbox Guide_1_2_2" :class="[driver__.driver?'hideEvents':'']">
<div>
<div v-show="type_.type2 != 'Sketchboard'">
<label>
<input
type="checkbox"
@@ -39,7 +39,7 @@
<li class="printModel_item" @click="setprintModel(1)">{{ $t('Generate.Model1') }}</li>
<li class="printModel_item" @click="setprintModel(2)">{{ $t('Generate.Model2') }}</li>
<li class="printModel_item" @click="setprintModel(3)">{{ $t('Generate.Model3') }}</li>
<li v-show="(sketchboardList.length>=1 && moodboarList.length>=1&& checkbox[0].type) || (sketchboardList.length>=2 && checkbox[0].type) " class="printModel_item" @click="setprintModel(4)">{{ $t('Generate.Merge') }}</li>
<!-- <li v-show="(sketchboardList.length>=1 && moodboarList.length>=1&& checkbox[0].type) || (sketchboardList.length>=2 && checkbox[0].type) " class="printModel_item" @click="setprintModel(4)">{{ $t('Generate.Merge') }}</li> -->
</ul>
</div>
</div>
@@ -325,6 +325,22 @@ export default defineComponent({
return this.store?.state?.Workspace?.workspace
})
this.workspace = this.store.state.Workspace.workspace
if(this.type_.type2 == 'Sketchboard'){
this.checkbox=[
{
name: "image",
type: false,
},
{
name: "text",
type: true,
},
{
name: "text-image",
type: false,
},
]
}
this.$emit('generateCheckbox',this.checkbox[0].type)
},
watch:{

View File

@@ -214,13 +214,13 @@ export default defineComponent({
language:[
{name:'English',value:'ENGLISH'},
{name:'中文',value:'CHINESE_SIMPLIFIED'},
{name:'한국인',value:'KOREAN'},
{name:'にほんご',value:'JAPANESE'},
{name:'Русский',value:'RUSSIAN'},
{name:'Français',value:'FRENCH'},
{name:'แบบไทย',value:'THAI'},
{name:'Tiếng Việt',value:'VIETNAMESE'},
{name:'Italiano',value:'ITALIAN'},
// {name:'한국인',value:'KOREAN'},
// {name:'にほんご',value:'JAPANESE'},
// {name:'Русский',value:'RUSSIAN'},
// {name:'Français',value:'FRENCH'},
// {name:'แบบไทย',value:'THAI'},
// {name:'Tiếng Việt',value:'VIETNAMESE'},
// {name:'Italiano',value:'ITALIAN'},
]
};
},

View File

@@ -672,7 +672,8 @@ export default defineComponent({
},
//发送请求生成图片
getgenerate(){
this.sketchCatecoryList = this.store.state.Workspace.workspacePosition
// this.sketchCatecoryList = this.store.state.Workspace.workspacePosition
let sketchCatecoryList = this.sketchCatecoryList
if(this.isTest){//试用用户禁止使用
message.warning(
this.t('isTest.available')
@@ -757,8 +758,8 @@ export default defineComponent({
arr = {
id:v.generateItemId,
imgUrl:v.generateItemUrl,
category:generage.level2Type?generage.level2Type:this.sketchCatecoryList[0].name,
categoryValue:generage.level2Type?generage.level2Type:this.sketchCatecoryList[0].value,
category:generage.level2Type?generage.level2Type:sketchCatecoryList[0].name,
categoryValue:generage.level2Type?generage.level2Type:sketchCatecoryList[0].value,
id_:GO.id++,
like:v.isLiked
}

View File

@@ -78,7 +78,7 @@ const driverObj__ = driver({
{ element: '.Guide_1_31', popover: { title: '', description: 'Click here to export the collection you just designed.' } },
{ element: '.Guide_1_99', popover: { title: 'Begin Your Design', description: 'Your guide is complete, and now the canvas is yours to create freely. For more insights and details, check out our demo video on the homepage at <a href="https://code-create.com.hk/aida/" style="pointer-events: auto;" target="_blank">https://code-create.com.hk/aida/</a><br>You can restart the tutorial at any time by simply telling the robot that you want to.' } },
],
// showProgress: true,//控制总页数和当前页数是否显示
// showProgress: true,//控制总页数和当前页数是否显示
allowClose:false,
showButtons:false,
stagePadding:10,//切口到元素的距离
@@ -91,9 +91,11 @@ const driverObj__ = driver({
// prevBtnText: '‹—',
doneBtnText: '✕',
onPopoverRender: (popover, options) => {//每个步骤的元素和所有信息
console.log(popover,options,element);
// console.log(popover,options,element);
// popover.closeButton.style.display = 'block'
// popover.closeButton.style.pointerEvents ='auto'
addClose()
popover.previousButton.style.display = 'none'
// let driver = document.querySelector('body')
driverIndex__ = driverObj__.getState().activeIndex
data = {
index : driverIndex__,
@@ -124,23 +126,15 @@ const driverObj__ = driver({
// options.config.stagePadding = 10
// }
if(
// options.state.activeIndex >= 2 && options.state.activeIndex < 3 ||
options.state.activeIndex >= 6 && options.state.activeIndex < 9 ||
options.state.activeIndex >= 14 && options.state.activeIndex < 15 ||
// options.state.activeIndex >= 24 && options.state.activeIndex < 25 ||
driverObj__.isLastStep()
){
popover.footer.style.display = 'block'
// popover.previousButton.style.display = 'block'
popover.footerButtons.style.pointerEvents = 'auto';
// driver.classList.add('showEvents')
// addDiv(options.state.activeElement)
}else{
popover.footer.style.display = 'none'
// popover.previousButton.style.display = 'none'
// removeDiv(options.state.activeElement)
popover.footerButtons.style.pointerEvents = 'none';
// driver.classList.remove('showEvents')
}
nextTick().then(()=>{
if(element){
@@ -149,12 +143,13 @@ const driverObj__ = driver({
element = options.state.activeElement
element.classList.add('Guide_')
})
},
//销毁前
onDestroyStarted:()=>{
setDestroy()
if (!driverObj__.hasNextStep() || confirm("Are you sure about turning off user guidance?")) {
setDestroy()
}
},
//销毁前
onDestroyed:()=>{
@@ -187,6 +182,25 @@ function addDiv(element){
element.appendChild(mask);
}
}
function addClose(){
const body = document.querySelector('body')
const div = document.createElement('div');
if(document.getElementsByClassName('driver-close__').length == 0){
div.classList.add('driver-close__')
div.innerText = '×'
div.addEventListener('click',()=>{
setDestroy()
})
body.appendChild(div)
}
}
function removeClose(){
const body = document.querySelector('body')
if(document.getElementsByClassName('driver-close__').length > 0){
let div = document.getElementsByClassName('driver-close__')[0]
body.removeChild(div)
}
}
function removeDiv(element){
const mask = document.getElementsByClassName('driver-mask__')?.[0]
if(mask){
@@ -236,6 +250,8 @@ function setDestroy(){
index : driverIndex__,
driver : false,
}
removeClose()
store?.commit("setGuide", data);
setCookie("isBeginner", false);
driverObj__.destroy();//销毁方法

View File

@@ -136,6 +136,8 @@ export const Https = {
classificationDelete:`/api/classification/delete`,//标签类别新增修改
relationLibrary:`/api/classification/relationLibrary`,//标签类别新增修改
getRelClassificationIdList:`/api/classification/getRelClassificationIdList`,//标签类别新增修改
getRelPublicClassificationIdList:`/api/classification/getRelPublicClassificationIdList`,//多选获取公共标签
editRelPublicClassificationIdList:`/api/classification/editRelPublicClassificationIdList`,//多选修改公共标签

View File

@@ -88,7 +88,7 @@
</a-upload>
</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="deleteBatchPic()">{{ $t('LibraryPage.Delete') }}</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal('','batch')">{{ $t('LibraryPage.Rename') }}</div>
<div :class="['header_operate_item' , 'fontSize',selectImgList.length>0?'active':'']" @click="showRenameModal(selectImgList,'batch')">{{ $t('LibraryPage.Rename') }}</div>
</div>
<div class="content_search_block">
<input class="search_input" :placeholder="$t('LibraryPage.inputContent1')" v-model="searchPictureName" @keydown.enter="getLibraryList()">
@@ -187,7 +187,7 @@
<div class="content_body_header content_body_header_generate">
<div class="content_body_header_right" >
<div class="content_body_header_right" v-show="selectCode != 'Moodboard'">
<div class="checkboxItem">
<div class="checkboxItem" v-show="selectCode != 'Sketchboard'">
<label>
<input
type="checkbox"
@@ -570,7 +570,6 @@ export default defineComponent({
this.getClass()
this.getSex()
this.token = getCookie("token") || "";
},
methods:{
@@ -667,6 +666,22 @@ export default defineComponent({
}
this.upload.level1Type = menu.code
}
if(this.selectCode == 'Sketchboard'){
this.checkbox=[
{
name: "image",
type: false,
},
{
name: "text",
type: true,
},
{
name: "text-image",
type: false,
},
]
}
},
async sexChange(){
@@ -769,27 +784,35 @@ export default defineComponent({
if(this.newPicName){//多选修改名字
await Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
(rv: any) => {
if(this.renameType ==='batch'){
this.selectImgList = []
}
// if(this.renameType ==='batch'){
// this.selectImgList = []
// }
bor = true
}
).catch((res)=>{
// this.closeRenameModal()
});
}
if(labelArr.length > 0 && this.renameType == 'batch'){//多选修改标签
if(this.renameType == 'single'){//多选修改标签
await Https.axiosPost(Https.httpUrls.relationLibrary, data2).then(
(rv: any) => {
bor = true
}
).catch((res)=>{
// this.closeRenameModal()
});
}else{
await Https.axiosPost(Https.httpUrls.editRelPublicClassificationIdList, data2).then(
(rv: any) => {
bor = true
}
).catch((res)=>{
});
}
if(bor){
this.getLibraryList()
}
// if(bor){
// }
this.value.labelValue = []
this.getLibraryList()
this.closeRenameModal()
},
@@ -797,7 +820,6 @@ export default defineComponent({
showRenameModal(data:any,type:any){
this.newPicName = ''
if(type =='batch' && !this.selectImgList.length){ //批量但未选中
this.value.labelValue = []
this.newPicName = ''
return
}
@@ -815,31 +837,24 @@ export default defineComponent({
"userId": 0
}
this.value.editLabelValue = []
this.selectSingleImg = data
this.newPicName = data.name
if(type === 'single'){
this.selectSingleImg = data
this.newPicName = data.name
Https.axiosPost(Https.httpUrls.getRelClassificationIdList, classData).then(
(rv: any) => {
let arr:any = []
// this.options.forEach((item:any)=>{
// rv.forEach((rvItem:any) => {
// if(item.id == rvItem){
// arr.push(item.id)
// }else{
// item.childList.forEach((optionsItem:any) => {
// if(optionsItem.id == rvItem){
// arr.push([optionsItem.parentId,optionsItem.id])
// }
// });
// }
// });
// })
this.value.editLabelValue = rv
}
).catch((res)=>{
});
}
}else{
classData.libraryIdList = data
Https.axiosPost(Https.httpUrls.getRelPublicClassificationIdList, classData).then(
(rv: any) => {
this.value.editLabelValue = rv
}
).catch((res)=>{
});
}
this.renameType = type
this.renameVisivle = true
},

View File

@@ -38,7 +38,7 @@ module.exports = defineConfig({
}
}
},
https:true,
// https:true,
},
pluginOptions: {
"style-resources-loader": {