Commit a6b06e61 authored by jiangjiaxu's avatar jiangjiaxu

debug

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