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