Fix style layout (#78)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2024-07-08 22:47:45 +08:00
1 parent fbd3336a2c
commit f8b297c9da
223 files changed
+14795 -12370

No files matched your search

+21 -3
View File
@@ -10,7 +10,7 @@
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="12" :offset="6">
<el-col :span="16" :offset="4">
<el-skeleton v-if="loading" />
<el-form v-else-if="application" label-width="100px">
<el-form-item :label="$t('application.field.service')">
@@ -22,6 +22,7 @@
v-for="(pkg, pkgIndex) in application?.service.packages"
:key="pkgIndex"
:label="pkg.id"
class="mb-2"
>
{{ pkg.amount }} {{ $t(`service.unit.${application?.service?.unit}s`) }}
</el-radio-button>
@@ -29,6 +30,15 @@
</el-form-item>
<el-form-item :label="$t('service.field.price')">
<price :price="package?.price" />
<span v-if="package" class="ml-2"
>({{
$t('service.message.around') +
' $' +
(package?.price / package?.amount).toFixed(4) +
' / ' +
$t(`service.unit.${application?.service?.unit}`)
}})
</span>
</el-form-item>
<el-divider border-style="dashed" />
<el-form-item :label="$t('application.field.shouldPayPrice')">
@@ -86,7 +96,7 @@ interface IData {
application: IApplication | undefined;
loading: boolean;
form: {
amount: number;
amount: number | undefined;
packageId: string | undefined;
};
creating: boolean;
@@ -112,7 +122,8 @@ export default defineComponent({
application: undefined,
loading: false,
form: {
packageId: undefined
packageId: undefined,
amount: undefined
},
creating: false
};
@@ -222,4 +233,11 @@ export default defineComponent({
.pagination {
float: right;
}
@media (max-width: 767px) {
.panel {
width: 100%;
height: 100%;
}
}
</style>
+4
View File
@@ -244,5 +244,9 @@ export default defineComponent({
.help {
top: 40px;
}
.panel {
width: 100%;
height: 100%;
}
}
</style>
+11 -4
View File
@@ -10,7 +10,7 @@
<el-col :span="24">
<el-card shadow="hover">
<el-row>
<el-col :span="14" :offset="5">
<el-col :span="16" :offset="4">
<div v-if="loading" class="pt-5">
<el-skeleton animated />
</div>
@@ -47,19 +47,19 @@
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PAID" class="mb-5">
<el-col :span="14" :offset="5">
<el-col :span="16" :offset="4">
<el-divider border-style="dashed" />
<el-alert :title="$t('order.message.paidSuccessfully')" type="success" show-icon :closable="false" />
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.EXPIRED" class="mb-5">
<el-col :span="14" :offset="5">
<el-col :span="16" :offset="4">
<el-divider border-style="dashed" />
<el-alert :title="$t('order.message.orderExpired')" type="error" show-icon :closable="false" />
</el-col>
</el-row>
<el-row v-if="order?.state === OrderState.PENDING || order?.state === OrderState.FAILED">
<el-col :span="14" :offset="5">
<el-col :span="16" :offset="4">
<el-divider border-style="dashed" />
<div v-if="showPayWays && order.price && order.price > 0 && !order.pay_way" class="payways mb-6">
<div
@@ -356,4 +356,11 @@ export default defineComponent({
width: 150px;
}
}
@media (max-width: 767px) {
.panel {
width: 100%;
height: 100%;
}
}
</style>
+4
View File
@@ -229,5 +229,9 @@ export default defineComponent({
.help {
top: 40px;
}
.panel {
width: 100%;
height: 100%;
}
}
</style>
+11 -9
View File
@@ -18,8 +18,7 @@
<el-card v-show="operating" class="operations">
<reference-image class="mb-4" @change="references = $event" />
<elements-selector v-model="elements" :advanced="preset?.advanced" class="mb-4" />
<ignore-selector v-if="preset?.advanced" v-model="ignore" class="mb-4" />
<final-prompt v-if="finalPrompt" :model-value="finalPrompt" />
<ignore-selector v-if="preset?.advanced" v-model="ignore" />
</el-card>
<input-box
:prompt="prompt"
@@ -46,8 +45,7 @@ import ReferenceImage from '@/components/midjourney/ReferenceImage.vue';
import { applicationOperator, midjourneyOperator } from '@/operators';
import ApplicationStatus from '@/components/application/Status.vue';
import TaskList from '@/components/midjourney/tasks/TaskList.vue';
import FinalPrompt from '@/components/midjourney/FinalPrompt.vue';
import { ERROR_CODE_DUPLICATION } from '@/constants/errorCode';
import { ERROR_CODE_DUPLICATION, ERROR_CODE_FORBIDDEN, ERROR_CODE_USED_UP } from '@/constants/errorCode';
import { Status } from '@/models';
import { IMidjourneyImagineRequest, IApplicationDetailResponse, MidjourneyImagineAction } from '@/models';
import {
@@ -82,7 +80,6 @@ export default defineComponent({
IgnoreSelector,
ApplicationStatus,
TaskList,
FinalPrompt,
Layout
},
data(): IData {
@@ -250,7 +247,7 @@ export default defineComponent({
console.error('no token specified');
return;
}
ElMessage.success(this.$t('midjourney.message.startingTask'));
ElMessage.info(this.$t('midjourney.message.startingTask'));
midjourneyOperator
.imagine(request, {
token
@@ -258,8 +255,13 @@ export default defineComponent({
.then(() => {
ElMessage.success(this.$t('midjourney.message.startTaskSuccess'));
})
.catch(() => {
ElMessage.error(this.$t('midjourney.message.startTaskFailed'));
.catch((error) => {
const response = error?.response?.data;
if (response?.error?.code === ERROR_CODE_USED_UP) {
ElMessage.error(this.$t('midjourney.message.usedUp'));
} else {
ElMessage.error(this.$t('midjourney.message.startTaskFailed'));
}
})
.finally(async () => {
await this.onGetTasks();
@@ -331,7 +333,7 @@ export default defineComponent({
.operations {
position: absolute;
width: 100%;
max-height: 400px;
max-height: 650px;
bottom: 60px;
left: 0;
}
+11 -6
View File
@@ -25,7 +25,7 @@ import ConfigPanel from '@/components/qrart/ConfigPanel.vue';
import { applicationOperator, qrartOperator } from '@/operators';
import { IApplicationDetailResponse, IQrartGenerateRequest, Status } from '@/models';
import { ElMessage } from 'element-plus';
import { ERROR_CODE_DUPLICATION } from '@/constants';
import { ERROR_CODE_DUPLICATION, ERROR_CODE_USED_UP } from '@/constants';
import ApplicationStatus from '@/components/application/Status.vue';
import OperationPanel from '@/components/qrart/OperationPanel.vue';
import RecentPanel from '@/components/qrart/RecentPanel.vue';
@@ -119,8 +119,8 @@ export default defineComponent({
},
async onScrollDown() {
setTimeout(() => {
// scroll to bottom for `.tasks`
const el = document.querySelector('.tasks');
// scroll to bottom for `.recent`
const el = document.querySelector('.recent');
if (el) {
el.scrollTop = el.scrollHeight;
}
@@ -166,7 +166,7 @@ export default defineComponent({
console.error('no token specified');
return;
}
ElMessage.success(this.$t('qrart.message.startingTask'));
ElMessage.info(this.$t('qrart.message.startingTask'));
qrartOperator
.generate(request, {
token
@@ -174,8 +174,13 @@ export default defineComponent({
.then(() => {
ElMessage.success(this.$t('qrart.message.startTaskSuccess'));
})
.catch(() => {
ElMessage.error(this.$t('qrart.message.startTaskFailed'));
.catch((error) => {
const response = error?.response?.data;
if (response?.error?.code === ERROR_CODE_USED_UP) {
ElMessage.error(this.$t('qrart.message.usedUp'));
} else {
ElMessage.error(this.$t('qrart.message.startTaskFailed'));
}
})
.finally(async () => {
await this.onGetTasks();