2025-04-16 10:43:54 +08:00
< template >
2025-06-18 21:47:27 +08:00
< div class = "createCloud" ref = "createCloud" > < / div >
< a-modal
class = "createCloud_modal generalModel"
v - model : visible = "operationsModal"
: footer = "null"
: get - container = "() => $refs.createCloud"
width = "50%"
: height = "'77rem'"
: maskClosable = "false"
: centered = "true"
: closable = "false"
: mask = "true"
wrapClassName = "#app"
: keyboard = "false"
>
< div class = "generalModel_btn" >
< div class = "generalModel_closeIcon" @click.stop ="cancelDsign()" >
< svg
2025-08-22 10:27:48 +08:00
width = "100%" height = "100%"
2025-06-18 21:47:27 +08:00
viewBox = "0 0 46 46"
fill = "none"
xmlns = "http://www.w3.org/2000/svg"
>
< circle cx = "23" cy = "23" r = "23" fill = "white" fill -opacity = " 0.3 " / >
< rect
x = "32.5063"
y = "12"
width = "3"
height = "29"
rx = "1.5"
transform = "rotate(45 32.5063 12)"
fill = "#000"
/ >
< rect
x = "34.6274"
y = "32.5059"
width = "3"
height = "29"
rx = "1.5"
transform = "rotate(135 34.6274 32.5059)"
fill = "#000"
/ >
< / svg >
< / div >
< / div >
< div class = "modal_title_text" >
2025-06-26 15:41:08 +08:00
< div > { { $t ( 'batchGeneration.title' ) } } < / div >
2025-06-18 21:47:27 +08:00
< / div >
< div class = "allUserPoeration_center admin_page" >
< div class = "admin_state_item" >
2025-06-26 15:41:08 +08:00
< span > { { $t ( 'batchGeneration.TaskType' ) } } < span > * < / span > < / span >
2025-06-18 21:47:27 +08:00
< a-select
v - model : value = "buildType"
allowClear
style = "width: 200px"
placeholder = "Please select"
: options = "cloudList"
@ change = "changeBuildType"
> < / a-select >
< / div >
< div class = "admin_state_item" >
< span
2025-06-26 15:41:08 +08:00
> { { $t ( 'batchGeneration.Project' ) } }
2025-06-18 21:47:27 +08:00
< span
v - show = "
buildType == 'SERIES_DESIGN' || buildType == 'SINGLE_DESIGN'
"
> * < / s p a n
> < / s p a n
>
< a-select
v - model : value = "projectData"
show - search
allowClear
: show - arrow = "false"
2025-07-19 14:04:48 +08:00
style = "width: 200px"
2025-06-26 15:41:08 +08:00
: placeholder = "$t('batchGeneration.PleaseSelect')"
2025-06-18 21:47:27 +08:00
: options = "objectList"
@ search = "getHistoryProjectList"
@ change = "changeProject"
>
< template # option = "{ value: val, label, icon, updateTime }" >
< span : title = "updateTime.replace('T', ' ')" > { { label } } < / span >
< / template >
< / a-select >
< / div >
< div class = "admin_state_item" >
2025-06-26 15:41:08 +08:00
< span > { { $t ( 'batchGeneration.TaskName' ) } } < span > * < / span > < / span >
2025-06-18 21:47:27 +08:00
< input
v - model = "porjectName"
: placeholder = "placeholder"
@ focus = "focus"
@ blur = "blur"
type = "text"
style = "width: 200px"
/ >
< / div >
< div class = "admin_state_item" v-show = "buildType" >
2025-06-26 15:41:08 +08:00
< span > { { $t ( 'batchGeneration.Quantity' ) } } < span > * < / span > < / span >
2025-06-18 21:47:27 +08:00
< input
v - model = "numberOfImages"
2025-06-26 15:41:08 +08:00
: placeholder = "$t('batchGeneration.enterNumber')"
2025-06-18 21:47:27 +08:00
type = "text"
style = "width: 200px"
@ input = "changeNumberOfImages"
/ >
< / div >
<!-- toProductimg -- >
< div v-show = "buildType == 'TO_PRODUCT_IMAGE'" class="admin_state_item" >
2025-06-26 15:41:08 +08:00
< span > { { $t ( "ProductImg.Similarity" ) } } 0 - 100 < / span >
2025-06-18 21:47:27 +08:00
< div class = "sliderAndImput" style = "width: 200px" >
<!-- < a-slider class = "system_silder"
2025-04-23 09:39:24 +08:00
v - model : value = "similarity"
2025-06-09 10:25:54 +08:00
range
2025-04-23 09:39:24 +08:00
: step = "5"
>
2025-06-18 11:05:23 +08:00
< / a-slider > -- >
2025-06-18 21:47:27 +08:00
< div style = "display: flex" >
2025-06-26 15:41:08 +08:00
< input type = "number" v-model = "similarity[0]" / >
2025-06-18 21:47:27 +08:00
< div style = "margin: 0 1rem" > - < / div >
2025-06-26 15:41:08 +08:00
< input type = "number" v-model = "similarity[1]" / >
2025-06-18 21:47:27 +08:00
< / div >
< / div >
< / div >
< div v-show = "buildType == 'RELIGHT'" class="admin_state_item" >
< span > { { $t ( "ProductImg.RelightDirection" ) } } < / span >
< a-select
style = "width: 200px"
v - model : value = "relightDirection"
: options = "relightDirectionList"
> < / a-select >
< / div >
< div v-show = "buildType == 'RELIGHT'" class="admin_state_item" >
< span > { { $t ( "ProductImg.Highlight" ) } } < / span >
< div class = "sliderAndImput" style = "width: 200px" >
< a-slider
class = "system_silder"
v - model : value = "brightenValue"
: tooltipVisible = "false"
: max = "3"
: min = "1"
: step = "0.1"
>
< / a-slider >
< input type = "number" readonly v-model = "brightenValue" / >
< / div >
< / div >
< div
v - show = "buildType == 'TO_PRODUCT_IMAGE' || buildType == 'relight'"
class = "admin_state_item"
>
2025-06-26 15:41:08 +08:00
< span > { { $t ( 'batchGeneration.Keyword' ) } } < / span >
2025-06-18 21:47:27 +08:00
< input
v - model = "generateText"
: placeholder = "$t('Generate.inputContent1')"
type = "text"
style = "width: 200px"
/ >
< / div >
<!-- < div class = "selectImgList generalScroll" v-mousewheel v-show = "exhibitionImgList.length>0" >
2025-04-23 09:39:24 +08:00
< div v-for = "item in exhibitionImgList" class="item" >
< img :src = "item.designOutfitUrl||item.url" alt = "" >
< / div >
2025-06-09 10:25:54 +08:00
< / div > -- >
2025-06-18 21:47:27 +08:00
< div
class = "productImg_content_item_imgBox generalScroll upload_item"
v - if = "
buildType &&
buildType != 'SERIES_DESIGN' &&
buildType != 'SINGLE_DESIGN'
"
v - mousewheel
>
< div
class = "content_item_imgBox_itemImg"
v - for = "item in uploadElement"
: key = "item"
>
< div class = "imgBox" @click ="() => (item.isChecked = !item.isChecked)" >
< img
: class = "[item?.isChecked ? 'active' : '']"
: src = "item?.url"
class = "upload_img"
/ >
< a-checkbox v -model :checked = "item.isChecked" > < / a-checkbox >
< / div >
< / div >
< div
class = "content_item_imgBox_itemImg"
v - for = "(file, index) in fileList"
: key = "file"
>
< div
class = "upload_file_item_content"
v - show = "file?.status === 'uploading'"
style = "display: flex; align-items: center"
>
< a-spin size = "large" / >
< / div >
< div
class = "imgBox"
v - show = "file?.status === 'done'"
@ click = "() => (file.isChecked = !file.isChecked)"
>
< img
: class = "[file?.isChecked ? 'active' : '']"
: src = "file?.imgUrl"
class = "upload_img"
/ >
< a-checkbox v -model :checked = "file.isChecked" > < / a-checkbox >
< / div >
< / div >
< div class = "upload_file_item upload_component" >
2026-04-28 17:24:59 +08:00
<!-- : action = "uploadUrl + '/aida/api/history/toProductImageElementUpload'" -- >
2025-06-18 21:47:27 +08:00
< a-upload
: action = "
2026-04-28 17:24:59 +08:00
getUploadUrl ( ) + '/aida/api/history/toProductImageElementUpload'
2025-06-18 21:47:27 +08:00
"
list - type = "picture-card"
: capture = "null"
: headers = "{ Authorization: getCookie('token') }"
: before - upload = "beforeUpload"
: data = " {
2025-07-19 14:04:48 +08:00
projectId : projectData ? . value ? projectData ? . value : ''
2025-06-18 21:47:27 +08:00
} "
v - model : file - list = "fileList"
: multiple = "true"
: maxCount = "8"
accept = ".jpg,.png,.jpeg,.bmp"
@ change = "(file) => fileUploadChange(file)"
>
< div class = "upload_tip_block" >
< i class = "fi fi-br-upload" > < / i >
<!-- < img class = "upload_img_icon" src = "@/assets/images/homePage/add_file.png" > -- >
< / div >
< / a-upload >
< / div >
< / div >
<!-- < div class = "admin_state_item" style = "width: 100%;" >
2025-04-23 09:39:24 +08:00
< span style = "margin: 0;" > Generation time : 19 min < / span >
< / div > -- >
2025-06-18 21:47:27 +08:00
< div v-show = "buildType" class="admin_state_item" style="width: 100%" >
< span style = "margin: 0"
2025-06-26 15:41:08 +08:00
> { { $t ( 'batchGeneration.CostCredit' ) } } : { { credits * numberOfImages } } < / s p a n
2025-06-18 21:47:27 +08:00
>
< / div >
< / div >
< div class = "allUserPoeration_btn admin_page" >
<!-- < div class = "admin_search_item" @click ="cancelDsign" >
2025-04-16 15:08:59 +08:00
Close
2025-04-23 17:30:42 +08:00
< / div > -- >
2025-06-18 21:47:27 +08:00
< div class = "admin_search_item" @click ="setOk" > OK < / div >
< / div >
< / a-modal >
< div class = "mark_loading" v-show = "loadingShow" >
< a-spin size = "large" / >
< / div >
2025-04-16 10:43:54 +08:00
< / template >
2025-04-16 15:08:59 +08:00
< script >
2025-06-18 21:47:27 +08:00
import {
defineComponent ,
computed ,
reactive ,
watch ,
onMounted ,
h ,
nextTick ,
toRefs ,
} from "vue" ;
2025-06-09 10:25:54 +08:00
import { LoadingOutlined } from "@ant-design/icons-vue" ;
2025-04-16 10:43:54 +08:00
import { Https } from "@/tool/https" ;
2025-04-16 15:08:59 +08:00
import { Modal , message } from "ant-design-vue" ;
2025-06-18 21:47:27 +08:00
import { getCookie , setCookie } from "@/tool/cookie" ;
2025-04-16 15:08:59 +08:00
import { ExclamationCircleOutlined } from "@ant-design/icons-vue" ;
2025-06-18 21:47:27 +08:00
import { getUploadUrl , isMoible } from "@/tool/util" ;
import dayjs , { Dayjs } from "dayjs" ;
2025-04-23 09:39:24 +08:00
import { useStore } from "vuex" ;
import { useI18n } from "vue-i18n" ;
2025-06-18 21:47:27 +08:00
import { getMinioUrl } from "@/tool/util" ;
import md5 from "md5" ;
2025-04-16 10:43:54 +08:00
export default defineComponent ( {
2025-06-18 21:47:27 +08:00
components : { } ,
props : {
cloudList : {
type : Array ,
default : [ ] ,
2025-04-16 15:08:59 +08:00
} ,
2025-06-18 21:47:27 +08:00
} ,
emits : [ "getContentList" ] ,
setup ( props , { emit } ) {
const store = useStore ( ) ;
let operations = reactive ( {
operationsModal : false ,
loadingShow : false ,
} ) ;
let operationsData = reactive ( {
buildType : "" ,
numberOfImages : "" ,
credits : 0 ,
exhibitionImgList : [ ] , //选择的图片
2025-07-19 14:04:48 +08:00
projectData : {
id : '' ,
name : '' ,
} , //批量id
2025-06-18 21:47:27 +08:00
objectList : [ ] ,
porjectName : "" , //任务名字
//toProduct
generateText : "" , //输入的内容
similarity : [ 20 , 40 ] ,
brightenValue : 1 , //亮度
relightDirection : "Right Light" , //打光方向
2025-07-19 14:04:48 +08:00
sequence : '' ,
2025-06-18 21:47:27 +08:00
relightDirectionList : [
{
value : "Right Light" ,
label : useI18n ( ) . t ( "ProductImg.RightLight" ) ,
} ,
{
value : "Left Light" ,
label : useI18n ( ) . t ( "ProductImg.LeftLight" ) ,
} ,
{
value : "Top Light" ,
label : useI18n ( ) . t ( "ProductImg.TopLight" ) ,
} ,
{
value : "Bottom Light" ,
label : useI18n ( ) . t ( "ProductImg.BottomLight" ) ,
} ,
] ,
fileList : [ ] ,
uploadElement : [ ] ,
placeholder : "" ,
} ) ;
const getUploadElement = ( ) => {
operations . loadingShow = true ;
let value = {
2025-07-19 14:04:48 +08:00
id : operationsData . projectData ? . value ,
2025-06-18 21:47:27 +08:00
moduleList : [ "uploadElement" ] ,
} ;
2025-07-19 14:04:48 +08:00
let str = setPlaceholder ( )
if ( ! str ) {
str = props . cloudList . filter ( ( item ) => item . value == operationsData . buildType ) [ 0 ] . label
str = str . replace ( /\s+/g , '_' )
}
operationsData . placeholder = "Batch_" + str + '_' + operationsData . sequence ;
2025-06-18 21:47:27 +08:00
Https . axiosPost ( Https . httpUrls . getModuleContent , value )
. then ( async ( rv ) => {
operationsData . uploadElement = rv . uploadElement ;
operations . loadingShow = false ;
} )
. catch ( ( err ) => {
operations . loadingShow = false ;
} ) ;
} ;
2025-07-19 14:04:48 +08:00
let init = ( projectData , buildType , sequence ) => {
operationsData . sequence = sequence
2025-06-18 21:47:27 +08:00
operations . operationsModal = true ;
clearData ( ) ;
if ( projectData ? . id ) {
operationsData . projectData = {
2025-07-19 14:04:48 +08:00
label : projectData . label ,
2025-06-18 21:47:27 +08:00
value : projectData . id ,
} ;
getUploadElement ( ) ;
}
2025-07-19 14:04:48 +08:00
if ( buildType . value ) operationsData . buildType = buildType . value ;
2025-06-18 21:47:27 +08:00
} ;
const clearData = ( ) => {
operationsData . porjectName = "" ;
operationsData . generateText = "" ;
operationsData . similarity = [ 20 , 40 ] ;
operationsData . brightenValue = 1 ;
operationsData . fileList = [ ] ;
operationsData . uploadElement = [ ] ;
} ;
2025-07-19 14:04:48 +08:00
const changeProject = ( rv ) => {
let porjectData = operationsData . objectList . find (
( item ) => item . id === rv
) ;
operationsData . projectData = {
value : porjectData ? . id ,
label : porjectData ? . name ,
}
2025-06-18 21:47:27 +08:00
getUploadElement ( ) ;
} ;
const changeBuildType = ( ) => {
// operationsData.exhibitionImgList = []
2025-07-19 14:04:48 +08:00
operationsData . projectData = {
label : '' ,
value : '' ,
} ;
2025-06-18 21:47:27 +08:00
props . cloudList . forEach ( ( item ) => {
if ( item . value == operationsData . buildType ) {
operationsData . credits = item . consumption ;
2025-06-09 10:25:54 +08:00
}
2025-06-18 21:47:27 +08:00
} ) ;
2025-07-19 14:04:48 +08:00
getUploadElement ( ) ;
2025-06-18 21:47:27 +08:00
getHistoryProjectList ( ) ;
} ;
const getGenerateCloudImgList = ( type ) => {
let list = [ ] ;
if ( type == "SINGLE_DESIGN" || type == "SERIES_DESIGN" ) return list ;
let selectList = [ ] ;
let fileList = operationsData . fileList . filter ( ( item ) => item . isChecked ) ;
let uploadElement = operationsData . uploadElement . filter (
( item ) => item . isChecked
) ;
if ( fileList ) selectList . push ( ... fileList ) ;
if ( uploadElement ) selectList . push ( ... uploadElement ) ;
selectList . forEach ( ( item ) => {
let obj = { } ;
if ( type == "POSE_TRANSFER" ) {
obj = {
poseId : 1 ,
2025-07-19 14:04:48 +08:00
elementId : item . id ,
2025-06-18 21:47:27 +08:00
productImage : getMinioUrl ( item . imgUrl ) ,
2025-07-19 14:04:48 +08:00
elementType : item . type ? item . type : "ProductElement" ,
2025-06-18 21:47:27 +08:00
} ;
} else {
obj = {
elementId : item . id ,
elementType : item . type || "ProductElement" ,
} ;
2025-06-09 10:25:54 +08:00
}
2025-06-18 21:47:27 +08:00
list . push ( obj ) ;
} ) ;
return list ;
} ;
let getPorductImg = ( ) => {
let modularData = store . state . UploadFilesModule . modularData ;
let list = [ ] ;
if (
operationsData . buildType == "toProductImage" ||
operationsData . buildType == "relight"
) {
let productOrRelight = [ ] ;
if ( operationsData . buildType == "toProductImage" )
productOrRelight = modularData . design . likeData ;
if ( operationsData . buildType == "relight" )
productOrRelight = modularData . toProduct ;
productOrRelight . forEach ( ( item ) => {
if ( ! item . id ) return ;
let obj = {
createTime : "" ,
elementId : 0 ,
elementType : "" ,
id : 0 ,
isLike : 0 ,
taskId : "" ,
toProductImageRecordId : 0 ,
url : "" ,
} ;
obj . elementId = item . designOutfitId ;
obj . elementType = "DesignOutfit" ;
if ( operationsData . buildType == "relight" ) {
obj . elementId = item . id ;
obj . elementType = "ToProductImage" ;
}
list . push ( obj ) ;
} ) ;
}
return list ;
} ;
const getImageStrength = ( num ) => {
let imageStrength = num == 100 ? 95 : num ;
return imageStrength ;
} ;
const getPoseTransformData = ( ) => {
let list = [ ] ;
let toProduct = store . state . UploadFilesModule . modularData . toProduct ;
toProduct . forEach ( ( item ) => {
let obj = {
poseId : 1 ,
productImage : getMinioUrl ( item . url ) ,
2025-04-16 15:08:59 +08:00
} ;
2025-06-18 21:47:27 +08:00
list . push ( obj ) ;
} ) ;
return list ;
} ;
let setAddData = ( ) => {
let buildTypeCorresponding = {
SINGLE _DESIGN : "design" ,
SERIES _DESIGN : "design" ,
TO _PRODUCT _IMAGE : "toProductImage" ,
RELIGHT : "relight" ,
POSE _TRANSFER : "poseTransfer" ,
} ;
return {
buildType : buildTypeCorresponding [ operationsData . buildType ] ,
nums : operationsData . numberOfImages ,
2025-07-19 14:04:48 +08:00
sequence : operationsData . sequence ,
projectId : operationsData . projectData ? . value ? operationsData . projectData ? . value : '' ,
2025-06-26 15:41:08 +08:00
name : operationsData . porjectName || operationsData . placeholder ,
2025-06-18 21:47:27 +08:00
//productimg
toProductImage : {
prompt : operationsData . generateText , //输入的内容
toProductImageVOList : getGenerateCloudImgList (
operationsData . buildType
) , //选择的图片
// toProductImageVOList:getPorductImg(),//选择的图片
2025-07-19 14:04:48 +08:00
projectId : operationsData . projectData ? . value ? operationsData . projectData ? . value : '' ,
2025-06-18 21:47:27 +08:00
direction : operationsData . relightDirection , //打光方向
brightenValue : operationsData . brightenValue ,
imageStrength : ( 100 - getImageStrength ( ) ) / 100 ,
imageStrengthMin :
( 100 - getImageStrength ( operationsData . similarity [ 1 ] ) ) / 100 ,
imageStrengthMax :
( 100 - getImageStrength ( operationsData . similarity [ 0 ] ) ) / 100 ,
} ,
//poseTransform
// poseTransform:getPoseTransformData(),
poseTransform :
operationsData . buildType == "POSE_TRANSFER"
? getGenerateCloudImgList ( "POSE_TRANSFER" )
: [ ] ,
2025-07-19 14:04:48 +08:00
private : operationsData . projectData ? . value ,
ToProductImageDTO : operationsData . projectData ? . value ,
2025-06-18 21:47:27 +08:00
} ;
} ;
let cancelDsign = ( ) => {
operationsData . buildType = "" ;
operationsData . numberOfImages = "" ;
operations . operationsModal = false ;
} ;
let setOk = ( ) => {
let data ;
data = setAddData ( ) ;
if ( operationsData . buildType == "TO_PRODUCT_IMAGE" ) {
if ( data . toProductImage . toProductImageVOList . length == 0 )
2025-06-26 15:41:08 +08:00
return message . warning ( "Please select or upload the picture first." ) ;
2025-06-18 21:47:27 +08:00
// if(data.toProductImage.toProductImageVOList.length == 0)return message.warning("You need to go to the Design module and generate a design result first before you can use the 'To Product Image' cloud generation feature.")
} else if ( operationsData . buildType == "RELIGHT" ) {
if ( data . toProductImage . toProductImageVOList . length == 0 )
2025-06-26 15:41:08 +08:00
return message . warning ( "Please select or upload the picture first." ) ;
2025-06-18 21:47:27 +08:00
// if(data.toProductImage.toProductImageVOList.length == 0)return message.warning("You need to go to the 'To Product Image' module and generate a result first before you can use the 'Relight' cloud generation feature.")
} else if ( operationsData . buildType == "POSE_TRANSFER" ) {
if ( data . poseTransform . length == 0 )
2025-06-26 15:41:08 +08:00
return message . warning ( "Please select or upload the picture first." ) ;
2025-06-18 21:47:27 +08:00
// if(data.poseTransform.length == 0)return message.warning("You must first generate results in the 'To Product Image' module before you can use the 'Transfer Pose' cloud generation feature.")
}
2025-07-19 14:04:48 +08:00
if ( operationsData . buildType == "DESIGN" && ! operationsData . projectData ? . value )
2025-06-18 21:47:27 +08:00
return message . warning ( "Please select a project" ) ;
if (
! data . buildType ||
! data . nums ||
! data . name ||
2025-07-19 14:04:48 +08:00
( operationsData . buildType == "DESIGN" && ! operationsData . projectData ? . value )
2025-06-18 21:47:27 +08:00
)
return message . warning ( "Please check the input box marked with *" ) ;
operations . loadingShow = true ;
Https . axiosPost ( Https . httpUrls . designCloud , data )
. then ( ( rv ) => {
if ( rv ) {
operations . loadingShow = false ;
cancelDsign ( ) ;
let porjectData = operationsData . objectList . find (
2025-07-19 14:04:48 +08:00
( item ) => item . id === operationsData . projectData ? . value
2025-06-18 21:47:27 +08:00
) ;
let project = {
value : porjectData ? . id ,
label : porjectData ? . name ,
} ;
emit ( "getContentList" , project ) ;
}
} )
. catch ( ( error ) => {
operations . loadingShow = false ;
} ) ;
} ;
const changeNumberOfImages = ( ) => {
if (
operationsData . buildType == "relight" ||
operationsData . buildType == "poseTransfer"
) {
if (
operationsData . exhibitionImgList . length <
Number ( operationsData . numberOfImages )
) {
operationsData . numberOfImages =
operationsData . exhibitionImgList . length ;
}
}
} ;
let getHistoryTime = null ;
const getHistoryProjectList = ( event ) => {
clearTimeout ( getHistoryTime ) ;
if ( ! event && ! operationsData . buildType ) {
operationsData . objectList = [ ] ;
return ;
}
getHistoryTime = setTimeout ( ( ) => {
let value = {
projectName : event ,
page : 1 ,
size : 9999 ,
asc : 0 ,
process : operationsData . buildType ,
2025-04-16 15:08:59 +08:00
} ;
2025-06-18 21:47:27 +08:00
Https . axiosPost ( Https . httpUrls . historyProject , value ) . then ( ( rv ) => {
rv . content . forEach ( ( item ) => {
item . value = item . id ;
item . label = item . name ;
} ) ;
operationsData . objectList = rv . content ;
} ) ;
} , 1000 ) ;
} ;
let beforeUpload = async ( file ) => {
const isJpgOrPng =
file . type === "image/jpeg" ||
file . type === "image/png" ||
file . type === "image/jpg" ||
file . type === "image/bmp" ;
if ( ! isJpgOrPng ) {
message . info ( useI18n ( ) . t ( "MoodboardUpload.jsContent3" ) ) ;
}
const isLt2M = file . size / 1024 / 1024 < 5 ;
if ( ! isLt2M ) {
message . info ( useI18n ( ) . t ( "MoodboardUpload.jsContent4" ) ) ;
}
return ( isJpgOrPng && isLt2M ) || Upload . LIST _IGNORE ;
} ;
let fileUploadChange = ( data ) => {
let file = data . file ;
let bor = true ;
if ( file . status === "done" ) {
let res = JSON . parse ( file . xhr . response ) ;
if ( res . errCode == 0 ) {
file . imgUrl = res . data . url ;
file . id = res . data . id ;
file . isChecked = true ;
file . type = "ProductElement" ;
operationsData . fileList . filter ( ( v ) => v . status === "done" ) ;
} else {
bor = false ;
}
// this.showFileList = productImgData.fileList
} else if ( file . status === "error" ) {
bor = false ;
}
} ;
const setPlaceholder = ( ) => {
2025-07-19 14:04:48 +08:00
if ( operationsData . projectData ? . label ) return operationsData . projectData . label
if ( ! operationsData . projectData ? . value ) return "" ;
2025-06-18 21:47:27 +08:00
let index = operationsData . objectList . findIndex (
2025-07-19 14:04:48 +08:00
( item ) => item . id === operationsData . projectData ? . value
2025-06-18 21:47:27 +08:00
) ;
return operationsData . objectList [ index ] . name ;
} ;
const focus = ( ) => {
if ( operationsData . porjectName ) return ;
operationsData . porjectName = operationsData . placeholder ;
} ;
const blur = ( ) => {
if ( operationsData . porjectName != operationsData . placeholder ) return ;
operationsData . porjectName = "" ;
} ;
return {
... toRefs ( operations ) ,
... toRefs ( operationsData ) ,
cancelDsign ,
init ,
changeProject ,
focus ,
blur ,
setOk ,
changeBuildType ,
changeNumberOfImages ,
getHistoryProjectList ,
beforeUpload ,
fileUploadChange ,
getUploadUrl ,
getCookie ,
} ;
} ,
data ( ) {
return {
indicator : h ( LoadingOutlined , {
style : {
fontSize : "2.4rem" ,
} ,
spin : true ,
} ) ,
} ;
} ,
mounted ( ) { } ,
methods : { } ,
directives : {
mousewheel : {
mounted ( el ) {
el . addEventListener ( "mouseenter" , ( e ) => {
if ( el . scrollWidth > el . clientWidth ) {
el . parentElement . style . overflowY = "hidden" ;
}
} ) ;
2025-04-23 09:39:24 +08:00
2025-06-18 21:47:27 +08:00
// 鼠标移出事件
el . addEventListener ( "mouseleave" , ( ) => {
el . parentElement . style . overflowY = "auto" ;
} ) ;
el . addEventListener (
"wheel" ,
( e ) => {
let num = 0 ;
if ( e . deltaY > 0 ) {
num = 25 ;
} else {
num = - 25 ;
}
el . scrollBy ( num , 0 ) ;
} ,
{ passive : true }
) ;
} ,
} ,
} ,
2025-04-16 15:08:59 +08:00
} ) ;
2025-04-16 10:43:54 +08:00
< / script >
< style lang = "less" scoped >
2025-06-18 21:47:27 +08:00
: deep ( . ant - modal - mask ) {
background : rgba ( 0 , 0 , 0 , 0.2 ) ;
2025-04-23 09:39:24 +08:00
}
2025-06-18 21:47:27 +08:00
: deep ( . createCloud _modal ) {
. ant - modal - body {
display : flex ;
flex - direction : column ;
}
2025-04-16 15:08:59 +08:00
}
< / style >
< style lang = "less" scoped >
. createCloud _modal {
2025-06-18 21:47:27 +08:00
. closeIcon {
z - index : 2 ;
}
. productImg _content _item _imgBox {
display : flex ;
overflow - x : auto ;
width : auto ;
margin - bottom : 2 rem ;
align - items : center ;
flex - wrap : nowrap ;
width : 100 % ;
. content _item _imgBox _itemImg {
display : flex ;
margin - right : 1 rem ;
position : relative ;
height : 20 rem ;
max - height : 100 % ;
position : relative ;
flex - shrink : 0 ;
img {
height : 100 % ;
width : 100 % ;
cursor : pointer ;
object - fit : contain ;
opacity : 0.5 ;
& . active {
opacity : 1 ;
}
}
. ant - checkbox - wrapper {
position : absolute ;
right : 0 ;
top : 0 ;
}
& . content _item _imgBox _itemImg : hover {
. content _item _imgBox _itemImg _delete {
display : block ;
cursor : pointer ;
}
}
. content _item _imgBox _itemImg _delete {
display : none ;
width : 100 % ;
height : 100 % ;
background : rgba ( 0 , 0 , 0 , 0.2 ) ;
position : absolute ;
i {
position : absolute ;
left : 50 % ;
top : 50 % ;
transform : translate ( - 50 % , - 50 % ) ;
color : # fff ;
}
}
2025-04-16 15:08:59 +08:00
}
2025-06-18 21:47:27 +08:00
: deep ( . upload _file _item ) {
flex - shrink : 0 ;
}
. content _item _imgBox _itemImg : last - child {
margin - right : 0 ;
}
}
. allUserPoeration _btn {
display : flex ;
flex - direction : row ;
height : auto ;
justify - content : flex - end ;
padding : 1 rem 0 ;
. admin _search _item {
margin - bottom : 0 ;
}
}
. allUserPoeration _center {
flex : 1 ;
overflow - y : auto ;
flex - direction : row ;
flex - wrap : wrap ;
align - content : flex - start ;
padding : 0 2 rem ;
> . selectImgList {
width : 100 % ;
display : flex ;
overflow - x : auto ;
align - items : center ;
flex - wrap : nowrap ;
height : 20 rem ;
margin : 2 rem 0 ;
> . item {
height : 100 % ;
margin - right : 1 rem ;
& : last - child {
margin - right : 0 ;
}
> img {
height : 100 % ;
}
}
//
}
> . admin _state _item {
width : auto ;
// width: 100%;
display : flex ;
flex - direction : column ;
align - items : flex - start ;
> span {
text - align : left ;
margin : 0 ;
margin - bottom : 1.5 rem ;
font - weight : 600 ;
}
: deep ( > . ant - select > . ant - select - selector ) {
border - radius : 1.6 rem ;
}
> input {
border - radius : 1.6 rem ;
}
> . sliderAndImput {
display : flex ;
align - items : center ;
flex : 1 ;
: deep ( > . ant - slider ) {
// border-radius: 1.6rem;
flex : 1 ;
}
input {
border - radius : 1.6 rem ;
width : 5 rem ;
padding : 4 px 11 px 4 px ;
margin - left : 1 rem ;
height : 100 % ;
text - align : center ;
}
}
}
}
2025-04-16 15:08:59 +08:00
}
2025-06-18 21:47:27 +08:00
< / style >