提交 459d0eb2 编写于 作者: a1695929110's avatar a1695929110

招聘所有界面2.0

上级 4184dff2
<template> <template>
<div> <div>
<el-card shadow="hover" style="width: 100%"> <el-card shadow="hover" style="width: 100%">
<h2>审核求助信息</h2> <h2>删除招聘信息</h2>
</el-card> </el-card>
<el-card> <el-card>
<div style="text-align: left; margin-left: 20px"> <div style="text-align: left; margin-left: 20px">
<h4>求助者账号:{{ teacherName }}</h4> <h4>企业名称:{{ teacherName }}</h4>
<h4>主题:{{ title }}</h4> <h4>招聘岗位:{{ title }}</h4>
<h4>内容:{{ hostUnit }}</h4> <h4>企业介绍:{{ hostUnit }}</h4>
<h4>社区:{{ content }}</h4> <h4>岗位要求:{{ hostUnit }}</h4>
<h4>图片:{{ registerTime }}</h4> <h4>招聘开始时间:{{ content }}</h4>
<h4>发布时间:{{ competitionTime }}</h4> <h4>招聘截止时间:{{ registerTime }}</h4>
<!-- <h4>报名人数{{ competitionTime }}</h4> -->
</div> </div>
<!-- <el-table :data="tableData" border style="width: 100%; margin: 20px"> <!-- <el-table :data="tableData" border style="width: 100%; margin: 20px">
<el-table-column prop="id" label="ID" width="80"> </el-table-column> <el-table-column prop="id" label="ID" width="80"> </el-table-column>
...@@ -50,14 +49,14 @@ ...@@ -50,14 +49,14 @@
round round
size="medium" size="medium"
@click="deleteForm" @click="deleteForm"
>通过</el-button >确认删除</el-button
> >
<el-button <el-button
style="display: inline-block; width: 150px; height: 40px" style="display: inline-block; width: 150px; height: 40px"
round round
size="medium" size="medium"
@click="cancel" @click="cancel"
></el-button ></el-button
> >
</el-card> </el-card>
</div> </div>
...@@ -106,7 +105,7 @@ ...@@ -106,7 +105,7 @@
getInformation() { getInformation() {
this.$axios({ this.$axios({
method: "get", method: "get",
url: "http://47.113.195.148:8085/backend/teacher/showComp", url: "http://124.220.174.249:8085/backend/teacher/showComp",
headers: { token: localStorage.token }, headers: { token: localStorage.token },
params: { params: {
competitionId: this.queryInfo.competeId, competitionId: this.queryInfo.competeId,
......
<template>
<div>
<el-card shadow="hover" class="back">
<el-card
style="width: 68%; background: white; position: relative; left: 180px;opacity:0.95;"
>
<h2
style="
width: 100%;
border-bottom: 1px solid #4988fd;
padding-bottom: 20px;
"
>
招聘详细信息
</h2>
<!-- <div style="text-align: left; margin-left: 340px">
<h4>发布者:{{ teacherName }}</h4>
<h4>竞赛名称:{{ title }}</h4>
<h4>举办地点:{{ hostUnit }}</h4>
<h4>介绍:{{ content }}</h4>
<h4>报名截止时间:{{ registerTime }}</h4>
<h4>比赛时间:{{ competitionTime }}</h4>
<h4>报名人数{{ competitionTime }}</h4> -->
<!-- <h4>报名名单:</h4> -->
<!-- </div> -->
<!-- <el-table :data="detailList" border style="width: 100%; margin: 20px">
<el-table-column prop="id" label="ID" width="80"> </el-table-column>
<el-table-column prop="no" label="学号" width="280"> </el-table-column>
<el-table-column prop="name" label="姓名" width="200">
</el-table-column>
<el-table-column prop="email" label="邮箱" width="280">
</el-table-column>
<el-table-column prop="phone" label="手机号" width="200">
</el-table-column>
<el-table-column prop="remarks" label="备注" width="80">
</el-table-column>
</el-table> -->
<!-- <el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
background
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageTotal"
>
</el-pagination> -->
<el-descriptions
class="margin-top"
style="width: 75%;margin-left:60px;"
:column="0"
size="medium"
>
<!-- <el-descriptions-item label="用户名">
<el-avatar :src="teacher" style="background-color: white"></el-avatar>
<span
style="
display: inline-block;
position: relative;
bottom: 12px;
left: 7px;
color: black;
"
>发布者:</span
>
{{ teacherName }}
</el-descriptions-item> -->
<el-descriptions-item>
<el-avatar :src="com" style="background-color: white"></el-avatar>
<span class="span_title">企业名称:</span>
<span class="span_content">{{
title
}}</span>
</el-descriptions-item>
<el-descriptions-item>
<el-avatar :src="place" style="background-color: white"></el-avatar>
<span class="span_title">招聘岗位:</span>
<span class="span_content">{{
hostUnit
}}</span>
</el-descriptions-item>
<el-descriptions-item>
<el-avatar :src="intro" style="background-color: white"></el-avatar>
<span class="span_title"> 企业介绍:</span>
<!-- <span class="span_content" style="text-indent: 144px">{{ -->
<span class="span_content">{{
content
}}</span>
</el-descriptions-item>
<el-descriptions-item>
<el-avatar :src="reg" style="background-color: white"></el-avatar>
<span class="span_title">招聘开始时间: </span>
<span class="span_content">{{
registerTime
}}</span>
</el-descriptions-item>
<el-descriptions-item>
<el-avatar :src="clo" style="background-color: white"></el-avatar>
<span class="span_title">招聘截止时间:</span>
<span class="span_content">{{
competitionTime
}}</span>
</el-descriptions-item>
</el-descriptions>
<br /><br />
<el-button
style="
display: inline-block;
width: 150px;
height: 40px;
margin-right: 120px;
"
type="primary"
plain
round
size="medium"
@click="sure"
>确认</el-button
>
<el-button
style="display: inline-block; width: 150px; height: 40px"
round
size="medium"
@click="goBack"
>返回</el-button
>
</el-card>
</el-card>
</div>
</template>
<script>
import teacher from "@/assets/teacher.png";
import com from "@/assets/com.png";
import place from "@/assets/place.png";
import reg from "@/assets/reg.png";
import intro from "@/assets/intro.png";
import clo from "@/assets/clo.png";
export default {
data() {
return {
teacher: teacher,
com: com,
place: place,
reg: reg,
intro: intro,
clo: clo,
queryInfo: {
competeId: this.$route.query.id, //获取竞赛id
},
tableData: [
{
id: "1",
no: "221900190",
name: "佩奇",
email: "1234567890@qq.com",
phone: "13822223333",
remarks: "...",
},
{
id: "1",
no: "221900190",
name: "佩奇",
email: "1234567890@qq.com",
phone: "13822223333",
remarks: "...",
},
],
// publisher: "FBB",
// date: "2022年4月3日",
// title: "2022年福州大学数学竞赛校赛",
// desc: "2022年福州大学数学竞赛校赛欢迎各专业同学报名",
// demand: "请在规定时间内提交报名表",
// comment: "非数学专业同学请报名非专业组",
teacherName: "",
hostUnit: "",
title: "",
content: "",
registerTime: "",
competitionTime: "",
currentPage: 1,
pageSize: 10,
pageTotal: 2,
detailList: [],
};
},
mounted() {
this.getDetail();
},
methods: {
handleSizeChange(size) {
this.pagesize = size;
this.$router.replace("/PageTable");
},
handleCurrentChange(currentPage) {
this.currentPage = currentPage;
this.$router.replace("/PageTable");
},
getDetail() {
this.$axios({
method: "get",
url: "http://124.220.174.249:8085/backend/teacher/showComp",
headers: { token: localStorage.token },
params: {
competitionId: this.queryInfo.competeId,
},
})
.then((res) => {
// console.log(username + password);
console.log(res);
if (res.data.code == "200") {
this.title = res.data.data.title;
this.teacherName = res.data.data.teacherName;
this.hostUnit = res.data.data.hostUnit;
this.content = res.data.data.content;
this.registerTime = res.data.data.registerTime;
this.competitionTime = res.data.data.competitionTime;
console.log("res.data.data");
console.log(res.data.data.title);
console.log(this.title);
console.log("res.data.data");
}
})
.catch((err) => {
return this.$message.error("获取竞赛列表信息失败!");
});
},
//点击确定按钮
sure() {
this.$router.replace("/PageTable");
},
//点击返回按钮
goBack() {
this.$router.replace("/PageTable");
},
},
};
</script>
<style scoped>
.span_title {
display: inline-block;
position: relative;
bottom: 12px;
left: 7px;
color: black;
font-weight: 700;
width: 80px;
}
.span_content {
display: inline-block;
position: relative;
bottom: 12px;
left: 7px;
color: black;
width: 400px;
padding-bottom: 10px;
/* border-bottom: 1px solid gray; */
margin-left: 15px;
}
.back {
position: relative;
left: 65px;
width: 90%;
background: #e8f3fe;
background-repeat: no-repeat;
background-size: 100%;
background-position-x: 0px;
}
</style>
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
width="414" width="547"
align="center" align="center"
header-align="center" header-align="center"
> >
......
<template>
<div>
<el-card shadow="hover" class="back">
<el-card shadow="hover" style="width: 75%;margin-left:133px;opacity:0.94;">
<h2
style="
width: 100%;
border-bottom: 1px solid #4988fd;
padding-bottom: 20px;
"
>
修改竞赛信息
</h2>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="100px"
>
<el-form-item label="企业名称" prop="title">
<el-input v-model="ruleForm.title"></el-input>
</el-form-item>
<el-form-item label="招聘岗位" prop="content">
<el-input v-model="ruleForm.content"></el-input>
</el-form-item>
<el-form-item label="岗位介绍" prop="teacherName">
<el-input v-model="ruleForm.teacherName"></el-input>
</el-form-item>
<el-form-item label="岗位要求" prop="hostUnit">
<el-input type="textarea" v-model="ruleForm.hostUnit"></el-input>
</el-form-item>
<el-form-item label="招聘开始时间" required>
<el-col :span="10">
<el-form-item prop="date1">
<el-date-picker
type="date"
placeholder="选择日期"
v-model="ruleForm.date1"
:picker-options="pickerOptions1"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="10">
<el-form-item prop="date2">
<el-time-picker
type="fixed-time"
placeholder="选择时间"
v-model="ruleForm.date2"
style="width: 100%"
></el-time-picker>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="招聘截止时间" required>
<el-col :span="10">
<el-form-item prop="gamedate1">
<el-date-picker
type="date"
placeholder="选择日期"
v-model="ruleForm.gamedate1"
:picker-options="pickerOptions1"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="10">
<el-form-item prop="gamedate2">
<el-time-picker
type="fixed-time"
placeholder="选择时间"
v-model="ruleForm.gamedate2"
style="width: 100%"
></el-time-picker>
</el-form-item>
</el-col>
</el-form-item>
<!-- <el-form-item label="报名表单"> </el-form-item>
<el-table :data="tableData" border style="width: 100%; margin: 20px">
<el-table-column prop="id" label="ID" width="80"> </el-table-column>
<el-table-column prop="no" label="学号" width="280">
</el-table-column>
<el-table-column prop="name" label="姓名" width="200">
</el-table-column>
<el-table-column prop="email" label="邮箱" width="280">
</el-table-column>
<el-table-column prop="phone" label="手机号" width="200">
</el-table-column>
<el-table-column prop="remarks" label="备注" width="80">
</el-table-column>
</el-table> -->
<!-- <el-form-item>
<el-button
style="
display: inline-block;
width: 150px;
height: 40px;
margin-right: 60px;
"
type="primary"
plain
round
size="medium"
@click="submitForm('ruleForm')"
>确认修改</el-button
>
<el-button
style="display: inline-block; width: 150px; height: 40px"
round
size="medium"
@click="resetForm('ruleForm')"
>返回</el-button
>
</el-form-item> -->
</el-form>
<!-- <el-form-item> -->
<el-button
style="
display: inline-block;
width: 150px;
height: 40px;
margin-right: 60px;
"
type="primary"
plain
round
size="medium"
@click="submitForm('ruleForm')"
>确认修改</el-button
>
<el-button
style="display: inline-block; width: 150px; height: 40px"
round
size="medium"
@click="resetForm('ruleForm')"
>返回</el-button
>
<!-- </el-form-item> -->
</el-card>
</el-card>
</div>
</template>
<script>
export default {
data() {
const generateData2 = () => {
const data = [];
const cities = ["上海", "北京", "广州", "深圳", "南京", "西安", "成都"];
const pinyin = [
"shanghai",
"beijing",
"guangzhou",
"shenzhen",
"nanjing",
"xian",
"chengdu",
];
cities.forEach((city, index) => {
data.push({
label: city,
key: index,
pinyin: pinyin[index],
});
});
return data;
};
return {
pickerOptions1: {
// 限制预约时间,只能选择今天和今天之后的时间
disabledDate(time) {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
},
},
queryInfo: {
competeId: this.$route.query.id, //获取竞赛id
},
ruleForm: {
title: "",
content: "",
teacherName: "",
hostUnit: "",
date1: "",
date2: "",
gamedate1: "",
gamedate2: "",
command: "",
remarks: "",
},
rules: {
title: [
{ required: true, message: "请输入竞赛名称", trigger: "blur" },
{
min: 3,
max: 20,
message: "长度在 3 到 20 个字符",
trigger: "blur",
},
],
desc: [{ required: true, message: "请输入竞赛介绍", trigger: "blur" }],
date1: [
{
type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
],
date2: [
{
type: "date",
required: true,
message: "请选择时间",
trigger: "change",
},
],
gamedate1: [
{
type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
],
gamedate2: [
{
type: "date",
required: true,
message: "请选择时间",
trigger: "change",
},
],
desc: [{ required: false, message: "请填写备注", trigger: "blur" }],
},
fileList: [
{
name: "food.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
{
name: "food2.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
],
data2: generateData2(),
value2: [],
filterMethod(query, item) {
return item.pinyin.indexOf(query) > -1;
},
tableData: [
{
id: "1",
no: "221900190",
name: "佩奇",
email: "1234567890@qq.com",
phone: "13822223333",
remarks: "...",
},
{
id: "1",
no: "221900190",
name: "佩奇",
email: "1234567890@qq.com",
phone: "13822223333",
remarks: "...",
},
],
currentPage: 1,
pageSize: 10,
pageTotal: 2,
};
},
//初始化数据
mounted() {
// window.addEventListener('message', this.handleMessage)
this.getInformation();
},
methods: {
//获取详情竞赛信息
getInformation() {
this.$axios({
method: "get",
url: "http://124.220.174.249:8085/backend/teacher/showComp",
headers: { token: localStorage.token },
params: {
competitionId: this.queryInfo.competeId,
},
})
.then((res) => {
// console.log(username + password);
console.log(res);
if (res.data.code == "200") {
this.ruleForm.title = res.data.data.title;
this.ruleForm.teacherName = res.data.data.teacherName;
this.ruleForm.hostUnit = res.data.data.hostUnit;
this.ruleForm.content = res.data.data.content;
// this.registerTime = res.data.data.registerTime;
// this.competitionTime = res.data.data.competitionTime;
var regTime = res.data.data.registerTime;
var comTime = res.data.data.competitionTime;
var temp = Date.parse(res.data.data.registerTime);
var temp2 = Date.parse(res.data.data.competitionTime);
if (!isNaN(temp)) {
temp = new Date(Date.parse(regTime.replace(/-/g, "/")));
} else {
temp = new Date();
}
if (!isNaN(temp2)) {
temp2 = new Date(Date.parse(comTime.replace(/-/g, "/")));
} else {
temp2 = new Date();
}
console.log("temp");
console.log(temp);
console.log("temp");
this.ruleForm.date1 = temp;
this.ruleForm.date2 = temp;
this.ruleForm.gamedate1 = temp2;
this.ruleForm.gamedate2 = temp2;
// console.log("res.data.data");
// console.log(res.data.data.title);
// console.log(this.title);
// console.log("res.data.data");
}
})
.catch((err) => {
console.log("???");
return this.$message.error("获取竞赛列表信息失败!");
});
},
//确定修改
submitForm(formName) {
//判断是否合法
// this.$refs[formName].validate((valid) => {
// if (valid) {
// alert("submit!");
// } else {
// console.log("error submit!!");
// return false;
// }
// });
this.$refs["ruleForm"].validate((valid) => {
if (valid) {
var date1 = new Date(this.ruleForm.date1);
var date2 = new Date(this.ruleForm.date2);
var gamedate1 = new Date(this.ruleForm.gamedate1);
var gamedate2 = new Date(this.ruleForm.gamedate2);
var registerTime =
date1.getFullYear() +
"-" +
(date1.getMonth() + 1) +
"-" +
date1.getDate() +
" " +
date2.getHours() +
":" +
date2.getMinutes() +
":" +
date2.getSeconds();
var competitionTime =
gamedate1.getFullYear() +
"-" +
(gamedate1.getMonth() + 1) +
"-" +
gamedate1.getDate() +
" " +
gamedate2.getHours() +
":" +
gamedate2.getMinutes() +
":" +
gamedate2.getSeconds();
this.$axios({
method: "post",
url: "http://124.220.174.249:8085/backend/teacher/changeCompetition",
headers: { token: localStorage.token },
data: {
competitionId: this.queryInfo.competeId,
title: this.ruleForm.title,
content: this.ruleForm.content,
hostUnit: this.ruleForm.hostUnit,
registerTime: registerTime,
competitionTime: competitionTime,
},
})
.then((res) => {
console.log(res);
if (res.data.code == "200") {
// 动态设置当前用户的路由
// setRoutes();
this.$notify({
title: "发布成功",
message: "111",
type: "success",
});
console.log("发布成功");
// this.$message.success("登录成功");
// localStorage.setItem("user_id", id);
// if (res.data.role === "ROLE_STUDENT") {
this.$router.push("/PageTable");
// } else {
// this.$router.push("/");
// }
}
})
.catch((err) => {
console.log(err);
console.log("发布失败");
});
} else {
this.$notify({
title: "警告",
message: "请将信息填写完整!",
type: "warning",
});
}
});
},
//取消按钮响应,返回大厅
resetForm(formName) {
this.$refs[formName].resetFields();
this.$router.replace("/PageTable");
},
},
};
</script>
<style scoped>
.back {
position: relative;
left: 22px;
width: 90%;
height: 90%;
padding: 40px;
background: #e8f3fe;
background-repeat: no-repeat;
background-size: 100%;
}
</style>
<template>
<div>
<el-card shadow="hover" class="back">
<el-card
shadow="hover"
style="width: 75%; margin-left: 133px; opacity: 0.94"
>
<h2
style="
width: 100%;
border-bottom: 1px solid #4988fd;
padding-bottom: 20px;
"
>
发布招聘信息
</h2>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
>
<el-form-item label="企业名称" prop="title">
<el-input v-model="ruleForm.title"></el-input>
</el-form-item>
<el-form-item label="企业介绍" prop="content">
<el-input v-model="ruleForm.content"></el-input>
</el-form-item>
<el-form-item label="招聘岗位" prop="hostUnit">
<el-input v-model="ruleForm.hostUnit"></el-input>
</el-form-item>
<el-form-item label="岗位要求" prop="remark">
<el-input type="textarea" v-model="ruleForm.remark"></el-input>
</el-form-item>
<el-form-item label="招聘开始时间" required>
<el-col :span="10">
<el-form-item prop="date1">
<el-date-picker
type="date"
placeholder="选择日期"
v-model="ruleForm.date1"
:picker-options="pickerOptions1"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="10">
<el-form-item prop="date2">
<el-time-picker
type="fixed-time"
placeholder="选择时间"
v-model="ruleForm.date2"
style="width: 100%"
></el-time-picker>
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="招聘截止时间时间" required>
<el-col :span="10">
<el-form-item prop="gamedate1">
<el-date-picker
type="date"
placeholder="选择日期"
v-model="ruleForm.gamedate1"
:picker-options="pickerOptions1"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="10">
<el-form-item prop="gamedate2">
<el-time-picker
type="fixed-time"
placeholder="选择时间"
v-model="ruleForm.gamedate2"
style="width: 100%"
></el-time-picker>
</el-form-item>
</el-col>
</el-form-item>
<!-- <el-form-item label="报名表单"> </el-form-item>
<el-table :data="tableData" border style="width: 100%; margin: 20px">
<el-table-column prop="id" label="ID" width="80"> </el-table-column>
<el-table-column prop="no" label="学号" width="280">
</el-table-column>
<el-table-column prop="name" label="姓名" width="200">
</el-table-column>
<el-table-column prop="email" label="邮箱" width="280">
</el-table-column>
<el-table-column prop="phone" label="手机号" width="200">
</el-table-column>
<el-table-column prop="remarks" label="备注" width="80">
</el-table-column>
</el-table> -->
<el-form-item>
<el-button
style="
display: inline-block;
width: 150px;
height: 40px;
margin-right: 60px;
"
type="primary"
plain
round
size="medium"
@click="submitForm('ruleForm')"
>确认发布</el-button
>
<el-button
style="display: inline-block; width: 150px; height: 40px"
round
size="medium"
@click="resetForm('ruleForm')"
>返回</el-button
>
</el-form-item>
</el-form>
</el-card>
</el-card>
</div>
</template>
<script>
export default {
data() {
const generateData2 = () => {
const data = [];
return data;
};
return {
pickerOptions1: {
// 限制预约时间,只能选择今天和今天之后的时间
disabledDate(time) {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
},
},
//比赛时间
pickerOptions2: {
// 限制预约时间
disabledDate(time) {
console.log("this.ruleForm.date1.getTime()");
console.log(this.ruleForm.date1.getTime());
return (
time.getTime() > this.ruleForm.date1.getTime() - 24 * 60 * 60 * 1000
);
},
},
ruleForm: {
title: "",
desc: "",
content: "",
hostUnit: "",
remark: "",
date1: "",
date2: "",
gamedate1: "",
gamedate2: "",
},
rules: {
title: [
{ required: true, message: "请输入竞赛名称", trigger: "blur" },
{
min: 1,
max: 20,
message: "长度在 1 到 20 个字符",
trigger: "blur",
},
],
content: [
{ required: false, message: "请输入竞赛介绍", trigger: "blur" },
{
min: 1,
max: 200,
message: "长度在 1 到 200 个字符",
trigger: "blur",
},
],
hostUnit: [
{ required: true, message: "请输入竞赛举办地点", trigger: "blur" },
{
min: 1,
max: 50,
message: "长度在 1 到 50 个字符",
trigger: "blur",
},
],
remark: [
{ required: false, message: "请输入竞赛性质", trigger: "blur" },
{
min: 1,
max: 200,
message: "长度在 1 到 200 个字符",
trigger: "blur",
},
],
date1: [
{
type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
],
date2: [
{
type: "date",
required: true,
message: "请选择时间",
trigger: "change",
},
],
gamedate1: [
{
type: "date",
required: true,
message: "请选择日期",
trigger: "change",
},
],
gamedate2: [
{
type: "date",
required: true,
message: "请选择时间",
trigger: "change",
},
],
desc: [{ required: false, message: "请填写备注", trigger: "blur" }],
},
fileList: [
{
name: "food.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
{
name: "food2.jpeg",
url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
},
],
data2: generateData2(),
value2: [],
filterMethod(query, item) {
return item.pinyin.indexOf(query) > -1;
},
tableData: [
{
id: "1",
no: "221900190",
name: "佩奇",
email: "1234567890@qq.com",
phone: "13822223333",
remarks: "...",
},
{
id: "1",
no: "221900190",
name: "佩奇",
email: "1234567890@qq.com",
phone: "13822223333",
remarks: "...",
},
],
currentPage: 1,
pageSize: 10,
pageTotal: 2,
};
},
methods: {
//发布竞赛
submitForm(formName) {
this.$refs["ruleForm"].validate((valid) => {
if (valid) {
console.log("Date.now()");
console.log(this.ruleForm.gamedate1.getTime());
// var regTime = new Date(this.ruleForm.date1);
// var regsterTime = this.ruleForm.date1.getFullYear().toString
// +"-"+(this.ruleForm.date1.getMonth+1).toString
// +"-"+this.ruleForm.date1.getDate.toString
// +" "+this.ruleForm.date1.getDate.toString;; //获取完整的年份;
var date1 = new Date(this.ruleForm.date1);
var date2 = new Date(this.ruleForm.date2);
var gamedate1 = new Date(this.ruleForm.gamedate1);
var gamedate2 = new Date(this.ruleForm.gamedate2);
var registerTime =
date1.getFullYear() +
"-" +
(date1.getMonth() + 1) +
"-" +
date1.getDate() +
" " +
date2.getHours() +
":" +
date2.getMinutes() +
":" +
date2.getSeconds();
var competitionTime =
gamedate1.getFullYear() +
"-" +
(gamedate1.getMonth() + 1) +
"-" +
gamedate1.getDate() +
" " +
gamedate2.getHours() +
":" +
gamedate2.getMinutes() +
":" +
gamedate2.getSeconds();
console.log("111");
console.log(registerTime);
console.log("111");
console.log(competitionTime);
console.log(localStorage.getItem("userId").replace(/\"/g, ""));
console.log("222");
// this.$refs[formName].validate((valid) => {
// if (valid) {
// alert("submit!");
// } else {
// console.log("error submit!!");
// return false;
// }
// });
// this.$axios
// .post(
// "http://47.113.195.148:8085/backend/teacher/addCompetition",
// JSON.stringify(this.ruleForm)
// // {
// // teacherNo: this.userForm.teacherNo,
// // password: this.userForm.password,
// // }
// )
this.$axios({
method: "post",
url: "http://124.220.174.249:8085/backend/teacher/addCompetition",
headers: { token: localStorage.token },
data: {
title: this.ruleForm.title,
content: this.ruleForm.content,
hostUnit: this.ruleForm.hostUnit,
remark: this.ruleForm.remark,
releaserId: localStorage.getItem("userId"), //去掉双引号,
registerTime: registerTime,
competitionTime: competitionTime,
scale: this.ruleForm.scale,
},
})
.then((res) => {
console.log(res);
if (res.data.code == "200") {
// 动态设置当前用户的路由
// setRoutes();
this.$notify({
title: "发布成功",
message: "111",
type: "success",
});
console.log("发布成功");
// this.$message.success("登录成功");
// localStorage.setItem("user_id", id);
// if (res.data.role === "ROLE_STUDENT") {
this.$router.push("/PageTable");
// } else {
// this.$router.push("/");
// }
}
})
.catch((err) => {
console.log(err);
console.log("发布失败");
});
} else {
this.$notify({
title: "警告",
message: "请将信息填写完整!",
type: "warning",
});
}
});
},
resetForm(formName) {
// this.$refs[formName].resetFields();
this.$router.push("/PageTable");
},
},
};
</script>
<style scoped>
#card {
display: flex;
justify-content: center;
align-items: center;
}
.back {
position: relative;
left: 22px;
width: 90%;
height: 90%;
padding: 40px;
background: #e8f3fe;
background-repeat: no-repeat;
background-size: 100%;
}
</style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册