15 发邮件

master
markma 3 years ago
parent d4b9405de9
commit 255d6b153d

@ -4,10 +4,14 @@
<el-container> <el-container>
<div style="width: 45%"> <div style="width: 45%">
<ve-line :data="chartData_H" :extend="chartExtend_H" height="400px"></ve-line> <ve-line :data="chartData_H" :extend="chartExtend_H" height="400px"></ve-line>
<ve-pie :data="chartData_reason" :extend="chartExtend_reason" height="400px"></ve-pie>
</div> </div>
<div style="width: 45%"> <div style="width: 45%">
<ve-line :data="chartData_D" :extend="chartExtend_D" height="400px"></ve-line> <ve-line :data="chartData_D" :extend="chartExtend_D" height="400px"></ve-line>
<ve-pie :data="chartData_place" :extend="chartExtend_place" height="400px"></ve-pie>
</div> </div>
</el-container> </el-container>
<h4 style="text-align: center">具体用户分析</h4> <h4 style="text-align: center">具体用户分析</h4>
<el-table <el-table
@ -94,6 +98,22 @@ export default {
textAlign: 'center' // text subtext auto, left, right, center textAlign: 'center' // text subtext auto, left, right, center
}, },
}; };
this.chartExtend_place = {
title: {
text: '外出地点情况',
x: 'middle', //x left, right, middle
y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center
},
};
this.chartExtend_reason = {
title: {
text: '外出理由情况',
x: 'middle', //x left, right, middle
y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center
},
};
return { return {
chartData_H: { chartData_H: {
@ -104,6 +124,14 @@ export default {
columns: ["日期", "预计离开人数", "预计返回人数", "实际离开人数", "实际返回人数"], columns: ["日期", "预计离开人数", "预计返回人数", "实际离开人数", "实际返回人数"],
rows: [] rows: []
}, },
chartData_place: {
columns: ["place", "value"],
rows: []
},
chartData_reason: {
columns: ["reason", "value"],
rows: []
},
pageSize: 20, pageSize: 20,
total: 11, total: 11,
tableData: [{ tableData: [{
@ -173,6 +201,21 @@ export default {
}) })
axios.get('http://localhost:8181/dataAnalysis/DATime/*/D').then(function (resp) { axios.get('http://localhost:8181/dataAnalysis/DATime/*/D').then(function (resp) {
_this.chartData_D.rows = resp.data; _this.chartData_D.rows = resp.data;
})
axios.get('http://localhost:8181/dataAnalysis/place/*').then(function (resp) {
for (let i = 0; i < resp.data.length; i++) {
resp.data[i]["value"] = Number(resp.data[i]["value"])
}
_this.chartData_place.rows = resp.data;
console.log(_this.chartData_place)
})
axios.get('http://localhost:8181/dataAnalysis/reason/*').then(function (resp) {
for (let i = 0; i < resp.data.length; i++) {
resp.data[i]["value"] = Number(resp.data[i]["value"])
}
_this.chartData_reason.rows = resp.data;
}) })
} }
} }

