合并画布代码

This commit is contained in:
X1627315083
2025-06-18 11:05:23 +08:00
parent 903c0ebdf5
commit 9c7fae36eb
118 changed files with 23633 additions and 8201 deletions

View File

@@ -24,7 +24,7 @@
</div>
</div>
<div class="modal_title_text">
<div>Create Cloud Generation Tasks</div>
<div>Create Batch Generation Tasks</div>
</div>
<div class="allUserPoeration_center admin_page">
<div class="admin_state_item">
@@ -52,12 +52,24 @@
placeholder="Please select"
: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">
<span>Name <span>*</span></span>
<input
v-model="porjectName"
:placeholder="placeholder"
@focus="focus"
@blur="blur"
type="text"
style="width: 200px"
/>
</div>
<div class="admin_state_item" v-show="buildType">
<span>Quantity <span>*</span></span>
<input
@@ -72,14 +84,17 @@
<div v-show="buildType == 'TO_PRODUCT_IMAGE'" class="admin_state_item ">
<span>{{$t('ProductImg.Similarity')}}</span>
<div class="sliderAndImput" style="width: 200px">
<a-slider class="system_silder"
<!-- <a-slider class="system_silder"
v-model:value="similarity"
range
:step="5"
>
</a-slider>
<!-- <input type="number" readonly v-model="similarity"> -->
</a-slider> -->
<div style="display: flex;">
<input type="number" readonly v-model="similarity[0]">
<div style="margin: 0 1rem;">-</div>
<input type="number" readonly v-model="similarity[1]">
</div>
</div>
</div>
<div v-show="buildType == 'RELIGHT'" class="admin_state_item ">
@@ -117,12 +132,18 @@
</div>
</div> -->
<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'" >
<a-spin
:indicator="indicator"
tip="Uploading..."
/>
<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"
@@ -217,9 +238,10 @@ export default defineComponent({
exhibitionImgList:[],//选择的图片
projectData:null,//批量id
objectList:[],
porjectName:'',//任务名字
//toProduct
generateText:'',//输入的内容
similarity:[30,60],
similarity:[20,40],
brightenValue:1,//亮度
relightDirection:'Right Light',//打光方向
relightDirectionList:[
@@ -238,13 +260,43 @@ export default defineComponent({
}
],
fileList:[],
uploadElement:[],
placeholder:'',
})
const getUploadElement = ()=>{
operations.loadingShow = true
let value = {
id:operationsData.projectData,
moduleList:['uploadElement']
}
operationsData.placeholder = 'Batch_' + setPlaceholder()
Https.axiosPost(Https.httpUrls.getModuleContent,value).then(async (rv)=>{
operationsData.uploadElement = rv.uploadElement
operations.loadingShow = false
}).catch((err)=>{
operations.loadingShow = false
})
}
let init = (projectData,buildType)=>{
operations.operationsModal = true
if(projectData?.id)operationsData.projectData = {label:projectData.name,value:projectData.id}
clearData()
if(projectData?.id){
operationsData.projectData = {label:projectData.name,value:projectData.id}
getUploadElement()
}
if(buildType.value)operationsData.buildType = buildType
}
const clearData = ()=>{
operationsData.porjectName = ''
operationsData.generateText = ''
operationsData.similarity = [20,40]
operationsData.brightenValue = 1
operationsData.fileList = []
operationsData.uploadElement = []
}
const changeProject = ()=>{
getUploadElement()
}
const changeBuildType = ()=>{
// operationsData.exhibitionImgList = []
operationsData.projectData = null
@@ -255,15 +307,20 @@ export default defineComponent({
})
getHistoryProjectList()
}
const getGenerateCloudImgList = ()=>{
const getGenerateCloudImgList = (type)=>{
let list = []
if(operationsData.buildType == 'SINGLE_DESIGN'|| operationsData.buildType == 'SERIES_DESIGN')return list
let selectList = operationsData.fileList.filter((item)=>item.isChecked)
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(operationsData.buildType == 'POSE_TRANSFER'){
if(type == 'POSE_TRANSFER'){
obj = {
poseId:1,
productImage:getMinioUrl(item.imgUrl)
@@ -271,7 +328,7 @@ export default defineComponent({
}else{
obj = {
elementId:item.id,
elementType:item.type
elementType:item.type||'ProductElement'
}
}
list.push(obj)
@@ -337,10 +394,11 @@ export default defineComponent({
"buildType": buildTypeCorresponding[operationsData.buildType],
nums: operationsData.numberOfImages,
projectId: operationsData.projectData,
name:operationsData.porjectName || operationsData.projectData,
//productimg
toProductImage:{
prompt:operationsData.generateText,//输入的内容
toProductImageVOList:(operationsData.buildType == 'TO_PRODUCT_IMAGE' || operationsData.buildType == 'RELIGHT')?getGenerateCloudImgList():[],//选择的图片
toProductImageVOList:getGenerateCloudImgList(operationsData.buildType),//选择的图片
// toProductImageVOList:getPorductImg(),//选择的图片
projectId: operationsData.projectData,
direction:operationsData.relightDirection,//打光方向
@@ -351,7 +409,7 @@ export default defineComponent({
},
//poseTransform
// poseTransform:getPoseTransformData(),
poseTransform:operationsData.buildType == 'POSE_TRANSFER'?getGenerateCloudImgList():[],
poseTransform:operationsData.buildType == 'POSE_TRANSFER'?getGenerateCloudImgList('POSE_TRANSFER'):[],
private: operationsData.projectData,
ToProductImageDTO: operationsData.projectData,
}
@@ -375,7 +433,7 @@ export default defineComponent({
// 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.")
}
if(operationsData.buildType == 'DESIGN' && !operationsData.projectData)return message.warning('Please select a project')
if(!data.buildType || !data.nums || (operationsData.buildType == 'DESIGN' && !operationsData.projectData))return message.warning('Please check the input box marked with *')
if(!data.buildType || !data.nums || !data.name || (operationsData.buildType == 'DESIGN' && !operationsData.projectData))return message.warning('Please check the input box marked with *')
operations.loadingShow = true
Https.axiosPost(Https.httpUrls.designCloud, data).then(
(rv) => {
@@ -458,11 +516,25 @@ export default defineComponent({
bor = false
}
}
const setPlaceholder = ()=>{
if(!operationsData.projectData)return ''
let index = operationsData.objectList.findIndex(item => item.id === operationsData.projectData)
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,
@@ -658,13 +730,17 @@ export default defineComponent({
// border-radius: 1.6rem;
flex: 1;
}
> input{
border-radius: 1.6rem;
width: 4rem;
margin-left: 1rem;
height: 100%;
border-radius: 1rem;
>div{
input{
border-radius: 1.6rem;
width: 5rem;
padding: 4px 11px 4px;
margin-left: 1rem;
height: 100%;
text-align: center;
}
}
}
}
}

View File

@@ -47,17 +47,35 @@
<div class="content">
<tr v-for="(row, index) in contentList" :key="index">
<td v-for="header in cloudTiltleList" :key="header.value">
<span v-show="header.value != 'operation'">
<div v-if="header.value != 'operation' && header.value != 'name'">
{{header?.fun?header.fun(row[header.value]) : row[header.value]}}
</div>
<div v-if="header.value == 'name'">
<div v-if="row.id == renameId" class="rename">
<input type="text" v-model="renameText">
<i class="fi fi-br-check" @click="submitRename(row)"></i>
</div>
<div v-else>
{{header?.fun?header.fun(row[header.value]) : row[header.value]}}
</div>
</div>
<span style="color: #007EE5; cursor: pointer; margin-right: 1rem;" v-show="header.value == 'operation'" @click="setRename(row)">
Rename
</span>
<span style="color: #007EE5; cursor: pointer;" v-show="header.value == 'operation'" @click="detailIamge(row)">
<span style="color: #007EE5; cursor: pointer; margin-right: 1rem;" v-show="header.value == 'operation'" @click="detailIamge(row)">
Review
</span>
<span style="color: #007EE5; cursor: pointer;" v-show="header.value == 'operation'" @click="deleteRom(row)">
Delete
</span>
</td>
</tr>
</div>
<a-pagination style="text-align: center;" @change="pagination" v-model:current="currentPage" :total="total" show-less-items />
</div>
<div class="mark_loading" v-show="loadingShow">
<a-spin size="large" />
</div>
<createCloud ref="createCloud" :cloudList="generateList.seriesDesign" @getContentList="submitGetContentList"></createCloud>
</div>
</template>
@@ -159,6 +177,9 @@ export default defineComponent({
},
cloudTiltleList:[
{
name:'Task Name',
value:'name',
},{
name:'Task type',
value:'buildType',
fun:(value:any)=>{
@@ -213,6 +234,9 @@ export default defineComponent({
] as any,
objectList:[],
isGetContentList:false as any,
renameId:-1 as any,
renameText:'',
loadingShow:false,
})
const dataDom = reactive({
createCloud,
@@ -259,7 +283,13 @@ export default defineComponent({
store.commit('setCloudList',{str:'relight',list:rv.relight})
router.push(`/home/tools?tools=${item.buildType}&id=${item.projectId}&source=batch`)
}else if(item.buildType == 'poseTransfer'){
store.commit('setCloudList',{str:'poseTransfer',list:rv.poseTransfer})
let list = {
list:rv.poseTransfer,
str:'add',
index:-1,
}
store.commit("setPoseTransfer", list);
// store.commit('setCloudList',{str:'poseTransfer',list:rv.poseTransfer})
router.push(`/home/tools?tools=${item.buildType}&id=${item.projectId}&source=batch`)
}
// if(rv.design && rv.design.length > 0){
@@ -281,6 +311,7 @@ export default defineComponent({
}
const pagination = ()=>{
data.isGetContentList = true
data.renameId = -1
getContentList()
}
let time = null as any
@@ -290,7 +321,7 @@ export default defineComponent({
let value = {
page:data.currentPage,
size:data.pageSize,
projectId: data.projectData?.value,
projectId: data.projectData?.value?data.projectData?.value:'',
}
Https.axiosPost(Https.httpUrls.cloudPage,value).then((rv)=>{
data.contentList = rv.content
@@ -342,6 +373,40 @@ export default defineComponent({
const handleChange = (event:any,value:any)=>{
data.createData = value
}
const setRename = (item:any)=>{
data.renameId = item.id
data.renameText = item.name
}
const submitRename = (item:any)=>{
data.renameId = -1
data.loadingShow = true
let value = {
id:item.id,
name:data.renameText,
}
Https.axiosPost(Https.httpUrls.cloudTaskNameUpdate,value).then((rv)=>{
data.loadingShow = false
data.renameText = ''
data.isGetContentList = true
getContentList()
}).catch((err)=>{
data.loadingShow = false
})
}
const deleteRom = (item:any)=>{
let value = {
id:item.id
}
Https.axiosPost(Https.httpUrls.cloudTaskDelete,value).then((rv)=>{
data.loadingShow = false
data.isGetContentList = true
getContentList()
}).catch((err)=>{
data.loadingShow = false
})
}
onBeforeUnmount(()=>{
data.isGetContentList = false
})
@@ -366,6 +431,9 @@ export default defineComponent({
handleChange,
getHistoryProjectList,
pagination,
setRename,
submitRename,
deleteRom,
}
},
provide() {
@@ -452,7 +520,31 @@ export default defineComponent({
text-align: center;
width: calc(100% / 4);
line-height: 4.6rem;
font-size: 2.2rem;
font-size: 1.6rem;
display: flex;
align-items: center;
justify-content: center;
.rename{
display: flex;
align-items: center;
input{
height: 100%;
padding: .8rem;
width: 12rem;
}
> i{
margin-left: 1rem;
cursor: pointer;
width: 3rem;
height: 3rem;
background: #000;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
border-radius: 2rem;
}
}
}
}
}