diff --git a/frontend/src/views/Prices.vue b/frontend/src/views/Prices.vue index 40f2e7c..a9af2e6 100644 --- a/frontend/src/views/Prices.vue +++ b/frontend/src/views/Prices.vue @@ -185,14 +185,54 @@ - + @@ -347,7 +387,11 @@ dall-e-3 按Token收费 OpenAI 美元 40.000000 40.000000" - + @@ -442,6 +486,7 @@ import { ref, computed, onMounted, watch } from 'vue' import axios from 'axios' import { ElMessage, ElMessageBox } from 'element-plus' import { useRouter } from 'vue-router' +import { Edit, Delete, Check, Close } from '@element-plus/icons-vue' const props = defineProps({ user: Object @@ -607,6 +652,28 @@ const handleAdd = () => { dialogVisible.value = true } +const handleQuickEdit = (row) => { + if (!props.user) { + router.push('/login') + ElMessage.warning('请先登录') + return + } + editingPrice.value = row + // 复制现有数据作为修改建议的基础 + form.value = { + model: row.model, + model_type: row.model_type, + billing_type: row.billing_type, + channel_type: row.channel_type, + currency: row.currency, + input_price: row.input_price, + output_price: row.output_price, + price_source: row.price_source, + created_by: props.user.username + } + dialogVisible.value = true +} + const submitForm = async () => { try { form.value.created_by = props.user.username @@ -1171,4 +1238,18 @@ onMounted(async () => { padding-right: 15px; } } + +.action-buttons { + display: flex; + gap: 8px; + justify-content: center; +} + +.action-buttons :deep(.el-button) { + padding: 4px; +} + +.action-buttons :deep(.el-icon) { + font-size: 16px; +} \ No newline at end of file