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

@@ -182,10 +182,10 @@
</div>
<div v-show="openClick == 3" class="modal_accomplish">
<div class="input_border">
<div class="Guide_1_9_2 input_box" :class="[inputShow?'active':'',driver__.driver?'showEvents':'']">
<div class="Guide_1_9_2 input_box" :class="[inputShow || inputShowEffectPoor?'active':'',driver__.driver?'showEvents':'']">
<input class="search_input" @input="ifMaximumLength" @keydown.enter="getgenerate" :maxlength='inputShow?0:9999' :class="{forbidden:generateCheckbox}" :readonly="generateCheckbox" :placeholder="$t('PrintboardUpload.inputContent1')" v-model="captionGeneration">
<div class="generage_btn started_btn" @click.stop="getgenerate">{{ $t('PrintboardUpload.Generate') }}</div>
<span>{{ $t('PrintboardUpload.maximumLength') }}</span>
<span ref="inputShowText"></span>
</div>
<!-- <div>
<div v-show="!isUseGenerate" @click="setUseGenerate">Printboard</div>
@@ -305,6 +305,7 @@ export default defineComponent({
})
let workspace:any = ref({})
let inputShow = ref(false)
let inputShowEffectPoor = ref(false)//表示是否出现红框
let inputTime = ref()
let sketchboardList:any = computed(()=>{
return store.state.UploadFilesModule.sketchboard
@@ -334,6 +335,7 @@ export default defineComponent({
sketchCatecoryList,
workspace,
inputShow,
inputShowEffectPoor,
inputTime,
sketchboardList,
t,
@@ -641,8 +643,10 @@ export default defineComponent({
// let num2 = (input as HTMLInputElement).value.split(' ').length
if(this.captionGeneration?.split(/\s+/).length > 75){
(this.$refs.inputShowText as any).innerHTML = this.t('SketchboardUpload.maximumLength')
this.inputShow = true
}else{
this.inputShowEffectPoor = false
this.inputShow = false
}
},500)
@@ -871,19 +875,23 @@ export default defineComponent({
(rv) => {
if(this.loadingShow){//防止取消后有正在执行的获取状态
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')
rv.forEach((element:any) => {
element.imgUrl = element.url
element.id_ = GO.id++
element.category = generage.level2Type?generage.level2Type:sketchCatecoryList[0].name,
element.categoryValue = categoryValue?categoryValue:sketchCatecoryList[0].value,
this.generateList.forEach((item:any,index:any) => {
if(item.taskId == element.taskId && element.status == 'Success'){
this.generateList[index] = element
element.imgUrl = element.url
element.id_ = GO.id++
element.category = generage.level2Type?generage.level2Type:sketchCatecoryList[0].name
element.categoryValue = categoryValue?categoryValue:sketchCatecoryList[0].value
}
});
});
// this.generateList = rv;
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){
nextTick().then(()=>{
if(this.driver__.driver){