From 15e844f64e5bc525890531f65e81ff7ab1213997 Mon Sep 17 00:00:00 2001 From: wood chen Date: Fri, 2 May 2025 16:58:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(Prices.vue):=20=E6=B7=BB=E5=8A=A0=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=90=8D=E7=A7=B0=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在模型名称旁添加复制图标,用户点击后可复制模型名称到剪贴板,提升用户体验。 --- frontend/src/views/Prices.vue | 48 ++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/Prices.vue b/frontend/src/views/Prices.vue index bef6aa6..2aa6638 100644 --- a/frontend/src/views/Prices.vue +++ b/frontend/src/views/Prices.vue @@ -101,7 +101,10 @@

- {{ price.model }} + + {{ price.model }} + + 待审核: {{ price.temp_model }} @@ -645,6 +648,22 @@ const billingTypeMap = { const getStatus = (status) => statusMap[status] || status const getBillingType = (type) => billingTypeMap[type] || type +// 复制模型名称到剪贴板 +const copyModelName = (modelName) => { + navigator.clipboard.writeText(modelName) + .then(() => { + ElMessage({ + message: `已复制模型名称: ${modelName}`, + type: 'success', + duration: 2000 + }) + }) + .catch(err => { + console.error('复制失败:', err) + ElMessage.error('复制失败') + }) +} + // 添加getModelType函数 const getModelType = (type) => { if (!type) return '' @@ -1828,6 +1847,33 @@ onMounted(() => { line-height: 1.2; } +.copyable-model-name { + display: inline-flex; + align-items: center; + gap: 6px; + cursor: pointer; + position: relative; + padding-right: 24px; + transition: color 0.2s ease; +} + +.copyable-model-name:hover { + color: #409EFF; +} + +.copy-icon { + font-size: 14px; + opacity: 0.6; + position: absolute; + right: 0; + transition: all 0.2s ease; +} + +.copyable-model-name:hover .copy-icon { + opacity: 1; + color: #409EFF; +} + .model-meta { display: flex; gap: 0.5rem;