refine column
This commit is contained in:
1 parent
25649410bc
commit
d1278ddeb3
3 files changed
+10
-10
No files matched your search
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
remainingCount: '剩余量',
|
||||
usedCount: '使用量',
|
||||
remainingAmount: '剩余量',
|
||||
usedAmount: '使用量',
|
||||
apiKey: 'API Key',
|
||||
service: '服务',
|
||||
operation: '操作',
|
||||
|
||||
@@ -30,8 +30,8 @@ export interface IApplication {
|
||||
proxy_id?: string;
|
||||
api_key?: string;
|
||||
user_id?: string;
|
||||
remaining_count?: number;
|
||||
used_count?: number;
|
||||
remaining_amount?: number;
|
||||
used_amount?: number;
|
||||
credential?: ICredential;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remaining_count"
|
||||
:label="$t('application.field.remainingCount')"
|
||||
prop="remaining_amount"
|
||||
:label="$t('application.field.remainingAmount')"
|
||||
width="100px"
|
||||
class-name="text-center"
|
||||
>
|
||||
@@ -31,8 +31,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="used_count"
|
||||
:label="$t('application.field.usedCount')"
|
||||
prop="used_amount"
|
||||
:label="$t('application.field.usedAmount')"
|
||||
width="100px"
|
||||
class-name="text-center"
|
||||
>
|
||||
@@ -237,12 +237,12 @@ export default defineComponent({
|
||||
getCount(application: IApplication) {
|
||||
if (application.type === IApplicationType.API) {
|
||||
const unit = this.$t(`api.unit.${application?.api?.unit}`);
|
||||
return `${application.remaining_count}${unit}`;
|
||||
return `${application.remaining_amount}${unit}`;
|
||||
}
|
||||
if (application.type === IApplicationType.PROXY) {
|
||||
const unit = this.$t(`proxy.unit.${application?.proxy?.unit}`);
|
||||
if (unit === 'MB') {
|
||||
return `${((application.remaining_count || 0) / 1024 / 1024).toFixed(2)}${unit}`;
|
||||
return `${((application.remaining_amount || 0) / 1024 / 1024).toFixed(2)}${unit}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user