完成管理员主页的数据读取
This commit is contained in:
@@ -7,45 +7,70 @@ var Main = {
|
||||
},
|
||||
feedbackData:[
|
||||
{
|
||||
content:'bug',
|
||||
time:'2018-2-3',
|
||||
username:'root'
|
||||
id: 68,
|
||||
username: "root",
|
||||
content: "Fred",
|
||||
time: "2018-02-08 10:14:11"
|
||||
},
|
||||
{
|
||||
id: 71,
|
||||
username: "root",
|
||||
content: "1234214",
|
||||
time: "2018-02-08 10:30:38"
|
||||
},
|
||||
{
|
||||
id: 72,
|
||||
username: "root",
|
||||
content: "afsdas",
|
||||
time: "2018-02-08 10:31:22"
|
||||
},
|
||||
{
|
||||
id: 73,
|
||||
username: "root",
|
||||
content: "反馈",
|
||||
time: "2018-02-08 10:35:18"
|
||||
}
|
||||
],
|
||||
logData:[
|
||||
{
|
||||
ip:'127.0.0.1',
|
||||
header:'bug',
|
||||
time:'2018-2-3',
|
||||
username:'root'
|
||||
logid: 55,
|
||||
colname: "root",
|
||||
coltime: "2018-02-06 11:35:56.0",
|
||||
colip: "0:0:0:0:0:0:0:1",
|
||||
colheader: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
|
||||
},
|
||||
{
|
||||
ip:'127.0.0.1',
|
||||
header:'bug',
|
||||
time:'2018-2-3',
|
||||
username:'root'
|
||||
},
|
||||
{
|
||||
ip:'127.0.0.1',
|
||||
header:'bug',
|
||||
time:'2018-2-3',
|
||||
username:'root'
|
||||
},
|
||||
{
|
||||
ip:'127.0.0.1',
|
||||
header:'bug',
|
||||
time:'2018-2-3',
|
||||
username:'root'
|
||||
},
|
||||
{
|
||||
ip:'127.0.0.1',
|
||||
header:'bug',
|
||||
time:'2018-2-3',
|
||||
username:'root'
|
||||
logid: 58,
|
||||
colname: "root",
|
||||
coltime: "2018-02-06 11:40:41.0",
|
||||
colip: "0:0:0:0:0:0:0:1",
|
||||
colheader: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
|
||||
}
|
||||
],
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
var that = this;
|
||||
axios.get('http://localhost:8080/cms/home/findvlog')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.logData = response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
axios.get('http://localhost:8080/cms/home/findvfeedback')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.feedbackData = response.data;
|
||||
//that.limitTime = response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
ClickToJump(targe){
|
||||
window.location.href="http://localhost:8080/cms/" + targe;
|
||||
|
||||
125
src/main/resources/static/js/user.js
Normal file
125
src/main/resources/static/js/user.js
Normal file
@@ -0,0 +1,125 @@
|
||||
var Main = {
|
||||
data() {
|
||||
var checkName = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('用户名不能为空'));
|
||||
}
|
||||
};
|
||||
var checkNo = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('学号不能为空'));
|
||||
}
|
||||
};
|
||||
var checkRealName = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('真实姓名不能为空'));
|
||||
}
|
||||
};
|
||||
var validatePass = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请输入密码'));
|
||||
} else {
|
||||
if (this.ruleForm2.checkPass !== '') {
|
||||
this.$refs.ruleForm2.validateField('checkPass');
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var validatePass2 = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请再次输入密码'));
|
||||
} else if (value !== this.ruleForm2.colpassword) {
|
||||
callback(new Error('两次输入密码不一致!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
activeIndex: '1',
|
||||
ruleForm2: {
|
||||
colname: '',
|
||||
colpassword: '',
|
||||
checkPass:'',
|
||||
colstudentno: '',
|
||||
colrealname: '',
|
||||
colemail: ''
|
||||
},
|
||||
rules2: {
|
||||
colpassword: [
|
||||
{required: true,validator: validatePass, trigger: 'blur'}
|
||||
],
|
||||
checkPass: [
|
||||
{required: true,validator: validatePass2, trigger: 'blur'}
|
||||
],
|
||||
colstudentno: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkNo,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
colrealname: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkRealName,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
colname: [
|
||||
{required: true,validator: checkName, trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
tableHomeworkData: [
|
||||
{
|
||||
workid: 1,
|
||||
colfileid: 56,
|
||||
workname: "实验报告",
|
||||
worktime: "2018-02-06 20:44:08.0",
|
||||
colfilename: "2018 服务器装机.xlsx",
|
||||
coursename: "信息安全",
|
||||
workremark: "3000字以上",
|
||||
workfolder: "第一次作业"
|
||||
},
|
||||
{
|
||||
workid: 1,
|
||||
colfileid: 56,
|
||||
workname: "实验报告2",
|
||||
worktime: "2018-02-08 20:44:08.0",
|
||||
colfilename: "2018 服务器装机.xlsx",
|
||||
coursename: "决策支持系统",
|
||||
workremark: "3000字以上",
|
||||
workfolder: "第一次作业"
|
||||
}
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submitForm(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
alert('submit!');
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
console.log(tab, event);
|
||||
},
|
||||
ClickToJump(targe){
|
||||
window.location.href="http://localhost:8080/cms/" + targe;
|
||||
},
|
||||
handleSelect(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
onSubmit() {
|
||||
console.log('submit!');
|
||||
}
|
||||
}
|
||||
}
|
||||
var Ctor = Vue.extend(Main)
|
||||
new Ctor().$mount('#app')
|
||||
Reference in New Issue
Block a user