'20200520'

This commit is contained in:
裴浩宇 2020-05-20 08:02:05 +08:00
parent 21c72257c4
commit 6c02d62343
6 changed files with 128 additions and 22 deletions

View File

@ -18,7 +18,11 @@ public class trafficServiceImpl implements trafficService {
public Map<String, Object> register(Map<String, Object> param) {
Map<String,Object> result = new HashMap<>();
int res = 0;
res = trafficMapper.userRegister(param);
try {
res = trafficMapper.userRegister(param);
} catch (Exception e) {
e.printStackTrace();
}
result.put("success",true);
result.put("data",res);
return result;

View File

@ -4,6 +4,7 @@ import java.util.Map;
public interface trafficService {
/**用户注册**/
Map<String, Object> register(Map<String, Object> param);
/**

View File

@ -1,11 +0,0 @@
<template>
<div>
<span>这是后台管理页面</span>
</div>
</template>
<script>
</script>
<style>
</style>

View File

@ -1,9 +1,118 @@
<template>
<span>这是违章处理页面</span>
<div class="illprocess">
<h2>违章行为处理</h2>
<el-form :model="illegalForm" :rules="illegalRules" ref="illegalForm" label-width="100px">
<el-form-item label="处罚书编号" prop="num">
<el-input type="text" v-model="illegalForm.num" class="inbox"></el-input>
</el-form-item>
<el-form-item label="号牌号码" prop="number">
<el-select v-model="numberValue" placeholder="" class="queryBox">
<el-option
v-for="item in numberOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input type="text" v-model="illegalForm.number" class="numberBox"></el-input>
</el-form-item>
<el-form-item label="发动机号" prop="serial">
<el-input type="text" v-model="illegalForm.serial" class="inbox"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input type="text" v-model="illegalForm.phone" class="inbox"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('')">处理</el-button>
<el-button @click="resetForm('')">重置</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
data() {
let numValidate = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入处罚决定书编号'));
}
};
let numberValidate = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入号牌号码'));
}
};
let serialValidate = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入发动机号'));
}
};
let phoneValidate = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入手机号码'));
} else if(!(/^1[34578]\d{9}$/).test(this.registerForm.phone)){
callback(new Error('手机号码格式不正确!'))
}
};
return {
illegalForm: {
num: '',
number: '',
serial: '',
phone: ''
},
numberOptions: [{
value: '选项1',
label: '京'
}, {
value: '选项2',
label: '津'
}, {
value: '选项3',
label: '沪'
}, {
value: '选项4',
label: '渝'
}, {
value: '选项5',
label: '鲁'
}],
numberValue: '',
illegalRules: {
num: [
{ validator: numValidate, trigger: 'blur' }
],
number: [
{ validator: numberValidate, trigger: 'blur' }
],
serial: [
{ validator: serialValidate, trigger: 'blur' }
],
phone: [
{ validator: phoneValidate, trigger: 'blur' }
]
}
}
}
}
</script>
<style>
.el-form {
width:50rem;
}
.inbox {
width: 30rem;
}
.queryBox {
width: 5rem;
}
.numberBox {
width: 24.7rem;
}
</style>

View File

@ -59,7 +59,6 @@
</el-submenu>
<el-menu-item index="/index/leave">在线留言</el-menu-item>
<el-menu-item index="/index/guide">办事指南</el-menu-item>
<el-menu-item index="/index/background">后台管理</el-menu-item>
</el-menu>
</div>
<router-view/>
@ -169,9 +168,18 @@ export default {
this.dialogLogonVisible = true;
},
//
submitRegister(formName) {
this.$ajax.post("/traffic/register",{formName},r=>{
this.dialogRegisterVisible = false;
if(r===1){
this.dialogRegisterVisible = false;
this.$message({
message: '注册成功!',
type: 'success'
});
} else{
this.$message.error('用户名已存在!');
}
},r=>{
})

View File

@ -50,11 +50,6 @@ export default new Router({
path: 'guide',
name: 'guide',
component:() => import('@/components/Guide')
},
{
path: 'background',
name: 'background',
component:() => import('@/components/Background')
}
]
}