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 {
|
export default {
|
||||||
remainingCount: '剩余量',
|
remainingAmount: '剩余量',
|
||||||
usedCount: '使用量',
|
usedAmount: '使用量',
|
||||||
apiKey: 'API Key',
|
apiKey: 'API Key',
|
||||||
service: '服务',
|
service: '服务',
|
||||||
operation: '操作',
|
operation: '操作',
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ export interface IApplication {
|
|||||||
proxy_id?: string;
|
proxy_id?: string;
|
||||||
api_key?: string;
|
api_key?: string;
|
||||||
user_id?: string;
|
user_id?: string;
|
||||||
remaining_count?: number;
|
remaining_amount?: number;
|
||||||
used_count?: number;
|
used_amount?: number;
|
||||||
credential?: ICredential;
|
credential?: ICredential;
|
||||||
created_at?: string;
|
created_at?: string;
|
||||||
updated_at?: string;
|
updated_at?: string;
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="remaining_count"
|
prop="remaining_amount"
|
||||||
:label="$t('application.field.remainingCount')"
|
:label="$t('application.field.remainingAmount')"
|
||||||
width="100px"
|
width="100px"
|
||||||
class-name="text-center"
|
class-name="text-center"
|
||||||
>
|
>
|
||||||
@@ -31,8 +31,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="used_count"
|
prop="used_amount"
|
||||||
:label="$t('application.field.usedCount')"
|
:label="$t('application.field.usedAmount')"
|
||||||
width="100px"
|
width="100px"
|
||||||
class-name="text-center"
|
class-name="text-center"
|
||||||
>
|
>
|
||||||
@@ -237,12 +237,12 @@ export default defineComponent({
|
|||||||
getCount(application: IApplication) {
|
getCount(application: IApplication) {
|
||||||
if (application.type === IApplicationType.API) {
|
if (application.type === IApplicationType.API) {
|
||||||
const unit = this.$t(`api.unit.${application?.api?.unit}`);
|
const unit = this.$t(`api.unit.${application?.api?.unit}`);
|
||||||
return `${application.remaining_count}${unit}`;
|
return `${application.remaining_amount}${unit}`;
|
||||||
}
|
}
|
||||||
if (application.type === IApplicationType.PROXY) {
|
if (application.type === IApplicationType.PROXY) {
|
||||||
const unit = this.$t(`proxy.unit.${application?.proxy?.unit}`);
|
const unit = this.$t(`proxy.unit.${application?.proxy?.unit}`);
|
||||||
if (unit === 'MB') {
|
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