优化气站唯一标识排版与创建方类型展示
This commit is contained in:
@@ -380,6 +380,17 @@ export function displayRawValue(key: string, value: unknown) {
|
||||
if (key === 'contract_readonly' && value === true)
|
||||
return '仅查看当前合同关联资料';
|
||||
if (typeof value === 'boolean') return value ? '是' : '否';
|
||||
// 创建方类型由接口编码转换为业务名称,详情页不直接暴露英文枚举值。
|
||||
if (key === 'creator_type') {
|
||||
return (
|
||||
{
|
||||
user: '用户',
|
||||
staff: '工作人员',
|
||||
delivery: '配送点',
|
||||
gas: '气站',
|
||||
}[String(value)] ?? `未知创建方类型(${String(value)})`
|
||||
);
|
||||
}
|
||||
if (key === 'status') return recordStatusLabel(Number(value));
|
||||
if (key === 'contract_status') return contractStatusLabel(Number(value));
|
||||
if (key === 'previous_order_status' && Number(value) === 0) return '无';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<!-- 功能描述:紧凑展示资源唯一标识或复制入口,并支持点击复制完整值。版本:v1.2.0。 -->
|
||||
<template>
|
||||
<a-tooltip :content="`${value}\n点击复制完整唯一标识`">
|
||||
<button class="identity-text" type="button" :aria-label="`复制完整唯一标识 ${value}`" @click="copyIdentity">
|
||||
{{ shortValue }}
|
||||
{{ displayText ?? shortValue }}
|
||||
</button>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
@@ -10,7 +11,7 @@
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const props = defineProps<{ value: string }>();
|
||||
const props = defineProps<{ value: string; displayText?: string }>();
|
||||
const shortValue = computed(() => props.value.slice(-12));
|
||||
|
||||
async function copyIdentity() {
|
||||
@@ -25,9 +26,15 @@ async function copyIdentity() {
|
||||
|
||||
<style scoped>
|
||||
.identity-text {
|
||||
/* 网格子项保持内容宽度,避免按钮拉伸后文字居中形成多余空白。 */
|
||||
justify-self: start;
|
||||
width: fit-content;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
color: rgb(var(--primary-6));
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
|
||||
Reference in New Issue
Block a user