Commit a6b06e61 authored by jiangjiaxu's avatar jiangjiaxu

debug

parent 320c5512
<template>
<div id="app">
<router-view/>
<router-view />
</div>
</template>
<style lang="less">
<style lang="less">
</style>
......@@ -10,4 +10,4 @@ const photoAddress = 'http://106.52.130.113:9088/';
const imgAddress = 'http://152.136.233.116:8083/roadlinks/';
const imgApi = 'http://152.136.233.116:8083/roadlinks/getCapitalImg?imgName=';
export { address,photoAddress,imgApi,imgAddress };
export { address, photoAddress, imgApi, imgAddress };
export default [
{
import { CapitalClass1,CapitalClass2,Capital } from "./entity"
captials = new CapitalClass1();
cities = [{
cityInfo: 'TianJin',
cityName: '天津',
status: 0,
......@@ -55,4 +58,6 @@ export default [
lat: 34.44,
lng: 113.42,
},
]
\ No newline at end of file
]
export { cities,captials }
export class CapitalClass1 {
constructor() {
this.Type = '';
this.Count = 0;
this.Class2List = [];
}
}
export class CapitalClass2 {
constructor() {
this.SubType = '';
this.Count = 0;
this.CapitalList = [];
}
}
export class Capital {
constructor() {
this.Name = '';
this.Longitude = 0.0;
this.Latitude = 0.0;
};
}
This diff is collapsed.
<template>
<div class="home">
<el-container>
<el-aside width="200px">
<el-menu
:default-active="onRoutes"
active-text-color="#41afdd"
background-color="#323346"
class="el-menu-vertical-demo">
<div class="logo"><img src="../assets/logo_new.png" alt=""></div>
<el-submenu index="1">
<span slot="title" class="submenu_parent">道路资产管理</span>
<el-menu-item index="1-1" @click="goTo('/overview')" style="background:#252639 !important">
<span slot="title" style="font-size: 16px">资产汇总</span>
</el-menu-item>
<el-menu-item index="1-2" @click="goTo('/detail')" style="background:#252639 !important">
<span slot="title" style="font-size: 16px">资产明细</span>
</el-menu-item>
</el-submenu>
<el-menu-item index="2" @click="goTo('/task')">
<span slot="title">巡检任务管理</span>
</el-menu-item>
<el-submenu index="3">
<span slot="title" class="submenu_parent">巡检结果管理</span>
<el-menu-item index="3-1" @click="goTo('/result')" style="background:#252639 !important">
<span slot="title" style="font-size: 16px">巡检结果查看</span>
</el-menu-item>
<el-menu-item index="3-2" @click="goTo('/resultDetail')" style="background:#252639 !important">
<span slot="title" style="font-size: 16px">巡检结果明细</span>
</el-menu-item>
</el-submenu>
</el-menu>
</el-aside>
<el-container>
<el-header>
<div class="header-title">安徽省道路综合巡检平台(测试)</div>
<span>欢迎您,</span>
<span>{{user.name}}</span>
<el-button type="text" class="exitSys" @click="esc">退出</el-button>
</el-header>
<el-main ref="el-main">
<router-view/>
</el-main>
</el-container>
</el-container>
<el-aside width="200px">
<el-menu
:default-active="onRoutes"
active-text-color="#41afdd"
background-color="#323346"
class="el-menu-vertical-demo"
>
<div class="logo">
<img src="../assets/logo_new.png" alt />
</div>
<el-submenu index="1">
<span slot="title" class="submenu_parent">道路资产管理</span>
<el-menu-item
index="1-1"
@click="goTo('/overview')"
style="background:#252639 !important"
>
<span slot="title" style="font-size: 16px">资产汇总</span>
</el-menu-item>
<el-menu-item
index="1-2"
@click="goTo('/detail')"
style="background:#252639 !important"
>
<span slot="title" style="font-size: 16px">资产明细</span>
</el-menu-item>
</el-submenu>
<el-menu-item index="2" @click="goTo('/task')">
<span slot="title">巡检任务管理</span>
</el-menu-item>
<el-submenu index="3">
<span slot="title" class="submenu_parent">巡检结果管理</span>
<el-menu-item
index="3-1"
@click="goTo('/result')"
style="background:#252639 !important"
>
<span slot="title" style="font-size: 16px">巡检结果查看</span>
</el-menu-item>
<el-menu-item
index="3-2"
@click="goTo('/resultDetail')"
style="background:#252639 !important"
>
<span slot="title" style="font-size: 16px">巡检结果明细</span>
</el-menu-item>
</el-submenu>
</el-menu>
</el-aside>
<el-container>
<el-header>
<div class="header-title">安徽省道路综合巡检平台(测试)</div>
<span>欢迎您,</span>
<span>{{user.name}}</span>
<el-button type="text" class="exitSys" @click="esc">退出</el-button>
</el-header>
<el-main ref="el-main">
<router-view />
</el-main>
</el-container>
</el-container>
</div>
</template>
<style lang="less" scoped>
.logo{
line-height: 50px;
}
.exitSys{
color: black;
background: 0 0;
padding-left: 0;
padding-right: 0;
font-size: 16px;
}
.el-container{
height: 100vh;
}
.el-header {
background-color: #f6f6f6;
color: #333;
text-align: right;
line-height: 60px;
.header-title{
font-size: 20px;
position: absolute;
}
span{
margin-right: 15px;
font-size: 16px;
}
}
.el-aside {
// background-color: #4ca29d;
color: #333;
text-align: center;
line-height: 200px;
}
.el-main {
// background-color: #E9EEF3;
color: #333;
width: calc(100vw - 200px);
// line-height: 160px;
}
body > .el-container {
margin-bottom: 40px;
}
.el-menu{
height: 100%;
padding-top: 40%;
box-sizing: border-box;
}
.el-menu-item:focus, .el-menu-item:hover{
background-color: #151628;
}
.el-submenu__title:focus, .el-submenu__title:hover{
background-color: #151628 !important;
}
.el-menu-item{
// color: black;
font-size:18px;
}
.el-menu-item.is-active[data-v-fae5bece] {
background-color: #151628 !important;
}
.el-submenu{
.submenu_parent{
color: #80a0b9;
}
span{
font-size:18px;
}
}
.el-menu-item.is-active {
background-color: #151628 !important;
span{
color: #41afdd !important;
}
}
.el-menu[data-v-fae5bece] {
background-color: #323346;
}
.el-menu-item * {
color: #80a0b9;
}
.el-submenu__title{
color:#80a0b9;
}
.el-menu.el-menu--inline{
background: #323346;
}
</style>
<script>
// @ is an alias to /src
// import HelloWorld from '@/components/HelloWorld.vue';
import Cookies from 'js-cookie';
import Cookies from "js-cookie";
export default {
name: 'home',
name: "home",
data() {
return {
myId: '',
myId: "",
user: {
name: '张三',
name: "张三",
},
};
},
......@@ -160,40 +84,34 @@ export default {
// HelloWorld,
},
created() {
const myId = Cookies.get('id');
const myId = Cookies.get("id");
this.myId = myId;
const username = Cookies.get('username');
const username = Cookies.get("username");
// console.log(this.$route.params.username);
this.user.name = username;
},
mounted() {
if(this.$route.path.replace('/','') == ''){
this.goTo('/overview');
if (this.$route.path.replace("/", "") == "") {
this.goTo("/overview");
}
},
computed:{
onRoutes(){
computed: {
onRoutes() {
// this.$route.path
// debugger
if(this.$route.path.replace('/','')=='overview'){
return '1-1';
}
else if(this.$route.path.replace('/','')=='detail'){
return '1-2'
}
else if(this.$route.path.replace('/','')=='task'){
return '2'
}
else if(this.$route.path.replace('/','')=='result'){
return '3-1'
}
else if(this.$route.path.replace('/','')=='resultDetail'){
return '3-2'
if (this.$route.path.replace("/", "") == "overview") {
return "1-1";
} else if (this.$route.path.replace("/", "") == "detail") {
return "1-2";
} else if (this.$route.path.replace("/", "") == "task") {
return "2";
} else if (this.$route.path.replace("/", "") == "result") {
return "3-1";
} else if (this.$route.path.replace("/", "") == "resultDetail") {
return "3-2";
} else {
return "1-1";
}
else{
return '1-1';
}
},
},
methods: {
......@@ -203,12 +121,12 @@ export default {
// handleClose(key, keyPath) {
// console.log(key, keyPath);
// },
// 退出
// 退出
esc() {
// alert(1);
Cookies.remove('id');
Cookies.remove("id");
this.$router.push({
name: 'login',
name: "login",
});
},
goTo(path) {
......@@ -217,3 +135,96 @@ export default {
},
};
</script>
<style lang="less" scoped>
.logo {
line-height: 50px;
}
.exitSys {
color: black;
background: 0 0;
padding-left: 0;
padding-right: 0;
font-size: 16px;
}
.el-container {
height: 100vh;
}
.el-header {
background-color: #f6f6f6;
color: #333;
text-align: right;
line-height: 60px;
.header-title {
font-size: 20px;
position: absolute;
}
span {
margin-right: 15px;
font-size: 16px;
}
}
.el-aside {
// background-color: #4ca29d;
color: #333;
text-align: center;
line-height: 200px;
}
.el-main {
// background-color: #E9EEF3;
color: #333;
width: calc(100vw - 200px);
// line-height: 160px;
}
body > .el-container {
margin-bottom: 40px;
}
.el-menu {
height: 100%;
padding-top: 40%;
box-sizing: border-box;
}
.el-menu-item:focus,
.el-menu-item:hover {
background-color: #151628;
}
.el-submenu__title:focus,
.el-submenu__title:hover {
background-color: #151628 !important;
}
.el-menu-item {
// color: black;
font-size: 18px;
}
.el-menu-item.is-active[data-v-fae5bece] {
background-color: #151628 !important;
}
.el-submenu {
.submenu_parent {
color: #80a0b9;
}
span {
font-size: 18px;
}
}
.el-menu-item.is-active {
background-color: #151628 !important;
span {
color: #41afdd !important;
}
}
.el-menu[data-v-fae5bece] {
background-color: #323346;
}
.el-menu-item * {
color: #80a0b9;
}
.el-submenu__title {
color: #80a0b9;
}
.el-menu.el-menu--inline {
background: #323346;
}
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -2,96 +2,102 @@
<div class="registered">
<div class="wrap">
<div class="has-text-centered signin">
<span>已有账户?</span> <i @click="goToLogin">登录</i>
<span>已有账户?</span>
<i @click="goToLogin">登录</i>
</div>
<div class="formBody">
<h1 class="section-title" data-i18n-text="">创建用户</h1>
<el-form :model="ruleForm2"
status-icon :rules="rules2" ref="ruleForm2" label-width="100px" class="demo-ruleForm">
<el-form-item label="用户名" prop="user">
<el-input v-model="ruleForm2.user"></el-input>
</el-form-item>
<el-form-item label="密码" prop="pass">
<el-input type="password" v-model="ruleForm2.pass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="checkPass">
<el-input type="password" v-model="ruleForm2.checkPass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="电子邮箱" prop="mailAddress">
<el-input placeholder="请填写邮箱地址" v-model="ruleForm2.mailAddress" @blur="sendEmail"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('ruleForm2')" class="newUser">创建用户</el-button>
<el-button @click="resetForm('ruleForm2')" class="reset">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
<h1 class="section-title" data-i18n-text>创建用户</h1>
<el-form
:model="ruleForm2"
status-icon
:rules="rules2"
ref="ruleForm2"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="用户名" prop="user">
<el-input v-model="ruleForm2.user"></el-input>
</el-form-item>
<el-form-item label="密码" prop="pass">
<el-input type="password" v-model="ruleForm2.pass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="checkPass">
<el-input type="password" v-model="ruleForm2.checkPass" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="电子邮箱" prop="mailAddress">
<el-input placeholder="请填写邮箱地址" v-model="ruleForm2.mailAddress" @blur="sendEmail"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('ruleForm2')" class="newUser">创建用户</el-button>
<el-button @click="resetForm('ruleForm2')" class="reset">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios';
import { Message } from 'element-ui';
import { setTimeout } from 'timers';
import { address } from '../config';
import axios from "axios";
import { Message } from "element-ui";
import { setTimeout } from "timers";
import { address } from "../config";
export default {
data() {
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
if (value === "") {
callback(new Error("请输入密码"));
} else {
if (this.ruleForm2.checkPass !== '') {
this.$refs.ruleForm2.validateField('checkPass');
if (this.ruleForm2.checkPass !== "") {
this.$refs.ruleForm2.validateField("checkPass");
}
callback();
}
};
const validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
if (value === "") {
callback(new Error("请再次输入密码"));
} else if (value !== this.ruleForm2.pass) {
callback(new Error('两次输入密码不一致!'));
callback(new Error("两次输入密码不一致!"));
} else {
callback();
}
};
return {
ruleForm2: {
pass: '',
checkPass: '',
user: '',
mailAddress: '',
pass: "",
checkPass: "",
user: "",
mailAddress: "",
},
rules2: {
pass: [
{ validator: validatePass, trigger: 'blur' },
{ min: 6, message: '密码长度最少为6位', trigger: 'blur' },
{ validator: validatePass, trigger: "blur" },
{ min: 6, message: "密码长度最少为6位", trigger: "blur" },
],
checkPass: [
{ validator: validatePass2, trigger: 'blur' },
{ min: 6, message: '密码长度最少为6位', trigger: 'blur' },
],
user: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ validator: validatePass2, trigger: "blur" },
{ min: 6, message: "密码长度最少为6位", trigger: "blur" },
],
user: [{ required: true, message: "请输入用户名", trigger: "blur" }],
mailAddress: [
{ required: true, message: '请填写电子邮箱', trigger: 'blur' },
{ required: true, message: "请填写电子邮箱", trigger: "blur" },
],
},
};
},
methods: {
sendEmail() {
var regEmail = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
if (this.ruleForm2.mailAddress != '' && !regEmail.test(this.ruleForm2.mailAddress)) {
this.$message({
message: '邮箱格式不正确',
type: 'error'
})
this.ruleForm2.mailAddress = ''
var regEmail = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
if (
this.ruleForm2.mailAddress != "" &&
!regEmail.test(this.ruleForm2.mailAddress)
) {
this.$message({
message: "邮箱格式不正确",
type: "error",
});
this.ruleForm2.mailAddress = "";
}
},
// 创建用户
......@@ -99,18 +105,19 @@ export default {
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.ruleForm2.user + this.ruleForm2.pass);
axios.post( address + 'register', {
username: this.ruleForm2.user,
password: this.ruleForm2.pass,
email: this.ruleForm2.mailAddress,
status: 1,
})
axios
.post(address + "register", {
username: this.ruleForm2.user,
password: this.ruleForm2.pass,
email: this.ruleForm2.mailAddress,
status: 1,
})
.then((response) => {
if (response.data.code === 200) {
Message({
message: response.data.data,
type: 'success',
duration: '500',
type: "success",
duration: "500",
});
setTimeout(() => {
this.goToLogin();
......@@ -118,7 +125,7 @@ export default {
} else {
Message({
message: response.data.message,
type: 'error',
type: "error",
});
}
console.log(response.data);
......@@ -127,7 +134,7 @@ export default {
console.log(error);
});
} else {
console.log('error submit!!');
console.log("error submit!!");
return false;
}
});
......@@ -138,65 +145,62 @@ export default {
},
// 返回登录页面
goToLogin() {
this.$router.push(
{ path: '/login' },
);
this.$router.push({ path: "/login" });
},
},
};
</script>
<style lang="less" scoped>
.registered{
.registered {
height: 100vh;
background: url('../assets/img/regist.jpeg');
background: url("../assets/img/regist.jpeg");
background-size: 100% 100%;
.wrap{
.wrap {
width: 570px;
position: absolute;
position: absolute;
left: 45%;
margin-left: -285px;
top: 50%;
transform: translateY(-50%);
.signin {
background: #fff;
height: 42px;
line-height: 42px;
font-size: 12px;
color: #555;
border-radius: 12px 12px 0 0;
i{
color: rgb(62, 107, 226);
cursor: pointer;
background: #fff;
height: 42px;
line-height: 42px;
font-size: 12px;
color: #555;
border-radius: 12px 12px 0 0;
i {
color: rgb(62, 107, 226);
cursor: pointer;
}
}
}
.has-text-centered {
text-align: center;
}
.formBody{
.section-title {
border-bottom: 1px solid #ccc;
font-size: 28px;
padding: 0 0 12px 0;
letter-spacing: 2px;
user-select: none;
color: #555;
text-align: center;
font-weight: normal;
margin: 12px;
}
padding: 10px 40px 40px 40px;
background: #eee;
border-radius: 0 0 12px 12px;
.newUser{
padding: 12px 30px;
background-color: #3e6be2;
.has-text-centered {
text-align: center;
}
.reset{
padding: 12px 30px;
.formBody {
.section-title {
border-bottom: 1px solid #ccc;
font-size: 28px;
padding: 0 0 12px 0;
letter-spacing: 2px;
user-select: none;
color: #555;
text-align: center;
font-weight: normal;
margin: 12px;
}
padding: 10px 40px 40px 40px;
background: #eee;
border-radius: 0 0 12px 12px;
.newUser {
padding: 12px 30px;
background-color: #3e6be2;
}
.reset {
padding: 12px 30px;
}
}
}
}
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment