Merge remote-tracking branch 'origin/StableVersion' into localDevelop

This commit is contained in:
X1627315083
2024-05-22 10:46:07 +08:00
8 changed files with 50 additions and 30 deletions

View File

@@ -4,7 +4,7 @@
<div class="admin_state"> <div class="admin_state">
<div class="admin_state_item"> <div class="admin_state_item">
<span>State:</span> <span>State Time:</span>
<a-range-picker <a-range-picker
class="range_picker" class="range_picker"
v-model:value="rangePickerValue" v-model:value="rangePickerValue"
@@ -22,7 +22,7 @@
</a-range-picker> </a-range-picker>
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>Time:</span> <span>End Time:</span>
<a-time-range-picker class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" /> <a-time-range-picker class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
</div> </div>

View File

@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
<div class="detail_modal_model_content" :class="{active:body}"> <div class="detail_modal_model_content" :class="{active:body}">
<img class="detail_modal_model" :src="designItemDetail.designItemUrl" alt=""> <img class="detail_modal_model" :src="designItemDetail.currentFullBodyView?designItemDetail.currentFullBodyView:designItemDetail.designItemUrl" alt="">
<!-- <div class="detail_modal_item_back" :class="{active:body}" v-for="item,index in frontBack.back" :style="item.style"> <!-- <div class="detail_modal_item_back" :class="{active:body}" v-for="item,index in frontBack.back" :style="item.style">
<img :src="item.imageUrl" alt=""> <img :src="item.imageUrl" alt="">
</div> --> </div> -->

View File

