Commit 2badd452 by liimin

仓库迁移

1 parent 9ca5b2bf
Showing 117 changed files with 1762 additions and 470 deletions
> 1% > 1%
last 2 versions last 3 versions
not ie <= 8
chrome >= 14
safari >= 3
not dead not dead
# 首次登录时默认跳转的微应用入口
VUE_APP_PORT = 6650 VUE_APP_PORT = 6650
# 是否mock数据(用于本地开发) 1:是 0: 否
VUE_APP_MOCK = 1
# MOCK 地址
VUE_APP_MOCK_URL = http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/base/permission
\ No newline at end of file \ No newline at end of file
# 首次登录时默认跳转的微应用入口
VUE_APP_PORT = 6650
\ No newline at end of file \ No newline at end of file
VUE_APP_CHILD_PATH = /child
VUE_APP_CONFIG_SWITCH_LOCAL = 0
VUE_APP_MOCK = 0
# MOCK 地址
VUE_APP_MOCK_URL = http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/base/permission_dev
\ No newline at end of file \ No newline at end of file
{ {
"name": "main", "name": "scrm-base",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
...@@ -9,13 +9,17 @@ ...@@ -9,13 +9,17 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"@sentry/tracing": "^7.7.0",
"@sentry/vue": "^7.7.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"glsx-common": "^1.4.4", "glsx-common": "^2.0.0-beta",
"gltracker": "^0.1.3",
"md5": "^2.3.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"qiankun": "^2.5.0", "qiankun": "^2.7.4",
"vue": "^2.6.11", "vue": "2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.5.3",
"vuex": "^3.4.0" "vuex": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
...@@ -25,7 +29,7 @@ ...@@ -25,7 +29,7 @@
"@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0", "@vue/cli-service": "~4.5.0",
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "^6.0.0",
"autoprefixer": "^10.2.5", "autoprefixer": "^8.0.0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",
...@@ -33,9 +37,11 @@ ...@@ -33,9 +37,11 @@
"lint-staged": "^9.5.0", "lint-staged": "^9.5.0",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"postcss": "^8.2.8", "postcss": "^8.2.8",
"postcss-loader": "^6.2.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11", "vue-template-compiler": "2.6.11",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-spritesmith": "^1.1.0" "webpack-spritesmith": "^1.1.0"
}, },
"gitHooks": { "gitHooks": {
......
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-10-21 16:11:15
* @LastEditors: limin
* @LastEditTime: 2021-10-21 16:11:18
* @FilePath: \scrm\scrm-base\postcss.config.js
*/
module.exports = {
plugins: {
autoprefixer: {}
}
}
No preview for this file type
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico" /> -->
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<head> <body>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>
<%= htmlWebpackPlugin.options.title %>
</title>
</head>
<body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
Please enable it to continue.</strong>
</noscript> </noscript>
<div id="main"></div> <div id="main"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html> </html>
var express = require('express')
var history = require('connect-history-api-fallback')
var cors = require('cors')
var app = express()
app.use(history())
app.use(cors())
app.use(express.static('./dist'))
app.get('/', function (req, res) {
res.send('Hello jq')
})
const port = 6650
app.listen(port)
console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
<template> <template>
<div class="scrm-base-entry">
<div id="main"> <div id="main">
<!-- {{ app.isLoading }} -->
<router-view></router-view> <router-view></router-view>
<!-- <div class="el-loading-mask scrm-base-app-loading" v-if="app.isLoading" style="background-color: rgba(0, 0, 0, 0)"> </div>
<div class="el-loading-mask" v-show="app.isLoading" style="background-color: rgba(0, 0, 0, 0.1)">
<div class="el-loading-spinner"> <div class="el-loading-spinner">
<i class="el-icon-loading"></i> <i class="el-icon-loading"></i>
<p class="el-loading-text">拼命加载中</p>
</div> </div>
</div> --> </div>
<!-- <div v-show="app.isLoadFaild" class="load-faild">加载失败,请检查服务是否开启</div> -->
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { helper } from '@/common'
export default { export default {
computed: { computed: {
...mapGetters(['app']) ...mapGetters(['app'])
},
mounted() {
this.customized()
},
methods: {
customized() {
const { cdn, customized } = this.$config
helper.customized(cdn, customized)
}
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '~@/assets/style/variables.scss'; @import '~@/assets/style/mixins.scss';
// 统一边距 begin
#app {
background-color: transparent !important;
padding: 16px $left !important;
margin: 0 !important;
position: relative !important;
}
// 统一边距 end
html { html {
margin: 0; margin: 0;
padding: 0; padding: 0;
...@@ -31,20 +50,58 @@ html { ...@@ -31,20 +50,58 @@ html {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 6 -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 6
height: 100%; height: 100%;
max-height: 100%; max-height: 100%;
// overflow-x: hidden;
// overflow-y: auto;
} }
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%; height: 100vh;
max-height: 100%; width: 100vw;
overflow: auto;
padding-left: calc(100vw - 100%);
font-size: 14px; font-size: 14px;
font-family: 'Microsoft YaHei', '微软雅黑', 'MicrosoftJhengHei', 'STHeiti', 'MingLiu'; font-family: $font-family;
@include hideScroll;
}
button,
button > span {
font-family: $font-family !important;
}
.footer {
box-shadow: 20px 10px 20px 10px rgba(88, 80, 255, 0.1);
} }
#main { .scrm-base-entry {
height: 100%;
.load-faild {
text-align: center;
color: #999;
position: absolute;
z-index: 1;
top: 80px;
left: 0;
right: 0;
pointer-events: none;
}
#main {
height: 100%; height: 100%;
// font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
background-color: $main-background-color; }
.el-loading-spinner {
i,
.el-loading-text {
color: $main-color;
font-size: 26px;
margin-left: $menu-width;
}
.circular {
height: 26px;
width: 26px;
.path {
stroke: $main-color;
}
}
}
} }
</style> </style>
...@@ -3,9 +3,20 @@ const login = data => { ...@@ -3,9 +3,20 @@ const login = data => {
data.method = 'scrm.api.sso.user.loginCode' data.method = 'scrm.api.sso.user.loginCode'
return http({ data, returnAll: true }) return http({ data, returnAll: true })
} }
const choose = data => {
data.method = 'scrm.api.sso.user.login.select'
return http({ data, returnAll: true })
}
const exchange = data => {
data.method = 'scrm.api.sso.user.login.change'
return http({ data, returnAll: true })
}
const permission = data => { const permission = data => {
data.method = 'scrm.api.sso.user.permission.get' data.method = 'scrm.api.sso.user.permission.get'
return http({ data }) if (+process.env.VUE_APP_MOCK) {
return http({ url: process.env.VUE_APP_MOCK_URL, method: 'GET', returnAll: true })
}
return http({ data, returnAll: true })
} }
const code = data => { const code = data => {
data.method = 'scrm.api.sso.user.login.getVerifyCode' data.method = 'scrm.api.sso.user.login.getVerifyCode'
...@@ -15,10 +26,16 @@ const logout = data => { ...@@ -15,10 +26,16 @@ const logout = data => {
data.method = 'scrm.api.sso.user.logout' data.method = 'scrm.api.sso.user.logout'
return http({ data }) return http({ data })
} }
const updatePassword = data => {
data.method = 'scrm.api.sso.user.updatePassword'
return http({ data, returnAll: true })
}
export default { export default {
login, login,
logout, logout,
choose,
exchange,
permission, permission,
code code,
updatePassword
} }

582 Bytes | W: | H:

264 Bytes | W: | H:

src/assets/images/icons/custom-active.png
src/assets/images/icons/custom-active.png
src/assets/images/icons/custom-active.png
src/assets/images/icons/custom-active.png
  • 2-up
  • Swipe
  • Onion skin

560 Bytes | W: | H:

264 Bytes | W: | H:

src/assets/images/icons/custom.png
src/assets/images/icons/custom.png
src/assets/images/icons/custom.png
src/assets/images/icons/custom.png
  • 2-up
  • Swipe
  • Onion skin

348 Bytes | W: | H:

169 Bytes | W: | H:

src/assets/images/icons/dataview-active.png
src/assets/images/icons/dataview-active.png
src/assets/images/icons/dataview-active.png
src/assets/images/icons/dataview-active.png
  • 2-up
  • Swipe
  • Onion skin

321 Bytes | W: | H:

169 Bytes | W: | H:

src/assets/images/icons/dataview.png
src/assets/images/icons/dataview.png
src/assets/images/icons/dataview.png
src/assets/images/icons/dataview.png
  • 2-up
  • Swipe
  • Onion skin

561 Bytes | W: | H:

299 Bytes | W: | H:

src/assets/images/icons/finance-active.png
src/assets/images/icons/finance-active.png
src/assets/images/icons/finance-active.png
src/assets/images/icons/finance-active.png
  • 2-up
  • Swipe
  • Onion skin

565 Bytes | W: | H:

299 Bytes | W: | H:

src/assets/images/icons/finance.png
src/assets/images/icons/finance.png
src/assets/images/icons/finance.png
src/assets/images/icons/finance.png
  • 2-up
  • Swipe
  • Onion skin

466 Bytes | W: | H:

380 Bytes | W: | H:

src/assets/images/icons/home-active.png
src/assets/images/icons/home-active.png
src/assets/images/icons/home-active.png
src/assets/images/icons/home-active.png
  • 2-up
  • Swipe
  • Onion skin

452 Bytes | W: | H:

376 Bytes | W: | H:

src/assets/images/icons/home.png
src/assets/images/icons/home.png
src/assets/images/icons/home.png
src/assets/images/icons/home.png
  • 2-up
  • Swipe
  • Onion skin

587 Bytes | W: | H:

352 Bytes | W: | H:

src/assets/images/icons/settings-active.png
src/assets/images/icons/settings-active.png
src/assets/images/icons/settings-active.png
src/assets/images/icons/settings-active.png
  • 2-up
  • Swipe
  • Onion skin

585 Bytes | W: | H:

353 Bytes | W: | H:

src/assets/images/icons/settings.png
src/assets/images/icons/settings.png
src/assets/images/icons/settings.png
src/assets/images/icons/settings.png
  • 2-up
  • Swipe
  • Onion skin
.i { display: inline-block; vertical-align: middle; background-image: url(./sprite.png) } .i { display: inline-block; vertical-align: middle; background-image: url(./sprite.png) }
.i-conversion-active { width: 14px; height: 16px; background-position: -52px -82px; }
.i-conversion { width: 14px; height: 16px; background-position: -76px -82px; }
.i-custom-active { width: 16px; height: 16px; background-position: 0px -30px; }
.i-custom { width: 16px; height: 16px; background-position: -26px -30px; }
.i-dataview-active { width: 16px; height: 14px; background-position: -112px 0px; }
.i-dataview { width: 16px; height: 14px; background-position: -112px -24px; }
.i-finance-active { width: 16px; height: 16px; background-position: -60px 0px; }
.i-finance { width: 16px; height: 16px; background-position: -60px -26px; }
.i-home-active { width: 16px; height: 16px; background-position: 0px -56px; }
.i-home { width: 16px; height: 16px; background-position: -26px -56px; }
.i-increase-active { width: 16px; height: 16px; background-position: -52px -56px; }
.i-increase { width: 16px; height: 16px; background-position: -86px 0px; }
.i-password { width: 20px; height: 20px; background-position: 0px 0px; }
.i-settings-active { width: 16px; height: 16px; background-position: -86px -26px; }
.i-settings { width: 16px; height: 16px; background-position: -86px -52px; }
.i-tactics-active { width: 16px; height: 16px; background-position: 0px -82px; }
.i-tactics { width: 16px; height: 16px; background-position: -26px -82px; }
.i-user { width: 20px; height: 20px; background-position: -30px 0px; }
\ No newline at end of file \ No newline at end of file
.i-activity-active { width: 20px; height: 20px; background-position: -30px -42px; }
.i-activity { width: 20px; height: 20px; background-position: -60px -42px; }
.i-activityCenter-active { width: 20px; height: 21px; background-position: -42px 0px; }
.i-activityCenter { width: 20px; height: 20px; background-position: -102px 0px; }
.i-arrow-down { width: 20px; height: 20px; background-position: -102px -30px; }
.i-authorize-active { width: 20px; height: 20px; background-position: 0px -73px; }
.i-authorize { width: 20px; height: 20px; background-position: -30px -73px; }
.i-avatar { width: 32px; height: 32px; background-position: 0px 0px; }
.i-back { width: 10px; height: 10px; background-position: -222px -160px; }
.i-checked { width: 20px; height: 20px; background-position: -60px -73px; }
.i-contact { width: 16px; height: 16px; background-position: -222px -60px; }
.i-custom-active { width: 20px; height: 20px; background-position: -90px -73px; }
.i-custom { width: 20px; height: 20px; background-position: -132px 0px; }
.i-dataview-active { width: 20px; height: 20px; background-position: -132px -30px; }
.i-dataview { width: 20px; height: 20px; background-position: -132px -60px; }
.i-dot { width: 12px; height: 12px; background-position: -222px -138px; }
.i-drainage-active { width: 20px; height: 20px; background-position: 0px -103px; }
.i-drainage { width: 20px; height: 20px; background-position: -30px -103px; }
.i-edit-active { width: 20px; height: 20px; background-position: -60px -103px; }
.i-edit { width: 20px; height: 20px; background-position: -90px -103px; }
.i-equity-active { width: 20px; height: 20px; background-position: -120px -103px; }
.i-equity { width: 20px; height: 20px; background-position: -162px 0px; }
.i-exchange-active { width: 20px; height: 20px; background-position: -162px -30px; }
.i-exchange-disabled { width: 20px; height: 20px; background-position: -162px -60px; }
.i-exchange { width: 20px; height: 20px; background-position: -162px -90px; }
.i-finance-active { width: 20px; height: 20px; background-position: 0px -133px; }
.i-finance { width: 20px; height: 20px; background-position: -30px -133px; }
.i-home-active { width: 20px; height: 20px; background-position: -60px -133px; }
.i-home { width: 20px; height: 20px; background-position: -90px -133px; }
.i-left { width: 10px; height: 9px; background-position: 0px -193px; }
.i-live-active { width: 20px; height: 20px; background-position: -120px -133px; }
.i-live { width: 20px; height: 20px; background-position: -150px -133px; }
.i-logoff-active { width: 20px; height: 20px; background-position: -192px 0px; }
.i-logoff { width: 20px; height: 20px; background-position: -192px -30px; }
.i-marketing-active { width: 20px; height: 20px; background-position: -192px -60px; }
.i-marketing { width: 20px; height: 20px; background-position: -192px -90px; }
.i-message-active { width: 16px; height: 16px; background-position: -222px -86px; }
.i-message { width: 16px; height: 16px; background-position: -222px -112px; }
.i-outbound-active { width: 20px; height: 21px; background-position: -72px 0px; }
.i-outbound { width: 20px; height: 20px; background-position: -192px -120px; }
.i-password { width: 20px; height: 20px; background-position: 0px -163px; }
.i-provider-active { width: 20px; height: 21px; background-position: 0px -42px; }
.i-provider { width: 20px; height: 20px; background-position: -30px -163px; }
.i-right { width: 8px; height: 8px; background-position: -20px -193px; }
.i-salepre-active { width: 20px; height: 20px; background-position: -60px -163px; }
.i-salepre { width: 20px; height: 20px; background-position: -90px -163px; }
.i-services-active { width: 20px; height: 20px; background-position: -120px -163px; }
.i-services { width: 20px; height: 20px; background-position: -150px -163px; }
.i-settings-active { width: 20px; height: 20px; background-position: -180px -163px; }
.i-settings { width: 20px; height: 20px; background-position: -222px 0px; }
.i-user { width: 20px; height: 20px; background-position: -222px -30px; }
\ No newline at end of file \ No newline at end of file

6.33 KB | W: | H:

22.6 KB | W: | H:

src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
src/assets/images/sprite/sprite.png
  • 2-up
  • Swipe
  • Onion skin
@charset "UTF-8"; /*!
* animate.css - https://animate.style/
* Version - 4.1.1
* Licensed under the MIT license - http://opensource.org/licenses/MIT
*
* Copyright (c) 2020 Animate.css
*/
:root {
--animate-duration: 0.3s;
--animate-delay: 0.3s;
--animate-repeat: 1;
}
.animate__animated {
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-duration: var(--animate-duration);
animation-duration: var(--animate-duration);
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.animate__animated.animate__infinite {
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
.animate__animated.animate__repeat-1 {
-webkit-animation-iteration-count: 1;
animation-iteration-count: 1;
-webkit-animation-iteration-count: var(--animate-repeat);
animation-iteration-count: var(--animate-repeat);
}
.animate__animated.animate__repeat-2 {
-webkit-animation-iteration-count: calc(1 * 2);
animation-iteration-count: calc(1 * 2);
-webkit-animation-iteration-count: calc(var(--animate-repeat) * 2);
animation-iteration-count: calc(var(--animate-repeat) * 2);
}
.animate__animated.animate__repeat-3 {
-webkit-animation-iteration-count: calc(1 * 3);
animation-iteration-count: calc(1 * 3);
-webkit-animation-iteration-count: calc(var(--animate-repeat) * 3);
animation-iteration-count: calc(var(--animate-repeat) * 3);
}
.animate__animated.animate__delay-1s {
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
-webkit-animation-delay: var(--animate-delay);
animation-delay: var(--animate-delay);
}
.animate__animated.animate__delay-2s {
-webkit-animation-delay: calc(1s * 2);
animation-delay: calc(1s * 2);
-webkit-animation-delay: calc(var(--animate-delay) * 2);
animation-delay: calc(var(--animate-delay) * 2);
}
.animate__animated.animate__delay-3s {
-webkit-animation-delay: calc(1s * 3);
animation-delay: calc(1s * 3);
-webkit-animation-delay: calc(var(--animate-delay) * 3);
animation-delay: calc(var(--animate-delay) * 3);
}
.animate__animated.animate__delay-4s {
-webkit-animation-delay: calc(1s * 4);
animation-delay: calc(1s * 4);
-webkit-animation-delay: calc(var(--animate-delay) * 4);
animation-delay: calc(var(--animate-delay) * 4);
}
.animate__animated.animate__delay-5s {
-webkit-animation-delay: calc(1s * 5);
animation-delay: calc(1s * 5);
-webkit-animation-delay: calc(var(--animate-delay) * 5);
animation-delay: calc(var(--animate-delay) * 5);
}
.animate__animated.animate__delay-.5s {
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
.animate__animated.animate__faster {
-webkit-animation-duration: calc(1s / 2);
animation-duration: calc(1s / 2);
-webkit-animation-duration: calc(var(--animate-duration) / 2);
animation-duration: calc(var(--animate-duration) / 2);
}
.animate__animated.animate__fast {
-webkit-animation-duration: calc(1s * 0.8);
animation-duration: calc(1s * 0.8);
-webkit-animation-duration: calc(var(--animate-duration) * 0.8);
animation-duration: calc(var(--animate-duration) * 0.8);
}
.animate__animated.animate__slow {
-webkit-animation-duration: calc(1s * 2);
animation-duration: calc(1s * 2);
-webkit-animation-duration: calc(var(--animate-duration) * 2);
animation-duration: calc(var(--animate-duration) * 2);
}
.animate__animated.animate__slower {
-webkit-animation-duration: calc(1s * 3);
animation-duration: calc(1s * 3);
-webkit-animation-duration: calc(var(--animate-duration) * 3);
animation-duration: calc(var(--animate-duration) * 3);
}
@media print, (prefers-reduced-motion: reduce) {
.animate__animated {
-webkit-animation-duration: 1ms !important;
animation-duration: 1ms !important;
-webkit-transition-duration: 1ms !important;
transition-duration: 1ms !important;
-webkit-animation-iteration-count: 1 !important;
animation-iteration-count: 1 !important;
}
.animate__animated[class*='Out'] {
opacity: 0;
}
}
@keyframes tada {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
10%,
20% {
-webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
}
30%,
50%,
70%,
90% {
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
}
40%,
60%,
80% {
-webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
.animate__tada {
-webkit-animation-name: tada;
animation-name: tada;
}
@keyframes shakeX {
from,
to {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
10%,
30%,
50%,
70%,
90% {
-webkit-transform: translate3d(-10px, 0, 0);
transform: translate3d(-10px, 0, 0);
}
20%,
40%,
60%,
80% {
-webkit-transform: translate3d(10px, 0, 0);
transform: translate3d(10px, 0, 0);
}
}
.animate__shakeX {
-webkit-animation-name: shakeX;
animation-name: shakeX;
}
@keyframes headShake {
0% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
6.5% {
-webkit-transform: translateX(-6px) rotateY(-9deg);
transform: translateX(-6px) rotateY(-9deg);
}
18.5% {
-webkit-transform: translateX(5px) rotateY(7deg);
transform: translateX(5px) rotateY(7deg);
}
31.5% {
-webkit-transform: translateX(-3px) rotateY(-5deg);
transform: translateX(-3px) rotateY(-5deg);
}
43.5% {
-webkit-transform: translateX(2px) rotateY(3deg);
transform: translateX(2px) rotateY(3deg);
}
50% {
-webkit-transform: translateX(0);
transform: translateX(0);
}
}
.animate__headShake {
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
-webkit-animation-name: headShake;
animation-name: headShake;
}
@keyframes fadeInDown {
from {
opacity: 0;
-webkit-transform: translate3d(0, -100%, 0);
transform: translate3d(0, -100%, 0);
}
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.animate__fadeInDown {
-webkit-animation-name: fadeInDown;
animation-name: fadeInDown;
}
@keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.animate__fadeInUp {
-webkit-animation-name: fadeInUp;
animation-name: fadeInUp;
}
@keyframes fadeInRight {
from {
opacity: 0;
-webkit-transform: translate3d(100%, 0, 0);
transform: translate3d(100%, 0, 0);
}
to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}
.animate__fadeInRight {
-webkit-animation-name: fadeInRight;
animation-name: fadeInRight;
}
@keyframes pulse {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
50% {
-webkit-transform: scale3d(1.05, 1.05, 1.05);
transform: scale3d(1.05, 1.05, 1.05);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
.animate__pulse {
-webkit-animation-name: pulse;
animation-name: pulse;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function: ease-in-out;
}
@keyframes bounceIn {
from,
20%,
40%,
60%,
80%,
to {
-webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}
0% {
opacity: 0;
-webkit-transform: scale3d(0.3, 0.3, 0.3);
transform: scale3d(0.3, 0.3, 0.3);
}
20% {
-webkit-transform: scale3d(1.1, 1.1, 1.1);
transform: scale3d(1.1, 1.1, 1.1);
}
40% {
-webkit-transform: scale3d(0.9, 0.9, 0.9);
transform: scale3d(0.9, 0.9, 0.9);
}
60% {
opacity: 1;
-webkit-transform: scale3d(1.03, 1.03, 1.03);
transform: scale3d(1.03, 1.03, 1.03);
}
80% {
-webkit-transform: scale3d(0.97, 0.97, 0.97);
transform: scale3d(0.97, 0.97, 0.97);
}
to {
opacity: 1;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
.animate__bounceIn {
-webkit-animation-duration: calc(1s * 0.75);
animation-duration: calc(1s * 0.75);
-webkit-animation-duration: calc(var(--animate-duration) * 0.75);
animation-duration: calc(var(--animate-duration) * 0.75);
-webkit-animation-name: bounceIn;
animation-name: bounceIn;
}
@keyframes fadeOutDown {
0% {
opacity: 1;
-webkit-transform: translateY(0);
-ms-transform: translateY(0);
transform: translateY(0);
}
100% {
opacity: 0;
-webkit-transform: translateY(20px);
-ms-transform: translateY(20px);
transform: translateY(20px);
}
}
.animate__fadeOutDown {
-webkit-animation-name: fadeOutDown;
animation-name: fadeOutDown;
}
.menu-collapse {
.scrm-base-submenu {
/deep/.el-submenu {
&__title {
margin: 0;
& > span {
display: none;
}
}
&.is-opened {
margin-bottom: $menu-item-mb;
}
}
.el-menu-item {
&.is-menu {
& > span {
display: none;
}
}
}
}
.base-container {
&-aside {
flex: 0 0 $menu-width-collapse;
}
}
.side-bar-menu-left {
max-width: $menu-width-collapse;
}
}
/deep/.el-menu--collapse {
width: $menu-width-collapse !important;
}
@import 'reset.css'; @import 'reset.css';
@import 'variables'; @import 'variables';
@import 'animate.css';
$prefix: paas !default; $prefix: paas !default;
@font-face {
html { font-family: 'PingFangSC-Regular';
margin: 0; src: url('https://img02.glsx.com.cn/weapp/resource/saas/scrm/fonts/PingFang-Regular.ttf');
padding: 0;
font-size: 625%;
-webkit-text-size-adjust: 100%; // 4
-ms-text-size-adjust: 100%; // 4
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); // 6
height: 100%;
max-height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
body {
margin: 0;
padding: 0;
height: 100vh;
width: 100vw;
overflow: auto;
padding-left: calc(100vw - 100%);
font-size: 14px;
font-family: 'Microsoft YaHei', '微软雅黑', 'MicrosoftJhengHei', 'STHeiti', 'MingLiu';
color: #303133;
-ms-overflow-style: none;
scrollbar-width: none;
} }
body::-webkit-scrollbar { #nprogress .bar {
display: none; background: $main-color !important;
height: 1px;
} }
a { a {
text-decoration: none; text-decoration: none;
......
@mixin hideScroll {
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
display: none;
}
}
@mixin leftpadding {
padding: 0 $left;
}
// 头部样式变量 // 头部样式变量
$header-height: 60px; $header-height: 48px;
$header-background: #a3b6c6; $header-background: #a3b6c6;
$header-color: #fff; $header-color: #fff;
$header-padding: 15px; $header-padding: 15px;
$logo-height: 133px;
// 左侧菜单样式变量 // 左侧菜单样式变量
$menu-background: #2a3f54; $menu-background: #2a3f54;
$menu-color: #fff; $menu-color: #fff;
$menu-active-color: #fff; $menu-active-color: #fff;
// 主视图区样式变量 // 主视图区样式变量
$main-background-color: #f4f5fa; $main-background-color: #f0f1f7;
$main-color: #5f5efb; $main-color: #5f5efb;
$menu-width: 194px; $menu-width: 208px;
$menu-width-collapse: 80px;
$base-border: #5f5efb; $base-border: #5f5efb;
$font-family: 'PingFangSC-Regular', 'Microsoft YaHei', '微软雅黑', 'MicrosoftJhengHei', 'STHeiti', 'MingLiu';
$min-width: 1280px;
$left: 24px;
$right-min-width: calc(#{$min-width} - #{$menu-width} - #{$left} - 2px);
$menu-item-mb: 20px;
module.exports = { module.exports = {
// 头部样式变量 // 头部样式变量
header_height: '60px', // header_height: '60px',
header_background: `#ededed`, // header_background: `#ededed`,
header_color: `#2a3f54`, // header_color: `#2a3f54`,
header_padding: `15px`, // header_padding: `15px`,
// // 左侧菜单样式变量
// menu_background: `#4d6987`,
// menu_color: `#fff`,
// menu_active_color: `#ffd04b`,
// // 主视图区样式变量
// main_base_color: `#f2f3f3`,
// main_body_padding: '8px',
// space_n: '8px',
// space_s: '10px',
// space_m: '12px',
// space_l: '15px',
// border_color_eee: '#EBEEF5'
// 头部样式变量
header_height: '48px',
header_background: '#a3b6c6',
header_color: '#fff',
header_padding: '15px',
logo_height: '133px',
// 左侧菜单样式变量 // 左侧菜单样式变量
menu_background: `#4d6987`, menu_background: '#2a3f54',
menu_color: `#fff`, menu_color: '#fff',
menu_active_color: `#ffd04b`, menu_active_color: '#fff',
// 主视图区样式变量 // 主视图区样式变量
main_base_color: `#f2f3f3`, main_background_color: '#f0f1f7',
main_body_padding: '8px', main_color: '#5f5efb',
space_n: '8px', menu_width: '208px',
space_s: '10px', menu_width_collapse: '80px',
space_m: '12px', base_border: '#5f5efb',
space_l: '15px', font_family: `'PingFangSC-Regular', 'Microsoft YaHei', '微软雅黑', 'MicrosoftJhengHei', 'STHeiti', 'MingLiu'`,
border_color_eee: '#EBEEF5' min_width: '1280px',
left: '24px',
right_min_width: `calc(#{$min-width} - #{$menu-width} - #{$left} - 2px)`,
menu_item_mb: '20px'
} }
...@@ -4,11 +4,30 @@ ...@@ -4,11 +4,30 @@
* @Author: limin * @Author: limin
* @Date: 2021-09-18 09:35:02 * @Date: 2021-09-18 09:35:02
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-09-18 18:07:07 * @LastEditTime: 2022-07-21 09:56:39
* @FilePath: \scrm\scrm-base\src\common\constants.js * @FilePath: \scrm\scrm-base\src\common\constants.js
*/ */
export default { export default {
SCRM_BASE_CURRENTPAGE: 'SCRM_BASE_CURRENTPAGE', SCRM_BASE_SESSION: 'SCRM_BASE_SESSION',
SCRM_BASE_SESSIONINFO: 'SCRM_BASE_SESSIONINFO', SCRM_BASE_MENULIST: 'SCRM_BASE_MENULIST',
SCRM_BASE_MENULIST: 'SCRM_BASE_MENULIST' SCRM_BASE_FUNCTIONAL_FLAG: 'function',
SCRM_BASE_USERTYPE: {
MERCHANT: '1',
EMPLOYEE: '2'
},
SCRM_BASE_ERRORS: {
NO_PERMISSION_MENUS: {
CODE: '100',
MESSAGE: '您的账户暂无任何功能权限,请联系管理员开通'
},
ILLEGAL_ROUTER_NO_THIRD_ROUTE: {
CODE: '101',
MESSAGE: '未分配任何子菜单'
}
},
ICONS: (() => {
const iconFiles = require.context('../assets/images/icons', true, /\.png$/)
return iconFiles.keys().map(iconPath => iconPath.replace(/^\.\/(.*)\.\w+$/, '$1'))
})(),
DEFAULT_ICON_NAME: 'dataview'
} }
...@@ -2,18 +2,14 @@ ...@@ -2,18 +2,14 @@
* @Descripttion: * @Descripttion:
* @version: 1.0.0 * @version: 1.0.0
* @Author: limin * @Author: limin
* @Date: 2021-08-13 14:12:11 * @Date: 2021-11-26 09:33:28
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-08-25 14:46:12 * @LastEditTime: 2022-07-22 20:40:43
* @FilePath: \scrm\scrm-base\src\util\childEmit.js * @FilePath: \scrm\scrm-base\src\common\error-handler.js
*/
/**
* des:主应用传递给子应用的 用于emit触发主应用事件的函数
*/ */
import store from '@/store' import store from '@/store'
// 系统错误捕获
function changeDataMsg(val) { function errorHandler() {
store.dispatch('send-data/changeMsg', val) store.dispatch('app/setLoading', false)
} }
window.onerror = errorHandler
export { changeDataMsg }
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2022-03-25 09:54:08
* @LastEditors: limin
* @LastEditTime: 2022-07-21 10:02:42
* @FilePath: \scrm\scrm-base\src\common\helper.js
*/
import constants from './constants'
export function customized(cdn, { assets, title }) {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link')
link.type = 'image/x-icon'
link.rel = 'shortcut icon'
link.href = `${cdn}/assets/${assets}/favicon.ico`
document.getElementsByTagName('head')[0].appendChild(link)
document.title = title
}
export function getIcon(iconName) {
const { ICONS, DEFAULT_ICON_NAME } = constants
return ICONS.includes(iconName) && ICONS.includes(iconName + '-active') ? iconName : DEFAULT_ICON_NAME
}
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
* @Author: limin * @Author: limin
* @Date: 2021-09-18 09:35:59 * @Date: 2021-09-18 09:35:59
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-09-18 09:37:02 * @LastEditTime: 2022-03-25 11:24:13
* @FilePath: \scrm\scrm-base\src\common\index.js * @FilePath: \scrm-base\src\common\index.js
*/ */
import constants from './constants' import constants from './constants'
export { constants } import * as helper from './helper'
export { constants, helper }
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-11-22 19:08:41
* @LastEditors: limin
* @LastEditTime: 2021-11-22 19:29:48
* @FilePath: \scrm\scrm-base\src\common\reg-prototype.js
*/
Array.prototype.noHidden = function () {
return this.filter(item => !item.hidden)
}
import GLDialogURL from './index.vue'
GLDialogURL.install = function (Vue) {
Vue.component(GLDialogURL.name, GLDialogURL)
}
export default GLDialogURL
<template>
<el-dialog title="" :visible.sync="visible" width="1000px" height="600px" :before-close="handleClose">
<iframe src="https://img02.glsx.com.cn/doc/privacy.html" frameborder="0" width="1000px" height="600px"></iframe>
<span slot="footer" class="dialog-footer"></span>
</el-dialog>
</template>
<script>
export default {
name: 'GLDialogURL',
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {}
},
methods: {
handleClose() {
this.$emit('update:visible', false)
}
}
}
</script>
<style></style>
...@@ -12,9 +12,23 @@ export default { ...@@ -12,9 +12,23 @@ export default {
<style lang="scss"> <style lang="scss">
.gl-scroll { .gl-scroll {
flex: 1; // flex: 1;
> .el-scrollbar__wrap { > .el-scrollbar__wrap {
overflow-x: hidden; overflow-x: hidden;
margin-bottom: 0 !important ;
}
> .el-scrollbar__bar {
z-index: 10;
&.is-vertical {
width: 6px;
}
&.is-horizontal {
height: 6px !important;
left: 0 !important;
}
/deep/ .el-scrollbar__thumb {
background-color: rgba(144, 147, 153, 0.6);
}
} }
} }
</style> </style>
import Vue from 'vue' import Vue from 'vue'
import GLContainer from './GLContainer' import GLContainer from './GLContainer'
import GLContextmenu from './GLContextmenu' import GLContextmenu from './GLContextmenu'
import GLFadein from './GLFadein' // import GLFadein from './GLFadein'
import GLScroll from './GLScroll' import GLScroll from './GLScroll'
// import GLDialogURL from './GLDialogURL'
const components = [GLContainer, GLContextmenu, GLFadein, GLScroll] // const components = [GLContainer, GLContextmenu, GLFadein, GLScroll, GLDialogURL]
const components = [GLContainer, GLContextmenu, GLScroll]
const install = function (Vue) { const install = function (Vue) {
components.forEach(component => { components.forEach(component => {
...@@ -19,6 +21,7 @@ Vue.use({ ...@@ -19,6 +21,7 @@ Vue.use({
install, install,
GLContainer, GLContainer,
GLContextmenu, GLContextmenu,
GLFadein, // GLFadein,
GLScroll GLScroll
// GLDialogURL
}) })
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-10-08 09:33:51 * @LastEditTime: 2022-01-13 14:05:08
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
...@@ -30,13 +30,12 @@ module.exports = { ...@@ -30,13 +30,12 @@ module.exports = {
appKey: '48e5e13229b82c1b4e6e8c96151f0637', appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0', v: '1.0.0',
format: 'json', format: 'json',
source: 'scrm-base' source: 'scrm'
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static', cdn: 'https://www.xxx.cn/static',
productCode: 'PC0001', productCode: 'PC0001',
loginSource: 'SCRM'
defaultPath: '/home/home/index'
} }
...@@ -27,6 +27,5 @@ module.exports = { ...@@ -27,6 +27,5 @@ module.exports = {
cdn: 'https://www.xxx.cn/static', cdn: 'https://www.xxx.cn/static',
productCode: 'PC0001', productCode: 'PC0001',
//默认打开页面 loginSource: 'SCRM'
defaultPath: '/home/home/index'
} }
...@@ -4,23 +4,24 @@ ...@@ -4,23 +4,24 @@
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-10-06 09:27:23 * @LastEditTime: 2022-11-04 10:22:15
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 const sw = !!+process.env.VUE_APP_CONFIG_SWITCH_LOCAL
export const fetchConfig = (isEnv = true) => { export const fetchConfig = (isEnv = sw) => {
if (isEnv) { if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg) return Promise.resolve(cfg)
} }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base/config')
return new Http({ headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('https://oss-config.dev.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base/config')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
cfg.isStandard = !cfg.customized || cfg.customized.assets === 'glsx'
vue.prototype.$config = cfg vue.prototype.$config = cfg
} }
} }
export const configSwitch = sw
export default cfg export default cfg
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-11-16 21:30:32
* @FilePath: \scrm\scrm-base\src\filters\filter.js
*/
export function accountLevel(value) {
return ['-', '工厂', '省代', '市代', '门店'][value]
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-10-25 20:55:46
* @FilePath: \scrm\scrm-base\src\filters\index.js
*/
import Vue from 'vue'
import * as filter from './filter'
Object.keys(filter).forEach(k => Vue.filter(k, filter[k]))
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-10-18 09:41:06
* @LastEditors: limin
* @LastEditTime: 2021-10-18 10:43:57
* @FilePath: \scrm\scrm-base\src\global\event.js
*/
class Event {
event = null
constructor() {}
send(message) {
if (!message) return
window.dispatchEvent(
new CustomEvent('scrm-message', {
detail: {
message
}
})
)
}
subscribe(cb) {
window.addEventListener('scrm-message', event => {
cb && cb(event.detail)
})
}
}
const messenger = new Event()
messenger.subscribe(v => {
console.log(`111监听到子应用${v.from}发来消息:`, v)
})
export default messenger
...@@ -4,11 +4,10 @@ ...@@ -4,11 +4,10 @@
* @Author: limin * @Author: limin
* @Date: 2021-08-24 14:17:53 * @Date: 2021-08-24 14:17:53
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-10-13 14:03:39 * @LastEditTime: 2022-06-30 15:32:52
* @FilePath: \scrm\scrm-base\src\global\index.js * @FilePath: \scrm\scrm-base\src\global\index.js
*/ */
import tracker from 'gltracker'
import messenger from './messenger' import messenger from './messenger'
import * as emiter from './emiter'
import * as history from './history' import * as history from './history'
// import store from './store' export { messenger, history, tracker }
export { messenger, emiter, history }
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-15 14:46:31
* @LastEditors: limin
* @LastEditTime: 2021-10-13 14:02:54
*/
// import store from 'storejs'
// export default {
// ...store,
// exp: {
// set: function (key, val, exp = 24 * 60 * 60 * 1000) {
// store.set(key, { val: val, exp: exp, time: new Date().getTime() })
// },
// get: function (key) {
// var info = store.get(key)
// if (!info) {
// return null
// }
// if (new Date().getTime() - info.time > info.exp) {
// store.remove(key)
// return null
// }
// return info.val
// }
// },
// consts: {
// SCRM_BASE_CURRENTPAGE: 'SCRM_BASE_CURRENTPAGE'
// }
// }
<template> <template>
<el-breadcrumb separator="/"> <el-breadcrumb separator="/" v-if="auth.session">
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: auth.session.defaultPath }" class="isLink">首页</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: item.path }" v-for="item in breadcrumbs" :key="item.id">{{ item.title }}</el-breadcrumb-item> <template v-if="isNotHome">
<el-breadcrumb-item :to="{ path: ['', item.path][+isLink(item)] }" v-for="item in breadcrumbs" :key="item.id" :class="isLink(item) ? 'isLink' : 'noLink'">{{ item.title }}</el-breadcrumb-item>
</template>
</el-breadcrumb> </el-breadcrumb>
</template> </template>
...@@ -14,40 +16,59 @@ export default { ...@@ -14,40 +16,59 @@ export default {
[Breadcrumb.name]: Breadcrumb, [Breadcrumb.name]: Breadcrumb,
[BreadcrumbItem.name]: BreadcrumbItem [BreadcrumbItem.name]: BreadcrumbItem
}, },
mounted() {
// console.log(111111111, this.app.currentPage, this.app.routers, this.app.menuList)
},
computed: { computed: {
breadcrumbs() { breadcrumbs() {
const { currentPage, menuList: menus } = this.app const { currentPage, menuList: menus, flatten: flattenMenus } = this.app
if (!currentPage || !menus || !menus.length) return [] if (!currentPage || !menus || !menus.length) return []
const curId = this.app.currentPage.id const { id: curId, title, navIds = curId.split('-'), curTitle = decodeURI(title) } = currentPage
const [lv1, lv2] = curId.split('-') return navIds.reduce((navs, next) => {
const menu1 = menus.find(menu => menu.id == lv1) const { length, nextId = length ? `${navs[length - 1].id}-${next}` : next } = navs
const bc = [{ title: menu1.title }] const menu = flattenMenus.find(item => item.id === nextId)
const menu2 = menu1.children && menu1.children.find(menu => menu.id == `${lv1}-${lv2}`) const { id, title, path, titleLogic = nextId === curId ? curTitle : title } = menu
if (menu2) { navs.push({ id, title: titleLogic, path })
bc.push({ title: menu2.title }) return navs
const menu3 = menu2.children && menu2.children.find(menu => menu.id == curId) }, [])
menu3 && bc.push({ title: menu3.title }) },
} isNotHome() {
return bc const { currentPage } = this.app
return currentPage && currentPage.path !== this.auth.session.defaultPath
},
...mapGetters(['app', 'auth'])
}, },
...mapGetters(['app']) methods: {
isLink({ path }) {
return path.startsWith('/') && !path.includes('@')
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$bread-item-color: #333 !important;
/deep/.el-breadcrumb { /deep/.el-breadcrumb {
&__item { &__item {
.el-breadcrumb__inner { .el-breadcrumb__inner {
color: #999 !important; color: $bread-item-color;
font-weight: 500; font-weight: 500;
cursor: default !important;
}
.el-breadcrumb__separator {
color: $bread-item-color;
font-weight: 500 !important;
} }
&[aria-current='page'] { &:last-child {
.el-breadcrumb__inner { .el-breadcrumb__inner {
text-decoration: none !important;
font-weight: 700 !important; font-weight: 700 !important;
color: #3a3a3a !important; color: $main-color !important;
cursor: default !important;
}
}
&.isLink {
.el-breadcrumb__inner {
&:hover {
text-decoration: underline;
cursor: pointer !important;
}
} }
} }
} }
......
<template>
<div class="com-bc2">
<div class="back-wrap" v-show="page.isShowBack" @click="$router.back()">
<i class="i i-back"></i>
<span class="back-text">返回</span>
<span class="sprator">|</span>
</div>
<div class="page-title">
{{ page.title }}
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'GLBreadcrumb2',
computed: {
page() {
const { id, hidden, title: pageTitle = '', name } = this.app.currentPage || {}
const isShowBack = id?.split('-').length > 2 && hidden
const title = name === 'HomeHomeIndex' ? '首页' : decodeURI(pageTitle)
return { isShowBack, title }
},
...mapGetters(['app', 'auth'])
},
methods: {}
}
</script>
<style lang="scss" scoped>
$bread-item-color: #333 !important;
.com-bc2 {
display: flex;
align-items: center;
font-weight: 600;
.back-wrap {
font-size: 12px;
color: $bread-item-color;
cursor: pointer;
i {
margin-right: 4px;
}
.sprator {
margin: 0 8px;
color: #c3c3c3;
}
}
.page-title {
font-size: 14px;
color: $bread-item-color;
}
}
</style>
...@@ -2,33 +2,76 @@ ...@@ -2,33 +2,76 @@
* @Author: lizhijie429 * @Author: lizhijie429
* @Date: 2021-08-19 11:16:08 * @Date: 2021-08-19 11:16:08
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2021-09-29 10:09:54 * @LastEditTime: 2022-07-26 09:39:27
* @Description: * @Description:
--> -->
<template> <template>
<div class="logo"> <div class="logo" :class="{ collapse: menu.isCollapse }">
<el-image :src="require('@/assets/logo.png')"></el-image> <!-- 防止切换图片闪烁,折叠和展开分别用标签展示 -->
<el-image :src="config.src_logo_menu" v-show="!config.isCollapse"></el-image>
<el-image :src="config.src_logo_collapse" v-show="config.isCollapse"></el-image>
<div class="folder" @click="toggle()">
<i class="i i-left"></i>
</div>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapGetters } from 'vuex'
export default { export default {
name: 'Logo' name: 'Logo',
computed: {
...mapGetters(['menu']),
config() {
const { cdn, customized, assets = customized.assets } = this.$config
const src = `${cdn}/assets/${assets}`
const src_logo_menu = `${src}/logo_menu.png`
const src_logo_collapse = `${src}/logo_collapse.png`
return { src_logo_menu, src_logo_collapse, isCollapse: this.menu.isCollapse }
}
},
methods: {
...mapActions('menu', ['toggleFolder', 'setOpenId']),
toggle() {
this.toggleFolder()
this.menu.openId && this.setOpenId('')
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~@/assets/style/collapse.scss';
.logo { .logo {
height: 100%;
background: #fff;
position: relative;
padding-left: 12px;
/deep/.el-image {
margin: 24px auto;
}
.folder {
position: absolute;
right: 0;
bottom: 18px;
width: 30px;
height: 24px;
background-color: #f1f1f5;
border-radius: 12px 0 0 12px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; cursor: pointer;
line-height: 64px; i {
background: #fff; font-size: 12px;
color: #333; color: #a4a3a3;
text-align: center; transition: 0.2s;
font-size: 20px; }
font-weight: 600; }
overflow: hidden; &.collapse {
i {
transform: rotate(180deg);
}
}
} }
</style> </style>
<!--
* @Author: limin
* @Date: 2021-08-19 11:16:08
* @LastEditors: limin
* @LastEditTime: 2022-03-29 09:34:28
* @Description:
-->
<template>
<div class="com-nav-contact">
<div class="contact-box">
<div class="contact-box-title" v-if="$config.isStandard">嘀加企微管家</div>
<div class="contact-box-title">专属顾问</div>
<div class="contact-box-content">
<div class="contact-box-content-qrcode">
<div class="contact-box-content-qrcode-image">
<img :src="`${$config.cdn}/lianghh.png`" alt="" />
</div>
<div class="contact-box-content-qrcode-desc">扫码添加您的专属顾问</div>
</div>
<div class="contact-box-content-consult">
<i class="el-icon-chat-dot-round"></i>
<span>联系客服</span>
</div>
<div class="contact-box-content-time">
<span>工作时间:9:00-18:00</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'NavContact'
}
</script>
<style>
.el-popover {
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1) !important;
margin-bottom: 20px !important;
padding: 20px !important;
box-sizing: border-box !important;
}
</style>
<style lang="scss" scoped>
$color333: #333;
@mixin font($size: 14px, $weight: 400, $lineHeght: 24px, $color: $color333, $align: center, $spacing: 1px) {
font-size: $size;
font-weight: $weight;
color: $color;
line-height: $lineHeght;
letter-spacing: $spacing;
text-align: $align;
}
.com-nav-contact {
display: flex;
align-items: center;
justify-content: center;
.contact-box-title {
@include font(20px, 600);
}
.contact-box-content {
margin: 20px 0px 6px;
&-qrcode {
text-align: center;
&-image {
img {
height: 100px;
width: 100px;
margin: 0 auto;
}
}
&-desc {
@include font();
margin: 10px 0px;
}
}
&-consult {
@include font();
i {
font-size: 20px;
color: #fe911a;
vertical-align: middle;
margin-right: 5px;
}
}
&-time {
@include font();
margin-top: 5px;
}
}
}
</style>
<template> <template>
<div class="scrm-base-nav"> <div class="scrm-base-nav flex-row">
<div class="flex-row" style="height: 60px">
<div class="flex-1 none-border nav-left"> <div class="flex-1 none-border nav-left">
<GLBreadcrumb></GLBreadcrumb> <GLBreadcrumb2></GLBreadcrumb2>
</div> </div>
<div class="flex-row flex-items-center nav-right"> <div class="flex-row flex-items-center nav-right">
<div class="menu-icons"> <div class="menu-icons">
<span class="menu-icon"> <span class="menu-icon">
<el-badge is-dot class="item"> <el-badge class="item">
<i class="el-icon-bell icon" /> <i class="i i-message" />
</el-badge> </el-badge>
</span> </span>
<span class="nav-text">消息</span> <el-popover placement="bottom" trigger="click">
<div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 86px">
<img :src="`${$config.cdn}/assets/images/empty.png`" style="width: 40px; height: 24px" />
<span style="margin-top: 4px">暂无消息</span>
</div>
<span class="nav-text" slot="reference" style="cursor: pointer">消息</span>
</el-popover>
</div> </div>
<div class="menu-icons"> <div class="menu-icons">
<span class="menu-icon"> <span class="menu-icon">
<el-badge class="item"> <el-badge class="item">
<i class="el-icon-phone-outline" /> <i class="i i-contact" />
</el-badge> </el-badge>
</span> </span>
<span class="nav-text"> <span class="nav-text">
<a href="">联系我们</a> <el-popover placement="bottom" width="228" height="316" trigger="click">
<NavContact></NavContact>
<a href="javascript:void(0);" slot="reference">联系我们</a>
</el-popover>
| |
<a>营销学院</a> <a href="https://www.yuque.com/docs/share/ad640d83-50d9-49cc-a92c-0a5230fedd17" target="blank">营销学院</a>
</span> </span>
</div> </div>
<el-dropdown @command="handleCommand"> <div class="flex-row flex-items-center">
<div class="flex-row flex-items-center cursor-pointer"> <i class="i i-avatar" />
<el-avatar class="border" :src="avatarImg"></el-avatar>
</div> </div>
<el-dropdown-menu slot="dropdown"> <template v-if="auth.session">
<el-dropdown-item command="logout">退出</el-dropdown-item> <span class="nav-text nav-text-avatar">{{ auth.session.userName }}</span>
<el-dropdown @command="handleCommand" trigger="click" :hide-on-click="false" @visible-change="dropdownVisibleChange">
<span class="el-dropdown-link">
<i class="i i-arrow-down" :class="{ drOpen }"></i>
</span>
<el-dropdown-menu slot="dropdown" ref="drop-main">
<el-dropdown-item :command="item.icon" v-for="item in dropDown" :key="item.icon" @mouseenter.native.stop="mouseenter(item)" @mouseleave.native.stop="mouseleave" :disabled="item.disabled" :title="item.title.length > 7 ? item.title : ''">
<i class="i" :class="genClass(item)" />
{{ item.title }}
</el-dropdown-item>
</el-dropdown-menu>
<el-dropdown-menu ref="drop-sub" class="drop-sub" :style="subStyle">
<el-dropdown-item :command="item" v-for="item in auth.session.loginList" :key="item.accounttypeId" :title="item.accounttypeName.length > 7 ? item.accounttypeName : ''">
<i class="i" :class="{ 'i-checked': currentMerchant.accounttypeId == item.accounttypeId }" />
{{ item.accounttypeName }}
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<span class="nav-text" style="padding-left: 8px">{{ user.userInfo && user.userInfo.name }}</span> </template>
</div>
</div> </div>
<NavUpdatePassWord :visible.sync="dialogVisible"></NavUpdatePassWord>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters, mapActions } from 'vuex' import { mapGetters, mapActions } from 'vuex'
import { Message } from '@/plugins/element'
import { utils } from 'glsx-common'
// import api from '@/api'
import { constants } from '@/common'
const SUBSTYLE = Object.freeze({ opacity: 0 })
const dropDown = [
{
title: '',
icon: 'exchange'
},
{
title: '修改密码',
icon: 'edit'
},
{
title: '退出账户',
icon: 'logoff'
}
]
export default { export default {
name: 'NavMenu', name: 'NavMenu',
data() { data() {
return { return {
avatarImg: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png' dropDown,
hoverIcon: '',
active: '',
drOpen: false,
subStyle: SUBSTYLE,
dialogVisible: false,
currentMerchant: {}
} }
}, },
computed: { computed: {
...mapGetters(['user']) ...mapGetters(['auth'])
},
beforeDestroy() {
this.resetIcon()
},
mounted() {
this.setCurrent()
}, },
methods: { methods: {
...mapActions('user', ['updateUserInfoItem']), ...mapActions('app', ['logout', 'formatSave']),
...mapActions('app', ['logout']), ...mapActions('auth', ['permission', 'saveSession']),
handleCommand(command) { async handleCommand(command) {
if (command === 'logout') { if (typeof command === 'string') {
this.active = command
return await this[command]()
}
await this.changeAccount(command)
},
async changeAccount(merchant) {
if (this.currentMerchant.accounttypeId == merchant.accounttypeId) return
const { merchantProTreeResponses: menus } = merchant.products[0]
if (menus.length) {
const { menuFormat, defaultPath } = await this.formatSave(menus).catch(error => Message.error(error.message))
if (!menuFormat) return
const { session } = this.auth
session.loginList.forEach(item => (item.active = item.accounttypeId == merchant.accounttypeId))
session.defaultPath = defaultPath
this.saveSession(session)
const isLegalPath = this.validatePath(menuFormat)
;[() => location.replace(defaultPath), () => location.reload()][+isLegalPath].call()
} else {
const { MESSAGE } = constants.SCRM_BASE_ERRORS.NO_PERMISSION_MENUS
Message.error(MESSAGE)
}
},
async exchange() {
;[this.showSub, this.hideSub][+this.$refs['drop-sub'].$el.style.opacity].call()
},
async edit() {
this.dialogVisible = true
},
async logoff() {
this.$router.replace('/login')
this.logout() this.logout()
// this.$router.replace({ path: '/login' }) },
location.reload('/login') dropdownVisibleChange(isShow) {
return false this.drOpen = isShow
if (!isShow) {
this.hideSub()
this.resetIcon()
} }
if (command === 'setting') { },
this.updateUserInfoItem({ key: 'userInfo', value: { name: 'zhangsan' } }) showSub() {
// this.$actions.setGlobalState({ userInfo: { name: 'zhangsan' } }) this.showOrHide(1)
return false },
hideSub() {
this.showOrHide(0)
this.active = ''
this.$refs['drop-main'].$children[0].$el.blur()
},
showOrHide(opacity) {
const {
['drop-sub']: {
$el: { offsetWidth }
},
['drop-main']: {
$el: { offsetLeft }
},
left = offsetLeft - opacity * offsetWidth + 'px'
} = this.$refs
this.subStyle = { left, opacity }
},
genClass(item) {
const { icon, _icon = `i-${icon}` } = item
if (item.disabled) return `${_icon}-disabled`
const active = this.active == icon || this.hoverIcon == icon
return `${_icon}${['', '-active'][+active]}`
},
mouseenter: function (item) {
if (this.hoverIcon === item.icon) return
this.hoverIcon = item.icon
},
mouseleave: function () {
this.hoverIcon = ''
},
resetIcon() {
this.active = ''
this.hoverIcon = ''
},
validatePath(menuFormat) {
const [, name, ...path] = location.pathname.split('/')
const mod = menuFormat.find(menu => menu.name === name)
if (mod) {
const menu = utils.array.valInDeep(mod.children, `/${path.join('/')}`, 'path', 'children')
return menu && menu.length
} }
return false
},
setCurrent() {
const { loginList, disabled = loginList.length == 1 } = this.auth.session
const merchant = loginList.find(type => type.active)
Object.assign(this.dropDown[0], { title: merchant.accounttypeName, disabled })
this.currentMerchant = merchant
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~@/assets/style/mixins.scss';
@mixin icon($color: rgb(153, 153, 153), $font-size: 20px) {
font-size: 20px;
font-weight: bolder;
color: rgb(153, 153, 153);
}
.scrm-base-nav { .scrm-base-nav {
height: $header-height;
background-color: #fff;
@include leftpadding;
.nav-text, .nav-text,
.nav-text a { .nav-text a {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #3b457f; color: #3b457f;
} }
.nav-text {
margin-left: 2px;
&-avatar {
margin-left: 8px;
}
}
.nav-left { .nav-left {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 40px;
}
.nav-right {
margin-right: 20px;
}
.qiankun-font {
font-size: 22px;
padding-right: 20px;
line-height: 60px;
} }
.menu-icons { .menu-icons {
padding-right: 20px; padding-right: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
.menu-icon { }
padding: 0 12px;
.el-dropdown {
.i-arrow-down {
@include icon;
margin: 0 10px;
cursor: pointer; cursor: pointer;
.icon { transition: all 0.2s ease-in-out;
display: inline-block; &.drOpen {
font-size: 18px; transform: rotate(-180deg);
text-align: center; }
}
}
}
.el-dropdown-menu {
background: #fff;
border: 1px solid #e4e7ed;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
&__item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 10em;
min-width: 8em;
user-select: none;
i.icon {
font-weight: bold;
font-size: 16px;
}
&:focus,
&:not(.is-disabled):hover {
background-color: #ebeaff;
color: $main-color;
}
} }
&.drop-sub {
opacity: 0;
transition: all 0.2s ease-in-out;
/deep/.popper__arrow::after {
display: none;
} }
} }
} }
......
<!--
* @Author: limin
* @Date: 2021-08-19 11:16:08
* @LastEditors: limin
* @LastEditTime: 2022-07-25 17:46:03
* @Description:
-->
<template>
<div class="com-nav-update-password">
<el-dialog title="修改密码" :visible.sync="dialogVisible" width="712px" height="520px" :show-close="false" :destroy-on-close="true" :close-on-click-modal="false">
<el-form :model="passwordForm" @keyup.enter.native="submitForm" :rules="rules" ref="passwordForm" class="updatePasswordForm">
<el-form-item prop="password">
<template slot="label">
<span>初始密码</span>
</template>
<el-input type="password" clearable v-model.trim="passwordForm.password" placeholder="请输入密码" @keyup.enter.native="submitForm" show-password auto-complete="new-password"></el-input>
</el-form-item>
<el-form-item prop="newPassword">
<template slot="label">
<span>新密码</span>
<span style="margin-left: 3em; font-size: 12px; font-weight: 400; color: #999">(必须包含6-20个字母+数字)</span>
</template>
<el-input type="password" clearable v-model.trim="passwordForm.newPassword" maxlength="20" placeholder="请输入新密码" @keyup.enter.native="submitForm" show-password></el-input>
</el-form-item>
<el-form-item prop="checkNewPassword">
<template slot="label">
<span>确认新密码</span>
<span style="margin-left: 1em; font-size: 12px; font-weight: 400; color: #999">(必须包含6-20个字母+数字)</span>
</template>
<el-input type="password" clearable v-model.trim="passwordForm.checkNewPassword" maxlength="20" placeholder="请输入新密码" @keyup.enter.native="submitForm" show-password></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<div class="btn-wrapper">
<el-button @click="cancle">取消</el-button>
<el-button type="primary" @click="submitForm" :loading="loading">确定</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import md5 from 'md5'
import { mapGetters, mapActions } from 'vuex'
import { utils } from 'glsx-common'
import api from '@/api'
import { Message } from '@/plugins/element'
export default {
name: 'NavUpdatePassWord',
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
var checkOldPass = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入旧密码。'))
}
if (md5(value) !== this.auth.session.pw) {
return callback(new Error('您输入的密码不正确,请重新输入。'))
}
callback()
}
var validateNewPassword = (rule, value, callback) => {
if (!value) {
return callback(new Error('请输入新密码。'))
}
const errText = validate(value)
if (errText) {
return callback(new Error(errText))
}
if (this.passwordForm.checkNewPassword) {
this.$refs.passwordForm.validateField('checkNewPassword')
}
callback()
}
var validateNewPassword2 = (rule, value, callback) => {
if (!value) {
return callback(new Error('请再次输入新密码。'))
}
const errText = validate(value)
if (errText) {
return callback(new Error(errText))
}
if (value !== this.passwordForm.newPassword) {
return callback(new Error('两次输入的密码不一致,请重新输入。'))
}
callback()
}
var validate = value => {
if (value.length < 6 || value.length > 20) {
return '密码必须包含6-20个字符和数字。'
}
// if (!/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]{6,20}$/.test(value)) {
if (!/^(?=.*\d)(?=.*[a-zA-Z])[\s\S]{6,20}$/.test(value)) {
return '您输入的密码格式不正确,必须同时包含字母、数字。'
}
return ''
}
return {
passwordForm: {
password: '',
newPassword: '',
checkNewPassword: ''
},
loading: false,
rules: {
password: [{ validator: checkOldPass, trigger: 'blur' }],
newPassword: [{ validator: validateNewPassword, trigger: 'blur' }],
checkNewPassword: [{ validator: validateNewPassword2, trigger: 'blur' }]
}
}
},
computed: {
...mapGetters(['auth']),
dialogVisible: {
get() {
return this.visible
},
set(v) {
this.$emit('update:visible', v)
}
}
},
methods: {
...mapActions('app', ['logout']),
submitForm: utils.debounce(function () {
this.$refs['passwordForm'].validate(async valid => {
if (valid) {
this.loading = true
const { response } = this.$config
const { password, newPassword } = this.passwordForm
const changeData = { oldPassword: md5(password), newPassword, sessionId: this.auth.session.token }
let { code, message } = await api.app.updatePassword(changeData).catch(err => Message.error(`修改失败:${err}`))
if (code === response.code_success_value) {
Message.success('修改密码成功')
setTimeout(() => {
this.cancle()
this.logoff()
}, 1000)
} else {
Message.error(`修改密码失败:${message}`)
}
this.loading = false
}
})
}, 500),
cancle() {
this.dialogVisible = false
this.$refs['passwordForm'].resetFields()
},
logoff() {
this.$router.push('/login')
this.logout()
}
}
}
</script>
<style lang="scss" scoped>
.com-nav-update-password {
/deep/.el-dialog {
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
&__header {
padding: 0;
background-color: $main-color;
}
&__title {
color: #fff;
height: 70px;
line-height: 70px;
text-align: center;
}
&__body {
width: 342px;
margin: 0 auto;
padding: 40px 0 0 0;
.el-form {
&-item {
text-align: left;
margin-bottom: 18px;
&__label {
line-height: 30px;
float: none;
}
&__content {
.el-input__inner {
&:focus {
border-color: $main-color;
}
}
}
}
}
}
&__footer {
text-align: center;
padding: 20px 0 60px 0;
border-top: 0px;
.btn-wrapper {
margin: 0 auto;
width: 342px;
display: flex;
justify-content: space-between;
.el-button {
width: 162px;
&.el-button--primary {
background-color: $main-color;
border-color: $main-color;
&:hover,
&:focus {
border-color: #7777f3;
background-color: #7777f3;
}
}
&.el-button--default {
&:hover,
&:focus {
color: $main-color !important;
}
}
}
}
}
}
}
</style>
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
<Logo></Logo> <Logo></Logo>
</div> </div>
<div class="side-bar-menu"> <div class="side-bar-menu">
<GLScroll class="side-bar-menu-scroll-y">
<div class="side-bar-menu-left"> <div class="side-bar-menu-left">
<el-menu class="flex-1 none-border" background-color="#fff" @open="open" @close="close" active-text-color="#409EFF" text-color="#999" :default-openeds="openeds" :default-active="active" :unique-opened="true"> <el-menu :collapse="menu.isCollapse" class="flex-1 none-border" background-color="#fff" @open="open" @close="close" active-text-color="#409EFF" text-color="#999" :default-openeds="current.openeds" :default-active="current.active" :unique-opened="true" :collapse-transition="false">
<SubMenu :subMenu="app.menuList" ref="sub"></SubMenu> <SubMenu :subMenu="app.menuList.noHidden()"></SubMenu>
</el-menu> </el-menu>
</div> </div>
</GLScroll>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,55 +20,58 @@ import { mapActions, mapGetters } from 'vuex' ...@@ -18,55 +20,58 @@ import { mapActions, mapGetters } from 'vuex'
export default { export default {
name: 'SideMenu', name: 'SideMenu',
computed: { computed: {
...mapGetters(['app']), ...mapGetters(['app', 'menu']),
active() { current() {
if (this.app.currentNav2) { const cur = { active: '', openeds: [] }
return this.app.currentNav2.id if (this.app.currentPage) {
const [lv1, lv2] = this.app.currentPage.id.split('-')
cur.openeds = [lv1]
cur.active = `${lv1}-${lv2}`
} }
return '0' return cur
},
openeds() {
if (this.app.currentApp) {
return [this.app.currentApp.id]
}
return []
} }
}, },
methods: { methods: {
...mapActions('app', ['setCurrentApp']),
...mapActions('menu', ['setOpenId', 'setHoverId']), ...mapActions('menu', ['setOpenId', 'setHoverId']),
open(index) { open(index) {
this.setOpenId(index) this.setOpenId(index)
}, },
close() { close() {
this.setOpenId('') this.setOpenId('')
this.setHoverId('') // this.setHoverId('')
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$logo-height: 140px; @import '~@/assets/style/collapse.scss';
.side-bar { .side-bar {
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
/deep/ .collapse-transition { overflow: hidden;
transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, 0.2s padding-bottom ease-in-out;
}
.logo { .logo {
flex: 0 0 $logo-height; flex: 0 0 $logo-height;
} }
.side-bar-menu { .side-bar-menu {
flex: 1; flex: 1;
user-select: none; user-select: none;
overflow-y: auto;
background-color: #fff;
&-left { &-left {
height: 100%; height: 100%;
width: $menu-width;
.el-menu { .el-menu {
height: 100%; height: 100%;
} }
} }
&-scroll-y {
/deep/.el-scrollbar__wrap {
margin-bottom: 0 !important ;
}
height: calc(100vh - #{$logo-height});
}
} }
} }
</style> </style>
<template> <template>
<div class="scrm-base-submenu"> <div class="scrm-base-submenu">
<template v-for="item in subMenu"> <div v-for="item in subMenu" :key="item.id">
<el-submenu v-if="isNotLv3(item)" :key="item.id" :index="item.id"> <!-- 没有二级菜单的一级菜单 -->
<div class="el-submenu" :class="{ 'is-active': active === item.id }" v-if="isMenuNoChildren(item)" @mouseenter.stop="mouseenter(item)" @mouseleave.stop="mouseleave" @click.stop="handleModuleClick(item)">
<div class="el-submenu__title">
<i class="i" :class="genClass(item)"></i>
<span>{{ item.title }}</span>
</div>
</div>
<!-- 有二级菜单的一级菜单 -->
<el-submenu v-else :index="item.id" @mouseenter.native.stop="mouseenter(item)" @mouseleave.native.stop="mouseleave" popper-class="el-submenu-popper-base">
<template slot="title"> <template slot="title">
<div @mouseenter="hover(item)" @mouseleave="mouseleave"> <i class="i" :class="genClass(item)"></i>
<i class="i" :class="genClass(item)" v-if="item.icon"></i>
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</div>
</template> </template>
<sub-menu :subMenu="item.children"></sub-menu> <!-- 渲染二级菜单 -->
<sub-menu-item :menuItems="item.children" :parentTitle="item.title"></sub-menu-item>
</el-submenu> </el-submenu>
<el-menu-item v-else :key="item.id" :index="item.id" @click="handleSelect(item)"> </div>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</div> </div>
</template> </template>
...@@ -37,63 +41,61 @@ export default { ...@@ -37,63 +41,61 @@ export default {
computed: { computed: {
...mapGetters(['app', 'menu']), ...mapGetters(['app', 'menu']),
active() { active() {
if (this.app.currentApp) { if (this.app.currentPage) {
return this.app.currentApp.id const [nav1Id] = this.app.currentPage.id.split('-')
return nav1Id
} }
return '0' return '0'
} }
}, },
mounted() {},
methods: { methods: {
handleSelect(item) { handleModuleClick({ children = [] }) {
if (item.path) { this.$router.push(children[0].path)
this.$router.push(item.path)
}
this.setCurrentNav2(item)
}, },
genClass(item) { genClass: function ({ id, icon }) {
const active = this.active == item.id || this.menu.hoverId == item.id || this.menu.openId == item.id return `i-${icon}${['', '-active'][+[this.active, this.menu.hoverId, this.menu.openId].includes(id)]}`
return `i-${active ? `${item.icon}-active` : item.icon}`
}, },
hover(item) { mouseenter: function (item) {
if (this.menu.hoverId === item.id) return
this.setHoverId(item.id) this.setHoverId(item.id)
}, },
mouseleave() { mouseleave: function () {
this.setHoverId('') this.menu.hoverId && this.setHoverId('')
}, },
isNotLv3(item) { isMenuNoChildren({ children = [] }) {
// 3级菜单不在左侧menu渲染 return children.noHidden().length == 0 && children[0]?.id?.split('-').length <= 2
return item.children && item.children.length > 0 && item.children[0].id.split('-').length <= 2
}, },
...mapActions('app', ['setCurrentNav2']),
...mapActions('menu', ['setHoverId']) ...mapActions('menu', ['setHoverId'])
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~@/assets/style/variables.scss'; @import '~@/assets/style/collapse.scss';
$active-background-color: rgba(235, 234, 255, 1) !important;
.scrm-base-submenu { .scrm-base-submenu {
display: flex;
flex-direction: column;
/deep/.el-submenu { /deep/.el-submenu {
&:not(.is-opened) {
margin-bottom: $menu-item-mb;
}
&__title { &__title {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
padding: 0 0 0 10px !important; background-color: transparent !important;
border-radius: 4px; border-radius: 4px;
margin: 0 20px; padding-left: 25px !important;
&:hover { &:hover {
background-color: $active-background-color; background-color: #fff !important;
span { span {
color: $main-color !important; color: $main-color !important;
} }
} }
span { span {
font-size: 14px; font-size: 18px;
color: #999; color: #666;
letter-spacing: 0; // letter-spacing: 1.2px;
font-weight: 600; font-weight: 600;
margin-left: 10.8px; margin-left: 10px;
} }
.el-submenu__icon-arrow { .el-submenu__icon-arrow {
display: none; display: none;
...@@ -101,26 +103,18 @@ $active-background-color: rgba(235, 234, 255, 1) !important; ...@@ -101,26 +103,18 @@ $active-background-color: rgba(235, 234, 255, 1) !important;
} }
&.is-opened { &.is-opened {
.el-submenu__title { .el-submenu__title {
background-color: $active-background-color; background-color: transparent !important;
span { span {
color: $main-color !important; color: $main-color !important;
} }
} }
} }
}
.el-menu-item {
min-width: $menu-width;
padding-left: 60px !important;
&:hover,
&.is-active { &.is-active {
outline: 0 !important; .el-submenu__title {
color: $main-color !important; > span {
background-color: #fff !important; color: $main-color;
border-bottom: none; }
} }
&:hover {
background-color: transparent !important;
} }
} }
} }
......
<template>
<el-menu-item-group :title="parentTitle" class="scrm-base-submenu-item" v-if="menuItems">
<el-menu-item v-for="item in menuItems.noHidden()" :key="item.id" :index="item.id" @click.native.stop="handleSelect(item)">
<span>{{ item.title }}</span>
</el-menu-item>
</el-menu-item-group>
</template>
<script>
export default {
name: 'SubMenuItem',
props: {
parentTitle: {
type: String,
required: false,
default: ''
},
menuItems: {
type: Array,
required: true
}
},
methods: {
handleSelect({ path }) {
if (path) {
this.$router.push(path)
}
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/collapse.scss';
$active-background-color: rgba(88, 80, 255, 0.2) !important;
$menu-item-width: 176px !important;
.scrm-base-submenu-item {
/deep/.el-menu-item-group__title {
display: none;
}
/deep/ul {
display: flex;
flex-direction: column;
align-items: center;
.el-menu-item {
width: $menu-item-width;
min-width: $menu-item-width;
height: 40px;
line-height: 40px;
align-self: center;
border-radius: 4px;
span {
color: #666;
font-size: 16px;
}
&:hover,
&.is-active {
outline: 0 !important;
color: $main-color !important;
background-color: $active-background-color;
border-bottom: none;
span {
color: $main-color !important;
}
}
&:hover:not(.is-active) {
background-color: transparent !important;
}
}
}
}
</style>
<style lang="scss">
$width: 150px;
@mixin popup_width {
width: $width !important;
min-width: $width !important;
}
.el-menu--vertical {
&.el-submenu-popper-base {
.el-menu--popup {
@include popup_width;
margin-left: -8px;
box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
.scrm-base-submenu-item {
.el-menu-item {
@include popup_width;
padding-left: 20px !important;
border-radius: 0;
}
.el-menu-item-group__title {
display: block;
}
}
}
}
}
</style>
<template> <template>
<div class="scrm-base-sub-nav"> <div class="scrm-base-sub-nav" v-show="subNavs && subNavs.length">
<el-tabs v-model="activeName" @tab-click="handleClick()"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane :label="item.title" :name="item.path" v-for="item in subNavs" :key="item.id"></el-tab-pane> <el-tab-pane :name="item.path" v-for="item in subNavs" :key="item.id">
<span slot="label" style="padding: 0 10px">{{ item.title }}</span>
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
...@@ -13,62 +15,80 @@ export default { ...@@ -13,62 +15,80 @@ export default {
data() { data() {
return { return {
activeName: '', activeName: '',
subNavs: [] cur2: {
id: '',
nav3: [],
activeId: ''
}
} }
}, },
mounted() {}, mounted() {},
methods: { methods: {
handleClick() {} handleClick(item) {
this.$router.push(item.name)
}, },
computed: { setActive(activeId, id = this.cur2.id, nav3 = this.cur2.nav3) {
...mapGetters(['app']) const sub = this.find(activeId)
if (sub) {
this.cur2 = { activeId, id, nav3 }
this.$nextTick(() => (this.activeName = sub.path))
}
}, },
watch: { find(id) {
activeName(n) { return this.app.flatten.find(item => item.id == id)
if (n.startsWith('/')) {
this.$router.push(n)
} }
}, },
'app.currentNav2': { computed: {
handler(v) { ...mapGetters(['app']),
if (!v) return subNavs() {
const sub = v.children const { currentPage } = this.app
if (sub && sub.length) { if (currentPage) {
this.subNavs = sub.filter(item => !item.hidden) const [lv1, lv2, lv3] = currentPage.id.split('-')
const { id, nav3, activeId, lv2id = `${lv1}-${lv2}`, lv3id = `${lv2id}-${lv3}` } = this.cur2
if (id === lv2id) {
if (activeId !== lv3id) {
this.setActive(lv3id)
} }
const curPage = this.app.currentPage return nav3
if (curPage) {
const nav2 = this.app.currentNav2
if (nav2 && curPage.id.startsWith(nav2.id)) {
this.activeName = curPage.path
return
} }
const sub = this.find(lv2id).children
if (sub && sub.length) {
const nav3 = sub.noHidden()
this.setActive(lv3id, lv2id, nav3)
return nav3
} }
if (this.subNavs && this.subNavs.length) {
this.activeName = this.subNavs[0].path
} }
}, return []
immediate: true
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~@/assets/style/variables.scss'; @import '~@/assets/style/mixins.scss';
.scrm-base-sub-nav { .scrm-base-sub-nav {
// transform: translateY(-5px);
@include leftpadding;
/deep/.el-tabs { /deep/.el-tabs {
&__nav-wrap { &__nav-wrap {
&::after { &::after {
opacity: 0; height: 1px;
// width: calc(100% - #{$left});
}
} }
&__header {
margin: 4px 0 1px;
} }
&__item { &__item {
height: 42px !important;
// line-height: 10px !important;
&.is-active, &.is-active,
&:hover { &:hover {
color: $main-color; color: $main-color;
font-weight: 600;
} }
font-weight: 400; font-weight: 400;
font-size: 16px;
color: #717171; color: #717171;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
......
<template>
<div class="tabs-box flex-row flex-items-center">
<div class="tabs-item paas-flex-cc" v-for="item in tabsList" :key="item.id" :class="item.path === currentPage ? 'tabs-item-hover' : 'null'">
<span>
<span class="cursor-pointer fs-14 tabs-item-text" @click="handleClick(item)">{{ item.title }}</span>
<i class="el-icon-close tabs-remove-icon cursor-pointer" @click="removeTab(item)"></i>
</span>
</div>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Tabs',
computed: {
...mapState({
menuList: state => state.app.menuList,
currentPage: state => state.app.currentPage,
tabsList: state => state.tabs.tabsList
})
},
methods: {
// 获取元素数组下标
getArrayIndex(arr, id) {
for (let index = 0; index < arr.length; index++) {
const item = arr[index]
if (item.id === id) {
return index
}
}
return -1
},
// 跳转tabs标签
handleClick(item) {
if (this.currentPage.id === item.id) return false
// 设置左侧菜单数据
if (item.path !== '/home') {
const menu = this.menuList.filter(element => {
return element.id === item.id.split('-')[0]
})
this.$store.commit('app/UPDATE_SUB_MENU', menu[0].menuList)
this.$router.push({ path: item.path })
} else {
this.$store.commit('app/UPDATE_SUB_MENU', true)
this.$router.push({ path: item.path })
}
},
// 删除tabs标签
removeTab(item) {
let tabsListLength = this.tabsList.length - 1
// 获取当前要删除的tabs的位置
let indexOf = this.getArrayIndex(this.tabsList, item.id)
if (tabsListLength === indexOf) {
// 删除最后一个
this.$store.dispatch('tabs/REMOVE_LAST_TAB', item)
} else {
// 删除除了第一个跟最后一个
this.$store.dispatch('tabs/REMOVE_ANY_TAB', {
indexOf,
tabsItem: item
})
}
}
}
}
</script>
<style lang="scss" scoped>
.tabs-box {
height: 0.32rem;
padding: 0.1rem;
.tabs-item {
height: 100%;
padding: 0 0.12rem;
margin-right: 0.1rem;
background-color: #fff;
border-radius: 0.04rem;
color: #333;
font-size: 0.14rem;
line-height: 0.32rem;
white-space: nowrap;
.tabs-item-text {
&:hover {
color: #23b7e5;
}
}
.tabs-remove-icon {
margin-left: 0.02rem;
padding: 0.02rem;
font-size: 0.04px;
cursor: pointer;
}
.tabs-remove-icon:hover {
border-radius: 50%;
color: #fff;
background-color: #23b7e5;
}
}
.tabs-item:last-child {
border-right: none !important;
}
}
.tabs-item-hover {
color: #23b7e5 !important;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!