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 = '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.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,
.library_page .input_border span {
position: absolute;
bottom: -1.5rem;
bottom: -2rem;
left: 0;
font-size: calc(1.2rem*1.2);
zoom: 0.8;
font-size: 1.2rem;
color: red;
opacity: 0;
transform: scale(0.7);
transform-origin: left bottom;
width: 100%;
}
.collection_modal_body .input_border .generage_btn,
.design_detail_modal_component .input_border .generage_btn,

View File

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

View File

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

View File

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

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){

View File

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

View File

@@ -342,6 +342,7 @@ export default {
currently:'You are currently in the {generateLineUp} th position in the queue',
Merge:'Merge',
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',
jsContent1:"You can only upload Image file!",
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" : "";
// console.log(httpIp,process.env.VUE_APP_BASE_URL);
// axios.defaults.baseURL = httpIp; //配置接口地址
axios.defaults.baseURL = process.env.VUE_APP_BASE_URL; //配置接口地址
axios.defaults.baseURL = httpIp; //配置接口地址
// axios.defaults.baseURL = process.env.VUE_APP_BASE_URL; //配置接口地址
// console.log(process.env.VUE_APP_BASE_URL);
//POST传参序列化(添加请求拦截器)
@@ -56,7 +56,7 @@ axios.interceptors.response.use((res) =>{
// return Promise.reject(res.data);
// }else
if (res.data) {
if (res.data.errCode === 0) {
if (res.data.errCode === 0) {
// message.error(res.data.errMsg)
return Promise.resolve(res.data.data);
} else if(res.data.errCode === 1){

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)