@@ -106,7 +106,7 @@
</label> </label>
<label v-show="operation != 'move'"> <label v-show="operation != 'move'">
<div >{{ $t('exportModel.Size') }}:</div> <div >{{ $t('exportModel.Size') }}:</div>
<input type="range" @input="setPencilWidth" min="1" max="50" v-model="canvasPencilWidth"> <input type="range" @input="setPencilWidth" min="1" max="50" v-model="canvasPencilWidth[operation]">
</label> </label>
<label v-show="operation == 'pencil'"> <label v-show="operation == 'pencil'">
<div >{{ $t('exportModel.Brushwork') }}:</div> <div >{{ $t('exportModel.Brushwork') }}:</div>
@@ -384,6 +384,13 @@ export default defineComponent({
canvas.on("mouse:out", event=>setCanvasOut(event)); canvas.on("mouse:out", event=>setCanvasOut(event));
canvas.on("mouse:down", event=>setCanvasDown(event)); canvas.on("mouse:down", event=>setCanvasDown(event));
canvas.on("mouse:up", event=>setCanvasUp(event)); canvas.on("mouse:up", event=>setCanvasUp(event));
//双击
canvas.on("mouse:dblclick", event=>{
if(operation.value == 'fold'){
foldEnd('Enter')
}
});
// canvas.on('path:created', (event)=>{updateCanvasState()}); // canvas.on('path:created', (event)=>{updateCanvasState()});
// canvas.on("selection:created", (event)=>{setZIndex(event)}); // canvas.on("selection:created", (event)=>{setZIndex(event)});
// canvas.on('object:removed', function() { // canvas.on('object:removed', function() {
@@ -1006,7 +1013,10 @@ export default defineComponent({
// } // }
} }
let canvasPencilColor = ref('#000000')//画笔颜色 let canvasPencilColor = ref('#000000')//画笔颜色
let canvasPencilWidth = ref(20)//画笔大小 // let canvasPencilWidth = ref(20)//画笔大小
let canvasPencilWidth = ref({
})
let allSelectWidth = ref(-1)//多选或单选的宽度 let allSelectWidth = ref(-1)//多选或单选的宽度
let allSelect = ref([])//多选或单选的宽度 let allSelect = ref([])//多选或单选的宽度
let setOperation = (str)=>{ let setOperation = (str)=>{
@@ -1104,7 +1114,7 @@ export default defineComponent({
let patternBrush = new fabric.PatternBrush(canvas) let patternBrush = new fabric.PatternBrush(canvas)
patternBrush.source = img patternBrush.source = img
patternBrush.width = canvasPencilWidth.value; // 设置画笔大小 patternBrush.width = canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20; // 设置画笔大小
canvas.freeDrawingBrush = patternBrush canvas.freeDrawingBrush = patternBrush
} }
let setOperationMode = (str) =>{ let setOperationMode = (str) =>{
@@ -1113,6 +1123,7 @@ export default defineComponent({
let uploadImage = (event)=>{ let uploadImage = (event)=>{
let input = document.querySelector('.uploadImage input') let input = document.querySelector('.uploadImage input')
const file = event.target.files[0]; const file = event.target.files[0];
setOperation('move')
if (file) { if (file) {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (e) => { reader.onload = (e) => {
@@ -1145,7 +1156,7 @@ export default defineComponent({
} }
let clearBrushIndicator = ()=>{ let clearBrushIndicator = ()=>{
let cator = new fabric.Circle({ let cator = new fabric.Circle({
radius:canvasPencilWidth.value/2, radius:(canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20)/2,
fill: '#fff', fill: '#fff',
stroke: '#000', stroke: '#000',
strokeWidth: 1, strokeWidth: 1,
@@ -1218,7 +1229,7 @@ export default defineComponent({
} }
canvas.freeDrawingBrush = pencil canvas.freeDrawingBrush = pencil
canvas.freeDrawingBrush.width = canvasPencilWidth.value; canvas.freeDrawingBrush.width = canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20;
if(brushworkValue.value == 'RibbonBrush' || brushworkValue.value == 'LongfurBrush'){ if(brushworkValue.value == 'RibbonBrush' || brushworkValue.value == 'LongfurBrush'){
canvas.freeDrawingBrush.width = 1; canvas.freeDrawingBrush.width = 1;
@@ -1244,10 +1255,10 @@ export default defineComponent({
canvas.isDrawingMode = true canvas.isDrawingMode = true
let eraser = new fabric.EraserBrush(canvas) let eraser = new fabric.EraserBrush(canvas)
canvas.freeDrawingBrush = eraser canvas.freeDrawingBrush = eraser
brushIndicator.set({fill: '#FFF'}); brushIndicator.set({fill: '#fff'});
canvas.requestRenderAll(); canvas.requestRenderAll();
canvas.freeDrawingBrush.isEraser = true canvas.freeDrawingBrush.isEraser = true
canvas.freeDrawingBrush.width = canvasPencilWidth.value; canvas.freeDrawingBrush.width = canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20;
} }
let setTextFun = (e)=>{ let setTextFun = (e)=>{
if(operation.value != 'text'){ if(operation.value != 'text'){
@@ -1263,13 +1274,13 @@ export default defineComponent({
left: x, left: x,
top: y, top: y,
width: 150, width: 150,
fontSize: canvasPencilWidth.value, fontSize: canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20,
fill:canvasPencilColor.value, fill:canvasPencilColor.value,
}) })
canvas.add(textbox) canvas.add(textbox)
canvas.renderAll();
textbox.enterEditing(); textbox.enterEditing();
canvas.setActiveObject(textbox).renderAll();
} }
} }
@@ -1327,12 +1338,12 @@ export default defineComponent({
} }
let setPencilWidth = ()=>{//切换颜色给铅笔设置颜色 let setPencilWidth = ()=>{//切换颜色给铅笔设置颜色
clearTimeout(setTimeOut.width) clearTimeout(setTimeOut.width)
canvasPencilWidth.value = Number(canvasPencilWidth.value) canvasPencilWidth.value[operation.value] = Number(canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20)
setTimeOut.width = setTimeout(()=>{ setTimeOut.width = setTimeout(()=>{
if(brushworkValue.value == 'LongfurBrush' || brushworkValue.value == 'RibbonBrush'){ if(brushworkValue.value == 'LongfurBrush' || brushworkValue.value == 'RibbonBrush'){
canvas.freeDrawingBrush.width = 1; canvas.freeDrawingBrush.width = 1;
}else{ }else{
canvas.freeDrawingBrush.width = canvasPencilWidth.value; canvas.freeDrawingBrush.width = canvasPencilWidth.value[operation.value];
} }
// setPencil() // setPencil()
},300) },300)
@@ -1352,6 +1363,7 @@ export default defineComponent({
} }
//设置再画布上移动 //设置再画布上移动
let setCanvasMove = (event)=>{ let setCanvasMove = (event)=>{
var pointer = canvas.getPointer(event.e); var pointer = canvas.getPointer(event.e);
if(canvas.isDrawingMode){ if(canvas.isDrawingMode){
canvas.setCursor('none'); canvas.setCursor('none');
@@ -1360,7 +1372,7 @@ export default defineComponent({
canvas.bringToFront(brushIndicator);//设置优先级最高 canvas.bringToFront(brushIndicator);//设置优先级最高
} }
// brushIndicator.fill = canvasPencilColor.value // brushIndicator.fill = canvasPencilColor.value
brushIndicator.set({ left: pointer.x, top: pointer.y, visible: true,radius:canvasPencilWidth.value/2 }); brushIndicator.set({ left: pointer.x, top: pointer.y, visible: true,radius:(canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20)/2 });
}else{ }else{
if(createPatterningIs){ if(createPatterningIs){
@@ -1374,6 +1386,7 @@ export default defineComponent({
} }
//设置再画布上按下 //设置再画布上按下
let setCanvasDown = (event)=>{ let setCanvasDown = (event)=>{
// brushIndicator.set({fill: '#FFF',strokeWidth:0});
//设置移动端按下添加元素 //设置移动端按下添加元素
if(isMoible && present.checked){ if(isMoible && present.checked){
present.checked = false present.checked = false
@@ -1408,7 +1421,7 @@ export default defineComponent({
}) })
// currentPatterning = JScanvasMouseDown(operation.value,event,canvasPencilWidth.value,currentPatterning) // currentPatterning = JScanvasMouseDown(operation.value,event,canvasPencilWidth.value,currentPatterning)
}else{ }else{
currentPatterning = JScanvasMouseDown(operation.value,event,canvasPencilWidth.value,currentPatterning) currentPatterning = JScanvasMouseDown(operation.value,event,canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20,currentPatterning)
canvas.add(currentPatterning) canvas.add(currentPatterning)
canvas.bringToFront(currentPatterning);//设置优先级最高 canvas.bringToFront(currentPatterning);//设置优先级最高
if(operation.value == 'fold'){ if(operation.value == 'fold'){
@@ -1433,7 +1446,7 @@ export default defineComponent({
let polyline = new fabric.Polyline(points, { let polyline = new fabric.Polyline(points, {
fill: operationMode.value == 'fill'? canvasPencilColor.value : 'transparent', fill: operationMode.value == 'fill'? canvasPencilColor.value : 'transparent',
stroke: canvasPencilColor.value, stroke: canvasPencilColor.value,
strokeWidth:canvasPencilWidth.value, strokeWidth:canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20,
selection:false, selection:false,
}) })
canvas.add(polyline) canvas.add(polyline)
@@ -1473,7 +1486,7 @@ export default defineComponent({
if(operationMode.value == 'fill'){ if(operationMode.value == 'fill'){
currentPatterning.set({fill: canvasPencilColor.value}) currentPatterning.set({fill: canvasPencilColor.value})
}else if (operationMode.value == 'border'){ }else if (operationMode.value == 'border'){
currentPatterning.set({fill: 'transparent',stroke: canvasPencilColor.value,strokeWidth: canvasPencilWidth.value}) currentPatterning.set({fill: 'transparent',stroke: canvasPencilColor.value,strokeWidth: canvasPencilWidth.value[operation.value]?canvasPencilWidth.value[operation.value]:20})
} }
if(JSON.stringify(downPoint) == JSON.stringify(upPoint)){ if(JSON.stringify(downPoint) == JSON.stringify(upPoint)){
canvas.remove(currentPatterning) canvas.remove(currentPatterning)

View File

@@ -679,7 +679,7 @@ export default defineComponent({
this.inputTime = setTimeout(()=>{ this.inputTime = setTimeout(()=>{
// let num1 = ((input as HTMLInputElement).value.match(/ /g) || []).length // let num1 = ((input as HTMLInputElement).value.match(/ /g) || []).length
// let num2 = (input as HTMLInputElement).value.split(' ').length // let num2 = (input as HTMLInputElement).value.split(' ').length
if(this.searchPictureName?.split(/\s+/).length > 75){ if(this.searchPictureName?.split(/\s+/).length > 250){
(this.$refs.inputShowText as any).innerHTML = this.t('Generate.maximumLength') (this.$refs.inputShowText as any).innerHTML = this.t('Generate.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{

View File

@@ -671,7 +671,7 @@ export default defineComponent({
}, },
ifMaximumLength(){ ifMaximumLength(){
this.inputTime = setTimeout(()=>{ this.inputTime = setTimeout(()=>{
if(this.captionGeneration?.split(/\s+/).length > 75){ if(this.captionGeneration?.split(/\s+/).length > 250){
(this.$refs.inputShowText as any).innerHTML = this.t('PrintboardUpload.maximumLength') (this.$refs.inputShowText as any).innerHTML = this.t('PrintboardUpload.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{

View File

@@ -525,7 +525,7 @@ export default defineComponent({
// let num1 = ((input as HTMLInputElement).value.match(/ /g) || []).length // let num1 = ((input as HTMLInputElement).value.match(/ /g) || []).length
// let num2 = (input as HTMLInputElement).value.split(' ').length // let num2 = (input as HTMLInputElement).value.split(' ').length
if(this.captionGeneration?.split(/\s+/).length > 75){ if(this.captionGeneration?.split(/\s+/).length > 250){
(this.$refs.inputShowText as any).innerHTML = this.t('SketchboardUpload.maximumLength') (this.$refs.inputShowText as any).innerHTML = this.t('SketchboardUpload.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{

View File

@@ -134,7 +134,7 @@ export default defineComponent({
function callback(entries:any, observer:any) { function callback(entries:any, observer:any) {
entries.forEach((entry:any) => { entries.forEach((entry:any) => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
this_.getTaskMoreList() this_.getTaskMoreList('')
} else { } else {
} }
}); });
@@ -154,12 +154,12 @@ export default defineComponent({
// this.getTaskList() // this.getTaskList()
let time = 100 let time = 100
if(data){ if(data){
time = 1000 time = 10000
} }
setTimeout(() => { setTimeout(() => {
this.currentPage = 1 this.currentPage = 1
this.isShowMark = true this.isShowMark = true
this.getTaskMoreList() this.getTaskMoreList(data)
this.getTaskTime = null this.getTaskTime = null
}, time); }, time);
}, },
@@ -182,7 +182,7 @@ export default defineComponent({
this.currentPage = 1 this.currentPage = 1
this.total = 0 this.total = 0
this.taskListMore = [] this.taskListMore = []
this.getTaskMoreList() this.getTaskMoreList('')
}, },
getTaskList(){ getTaskList(){
clearTimeout(this.getTaskTime) clearTimeout(this.getTaskTime)
@@ -226,7 +226,7 @@ export default defineComponent({
} }
}) })
}, },
getTaskMoreList(){ getTaskMoreList(value:any){
let data = { let data = {
size:this.pageSize, size:this.pageSize,
page: this.currentPage, page: this.currentPage,
@@ -238,12 +238,20 @@ export default defineComponent({
this.isShowMark = false this.isShowMark = false
if(this.currentPage != 1 && rv.content.length == 0){ if(this.currentPage != 1 && rv.content.length == 0){
this.currentPage = 1 this.currentPage = 1
this.getTaskMoreList() this.getTaskMoreList('')
}else{ }else{
this.currentPage += 1 this.currentPage += 1
this.taskListMore.push(...rv.content) this.taskListMore.push(...rv.content)
this.total = rv.total this.total = rv.total
this.taskListUnfinished = [] this.taskListUnfinished = []
rv.content.forEach((item:any) => {
value.forEach((valueItem:any) => {
if(valueItem == item.taskId && item.status == 'success'){
downloadIamge(item.outputImage,item.imageName)
this.store.dispatch('getCredits')
}
});
});
this.taskListMore.forEach((item:any,index:number)=>{ this.taskListMore.forEach((item:any,index:number)=>{
if(item.status == 'Waiting' || item.status == 'Executing'){ if(item.status == 'Waiting' || item.status == 'Executing'){
item.index = index item.index = index
@@ -260,7 +268,6 @@ export default defineComponent({
}); });
}, },
setDownloadIamge(item:any){ setDownloadIamge(item:any){
console.log(item);
downloadIamge(item.outputImage,item.imageName) downloadIamge(item.outputImage,item.imageName)
} }

View File

@@ -1052,7 +1052,7 @@ export default defineComponent({
ifMaximumLength(){ ifMaximumLength(){
clearTimeout(this.inputTime) clearTimeout(this.inputTime)
this.inputTime = setTimeout(()=>{ this.inputTime = setTimeout(()=>{
if(this.captionGeneration?.split(/\s+/).length > 75){ if(this.captionGeneration?.split(/\s+/).length > 250){
(this.$refs.inputShowText as any).innerHTML = this.t('LibraryPage.maximumLength') (this.$refs.inputShowText as any).innerHTML = this.t('LibraryPage.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{