From 9f2acfee68503178c2b8db1f77ca67d19c112fd8 Mon Sep 17 00:00:00 2001 From: wangchengming <15110151257@163.com> Date: Sun, 2 Nov 2025 20:46:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mediaLibrary/historyData.vue | 27 +++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/views/mediaLibrary/historyData.vue b/src/views/mediaLibrary/historyData.vue index ee334eb..55e43b7 100644 --- a/src/views/mediaLibrary/historyData.vue +++ b/src/views/mediaLibrary/historyData.vue @@ -13,7 +13,8 @@ value-format="YYYY-MM-DD HH:mm:ss" type="date" placeholder="结束时间" @change="validateEndTime" /> - + @@ -216,7 +217,14 @@ const initHistoryCharLine = () => { _historyChar.value.setOption({ tooltip: { trigger: 'item', - formatter: "{b} : {c} 元/天" //鼠标放上去 展示内容 + // formatter: "{b} : {c} 元/天" //鼠标放上去 展示内容 + formatter: function (params) { + // 从原始数据中获取时间 + const originalData = historyList.value; // 你的原始数据 + const time = originalData[params.dataIndex].createTime; + + return `${params.name}: ${params.value} 元/天
时间: ${time}`; + } }, grid: { left: '3%', @@ -304,7 +312,14 @@ const initHistoryCharBar = () => { _historyChar.value.setOption({ tooltip: { trigger: 'item', - formatter: "{b} : {c} 元/天" //鼠标放上去 展示内容 + // formatter: "{b} : {c} 元/天" //鼠标放上去 展示内容 + formatter: function (params) { + // 从原始数据中获取时间 + const originalData = historyList.value; // 你的原始数据 + const time = originalData[params.dataIndex].createTime; + + return `${params.name}: ${params.value} 元/天
时间: ${time}`; + } }, grid: { left: '3%', @@ -388,7 +403,7 @@ const initHistoryCharBar = () => { // _historyChar.value.resize() // }) } -const handleChangeMediaType = (val) => { +const handleChangeMediaType = (val) => { getMediaPriceList() } const handleChangeType = (val) => { @@ -424,8 +439,6 @@ const getMediaPriceList = () => { itemYDate = (convertIntTotalRegularPrice / (item.buyCycle * 7)).toFixed(2) } else { const repliceValue = parseInt(item.buyCycle.replace('个月', '').replace('月', '')) - console.log('会输入月份的原始值', item.buyCycle) - console.log('替换会输入月份的结果', repliceValue) itemYDate = (convertIntTotalRegularPrice / (repliceValue * 31)).toFixed(2) } } @@ -463,7 +476,7 @@ const validateEndTime = (val) => { } }; // 对外暴漏方法 -const initHistoryData = (_mediaId, _readonly) => { +const initHistoryData = (_mediaId, _readonly) => { historyDataOpen.value = true readonly.value = _readonly nextTick(() => {