Fix known bugs of mj chat (#258)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2025-08-16 17:32:33 +08:00
1 parent 7877ec5c06
commit 8e5711d083
95 files changed
+5899 -5177

No files matched your search

+15 -10
View File
@@ -1,10 +1,11 @@
<template>
<div class="flex flex-col h-full">
<div class="flex-1 overflow-y-auto p-[15px]">
<el-tabs v-model="activeTab" class="demo-tabs" stretch>
<el-tab-pane :label="$t('midjourney.tab.images')" name="image">
<el-tabs v-model="type" class="demo-tabs" stretch>
<el-tab-pane :label="$t('midjourney.tab.images')" name="imagine">
<div class="pt-2">
<model-selector class="mb-2" />
<prompt-input class="mb-4" />
<reference-image class="mb-2" />
<ratio-selector class="mb-4" />
<quality-selector class="mb-4" />
@@ -18,11 +19,9 @@
<image-weight-selector class="mb-2" />
<style-selector class="mb-2" />
</div>
<prompt-input class="mb-4" />
</div>
</el-tab-pane>
<el-tab-pane :label="$t('midjourney.tab.videos')" name="video">
<el-tab-pane :label="$t('midjourney.tab.videos')" name="videos">
<div class="pt-2">
<video-from-input v-show="config?.action === 'extend'" class="mb-4" />
<image-url-input class="mb-2" />
@@ -39,7 +38,7 @@
<div class="flex flex-col px-[15px] pb-[15px]">
<consumption :value="consumption" :service="service" />
<div class="flex gap-1">
<mode-selector v-if="activeTab !== 'describe'" />
<mode-selector v-if="type !== 'describe'" />
<el-button v-if="config.action === 'extend'" type="primary" class="btn w-full" round @click="$emit('generate')">
{{ $t('midjourney.button.extend') }}
</el-button>
@@ -73,6 +72,7 @@ import ReferenceImage from './config/ReferenceImage.vue';
import { ElButton, ElTabs, ElTabPane } from 'element-plus';
import Consumption from '../common/Consumption.vue';
import { getConsumption } from '@/utils';
import { MIDJOURNEY_DEFAULT_TYPE } from '@/constants';
export default defineComponent({
name: 'ConfigPanel',
@@ -104,15 +104,15 @@ export default defineComponent({
config() {
return this.$store.state.midjourney.config;
},
activeTab: {
type: {
get() {
return this.$store.state.midjourney.config.active_tab || 'image';
return this.$store.state.midjourney.config.type || MIDJOURNEY_DEFAULT_TYPE;
},
set(val: string) {
console.debug('set active_tab', val);
console.debug('set type', val);
this.$store.commit('midjourney/setConfig', {
...this.$store.state.midjourney.config,
active_tab: val
type: val
});
}
},
@@ -122,6 +122,11 @@ export default defineComponent({
service() {
return this.$store.state.midjourney?.service;
}
},
mounted() {
if (!this.config.type) {
this.type = MIDJOURNEY_DEFAULT_TYPE;
}
}
});
</script>
@@ -9,7 +9,7 @@
<el-input-number v-model="value" controls-position="right" />
</div>
</div>
<div class="w-full">
<div class="w-full px-2">
<el-slider v-model="value" :min="0" :max="100" :step="1" />
</div>
</div>
@@ -9,7 +9,7 @@
<el-input-number v-model="value" size="small" controls-position="right" />
</div>
</div>
<div class="w-full">
<div class="w-full px-2">
<el-slider v-model="value" :min="0" :max="2" :step="0.1" />
</div>
</div>
@@ -9,7 +9,7 @@
<el-input-number v-model="value" controls-position="right" />
</div>
</div>
<div class="w-full">
<div class="w-full px-2">
<el-slider v-model="value" :min="0" :max="100" :step="1" />
</div>
</div>
@@ -4,7 +4,7 @@
<span class="text-sm font-bold">{{ $t('midjourney.name.extend') }}</span>
</div>
<div>
<video-player v-if="config?.video_url" :src="config?.video_url" />
<video-player v-if="config?.video_url" :src="config?.video_url" :options="options" />
</div>
</div>
</template>
@@ -27,7 +27,9 @@ export default defineComponent({
},
data() {
return {
options: { quality: { default: '1080p' } }
options: {
controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'captions', 'settings', 'fullscreen']
}
};
},
computed: {
@@ -9,7 +9,7 @@
<el-input-number v-model="value" controls-position="right" />
</div>
</div>
<div class="w-full">
<div class="w-full px-2">
<el-slider v-model="value" :min="0" :max="1000" :step="1" />
</div>
</div>
+15 -29
View File
@@ -11,7 +11,7 @@
</span>
</div>
<div class="info">
<p v-if="modelValue?.request?.prompt" class="prompt mt-2">
<p v-if="modelValue?.request?.prompt" class="prompt">
{{ modelValue?.request?.prompt }}
<span v-if="!modelValue?.response"> - ({{ $t('midjourney.status.pending') }}) </span>
<span v-if="modelValue?.response?.progress !== undefined && modelValue?.response?.progress !== 100">
@@ -19,7 +19,7 @@
</span>
<span>({{ modelValue?.request?.mode }})</span>
</p>
<p v-if="modelValue?.request?.image_id" class="prompt mt-2">
<p v-if="modelValue?.request?.image_id" class="prompt">
{{ modelValue?.request?.image_id }} - {{ modelValue?.request?.action }}
<span v-if="!modelValue?.response"> - ({{ $t('midjourney.status.pending') }}) </span>
<span>({{ modelValue?.request?.mode }})</span>
@@ -56,7 +56,7 @@
:raw-src="modelValue?.response?.raw_image_url"
class="image"
/>
<div v-if="modelValue?.response?.actions" :class="{ operations: true, full, 'mt-2': true }">
<div v-if="modelValue?.response?.actions" :class="{ operations: true, full }">
<el-tooltip
v-for="(action, actionKey) in modelValue?.response?.actions"
:key="actionKey"
@@ -122,7 +122,7 @@
</span>
</div>
<div class="info">
<p v-if="modelValue?.request?.prompt" class="prompt mt-2">
<p v-if="modelValue?.request?.prompt" class="prompt">
{{ modelValue?.request?.prompt }}
<span v-if="!modelValue?.response"> - ({{ $t('midjourney.status.pending') }}) </span>
<span v-if="modelValue?.response?.progress !== undefined && modelValue?.response?.progress !== 100">
@@ -130,7 +130,7 @@
</span>
<span>({{ modelValue?.request?.mode }})</span>
</p>
<p v-if="modelValue?.request?.video_id" class="prompt mt-2">
<p v-if="modelValue?.request?.video_id" class="prompt">
{{ modelValue?.request?.video_id }} - {{ modelValue?.request?.action }}
<span v-if="!modelValue?.response"> - ({{ $t('midjourney.status.pending') }}) </span>
<span>({{ modelValue?.request?.mode }})</span>
@@ -207,7 +207,7 @@
</div>
<!-- response pending -->
<div v-if="!modelValue?.response">
<el-alert :closable="false" class="mt-2 info">
<el-alert :closable="false" class="info">
<p class="text-[var(--el-text-color-regular)] text-xs mb-0">
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
{{ $t('midjourney.field.taskId') }}:
@@ -230,7 +230,7 @@
</span>
</div>
<div class="info">
<p v-if="modelValue?.request?.image_url" class="prompt mt-2">
<p v-if="modelValue?.request?.image_url" class="prompt">
{{ modelValue?.request?.image_url }}
<span v-if="!modelValue?.response?.descriptions"> - ({{ $t('midjourney.status.describePending') }}) </span>
<span v-if="modelValue?.response?.descriptions"> - ({{ $t('midjourney.status.describeComplete') }}) </span>
@@ -262,35 +262,21 @@
</p>
</el-alert>
</div>
<!-- response success -->
<div v-if="modelValue?.response?.descriptions" :class="{ content: true, full: full }">
<div class="mb-4">
<!-- 描述列表 -->
<div class="mb-4">
<div
v-for="(description, index) in modelValue.response.descriptions"
:key="index"
class="flex items-start mb-3"
>
<div class="mb-2">
<div class="mb-2">
<div v-for="(description, index) in modelValue.response.descriptions" :key="index" class="flex items-start">
<div v-if="description !== ''">
<!-- 使用 el-tag 美化序号 -->
<el-tag
effect="dark"
color="#3574F0"
size="small"
type="primary"
class="flex-shrink-0 font-bold mr-3 mt-0.5 border-0"
>
<el-tag effect="dark" size="small" type="primary" round class="mr-1">
{{ index + 1 }}
</el-tag>
<span class="text-sm text-[var(--el-text-color-primary)]">
{{ description }}
<copy-to-clipboard :content="description" />
</span>
</div>
</div>
</div>
<!-- 参考图片 -->
<image-wrapper
v-if="modelValue?.request?.image_url"
:src="modelValue?.request?.image_url"
@@ -298,7 +284,7 @@
class="image w-full rounded-lg"
/>
</div>
<el-alert :closable="false" class="mt-2 success">
<el-alert :closable="false" class="success">
<p class="text-[var(--el-text-color-regular)] text-xs mb-2">
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
{{ $t('midjourney.field.taskId') }}:
@@ -315,7 +301,7 @@
</div>
<!-- response pending -->
<div v-if="!modelValue?.response">
<el-alert :closable="false" class="mt-2 info">
<el-alert :closable="false" class="info">
<p class="text-[var(--el-text-color-regular)] text-xs mb-0">
<font-awesome-icon icon="fa-solid fa-magic" class="mr-1" />
{{ $t('midjourney.field.taskId') }}:
@@ -496,7 +482,7 @@ $left-width: 70px;
font-size: 16px;
font-weight: bold;
color: rgb(46, 204, 113);
margin-bottom: 0;
margin-bottom: 10px;
margin-top: 0;
.datetime {
font-size: 12px;
+1 -2
View File
@@ -8,7 +8,7 @@
<div
v-else-if="tasks.length > 0"
ref="panel"
class="p-2 h-full flex flex-col overflow-y-auto"
class="p-2 py-3 h-full flex flex-col overflow-y-auto tasks"
@scroll="onHandleScroll"
>
<task-item
@@ -52,7 +52,6 @@ export default defineComponent({
methods: {
onHandleScroll() {
const el = this.$refs.panel as HTMLElement;
console.log('onHandleScroll ', el.scrollTop);
if (el.scrollTop === 0) {
console.log('reach-top reach-top');
this.$emit('reach-top');