提交 974d9b36 编写于 作者: Tbryant1223's avatar Tbryant1223

Merge branch 'frontend-后台' of...

Merge branch 'frontend-后台' of https://gitcode.net/SoftwareEngineering2022ClassW/DeliverUnderBigBen/smartdormitory into frontend-后台
......@@ -17,7 +17,7 @@
<script src="https://cdn.bootcdn.net/ajax/libs/vuex/3.6.2/vuex.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.18.0/axios.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js"></script>
<script src="https://unpkg.com/element-ui@2.4.5/lib/index.js"></script>
<!-- <script src="https://unpkg.com/element-ui@2.4.5/lib/index.js"></script>-->
</div>
<!-- built files will be auto injected -->
</body>
......
......@@ -12,6 +12,12 @@ export default {
</script>
<style>
.el-table th.gutter {
display: table-cell !important;
}
body .el-table colgroup.gutter {
display: table-cell !important;
}
*{
margin: 0;
padding: 0;
......
......@@ -24,6 +24,7 @@
<el-menu-item index="/layout/stuInfo">学生信息</el-menu-item>
<el-menu-item index="/layout/houseKeepingInfo">楼管信息</el-menu-item>
<el-menu-item index="/layout/maintainerInfo">维修人员信息</el-menu-item>
<el-menu-item index="/layout/userInfo">用户信息</el-menu-item>
</el-menu-item-group>
</el-submenu>
......
// import Vue from 'vue'
// import VueRouter from 'vue-router'
//
//
// Vue.use(VueRouter)
//
// const routes = [
// {
// path: '/',
// name: 'login',
// component: () => import('../views/LoginRegister.vue')
// },
// {
// path: '/home',
// name: 'home',
// component: () => import('../views/HomeView.vue')
// },
// {
// path: '/dormMgt',
// name: 'dormMgt',
// component: () => import('../views/DormitoryManagement.vue')
// },{
// path: '/stuInfo',
// name: 'stuInfo',
// component: () => import('../views/personnelInformation/StudentInformation')
// },
// {
// path: '/houseKeepingInfo',
// name: 'houseKeepInfo',
// component: () => import('../views/personnelInformation/HousekeepingInformation')
// },
// {
// path: '/maintainerInfo',
// name: 'maintainerInfo',
// component: () => import('../views/personnelInformation/MaintainerInformation')
// },{
// path: '/checkins',
// name: 'checkins',
// component: () => import('../views/registrationManagement/CheckIns')
// },
// {
// path: '/publishTask',
// name: 'publishTask',
// component: () => import('../views/registrationManagement/PublishTask')
// },
// {
// path: '/repairMgt',
// name: 'repairMgt',
// component: () => import('../views/ServiceManagement/RepairManagement')
// },{
// path: '/complainMgt',
// name: 'complainMgt',
// component: () => import('../views/ServiceManagement/ComplaintManagement')
// },
// {
// path: '/communalFaciRepInfo',
// name: 'communalFaciRepInfo',
// component: () => import('../views/ServiceManagement/CommunalFacilitiesRepairInfo')
// },{
// path: '/chargeItems',
// name: 'chargeItems',
// component: () => import('../views/chargeManagement/ChargeItems')
// },
// {
// path: '/chargeDetailsMgt',
// name: 'chargeDetailsMgt',
// component: () => import('../views/chargeManagement/ChargeDetailsManagement')
// },{
// path: '/adminList',
// name: 'adminList',
// component: () => import('../views/AdministratorManagement/AdministratorList')
// },
// {
// path: '/userGroupMgt',
// name: 'userGroupMgt',
// component: () => import('../views/AdministratorManagement/UserGroupManagement')
// },{
// path: '/personalInfoSetting',
// name: 'personalInfoSetting',
// component: () => import('../views/PersonalInformationSettings')
// }
// ]
//
// const router = new VueRouter({
// mode: 'history',
// base: process.env.BASE_URL,
// routes
// })
//
// export default router
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/components/Layout'
......@@ -124,6 +31,11 @@ const router= new Router({
name: 'stuInfo',
component: () => import('../views/personnelInformation/StudentInformation')
},
{
path: 'userInfo',
name: 'userInfo',
component: () => import('../views/personnelInformation/UserInformation')
},
{
path: 'houseKeepingInfo',
name: 'houseKeepInfo',
......
......@@ -21,6 +21,9 @@
<el-form-item label="姓名" :label-width="formLabelWidth" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="邮箱" :label-width="formLabelWidth" prop="email">
<el-input v-model="form.email" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')">重置</el-button>
......@@ -52,7 +55,8 @@ export default {
password:'',
tel:'',
name:'',
repassword:''
repassword:'',
email:''
},
formLabelWidth: '120px',
passw:"password",
......@@ -74,6 +78,8 @@ export default {
name:[{ required: true, message: '请输入姓名', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
email: [{required:true,message:'请输入邮箱',trigger:'blur'},
{pattern:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,message: '邮箱格式错误'}]
}
}
},
......@@ -89,7 +95,8 @@ export default {
password:'',
tel:'',
name:'',
repassword:''
repassword:'',
email: ''
};
},
showPass(){
......@@ -106,7 +113,13 @@ export default {
this.$refs.form.validate((validate)=>{
if (validate){
this.dialogFormVisible= false;
axios.post("http://124.223.194.15:19260/admin/add",this.form).then(response=>{
axios.post("http://36.139.166.61:19260/admin/add",{
"username":this.form.username,
"password":this.form.password,
"tel":this.form.tel,
"name":this.form.name,
"email":this.form.email
}).then(response=>{
// console.log(response);
if (response.data.status === 1000){
this.$message.success("添加成功");
......
......@@ -30,6 +30,12 @@
width="180"
align="center">
</el-table-column>
<el-table-column
prop="email"
label="邮箱"
width="180"
align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<!-- <el-button-->
......@@ -76,7 +82,7 @@ export default {
}
},
mounted() {
axios.post('http://124.223.194.15:19260/admin/search', {})
axios.post('http://36.139.166.61:19260/admin/search', {})
.then(response => {
// console.log(response.data.data);
this.tableData = response.data.data;
......@@ -95,7 +101,7 @@ export default {
type: 'warning',
center: true
}).then(async () => {
axios.get('http://124.223.194.15:19260/admin/delete',{params:{id:row.id}})
axios.get('http://36.139.166.61:19260/admin/delete',{params:{id:row.id}})
.then(response=>{
if (response.data.status ===1000){
this.$message.success('删除成功');
......@@ -112,13 +118,13 @@ export default {
},
transfer(row) {
this.dfn_update++;
this.user = {id: row.id, username: row.username, password: row.password, name: row.name, tel: row.tel};
this.user = {id: row.id, username: row.username, password: row.password, name: row.name, tel: row.tel, email:row.email};
},
add() {
this.dfn_add++;
},
getData() {
axios.post('http://124.223.194.15:19260/admin/search', {})
axios.post('http://36.139.166.61:19260/admin/search', {})
.then(response => {
this.tableData = response.data.data;
})
......
......@@ -24,6 +24,9 @@
<el-form-item label="姓名" :label-width="formLabelWidth" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="邮箱" :label-width="formLabelWidth" prop="email">
<el-input v-model="form.email" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="closeForm">取 消</el-button>
......@@ -77,6 +80,8 @@ export default {
name:[{ required: true, message: '请输入姓名', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
email: [{required:true,message:'请输入邮箱',trigger:'blur'},
{pattern:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,message: '邮箱格式错误'}]
}
}
},
......@@ -99,7 +104,7 @@ export default {
this.$refs.form.validate((validate)=>{
if (validate){
this.dialogFormVisible = false;
axios.post("http://124.223.194.15:19260/admin/update",this.form).then(response=>{
axios.post("http://36.139.166.61:19260/admin/update",this.form).then(response=>{
console.log(response);
if (response.data.status === 1000){
this.$message.success("修改成功");
......
......@@ -152,7 +152,7 @@ export default {
},
}},
created() {
axios.post('http://124.223.194.15:19260/admin/building/search',{})
axios.post('http://36.139.166.61:19260/admin/building/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -160,7 +160,7 @@ export default {
.catch(function (error) {
console.log(error);
});
axios.post('http://124.223.194.15:19260/admin/caretaker/search',{})
axios.post('http://36.139.166.61:19260/admin/caretaker/search',{})
.then(response => {
this.caretakerOptions=response.data.data;
console.log('请求成功');
......@@ -207,14 +207,14 @@ export default {
}
//获取文件url
axios.post('http://124.223.194.15:19260/upload',formData,config)
axios.post('http://36.139.166.61:19260/upload',formData,config)
.then(response=>{
if (response.data.status ===1000){
// this.$message.success('请求成功');
console.log(response)
this.file_Url = response.data.url;
axios.post('http://124.223.194.15:19260/admin/building/addList',{
axios.post('http://36.139.166.61:19260/admin/building/addList',{
fileUrl:this.file_Url
}).then(response=>{
if (response.data.status ===1000){
......@@ -242,7 +242,7 @@ export default {
},
refleshTable(){
axios.post('http://124.223.194.15:19260/admin/building/search',{})
axios.post('http://36.139.166.61:19260/admin/building/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -281,7 +281,7 @@ export default {
{
this.form.bid=this.form.bid-0
this.form.area=this.form.area-0
axios.post("http://124.223.194.15:19260/admin/building/update", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/building/update", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("修改成功");
this.refleshTable();
......@@ -294,7 +294,7 @@ export default {
}else{
this.form.bid=this.form.bid-0
this.form.area=this.form.area-0
axios.post("http://124.223.194.15:19260/admin/building/add", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/building/add", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("添加成功");
this.refleshTable();
......
......@@ -198,12 +198,12 @@ export default {
};
},
created() {
axios.post('http://124.223.194.15:19260/admin/repair/search',{}).then(response => {
axios.post('http://36.139.166.61:19260/admin/repair/search',{}).then(response => {
this.tableData = response.data.data;
})
},
mounted() {
axios.get('http://124.223.194.15:19260/admin/mainPageData').then(response => {
axios.get('http://36.139.166.61:19260/admin/mainPageData').then(response => {
this.homeData = response.data.data;
})
......@@ -280,4 +280,4 @@ export default {
background: #92e4ba;
}
</style>
\ No newline at end of file
</style>
......@@ -9,7 +9,7 @@
<el-main width="">
<h1 style="text-align: center">智慧宿舍管理系统登陆</h1>
<br /><br /><br />
<div class="tablee">
<div class="tablee" >
<table>
<tr>
<td>
......@@ -59,17 +59,38 @@
</table>
</div>
<br /><br /><br />
<el-button type="primary" @click="login" style="align: center"
>登录</el-button
>
<el-button type="primary" @click="login" style="align: center">登录</el-button>
<el-button @click = "refreshCode" >刷新验证码</el-button>
<el-button @click = "dialogVisible=true" >忘记密码</el-button>
<el-dialog title="重置密码" :visible.sync="dialogVisible" height="80%" width="30%">
<el-form :model="dataPsw" ref="dataPsw" :rules="rules2" >
<el-form-item label="请输入用户名" prop="username">
<el-input v-model="dataPsw.username" autocomplete="off"></el-input>
</el-form-item>
<el-button type="primary" size="mini" @click="getVcode" :disabled="this.geted">获取验证码</el-button>
<el-form-item label="请输入验证码" prop="vcode">
<el-input v-model="dataPsw.vcode" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="请输入新密码" prop="newPassword">
<el-input show-password placeholder="请输入新密码" auto-complete="off" v-model="dataPsw.newPassword" ></el-input>
</el-form-item>
<el-form-item label="请重复新密码" prop="repeatPassword">
<el-input show-password placeholder="请重复新密码" maxlength="18" v-model="dataPsw.repeatPassword" ></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close">取 消</el-button>
<el-button type="primary" @click="reset">修 改</el-button>
</div>
</el-dialog>
<el-button @click = "refreshCode" >刷新</el-button>
</el-main>
</div>
<el-aside width="500px"></el-aside>
</el-container>
</div>
</template>
......@@ -81,17 +102,82 @@ export default {
components: { SIdentify },
name: "LoginRegister.vue",
data() {
var validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'))
} else if (value !== this.dataPsw.newPassword) {
callback(new Error('两次输入密码不一致!'))
} else {
callback()
}
}
return {
rules2:{
username: [
{ required: false, message: '请输入用户名', trigger: 'blur' },
],
vcode: [
{ required: false, message: '请输入验证码', trigger: 'blur' },
],
newPassword: [
{ required: false, message: '请输入密码', trigger: 'blur' },
{ pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{4,20}$/, message: '密码必须是由4-20位字母+数字组合' }
],
repeatPassword: [
{ required: false, validator: validatePass2, trigger: 'blur' }
]
},
geted:false,
resetId:0,
dataPsw:{
username:"",
vcode:"",
newPassword:"",
repeatPassword:""
},
id: "",
psw: "",
dialogVisible:false,
status: 1000,
code:"",
identifyCodes: '1234567890abcdefjhijklinopqrsduvwxyz',//随机串内容
identifyCodes: '1234567890abcdefjhijklinopqrsduvwxyz',
identifyCode: '',
};
},
methods: {
refreshCode () {
close(){
this.dialogVisible = false;this.geted=false;
},
getVcode(){
axios.post("http://36.139.166.61:19260/admin/sendResetEmail", {username: this.dataPsw.username}).then(response => {
if (response.data.status === 1000) {
this.resetId=response.data.id
this.geted=true;
this.$message.success("验证码已发送,请接收邮件");
}else{
this.$message.error("用户名不存在!");
}
}).catch(function (error) {
console.log(error);
this.$message.error("操作失败!");
});
},
reset(){
axios.post("http://36.139.166.61:19260/admin/resetPassword", {id: this.resetId,code:this.dataPsw.vcode-0,password: this.dataPsw.newPassword}).then(response => {
this.geted=false;
if (response.data.status === 1000) {
this.resetId=response.data.id
this.$message.success("密码更改成功,请重新登录!");
this.dialogVisible = false;
}else{
this.$message.error("验证码错误!");
}
}).catch(function (error) {
console.log(error);
this.$message.error("操作失败!");
});
},
refreshCode () {
this.identifyCode = ''
this.makeCode(this.identifyCodes, 4)
},
......@@ -109,13 +195,14 @@ export default {
if (this.code!=this.identifyCode)
{
alert("验证码错误!");
this.refreshCode();
}
else{
//后端接口
axios
.post("http://124.223.194.15:19260/admin/login", {
.post("http://36.139.166.61:19260/admin/login", {
username: this.id,
password: this.psw,
})
......@@ -127,7 +214,7 @@ export default {
console.log("登录成功");
localStorage.setItem('tempUser',JSON.stringify(response.data));
this.$router.push({ path: "/layout/home" }); //跳转
} else if (this.status == "1001")
} else if (this.status == "1001")
{alert("账号/密码错误");
this.refreshCode();}
},
......@@ -155,11 +242,16 @@ export default {
margin: 0 auto;
}
.tablee {
deep:true;
width: 600px;
height: 100px;
margin-right: auto;
margin-left: auto;
}
.dialog-footer{
padding-top:10px ;
padding-left: 10%;
}
/* .main {
position: relative;
}*/
......
......@@ -10,13 +10,15 @@
<div style="text-align: center">
<h1>头像</h1>
<el-upload
disabled
class="avatar-uploader"
action="https://jsonplaceholder.typicode.com/posts/"
class="upload-demo"
action="customize"
:http-request="uploadFile"
:before-upload="beforeAvatarUpload"
:limit="1"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar">
>
<img v-if="imageUrl" :src="imageUrl" class="avatar" alt="头像">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
......@@ -34,6 +36,9 @@
<div class="personal-relation">
<div class="relation-item">电话: <div style="float: right; padding-right:20px;">{{ dataForm.tel }}</div></div>
</div>
<div class="personal-relation">
<div class="relation-item">邮箱: <div style="float: right; padding-right:20px;">{{ dataForm.email }}</div></div>
</div>
</el-card>
</div>
</el-col>
......@@ -58,6 +63,9 @@
<el-form-item label="用户名" prop="username">
<el-input disabled maxlength="18" v-model="dataForm.username"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input auto-complete="off" v-model="dataForm.email"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button size="mini" type="primary" @click="changeInfo">修改</el-button>
......@@ -110,11 +118,12 @@ export default {
}
return{
tempUser:{},
imageUrl: require("@/assets/imgs/head.jpg"),
imageUrl: "",
dataForm:{
name: '伞兵',
tel: '173567777777',
username: 'fdjsb'
username: 'fdjsb',
email:'abc@123.com'
},
informationShow:true,
passwordShow:false,
......@@ -133,6 +142,8 @@ export default {
name:[{ required: true, message: '请输入姓名', trigger: 'blur' },
{ min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur' }
],
email: [{required:true,message:'请输入邮箱',trigger:'blur'},
{pattern:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,message: '邮箱格式错误'}]
},
rules2:{
newPassword: [
......@@ -150,12 +161,52 @@ export default {
this.dataForm.name=this.tempUser.name;
this.dataForm.tel=this.tempUser.tel;
this.dataForm.username=this.tempUser.username;
this.dataForm.email = this.tempUser.email;
this.imageUrl = this.tempUser.image||require("@/assets/imgs/head.jpg");
},
methods:{
//上传图标事件
uploadFile(params){
const _file = params.file;
let formData = new FormData();
formData.append("file", _file);
let config = {
headers:{
'Content-Type':'multipart/form-data',
}
}; //添加请求头
//获取文件url
axios.post('http://36.139.166.61:19260/upload',formData,config)
.then(response=>{
if (response.data.status ===1000){
// this.$message.success('请求成功');
console.log(response);
axios.post("http://36.139.166.61:19260/admin/update",{"image":response.data.url})
.then(res=>{
console.log(res);
if (res.data.status === 1000){
this.imageUrl = response.data.url;
let tempUser =JSON.parse(localStorage.getItem('tempUser'));
tempUser.image = this.imageUrl;
localStorage.setItem('tempUser',JSON.stringify(tempUser));
}
else{
this.$message.error('修改头像失败,'+res.data.message);
}
})
}
else{
this.$message.error('请求失败');
}
}).catch(function (error) {
console.log(error);
});
},
changeInfo(){
this.$refs['dataForm'].validate(validate=>{
if (validate){
axios.post("http://124.223.194.15:19260/admin/update",{"name":this.dataForm.name,"tel":this.dataForm.tel})
axios.post("http://36.139.166.61:19260/admin/update",{"name":this.dataForm.name,"tel":this.dataForm.tel})
.then(response=>{
console.log(response);
if (response.data.status === 1000){
......@@ -179,7 +230,7 @@ export default {
changePassword(){
this.$refs['dataPsw'].validate(validate=>{
if (validate){
axios.post("http://124.223.194.15:19260/admin/update",{"password":this.dataPsw.newPassword})
axios.post("http://36.139.166.61:19260/admin/update",{"password":this.dataPsw.newPassword})
.then(response=>{
console.log(response);
if (response.data.status === 1000){
......@@ -205,17 +256,19 @@ export default {
handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw);
},
//对上传图片的大小、格式进行限制
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 格式!');
const isJPG = file.type === "image/jpeg";
const isJPG2 = file.type === "image/jpg";
const isPNG = file.type === "image/png";
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isJPG && !isJPG2 && !isPNG) {
this.$message.warning("只支持jpg或png格式图片");
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
if (!isLt5M) {
this.$message.warning("请上传5MB以内的图片!");
}
return isJPG && isLt2M;
return (isJPG || isJPG2 || isPNG) && isLt5M;
},
informationClick(){ //个人信息事件
this.informationShow = true
......
......@@ -127,7 +127,7 @@ export default {
}else{
rType = this.repairType
}
axios.post('http://124.223.194.15:19260/admin/publicFacilitiesRepair/search',{
axios.post('http://36.139.166.61:19260/admin/publicFacilitiesRepair/search',{
bid: bID,
type: rType
}).then(
......@@ -176,7 +176,7 @@ export default {
},
mounted() {
this.buildings = this.loadAll();
axios.get('http://124.223.194.15:19260/admin/publicFacilitiesRepair/type',{params:{}})
axios.get('http://36.139.166.61:19260/admin/publicFacilitiesRepair/type',{params:{}})
.then(response=>{
if (response.data.status ===1000){
this.options=response.data.data;
......@@ -195,7 +195,7 @@ export default {
}).catch(function (error) {
console.log(error);
});
axios.post('http://124.223.194.15:19260/admin/publicFacilitiesRepair/search',{
axios.post('http://36.139.166.61:19260/admin/publicFacilitiesRepair/search',{
bid: null,
type: null
}).then(
......@@ -266,4 +266,4 @@ export default {
<style scoped>
</style>
\ No newline at end of file
</style>
......@@ -125,7 +125,7 @@ export default {
},
save(){
if(this.rowNum!=-1){
axios.post('http://124.223.194.15:19260/admin/complaint/response',{
axios.post('http://36.139.166.61:19260/admin/complaint/response',{
id:this.rowNum,
response:this.textarea
}).then(
......@@ -167,7 +167,7 @@ export default {
else{
c_status = this.complaintStatus-0;
}
axios.post('http://124.223.194.15:19260/admin/complaint/search',{
axios.post('http://36.139.166.61:19260/admin/complaint/search',{
sno: c_SID,
status: c_status
}).then(
......@@ -193,7 +193,7 @@ export default {
},
},
mounted(){
axios.post('http://124.223.194.15:19260/admin/complaint/search',{
axios.post('http://36.139.166.61:19260/admin/complaint/search',{
sno: null,
status: null
}).then(
......@@ -256,4 +256,4 @@ export default {
<style scoped>
</style>
\ No newline at end of file
</style>
......@@ -137,7 +137,7 @@ export default {
}else{
rType = this.repairType
}
axios.post('http://124.223.194.15:19260/admin/repair/search',{
axios.post('http://36.139.166.61:19260/admin/repair/search',{
bid: bID,
type: rType
}).then(
......@@ -193,7 +193,7 @@ export default {
},
mounted() {
this.buildings = this.loadAll();
axios.get('http://124.223.194.15:19260/admin/repair/type',{params:{}})
axios.get('http://36.139.166.61:19260/admin/repair/type',{params:{}})
.then(response=>{
if (response.data.status ===1000){
this.options=response.data.data;
......@@ -206,7 +206,7 @@ export default {
}).catch(function (error) {
console.log(error);
});
axios.post('http://124.223.194.15:19260/admin/repair/search',{
axios.post('http://36.139.166.61:19260/admin/repair/search',{
bid: null,
type: null
}).then(
......@@ -322,4 +322,4 @@ export default {
<style scoped>
</style>
\ No newline at end of file
</style>
......@@ -11,7 +11,7 @@
v-model="form.startTime"
type="datetime"
placeholder="选择开始日期"
value-format="yyyy-MM-ddTHH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
>
</el-date-picker>
</el-form-item>
......@@ -21,7 +21,7 @@
v-model="form.endTime"
type="datetime"
placeholder="选择结束日期"
value-format="yyyy-MM-ddTHH:mm:ss">
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-form>
......@@ -65,7 +65,7 @@ export default {
if (validate){
// console.log(this.form);
this.dialogFormVisible= false;
axios.post("http://124.223.194.15:19260/admin/charge/add",this.form).then(response=>{
axios.post("http://36.139.166.61:19260/admin/charge/add",this.form).then(response=>{
// console.log(response);
if (response.data.status === 1000){
this.$message.success("添加成功");
......
......@@ -62,7 +62,7 @@ export default {
}
},
mounted() {
axios.post('http://124.223.194.15:19260/admin/charge/search',{})
axios.post('http://36.139.166.61:19260/admin/charge/search',{})
.then(response=>{
if (response.data.status ===1000){
this.options=response.data.data;
......@@ -81,7 +81,7 @@ export default {
value:{
handler(newValue){
console.log(newValue);
axios.get('http://124.223.194.15:19260/admin/charge/detail',{params:{
axios.get('http://36.139.166.61:19260/admin/charge/detail',{params:{
pid:newValue
}}).then(response=>{
if (response.data.status ===1000){
......@@ -93,7 +93,7 @@ export default {
console.log(error);
});
axios.get('http://124.223.194.15:19260/admin/charge/status',{params:{
axios.get('http://36.139.166.61:19260/admin/charge/status',{params:{
id:newValue
}}).then((response=>{
if (response.data.status ===1000){
......
......@@ -48,7 +48,7 @@
header-align = center>
<template slot-scope="scope">{{scope.row.endtime.slice(0, 19).replace("T", " ")}}</template>
</el-table-column>
<el-table-column label="操作" style="width: 120px" align = center header-align = center>
<el-table-column label="操作" width="230" align = center header-align = center>
<template slot-scope="scope">
<el-row>
<el-col :span="9" offset="1">
......@@ -121,7 +121,7 @@ export default {
}
},
mounted() {
axios.post('http://124.223.194.15:19260/admin/charge/search',{})
axios.post('http://36.139.166.61:19260/admin/charge/search',{})
.then(response=>{
if (response.data.status ===1000){
this.tableData=response.data.data;
......@@ -186,14 +186,14 @@ export default {
}
//获取文件url
axios.post('http://124.223.194.15:19260/upload',formData,config)
axios.post('http://36.139.166.61:19260/upload',formData,config)
.then(response=>{
if (response.data.status ===1000){
// this.$message.success('请求成功');
console.log(response)
this.file_Url = response.data.url;
axios.post('http://124.223.194.15:19260/admin/charge/addDetail',{
axios.post('http://36.139.166.61:19260/admin/charge/addDetail',{
id:1,
fileUrl:this.file_Url
}).then(response=>{
......@@ -232,7 +232,7 @@ export default {
type: 'warning',
center: true
}).then(async () => {
axios.post('http://124.223.194.15:19260/admin/charge/delete',{id:row.id})
axios.post('http://36.139.166.61:19260/admin/charge/delete',{id:row.id})
.then(response=>{
if (response.data.status ===1000){
this.$message.success('删除成功');
......@@ -255,7 +255,7 @@ export default {
this.dfn_add++;
},
getData(){
axios.post('http://124.223.194.15:19260/admin/charge/search',{})
axios.post('http://36.139.166.61:19260/admin/charge/search',{})
.then(response=>{
if (response.data.status ===1000){
console.log(this);
......
......@@ -58,6 +58,18 @@
width="200">
<template slot-scope="scope">{{ scope.row.starttime+'~'+scope.row.endtime }}</template>
</el-table-column>
<el-table-column
prop="workday"
label="工作日"
width="150">
<template slot-scope="scope">
<span v-if="scope.row.workday.length==1">{{"每星期"+scope.row.workday[0]}}</span>
<span v-if="scope.row.workday.length==2">{{"每星期"+scope.row.workday[0]+','+scope.row.workday[1]}}</span>
<span v-if="scope.row.workday.length==3">{{"每星期"+scope.row.workday[0]+','+scope.row.workday[1]+','+scope.row.workday[2]}}</span>
<span v-if="scope.row.workday.length==4">{{"每星期"+scope.row.workday[0]+','+scope.row.workday[1]+','+scope.row.workday[2]+','+scope.row.workday[3]}}</span>
<span v-if="scope.row.workday.length>4">{{"每星期"+scope.row.workday}}</span>
</template>
</el-table-column>
<el-table-column
prop="bid"
label="负责楼号"
......@@ -75,7 +87,7 @@
label="联系方式"
width="120">
</el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" circle @click="handleEdit(scope.row)"></el-button>
<el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.$index, scope.row)"></el-button>
......@@ -114,6 +126,16 @@
placeholder="选择时间">
</el-time-picker>
</el-form-item>
<el-form-item label="工作日" prop="workday">
<el-select v-model="form.workdayList" multiple placeholder="请选择工作日">
<el-option
v-for="item in workdayOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式" prop="tel">
<el-input v-model="form.tel" autocomplete="off"></el-input>
</el-form-item>
......@@ -162,11 +184,12 @@ export default {
title:'',
tableData: [{
"id": 1,
"wno": "123456",
"cno": "123456",
"name": "fdj",
"sex": 0,
"starttime": "00:09:00",
"endtime": "00:17:00",
"workday":["1"],
"bid": ["34"],
"tel": "123456789"
}],
......@@ -197,11 +220,36 @@ export default {
endtime: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
],
workdayList: [
{ required: true, message: '请选择工作日', trigger: 'change' }
],
tel: [
{ required: true, message: '请输入联系方式', trigger: 'blur' },
{pattern: /^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/, message: '手机号格式错误'}
]
},
workdayOptions: [{
value: 1,
label: '星期一'
}, {
value: 2,
label: '星期二'
}, {
value: 3,
label: '星期三'
}, {
value: 4,
label: '星期四'
}, {
value: 5,
label: '星期五'
}, {
value: 6,
label: '星期六'
}, {
value: 7,
label: '星期天'
}],
multipleSelection: [],
value: "",
options:[],
......@@ -213,12 +261,13 @@ export default {
sex:'',
starttime:'',
endtime:'',
workdayList:[],
tel:'',
},
}
},
created() {
axios.post('http://124.223.194.15:19260/admin/caretaker/search',{})
axios.post('http://36.139.166.61:19260/admin/caretaker/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -228,7 +277,7 @@ export default {
});
},
mounted() {
axios.post('http://124.223.194.15:19260/admin/building/search',{})
axios.post('http://36.139.166.61:19260/admin/building/search',{})
.then(response=>{
if (response.data.status ===1000){
this.options=response.data.data;
......@@ -280,14 +329,14 @@ export default {
}
//获取文件url
axios.post('http://124.223.194.15:19260/upload',formData,config)
axios.post('http://36.139.166.61:19260/upload',formData,config)
.then(response=>{
if (response.data.status ===1000){
// this.$message.success('请求成功');
console.log(response)
this.file_Url = response.data.url;
axios.post('http://124.223.194.15:19260/admin/charge/addDetail',{
axios.post('http://36.139.166.61:19260/admin/charge/addDetail',{
fileUrl:this.file_Url
}).then(response=>{
if (response.data.status ===1000){
......@@ -315,7 +364,7 @@ export default {
},
refleshTable(){
axios.post('http://124.223.194.15:19260/admin/caretaker/search',{})
axios.post('http://36.139.166.61:19260/admin/caretaker/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -360,7 +409,7 @@ export default {
date2.setMinutes(date2.getMinutes()-date2.getTimezoneOffset())
this.form.starttime=date.toJSON().substr(11, 8);
this.form.endtime=date2.toJSON().substr(11, 8);
axios.post("http://124.223.194.15:19260/admin/caretaker/update", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/caretaker/update", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("修改成功");
this.refleshTable();
......@@ -379,7 +428,7 @@ export default {
date2.setMinutes(date2.getMinutes()-date2.getTimezoneOffset())
this.form.starttime=date.toJSON().substr(11, 8);
this.form.endtime=date2.toJSON().substr(11, 8);
axios.post("http://124.223.194.15:19260/admin/caretaker/add", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/caretaker/add", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("添加成功");
this.refleshTable();
......@@ -410,7 +459,7 @@ export default {
}).then(async () => {
let arr = []
arr.push(row.id)
axios.post('http://124.223.194.15:19260/admin/caretaker/delete',{id:arr})
axios.post('http://36.139.166.61:19260/admin/caretaker/delete',{id:arr})
.then(response=>{
if (response.data.status ===1000){
this.$message.success('删除成功');
......@@ -432,19 +481,23 @@ export default {
}).then( async() => {
this.deleteOptions=[];
let d = this.multipleSelection;
for(let i = 0 ; i<d.length; i ++ ){
this.deleteOptions.push(d[i].id);
}
axios.post("http://124.223.194.15:19260/admin/caretaker/delete",{id:this.deleteOptions}).then(response=>{
if (response.data.status === 1000){
this.$message.success("批量删除成功");
this.refleshTable();
if(d.length == 0)
{
this.$message.error('未选择删除的数据行');
}else{
for(let i = 0 ; i<d.length; i ++ ){
this.deleteOptions.push(d[i].id);
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
axios.post("http://36.139.166.61:19260/admin/caretaker/delete",{id:this.deleteOptions}).then(response=>{
if (response.data.status === 1000){
this.$message.success("批量删除成功");
this.refleshTable();
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
}
});
}
},
......@@ -452,7 +505,7 @@ export default {
value:{
handler(newValue){
console.log(newValue);
axios.post('http://124.223.194.15:19260/admin/caretaker/search',{
axios.post('http://36.139.166.61:19260/admin/caretaker/search',{
bid:newValue
}).then(response=>{
if (response.data.status ===1000){
......@@ -471,4 +524,4 @@ export default {
<style scoped>
</style>
\ No newline at end of file
</style>
......@@ -58,6 +58,18 @@
width="200">
<template slot-scope="scope">{{ scope.row.starttime+'~'+scope.row.endtime }}</template>
</el-table-column>
<el-table-column
prop="workday"
label="工作日"
width="150">
<template slot-scope="scope">
<span v-if="scope.row.workday.length==1">{{"每星期"+scope.row.workday[0]}}</span>
<span v-if="scope.row.workday.length==2">{{"每星期"+scope.row.workday[0]+','+scope.row.workday[1]}}</span>
<span v-if="scope.row.workday.length==3">{{"每星期"+scope.row.workday[0]+','+scope.row.workday[1]+','+scope.row.workday[2]}}</span>
<span v-if="scope.row.workday.length==4">{{"每星期"+scope.row.workday[0]+','+scope.row.workday[1]+','+scope.row.workday[2]+','+scope.row.workday[3]}}</span>
<span v-if="scope.row.workday.length>4">{{"每星期"+scope.row.workday}}</span>
</template>
</el-table-column>
<el-table-column
prop="repairType"
label="维修类型"
......@@ -68,7 +80,7 @@
label="联系方式"
width="120">
</el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" circle @click="handleEdit(scope.row)"></el-button>
<el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.$index, scope.row)"></el-button>
......@@ -107,6 +119,16 @@
placeholder="选择时间">
</el-time-picker>
</el-form-item>
<el-form-item label="工作日" prop="workday">
<el-select v-model="form.workdayList" multiple placeholder="请选择工作日">
<el-option
v-for="item in workdayOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="维修类型" prop="repairtypeid">
<el-select v-model="form.repairtypeid" clearablell placeholder="请选择维修类型">
<el-option
......@@ -192,6 +214,9 @@ export default {
endtime: [
{ required: true, message: '请选择结束时间', trigger: 'change' }
],
workdayList: [
{ required: true, message: '请选择工作日', trigger: 'change' }
],
repairtypeid: [
{ required: true, message: '请选择维修类型', trigger: 'blur' }
],
......@@ -204,6 +229,28 @@ export default {
value: "",
options:[],
deleteOptions:[],
workdayOptions: [{
value: 1,
label: '星期一'
}, {
value: 2,
label: '星期二'
}, {
value: 3,
label: '星期三'
}, {
value: 4,
label: '星期四'
}, {
value: 5,
label: '星期五'
}, {
value: 6,
label: '星期六'
}, {
value: 7,
label: '星期天'
}],
dialogVisible:false,
form:{
wno:'',
......@@ -211,13 +258,14 @@ export default {
sex:'',
starttime:'',
endtime:'',
workdayList:[],
repairtypeid:'',
tel:'',
},
}
},
created() {
axios.post('http://124.223.194.15:19260/admin/repairer/search',{})
axios.post('http://36.139.166.61:19260/admin/repairer/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -225,7 +273,7 @@ export default {
.catch(function (error) {
console.log(error);
});
axios.get('http://124.223.194.15:19260/admin/repairer/type')
axios.get('http://36.139.166.61:19260/admin/repairer/type')
.then(response => {
this.repairTypeOptions=response.data.data;
console.log('请求成功');
......@@ -272,14 +320,14 @@ export default {
}
//获取文件url
axios.post('http://124.223.194.15:19260/upload',formData,config)
axios.post('http://36.139.166.61:19260/upload',formData,config)
.then(response=>{
if (response.data.status ===1000){
// this.$message.success('请求成功');
console.log(response)
this.file_Url = response.data.url;
axios.post('http://124.223.194.15:19260/admin/repairer/addList',{
axios.post('http://36.139.166.61:19260/admin/repairer/addList',{
fileUrl:this.file_Url
}).then(response=>{
if (response.data.status ===1000){
......@@ -307,7 +355,7 @@ export default {
},
refleshTable(){
axios.post('http://124.223.194.15:19260/admin/repairer/search',{})
axios.post('http://36.139.166.61:19260/admin/repairer/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -353,7 +401,7 @@ export default {
date2.setMinutes(date2.getMinutes()-date2.getTimezoneOffset())
this.form.starttime=date.toJSON().substr(11, 8);
this.form.endtime=date2.toJSON().substr(11, 8);
axios.post("http://124.223.194.15:19260/admin/repairer/update", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/repairer/update", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("修改成功");
this.refleshTable();
......@@ -374,7 +422,7 @@ export default {
date2.setMinutes(date2.getMinutes()-date2.getTimezoneOffset())
this.form.starttime=date.toJSON().substr(11, 8);
this.form.endtime=date2.toJSON().substr(11, 8);
axios.post("http://124.223.194.15:19260/admin/repairer/add", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/repairer/add", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("添加成功");
this.refleshTable();
......@@ -407,7 +455,7 @@ export default {
}).then(async () => {
let arr = []
arr.push(row.id)
axios.post('http://124.223.194.15:19260/admin/repairer/delete',{id:arr})
axios.post('http://36.139.166.61:19260/admin/repairer/delete',{id:arr})
.then(response=>{
if (response.data.status ===1000){
this.$message.success('删除成功');
......@@ -429,19 +477,23 @@ export default {
}).then( async() => {
this.deleteOptions=[];
let d = this.multipleSelection;
for(let i = 0 ; i<d.length; i ++ ){
this.deleteOptions.push(d[i].id);
}
axios.post("http://124.223.194.15:19260/admin/repairer/delete",{id:this.deleteOptions}).then(response=>{
if (response.data.status === 1000){
this.$message.success("批量删除成功");
this.refleshTable();
if(d.length == 0)
{
this.$message.error('未选择删除的数据行');
}else {
for (let i = 0; i < d.length; i++) {
this.deleteOptions.push(d[i].id);
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
axios.post("http://36.139.166.61:19260/admin/repairer/delete", {id: this.deleteOptions}).then(response => {
if (response.data.status === 1000) {
this.$message.success("批量删除成功");
this.refleshTable();
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
}
});
}
},
......@@ -449,7 +501,7 @@ export default {
value:{
handler(newValue){
console.log(newValue);
axios.post('http://124.223.194.15:19260/admin/repairer/search',{
axios.post('http://36.139.166.61:19260/admin/repairer/search',{
repairtypeid:newValue
}).then(response=>{
if (response.data.status ===1000){
......
......@@ -49,7 +49,7 @@
<el-table-column
prop="sex"
label="性别"
width="120">
width="90">
<template slot-scope="scope">{{ scope.row.sex==0?'':'' }}</template>
</el-table-column>
<el-table-column
......@@ -60,17 +60,17 @@
<el-table-column
prop="bid"
label="楼号"
width="120">
width="90">
</el-table-column>
<el-table-column
prop="rid"
label="宿舍号"
width="120">
width="90">
</el-table-column>
<el-table-column
prop="bed"
label="床号"
width="120">
width="90">
</el-table-column>
<el-table-column
prop="idCard"
......@@ -82,7 +82,7 @@
label="联系方式"
width="120">
</el-table-column>
<el-table-column label="操作" width="120">
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" circle @click="handleEdit(scope.row)"></el-button>
<el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.$index, scope.row)"></el-button>
......@@ -263,7 +263,7 @@ export default {
},
}},
created() {
axios.post('http://124.223.194.15:19260/admin/student/search',{})
axios.post('http://36.139.166.61:19260/admin/student/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -271,7 +271,7 @@ export default {
.catch(function (error) {
console.log(error);
});
axios.get('http://124.223.194.15:19260/admin/student/college')
axios.get('http://36.139.166.61:19260/admin/student/college')
.then(response => {
this.collegeOptions=response.data.data;
console.log('请求成功');
......@@ -281,7 +281,7 @@ export default {
});
},
mounted() {
axios.post('http://124.223.194.15:19260/admin/building/search',{})
axios.post('http://36.139.166.61:19260/admin/building/search',{})
.then(response=>{
if (response.data.status ===1000){
this.options=response.data.data;
......@@ -294,7 +294,7 @@ export default {
}).catch(function (error) {
console.log(error);
});
axios.get('http://124.223.194.15:19260/admin/building/findBuildingId',{params:{}})
axios.get('http://36.139.166.61:19260/admin/building/findBuildingId',{params:{}})
.then(response=>{
if (response.data.status ===1000){
this.buildingOptions=response.data.data;
......@@ -346,14 +346,14 @@ export default {
}
//获取文件url
axios.post('http://124.223.194.15:19260/upload',formData,config)
axios.post('http://36.139.166.61:19260/upload',formData,config)
.then(response=>{
if (response.data.status ===1000){
// this.$message.success('请求成功');
console.log(response)
this.file_Url = response.data.url;
axios.post('http://124.223.194.15:19260/admin/student/addList',{
axios.post('http://36.139.166.61:19260/admin/student/addList',{
fileUrl:this.file_Url
}).then(response=>{
if (response.data.status ===1000){
......@@ -381,7 +381,7 @@ export default {
},
refleshTable(){
axios.post('http://124.223.194.15:19260/admin/student/search',{})
axios.post('http://36.139.166.61:19260/admin/student/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
......@@ -424,7 +424,7 @@ export default {
this.form.rid=this.form.rid-0
this.form.bed=this.form.bed-0
this.form.sex=this.form.sex-0
axios.post("http://124.223.194.15:19260/admin/student/update", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/student/update", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("修改成功");
this.refleshTable();
......@@ -441,7 +441,7 @@ export default {
this.form.rid=this.form.rid-0
this.form.bed=this.form.bed-0
this.form.sex=this.form.sex-0
axios.post("http://124.223.194.15:19260/admin/student/add", this.form).then(response => {
axios.post("http://36.139.166.61:19260/admin/student/add", this.form).then(response => {
if (response.data.status === 1000) {
this.$message.success("添加成功");
this.refleshTable();
......@@ -478,7 +478,7 @@ export default {
}).then(async () => {
let arr = []
arr.push(row.id)
axios.post('http://124.223.194.15:19260/admin/student/delete',{id:arr})
axios.post('http://36.139.166.61:19260/admin/student/delete',{id:arr})
.then(response=>{
if (response.data.status ===1000){
this.$message.success('删除成功');
......@@ -500,19 +500,23 @@ export default {
}).then( async() => {
this.deleteOptions=[];
let d = this.multipleSelection;
for(let i = 0 ; i<d.length; i ++ ){
this.deleteOptions.push(d[i].id);
}
axios.post("http://124.223.194.15:19260/admin/student/delete",{id:this.deleteOptions}).then(response=>{
if (response.data.status === 1000){
this.$message.success("批量删除成功");
this.refleshTable();
if(d.length == 0)
{
this.$message.error('未选择删除的数据行');
}else {
for (let i = 0; i < d.length; i++) {
this.deleteOptions.push(d[i].id);
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
axios.post("http://36.139.166.61:19260/admin/student/delete", {id: this.deleteOptions}).then(response => {
if (response.data.status === 1000) {
this.$message.success("批量删除成功");
this.refleshTable();
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
}
});
}
},
......@@ -520,7 +524,7 @@ export default {
value:{
handler(newValue){
console.log(newValue);
axios.post('http://124.223.194.15:19260/admin/student/search',{
axios.post('http://36.139.166.61:19260/admin/student/search',{
bid:newValue
}).then(response=>{
if (response.data.status ===1000){
......@@ -537,7 +541,7 @@ export default {
handler(newValue){
console.log(newValue);
if(newValue!=null){
axios.post('http://124.223.194.15:19260/admin/building/findRoomId',{
axios.post('http://36.139.166.61:19260/admin/building/findRoomId',{
bid:newValue-0
}).then(response=>{
if (response.data.status ===1000){
......
<template>
<div>
<h1>用户信息</h1>
<br/>
<el-row>
<el-col :span="2">
<el-button style="font-size: 20px" type="danger" plain @click="deleteAll">批量删除</el-button>
</el-col>
<el-col :span="20" offset=1>
<span style="margin-left: 10px">请输入要查找的用户名:</span>
<el-input
placeholder="用户名"
v-model="userName"
clearable
style="width: 15%; margin-left: 10px">
</el-input>
<el-button type="primary" @click="search" icon="el-icon-search" round style="margin-left: 10px"></el-button>
</el-col>
</el-row>
<br/>
<el-row>
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
prop="username"
label="用户名"
width="100">
</el-table-column>
<el-table-column
prop="type"
label="身份"
width="120">
</el-table-column>
<el-table-column
prop="no"
label="学号/工号"
width="200">
</el-table-column>
<el-table-column label="操作" width="240">
<template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-s-release" plain @click="handleUnbind(scope.row)">解绑</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" plain @click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</div>
</template>
<script>
export default {
name: "UserInformation",
data() {
return {
tableData: [
{
"id": 1,
"username": "test",
"type": "学生",
"no": 221900000
}
],
multipleSelection: [],
userName:"",
value: "",
options:[],
deleteOptions:[],
}},
created() {
axios.post('http://36.139.166.61:19260/admin/user/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
})
.catch(function (error) {
console.log(error);
});
},
methods: {
refleshTable(){
axios.post('http://36.139.166.61:19260/admin/user/search',{})
.then(response => {
this.tableData=response.data.data;
console.log('请求成功');
})
.catch(function (error) {
console.log(error);
});
},
toggleSelection(rows) {
if (rows) {
rows.forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleUnbind(row) {
this.$confirm('确定要解绑吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
closeOnClickModal: false,
type: 'warning',
center: true
}).then(async () => {
axios.get('http://36.139.166.61:19260/admin/user/unBind',{ params: {
id: row.id-0,
}}).then(response=>{
if (response.data.status ===1000){
this.$message.success('解绑成功');
this.refleshTable();
}
else{
this.$message.error('解绑错误');
}
}).catch(function (error) {
console.log(error);
});
})
},
handleDelete(index, row) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
closeOnClickModal: false,
type: 'warning',
center: true
}).then(async () => {
let arr = []
arr.push(row.id)
axios.post('http://36.139.166.61:19260/admin/user/delete',{id:arr})
.then(response=>{
if (response.data.status ===1000){
this.$message.success('删除成功');
this.refleshTable();
}
else{
this.$message.error('删除失败');
}
}).catch(function (error) {
console.log(error);
});
})
},
deleteAll(){
this.$confirm (' 确定要删除吗?', ' 提示 ', {
confirmButtonText: ' 确定 ',
cancelButtonText: ' 取消 ',
type: 'warning'
}).then( async() => {
this.deleteOptions=[];
let d = this.multipleSelection;
if(d.length == 0)
{
this.$message.error('未选择删除的数据行');
}else {
for (let i = 0; i < d.length; i++) {
this.deleteOptions.push(d[i].id);
}
axios.post("http://36.139.166.61:19260/admin/user/delete", {id: this.deleteOptions}).then(response => {
if (response.data.status === 1000) {
this.$message.success("批量删除成功");
this.refleshTable();
}
}).catch(function (error) {
console.log(error);
this.$message.error("批量删除失败");
});
}
});
},
search(){
axios.post('http://36.139.166.61:19260/admin/user/search',{
username: this.userName,
}).then(
res => {
console.log(res)
if(res.data.status=="1000"){
this.tableData = res.data.data
}
else
alert("查询请求失败!");
},
error => {
console.log('请求失败',error.message)
}
)
},
},
watch:{
value:{
handler(newValue){
console.log(newValue);
axios.post('http://36.139.166.61:19260/admin/user/search',{
username:newValue
}).then(response=>{
if (response.data.status ===1000){
this.tableData = response.data.data;
// console.log('获取成功',response);
}
else this.$message.error('数据获取失败');
}).catch(function (error) {
console.log(error);
});
}
},
}
}
</script>
<style scoped>
</style>
......@@ -157,7 +157,7 @@ export default {
mounted() {
this.initEcharts();
this.buildings = this.loadAll();
axios.post('http://124.223.194.15:19260/admin/signIn/search',{params:{}})
axios.post('http://36.139.166.61:19260/admin/signIn/search',{})
.then(response=>{
if (response.data.status ===1000){
this.options=response.data.data;
......@@ -176,7 +176,7 @@ export default {
refresh(){
console.log(this.task);
//添加表格数据
axios.post('http://124.223.194.15:19260/admin/signIn/detail',{
axios.post('http://36.139.166.61:19260/admin/signIn/detail',{
tid:this.task
}).then(response=>{
if (response.data.status ===1000){
......@@ -189,7 +189,7 @@ export default {
});
//添加柱状图数据
axios.get('http://124.223.194.15:19260/admin/signIn/status',{params:{
axios.get('http://36.139.166.61:19260/admin/signIn/status',{params:{
id:this.task
}}).then(response=>{
if (response.data.status ===1000){
......@@ -224,7 +224,7 @@ export default {
_status = this.checkInStatus-0;
}
//添加表格数据
axios.post('http://124.223.194.15:19260/admin/signIn/detail',{
axios.post('http://36.139.166.61:19260/admin/signIn/detail',{
tid:t_id,
bid:b_id,
status:_status
......@@ -332,4 +332,4 @@ export default {
<style scoped>
</style>
\ No newline at end of file
</style>
......@@ -9,7 +9,7 @@
</el-form-item>
<el-form-item label="开始时间">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="form.startdate1" format="yyyy-MM-dd" value-format="yyyy-MM-ddT" style="width: 100%;"></el-date-picker>
<el-date-picker type="date" placeholder="选择日期" v-model="form.startdate1" format="yyyy-MM-dd" value-format="yyyy-MM-dd " style="width: 100%;"></el-date-picker>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="11">
......@@ -18,7 +18,7 @@
</el-form-item>
<el-form-item label="结束时间">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-ddT" v-model="form.enddate1" style="width: 100%;"></el-date-picker>
<el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd " v-model="form.enddate1" style="width: 100%;"></el-date-picker>
</el-col>
<el-col class="line" :span="2">-</el-col>
<el-col :span="11">
......@@ -195,14 +195,14 @@ export default {
this.form.islocation =1;
}
if (this.form.islocation) {
axios.post('http://124.223.194.15:19261/admin/signIn/add',
this.longitude = this.longitude-0;
this.latitude = this.latitude-0;
axios.post('http://36.139.166.61:19260/admin/signIn/add',
{
name: this.form.name, starttime: this.form.startdate1 + this.form.startdate2,
endtime: this.form.enddate1 + this.form.enddate2, location: this.form.islocation,
cycle: this.form.cyclestate, longitude: this.longitude, latitude: this.latitude,
}).then(response => {
alert(this.form.cyclestate);
alert(this.form.islocation);
if (response.data.status===1000){
this.$message({
message: '任务发布成功',
......@@ -216,7 +216,9 @@ export default {
})
}
else {
axios.post('http://124.223.194.15:19260/admin/signIn/add',
this.longitude = this.longitude-0;
this.latitude = this.latitude-0;
axios.post('http://36.139.166.61:19260/admin/signIn/add',
{name:this.form.name,starttime:this.form.startdate1+this.form.startdate2,
endtime:this.form.enddate1+this.form.enddate2,location:this.form.islocation,
cycle:this.form.cyclestate,longitude:null,latitude:null,}).then(response=>{
......
......@@ -7,6 +7,6 @@ module.exports = defineConfig({
'vuex': 'Vuex',
'vue-router': 'VueRouter',
'axios': 'axios',
'element-ui': 'ELEMENT'
/*'element-ui': 'ELEMENT'*/
}},
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册