@ -54,6 +54,9 @@
<el-form-item label="学号" maxlength="64" prop="school_id"> <el-form-item label="学号" maxlength="64" prop="school_id">
<el-input v-model="ruleForm_register.school_id"></el-input> <el-input v-model="ruleForm_register.school_id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="邮箱" maxlength="30" prop="email">
<el-input v-model="ruleForm_register.email"></el-input>
</el-form-item>
<el-radio v-model="ruleForm_register.type" label="student"></el-radio> <el-radio v-model="ruleForm_register.type" label="student"></el-radio>
<el-radio v-model="ruleForm_register.type" label="teacher"></el-radio> <el-radio v-model="ruleForm_register.type" label="teacher"></el-radio>
<el-radio v-model="ruleForm_register.type" label="outer"></el-radio> <el-radio v-model="ruleForm_register.type" label="outer"></el-radio>
@ -116,6 +119,20 @@ export default {
school_id: [ school_id: [
{required: true, message: '请输入学校id', trigger: 'blur'} {required: true, message: '请输入学校id', trigger: 'blur'}
], ],
email: [
{required: true, message: '请输入邮箱', trigger: 'blur'},
{
type: 'string',
message: '邮箱格式不正确',
trigger: 'blur',
transform(value) {
if (!/^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value)) {
return true
} else {
}
}
}
],
}, },
pictures: [ pictures: [
'https://www.nudt.edu.cn/images/2020-09/315f04ae3e4e4e488db721ba151f0fcc.jpg', 'https://www.nudt.edu.cn/images/2020-09/315f04ae3e4e4e488db721ba151f0fcc.jpg',
@ -165,39 +182,38 @@ export default {
}, },
submitFormRegister() { submitFormRegister() {
const _this = this const _this = this
console.log(this.ruleForm_register.email)
if (this.ruleForm_register.type === '') { if (this.ruleForm_register.type === '') {
this.$message({ this.$message({
message: '请填写您的职业!', message: '请填写您的职业!',
type: 'warning' type: 'warning'
}); });
return false; return false;
} } else if (this.ruleForm_register.password !== this.ruleForm_register.check_password) {
if (this.ruleForm_register.password !== this.ruleForm_register.check_password) {
this.$message({ this.$message({
message: '两次密码不一致!', message: '两次密码不一致!',
type: 'warning' type: 'warning'
}); });
return false; return false;
} else {
axios.get('http://localhost:8181/userDetail/checkValuable/' + this.ruleForm_register.username + '/' + this.ruleForm_register.school_id + '/' + this.ruleForm_register.name).then(function (resp) {
if (resp.data !== 'success') {
_this.$message.error(resp.data + '重复,请登录!');
return false;
} else {
axios.post('http://localhost:8181/userDetail/saveUAD', _this.ruleForm_register).then(function (resp) {
if (resp.data === 'success') {
_this.$message({
message: '保存成功,已提交到管理员,批准后通过邮件通知,请等待管理员批准',
type: 'success'
})
} else {
_this.$message.error('保存失败')
}
})
}
})
} }
axios.get('http://localhost:8181/userDetail/checkValuable/' + this.ruleForm_register.username + '/' + this.ruleForm_register.school_id + '/' + this.ruleForm_register.name).then(function (resp) {
if (resp.data !== 'success') {
_this.$message.error(resp.data + '重复,请登录!');
return false;
}
})
axios.post('http://localhost:8181/userDetail/saveUAD', _this.ruleForm_register).then(function (resp) {
if (resp.data === 'success') {
_this.$message({
message: '保存成功,已提交到管理员,请等待管理员批准',
type: 'success'
})
} else {
_this.$message.error('保存失败')
}
})
} }
}, },
created() { created() {

@ -1,9 +1,9 @@
<template> <template>
<el-dialog :visible.sync="dialogFormVisible" @close="closeDialog"> <el-dialog :visible.sync="dialogFormVisible" @close="closeDialog">
<div> <ve-line :data="chartData_H" :extend="chartExtend_H" height="400px"></ve-line>
<ve-line :data="chartData_H" :extend="chartExtend_H" height="400px"></ve-line> <ve-line :data="chartData_D" :extend="chartExtend_D" height="400px"></ve-line>
<ve-line :data="chartData_D" :extend="chartExtend_D" height="400px"></ve-line> <ve-pie :data="chartData_reason" :extend="chartExtend_reason" height="400px"></ve-pie>
</div> <ve-pie :data="chartData_place" :extend="chartExtend_place" height="400px"></ve-pie>
</el-dialog> </el-dialog>
</template> </template>
@ -27,6 +27,22 @@ export default {
textAlign: 'center' // text subtext auto, left, right, center textAlign: 'center' // text subtext auto, left, right, center
}, },
}; };
this.chartExtend_place = {
title: {
text: '外出地点情况',
x: 'middle', //x left, right, middle
y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center
},
};
this.chartExtend_reason = {
title: {
text: '外出理由情况',
x: 'middle', //x left, right, middle
y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center
},
};
return { return {
student_id: '', student_id: '',
dialogFormVisible: false, dialogFormVisible: false,
@ -38,6 +54,14 @@ export default {
columns: ["日期", "预计离开人数", "预计返回人数", "实际离开人数", "实际返回人数"], columns: ["日期", "预计离开人数", "预计返回人数", "实际离开人数", "实际返回人数"],
rows: [] rows: []
}, },
chartData_place: {
columns: ["place", "value"],
rows: []
},
chartData_reason: {
columns: ["reason", "value"],
rows: []
},
} }
}, },
methods: { methods: {
@ -49,6 +73,18 @@ export default {
axios.get('http://localhost:8181/dataAnalysis/DATime/' + _this.student_id + '/D').then(function (resp) { axios.get('http://localhost:8181/dataAnalysis/DATime/' + _this.student_id + '/D').then(function (resp) {
_this.chartData_D.rows = resp.data; _this.chartData_D.rows = resp.data;
}) })
axios.get('http://localhost:8181/dataAnalysis/place/' + _this.student_id).then(function (resp) {
for (let i = 0; i < resp.data.length; i++) {
resp.data[i]["value"] = Number(resp.data[i]["value"])
}
_this.chartData_place.rows = resp.data;
})
axios.get('http://localhost:8181/dataAnalysis/reason/' + _this.student_id).then(function (resp) {
for (let i = 0; i < resp.data.length; i++) {
resp.data[i]["value"] = Number(resp.data[i]["value"])
}
_this.chartData_reason.rows = resp.data;
})
}, },
closeDialog() { closeDialog() {
this.chartData.rows = [] this.chartData.rows = []

@ -2,9 +2,12 @@
<el-container> <el-container>
<div style="width: 45%"> <div style="width: 45%">
<ve-line :data="chartData_H" :extend="chartExtend_H" height="400px"></ve-line> <ve-line :data="chartData_H" :extend="chartExtend_H" height="400px"></ve-line>
<ve-pie :data="chartData_reason" :extend="chartExtend_reason" height="400px"></ve-pie>
</div> </div>
<div style="width: 45%"> <div style="width: 45%">
<ve-line :data="chartData_D" :extend="chartExtend_D" height="400px"></ve-line> <ve-line :data="chartData_D" :extend="chartExtend_D" height="400px"></ve-line>
<ve-pie :data="chartData_place" :extend="chartExtend_place" height="400px"></ve-pie>
</div> </div>
</el-container> </el-container>
@ -32,6 +35,23 @@ export default {
y: 'bottom', //y top, bottom y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center textAlign: 'center' // text subtext auto, left, right, center
}, },
};
this.chartExtend_place = {
title: {
text: '外出地点情况',
x: 'middle', //x left, right, middle
y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center
},
};
this.chartExtend_reason = {
title: {
text: '外出理由情况',
x: 'middle', //x left, right, middle
y: 'bottom', //y top, bottom
textAlign: 'center' // text subtext auto, left, right, center
},
}; };
return { return {
chartData_H: { chartData_H: {
@ -42,6 +62,14 @@ export default {
columns: ["日期", "预计离开人数", "预计返回人数", "实际离开人数", "实际返回人数"], columns: ["日期", "预计离开人数", "预计返回人数", "实际离开人数", "实际返回人数"],
rows: [] rows: []
}, },
chartData_place: {
columns: ["place", "value"],
rows: []
},
chartData_reason: {
columns: ["reason", "value"],
rows: []
},
} }
}, },
methods: {}, methods: {},
@ -66,6 +94,20 @@ export default {
axios.get('http://localhost:8181/dataAnalysis/DATime/' + id + '/D').then(function (resp) { axios.get('http://localhost:8181/dataAnalysis/DATime/' + id + '/D').then(function (resp) {
_this.chartData_D.rows = resp.data; _this.chartData_D.rows = resp.data;
}) })
axios.get('http://localhost:8181/dataAnalysis/place/' + id).then(function (resp) {
for (let i = 0; i < resp.data.length; i++) {
resp.data[i]["value"] = Number(resp.data[i]["value"])
}
_this.chartData_place.rows = resp.data;
console.log(_this.chartData_place)
})
axios.get('http://localhost:8181/dataAnalysis/reason/' + id).then(function (resp) {
for (let i = 0; i < resp.data.length; i++) {
resp.data[i]["value"] = Number(resp.data[i]["value"])
}
_this.chartData_reason.rows = resp.data;
})
} }
} }
</script> </script>

Loading…
Cancel
Save