From 4f8f5e5375b82a5ebc1f67f389b934b3b757f062 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 19 Jan 2024 18:01:09 +0800
Subject: [PATCH] 双登录页处理
---
src/router/avue-router.js | 171 ++--
src/router/page/index.js | 123 ++-
src/page/login/index.vue | 15
src/page/login/tenement.vue | 150 ++++
src/views/wel/index.vue | 7
src/store/modules/common.js | 73 +-
public/index.html | 212 +++---
src/lang/en.js | 198 +++---
src/store/getters.js | 65 +
src/views/authority/role.vue | 665 ++++++++++-----------
src/page/index/logo.vue | 124 ++-
11 files changed, 1,005 insertions(+), 798 deletions(-)
diff --git a/public/index.html b/public/index.html
index 89d4858..d6a4965 100644
--- a/public/index.html
+++ b/public/index.html
@@ -2,124 +2,124 @@
<html>
<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta http-equiv="X-UA-Compatible" content="chrome=1"/>
- <meta name="renderer" content="webkit">
- <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
- <meta name="format-detection" content="telephone=no">
- <link rel="stylesheet" href="<%= BASE_URL %>cdn/element-ui/2.15.6/theme-chalk/index.css">
- <link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css">
- <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/index.css">
- <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/avue/iconfont.css">
- <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/saber/iconfont.css">
- <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.10.16/index.css">
- <script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script>
- <script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
- <!-- AvueMap-begin-->
- <script>
- window._AMapSecurityConfig = {
- securityJsCode: '5c569caedb31676fc64da5be4c5e8cee',
- }
- </script>
- <script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.11&key=fce315b8c816ec06755a523ccae9922d&plugin=AMap.PlaceSearch'></script>
- <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta http-equiv="X-UA-Compatible" content="chrome=1" />
+ <meta name="renderer" content="webkit">
+ <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
+ <meta name="format-detection" content="telephone=no">
+ <link rel="stylesheet" href="<%= BASE_URL %>cdn/element-ui/2.15.6/theme-chalk/index.css">
+ <link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css">
+ <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/index.css">
+ <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/avue/iconfont.css">
+ <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/saber/iconfont.css">
+ <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/2.10.16/index.css">
+ <script src="<%= BASE_URL %>cdn/xlsx/FileSaver.min.js"></script>
+ <script src="<%= BASE_URL %>cdn/xlsx/xlsx.full.min.js"></script>
+ <!-- AvueMap-begin-->
+ <script>
+ window._AMapSecurityConfig={
+ securityJsCode: '5c569caedb31676fc64da5be4c5e8cee',
+ }
+ </script>
+ <script type="text/javascript"
+ src='https://webapi.amap.com/maps?v=1.4.11&key=fce315b8c816ec06755a523ccae9922d&plugin=AMap.PlaceSearch'></script>
+ <script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<!-- AvueMap-end-->
- <link rel="icon" href="<%= BASE_URL %>favicon.png">
- <title>基层智治综合协同平台</title>
+ <link rel="icon" href="<%= BASE_URL %>favicon.png">
- <style>
- html,
- body,
- #app {
- height: 100%;
- margin: 0;
- padding: 0;
- }
+ <style>
+ html,
+ body,
+ #app {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ }
- .avue-home {
- background-color: #303133;
- height: 100%;
- display: flex;
- flex-direction: column;
- }
+ .avue-home {
+ background-color: #303133;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ }
- .avue-home__main {
- user-select: none;
- width: 100%;
- flex-grow: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- }
+ .avue-home__main {
+ user-select: none;
+ width: 100%;
+ flex-grow: 1;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ flex-direction: column;
+ }
- .avue-home__footer {
- width: 100%;
- flex-grow: 0;
- text-align: center;
- padding: 1em 0;
- }
+ .avue-home__footer {
+ width: 100%;
+ flex-grow: 0;
+ text-align: center;
+ padding: 1em 0;
+ }
- .avue-home__footer > a {
- font-size: 12px;
- color: #ABABAB;
- text-decoration: none;
- }
+ .avue-home__footer>a {
+ font-size: 12px;
+ color: #ABABAB;
+ text-decoration: none;
+ }
- .avue-home__loading {
- height: 32px;
- width: 32px;
- margin-bottom: 20px;
- }
+ .avue-home__loading {
+ height: 32px;
+ width: 32px;
+ margin-bottom: 20px;
+ }
- .avue-home__title {
- color: #FFF;
- font-size: 14px;
- margin-bottom: 10px;
- }
+ .avue-home__title {
+ color: #FFF;
+ font-size: 14px;
+ margin-bottom: 10px;
+ }
- .avue-home__sub-title {
- color: #ABABAB;
- font-size: 12px;
- }
- </style>
+ .avue-home__sub-title {
+ color: #ABABAB;
+ font-size: 12px;
+ }
+ </style>
</head>
<body>
-<noscript>
- <strong>
- 很抱歉,如果没有 JavaScript 支持,Saber 将不能正常工作。请启用浏览器的 JavaScript 然后继续。
- </strong>
-</noscript>
-<div id="app">
- <div class="avue-home">
- <div class="avue-home__main">
- <img class="avue-home__loading" src="<%= BASE_URL %>svg/loading-spin.svg" alt="loading">
- <div class="avue-home__title">
- 正在加载资源
- </div>
- <div class="avue-home__sub-title d">
- 初次加载资源可能需要较多时间 请耐心等待
- </div>
+ <noscript>
+ <strong>
+ 很抱歉,如果没有 JavaScript 支持,Saber 将不能正常工作。请启用浏览器的 JavaScript 然后继续。
+ </strong>
+ </noscript>
+ <div id="app">
+ <div class="avue-home">
+ <div class="avue-home__main">
+ <img class="avue-home__loading" src="<%= BASE_URL %>svg/loading-spin.svg" alt="loading">
+ <div class="avue-home__title">
+ 正在加载资源
+ </div>
+ <div class="avue-home__sub-title d">
+ 初次加载资源可能需要较多时间 请耐心等待
+ </div>
+ </div>
+ <div class="avue-home__footer">
+ <a href="https://bladex.cn" target="_blank">
+ https://bladex.cn </a>
+ </div>
+ </div>
</div>
- <div class="avue-home__footer">
- <a href="https://bladex.cn" target="_blank">
- https://bladex.cn </a>
- </div>
- </div>
-</div>
-<!-- built files will be auto injected -->
-<script src="<%= BASE_URL %>util/aes.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/vue/2.6.10/vue.min.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/vuex/3.1.1/vuex.min.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/vue-router/3.0.1/vue-router.min.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/element-ui/2.15.6/index.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/avue/2.10.16/avue.min.js" charset="utf-8"></script>
-<script src="<%= BASE_URL %>cdn/nutflow/wf-design-base/index.umd.min.js" charset="utf-8"></script>
+ <!-- built files will be auto injected -->
+ <script src="<%= BASE_URL %>util/aes.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/vue/2.6.10/vue.min.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/vuex/3.1.1/vuex.min.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/vue-router/3.0.1/vue-router.min.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/axios/1.0.0/axios.min.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/element-ui/2.15.6/index.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/avue/2.10.16/avue.min.js" charset="utf-8"></script>
+ <script src="<%= BASE_URL %>cdn/nutflow/wf-design-base/index.umd.min.js" charset="utf-8"></script>
</body>
-</html>
+</html>
\ No newline at end of file
diff --git a/src/lang/en.js b/src/lang/en.js
index 1ec0da0..4cfd4e2 100644
--- a/src/lang/en.js
+++ b/src/lang/en.js
@@ -1,122 +1,122 @@
export default {
- title: '基层智治综合协同平台',
- logoutTip: 'Exit the system, do you want to continue?',
- submitText: 'submit',
- cancelText: 'cancel',
- search: 'Please input search content',
- menuTip: 'none menu list',
+ title: "",
+ logoutTip: "Exit the system, do you want to continue?",
+ submitText: "submit",
+ cancelText: "cancel",
+ search: "Please input search content",
+ menuTip: "none menu list",
common: {
- condition: 'condition',
- display: 'display',
- hide: 'hide'
+ condition: "condition",
+ display: "display",
+ hide: "hide",
},
tip: {
- select: 'Please select',
- input: 'Please input'
+ select: "Please select",
+ input: "Please input",
},
upload: {
- upload: 'upload',
- tip: 'Drag files here,/'
+ upload: "upload",
+ tip: "Drag files here,/",
},
date: {
- start: 'Start date',
- end: 'End date',
- t: 'today',
- y: 'yesterday',
- n: 'nearly 7',
- a: 'whole'
+ start: "Start date",
+ end: "End date",
+ t: "today",
+ y: "yesterday",
+ n: "nearly 7",
+ a: "whole",
},
form: {
- printBtn: 'print',
- mockBtn: 'mock',
- submitBtn: 'submit',
- emptyBtn: 'empty'
+ printBtn: "print",
+ mockBtn: "mock",
+ submitBtn: "submit",
+ emptyBtn: "empty",
},
crud: {
filter: {
- addBtn: 'add',
- clearBtn: 'clear',
- resetBtn: 'reset',
- cancelBtn: 'cancel',
- submitBtn: 'submit'
+ addBtn: "add",
+ clearBtn: "clear",
+ resetBtn: "reset",
+ cancelBtn: "cancel",
+ submitBtn: "submit",
},
column: {
- name: 'name',
- hide: 'hide',
- fixed: 'fixed',
- filters: 'filters',
- sortable: 'sortable',
- index: 'index',
- width: 'width'
+ name: "name",
+ hide: "hide",
+ fixed: "fixed",
+ filters: "filters",
+ sortable: "sortable",
+ index: "index",
+ width: "width",
},
- tipStartTitle: 'Currently selected',
- tipEndTitle: 'items',
- editTitle: 'edit',
- copyTitle: 'copy',
- addTitle: 'add',
- viewTitle: 'view',
- filterTitle: 'filter',
- showTitle: 'showTitle',
- menu: 'menu',
- addBtn: 'add',
- show: 'show',
- hide: 'hide',
- open: 'open',
- shrink: 'shrink',
- printBtn: 'print',
- excelBtn: 'excel',
- updateBtn: 'update',
- cancelBtn: 'cancel',
- searchBtn: 'search',
- emptyBtn: 'empty',
- menuBtn: 'menu',
- saveBtn: 'save',
- viewBtn: 'view',
- editBtn: 'edit',
- copyBtn: 'copy',
- delBtn: 'delete'
+ tipStartTitle: "Currently selected",
+ tipEndTitle: "items",
+ editTitle: "edit",
+ copyTitle: "copy",
+ addTitle: "add",
+ viewTitle: "view",
+ filterTitle: "filter",
+ showTitle: "showTitle",
+ menu: "menu",
+ addBtn: "add",
+ show: "show",
+ hide: "hide",
+ open: "open",
+ shrink: "shrink",
+ printBtn: "print",
+ excelBtn: "excel",
+ updateBtn: "update",
+ cancelBtn: "cancel",
+ searchBtn: "search",
+ emptyBtn: "empty",
+ menuBtn: "menu",
+ saveBtn: "save",
+ viewBtn: "view",
+ editBtn: "edit",
+ copyBtn: "copy",
+ delBtn: "delete",
},
login: {
- title: 'Login ',
- info: 'BladeX Development Platform',
- tenantId: 'Please input tenantId',
- username: 'Please input username',
- password: 'Please input a password',
- wechat: 'Wechat',
- qq: 'QQ',
- github: 'github',
- gitee: 'gitee',
- phone: 'Please input a phone',
- code: 'Please input a code',
- submit: 'Login',
- userLogin: 'userLogin',
- phoneLogin: 'phoneLogin',
- thirdLogin: 'thirdLogin',
- ssoLogin: 'ssoLogin',
- msgText: 'send code',
- msgSuccess: 'reissued code',
+ title: "Login ",
+ info: "BladeX Development Platform",
+ tenantId: "Please input tenantId",
+ username: "Please input username",
+ password: "Please input a password",
+ wechat: "Wechat",
+ qq: "QQ",
+ github: "github",
+ gitee: "gitee",
+ phone: "Please input a phone",
+ code: "Please input a code",
+ submit: "Login",
+ userLogin: "userLogin",
+ phoneLogin: "phoneLogin",
+ thirdLogin: "thirdLogin",
+ ssoLogin: "ssoLogin",
+ msgText: "send code",
+ msgSuccess: "reissued code",
},
navbar: {
- info: 'info',
- logOut: 'logout',
- userinfo: 'userinfo',
- switchDept : 'switch dept',
- dashboard: 'dashboard',
- lock: 'lock',
- bug: 'none bug',
- bugs: 'bug',
- screenfullF: 'exit screenfull',
- screenfull: 'screenfull',
- language: 'language',
- notice: 'notice',
- theme: 'theme',
- color: 'color'
+ info: "info",
+ logOut: "logout",
+ userinfo: "userinfo",
+ switchDept: "switch dept",
+ dashboard: "dashboard",
+ lock: "lock",
+ bug: "none bug",
+ bugs: "bug",
+ screenfullF: "exit screenfull",
+ screenfull: "screenfull",
+ language: "language",
+ notice: "notice",
+ theme: "theme",
+ color: "color",
},
tagsView: {
- search: 'Search',
- menu: 'menu',
- clearCache: 'Clear Cache',
- closeOthers: 'Close Others',
- closeAll: 'Close All'
- }
+ search: "Search",
+ menu: "menu",
+ clearCache: "Clear Cache",
+ closeOthers: "Close Others",
+ closeAll: "Close All",
+ },
};
diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue
index de07ead..63580cc 100644
--- a/src/page/index/logo.vue
+++ b/src/page/index/logo.vue
@@ -1,73 +1,89 @@
+<!--
+ * @Author: shuishen 1109946754@qq.com
+ * @Date: 2023-12-14 17:10:00
+ * @LastEditors: shuishen 1109946754@qq.com
+ * @LastEditTime: 2024-01-19 15:47:47
+ * @FilePath: \jczz_web\src\page\index\logo.vue
+ * @Description:
+ *
+ * Copyright (c) 2024 by shuishen, All Rights Reserved.
+-->
<template>
- <div class="avue-logo">
- <transition name="fade">
- <span v-if="keyCollapse"
- class="avue-logo_subtitle"
- key="0">
- {{website.logo}}
- </span>
- </transition>
- <transition-group name="fade">
- <template v-if="!keyCollapse">
- <span class="avue-logo_title"
- key="1">{{website.indexTitle}} </span>
- </template>
- </transition-group>
- </div>
+ <div class="avue-logo">
+ <transition name="fade">
+ <span v-if="keyCollapse" class="avue-logo_subtitle" key="0">
+ {{ website.logo }}
+ </span>
+ </transition>
+ <transition-group name="fade">
+ <template v-if="!keyCollapse">
+ <span class="avue-logo_title" key="1">{{ webTitle }} </span>
+ </template>
+ </transition-group>
+ </div>
</template>
<script>
-import { mapGetters } from "vuex";
+import { getStore } from "@/util/store"
+import { mapGetters } from "vuex"
+
export default {
- name: "logo",
- data() {
- return {};
- },
- created() {},
- computed: {
- ...mapGetters(["website", "keyCollapse"])
- },
- methods: {}
-};
+ name: "logo",
+ data () {
+ return {
+ webTitle: getStore({ name: "webTitle" })
+ }
+ },
+ created () { },
+ computed: {
+ ...mapGetters(["website", "keyCollapse"])
+ },
+ methods: {}
+}
</script>
<style lang="scss">
.fade-leave-active {
- transition: opacity 0.2s;
+ transition: opacity 0.2s;
}
+
.fade-enter-active {
- transition: opacity 2.5s;
+ transition: opacity 2.5s;
}
+
.fade-enter,
.fade-leave-to {
- opacity: 0;
+ opacity: 0;
}
+
.avue-logo {
- position: fixed;
- top: 0;
- left: 0;
- width: 240px;
- height: 64px;
- line-height: 64px;
- background-color: #20222a;
- font-size: 20px;
- overflow: hidden;
- box-sizing: border-box;
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
- color: rgba(255, 255, 255, 0.8);
- z-index: 1024;
- &_title {
- display: block;
- text-align: center;
- font-weight: 300;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 240px;
+ height: 64px;
+ line-height: 64px;
+ background-color: #20222a;
font-size: 20px;
- }
- &_subtitle {
- display: block;
- text-align: center;
- font-size: 18px;
- font-weight: bold;
- color: #fff;
- }
+ overflow: hidden;
+ box-sizing: border-box;
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
+ color: rgba(255, 255, 255, 0.8);
+ z-index: 1024;
+
+ &_title {
+ display: block;
+ text-align: center;
+ font-weight: 300;
+ font-size: 20px;
+ }
+
+ &_subtitle {
+ display: block;
+ text-align: center;
+ font-size: 18px;
+ font-weight: bold;
+ color: #fff;
+ }
}
</style>
\ No newline at end of file
diff --git a/src/page/login/index.vue b/src/page/login/index.vue
index 87b8f01..f57b3a9 100644
--- a/src/page/login/index.vue
+++ b/src/page/login/index.vue
@@ -7,7 +7,8 @@
{{ time }}
</div>
<!-- <img class="img" src="/img/logo.png" alt=""> -->
- <p class="title">{{ $t('login.info') }}</p>
+ <!-- <p class="title">{{ $t('login.info') }}</p> -->
+ <p class="title">基层智治综合协同平台</p>
</div>
<div class="login-border">
<img class="img" src="/img/logo.png" alt="">
@@ -33,6 +34,7 @@
</div>
</template>
<script>
+import { setStore, getStore } from "@/util/store"
import Watermark from "@/warterMarkVUE"
import userLogin from "./userlogin"
import codeLogin from "./codelogin"
@@ -71,6 +73,17 @@
}
},
created () {
+ document.title = "基层智治综合协同平台"
+ setStore({
+ name: "webTitle",
+ content: '基层智治综合协同平台',
+ })
+
+ setStore({
+ name: "webType",
+ content: 'default',
+ })
+
Watermark.remove()
this.handleLogin()
diff --git a/src/page/login/tenement.vue b/src/page/login/tenement.vue
new file mode 100644
index 0000000..1465f44
--- /dev/null
+++ b/src/page/login/tenement.vue
@@ -0,0 +1,150 @@
+<template>
+ <div class="login-container" ref="login" @keyup.enter.native="handleLogin">
+ <top-color v-show="false"></top-color>
+ <div class="login-weaper animated bounceInDown">
+ <div class="login-left">
+ <div class="login-time">
+ {{ time }}
+ </div>
+ <!-- <img class="img" src="/img/logo.png" alt=""> -->
+ <!-- <p class="title">{{ $t('login.info') }}</p> -->
+ <p class="title">上饶市智慧物业管理平台</p>
+ </div>
+ <div class="login-border">
+ <img class="img" src="/img/logo.png" alt="">
+ <div class="login-main">
+
+ <h4 class="login-title">
+ {{ $t('login.title') }}
+ <!-- <top-lang></top-lang> -->
+ </h4>
+ <userLogin v-if="activeName === 'user'"></userLogin>
+ <!-- <codeLogin v-else-if="activeName==='code'"></codeLogin> -->
+ <!-- <thirdLogin v-else-if="activeName==='third'"></thirdLogin> -->
+ <div class="login-menu">
+ <!-- <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a> -->
+ <!--<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>-->
+ <!-- <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a> -->
+ <!-- <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a> -->
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+</template>
+<script>
+import { setStore, getStore } from "@/util/store"
+import Watermark from "@/warterMarkVUE"
+import userLogin from "./userlogin"
+import codeLogin from "./codelogin"
+import thirdLogin from "./thirdlogin"
+import { mapGetters } from "vuex"
+import { dateFormat } from "@/util/date"
+import { validatenull } from "@/util/validate"
+import topLang from "@/page/index/top/top-lang"
+import topColor from "@/page/index/top/top-color"
+import { getQueryString, getTopUrl } from "@/util/util"
+
+export default {
+ name: "login",
+ components: {
+ userLogin,
+ codeLogin,
+ thirdLogin,
+ topLang,
+ topColor
+ },
+ data () {
+ return {
+ time: "",
+ activeName: "user",
+ socialForm: {
+ tenantId: "000000",
+ source: "",
+ code: "",
+ state: "",
+ }
+ }
+ },
+ watch: {
+ $route () {
+ this.handleLogin()
+ }
+ },
+ created () {
+ document.title = "上饶市智慧物业管理平台"
+ setStore({
+ name: "webTitle",
+ content: '上饶市智慧物业管理平台',
+ })
+
+ setStore({
+ name: "webType",
+ content: 'secend',
+ })
+
+ Watermark.remove()
+
+ this.handleLogin()
+ this.getTime()
+ },
+ mounted () {
+ },
+ computed: {
+ ...mapGetters(["website", "tagWel"])
+ },
+ props: [],
+ methods: {
+ getTime () {
+ setInterval(() => {
+ this.time = dateFormat(new Date())
+ }, 1000)
+ },
+ handleLogin () {
+ const topUrl = getTopUrl()
+ const redirectUrl = "/oauth/redirect/"
+ const ssoCode = "?code="
+ this.socialForm.source = getQueryString("source")
+ this.socialForm.code = getQueryString("code")
+ this.socialForm.state = getQueryString("state")
+ if (validatenull(this.socialForm.source) && topUrl.includes(redirectUrl)) {
+ let source = topUrl.split("?")[0]
+ source = source.split(redirectUrl)[1]
+ this.socialForm.source = source
+ }
+ if (topUrl.includes(redirectUrl) && !validatenull(this.socialForm.source) && !validatenull(this.socialForm.code) && !validatenull(this.socialForm.state)) {
+ const loading = this.$loading({
+ lock: true,
+ text: '第三方系统登录中,请稍后。。。',
+ spinner: "el-icon-loading"
+ })
+ this.$store.dispatch("LoginBySocial", this.socialForm).then(() => {
+ window.location.href = topUrl.split(redirectUrl)[0]
+ this.$router.push({ path: this.tagWel.value })
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ } else if (!topUrl.includes(redirectUrl) && !validatenull(this.socialForm.code) && !validatenull(this.socialForm.state)) {
+ const loading = this.$loading({
+ lock: true,
+ text: '单点系统登录中,请稍后。。。',
+ spinner: "el-icon-loading"
+ })
+ this.$store.dispatch("LoginBySso", this.socialForm).then(() => {
+ window.location.href = topUrl.split(ssoCode)[0]
+ this.$router.push({ path: this.tagWel.value })
+ loading.close()
+ }).catch(() => {
+ loading.close()
+ })
+ }
+ }
+ }
+}
+</script>
+
+<style lang="scss">
+@import "@/styles/login.scss";
+</style>
diff --git a/src/router/avue-router.js b/src/router/avue-router.js
index 0e68bda..88b3df0 100644
--- a/src/router/avue-router.js
+++ b/src/router/avue-router.js
@@ -1,8 +1,10 @@
let RouterPlugin = function () {
this.$router = null;
this.$store = null;
-
};
+
+import { getStore } from "@/util/store";
+
RouterPlugin.install = function (vue, option = {}) {
this.$router = option.router;
this.$store = option.store;
@@ -10,53 +12,58 @@
// 这个的作用是 为了检查出网页链接,因为本项目用到了 iframe
function isURL(s) {
- if (s.includes('html')) return true;
- return /^http[s]?:\/\/.*/.test(s)
+ if (s.includes("html")) return true;
+ return /^http[s]?:\/\/.*/.test(s);
}
// 将参数处理为参数的形式拼接
function objToform(obj) {
let result = [];
- Object.keys(obj).forEach(ele => {
+ Object.keys(obj).forEach((ele) => {
result.push(`${ele}=${obj[ele]}`);
- })
- return result.join('&');
+ });
+ return result.join("&");
}
this.$router.$avueRouter = {
//全局配置
$website: this.$store.getters.website,
- group: '',
+ group: "",
meta: {},
safe: this,
// 设置标题
setTitle: (title) => {
- const defaultTitle = this.$vue.$t('title');
- title = title ? `${title}-${defaultTitle}` : defaultTitle;
+ // const defaultTitle = this.$vue.$t("title");
+
+ title = title
+ ? `${title}-${getStore({ name: "webTitle" })}`
+ : getStore({ name: "webTitle" });
document.title = title;
},
closeTag: (value) => {
let tag = value || this.$store.getters.tag;
- if (typeof value === 'string') {
- tag = this.$store.getters.tagList.filter(ele => ele.value === value)[0]
+ if (typeof value === "string") {
+ tag = this.$store.getters.tagList.filter(
+ (ele) => ele.value === value
+ )[0];
}
- this.$store.commit('DEL_TAG', tag)
+ this.$store.commit("DEL_TAG", tag);
},
generateTitle: (title, key) => {
if (!key) return title;
- const hasKey = this.$vue.$te('route.' + key)
+ const hasKey = this.$vue.$te("route." + key);
if (hasKey) {
// $t :this method from vue-i18n, inject in @/lang/index.js
- const translatedTitle = this.$vue.$t('route.' + key)
+ const translatedTitle = this.$vue.$t("route." + key);
- return translatedTitle
+ return translatedTitle;
}
- return title
+ return title;
},
//处理路由
getPath: function (params) {
- let {src} = params;
- let result = src || '/';
+ let { src } = params;
+ let result = src || "/";
if (isURL(src)) {
result = `/myiframe/urlPath?${objToform(params)}`;
}
@@ -65,12 +72,11 @@
//正则处理路由
vaildPath: function (list, path) {
let result = false;
- list.forEach(ele => {
+ list.forEach((ele) => {
if (new RegExp("^" + ele + ".*", "g").test(path)) {
- result = true
+ result = true;
}
-
- })
+ });
return result;
},
//设置路由值
@@ -85,24 +91,24 @@
},
//动态路由
// 路由是专门的一个接口获取
- /**
- * aMenu: 接受到的动态路由数据 menu的结构外层有父级path 里面有一个childen 记录页面的路由
- * first: 为了区分外界 调用formatRoutes 和 当前文件调用 formatRoutes
- */
+ /**
+ * aMenu: 接受到的动态路由数据 menu的结构外层有父级path 里面有一个childen 记录页面的路由
+ * first: 为了区分外界 调用formatRoutes 和 当前文件调用 formatRoutes
+ */
formatRoutes: function (aMenu = [], first) {
// window.console.log('aMenu')
// window.console.log(aMenu)
- const aRouter = []
+ const aRouter = [];
// 获取到全局配置中的 props
const propsConfig = this.$website.menu.props;
// 设置 props默认值 作用就是将字段设置成配置的
const propsDefault = {
- label: propsConfig.label || 'name',
- path: propsConfig.path || 'path',
- icon: propsConfig.icon || 'icon',
- children: propsConfig.children || 'children',
- meta: propsConfig.meta || 'meta',
- }
+ label: propsConfig.label || "name",
+ path: propsConfig.path || "path",
+ icon: propsConfig.icon || "icon",
+ children: propsConfig.children || "children",
+ meta: propsConfig.meta || "meta",
+ };
// 如果没有权限菜单就结束
if (aMenu.length === 0) return;
// 开始处理menu
@@ -113,25 +119,28 @@
let path = (() => {
if (first) {
// 将 '/index' 替换为 ''
- return oMenu[propsDefault.path].replace('/index', '')
+ return oMenu[propsDefault.path].replace("/index", "");
} else {
- return oMenu[propsDefault.path]
+ return oMenu[propsDefault.path];
}
})(),
//特殊处理组件 执行完这个 component 也就是精确到具体的文件了 views文件夹下面就是具体的页面代码
- component = 'views' + oMenu.path,
+ component = "views" + oMenu.path,
name = oMenu[propsDefault.label],
icon = oMenu[propsDefault.icon],
children = oMenu[propsDefault.children],
meta = oMenu[propsDefault.meta] || {};
- // meta中 keepalive 的处理
- meta = Object.assign(meta, (function () {
- if (option.keepAlive === true) {
- return {
- keepAlive: true
+ // meta中 keepalive 的处理
+ meta = Object.assign(
+ meta,
+ (function () {
+ if (option.keepAlive === true) {
+ return {
+ keepAlive: true,
+ };
}
- }
- })());
+ })()
+ );
//是否有子路由
const isChild = children.length !== 0;
const oRouter = {
@@ -139,15 +148,15 @@
component(resolve) {
// 判断是否为首路由
if (first) {
- require(['../page/index'], resolve)
- return
+ require(["../page/index"], resolve);
+ return;
// 判断是否为多层路由
} else if (isChild && !first) {
- require(['../page/index/layout'], resolve)
- return
+ require(["../page/index/layout"], resolve);
+ return;
// 判断是否为最终的页面视图
} else {
- require([`../${component}.vue`], resolve)
+ require([`../${component}.vue`], resolve);
}
},
name: name,
@@ -155,45 +164,49 @@
meta: meta,
redirect: (() => {
// 第一次进来但是没有子路由的 需要添加redirect
- if (!isChild && first && !isURL(path)) return `${path}/index`
- else return '';
+ if (!isChild && first && !isURL(path)) return `${path}/index`;
+ else return "";
})(),
// 整理子路由的route 配置
// 处理是否为一级路由
- children: !isChild ? (() => {
- if (first) {
- // 这里的isURL判断,因为这个网站有使用 iframe。所以需要判断是否为网页链接
- if (!isURL(path)) oMenu[propsDefault.path] = `${path}/index`;
- return [{
- component(resolve) {
- require([`../${component}.vue`], resolve)
- },
- icon: icon,
- name: name,
- meta: meta,
- path: 'index'
- }]
- }
- return [];
- })() : (() => {
- /**
- * 这里是重点,当有子路由的时候 会再去执行 formatRoutes 方法,然后又会有一个新的 aMenu for循环。
- * 最后返回的是一个数组 aRouter 这个数组就会作为 childen的值被 return
- */
- return this.formatRoutes(children, false)
- })()
- }
- aRouter.push(oRouter)
+ children: !isChild
+ ? (() => {
+ if (first) {
+ // 这里的isURL判断,因为这个网站有使用 iframe。所以需要判断是否为网页链接
+ if (!isURL(path)) oMenu[propsDefault.path] = `${path}/index`;
+ return [
+ {
+ component(resolve) {
+ require([`../${component}.vue`], resolve);
+ },
+ icon: icon,
+ name: name,
+ meta: meta,
+ path: "index",
+ },
+ ];
+ }
+ return [];
+ })()
+ : (() => {
+ /**
+ * 这里是重点,当有子路由的时候 会再去执行 formatRoutes 方法,然后又会有一个新的 aMenu for循环。
+ * 最后返回的是一个数组 aRouter 这个数组就会作为 childen的值被 return
+ */
+ return this.formatRoutes(children, false);
+ })(),
+ };
+ aRouter.push(oRouter);
}
// for循环结束
// 这个first 卡的其实就是首路由
if (first) {
- this.safe.$router.addRoutes(aRouter)
+ this.safe.$router.addRoutes(aRouter);
} else {
// 这里返回的是子组件
- return aRouter
+ return aRouter;
}
- }
- }
-}
+ },
+ };
+};
export default RouterPlugin;
diff --git a/src/router/page/index.js b/src/router/page/index.js
index 1136402..3fd53b8 100644
--- a/src/router/page/index.js
+++ b/src/router/page/index.js
@@ -1,81 +1,102 @@
-import Layout from '@/page/index/'
+/*
+ * @Author: shuishen 1109946754@qq.com
+ * @Date: 2023-12-14 17:10:00
+ * @LastEditors: shuishen 1109946754@qq.com
+ * @LastEditTime: 2024-01-19 11:40:51
+ * @FilePath: \jczz_web\src\router\page\index.js
+ * @Description:
+ *
+ * Copyright (c) 2024 by shuishen, All Rights Reserved.
+ */
+import Layout from "@/page/index/";
-export default [{
- path: '/login',
- name: '登录页',
- component: () =>
- import( /* webpackChunkName: "page" */ '@/page/login/index'),
- meta: {
- keepAlive: true,
- isTab: false,
- isAuth: false
- }
-},
+export default [
{
- path: '/lock',
- name: '锁屏页',
+ path: "/login",
+ name: "登录页",
component: () =>
- import( /* webpackChunkName: "page" */ '@/page/lock/index'),
+ import(/* webpackChunkName: "page" */ "@/page/login/index"),
meta: {
keepAlive: true,
isTab: false,
- isAuth: false
- }
+ isAuth: false,
+ },
},
{
- path: '/404',
+ path: "/tenementLogin",
+ name: "登录页",
component: () =>
- import( /* webpackChunkName: "page" */ '@/components/error-page/404'),
- name: '404',
+ import(/* webpackChunkName: "page" */ "@/page/login/tenement.vue"),
meta: {
keepAlive: true,
isTab: false,
- isAuth: false
- }
-
+ isAuth: false,
+ },
},
{
- path: '/403',
- component: () =>
- import( /* webpackChunkName: "page" */ '@/components/error-page/403'),
- name: '403',
+ path: "/lock",
+ name: "锁屏页",
+ component: () => import(/* webpackChunkName: "page" */ "@/page/lock/index"),
meta: {
keepAlive: true,
isTab: false,
- isAuth: false
- }
+ isAuth: false,
+ },
},
{
- path: '/500',
+ path: "/404",
component: () =>
- import( /* webpackChunkName: "page" */ '@/components/error-page/500'),
- name: '500',
+ import(/* webpackChunkName: "page" */ "@/components/error-page/404"),
+ name: "404",
meta: {
keepAlive: true,
isTab: false,
- isAuth: false
- }
+ isAuth: false,
+ },
},
{
- path: '/',
- name: '主页',
- redirect: '/wel'
+ path: "/403",
+ component: () =>
+ import(/* webpackChunkName: "page" */ "@/components/error-page/403"),
+ name: "403",
+ meta: {
+ keepAlive: true,
+ isTab: false,
+ isAuth: false,
+ },
},
{
- path: '/myiframe',
+ path: "/500",
+ component: () =>
+ import(/* webpackChunkName: "page" */ "@/components/error-page/500"),
+ name: "500",
+ meta: {
+ keepAlive: true,
+ isTab: false,
+ isAuth: false,
+ },
+ },
+ {
+ path: "/",
+ name: "主页",
+ redirect: "/wel",
+ },
+ {
+ path: "/myiframe",
component: Layout,
- redirect: '/myiframe',
- children: [{
- path: ":routerPath",
- name: 'iframe',
- component: () =>
- import( /* webpackChunkName: "page" */ '@/components/iframe/main'),
- props: true
- }]
-
+ redirect: "/myiframe",
+ children: [
+ {
+ path: ":routerPath",
+ name: "iframe",
+ component: () =>
+ import(/* webpackChunkName: "page" */ "@/components/iframe/main"),
+ props: true,
+ },
+ ],
},
{
- path: '*',
- redirect: '/404'
- }
-]
+ path: "*",
+ redirect: "/404",
+ },
+];
diff --git a/src/store/getters.js b/src/store/getters.js
index e6fcd6f..90fb411 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -1,29 +1,40 @@
+/*
+ * @Author: shuishen 1109946754@qq.com
+ * @Date: 2023-12-14 17:10:00
+ * @LastEditors: shuishen 1109946754@qq.com
+ * @LastEditTime: 2024-01-19 15:58:57
+ * @FilePath: \jczz_web\src\store\getters.js
+ * @Description:
+ *
+ * Copyright (c) 2024 by shuishen, All Rights Reserved.
+ */
const getters = {
- tag: state => state.tags.tag,
- language: state => state.common.language,
- website: state => state.common.website,
- userInfo: state => state.user.userInfo,
- colorName: state => state.common.colorName,
- themeName: state => state.common.themeName,
- isShade: state => state.common.isShade,
- isCollapse: state => state.common.isCollapse,
- keyCollapse: (state, getters) => getters.screen > 1 ? getters.isCollapse : false,
- screen: state => state.common.screen,
- isLock: state => state.common.isLock,
- isFullScren: state => state.common.isFullScren,
- isMenu: state => state.common.isMenu,
- lockPasswd: state => state.common.lockPasswd,
- tagList: state => state.tags.tagList,
- tagWel: state => state.tags.tagWel,
- token: state => state.user.token,
- roles: state => state.user.roles,
- permission: state => state.user.permission,
- menu: state => state.user.menu,
- menuId: state => state.user.menuId,
- menuAll: state => state.user.menuAll,
- logsList: state => state.logs.logsList,
- logsLen: state => state.logs.logsList.length || 0,
+ tag: (state) => state.tags.tag,
+ language: (state) => state.common.language,
+ website: (state) => state.common.website,
+ userInfo: (state) => state.user.userInfo,
+ colorName: (state) => state.common.colorName,
+ themeName: (state) => state.common.themeName,
+ isShade: (state) => state.common.isShade,
+ isCollapse: (state) => state.common.isCollapse,
+ keyCollapse: (state, getters) =>
+ getters.screen > 1 ? getters.isCollapse : false,
+ screen: (state) => state.common.screen,
+ isLock: (state) => state.common.isLock,
+ isFullScren: (state) => state.common.isFullScren,
+ isMenu: (state) => state.common.isMenu,
+ lockPasswd: (state) => state.common.lockPasswd,
+ tagList: (state) => state.tags.tagList,
+ tagWel: (state) => state.tags.tagWel,
+ token: (state) => state.user.token,
+ roles: (state) => state.user.roles,
+ permission: (state) => state.user.permission,
+ menu: (state) => state.user.menu,
+ menuId: (state) => state.user.menuId,
+ menuAll: (state) => state.user.menuAll,
+ logsList: (state) => state.logs.logsList,
+ logsLen: (state) => state.logs.logsList.length || 0,
logsFlag: (state, getters) => getters.logsLen === 0,
- flowRoutes: state => state.dict.flowRoutes,
-}
-export default getters
+ flowRoutes: (state) => state.dict.flowRoutes,
+};
+export default getters;
diff --git a/src/store/modules/common.js b/src/store/modules/common.js
index 1021541..b0840a7 100644
--- a/src/store/modules/common.js
+++ b/src/store/modules/common.js
@@ -1,20 +1,25 @@
-import {
- setStore,
- getStore,
- removeStore
-} from '@/util/store'
-import website from '@/config/website'
+/*
+ * @Author: shuishen 1109946754@qq.com
+ * @Date: 2023-12-14 17:10:00
+ * @LastEditors: shuishen 1109946754@qq.com
+ * @LastEditTime: 2024-01-19 16:43:29
+ * @FilePath: \jczz_web\src\store\modules\common.js
+ * @Description:
+ *
+ * Copyright (c) 2024 by shuishen, All Rights Reserved.
+ */
+import { setStore, getStore, removeStore } from "@/util/store";
+import website from "@/config/website";
const common = {
-
state: {
- language: getStore({name: 'language'}) || 'zh',
+ language: getStore({ name: "language" }) || "zh",
isCollapse: false,
isFullScren: false,
isMenu: true,
isShade: false,
screen: -1,
- isLock: getStore({name: 'isLock'}) || false,
+ isLock: getStore({ name: "isLock" }) || false,
showTag: true,
showDebug: true,
showCollapse: true,
@@ -24,18 +29,18 @@
showTheme: true,
showMenu: true,
showColor: true,
- colorName: getStore({name: 'colorName'}) || '#409EFF',
- themeName: 'theme-white',
- lockPasswd: getStore({name: 'lockPasswd'}) || '',
+ colorName: getStore({ name: "colorName" }) || "#409EFF",
+ themeName: "theme-white",
+ lockPasswd: getStore({ name: "lockPasswd" }) || "",
website: website,
},
mutations: {
SET_LANGUAGE: (state, language) => {
- state.language = language
+ state.language = language;
setStore({
- name: 'language',
- content: state.language
- })
+ name: "language",
+ content: state.language,
+ });
},
SET_SHADE: (state, active) => {
state.isShade = active;
@@ -52,10 +57,10 @@
SET_LOCK: (state) => {
state.isLock = true;
setStore({
- name: 'isLock',
+ name: "isLock",
content: state.isLock,
- type: 'session'
- })
+ type: "session",
+ });
},
SET_SCREEN: (state, screen) => {
state.screen = screen;
@@ -63,37 +68,37 @@
SET_COLOR_NAME: (state, colorName) => {
state.colorName = colorName;
setStore({
- name: 'colorName',
+ name: "colorName",
content: state.colorName,
- })
+ });
},
SET_THEME_NAME: (state, themeName) => {
state.themeName = themeName;
setStore({
- name: 'themeName',
+ name: "themeName",
content: state.themeName,
- })
+ });
},
SET_LOCK_PASSWD: (state, lockPasswd) => {
state.lockPasswd = lockPasswd;
setStore({
- name: 'lockPasswd',
+ name: "lockPasswd",
content: state.lockPasswd,
- type: 'session'
- })
+ type: "session",
+ });
},
CLEAR_LOCK: (state) => {
state.isLock = false;
- state.lockPasswd = '';
+ state.lockPasswd = "";
removeStore({
- name: 'lockPasswd',
- type: 'session'
+ name: "lockPasswd",
+ type: "session",
});
removeStore({
- name: 'isLock',
- type: 'session'
+ name: "isLock",
+ type: "session",
});
},
- }
-}
-export default common
+ },
+};
+export default common;
diff --git a/src/views/authority/role.vue b/src/views/authority/role.vue
index 1233dfb..c95ccfd 100644
--- a/src/views/authority/role.vue
+++ b/src/views/authority/role.vue
@@ -1,53 +1,27 @@
<template>
- <basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- ref="crud"
- v-model="form"
- :permission="permissionList"
- :before-open="beforeOpen"
- @row-del="rowDel"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
- <template slot="menuLeft">
- <el-button type="danger"
- size="small"
- icon="el-icon-delete"
- v-if="permission.role_delete"
- plain
- @click="handleDelete">删 除
- </el-button>
- <el-button size="small"
- icon="el-icon-setting"
- @click="handleRole"
- v-if="userInfo.role_name.includes('admin')"
- plain>权限设置
- </el-button>
- </template>
- </avue-crud>
- <el-dialog title="角色权限配置"
- append-to-body
- :visible.sync="box"
- width="345px">
- <el-tabs type="border-card">
- <el-tab-pane label="权限">
- <el-tree :data="menuGrantList"
- show-checkbox
- node-key="id"
- ref="treeMenu"
- :default-checked-keys="menuTreeObj"
- :props="props">
- </el-tree>
- </el-tab-pane>
- <!-- <el-tab-pane label="数据权限">
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" ref="crud" v-model="form"
+ :permission="permissionList" :before-open="beforeOpen" @row-del="rowDel" @row-update="rowUpdate"
+ @row-save="rowSave" @search-change="searchChange" @search-reset="searchReset"
+ @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+ @refresh-change="refreshChange" @on-load="onLoad">
+ <template slot="menuLeft">
+ <el-button type="danger" size="small" icon="el-icon-delete" v-if="permission.role_delete" plain
+ @click="handleDelete">删 除
+ </el-button>
+ <el-button size="small" icon="el-icon-setting" @click="handleRole"
+ v-if="userInfo.role_name.includes('admin')" plain>权限设置
+ </el-button>
+ </template>
+ </avue-crud>
+ <el-dialog title="角色权限配置" append-to-body :visible.sync="box" width="345px">
+ <el-tabs type="border-card">
+ <el-tab-pane label="权限">
+ <el-tree :data="menuGrantList" show-checkbox node-key="id" ref="treeMenu"
+ :default-checked-keys="menuTreeObj" :props="props">
+ </el-tree>
+ </el-tab-pane>
+ <!-- <el-tab-pane label="数据权限">
<el-tree :data="dataScopeGrantList"
show-checkbox
node-key="id"
@@ -65,316 +39,317 @@
:props="props">
</el-tree>
</el-tab-pane> -->
- </el-tabs>
+ </el-tabs>
- <span slot="footer"
- class="dialog-footer">
- <el-button @click="box = false">取 消</el-button>
- <el-button type="primary"
- @click="submit">确 定</el-button>
- </span>
- </el-dialog>
- </basic-container>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="box = false">取 消</el-button>
+ <el-button type="primary" @click="submit">确 定</el-button>
+ </span>
+ </el-dialog>
+ </basic-container>
</template>
<script>
- import {add, getList, getRoleList, getRole, getRoleTreeById, grant, grantTree, remove, update} from "@/api/system/role";
- import {mapGetters} from "vuex";
- import website from '@/config/website';
+import { add, getList, getRoleList, getRole, getRoleTreeById, grant, grantTree, remove, update } from "@/api/system/role"
+import { mapGetters } from "vuex"
+import website from '@/config/website'
- export default {
- data() {
- return {
- form: {},
- box: false,
- props: {
- label: "title",
- value: "key"
- },
- menuGrantList: [],
- dataScopeGrantList: [],
- apiScopeGrantList: [],
- apiGrantList: [],
- menuTreeObj: [],
- dataScopeTreeObj: [],
- apiScopeTreeObj: [],
- selectionList: [],
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- option: {
- tip: false,
- simplePage: true,
- searchShow: true,
- searchMenuSpan: 6,
- tree: true,
- border: true,
- index: true,
- selection: true,
- viewBtn: true,
- dialogWidth: 900,
- dialogClickModal: false,
- column: [
- {
- label: "角色名称",
- prop: "roleName",
- search: true,
- span: 24,
- rules: [
- {
- required: true,
- message: "请输入角色名称",
- trigger: "blur"
- }
- ]
+export default {
+ data () {
+ return {
+ form: {},
+ box: false,
+ props: {
+ label: "title",
+ value: "key"
},
- // {
- // label: "所属租户",
- // prop: "tenantId",
- // type: "tree",
- // dicUrl: "/api/blade-system/tenant/select",
- // addDisplay: false,
- // editDisplay: false,
- // viewDisplay: website.tenantMode,
- // span: 24,
- // props: {
- // label: "tenantName",
- // value: "tenantId"
- // },
- // hide: !website.tenantMode,
- // search: website.tenantMode,
- // rules: [{
- // required: true,
- // message: "请输入所属租户",
- // trigger: "click"
- // }]
- // },
- {
- label: "角色别名",
- prop: "roleAlias",
- search: true,
- span: 24,
- rules: [
- {
- required: true,
- message: "请输入角色别名",
- trigger: "blur"
- }
- ]
+ menuGrantList: [],
+ dataScopeGrantList: [],
+ apiScopeGrantList: [],
+ apiGrantList: [],
+ menuTreeObj: [],
+ dataScopeTreeObj: [],
+ apiScopeTreeObj: [],
+ selectionList: [],
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
},
- {
- label: "上级角色",
- prop: "parentId",
- dicData: [],
- type: "tree",
- hide: true,
- span: 24,
- props: {
- label: "title"
- },
- rules: [
- {
- required: false,
- message: "请选择上级角色",
- trigger: "click"
- }
- ]
+ option: {
+ lazy: true,
+ tip: false,
+ simplePage: true,
+ searchShow: true,
+ searchMenuSpan: 6,
+ tree: true,
+ border: true,
+ index: true,
+ selection: true,
+ viewBtn: true,
+ dialogWidth: 900,
+ dialogClickModal: false,
+ column: [
+ {
+ label: "角色名称",
+ prop: "roleName",
+ search: true,
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入角色名称",
+ trigger: "blur"
+ }
+ ]
+ },
+ // {
+ // label: "所属租户",
+ // prop: "tenantId",
+ // type: "tree",
+ // dicUrl: "/api/blade-system/tenant/select",
+ // addDisplay: false,
+ // editDisplay: false,
+ // viewDisplay: website.tenantMode,
+ // span: 24,
+ // props: {
+ // label: "tenantName",
+ // value: "tenantId"
+ // },
+ // hide: !website.tenantMode,
+ // search: website.tenantMode,
+ // rules: [{
+ // required: true,
+ // message: "请输入所属租户",
+ // trigger: "click"
+ // }]
+ // },
+ {
+ label: "角色别名",
+ prop: "roleAlias",
+ search: true,
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入角色别名",
+ trigger: "blur"
+ }
+ ]
+ },
+ {
+ label: "上级角色",
+ prop: "parentId",
+ type: "tree",
+ dicData: [],
+ addDisabled: false,
+ // hide: true,
+ span: 24,
+ props: {
+ label: "title",
+ value: 'id'
+ },
+ rules: [
+ {
+ required: false,
+ message: "请选择上级角色",
+ trigger: "click"
+ }
+ ]
+ },
+ {
+ label: "角色排序",
+ prop: "sort",
+ type: "number",
+ span: 24,
+ rules: [
+ {
+ required: true,
+ message: "请输入角色排序",
+ trigger: "blur"
+ }
+ ]
+ }
+ ]
},
- {
- label: "角色排序",
- prop: "sort",
- type: "number",
- span: 24,
- rules: [
- {
- required: true,
- message: "请输入角色排序",
- trigger: "blur"
- }
- ]
- }
- ]
- },
- data: []
- };
+ data: []
+ }
},
computed: {
- ...mapGetters(["userInfo", "permission"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.role_add, false),
- viewBtn: this.vaildData(this.permission.role_view, false),
- delBtn: this.vaildData(this.permission.role_delete, false),
- editBtn: this.vaildData(this.permission.role_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
+ ...mapGetters(["userInfo", "permission"]),
+ permissionList () {
+ return {
+ addBtn: this.vaildData(this.permission.role_add, false),
+ viewBtn: this.vaildData(this.permission.role_view, false),
+ delBtn: this.vaildData(this.permission.role_delete, false),
+ editBtn: this.vaildData(this.permission.role_edit, false)
+ }
+ },
+ ids () {
+ let ids = []
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id)
- });
- return ids.join(",");
- },
- idsArray() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids;
- }
+ })
+ return ids.join(",")
+ },
+ idsArray () {
+ let ids = []
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id)
+ })
+ return ids
+ }
},
methods: {
- initData(roleId){
- getRoleTreeById(roleId).then(res => {
- const column = this.findObject(this.option.column, "parentId");
- column.dicData = res.data.data;
- });
- },
- submit() {
- const menuList = this.$refs.treeMenu.getCheckedKeys();
- const dataScopeList = [];
- const apiScopeList = [];
- grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
- this.box = false;
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.onLoad(this.page);
- });
- },
- rowSave(row, done, loading) {
- add(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- window.console.log(error);
- loading();
- });
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
+ initData (roleId) {
+ getRoleTreeById(roleId).then(res => {
+ const column = this.findObject(this.option.column, "parentId")
+ column.dicData = res.data.data
+ })
+ },
+ submit () {
+ const menuList = this.$refs.treeMenu.getCheckedKeys()
+ const dataScopeList = []
+ const apiScopeList = []
+ grant(this.idsArray, menuList, dataScopeList, apiScopeList).then(() => {
+ this.box = false
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ this.onLoad(this.page)
+ })
+ },
+ rowSave (row, done, loading) {
+ add(row).then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ done()
+ }, error => {
+ window.console.log(error)
+ loading()
+ })
+ },
+ rowUpdate (row, index, done, loading) {
+ update(row).then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ done()
+ }, error => {
+ window.console.log(error)
+ loading()
+ })
+ },
+ rowDel (row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ })
+ },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- beforeOpen(done, type) {
- if (["add", "edit"].includes(type)) {
- this.initData(this.form.id);
+ searchReset () {
+ this.query = {}
+ this.onLoad(this.page)
+ },
+ searchChange (params, done) {
+ this.query = params
+ this.page.currentPage = 1
+ this.onLoad(this.page, params)
+ done()
+ },
+ selectionChange (list) {
+ this.selectionList = list
+ },
+ selectionClear () {
+ this.selectionList = []
+ this.$refs.crud.toggleSelection()
+ },
+ beforeOpen (done, type) {
+ if (["add", "edit"].includes(type)) {
+ this.initData(this.form.id)
+ }
+ done()
+ },
+ handleRole () {
+ if (this.selectionList.length !== 1) {
+ this.$message.warning("只能选择一条数据")
+ return
+ }
+ this.menuTreeObj = []
+ this.dataScopeTreeObj = []
+ this.apiScopeTreeObj = []
+ grantTree()
+ .then(res => {
+ this.menuGrantList = res.data.data.menu
+ // this.dataScopeGrantList = res.data.data.dataScope;
+ // this.apiScopeGrantList = res.data.data.apiScope;
+ getRole(this.ids).then(res => {
+ this.menuTreeObj = res.data.data.menu
+ // this.dataScopeTreeObj = res.data.data.dataScope;
+ // this.apiScopeTreeObj = res.data.data.apiScope;
+ this.box = true
+ })
+ })
+ },
+ handleDelete () {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据")
+ return
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ })
+ this.$refs.crud.toggleSelection()
+ })
+ },
+ currentChange (currentPage) {
+ this.page.currentPage = currentPage
+ },
+ sizeChange (pageSize) {
+ this.page.pageSize = pageSize
+ },
+ refreshChange () {
+ this.onLoad(this.page, this.query)
+ },
+ onLoad (page, params = {}) {
+ this.loading = true
+ getRoleList(Object.assign(params, this.query)).then(res => {
+ this.data = res.data.data
+ this.loading = false
+ this.selectionClear()
+ })
}
- done();
- },
- handleRole() {
- if (this.selectionList.length !== 1) {
- this.$message.warning("只能选择一条数据");
- return;
- }
- this.menuTreeObj = [];
- this.dataScopeTreeObj = [];
- this.apiScopeTreeObj = [];
- grantTree()
- .then(res => {
- this.menuGrantList = res.data.data.menu;
- // this.dataScopeGrantList = res.data.data.dataScope;
- // this.apiScopeGrantList = res.data.data.apiScope;
- getRole(this.ids).then(res => {
- this.menuTreeObj = res.data.data.menu;
- // this.dataScopeTreeObj = res.data.data.dataScope;
- // this.apiScopeTreeObj = res.data.data.apiScope;
- this.box = true;
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据");
- return;
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- currentChange(currentPage) {
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize) {
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- getRoleList(Object.assign(params, this.query)).then(res => {
- this.data = res.data.data;
- this.loading = false;
- this.selectionClear();
- });
- }
}
- };
+}
</script>
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 54b819b..726597f 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -1,8 +1,8 @@
<template>
<div id="homeL">
<div class="homeL-up">
- <span class="h1">基层智治综合协同平台</span>
- <span class="h2">Grassroots intelligent governance integrated cooperation platform</span>
+ <span class="h1">{{ webTitle }}</span>
+ <span class="h2"></span>
</div>
<div class="homeL-bar">
<div class="outS" @click="down1">
@@ -35,10 +35,13 @@
export default {
data () {
return {
+ webTitle: getStore({ name: "webTitle" }),
+ webType: getStore({ name: "webType" }),
a: 1,
globalUserInfo: getStore({ name: "userInfo" }),
}
},
+
methods: {
down1 () {
this.$router.push({ path: "/userHouse/houseHoldList" })
--
Gitblit v1.9.3