generate功能调整

This commit is contained in:
X1627315083
2024-04-24 13:36:27 +08:00
parent f26925a2b5
commit ee4ed450a8
10 changed files with 76 additions and 37 deletions

View File

@@ -204,7 +204,7 @@
</div>
</div>
<div class="input_border">
<div class="input_box" :class="{active:inputShow}">
<div class="input_box" :class="{active:inputShow || inputShowEffectPoor}">
<input
class="search_input "
@input="ifMaximumLength"
@@ -214,7 +214,7 @@
:placeholder="$t('LibraryPage.inputContent2')"
v-model="captionGeneration">
<div class="generage_btn started_btn" @click.stop="getgenerate">{{ $t('LibraryPage.Generate') }}</div>
<span>{{ $t('LibraryPage.maximumLength') }}</span>
<span ref="inputShowText"></span>
</div>
</div>
<div v-show="selectCode == 'Printboard'" class="printModel">
@@ -408,6 +408,7 @@ export default defineComponent({
},
]);
let inputShow = ref(false)
let inputShowEffectPoor = ref(false)//表示是否出现红框
let generateCheckbox:any = ref()
let captionGeneration:any = ref()
let inputTime = ref()
@@ -471,6 +472,7 @@ export default defineComponent({
uploadGenerate,
checkbox,
inputShow,
inputShowEffectPoor,
generateCheckbox,
captionGeneration,
inputTime,
@@ -624,6 +626,8 @@ export default defineComponent({
this.captionGeneration = ''
this.selectGenerateList = []
this.generateList = []
this.inputShowEffectPoor = false
this.inputShow = false
}
this.upload.level1Type = menu.code
}
@@ -965,8 +969,10 @@ export default defineComponent({
clearTimeout(this.inputTime)
this.inputTime = setTimeout(()=>{
if(this.captionGeneration?.split(/\s+/).length > 75){
(this.$refs.inputShowText as any).innerHTML = this.t('LibraryPage.maximumLength')
this.inputShow = true
}else{
this.inputShowEffectPoor = false
this.inputShow = false
}
},500)
@@ -1167,16 +1173,21 @@ export default defineComponent({
(rv) => {
if(this.isShowMark){//防止取消后有正在执行的获取状态
let arr:any = []
arr = rv.filter((item:any)=>item.status != 'Success' && item.status != 'Fail')
arr = rv.filter((item:any)=>item.status != 'Success' && item.status != 'Fail' && item.status != 'Invalid')
console.log(arr);
rv.forEach((element:any) => {
element.imgUrl = element.url
this.generateList.forEach((item:any,index:any) => {
if(item.taskId == element.taskId && element.status == 'Success'){
element.imgUrl = element.url
this.generateList[index] = element
}
});
});
if(rv.filter((item:any)=>item.status == 'Invalid').length == 4) {
(this.$refs.inputShowText as any).innerHTML = this.t('Generate.effectPoor')
this.inputShowEffectPoor = true
}
if(arr.length == 0){
this.generateList = this.generateList.filter((item:any)=>item.status == 'Success')
clearInterval(this.generateTime)