123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888 |
- <template>
- <el-container style="height: 100vh; overflow: hidden">
- <el-aside style="width: auto">
- <el-menu
- :unique-opened="true"
- ref="menu"
- :collapse-transition="false"
- class="el-menu-vertical-demo shadow-menu aside-menu"
- :router="true"
- :default-active="active"
- :collapse="isCollapse"
- text-color="#333"
- active-text-color="#fff"
- @select="selectMenu"
- >
- <!-- <img src="../../assets/img/commons/jhTop.png" /> -->
- <img v-show="!isCollapse" src="../../assets/img/commons/jhTop.png" />
- <img
- v-show="isCollapse"
- style="menu_top_suo"
- src="../../assets/img/commons/jhTopSuo.png"
- />
- <el-submenu
- v-for="item in menuList"
- :key="item.id"
- :index="item.path"
- v-show="item.showItem"
- >
- <template slot="title">
- <i :class="item.icon"></i>
- <span class="menu_name">{{ item.name }}</span>
- </template>
- <el-menu-item-group>
- <el-menu-item v-for="el in item.child" :key="el.id" :index="el.path">
- <span class="menu_sub_tt"
- ><span class="menu_sub_t1"></span>{{ el.name }}</span
- >
- </el-menu-item>
- </el-menu-item-group>
- </el-submenu>
- </el-menu>
- </el-aside>
- <el-container style="height: 100vh; display: flex; flex-direction: column">
- <el-header class="shadow-menu">
- <el-row class="admin-header-content">
- <el-col :span="12"> </el-col>
- <el-col :span="12" class="just-right">
- <el-menu
- :default-active="activeIndex"
- class="el-menu-demo"
- mode="horizontal"
- background-color="transparent"
- text-color="#000"
- active-text-color="#000"
- >
- <el-submenu index="2" class="rightExit">
- <template slot="title" :size="size" :src="circleUrl">{{
- userInfo.userName
- }}</template>
- <el-menu-item index="2-1" @click="escape()">退出</el-menu-item>
- <el-menu-item index="2-1" @click="changePwd()">修改密码</el-menu-item>
- </el-submenu>
- </el-menu>
- <!-- <vue-qr
- v-show="false"
- :ref="userInfo.name + '-' + userInfo.userNumber"
- :text="urlJump + userInfo.invitationCode"
- :size="500"
- :width="1"
- ></vue-qr> -->
- </el-col>
- </el-row>
- </el-header>
- <el-container style="flex: 1; overflow: auto">
- <el-header class="main-header">
- <el-row>
- <el-col :span="1">
- <div class="menu-hide" @click="changeMenu">
- <i class="el-icon-s-fold" style="color: #000; font-size: 20px"></i>
- </div>
- </el-col>
- <el-col :span="10">
- <el-breadcrumb class="admin-breadcrumb" separator="/">
- <el-breadcrumb-item>{{ crumbParent }}</el-breadcrumb-item>
- <el-breadcrumb-item v-if="crumbChild && crumbChild != null">{{
- crumbChild
- }}</el-breadcrumb-item>
- </el-breadcrumb>
- </el-col>
- </el-row>
- </el-header>
- <el-main style="background-color: #f5f5f5; display: flex">
- <div class="el-main-inner">
- <transition name="fade" mode="out-in">
- <router-view></router-view>
- </transition>
- </div>
- </el-main>
- <!-- <el-footer>
- <div style="background-color:#000000">递交</div>
- </el-footer> -->
- <!-- <el-footer style="padding-left: 0px; padding-right: 0px">
- <Footer />
- </el-footer> -->
- </el-container>
- </el-container>
- <!---lxh-修改密码-->
- <el-dialog
- title="修改密码"
- :visible.sync="dialogVisible"
- :close-on-click-modal="false"
- width="40%"
- >
- <div>
- <el-form
- :model="ruleForm"
- :rules="rules"
- ref="ruleForm"
- label-width="150px"
- class="demo-ruleForm"
- >
- <el-form-item label="请输入旧密码" prop="oldpass">
- <el-input
- type="password"
- v-model="ruleForm.oldpass"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="请输入新密码" prop="pass">
- <el-input
- type="password"
- v-model="ruleForm.pass"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- <el-form-item label="确认新密码" prop="checkPass">
- <el-input
- type="password"
- v-model="ruleForm.checkPass"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
- <el-button @click="resetForm('ruleForm')">重置</el-button>
- </el-form-item>
- </el-form>
- </div>
- </el-dialog>
- </el-container>
- </template>
- <script>
- import md5 from "md5";
- import vueQr from "vue-qr";
- import { mapGetters, mapActions } from "vuex";
- import { oSessionStorage } from "@/utils/utils";
- import register from "@/components/Register";
- import Footer from "@/components/Footer";
- export default {
- name: "manageMain",
- components: {
- vueQr,
- Footer,
- },
- computed: {
- // ...mapGetters(['sacleListName']),
- // ...mapGetters(['menuActive']),
- },
- data() {
- var validatePassOld = (rule, value, callback) => {
- // if (value === "") {
- // callback(new Error("请输入密码"));
- // } else {
- // let juPassword = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]{8,16}$/;
- // if (!juPassword.test(this.ruleForm.oldpass)) {
- // callback(new Error("格式为数字+英文字母+特殊字符(~!@#$%^&*)8-16位"));
- // } else {
- // callback();
- // }
- // }
- if (value === "") {
- callback(new Error("请输入旧密码"));
- } else {
- if (value.length < 6 || value.length > 18) {
- callback(new Error("密码长度需在6~18位之间"));
- } else {
- this.$refs.ruleForm.validateField("pass");
- }
- callback();
- }
- };
- var validatePass = (rule, value, callback) => {
- // if (value === "") {
- // callback(new Error("请输入密码"));
- // } else {
- // let juPassword = /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]{8,16}$/;
- // if (!juPassword.test(this.ruleForm.pass)) {
- // callback(new Error("格式为数字+英文字母+特殊字符(~!@#$%^&*)8-16位"));
- // } else {
- // callback();
- // }
- // }
- if (value === "") {
- callback(new Error("请输入新密码"));
- } else {
- if (value.length < 6 || value.length > 18) {
- callback(new Error("密码长度需在6~18位之间"));
- } else {
- this.$refs.ruleForm.validateField("checkPass");
- }
- callback();
- }
- };
- var validatePass2 = (rule, value, callback) => {
- if (value === "") {
- callback(new Error("请再次输入密码"));
- } else if (value !== this.ruleForm.pass) {
- callback(new Error("两次输入密码不一致!"));
- } else if (value == this.ruleForm.oldpass) {
- callback(new Error("旧密码和新密码相同!"));
- } else {
- callback();
- }
- };
- return {
- userInfo: {}, //用户信息
- dialogVisible: false, //弹出窗是否可见
- size: "small",
- circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
- activeIndex: "10",
- activeIndex2: "1",
- isCollapse: false,
- userType: "",
- menuList: [
- {
- id: "0",
- name: "渠道信息",
- icon: "el-icon-s-home",
- path: "0",
- showItem: true,
- child: [
- {
- id: "01",
- name: "签约详情",
- parentName: "渠道信息",
- icon: "el-icon-user-solid",
- path: "/manage/channelInfo",
- showItem: true,
- },
- {
- id: "02",
- name: "订单结算",
- icon: "el-icon-user-solid",
- parentName: "渠道信息",
- path: "/manage/orderSettlement",
- showItem: true,
- },
- {
- id: "03",
- name: "邀请链接",
- icon: "el-icon-user-solid",
- parentName: "渠道信息",
- path: "/manage/invite",
- showItem: true,
- },
- {
- id: "04",
- name: "报告记录",
- icon: "el-icon-user-solid",
- parentName: "渠道信息",
- path: "/manage/recordListAll",
- showItem: true,
- },
- {
- id: "05",
- name: "员工管理",
- icon: "el-icon-user-solid",
- parentName: "渠道信息",
- path: "/manage/channelUserManage",
- showItem: true,
- },
- ],
- },//channelUserManage
- {
- id: "1",
- name: "渠道管理",
- icon: "el-icon-user-solid",
- path: "",
- showItem: true,
- child: [
- {
- id: "11",
- name: "渠道信息",
- icon: "el-icon-user-solid",
- parentName: "渠道管理",
- path: "/manage/channelManagement",
- showItem: true,
- },
- {
- id: "12",
- name: "签约详情",
- icon: "el-icon-user-solid",
- parentName: "渠道管理",
- path: "/manage/contract",
- showItem: true,
- },
- ],
- },
- {
- id: "2",
- name: "财税报告",
- icon: "el-icon-user-solid",
- path: "2",
- showItem: true,
- child: [
- {
- id: "21",
- name: "接口价格",
- icon: "el-icon-user-solid",
- path: "/manage/interfacePrice",
- parentName: "渠道管理",
- showItem: true,
- },
- {
- id: "22",
- name: "产品定价",
- icon: "el-icon-user-solid",
- parentName: "渠道管理",
- path: "/manage/productPrice",
- showItem: true,
- },
- {
- id: "23",
- name: "报告记录",
- parentName: "渠道管理",
- icon: "el-icon-user-solid",
- path: "/manage/reportList",
- showItem: true,
- },
- ],
- },
- {
- id: "3",
- name: "订单管理",
- icon: "el-icon-user-solid",
- path: "3",
- showItem: true,
- child: [
- {
- id: "31",
- name: "用户订单",
- icon: "el-icon-user-solid",
- parentName: "订单管理",
- path: "/manage/userOrder",
- showItem: true,
- },
- {
- id: "32",
- name: "邀约订单",
- icon: "el-icon-user-solid",
- parentName: "订单管理",
- path: "/manage/orderInvite",
- showItem: true,
- },
- {
- id: "33",
- name: "订单结算",
- icon: "el-icon-user-solid",
- parentName: "订单管理",
- path: "/manage/orderSettlementManage",
- showItem: true,
- },
- ],
- },
- /*
-
- {
- id: '3',
- name: "订单管理",
- icon: "el-icon-user-solid",
- path: "/manage/userManage",
- showItem: true,
- child:[
- {
- id: '31',
- name: "用户订单",
- icon: "el-icon-user-solid",
- path: "/manage/agencyUserManage",
- showItem: true,
- },
- {
- id: '32',
- name: "邀约订单",
- icon: "el-icon-user-solid",
- path: "/manage/agencyUserManage",
- showItem: true,
- },
- {
- id: '33',
- name: "订单结算",
- icon: "el-icon-user-solid",
- path: "/manage/agencyUserManage",
- showItem: true,
- },
- ]
- },
- {
- id: '4',
- name: "邀请管理",
- icon: "el-icon-s-order",
- path: "/manage/gameRecord1",
- showItem: true,
- child:[
- {
- id: '41',
- name: "邀请链接",
- icon: "el-icon-user-solid",
- path: "/manage/agencyUserManage",
- showItem: true,
- },
- ]
- },*/
- {
- id: "5",
- name: "用户管理",
- icon: "el-icon-s-order",
- path: "/manage/gameRecord2",
- showItem: true,
- child: [
- {
- parentName: "用户管理",
- id: "51",
- name: "用户管理",
- icon: "el-icon-user-solid",
- path: "/manage/userManage",
- showItem: true,
- },
- {
- parentName: "用户管理",
- id: "52",
- name: "角色管理",
- icon: "el-icon-user-solid",
- path: "/manage/roleManage",
- showItem: true,
- },
- ],
- },
- // {
- // id: "6",
- // name: "数据大屏",
- // icon: "el-icon-s-order",
- // // path: "/manage/gameRecord",
- // showItem: true,
- // child: [
- // {
- // id: "61",
- // name: "大屏",
- // icon: "el-icon-user-solid",
- // path: "/manage/agencyUserManage",
- // showItem: true,
- // },
- // ],
- // },
- {
- id: "7",
- name: "文件上传",
- icon: "el-icon-user-solid",
- path: "7",
- showItem: true,
- child: [
- {
- id: "71",
- name: "生成报告",
- icon: "el-icon-user-solid",
- parentName: "文件上传",
- path: "/manage/createReport/index",
- showItem: true,
- }
- ],
- },
- ],
- //面包屑页签
- crumbParent: "首页",
- crumbChild: null,
- //修改密码
- ruleForm: {
- pass: "",
- checkPass: "",
- oldpass: "",
- },
- upPass: {
- institutionNo: "",
- password: "",
- },
- rules: {
- pass: [{ required: true, validator: validatePass, trigger: "blur" }],
- checkPass: [{ required: true, validator: validatePass2, trigger: "blur" }],
- oldpass: [{ required: true, validator: validatePassOld, trigger: "blur" }],
- },
- ifAdmin: false,
- ifSupAdmin: false,
- active: "/manage/adminHome",
- urlJump: "http://152.136.24.101:8997?invitationCode=", //二维码跳转链接
- };
- },
- created() {
- if (oSessionStorage.getItem("userInfo")) {
- this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
- this.userType = this.userInfo.type;
- //假如是代理用户则 //代理用户菜单不显示
- if (this.userType == "0") {
- for (let i = 0; i < this.menuList.length; i++) {
- if (
- this.menuList[i].id == "5" ||
- this.menuList[i].id == "6" ||
- this.menuList[i].id == "2" ||
- this.menuList[i].id == "3" ||
- this.menuList[i].id == "1"
- ) {
- this.menuList[i].showItem = false;
- }
- }
- }
- }
- },
- mounted() {
- let codeImage = sessionStorage.getItem("codeImage");
- this.urlJump = codeImage + "?invitationCode=";
- let that = this;
- // 页面初始化或者刷新页面初始化页签及激活菜单-2020-03-17 lwl
- this.active = this.$route.path;
- this.selectMenu(this.$route.path);
- this.bus.$on("menuStatusUpdate", (e) => {
- that.$refs.menu.activeIndex = e;
- that.active = e;
- // that.$forceUpdate()
- that.selectMenu(e);
- });
- //得到用户信息,根据角色信息判断哪个显示哪个不显示
- },
- methods: {
- ...mapActions({
- // setSacleListName:"setSacleListName",
- // setMenuActive:"setMenuActive"
- }),
- changeMenu: function () {
- this.isCollapse = !this.isCollapse;
- },
- //匹配获取页签名称-2020-03-17 lwl
- selectMenu(param) {
- this.menuList.forEach((item) => {
- if (item.path == param) {
- this.crumbParent = item.name;
- this.crumbChild = null;
- return;
- } else {
- item.child.forEach((i) => {
- if (i.path == param) {
- this.crumbParent = i.parentName;
- this.crumbChild = i.name;
- }
- });
- }
- });
- },
- //下载专属二维码
- downCode(linkId) {
- const iconUrl = this.$refs[linkId].$el.src;
- const a = document.createElement("a");
- const event = new MouseEvent("click");
- a.download = linkId;
- a.href = iconUrl;
- a.dispatchEvent(event);
- },
- // 退出
- escape() {
- // localStorage.clear();
- // sessionStorage.clear();
- //
- // this.$router.push({
- // path: "/",
- // });
- oSessionStorage.removeItem("userInfo");
- oSessionStorage.removeItem("token");
- this.$router.push({ path: "/" });
- },
- /*lxh-修改密码*/
- submitForm(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.$http.post(
- "/user/update/password",
- {
- id: this.userInfo.id,
- newPassword: md5(this.ruleForm.pass),
- oldPassword: md5(this.ruleForm.oldpass),
- },
- (res) => {
- if (res.code == 2001) {
- this.$message({
- message: "旧密码错误",
- type: "error",
- });
- }
- if (res.code == 200) {
- this.ruleForm.oldpass = "";
- this.ruleForm.pass = "";
- this.ruleForm.checkPass = "";
- this.dialogVisible = false;
- this.$message({
- message: "密码修改完成!",
- type: "success",
- });
- sessionStorage.clear();
- this.$router.push({
- path: "/",
- });
- }
- }
- );
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- // 重置表单
- resetForm(formName) {
- this.$refs[formName].resetFields();
- },
- // 修改密码
- changePwd() {
- this.dialogVisible = true;
- },
- },
- };
- </script>
- >
- <style>
- .el-menu--popup {
- /* min-width:100px */
- }
- .el-submenu__title:hover {
- background-color: #80a1ff;
- }
- .el-menu {
- background-color: #23315a;
- }
- .el-menu-item-group .el-menu-item.is-active {
- background-color: #80a1ff !important;
- }
- .el-menu-item-group .el-menu-item:hover {
- background-color: #80a1ff !important;
- }
- .el-menu-item-group__title {
- padding: 0px !important;
- line-height: normal;
- font-size: 12px;
- color: #909399;
- }
- .el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
- .el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
- .el-menu--horizontal > .el-submenu .el-submenu__title:hover {
- background-color: transparent !important;
- }
- </style>
- <style lang="less" scoped>
- .el-menu-vertical-demo:not(.el-menu--collapse) {
- width: 200px;
- min-height: 400px;
- }
- .shadow-menu {
- // box-shadow: 0 4px 12px 2px rgba(0, 0, 0, 0.1);
- }
- #app {
- margin-top: 0px;
- }
- .el-header {
- padding: 0 0px !important;
- box-sizing: border-box;
- flex-shrink: 0;
- }
- .menu-top-left {
- background-color: black;
- height: 3.75rem;
- display: flex;
- align-items: center;
- font-size: 16px;
- line-height: 2;
- }
- .menu-top-left i img {
- width: 30px;
- height: 30px;
- }
- .menu-top-left-title {
- color: #ffffff;
- font-size: 1rem;
- }
- .el-menu--horizontal {
- // position: absolute;
- // top: 60px;
- // z-index: 2003;
- // left: 975px !important;
- }
- /*.el-menu--horizontal > .el-submenu {*/
- /*float: right;*/
- /*}*/
- /*.el-menu--horizontal > .el-menu-item {*/
- /*float: right;*/
- /*height: 60px;*/
- /*line-height: 60px;*/
- /*margin: 0;*/
- /*border-bottom: 2px solid transparent;*/
- /*color: #909399;*/
- /*}*/
- .top-menu-control {
- float: left;
- }
- .aside-menu {
- background-color: #000000;
- /*height: 98vh;*/
- height: 100vh;
- text-align: left;
- /*padding-top: 60px;*/
- border-top-right-radius: 40px;
- border-bottom-right-radius: 40px;
- }
- .aside-menu .el-menu-item.is-active {
- background: #80a1ff !important;
- }
- .el-menu-item-group .el-menu-item.is-active {
- background: #80a1ff !important;
- }
- .fade-enter {
- opacity: 0;
- }
- .fade-leave {
- opacity: 1;
- }
- .fade-leave-active,
- .fade-enter-active {
- transition: opacity 0s;
- }
- /*.rightExit {*/
- /*float: right !important;*/
- /*}*/
- .main-header {
- height: 40px !important;
- padding: 20px 0 0 20px !important;
- .menu-hide {
- height: 20px !important;
- text-align: left;
- line-height: 20px !important;
- }
- }
- .admin-header-content {
- // background: #57acbb;
- background: transparent;
- height: 100% !important;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
- .admin-header-content .el-col {
- height: 100% !important;
- }
- .admin-header-content .admin-logo-content {
- /*box-sizing: border-box;*/
- /*width: 100%;*/
- /*height: 100%;*/
- width: 165px;
- height: 45px;
- padding: 8px 0 8px 20px;
- font-size: 18px;
- color: #fff;
- text-align: left;
- line-height: 45px;
- }
- .admin-header-content .admin-logo-content img {
- width: 100%;
- height: 100%;
- }
- .admin-header-content .admin-head-content {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- flex: 1;
- }
- .admin-header-content .el-menu-demo {
- height: 100%;
- }
- .el-menu--horizontal > .el-submenu .el-submenu__title,
- /deep/.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
- border-bottom: none !important;
- }
- /deep/.el-menu--horizontal > .el-submenu .el-submenu__icon-arrow {
- color: #161616;
- }
- .el-menu.el-menu--horizontal {
- border-bottom: none;
- }
- .admin-breadcrumb {
- padding-top: 3px;
- margin-left: -18px;
- }
- .just-right {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- }
- .el-main-inner {
- display: flex;
- width: 100%;
- background-color: #fff;
- padding: 20px;
- border-radius: 40px;
- overflow: scroll;
- }
- .el-main {
- box-sizing: border-box !important;
- display: flex !important;
- overflow: hidden !important;
- }
- .menu_name {
- color: #ffffff;
- }
- .menu_sub_tt {
- margin-left: 10px;
- color: white;
- display: flex;
- flex-direction: row;
- align-items: center;
- .menu_sub_t1 {
- background-color: #ffffff;
- border-radius: 50%;
- width: 5px;
- height: 5px;
- margin-right: 10px;
- }
- }
- </style>
|