email 模块instance页面接口联调

This commit is contained in:
renpy 2023-08-15 19:39:01 +08:00
parent 99c01e55ab
commit c8098d487c

View File

@ -104,7 +104,7 @@
</a-select>
<a-range-picker
style="width: 270px;"
:default-value="[moment(startDate), moment(endDate)]"
:value="[moment(startDate), moment(endDate)]"
@change="onRangeDateChange"
/>
</div>
@ -117,12 +117,12 @@
<script>
var data1 = [];
var dataCount = 1;
var dataCount = 24;
var startTime = +new Date();
console.log("startTime",startTime);
var categories = ['cpu'];
var categories = ['email'];
var types = [
{ name: 'Halt', color: '#0aaf25' },
{ name: 'num', color: '#0aaf25' },
];
var legendData = types.map(item=>{
return item.name
@ -131,7 +131,7 @@ var legendData = types.map(item=>{
categories.forEach((category, index) => {
var baseTime = startTime;
for (var i = 0; i < dataCount; i++) {
var typeItem = types[i];
var typeItem = types[0];
var duration = Math.round(Math.random() * 10000);
data1.push({
name: typeItem.name,
@ -146,10 +146,16 @@ categories.forEach((category, index) => {
}
});
function renderItem1(params, api) {
console.log("params",params);
console.log("api",api);
var categoryIndex = api.value(0);
var start = api.coord([api.value(1), categoryIndex]);
var end = api.coord([api.value(2), categoryIndex]);
var height = api.size([0, 1])[1] * 1;
console.log(categoryIndex);
console.log(start);
console.log(end);
console.log(height);
var rectShape = echarts.graphic.clipRectByRect(
{
x: start[0],
@ -205,7 +211,7 @@ export default {
value: 365,
},
],
startDate: dateFormat(new Date(), 'yyyy-MM-dd'),
startDate: "",
endDate: dateFormat(new Date(), 'yyyy-MM-dd'),
guageStore: null,
timeLine: null,
@ -213,6 +219,9 @@ export default {
yData: [],
}
},
created () {
this.startDate = this.getBeforeDate(6)
},
mounted() {
this.getServerList()
this.getEmailStatus()
@ -221,7 +230,6 @@ export default {
this.$nextTick(() => {
setTimeout(() => {
this.drawTimeline ()
// this.drawAreaMail ()
},0)
})
},
@ -250,15 +258,15 @@ export default {
console.log(val);
},
onDateChange(val) {
console.log(val);
console.log(this.getBeforeDate(val-1));
this.startDate = this.getBeforeDate(val-1)
},
onRangeDateChange(date, dateString) {
this.startDate = dateString[0]
this.endDate = dateString[1]
},
getEmailStatus() {
// getAction("/sysEmailLog/status",{emailId:this.$route.query.emailId}).then(res => {
getAction("/sysEmailLog/status",{emailId:"1668823404678311937"}).then(res => {
getAction("/sysEmailLog/status",{emailId:this.$route.query.emailId}).then(res => {
if (res.success) {
this.emailStatus = res.result
} else {
@ -267,8 +275,7 @@ export default {
})
},
getEmailTotal() {
// getAction("/sysEmailLog/total",{emailId:this.$route.query.emailId}).then(res => {
getAction("/sysEmailLog/total",{emailId:"1668823404678311937"}).then(res => {
getAction("/sysEmailLog/total",{emailId:this.$route.query.emailId}).then(res => {
if (res.success) {
this.emailTotal = res.result
} else {
@ -277,8 +284,7 @@ export default {
})
},
getEmailSpace() {
// getAction("/sysEmailLog/space",{emailId:this.$route.query.emailId}).then(res => {
getAction("/sysEmailLog/space",{emailId:"1668823404678311937"}).then(res => {
getAction("/sysEmailLog/space",{emailId:this.$route.query.emailId}).then(res => {
if (res.success) {
let s = res.result.usage
s = s.substring(0, s.length - 1)
@ -302,9 +308,12 @@ export default {
},
getEmailStatistics() {
let params = {
emailId: "1668823404678311937",
startDate: "2022-12-30",
endDate:"2023-01-02"
emailId: this.$route.query.emailId,
startDate: this.startDate,
endDate: this.endDate
// emailId: "1668823404678311937",
// startDate: "2022-12-30",
// endDate:"2023-01-02"
}
getAction("/sysEmailLog/analysis",params).then(res => {
if (res.success) {
@ -316,6 +325,28 @@ export default {
}
})
},
// n
getBeforeDate(n){
var n = n;
var d = new Date();
var year = d.getFullYear();
var mon=d.getMonth()+1;
var day=d.getDate();
if(day <= n){
if(mon>1) {
mon=mon-1;
} else {
year = year-1;
mon = 12;
}
}
d.setDate(d.getDate()-n);
year = d.getFullYear();
mon=d.getMonth()+1;
day=d.getDate();
var s = year+"-"+(mon<10?('0'+mon):mon)+"-"+(day<10?('0'+day):day);
return s;
},
drawGuageStore() {
this.guageStore = echarts.init(document.getElementById("store"))
let option = {
@ -442,8 +473,8 @@ export default {
}
},
grid: {
left: '0%',
right: '0%',
left: '10%',
right: '10%',
bottom: '0',
top:15,
height: 32,
@ -732,14 +763,14 @@ export default {
}
/deep/.ant-select-selection__placeholder{
font-family: ArialMT;
font-size: 14px;
font-size: 12px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;
}
/deep/.ant-select-selection-selected-value{
font-family: ArialMT;
font-size: 14px;
font-size: 12px;
font-weight: normal;
font-stretch: normal;
letter-spacing: 0px;