Commit b42b471c authored by whlviolin's avatar whlviolin

修改我的数据时间戳显示

parent 9a9d040a
......@@ -2,7 +2,7 @@
<div class="index-container" >
<div style="flex:1;padding: 10px;">
<el-table
:data="fileList"
:data=fileList
:style="{'width': '100%', 'height': '100%'}">
<template v-for="item in tableHeader">
<el-table-column v-if="item.key == 'name'"
......@@ -73,7 +73,7 @@ import { getFileList } from '@/api/data'
initData() {
getFileList().then(res => {
console.log(res)
this.fileList = res.data;
this.fileList = this.getFfileList(res.data)
}).catch(err => {
console.log(err)
......@@ -85,7 +85,28 @@ import { getFileList } from '@/api/data'
name:"detail",
query: row
})
}
},
dateFormat(timestamp){
// 使用日期对象来格式化日期字符串
let date = new Date(timestamp);
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始,所以要加1,然后使用padStart函数补零
let day = date.getDate().toString().padStart(2, '0');
let hours = date.getHours().toString().padStart(2, '0');
let minutes = date.getMinutes().toString().padStart(2, '0');
let seconds = date.getSeconds().toString().padStart(2, '0');
let formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
return formattedDate;
},
getFfileList(datas){
for(let i in datas) {
let data=datas[i]
data['createTime']=this.dateFormat(data['createTime'])
data['updateTime']=this.dateFormat(data['updateTime'])
};
return datas;
},
}
}
</script>
......@@ -99,4 +120,4 @@ import { getFileList } from '@/api/data'
cursor: pointer;
color: rgb(255, 121, 11);
}
</style>
\ No newline at end of file
</style>
......@@ -47,11 +47,11 @@
</div>
<div class="right">
<div class="entry" style="height:35%;">
<div class="entry" style="height:25%;">
<div class="header" style="">指标</div>
<div class="body">
<template v-for="(item, index) in params.dataCondition">
<div style="margin-left:10px; height:26px;line-height:26px;">{{"Y"+ (index + 1) + " "}}{{item.name}}</div>
<div style="margin-left:10px;line-height:26px;">{{"Y"+ (index + 1) + " "}}{{item.name}}</div>
</template>
</div>
</div>
......@@ -66,7 +66,7 @@
</div>
<div class="entry" style="width: 100%;height: 35%;border-right: 3px solid #dbdbdb69;">
<div class="header">区域</div>
<div class="body" style=" border-right: 3px solid #dbdbdb69;">
<div class="body">
<template v-for="(item, index) in params.address">
<div style="margin-left:10px; height:26px;line-height:26px;">{{item.name}}</div>
</template>
......@@ -354,7 +354,6 @@ import {getyear, getAddress, detDataTitle, getIndustry, getCondition, getTree, s
for(let item in dataList) {
let obj =dataList[item]
obj["checked"] = false;
dataList.push(obj);
}
return dataList;
},
......@@ -493,6 +492,7 @@ import {getyear, getAddress, detDataTitle, getIndustry, getCondition, getTree, s
/* box-shadow: 3px 0px 4px #8b8b8b; */
line-height: 41px;
padding-left: 20px;
position: inherit;
color: #545454;
font-weight: 700;
}
......@@ -501,6 +501,7 @@ import {getyear, getAddress, detDataTitle, getIndustry, getCondition, getTree, s
flex: 1;
overflow-y: scroll;
padding-left: 20px;
}
.result {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment