Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite
This commit is contained in:
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -191,15 +191,26 @@ export default defineComponent({
|
|||||||
operationsData.paidCommission = data.paidCommission;
|
operationsData.paidCommission = data.paidCommission;
|
||||||
operationsData.remark = data.remark;
|
operationsData.remark = data.remark;
|
||||||
operationsData.endTime = dayjs(
|
operationsData.endTime = dayjs(
|
||||||
new Date(data.redeemBy * 1000).toISOString().split("T")[0],
|
new Date(data.redeemBy * 1000).toLocaleDateString('zh-CN', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit'
|
||||||
|
}).replace(/\//g, '/'),
|
||||||
"YYYY/MM/DD"
|
"YYYY/MM/DD"
|
||||||
);
|
);
|
||||||
|
// 确保格式一致
|
||||||
|
// operationsData.startTime = dayjs(
|
||||||
|
// new Date(data.startTime * 1000).toISOString().split("T")[0],
|
||||||
|
// "YYYY/MM/DD"
|
||||||
|
// );
|
||||||
operationsData.startTime = dayjs(
|
operationsData.startTime = dayjs(
|
||||||
new Date(data.startTime * 1000).toISOString().split("T")[0],
|
new Date(data.startTime * 1000).toLocaleDateString('zh-CN', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit'
|
||||||
|
}).replace(/\//g, '/'),
|
||||||
"YYYY/MM/DD"
|
"YYYY/MM/DD"
|
||||||
);
|
);
|
||||||
console.log(data)
|
|
||||||
|
|
||||||
// operationsData.endTime='2024-08-05T00:00:06'
|
// operationsData.endTime='2024-08-05T00:00:06'
|
||||||
// operationsData.validEndTime='2024-08-05T00:00:06'
|
// operationsData.validEndTime='2024-08-05T00:00:06'
|
||||||
// operationsData.commissionRate = data.commissionRate
|
// operationsData.commissionRate = data.commissionRate
|
||||||
@@ -317,3 +328,4 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -300,7 +300,11 @@ export default defineComponent({
|
|||||||
// ]
|
// ]
|
||||||
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
let isCurrent = list[i].id == detailData?.selectDetail?.id
|
||||||
console.log(isCurrent,newData)
|
console.log(isCurrent,newData)
|
||||||
let color = (detailData.currentDetailType == 'color' && isCurrent)?(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):(list[i].color?.rgba?.r?`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:'')
|
let color = (detailData.currentDetailType == 'color' && isCurrent && !detailData.isEditPattern.value)?
|
||||||
|
(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):
|
||||||
|
(list[i].color?.rgba?.r?
|
||||||
|
`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:
|
||||||
|
'')
|
||||||
if(detailData.currentDetailType == 'sketch' && newData){
|
if(detailData.currentDetailType == 'sketch' && newData){
|
||||||
color = detailData.designDetail.clothes[0].color?.rgba?.r?`${detailData.designDetail.clothes[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
|
color = detailData.designDetail.clothes[0].color?.rgba?.r?`${detailData.designDetail.clothes[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
|
||||||
detailData.selectDetail.maskUrl = ''
|
detailData.selectDetail.maskUrl = ''
|
||||||
@@ -309,8 +313,8 @@ export default defineComponent({
|
|||||||
let data:any = {
|
let data:any = {
|
||||||
changed:false,
|
changed:false,
|
||||||
color,
|
color,
|
||||||
designType:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.designType:list[i].designType,
|
designType:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.designType:list[i].designType,
|
||||||
id:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.id:list[i].id,
|
id:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.id:list[i].id,
|
||||||
maskMinioUrl:(newData && detailData.currentDetailType == 'sketch')?'':list[i]?.maskMinioUrl,
|
maskMinioUrl:(newData && detailData.currentDetailType == 'sketch')?'':list[i]?.maskMinioUrl,
|
||||||
// maskUrl:'',
|
// maskUrl:'',
|
||||||
maskUrl:(newData && detailData.currentDetailType == 'sketch')?'':list[i]?.maskUrl,
|
maskUrl:(newData && detailData.currentDetailType == 'sketch')?'':list[i]?.maskUrl,
|
||||||
@@ -321,19 +325,19 @@ export default defineComponent({
|
|||||||
offset,
|
offset,
|
||||||
partialDesign:list[i].partialDesign || {},
|
partialDesign:list[i].partialDesign || {},
|
||||||
// partialDesign:detailData.isEditPattern.value?list[i].partialDesign:{},
|
// partialDesign:detailData.isEditPattern.value?list[i].partialDesign:{},
|
||||||
path:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.minIOPath:list[i].minIOPath,
|
path:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.minIOPath:list[i].minIOPath,
|
||||||
printObject:(newData && detailData.currentDetailType == 'print' && isCurrent)?{prints:newData}:list[i].printObject?list[i].printObject:{prints:[]},
|
printObject:(newData && detailData.currentDetailType == 'print' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].printObject?list[i].printObject:{prints:[]},
|
||||||
priority,
|
priority,
|
||||||
// scale:[
|
// scale:[
|
||||||
// 0.5,
|
// 0.5,
|
||||||
// 0.35822305
|
// 0.35822305
|
||||||
// ],
|
// ],
|
||||||
scale:[scale[0]?scale[0]:1,scale[1]?scale[1]:1],
|
scale:[scale[0]?scale[0]:1,scale[1]?scale[1]:1],
|
||||||
type:(newData && detailData.currentDetailType == 'sketch' && isCurrent)?newData.level2Type || newData.categoryValue:list[i].type,
|
type:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.level2Type || newData.categoryValue:list[i].type,
|
||||||
sketchString:list[i].sketchString?list[i].sketchString:'',
|
sketchString:list[i].sketchString?list[i].sketchString:'',
|
||||||
trims:(newData && detailData.currentDetailType == 'element' && isCurrent)?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
|
trims:(newData && detailData.currentDetailType == 'element' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
|
||||||
}
|
}
|
||||||
if((list[i].color?.gradient || list[i].newDetail?.color?.gradient)){
|
if((list[i].color?.gradient || list[i].newDetail?.color?.gradient) && !detailData.isEditPattern.value){
|
||||||
gradient = list[i].newDetail?.color?.gradient || list[i].color.gradient
|
gradient = list[i].newDetail?.color?.gradient || list[i].color.gradient
|
||||||
gradient.colorImg = await setGradual(gradient,320,700)
|
gradient.colorImg = await setGradual(gradient,320,700)
|
||||||
data.gradient = gradient
|
data.gradient = gradient
|
||||||
@@ -389,7 +393,7 @@ export default defineComponent({
|
|||||||
designSingleItemDTOList:clothes,
|
designSingleItemDTOList:clothes,
|
||||||
isPreview:false,
|
isPreview:false,
|
||||||
// ifSubmit:designItemDetail.isPreview,
|
// ifSubmit:designItemDetail.isPreview,
|
||||||
gender:workspace?.sex == 'Male'?1:0,
|
gender:workspace?.sex,
|
||||||
sketchString:'',
|
sketchString:'',
|
||||||
modelId:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.id:detailData.designDetail.oldModel?detailData.designDetail.oldModel.id:'',
|
modelId:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.id:detailData.designDetail.oldModel?detailData.designDetail.oldModel.id:'',
|
||||||
modelType:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.type:detailData.designDetail.oldModel?detailData.designDetail.oldModel.type:'',
|
modelType:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.type:detailData.designDetail.oldModel?detailData.designDetail.oldModel.type:'',
|
||||||
|
|||||||
@@ -16,8 +16,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="detailText">{{$t('DesignPrintOperation.Colorfromimage')}}</div>
|
<div class="detailText">{{$t('DesignPrintOperation.Colorfromimage')}}</div>
|
||||||
<div class="uploadImage">
|
<div class="uploadImage flex flex-align-center flex-justify-around">
|
||||||
<upload @selectUplpadColor="selectUplpadColor"></upload>
|
<div class="upload-container flex flex-column flex-align-center" :class="{'hide': !showLibrary}">
|
||||||
|
<upload ref="uploadRef" @selectUplpadColor="selectUplpadColor" @selectFile="showLibrary = false" @deleteColor="showLibrary = true"></upload>
|
||||||
|
<div class="upload-text" v-show="showLibrary"> {{ $t('LibraryPage.Upload') }} </div>
|
||||||
|
</div>
|
||||||
|
<div class="upload-container flex flex-column flex-align-center" v-show="showLibrary">
|
||||||
|
<!-- <i class="fi fi-rr-followcollection"></i> -->
|
||||||
|
<SvgIcon name="CLibrary" size="40" @click="handleOpenLibrary" />
|
||||||
|
<div class="upload-text"> {{ $t('LibraryPage.library') }} </div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="detailText">{{$t('DesignPrintOperation.ColorCode')}}</div>
|
<div class="detailText">{{$t('DesignPrintOperation.ColorCode')}}</div>
|
||||||
<div class="colorCode">
|
<div class="colorCode">
|
||||||
@@ -30,7 +38,14 @@
|
|||||||
<!-- <div class="getTcxColorBtn" @click="getTcxColor">{{$t('DesignPrintOperation.ExtractColor')}}</div> -->
|
<!-- <div class="getTcxColorBtn" @click="getTcxColor">{{$t('DesignPrintOperation.ExtractColor')}}</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<SelectImages
|
||||||
|
ref="selectImages"
|
||||||
|
@select="handleImageSelect"
|
||||||
|
radio
|
||||||
|
full-data
|
||||||
|
:api="Https.httpUrls.queryLibraryPage"
|
||||||
|
isLibrary
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent,computed,ref,watch,nextTick,toRefs, reactive, onMounted} from 'vue'
|
import { defineComponent,computed,ref,watch,nextTick,toRefs, reactive, onMounted} from 'vue'
|
||||||
@@ -39,14 +54,16 @@ import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import { Https } from "@/tool/https";
|
import { Https } from "@/tool/https";
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { rgbaToHex,rgbToHsv } from "@/tool/util"
|
import { rgbaToHex,rgbToHsv,UrlToFile } from "@/tool/util"
|
||||||
import { message,Upload} from 'ant-design-vue';
|
import { message,Upload} from 'ant-design-vue';
|
||||||
|
import SelectImages from '@/component/common/SelectImages.vue'
|
||||||
|
|
||||||
|
|
||||||
import upload from './upload.vue'
|
import upload from './upload.vue'
|
||||||
import pallet from './pallet.vue'
|
import pallet from './pallet.vue'
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components:{
|
components:{
|
||||||
upload,pallet
|
upload,pallet,SelectImages
|
||||||
},
|
},
|
||||||
setup(props,{emit}) {
|
setup(props,{emit}) {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -243,6 +260,33 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uploadRef = ref<any>(null)
|
||||||
|
const selectImages = ref<any>(null)
|
||||||
|
const showLibrary = ref(true)
|
||||||
|
const handleOpenLibrary = ()=>{
|
||||||
|
selectImages.value.init()
|
||||||
|
}
|
||||||
|
const handleImageSelect = (item:any)=>{
|
||||||
|
console.log('item',item)
|
||||||
|
UrlToFile(item.url,item.name).then((file:any)=>{
|
||||||
|
console.log('file',file)
|
||||||
|
// 构造符合 fileUploadChange 期望的数据结构
|
||||||
|
const fileData = {
|
||||||
|
file: {
|
||||||
|
originFileObj: file, // 将 File 对象放在 originFileObj 属性中
|
||||||
|
status: 'done'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uploadRef.value.fileUploadChange(fileData)
|
||||||
|
})
|
||||||
|
// uploadRef.value.selectColor(item)
|
||||||
|
}
|
||||||
|
const handleShowListChange=(val:boolean)=>{
|
||||||
|
console.log('val',val)
|
||||||
|
showLibrary.value = !val
|
||||||
|
}
|
||||||
|
|
||||||
const selectUplpadColor = (item:any)=>{
|
const selectUplpadColor = (item:any)=>{
|
||||||
colorData.selectColor = JSON.parse(JSON.stringify(item))
|
colorData.selectColor = JSON.parse(JSON.stringify(item))
|
||||||
}
|
}
|
||||||
@@ -301,6 +345,14 @@ export default defineComponent({
|
|||||||
selectUplpadColor,
|
selectUplpadColor,
|
||||||
setSelectColor,
|
setSelectColor,
|
||||||
getTcxColor,
|
getTcxColor,
|
||||||
|
handleOpenLibrary,
|
||||||
|
Https,
|
||||||
|
showLibrary,
|
||||||
|
selectImages,
|
||||||
|
uploadRef,
|
||||||
|
handleImageSelect,
|
||||||
|
handleShowListChange,
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -312,6 +364,30 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
.flex{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-column{
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-align-center{
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-justify-center{
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-justify-between{
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-justify-around{
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
.color{
|
.color{
|
||||||
// width: 34rem;
|
// width: 34rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -374,6 +450,25 @@ export default defineComponent({
|
|||||||
height: 10rem;
|
height: 10rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
|
.upload-container{
|
||||||
|
background-color: #EDEDED;
|
||||||
|
padding: 1rem 2rem;
|
||||||
|
border-radius: 1rem;
|
||||||
|
width: 8rem;
|
||||||
|
height: 8rem;
|
||||||
|
&.hide{
|
||||||
|
width: initial;
|
||||||
|
height: initial;
|
||||||
|
border: none;
|
||||||
|
padding: 0;
|
||||||
|
flex: 1;
|
||||||
|
background-color: transparent;
|
||||||
|
padding-left: 1rem;
|
||||||
|
}
|
||||||
|
:deep(.ant-upload){
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
> .colorCode{
|
> .colorCode{
|
||||||
margin-bottom: 3rem;
|
margin-bottom: 3rem;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ import { rgbaToHex } from "@/tool/util"
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components:{
|
components:{
|
||||||
},
|
},
|
||||||
emits:['selectUplpadColor'],
|
emits:['selectUplpadColor','deleteColor','selectFile'],
|
||||||
setup(props,{emit}) {
|
setup(props,{emit}) {
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
@@ -63,6 +63,8 @@ export default defineComponent({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const fileUploadChange = (data:any)=>{
|
const fileUploadChange = (data:any)=>{
|
||||||
|
emit('selectFile')
|
||||||
|
console.log('fileUploadChange',data)
|
||||||
let file:any = data.file
|
let file:any = data.file
|
||||||
let fileData = file.originFileObj
|
let fileData = file.originFileObj
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
@@ -157,6 +159,7 @@ export default defineComponent({
|
|||||||
const colorDeleteFile = ()=>{
|
const colorDeleteFile = ()=>{
|
||||||
colorUpload.uploadList[colorUpload.selectDetail.id] = []
|
colorUpload.uploadList[colorUpload.selectDetail.id] = []
|
||||||
colorUpload.colorList[colorUpload.selectDetail.id] = []
|
colorUpload.colorList[colorUpload.selectDetail.id] = []
|
||||||
|
emit('deleteColor')
|
||||||
}
|
}
|
||||||
return{
|
return{
|
||||||
...toRefs(colorUpload),
|
...toRefs(colorUpload),
|
||||||
|
|||||||
@@ -40,7 +40,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a-dropdown>
|
<a-dropdown>
|
||||||
<i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}"></i>
|
<!-- <i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}"></i> -->
|
||||||
|
<i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}" :title="$t('Generate.uploadTitle')" v-show="!isTextarea && upload.level1Type !== 'Moodboard' && scene?.value != 'Slogan' && scene?.value != 'Logo'"></i>
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
<a-menu-item>
|
<a-menu-item>
|
||||||
@@ -60,7 +61,7 @@
|
|||||||
@change="(file) => fileUploadChange(file)"
|
@change="(file) => fileUploadChange(file)"
|
||||||
>
|
>
|
||||||
<div class="drop-container">
|
<div class="drop-container">
|
||||||
<i class="fi fi-br-upload" :class="{ Guide_1_2_6:type_.type2 == 'Printboard'}" :title="$t('Generate.uploadTitle')" v-show="!isTextarea && upload.level1Type !== 'Moodboard' && scene?.value != 'Slogan' && scene?.value != 'Logo'"></i>
|
<folder-outlined />
|
||||||
<div>{{ $t('PrintboardUpload.Upload') }}</div>
|
<div>{{ $t('PrintboardUpload.Upload') }}</div>
|
||||||
</div>
|
</div>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
@@ -248,6 +249,7 @@ import createSlogan from "@/component/HomePage/createSlogan.vue";
|
|||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import sketchCategory from "@/component/HomePage/sketchCategory.vue";
|
import sketchCategory from "@/component/HomePage/sketchCategory.vue";
|
||||||
import SelectImages from '@/component/common/SelectImages.vue'
|
import SelectImages from '@/component/common/SelectImages.vue'
|
||||||
|
import { FolderOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
@@ -255,7 +257,8 @@ export default defineComponent({
|
|||||||
generalMenu,
|
generalMenu,
|
||||||
createSlogan,
|
createSlogan,
|
||||||
sketchCategory,
|
sketchCategory,
|
||||||
SelectImages
|
SelectImages,
|
||||||
|
FolderOutlined
|
||||||
},
|
},
|
||||||
props: ["msg",'sketchCatecoryList','scene','gender'],
|
props: ["msg",'sketchCatecoryList','scene','gender'],
|
||||||
emits:['setLibrary'],
|
emits:['setLibrary'],
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<!-- 分类标签 -->
|
<!-- 分类标签 -->
|
||||||
<div class="image-categories">
|
<div v-if="showCategories" class="image-categories">
|
||||||
<div
|
<div
|
||||||
v-for="category in categories"
|
v-for="category in categories"
|
||||||
:key="category"
|
:key="category"
|
||||||
@@ -88,11 +88,6 @@ import { navTypeList } from '@/tool/listData'
|
|||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const libraryTypeList = [
|
|
||||||
{ label: t('Canvas.all'), value: '' },
|
|
||||||
...navTypeList(t).library.list
|
|
||||||
]
|
|
||||||
|
|
||||||
// Props
|
// Props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
api: {
|
api: {
|
||||||
@@ -110,35 +105,58 @@ const props = defineProps({
|
|||||||
fullData: {
|
fullData: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
level1Type: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
const emits = defineEmits(['select'])
|
const emits = defineEmits(['select'])
|
||||||
|
|
||||||
// 响应式数据
|
const libraryTypeList = ref([
|
||||||
|
...navTypeList(t).library.list.filter(item => item.value !== 'MyBrand')
|
||||||
|
])
|
||||||
|
|
||||||
|
// 根据传入的level1Type参数确定默认选中的分类
|
||||||
|
const getDefaultCategory = () => {
|
||||||
|
if (props.level1Type) {
|
||||||
|
// 如果传入了level1Type,查找匹配的category
|
||||||
|
const matchedCategory = libraryTypeList.value.find(
|
||||||
|
item => item.value === props.level1Type
|
||||||
|
)
|
||||||
|
return matchedCategory ? matchedCategory.label : libraryTypeList.value[0]?.label || ''
|
||||||
|
}
|
||||||
|
// 如果没有传入参数,选择第一个
|
||||||
|
return libraryTypeList.value[0]?.label || ''
|
||||||
|
}
|
||||||
|
|
||||||
const showPanel = ref(false)
|
const showPanel = ref(false)
|
||||||
const selectedCategory = ref(t('Canvas.all'))
|
const selectedCategory = ref(getDefaultCategory())
|
||||||
const selectList = ref([])
|
const selectList = ref([])
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
|
|
||||||
// 新增:分页和加载状态
|
|
||||||
const currentPage = ref(1)
|
const currentPage = ref(1)
|
||||||
const hasMore = ref(true)
|
const hasMore = ref(true)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
// 内部管理的分页大小
|
|
||||||
const pageSize = ref(10)
|
const pageSize = ref(10)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
|
|
||||||
// 计算属性:获取所有分类
|
// 计算属性:获取所有分类
|
||||||
const categories = computed(() => {
|
const categories = computed(() => {
|
||||||
if (props.isLibrary) {
|
if (props.isLibrary) {
|
||||||
return libraryTypeList.map(item => item.label)
|
return libraryTypeList.value.map(item => item.label)
|
||||||
} else {
|
} else {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 计算属性:是否显示分类选择器
|
||||||
|
const showCategories = computed(() => {
|
||||||
|
return !props.level1Type // 如果没有传入level1Type参数,则显示分类选择器
|
||||||
|
})
|
||||||
|
|
||||||
// 新增:API请求函数
|
// 新增:API请求函数
|
||||||
const fetchImages = async (
|
const fetchImages = async (
|
||||||
page = 1,
|
page = 1,
|
||||||
@@ -148,11 +166,10 @@ const fetchImages = async (
|
|||||||
if (!props.api) return
|
if (!props.api) return
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
|
||||||
const type = libraryTypeList.find(item => item.label === category).value
|
const type = libraryTypeList.value.find(item => item.label === category)?.value
|
||||||
console.log('type', type)
|
|
||||||
const params = {
|
const params = {
|
||||||
classificationIdList: [],
|
classificationIdList: [],
|
||||||
level1Type: 'Printboard',
|
level1Type: props.level1Type || type,
|
||||||
level2Type: '',
|
level2Type: '',
|
||||||
page,
|
page,
|
||||||
ageGroup: '',
|
ageGroup: '',
|
||||||
|
|||||||
@@ -306,6 +306,23 @@ export default defineComponent({
|
|||||||
data.isGenerate = false
|
data.isGenerate = false
|
||||||
clearInterval(data.remGenerateTime)
|
clearInterval(data.remGenerateTime)
|
||||||
data.remGenerate = false
|
data.remGenerate = false
|
||||||
|
if(res.errCode === 2){
|
||||||
|
Modal.confirm({
|
||||||
|
title: res.errMsg,
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
okText: 'Yes',
|
||||||
|
cancelText: 'No',
|
||||||
|
mask:false,
|
||||||
|
zIndex:99999,
|
||||||
|
centered:true,
|
||||||
|
onOk() {
|
||||||
|
store.commit("setUpgradePlan", true);
|
||||||
|
},
|
||||||
|
onCancel(){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const setGenerate = (dataList:any)=>{
|
const setGenerate = (dataList:any)=>{
|
||||||
|
|||||||
@@ -155,6 +155,12 @@ const base64toFile = (dataurl, filename = 'file') => {//转换base64
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const UrlToFile = async (url, imageName) => {
|
||||||
|
const response = await fetch(url)
|
||||||
|
const blob = await response.blob()
|
||||||
|
return new File([blob], imageName, { type: 'image/png' })
|
||||||
|
}
|
||||||
|
|
||||||
function rgbToHsv([R, G, B]) {//根据rgb获取hsv
|
function rgbToHsv([R, G, B]) {//根据rgb获取hsv
|
||||||
R /= 255
|
R /= 255
|
||||||
G /= 255
|
G /= 255
|
||||||
@@ -634,4 +640,5 @@ export {
|
|||||||
setGradual,
|
setGradual,
|
||||||
calculateGradientCoordinate,
|
calculateGradientCoordinate,
|
||||||
segmentImage,
|
segmentImage,
|
||||||
|
UrlToFile
|
||||||
}
|
}
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
<div
|
<div
|
||||||
class="operate_item"
|
class="operate_item"
|
||||||
v-if="
|
v-if="
|
||||||
record.process !== 'TO_PRODUCT_IMAGE' &&
|
record.process ==='SERIES_DESIGN' ||
|
||||||
record.process !== 'POSE_TRANSFER'
|
record.process ==='SINGLE_DESIGN'
|
||||||
"
|
"
|
||||||
@click="turnToDetail(record)"
|
@click="turnToDetail(record)"
|
||||||
>
|
>
|
||||||
@@ -41,8 +41,8 @@
|
|||||||
<div
|
<div
|
||||||
class="operate_item"
|
class="operate_item"
|
||||||
v-if="
|
v-if="
|
||||||
record.process !== 'TO_PRODUCT_IMAGE' &&
|
record.process ==='SERIES_DESIGN' ||
|
||||||
record.process !== 'POSE_TRANSFER'
|
record.process ==='SINGLE_DESIGN'
|
||||||
"
|
"
|
||||||
@click="renameCollection(record, index)"
|
@click="renameCollection(record, index)"
|
||||||
>
|
>
|
||||||
@@ -97,6 +97,7 @@ import projectSetting from '@/component/home/newProject/setting.vue'
|
|||||||
import { useStore } from 'vuex'
|
import { useStore } from 'vuex'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
// HeaderComponent,
|
// HeaderComponent,
|
||||||
@@ -315,8 +316,14 @@ export default defineComponent({
|
|||||||
searchHistoryList(value: any) {
|
searchHistoryList(value: any) {
|
||||||
// console.log('value', value)
|
// console.log('value', value)
|
||||||
this.currentPage = 1
|
this.currentPage = 1
|
||||||
|
const process =
|
||||||
|
value.currentPreset === ''
|
||||||
|
? []
|
||||||
|
: value.currentPreset === 'TO_PRODUCT_IMAGE'
|
||||||
|
? ['TO_PRODUCT_IMAGE', 'RELIGHT']
|
||||||
|
: [value.currentPreset]
|
||||||
this.getHistoryList({
|
this.getHistoryList({
|
||||||
process: value.currentPreset,
|
process,
|
||||||
projectName: value.searchText
|
projectName: value.searchText
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user