Update application estimation (#127)

Co-authored-by: AceDataCloud <office@acedata.cloud>
This commit is contained in:
GermeyandAceDataCloud authored and GitHub committed 2024-08-21 13:05:52 +08:00
1 parent df393c2aeb
commit b4b03ca022
109 files changed
+3850 -3684

No files matched your search

@@ -11,7 +11,7 @@
import { defineComponent } from 'vue';
import { ElSelect, ElOption } from 'element-plus';
const DEFAULT_VERSION = '5.2';
const DEFAULT_VERSION = '6.0';
export default defineComponent({
name: 'VersionSelector',
+1 -1
View File
@@ -50,7 +50,7 @@ export default defineComponent({
computed: {
tasks() {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
return this.$store.state.midjourney.tasks?.items?.reverse();
return this.$store.state.midjourney.tasks?.items;
},
application() {
return this.$store.state.midjourney.application;
+64
View File
@@ -0,0 +1,64 @@
<template>
<div class="estimation">
<div v-for="(api, apiIndex) in service?.apis" :key="apiIndex">
<div v-for="(item, itemIndex) in api?.estimation" :key="itemIndex" class="items">
<p v-if="package?.amount && item?.cost" class="item">
≈ {{ item.name }} {{ Math.round(package.amount / item.cost) }} {{ $t('api.unit.count') }}
<span v-if="item.remark"> ({{ item.remark }}) </span>
<span v-if="item?.comparisons?.length > 0"> - </span>
<span v-for="(comparison, comparisonIndex) in item?.comparisons" :key="comparisonIndex" class="comparison">
<i v-if="comparison?.value < 0">
{{ $t('api.message.cheaperThan').replace('$[[value]]', comparison?.target?.toString()) }}
{{ Math.abs(comparison?.value) * 100 }}%
</i>
<i v-if="comparison?.value > 0">
{{ $t('api.message.moreExpensiveThan').replace('$[[value]]', comparison?.target?.toString()) }}
{{ Math.abs(comparison?.value) * 100 }}%
</i>
</span>
</p>
</div>
</div>
</div>
</template>
<script lang="ts">
import { IService, IPackage } from '@/operators';
import { defineComponent } from 'vue';
export default defineComponent({
name: 'ServiceEstimation',
components: {},
props: {
service: {
type: Object as () => IService | undefined,
required: true
},
package: {
type: Object as () => IPackage | undefined,
required: true
}
}
});
</script>
<style lang="scss" scoped>
.estimation {
.items {
line-height: initial;
border: none;
padding: initial;
border-radius: initial;
.item {
font-size: 12px;
color: var(--text-color-secondary);
margin-bottom: 5px;
.comparison {
i {
font-style: normal;
}
}
}
}
}
</style>