2023-11-13-dist

This commit is contained in:
X1627315083
2023-11-13 17:33:41 +08:00
parent 6cad540fbb
commit e3a2f8d25d
35 changed files with 433 additions and 184 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/css/945.8e7d181e.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@@ -1 +1 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>AiDA</title><link rel="stylesheet" href="./css/googleapis.css"><link rel="stylesheet" href="./css/roboto.css"><script defer="defer" src="/js/chunk-vendors.ac33c5f3.js"></script><script defer="defer" src="/js/app.3705ca65.js"></script><link href="/css/chunk-vendors.5e9dbdc9.css" rel="stylesheet"><link href="/css/app.6fa284b2.css" rel="stylesheet"></head><body><script src="./js/color-thief.js"></script><noscript><strong>We're sorry but aida doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>AiDA</title><link rel="stylesheet" href="./css/googleapis.css"><link rel="stylesheet" href="./css/roboto.css"><script defer="defer" src="/js/chunk-vendors.ac33c5f3.js"></script><script defer="defer" src="/js/app.bb3d2003.js"></script><link href="/css/chunk-vendors.5e9dbdc9.css" rel="stylesheet"><link href="/css/app.6fa284b2.css" rel="stylesheet"></head><body><script src="./js/color-thief.js"></script><noscript><strong>We're sorry but aida doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

