|
|
@@ -2,13 +2,29 @@
|
|
|
<template>
|
|
|
<div class="indexbox">
|
|
|
<div class="menubox">
|
|
|
- <div class="menubox_logo">
|
|
|
- <img src="../../assets/logo.png" alt="" class="menubox_logo_img" />
|
|
|
- <div class="menubox_logo_text">
|
|
|
- <p>中国海关</p>
|
|
|
- <p>CHINACUSTOMS</p>
|
|
|
- </div>
|
|
|
+ <div class="index_title">
|
|
|
+ <img
|
|
|
+ :src="'http://192.168.1.17:12345' + imgurl"
|
|
|
+ alt=""
|
|
|
+ class="menubox_logo_img"
|
|
|
+ />
|
|
|
+ <p>{{ headline }}</p>
|
|
|
+ </div>
|
|
|
+ <div class="index_out">
|
|
|
+ <el-dropdown trigger="click" @command="quit">
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ <span>{{ username }}</span>
|
|
|
+ <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </span>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="a">更改密码</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="b">退出</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
+ <!-- <p><i class="el-icon-switch-button" @click="quit"></i></p> -->
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ <div class="contentbox">
|
|
|
<div class="menubox_item">
|
|
|
<el-menu
|
|
|
default-active="2"
|
|
|
@@ -78,34 +94,57 @@
|
|
|
</el-submenu>
|
|
|
</el-menu>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="contentbox">
|
|
|
- <div class="contentbox_top">
|
|
|
- <div class="index_title">
|
|
|
- <p>深圳海关外来入侵物种监测指挥中心</p>
|
|
|
+ <div class="contentbox_right">
|
|
|
+ <div class="contentbox_crumbs">
|
|
|
+ <el-breadcrumb separator="/">
|
|
|
+ <el-breadcrumb-item
|
|
|
+ v-for="(item, index) in routerinfo"
|
|
|
+ :key="item.pur_id"
|
|
|
+ ><a
|
|
|
+ v-if="index == routerinfo.length - 2 && item.menu != ''"
|
|
|
+ :href="'/#/index/' + item.menu"
|
|
|
+ >{{ item.purview_name }}</a
|
|
|
+ ><a v-else>{{ item.purview_name }}</a></el-breadcrumb-item
|
|
|
+ >
|
|
|
+ </el-breadcrumb>
|
|
|
</div>
|
|
|
- <div class="index_out">
|
|
|
- <p>{{ username }}</p>
|
|
|
- <p><i class="el-icon-switch-button" @click="quit"></i></p>
|
|
|
+ <div class="contentbox_box">
|
|
|
+ <router-view />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="contentbox_crumbs">
|
|
|
- <el-breadcrumb separator="/">
|
|
|
- <el-breadcrumb-item
|
|
|
- v-for="(item, index) in routerinfo"
|
|
|
- :key="item.pur_id"
|
|
|
- ><a
|
|
|
- v-if="index == routerinfo.length - 2 && item.menu!=''"
|
|
|
- :href="'/#/index/'+item.menu"
|
|
|
- >{{ item.purview_name }}</a
|
|
|
- ><a v-else>{{ item.purview_name }}</a></el-breadcrumb-item
|
|
|
- >
|
|
|
- </el-breadcrumb>
|
|
|
- </div>
|
|
|
- <div class="contentbox_box">
|
|
|
- <router-view />
|
|
|
- </div>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ title="提示"
|
|
|
+ :visible.sync="alterpassTF"
|
|
|
+ width="30%"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-form
|
|
|
+ :model="ruleForm"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
+ label-width="110px"
|
|
|
+ class="demo-ruleForm"
|
|
|
+ >
|
|
|
+ <el-form-item label="原始密码:" prop="oldpass">
|
|
|
+ <el-input type="password" v-model="ruleForm.oldpass"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="新密码:" prop="newpass">
|
|
|
+ <el-input type="password" v-model="ruleForm.newpass"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="确认新密码:" prop="newpasstrue">
|
|
|
+ <el-input type="password" v-model="ruleForm.newpasstrue"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="resetForm('ruleForm')" size="mini">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm('ruleForm')" size="mini"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -117,6 +156,14 @@ export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
+ var validatePass = (rule, value, callback) => {
|
|
|
+ console.log(value);
|
|
|
+ if (value == this.ruleForm.newpass) {
|
|
|
+ callback();
|
|
|
+ } else {
|
|
|
+ callback(new Error("俩次密码不一致,请重新确认密码!"));
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
infodata: [],
|
|
|
username: "",
|
|
|
@@ -124,6 +171,46 @@ export default {
|
|
|
menuActiveId: "1",
|
|
|
// menuOpeneds:["18"]
|
|
|
routerinfo: [],
|
|
|
+ options: [],
|
|
|
+ value: "",
|
|
|
+ imgurl: "", //系统logo
|
|
|
+ headline: "", //系统标题
|
|
|
+ alterpassTF: false, //修改密码框
|
|
|
+ ruleForm: {
|
|
|
+ oldpass: "",
|
|
|
+ newpass: "",
|
|
|
+ newpasstrue: "",
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ oldpass: [
|
|
|
+ { required: true, message: "请输入原始密码", trigger: "blur" },
|
|
|
+ {
|
|
|
+ min: 6,
|
|
|
+ max: 15,
|
|
|
+ message: "长度在 6 到 15 个字符",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ newpass: [
|
|
|
+ { required: true, message: "请输入新密码", trigger: "blur" },
|
|
|
+ {
|
|
|
+ min: 6,
|
|
|
+ max: 15,
|
|
|
+ message: "长度在 6 到 15 个字符",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ newpasstrue: [
|
|
|
+ { required: true, message: "请再次输入新密码", trigger: "blur" },
|
|
|
+ {
|
|
|
+ min: 6,
|
|
|
+ max: 15,
|
|
|
+ message: "长度在 6 到 15 个字符",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ { validator: validatePass, trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -149,29 +236,38 @@ export default {
|
|
|
method: "POST",
|
|
|
url: "/api/api_gateway?method=sysmenage.usermanager.user_info",
|
|
|
}).then((res) => {
|
|
|
+ this.imgurl = res.data.data.theme_info.logo_url;
|
|
|
+ this.headline = res.data.data.theme_info.sys_name;
|
|
|
this.routerdata = JSON.parse(JSON.stringify(res.data.data.children));
|
|
|
this.infodata = res.data.data.children;
|
|
|
console.log(this.routerdata);
|
|
|
// this.infodata.shift();
|
|
|
- localStorage.setItem('userID', res.data.data.im_user_id) // 存储当前登录账号的ID
|
|
|
- this.infodata.shift();
|
|
|
+ localStorage.setItem("userID", res.data.data.im_user_id); // 存储当前登录账号的ID
|
|
|
this.username = res.data.data.username;
|
|
|
localStorage.setItem("usernme", this.username);
|
|
|
this.routemap(this.routerdata);
|
|
|
});
|
|
|
},
|
|
|
- quit() {
|
|
|
+ quit(e) {
|
|
|
// user.login.logout_user
|
|
|
+ console.log(e);
|
|
|
+ if (e == "a") {
|
|
|
+ this.alterpassTF = true;
|
|
|
+ } else if (e == "b") {
|
|
|
+ this.outsystem()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ outsystem(){
|
|
|
this.$axios({
|
|
|
- method: "POST",
|
|
|
- url: "/api/api_gateway?method=sysmenage.usermanager.user_logout",
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.data) {
|
|
|
- localStorage.removeItem("session");
|
|
|
- localStorage.removeItem("username");
|
|
|
- this.$router.push("/Login");
|
|
|
- }
|
|
|
- });
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/api_gateway?method=sysmenage.usermanager.user_logout",
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.data) {
|
|
|
+ localStorage.removeItem("session");
|
|
|
+ localStorage.removeItem("username");
|
|
|
+ this.$router.push("/Login");
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
skip(path) {
|
|
|
// console.log(this.$route);ssssss
|
|
|
@@ -179,6 +275,45 @@ export default {
|
|
|
this.$router.push(path);
|
|
|
}
|
|
|
},
|
|
|
+ submitForm(formName) {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$axios({
|
|
|
+ method: "POST",
|
|
|
+ url: "/api/api_gateway?method=app.my.app_change_pwd",
|
|
|
+ data: this.qs.stringify({
|
|
|
+ old_password: this.ruleForm.oldpass, // 必传 旧密码
|
|
|
+ new_password: this.ruleForm.newpass, // 必传 新密码
|
|
|
+ confirm_password: this.ruleForm.newpasstrue, // 必传 再次确认新密码
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.data.data) {
|
|
|
+ this.alterpassTF = false;
|
|
|
+ this.$message({
|
|
|
+ message: "修改成功!",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ this.outsystem()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "修改失败!"+res.data.data.message,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "请完成信息填写!",
|
|
|
+ type: "warning",
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ resetForm(formName) {
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
+ this.alterpassTF = false;
|
|
|
+ },
|
|
|
routemap(routerdata) {
|
|
|
var newrouter = this.$route.path;
|
|
|
var tf = routerdata.filter((item) => {
|
|
|
@@ -256,41 +391,44 @@ p {
|
|
|
margin: 0;
|
|
|
}
|
|
|
.indexbox {
|
|
|
- display: flex;
|
|
|
+ // display: flex;
|
|
|
}
|
|
|
-.menubox_logo {
|
|
|
- background-color: #0d3756;
|
|
|
- margin: 0;
|
|
|
- height: 62px;
|
|
|
- width: 240px;
|
|
|
+.menubox {
|
|
|
+ width: 100%;
|
|
|
display: flex;
|
|
|
- .menubox_logo_img {
|
|
|
- width: 40px;
|
|
|
- height: 40px;
|
|
|
- margin: 15px 15px 11px 30px;
|
|
|
- }
|
|
|
- .menubox_logo_text {
|
|
|
- color: #fff;
|
|
|
- margin-top: 18px;
|
|
|
+ height: 62px;
|
|
|
+ line-height: 62px;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding: 0 15px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0 2px 3px -1px rgb(224, 219, 219); //底部阴影
|
|
|
+ .index_title {
|
|
|
+ display: flex;
|
|
|
+ .menubox_logo_img {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin: 11px;
|
|
|
+ }
|
|
|
p {
|
|
|
- margin: 0;
|
|
|
font-size: 18px;
|
|
|
- }
|
|
|
- p:last-child {
|
|
|
- font-size: 12px;
|
|
|
- margin-top: 5px;
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.menubox {
|
|
|
- width: 240px;
|
|
|
- height: 100vh;
|
|
|
+.contentbox {
|
|
|
+ // width: calc(100% - 240px);
|
|
|
+ display: flex;
|
|
|
.menubox_item {
|
|
|
height: calc(100vh - 62px);
|
|
|
background-color: #0d3756;
|
|
|
overflow-y: auto;
|
|
|
+ width: 226px;
|
|
|
+ /deep/.el-menu {
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
/deep/.el-menu-vertical-demo {
|
|
|
- width: 240px;
|
|
|
+ width: 220px;
|
|
|
}
|
|
|
/deep/.el-submenu__title {
|
|
|
text-align: left;
|
|
|
@@ -327,6 +465,7 @@ p {
|
|
|
/*滚动条样式*/
|
|
|
::-webkit-scrollbar {
|
|
|
width: 6px;
|
|
|
+ // margin-left: -1px;
|
|
|
/*height: 4px;*/
|
|
|
}
|
|
|
::-webkit-scrollbar-thumb {
|
|
|
@@ -340,42 +479,25 @@ p {
|
|
|
// border-radius: 0;
|
|
|
background: rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
|
-}
|
|
|
-.contentbox {
|
|
|
- width: calc(100% - 240px);
|
|
|
- .contentbox_top {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- height: 62px;
|
|
|
- box-shadow: 0 2px 3px -1px rgb(224, 219, 219); //底部阴影
|
|
|
- .index_title {
|
|
|
- line-height: 62px;
|
|
|
- font-size: 18px;
|
|
|
- padding-left: 20px;
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
- .index_out {
|
|
|
- display: flex;
|
|
|
- line-height: 62px;
|
|
|
- p:last-child {
|
|
|
- margin: 0 15px;
|
|
|
+ .contentbox_right {
|
|
|
+ width: calc(100% - 226px);
|
|
|
+ margin: 10px auto 0;
|
|
|
+ .contentbox_crumbs {
|
|
|
+ width: 98%;
|
|
|
+ margin: 0;
|
|
|
+ /deep/.el-breadcrumb {
|
|
|
+ margin: 0 0 0 20px;
|
|
|
+ padding: 0 !important;
|
|
|
+ background-color: transparent !important;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- .contentbox_crumbs {
|
|
|
- width: 95%;
|
|
|
- margin: 15px auto;
|
|
|
- /deep/.el-breadcrumb {
|
|
|
- padding: 0 !important;
|
|
|
- background-color: transparent !important;
|
|
|
+ .contentbox_box {
|
|
|
+ width: 98%;
|
|
|
+ height: calc(100vh - 100px);
|
|
|
+ // background-color: chartreuse;
|
|
|
+ margin: 15px auto 0;
|
|
|
+ overflow-y: auto;
|
|
|
}
|
|
|
}
|
|
|
- .contentbox_box {
|
|
|
- width: 98%;
|
|
|
- height: calc(100vh - 104px);
|
|
|
- // background-color: chartreuse;
|
|
|
- margin: 15px auto 0;
|
|
|
- overflow-y: auto;
|
|
|
- }
|
|
|
}
|
|
|
</style>
|