添加时间显示
This commit is contained in:
parent
063ab62109
commit
9f2acfee68
|
|
@ -13,7 +13,8 @@
|
||||||
value-format="YYYY-MM-DD HH:mm:ss" type="date" placeholder="结束时间" @change="validateEndTime" />
|
value-format="YYYY-MM-DD HH:mm:ss" type="date" placeholder="结束时间" @change="validateEndTime" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类型:" v-if="!readonly">
|
<el-form-item label="类型:" v-if="!readonly">
|
||||||
<el-select v-model="mediaType" placeholder="请选择" style="min-width: 120px;" clearable @change="handleChangeMediaType" >
|
<el-select v-model="mediaType" placeholder="请选择" style="min-width: 120px;" clearable
|
||||||
|
@change="handleChangeMediaType">
|
||||||
<el-option v-for="item in mediaTypes" :key="item.value" :label="item.label"
|
<el-option v-for="item in mediaTypes" :key="item.value" :label="item.label"
|
||||||
:value="item.value" />
|
:value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
@ -216,7 +217,14 @@ const initHistoryCharLine = () => {
|
||||||
_historyChar.value.setOption({
|
_historyChar.value.setOption({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
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} 元/天<br/>时间: ${time}`;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
|
|
@ -304,7 +312,14 @@ const initHistoryCharBar = () => {
|
||||||
_historyChar.value.setOption({
|
_historyChar.value.setOption({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item',
|
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} 元/天<br/>时间: ${time}`;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '3%',
|
left: '3%',
|
||||||
|
|
@ -424,8 +439,6 @@ const getMediaPriceList = () => {
|
||||||
itemYDate = (convertIntTotalRegularPrice / (item.buyCycle * 7)).toFixed(2)
|
itemYDate = (convertIntTotalRegularPrice / (item.buyCycle * 7)).toFixed(2)
|
||||||
} else {
|
} else {
|
||||||
const repliceValue = parseInt(item.buyCycle.replace('个月', '').replace('月', ''))
|
const repliceValue = parseInt(item.buyCycle.replace('个月', '').replace('月', ''))
|
||||||
console.log('会输入月份的原始值', item.buyCycle)
|
|
||||||
console.log('替换会输入月份的结果', repliceValue)
|
|
||||||
itemYDate = (convertIntTotalRegularPrice / (repliceValue * 31)).toFixed(2)
|
itemYDate = (convertIntTotalRegularPrice / (repliceValue * 31)).toFixed(2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user