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

@@ -3,6 +3,6 @@ NODE_ENV = 'development'
# VUE_APP_BASE_URL = 'https://api.aida.com.hk' # VUE_APP_BASE_URL = 'https://api.aida.com.hk'
# VUE_APP_BASE_URL = 'http://18.167.251.121:10086' # VUE_APP_BASE_URL = 'http://18.167.251.121:10086'
# VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk'
# VUE_APP_BASE_URL = 'http://192.168.1.9:17088' # VUE_APP_BASE_URL = 'http://192.168.1.9:17088'
VUE_APP_BASE_URL = 'http://192.168.1.7:5567' # VUE_APP_BASE_URL = 'http://192.168.1.7:5567'

View File

@@ -1206,13 +1206,13 @@ i {
.design_detail_modal_component .input_border span, .design_detail_modal_component .input_border span,
.library_page .input_border span { .library_page .input_border span {
position: absolute; position: absolute;
bottom: -1.5rem; bottom: -2rem;
left: 0; left: 0;
font-size: calc(1.2rem*1.2); zoom: 0.8;
font-size: 1.2rem;
color: red; color: red;
opacity: 0; opacity: 0;
transform: scale(0.7); width: 100%;
transform-origin: left bottom;
} }
.collection_modal_body .input_border .generage_btn, .collection_modal_body .input_border .generage_btn,
.design_detail_modal_component .input_border .generage_btn, .design_detail_modal_component .input_border .generage_btn,

View File

@@ -1299,13 +1299,16 @@ i{
span{ span{
position: absolute; position: absolute;
// bottom: calc(0rem*1.2); // bottom: calc(0rem*1.2);
bottom: -1.5rem; bottom: -2rem;
left: 0; left: 0;
font-size: calc(1.2rem*1.2); zoom: .8;
// font-size: calc(1.2rem*1.2);
font-size: 1.2rem;
color: red; color: red;
opacity: 0; opacity: 0;
transform: scale(.7); // transform: scale(.7);
transform-origin: left bottom; // transform-origin: left bottom;
width: 100%;
} }
.generage_btn{ .generage_btn{

View File

@@ -43,8 +43,8 @@
</ul> </ul>
</div> </div>
</div> </div>
<div v-else class="input_border" :class="[inputShow?'active':'',]"> <div v-else class="input_border" >
<div class="input_box Guide_1_5"> <div class="input_box Guide_1_5" :class="[inputShow || inputShowEffectPoor?'active':'',]">
<input <input
class="search_input" class="search_input"
@input="ifMaximumLength" @input="ifMaximumLength"
@@ -54,7 +54,7 @@
@keydown.enter="getgenerate()" @keydown.enter="getgenerate()"
/> />
<div class="generage_btn started_btn" @click.stop="getgenerate">{{ $t('Generate.Generate') }}</div> <div class="generage_btn started_btn" @click.stop="getgenerate">{{ $t('Generate.Generate') }}</div>
<span>{{ $t('Generate.maximumLength') }}</span> <span ref="inputShowText"></span>
</div> </div>
</div> </div>
@@ -253,7 +253,8 @@ export default defineComponent({
let workspace:any = ref({}) let workspace:any = ref({})
let loadingShow = ref(false) let loadingShow = ref(false)
let inputShow = ref(false) let inputShow = ref(false)//表示是否出现红框
let inputShowEffectPoor = ref(false)//表示是否出现红框
let inputTime = ref() let inputTime = ref()
let driver__:any = inject('driver__') let driver__:any = inject('driver__')
let {t} = useI18n() let {t} = useI18n()
@@ -291,6 +292,7 @@ export default defineComponent({
// sketchCatecoryList, // sketchCatecoryList,
workspace, workspace,
inputShow, inputShow,
inputShowEffectPoor,
inputTime, inputTime,
driver__, driver__,
t, t,
@@ -612,16 +614,20 @@ export default defineComponent({
(rv) => { (rv) => {
if(this.loadingShow){//防止取消后有正在执行的获取状态 if(this.loadingShow){//防止取消后有正在执行的获取状态
let arr:any = [] 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) => { rv.forEach((element:any) => {
element.imgUrl = element.url
element.id_ = GO.id++
this.fileList.forEach((item:any,index:any) => { this.fileList.forEach((item:any,index:any) => {
if(item.taskId == element.taskId && element.status == 'Success'){ if(item.taskId == element.taskId && element.status == 'Success'){
element.imgUrl = element.url
element.id_ = GO.id++
this.fileList[index] = element this.fileList[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){ if(arr.length == 0){
nextTick().then(()=>{ nextTick().then(()=>{
if(this.driver__.driver){ if(this.driver__.driver){
@@ -669,8 +675,10 @@ 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.searchPictureName?.split(/\s+/).length > 75){ if(this.searchPictureName?.split(/\s+/).length > 75){
(this.$refs.inputShowText as any).innerHTML = this.t('Generate.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{
this.inputShowEffectPoor = false
this.inputShow = false this.inputShow = false
} }
},500) },500)

View File

@@ -104,10 +104,10 @@
</div> </div>
<div v-show="openClick == 3" class="modal_accomplish"> <div v-show="openClick == 3" class="modal_accomplish">
<div class="input_border"> <div class="input_border">
<div class="Guide_1_2_8 input_box" :class="[inputShow?'active':'',driver__.driver?'showEvents':'']"> <div class="Guide_1_2_8 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"> <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> <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> <!-- <div>
<div v-show="!isUseGenerate" @click="setUseGenerate">Printboard</div> <div v-show="!isUseGenerate" @click="setUseGenerate">Printboard</div>
@@ -186,6 +186,7 @@ export default defineComponent({
]) ])
let loadingShow = ref(false) let loadingShow = ref(false)
let inputShow = ref(false) let inputShow = ref(false)
let inputShowEffectPoor = ref(false)//表示是否出现红框
let inputTime = ref() let inputTime = ref()
let driver__:any = inject('driver__') let driver__:any = inject('driver__')
let {t} = useI18n() let {t} = useI18n()
@@ -212,6 +213,7 @@ export default defineComponent({
generateList, generateList,
loadingShow, loadingShow,
inputShow, inputShow,
inputShowEffectPoor,
inputTime, inputTime,
driver__, driver__,
t, t,
@@ -627,11 +629,12 @@ export default defineComponent({
this.generateCheckbox = value this.generateCheckbox = value
}, },
ifMaximumLength(){ ifMaximumLength(){
clearTimeout(this.inputTime)
this.inputTime = setTimeout(()=>{ this.inputTime = setTimeout(()=>{
if(this.captionGeneration?.split(/\s+/).length > 75){ if(this.captionGeneration?.split(/\s+/).length > 75){
(this.$refs.inputShowText as any).innerHTML = this.t('PrintboardUpload.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{
this.inputShowEffectPoor = false
this.inputShow = false this.inputShow = false
} }
},500) },500)
@@ -761,15 +764,19 @@ export default defineComponent({
let arr:any = [] 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')
rv.forEach((element:any) => { rv.forEach((element:any) => {
element.imgUrl = element.url
element.id_ = GO.id++
this.generateList.forEach((item:any,index:any) => { this.generateList.forEach((item:any,index:any) => {
if(item.taskId == element.taskId && element.status == 'Success'){ if(item.taskId == element.taskId && element.status == 'Success'){
element.imgUrl = element.url
element.id_ = GO.id++
this.generateList[index] = element this.generateList[index] = element
} }
}); });
}); });
// this.generateList = rv; // 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){ if(arr.length == 0){
nextTick().then(()=>{ nextTick().then(()=>{
if(this.driver__.driver){ if(this.driver__.driver){

View File

@@ -182,10 +182,10 @@
</div> </div>
<div v-show="openClick == 3" class="modal_accomplish"> <div v-show="openClick == 3" class="modal_accomplish">
<div class="input_border"> <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"> <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> <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> <!-- <div>
<div v-show="!isUseGenerate" @click="setUseGenerate">Printboard</div> <div v-show="!isUseGenerate" @click="setUseGenerate">Printboard</div>
@@ -305,6 +305,7 @@ export default defineComponent({
}) })
let workspace:any = ref({}) let workspace:any = ref({})
let inputShow = ref(false) let inputShow = ref(false)
let inputShowEffectPoor = ref(false)//表示是否出现红框
let inputTime = ref() let inputTime = ref()
let sketchboardList:any = computed(()=>{ let sketchboardList:any = computed(()=>{
return store.state.UploadFilesModule.sketchboard return store.state.UploadFilesModule.sketchboard
@@ -334,6 +335,7 @@ export default defineComponent({
sketchCatecoryList, sketchCatecoryList,
workspace, workspace,
inputShow, inputShow,
inputShowEffectPoor,
inputTime, inputTime,
sketchboardList, sketchboardList,
t, t,
@@ -641,8 +643,10 @@ export default defineComponent({
// 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 > 75){
(this.$refs.inputShowText as any).innerHTML = this.t('SketchboardUpload.maximumLength')
this.inputShow = true this.inputShow = true
}else{ }else{
this.inputShowEffectPoor = false
this.inputShow = false this.inputShow = false
} }
},500) },500)
@@ -871,19 +875,23 @@ export default defineComponent({
(rv) => { (rv) => {
if(this.loadingShow){//防止取消后有正在执行的获取状态 if(this.loadingShow){//防止取消后有正在执行的获取状态
let arr:any = [] 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) => { 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) => { this.generateList.forEach((item:any,index:any) => {
if(item.taskId == element.taskId && element.status == 'Success'){ if(item.taskId == element.taskId && element.status == 'Success'){
this.generateList[index] = element 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; // 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){ if(arr.length == 0){
nextTick().then(()=>{ nextTick().then(()=>{
if(this.driver__.driver){ if(this.driver__.driver){

View File

@@ -341,6 +341,7 @@ export default {
currently:'您排在队列中的第{generateLineUp}位', currently:'您排在队列中的第{generateLineUp}位',
Merge:'合成', Merge:'合成',
maximumLength:'输入的内容超过允许输入的最大长度', maximumLength:'输入的内容超过允许输入的最大长度',
effectPoor:'当前输入的内容生成出的效果不佳,请调整输入的内容。',
Model:'模型', Model:'模型',
jsContent1:"您只能上传图片文件!", jsContent1:"您只能上传图片文件!",
jsContent2:'图片必须小于2MB', jsContent2:'图片必须小于2MB',

View File

@@ -342,6 +342,7 @@ export default {
currently:'You are currently in the {generateLineUp} th position in the queue', currently:'You are currently in the {generateLineUp} th position in the queue',
Merge:'Merge', Merge:'Merge',
maximumLength:'The entered content exceeds the maximum length.', maximumLength:'The entered content exceeds the maximum length.',
effectPoor:'The image generated by the current input content effect is poor, please adjust the input content.',
Model:'Model', Model:'Model',
jsContent1:"You can only upload Image file!", jsContent1:"You can only upload Image file!",
jsContent2:'Image must smaller than 2MB!', jsContent2:'Image must smaller than 2MB!',

View File

@@ -29,8 +29,8 @@ let httpIp = process.env.NODE_ENV == 'development' ? "" : "";
// let httpIp = process.env.NODE_ENV == 'development' ? "https://192.168.0.102:10086" : ""; // let httpIp = process.env.NODE_ENV == 'development' ? "https://192.168.0.102:10086" : "";
// console.log(httpIp,process.env.VUE_APP_BASE_URL); // console.log(httpIp,process.env.VUE_APP_BASE_URL);
// axios.defaults.baseURL = httpIp; //配置接口地址 axios.defaults.baseURL = httpIp; //配置接口地址
axios.defaults.baseURL = process.env.VUE_APP_BASE_URL; //配置接口地址 // axios.defaults.baseURL = process.env.VUE_APP_BASE_URL; //配置接口地址
// console.log(process.env.VUE_APP_BASE_URL); // console.log(process.env.VUE_APP_BASE_URL);
//POST传参序列化(添加请求拦截器) //POST传参序列化(添加请求拦截器)
@@ -56,7 +56,7 @@ axios.interceptors.response.use((res) =>{
// return Promise.reject(res.data); // return Promise.reject(res.data);
// }else // }else
if (res.data) { if (res.data) {
if (res.data.errCode === 0) { if (res.data.errCode === 0) {
// message.error(res.data.errMsg) // message.error(res.data.errMsg)
return Promise.resolve(res.data.data); return Promise.resolve(res.data.data);
} else if(res.data.errCode === 1){ } else if(res.data.errCode === 1){

View File

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