1
dist/js/586.bdf1bd31.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/972.e752e8bc.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
dist/js/app.bb3d2003.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -771,22 +771,27 @@ export default defineComponent({
return
}
let DesignDetailEnd = this.$refs.DesignDetailEnd
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
if(rv && rv.name){
// let hex = this.rgbaToHex([color.r,color.g,color.b])
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a? rv.a :1])
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
this.selectColor = this.reviewColor
DesignDetailEnd.colorList[DesignDetailEnd.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
this.pantongName = rv.name
let colorList =DesignDetailEnd.colorList.filter((v) => Object.keys(v).length)
this.setColorboardList(colorList)
this.getColorBg = true
}else{
message.warning(this.t('DesignDetailAlter.jsContent6'))
}
})
let pattern = /^\d{2}-\d{4}$/;
if(pattern.test(this.tcxColor)){
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
if(rv && rv.name){
// let hex = this.rgbaToHex([color.r,color.g,color.b])
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a? rv.a :1])
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
this.selectColor = this.reviewColor
DesignDetailEnd.colorList[DesignDetailEnd.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
this.pantongName = rv.name
let colorList =DesignDetailEnd.colorList.filter((v) => Object.keys(v).length)
this.setColorboardList(colorList)
this.getColorBg = true
}else{
message.warning(this.t('DesignDetailAlter.jsContent6'))
}
})
}else{
message.warning(this.t('ColorboardUpload.jsContent5'))
}
},
//查询颜色的潘通值和txc
getPantongName(v) {

View File

@@ -272,21 +272,27 @@ export default defineComponent({
if(!this.tcxColor){
return
}
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
if(rv && rv.name){
// let hex = this.rgbaToHex([color.r,color.g,color.b])
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a?rv.a:1])
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
this.selectColor = this.reviewColor
this.colorList[this.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
this.pantongName = rv.name
let colorList =this.colorList.filter((v) => Object.keys(v).length)
this.setColorboardList(colorList)
this.getColorBg = true
}else{
message.warning(this.t('ColorboardUpload.jsContent2'))
}
})
let pattern = /^\d{2}-\d{4}$/;
if(pattern.test(this.tcxColor)){
Https.axiosGet(Https.httpUrls.getRgbByTcx + '?tcx=' + this.tcxColor).then((rv) =>{
if(rv && rv.name){
// let hex = this.rgbaToHex([color.r,color.g,color.b])
let hex = this.rgbaToHex([rv.r,rv.g,rv.b,rv.a?rv.a:1])
this.reviewColor = rv?.r + ''? {rgba:{r:rv.r,g:rv.g,b:rv.b,a:1},hex:hex} : {hex:''}
this.selectColor = this.reviewColor
this.colorList[this.selectIndex] = {r:rv.r, g:rv.g, b:rv.b}
this.pantongName = rv.name
let colorList =this.colorList.filter((v) => Object.keys(v).length)
this.setColorboardList(colorList)
this.getColorBg = true
}else{
message.warning(this.t('ColorboardUpload.jsContent2'))
}
})
}else{
message.warning(this.t('ColorboardUpload.jsContent5'))
}
},
//清除当前的颜色
@@ -334,6 +340,7 @@ export default defineComponent({
(rv) => {
if(rv){
colorSort = rv.ratio
console.log(rv);
}
}
)

View File

@@ -188,15 +188,15 @@ export default defineComponent({
modalWarning: null,
isLanguage: false,
language:[
{name:'English',value:'en'},
{name:'中文',value:'zh'},
{name:'한국인',value:'ko'},
{name:'にほんご',value:'ja'},
{name:'Русский',value:'ru'},
{name:'Français',value:'fr'},
{name:'แบบไทย',value:'th'},
{name:'Tiếng Việt',value:'vi'},
{name:'Italiano',value:'it'},
{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'},
]
};
},
@@ -208,7 +208,6 @@ export default defineComponent({
this.accountIsLogin(this.userInfo);
}
this.isHaveBindEmail = this.userInfo?.email ? true : false;
this.getLang()
this.operateClick();
document.addEventListener("click", this.operateClick);
},
@@ -374,27 +373,29 @@ export default defineComponent({
},
//获取当前语言
getLang(){
let data = {}
// Https.axiosPost(Https.httpUrls.getUserLanguage, data).then(
// (rv) => {
// if (rv) {
// this.locale = rv
// }
// }
// );
let data
Https.axiosPost(Https.httpUrls.getUserLanguage, data).then(
(rv) => {
if (rv) {
this.locale = v
console.log(rv);
}
}
);
},
setLang(v){
let data = {
language:v
}
// Https.axiosPost(Https.httpUrls.changeUserLanguage, data).then(
// (rv) => {
// if (rv) {
// console.log(rv);
// this.getLang()
// }
// }
// );
Https.axiosPost(Https.httpUrls.changeUserLanguage, data).then(
(rv) => {
if (rv) {
let token = rv;
setCookie("token", token);
this.getLang(v)
}
}
);
},
setLocale(v){

View File

@@ -547,28 +547,27 @@ export default defineComponent({
return
}
}
// this.loadingShow = true
// Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data).then(
// (rv) => {
// if(rv){
// this.generateList = []
// let arr
// rv.generatedCollectionItems.forEach((v:any,index:number)=>{
// arr = {
// id:v.generateItemId,
// imgUrl:v.generateItemUrl,
// id_:GO.id++,
// like:rv.generatedCollectionItems[index].isLiked
// }
// this.generateList.push(arr)
// this.loadingShow = false
// })
// }
// }
// ).catch(res=>{
// this.loadingShow = false
// });
this.loadingShow = true
Https.axiosPost(Https.httpUrls.sketchAndPrintGenerate, data).then(
(rv) => {
if(rv){
this.generateList = []
let arr
rv.generatedCollectionItems.forEach((v:any,index:number)=>{
arr = {
id:v.generateItemId,
imgUrl:v.generateItemUrl,
id_:GO.id++,
like:rv.generatedCollectionItems[index].isLiked
}
this.generateList.push(arr)
this.loadingShow = false
})
}
}
).catch(res=>{
this.loadingShow = false
});
},
randomRange(min:any, max:any, num:any) { // min最小值max最大值 num排除的值
let index = Math.floor(Math.random() * (max - min)) + min;

View File

@@ -130,7 +130,7 @@
</template>
<script lang="ts">
import { defineComponent,ref,createVNode} from 'vue'
import { defineComponent,ref,createVNode,nextTick} from 'vue'
import { Https } from "@/tool/https";
import {dataURLtoFile,base64toFile} from "@/tool/util"
import { getCookie } from "@/tool/cookie";
@@ -255,44 +255,49 @@ export default defineComponent({
this.option.img = this.printObject.url
setTimeout(()=>{
let imgbox:any = this.$refs.imgbox
nextTick().then(()=>{
let image:any = new Image()
image.src = this.option.img
let imgbox:any = this.$refs.imgbox
console.log(imgbox);
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
let imgBoxSizeBG = imgbox.getElementsByClassName('cropper-view-box')[0]
let divTop:any = document.createElement('div');
let divBottom:any = document.createElement('div');
let divCenter:any = document.createElement('div');
if(imgbox.getElementsByClassName('cropper-view-box-Bg').length >= 1){
}else{
divTop.classList.add('cropper-view-box-Bg')
divBottom.classList.add('cropper-view-box-Bg')
divCenter.classList.add('cropper-view-box-Bg')
divTop.classList.add('cropper-view-box-Top')
divBottom.classList.add('cropper-view-box-Bottom')
divCenter.classList.add('cropper-view-box-Center')
let imgBoxSize = imgbox.getElementsByClassName('cropper-crop-box')[0]
let imgBoxSizeBG = imgbox.getElementsByClassName('cropper-view-box')[0]
let divTop:any = document.createElement('div');
let divBottom:any = document.createElement('div');
let divCenter:any = document.createElement('div');
if(imgbox.getElementsByClassName('cropper-view-box-Bg').length >= 1){
}else{
divTop.classList.add('cropper-view-box-Bg')
divBottom.classList.add('cropper-view-box-Bg')
divCenter.classList.add('cropper-view-box-Bg')
divTop.classList.add('cropper-view-box-Top')
divBottom.classList.add('cropper-view-box-Bottom')
divCenter.classList.add('cropper-view-box-Center')
imgBoxSizeBG.appendChild(divTop)
imgBoxSizeBG.appendChild(divBottom)
imgBoxSizeBG.appendChild(divCenter)
// imgBoxSizeBG.appendChild(div)
imgBoxSizeBG.appendChild(divTop)
imgBoxSizeBG.appendChild(divBottom)
imgBoxSizeBG.appendChild(divCenter)
// imgBoxSizeBG.appendChild(div)
}
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
}
// imgBoxSize.style.backgroundImage = 'url('+require('@assets/images/library/lemaleBG.png')')'
let cropper:any = this.$refs.cropper
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
imgBoxSize.addEventListener('mousemove',this.startMove)
this.setImageSize()
this.getDefaultPointList(this.imgBox,' ')
let cropper:any = this.$refs.cropper
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
imgBoxSize.addEventListener('mousemove',this.startMove)
this.setImageSize()
this.getDefaultPointList(this.imgBox,' ')
})
},300)
},
realTime(data:any) {
clearTimeout(this.cropperTime)
this.cropperTime = setTimeout(()=>{
this.setImageSize()
},1000)

View File

@@ -194,6 +194,8 @@ export default {
jsContent2:"找不到这个TCX的颜色",
jsContent3:"您只能上传图片文件!",
jsContent4:'图片必须小于2MB',
jsContent5:"请输入正确的TCX值",
},
MoodboardUpload:{
Upload:'上传',

View File

@@ -196,6 +196,7 @@ export default {
jsContent2:"Can't find the TCX color",
jsContent3:"You can only upload Image file!",
jsContent4:'Image must smaller than 2MB!',
jsContent5:"Please enter the correct TCX value",
},
MoodboardUpload:{
Upload:'Upload',

View File

@@ -197,6 +197,7 @@ export default {
jsContent2:"Je ne trouve pas la couleur TCX",
jsContent3:"Vous pouvez uniquement télécharger un fichier image!",
jsContent4:"L'image doit être inférieure à 2 Mo!",
jsContent5:"Veuillez saisir la valeur TCX correcte",
},
MoodboardUpload:{
Upload:'Télécharger',

View File

@@ -33,39 +33,39 @@ import itLocale from './it'
// 语言配置整合
const messages = {
'en':{
'ENGLISH':{
...enLocale,
...elementEnLocale
},
'zh':{
'CHINESE_SIMPLIFIED':{
...zhLocale,
...elementZhLocale
},
'ko':{
'KOREAN':{
...krLocale,
...elementKrLocale
},
'ja':{
'JAPANESE':{
...jaLocale,
...elementJaLocale
},
'ru':{
'RUSSIAN':{
...ruLocale,
...elementRuLocale
},
'fr':{
'FRENCH':{
...frLocale,
...elementFrLocale
},
'th':{
'THAI':{
...thLocale,
...elementThLocale
},
'vi':{
'VIETNAMESE':{
...vnLocale,
...elementVnLocale
},
'it':{
'ITALIAN':{
...itLocale,
...elementItLocale
},
@@ -75,7 +75,7 @@ const messages = {
const i18n = createI18n({
legacy: false,
globalInjection:true, // 全局模式,可以直接使用 $t
locale: 'en',
locale: 'ENGLISH',
messages: messages
})

View File

@@ -196,6 +196,7 @@ export default {
jsContent2:"Impossibile trovare il colore TCX",
jsContent3:"Puoi caricare solo il file immagine!",
jsContent4:"L'immagine deve essere inferiore a 2 MB!",
jsContent5:"Inserisci il valore TCX corretto",
},
MoodboardUpload:{
Upload:'Caricamento',

View File

@@ -196,6 +196,7 @@ export default {
jsContent2:"TCXの色が見つからない",
jsContent3:"画像ファイルのみアップロードできます!",
jsContent4:'画像は 2MB 未満である必要があります!',
jsContent5:'正しい TCX 値を入力してください。」',
},
MoodboardUpload:{
Upload:'アップロード',

View File

@@ -196,6 +196,7 @@ export default {
jsContent2:"TCX 색상을 찾을 수 없습니다",
jsContent3:"이미지 파일만 업로드할 수 있습니다!",
jsContent4:'이미지는 2MB보다 작아야 합니다!',
jsContent5:'올바른 TCX 값을 입력하세요"',
},
MoodboardUpload:{
Upload:'업로드',

View File

@@ -196,6 +196,7 @@ export default {
jsContent2:"Не могу найти цвет TCX",
jsContent3:"Вы можете загрузить только файл изображения!",
jsContent4:'Изображение должно быть меньше 2 МБ!',
jsContent5:'Пожалуйста, введите правильное значение TCX',
},
MoodboardUpload:{
Upload:'Загрузить',

View File

@@ -194,6 +194,7 @@ export default {
jsContent2:"ไม่พบสี TCX",
jsContent3:"คุณสามารถอัปโหลดได้เฉพาะไฟล์รูปภาพเท่านั้น!",
jsContent4:'รูปภาพต้องมีขนาดเล็กกว่า 2MB!',
jsContent5:'โปรดป้อนค่า TCX ที่ถูกต้อง',
},
MoodboardUpload:{
Upload:'อัปโหลด',

View File

@@ -196,6 +196,7 @@ export default {
jsContent2:"Không tìm thấy màu TCX",
jsContent3:"YBạn chỉ có thể tải lên tệp Hình ảnh!",
jsContent4:'Hình ảnh phải nhỏ hơn 2MB!',
jsContent5:"Vui lòng nhập giá trị TCX chính xác",
},
MoodboardUpload:{
Upload:'Tải lên',

View File

@@ -8,6 +8,7 @@ export default {
var max = obj?.max == undefined ? 5 : obj.max;
var img = new Image();
img.src = url;
let arr:any = []
img.onload = () => {
const width = img.width;
const height = img.height;
@@ -40,10 +41,168 @@ export default {
ratio:parseInt(String((num/ (width * height) * 100).toFixed(6)))
}
ratio.push(rgb)
// console.log(ratio);
// console.log((num/ (width * height) * 100).toFixed(2));
}
for (let i = 0; i < data.data.length; i+=4) {
var r = data.data[i];
var g = data.data[i+1];
var b = data.data[i+2];
var a = data.data[i+3];
arr.push([r,g,b,a])
}
// interface Point {
// x: number;
// y: number;
// z: number;
// }
// interface Centroid extends Point {
// points: Point[];
// }
// // 计算两个点之间的欧氏距离
// function euclideanDistance(a: Point, b: Point): number {
// const dx = a.x - b.x;
// const dy = a.y - b.y;
// const dz = a.z - b.z;
// return Math.sqrt(dx * dx + dy * dy + dz * dz);
// }
// // 使用 K-means 算法获取主要的 RGB 值
// function getMainRGBValues(rgbData: number[][], k: number): number[][] {
// const points: Point[] = rgbData.map(rgb => ({
// x: rgb[0],
// y: rgb[1],
// z: rgb[2]
// }));
// // 随机选择初始聚类中心
// const centroids: Centroid[] = [];
// for (let i = 0; i < k; i++) {
// const randomPoint = points[Math.floor(Math.random() * points.length)];
// centroids.push({ ...randomPoint, points: [] });
// }
// let converged = false;
// while (!converged) {
// // 将每个点分配到最近的聚类中心
// points.forEach(point => {
// let minDistance = Infinity;
// let closestCentroid: Centroid | undefined;
// centroids.forEach(centroid => {
// const distance = euclideanDistance(point, centroid);
// if (distance < minDistance) {
// minDistance = distance;
// closestCentroid = centroid;
// }
// });
// if (closestCentroid) {
// closestCentroid.points.push(point);
// }
// });
// // 更新聚类中心的位置
// const newCentroids: Centroid[] = [];
// centroids.forEach(centroid => {
// const { points } = centroid;
// if (points.length > 0) {
// const sumX = points.reduce((acc, point) => acc + point.x, 0);
// const sumY = points.reduce((acc, point) => acc + point.y, 0);
// const sumZ = points.reduce((acc, point) => acc + point.z, 0);
// const newX = sumX / points.length;
// const newY = sumY / points.length;
// const newZ = sumZ / points.length;
// newCentroids.push({ x: newX, y: newY, z: newZ, points: [] });
// } else {
// newCentroids.push(centroid);
// }
// });
// // 检查聚类中心是否发生变化
// converged = JSON.stringify(centroids) === JSON.stringify(newCentroids);
// centroids.splice(0, centroids.length, ...newCentroids);
// }
// // 找到每个聚类的平均颜色值
// const mainRGBValues = centroids.map(centroid => [
// Math.round(centroid.x),
// Math.round(centroid.y),
// Math.round(centroid.z)
// ]);
// return mainRGBValues;
// }
// // 示例使用
// const rgbData: number[][] = [
// [255, 0, 0], // 红色
// [0, 255, 0], // 绿色
// [0, 0, 255], // 蓝色
// // 更多 RGB 数据...
// ];
// const k = 1; // 假设我们想要找到三个主要的 RGB 值
// const mainRGBValues = getMainRGBValues(rgbData, k);
// console.log(mainRGBValues); // 输出主要的 RGB 值
//获取颜色做多的值
// function findMostFrequent(arr:any) {
// let map:any = {};
// let maxCount = 0;
// let mostFrequent;
// for (let item of arr) {
// if (map[item] === undefined) {
// map[item] = 1;
// } else {
// map[item]++;
// }
// if (map[item] > maxCount) {
// maxCount = map[item];
// mostFrequent = item;
// }
// }
// return mostFrequent;
// }
// console.log(arr);
// console.log(findMostFrequent(arr));
resolve({
width,
height,

View File

@@ -116,8 +116,10 @@ export const Https = {
queryClassification:`/api/classification/queryClassification`,//标签类别查询
saveOrUpdate:`/api/classification/saveOrUpdate`,//标签类别新增修改
classificationDelete:`/api/classification/delete`,//标签类别新增修改
relationLibrary:`/api/classification/relationLibrary`,//标签类别新增修改
batchUpdateLibraryName:'/api/library/batchUpdateLibraryName',//Library修改用户文件名
batchDeleteLibrary:'/api/library/batchDeleteLibrary',//删除library
queryLibraryTopAndBottomPage:'/api/library/queryLibraryTopAndBottomPage',//Library分页列表(查询top和bottom)

View File

@@ -86,23 +86,22 @@
<div class="content_body_header_right">
<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('','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()">
<a-cascader
@click.stop="dropdownVisibleChange"
ref="cascader"
v-model:value="value"
v-model:value="value.labelValue"
style="width: 60%"
:field-names="{ label: 'classificationName', value: 'classificationName', children: 'childList'}"
:field-names="{ label: 'classificationName', value: 'id', children: 'childList'}"
multiple
@change="setLabel1"
max-tag-count="responsive"
:options="options"
placeholder="Please select"
:show-search="{ filter }"
:open="labelOpen"
:open="labelOpen.labelOpen"
dropdownClassName="libraryPageCascader"
>
</a-cascader>
@@ -298,7 +297,23 @@
<div class="rename_form_content">
<input class="rename_form_input" :placeholder="$t('LibraryPage.inputContent3')" v-model="newPicName" @keydown.enter="confrimRename()">
</div>
<div class="rename_button_list">
<a-cascader
@click.stop="labelSearch"
ref="cascader"
v-model:value="value.editLabelValue"
style="width: 100%"
:field-names="{ label: 'classificationName', value: 'id', children: 'childList'}"
multiple
@change="setLabel1"
max-tag-count="responsive"
:options="options"
placeholder="Please select"
:show-search="{ filter }"
:open="labelOpen.editLabelOpen"
dropdownClassName="editLabel"
>
</a-cascader>
<div class="rename_button_list">
<div class="rename_button_item rename_cancel_button" @click="closeRenameModal()">{{ $t('LibraryPage.Cancel') }}</div>
<div class="rename_button_item rename_submit_button" @click="confrimRename()">{{ $t('LibraryPage.Sure') }}</div>
</div>
@@ -404,48 +419,23 @@ export default defineComponent({
})
let {t} = useI18n()
const options = ref([
{
label: 'Light',
value: 'light',
children: new Array(20)
.fill(null)
.map((_, index) => ({ label: `Number ${index}`, value: index })),
},
{
label: 'Bamboo',
value: 'bamboo',
children: [
{
label: 'Little',
value: 'little',
children: [
{
label: `'Toy Fish'`,
value: 'fish',
},
{
label: 'Toy Cards',
value: 'cards',
},
{
label: 'Toy Bird',
value: 'bird',
},
],
},
],
},
]);
let type:any = {
selectCode:selectCode,
designType:designType
}
provide('type',type)
let value = ref({
labelValue:[],
editLabelValue:[],
})
const filter: ShowSearchType['filter'] = (inputValue, path) => {
return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
};
let labelOpen = ref(false)
let labelOpen = ref({
labelOpen:false,
editLabelOpen:false,
})
return {
menuList,
selectImgList,
@@ -476,7 +466,7 @@ export default defineComponent({
generateList,
selectGenerateList,
printModel,
value: ref<string[]>([]),
value,
options,
filter,
t,
@@ -635,6 +625,8 @@ export default defineComponent({
closeRenameModal(){
this.renameVisivle= false;
this.newPicName = ''
this.value.editLabelValue = []
this.value.labelValue = []
},
//确定修改名称
@@ -644,28 +636,58 @@ export default defineComponent({
libraryName:this.newPicName,
timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
}
Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
// Https.axiosPost(Https.httpUrls.batchUpdateLibraryName, data).then(
// (rv: any) => {
// if(this.renameType ==='batch'){
// this.selectImgList = []
// }
// this.getLibraryList()
// this.closeRenameModal()
// }
// ).catch((res)=>{
// this.closeRenameModal()
// });
let labelArr:any = []
this.value.editLabelValue.forEach((item:any)=>{
labelArr.push(item[item.length-1])
})
let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType : ''
let data2 = {
"classificationIdList": labelArr,
"classificationName": "",
"createTime": "",
"id": 0,
"libraryId": this.renameType === 'single' ? [this.selectSingleImg.id] : this.selectImgList,
"type": this.selectCode,
"updateTime": "",
"userId": 0
}
Https.axiosPost(Https.httpUrls.relationLibrary, data2).then(
(rv: any) => {
if(this.renameType ==='batch'){
this.selectImgList = []
}
console.log(rv);
this.getLibraryList()
this.closeRenameModal()
}
).catch((res)=>{
this.closeRenameModal()
this.closeRenameModal()
});
},
//打开修改名称弹窗
showRenameModal(data:any,type:any){
this.newPicName = ''
if(type =='batch' && !this.selectImgList.length){ //批量但未选中
this.value.labelValue = []
this.newPicName = ''
return
}
if(type === 'single'){
this.selectSingleImg = data
this.newPicName = data.name
}
this.renameType = type
this.labelOpen.labelOpen = false
this.renameVisivle = true
},
upLoad(){
@@ -680,6 +702,7 @@ export default defineComponent({
},
//删除单个图片
deleteSinglePic(data:any,index:any){
this.labelOpen.labelOpen = false
let _this = this
Modal.confirm({
title: this.t('LibraryPage.jsContent1'),
@@ -817,8 +840,15 @@ export default defineComponent({
});
},
getLibraryList(){
let labelArr:any = []
this.value.labelValue.forEach((item:any)=>{
labelArr.push(item[item.length-1])
})
console.log(labelArr);
let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType : ''
let data = {
classificationId:[],
level1Type:this.selectCode,
level2Type:designType,
page:this.currentPage,
@@ -844,6 +874,7 @@ export default defineComponent({
...data.libraryModelPoint,
url:data.url,
}
this.labelOpen.labelOpen = false
this.placementClick(newData)
},
@@ -997,12 +1028,11 @@ export default defineComponent({
},
dropdownVisibleChange(){
this.labelOpen = true
this.labelOpen.labelOpen = true
document.addEventListener('click',this.setClick)
nextTick().then(()=>{
let cascader = document.getElementsByClassName('libraryPageCascader')[0]
let cascaderChild = cascader.children[0].children[0]
console.log(cascader.children,cascaderChild);
cascader.addEventListener('click',(event)=>{
event.stopPropagation()
})
@@ -1034,14 +1064,15 @@ export default defineComponent({
let myCascader:any = this.$refs.cascader
},
setClick(){
this.labelOpen = false
this.labelOpen.labelOpen = false
this.labelOpen.editLabelOpen = false
document.removeEventListener('click',this.setClick)
},
removeClick(){
},
addLabel(){
let setLabel:any = this.$refs.setLabel
this.labelOpen = false
this.labelOpen.labelOpen = false
setLabel.init('add',this.options)
},
// removeLabel(){
@@ -1049,7 +1080,20 @@ export default defineComponent({
// setLabel.init('remove')
// this.labelOpen = false
// }
labelSearch(){
this.labelOpen.editLabelOpen = true
document.addEventListener('click',this.setClick)
nextTick().then(()=>{
let cascader = document.getElementsByClassName('editLabel')[0]
cascader.addEventListener('click',(event)=>{
event.stopPropagation()
})
console.log(this.value.editLabelValue);
})
},
getClass(){
let designType = this.selectCode == 'Sketchboard' || this.selectCode == 'MarketingSketch' ? this.designType : ''
let data = {
@@ -1603,6 +1647,21 @@ export default defineComponent({
color: #FFFFFF;
}
}
.ant-select-allow-clear{
height: 4.6rem;
margin-top: 2rem;
.ant-select-selector{
.ant-select-selection-overflow{
.ant-select-selection-overflow-item{
.ant-select-selection-item{
.ant-select-selection-item-content{
line-height: 2.7;
}
}
}
}
}
}
}

View File

@@ -503,11 +503,13 @@ export default defineComponent({
},
//获取当前语言
getLang(){
let data = {}
let data ={}
Https.axiosPost(Https.httpUrls.getUserLanguage, data).then(
(rv: any) => {
if (rv) {
this.locale = rv
console.log(rv);
}
}
);