统一平台、气站和配送点后台的服务关系业务名称展示。 新增气站、配送点、服务人员三级联动及暂未分配语义。 后端补充组织归属、人员角色和启用状态的严格校验。 补充前后端测试、项目文档、操作日志及本机日志忽略规则。
81 lines
1.9 KiB
Vue
81 lines
1.9 KiB
Vue
<!-- 功能描述:列表以关系名称为主展示,并提供完整唯一标识的悬停查看与复制。版本:v1.0.0。 -->
|
||
<template>
|
||
<div class="relation-name-text">
|
||
<a-tooltip :content="`${identityLabel}:${identity}`">
|
||
<span class="relation-name">{{ displayName }}</span>
|
||
</a-tooltip>
|
||
<a-tooltip :content="`复制${identityLabel}`">
|
||
<button
|
||
class="copy-button"
|
||
type="button"
|
||
:aria-label="`复制${identityLabel} ${identity}`"
|
||
@click.stop="copyIdentity"
|
||
>
|
||
<icon-copy />
|
||
</button>
|
||
</a-tooltip>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup lang="ts">
|
||
import { Message } from '@arco-design/web-vue';
|
||
import { IconCopy } from '@arco-design/web-vue/es/icon';
|
||
import { computed } from 'vue';
|
||
|
||
const props = defineProps<{
|
||
name: string;
|
||
identity: string;
|
||
identityLabel?: string;
|
||
}>();
|
||
const displayName = computed(() => props.name || props.identity);
|
||
|
||
/** 复制当前关联记录的完整唯一标识,并给出明确操作反馈。 */
|
||
async function copyIdentity() {
|
||
try {
|
||
await navigator.clipboard.writeText(props.identity);
|
||
Message.success(`${props.identityLabel ?? '唯一标识'}已复制`);
|
||
} catch {
|
||
Message.error('复制失败,请从悬浮提示中复制');
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
.relation-name-text {
|
||
display: flex;
|
||
gap: 6px;
|
||
align-items: center;
|
||
min-width: 0;
|
||
}
|
||
|
||
.relation-name {
|
||
min-width: 0;
|
||
overflow: hidden;
|
||
color: var(--color-text-1);
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.copy-button {
|
||
display: inline-flex;
|
||
flex: 0 0 auto;
|
||
align-items: center;
|
||
justify-content: center;
|
||
width: 24px;
|
||
height: 24px;
|
||
padding: 0;
|
||
color: rgb(var(--primary-6));
|
||
font-size: 14px;
|
||
background: transparent;
|
||
border: 0;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.copy-button:hover,
|
||
.copy-button:focus-visible {
|
||
background: var(--color-fill-2);
|
||
outline: none;
|
||
}
|
||
</style>
|