Commit 006ea11b by wangql

aaa

2 parents 765877ac c2e97b11
Showing 120 changed files with 1579 additions and 623 deletions
......@@ -7,10 +7,12 @@ VUE_APP_TITLE=tFIMS
VUE_APP_API=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
# 仓库地址
VUE_APP_REPO=
VUE_APP_REPO=http://192.168.3.171:7300/mock/5d638b3b6fbe9a0ac59d872e/tFIMS
# 国际化配置
VUE_APP_I18N_LOCALE=zh-chs
VUE_APP_I18N_FALLBACK_LOCALE=en
VUE_APP_ELEMENT_COLOR=#409EFF
VUE_APP_MAIN_COLOR=#3D6FE4
\ No newline at end of file
......@@ -5,16 +5,13 @@
"serve": "vue-cli-service serve --open",
"start": "npm run serve",
"dev": "npm run serve",
"build": "vue-cli-service build",
"build": "vue-cli-service build --mode nomock",
"build:nomock": "vue-cli-service build --mode nomock",
"build:travis": "vue-cli-service build --mode travis",
"lint": "vue-cli-service lint --fix",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"@d2-projects/d2-crud": "^2.1.1",
"@d2-projects/vue-table-export": "^1.0.1",
"@d2-projects/vue-table-import": "^1.0.0",
"axios": "^0.18.0",
"better-scroll": "^1.15.2",
"core-js": "^2.6.5",
......@@ -28,13 +25,11 @@
"js-md5": "^0.7.3",
"lodash": "^4.17.11",
"lowdb": "^1.0.0",
"mockjs": "^1.0.1-beta3",
"nprogress": "^0.2.0",
"qs": "^6.7.0",
"screenfull": "^4.2.0",
"ua-parser-js": "^0.7.19",
"vue": "^2.6.10",
"vue-avatar": "^2.1.7",
"vue-i18n": "^8.14.0",
"vue-role-manager": "^1.2.0",
"vue-router": "^3.0.3",
......@@ -57,6 +52,7 @@
"sass-loader": "^7.1.0",
"svg-sprite-loader": "^4.1.3",
"vue-template-compiler": "^2.5.21",
"webpack-bundle-analyzer": "^3.4.1",
"webpack-theme-color-replacer": "^1.2.15"
}
}
No preview for this file type
<!DOCTYPE html>
<html>
<head>
<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 %>icon.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><%= VUE_APP_TITLE %></title>
<style>
html, body, #app { height: 100%; margin: 0px; padding: 0px; width: 100%; }
.d2-home { background-color:#000; height: 100%; display: flex; flex-direction: column; }
.d2-home__main { user-select: none; width: 100%; flex-grow: 1; display: flex; justify-content: center; align-items: center; flex-direction: column; }
.d2-home__footer { width: 100%; flex-grow: 0; text-align: center; padding: 1em 0; }
.d2-home__footer > a { font-size: 12px; color: #fff; text-decoration: none; }
.d2-home__loading { height: 32px; width: 32px; margin-bottom: 20px; }
.d2-home__title { color: #FFF; font-size: 20px; margin-bottom: 10px; }
.d2-home__sub-title { color: #fff; font-size: 14px; }
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
width: 100%;
}
.d2-home {
background-color: #2A343D;
height: 100%;
display: flex;
flex-direction: column;
}
.d2-home__main {
user-select: none;
width: 100%;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.d2-home__footer {
width: 100%;
flex-grow: 0;
text-align: center;
padding: 1em 0;
}
.d2-home__footer>a {
font-size: 12px;
color: #fff;
text-decoration: none;
}
.d2-home__loading {
height: 32px;
width: 32px;
margin-bottom: 20px;
}
.d2-home__title {
color: #FFF;
font-size: 20px;
margin-bottom: 10px;
}
.d2-home__sub-title {
color: #fff;
font-size: 14px;
}
</style>
<!-- <script>
var _hmt = _hmt || [];
var hmid = "1dfa88d0c8571eef2d383070cb3e5ca1";
(function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?" + hmid; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})();
</script> -->
</head>
<body>
</head>
<body>
<noscript>
<strong>
很抱歉,如果没有 JavaScript 支持,D2Admin 将不能正常工作。请启用浏览器的 JavaScript 然后继续。
很抱歉,如果没有 JavaScript 支持,系统 将不能正常工作。请启用浏览器的 JavaScript 然后继续。
</strong>
</noscript>
<div id="app">
<div class="d2-home">
<div class="d2-home__main">
<img
class="d2-home__loading"
src="./image/loading/loading-spin.svg"
alt="loading">
<img class="d2-home__loading" src="./image/loading/loading-spin.svg" alt="loading">
<div class="d2-home__title">
正在加载资源
</div>
......@@ -43,13 +97,16 @@
</div>
</div>
<div class="d2-home__footer">
<a
href="https://github.com/d2-projects/d2-admin"
target="_blank">
https://github.com/d2-projects/d2-admin
<a href="http://www.glsx.com.cn" target="_blank">
<!-- 版权所有&copy-2019 GLSX粤ICP备12020087号 -->
</a>
</div>
</div>
</div>
</body>
<!-- built files will be auto injected -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>
\ No newline at end of file
import request from './request'
const path = 'fims.device.'
function getListApi (data) {
data.method = `${path}list`
return request(data)
}
function editApi (data) {
data.method = `${path}edit`
return request(data)
}
function removeApi (data) {
data.method = `${path}remove`
return request(data)
}
function importApi (data) {
data.method = `${path}import`
return request(data)
}
function exportApi (data) {
data.method = `${path}export`
return request(data)
}
export {
getListApi,
editApi,
removeApi,
importApi,
exportApi
}
import request from './request'
const path = 'fims.maintain.'
function getListApi (data) {
data.method = `${path}search`
return request(data)
}
function removeApi (data) {
data.method = `${path}delete`
return request(data)
}
function exportApi (data) {
data.method = `${path}export`
return request(data)
}
export {
getListApi,
removeApi,
exportApi
}
import request from './request'
const path = 'fims.order.'
function getListApi (data) {
data.method = `${path}search`
return request(data)
}
function detailApi (data) {
data.method = `${path}detail`
return request(data)
}
function removeApi (data) {
data.method = `${path}delete`
return request(data)
}
function downloadApi (data) {
data.method = `${path}download`
return request(data)
}
export {
getListApi,
detailApi,
removeApi,
downloadApi
}
import request from './request'
const path = 'fims.material.'
function getListApi (data) {
data.method = `${path}list`
return request(data)
}
export {
getListApi
}
......@@ -2,22 +2,26 @@
* @Author: limin
* @Date: 2019-08-26 18:02:41
* @Last Modified by: limin
* @Last Modified time: 2019-08-28 15:04:32
* @Last Modified time: 2019-09-01 15:33:02
*/
import axios from '@/plugin/axios'
import sign from './sign'
const request = (params, method) => {
import RequestMethods from './request.methods'
// import util from '@/libs/util'
const request = (params = {}, method = RequestMethods.GET) => {
// params = util.deepClone(params)
params.source = ''
params.app_key = '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
const url = process.env.NODE_ENV === 'production' ? 'router' : params.method
// const url = process.env.NODE_ENV === 'production' ? 'router' : params.method
// return axios.post(url, { 'params': sign(params) })
const url = params.method
return axios({
url,
method: method || 'get',
method,
data: sign(params)
})
}
......
......@@ -20,9 +20,9 @@ function removeApi (data) {
return request(data)
}
export {
export {
getListApi,
methods,
editApi,
removeApi
}
\ No newline at end of file
}
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 17:18:41
*/
import request from './request'
import RequestMethods from './request.methods'
// 用户相关
const user_path = 'fims.user.'
/**
* 用户登录
* @param {*} data 参数
*/
export function AccountLogin (data) {
data.method = `${user_path}login`
return request(data, RequestMethods.POST)
}
/**
* 注册
* @param {*} data 参数
*/
export function Reg (data = {}) {
data.method = `${user_path}register`
return request(data, RequestMethods.GET)
}
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 17:19:07
*/
import request from './request'
import RequestMethods from './request.methods'
// 基础数据
const path = 'fims.base.'
/**
* 获取站点列表
* @param {*} data 参数
*/
export function StationList (data = {}) {
data.method = `${path}station`
return request(data, RequestMethods.GET)
}
/**
* 获取公司列表
* @param {*} data 参数
*/
export function CompanyList (data = {}) {
data.method = `${path}company`
return request(data, RequestMethods.GET)
}
/**
* 获取部门列表
* @param {*} data 参数
*/
export function DepartList (data = {}) {
data.method = `${path}depart`
return request(data, RequestMethods.GET)
}
/**
* 获取角色列表
* @param {*} data 参数
*/
export function FetchRoleList (data = {}) {
data.method = `fims.role.list`
return request(data, RequestMethods.GET)
}
......@@ -2,7 +2,7 @@
html, body {
margin: 0px;
height: 100%;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
#app {
@extend %full;
a {
......
......@@ -17,3 +17,9 @@
.el-tabs__item:focus.is-active.is-focus:not(:active) {
box-shadow: none !important;
}
.el-tabs__nav-scroll{
padding-left: 20px;
}
.el-color-picker__trigger{
border-color:rgba(255,255,255,.1)
}
\ No newline at end of file
// 主题名称
$theme-name: 'blue';
// diff
$private-left-side-color:#652DED;
// diff
$private-menu-active-background-color:#521ADA;
$private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF;
// 主题背景颜色
$theme-bg-color: $private-left-side-color;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// 主区域背景色 --- limin diff
$theme-container-main-background-color:#F5F5F5;
// container组件
$theme-container-background-color: rgba(#FFF, 1);
$theme-container-header-footer-background-color: rgb(255, 255, 255);
$theme-container-border-inner: 1px solid $color-border-1;
$theme-container-border-outer: 1px solid #E7EAEC;
$theme-multiple-page-control-color: #888;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: $private-menu-text-color;
$theme-multiple-page-control-nav-next-color: $private-menu-text-color;
$theme-multiple-page-control-border-color: #E7EAEC;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .2);
$theme-multiple-page-control-background-color-active: #FFF;
// hamberg --limin diff
$theme-header-hamberg-color:#FFF;
$theme-header-hamberg-color-hover:$private-menu-active-background-color;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 头部背景色 --- limin
$theme-header-background-color:$private-left-side-color;
//logo 背景色 --- limin
$theme-header-logo-background-color:$private-left-side-color;
// 顶栏上的文字颜色 diff
$theme-header-item-color: $private-menu-text-color;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFF;
$theme-header-item-border-color-hover:rgba($theme-header-item-color-hover,.1);
$theme-header-item-background-color-hover: $private-item-hover;
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFF;
$theme-header-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFF;
$theme-header-item-background-color-active: rgba($private-menu-active-background-color, 1);
$theme-container-aside-background-color:linear-gradient(180deg, #6729ED 0%, #3E76E2 100%);
// 侧边栏上的文字颜色
$theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover;
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147;
$theme-aside-menu-empty-text-color: #1F3147;
$theme-aside-menu-empty-background-color: rgba(#FFF, .1);
$theme-aside-menu-empty-icon-color-hover: #FFEBA4;
$theme-aside-menu-empty-text-color-hover: #FFEBA4;
$theme-aside-menu-empty-background-color-hover: rgba(#FFF, .2);
\ No newline at end of file
// 主题名称
$theme-name: 'classic';
$private-left-side-color:#2A58AD;
$private-menu-active-background-color:#154190;
$private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF;
// 主题背景颜色
$theme-bg-color: $private-left-side-color;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// 主区域背景色 --- limin
$theme-container-main-background-color:#FFF;
// container组件
$theme-container-background-color: rgba(#FFF, 1);
$theme-container-header-footer-background-color: rgb(255, 255, 255);
$theme-container-border-inner: 1px solid $color-border-1;
$theme-container-border-outer: 1px solid #E7EAEC;
$theme-multiple-page-control-color: #888;
$theme-multiple-page-control-color-active: $color-text-normal;
// tab 页签 滚动条 左 箭头 按钮 颜色
$theme-multiple-page-control-nav-prev-color: $private-menu-text-color;
// tab 页签 滚动条 右 箭头 按钮 颜色
$theme-multiple-page-control-nav-next-color: $private-menu-text-color;
$theme-multiple-page-control-border-color: #E7EAEC;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .2);
$theme-multiple-page-control-background-color-active: #FFF;
// hamberg --limin
$theme-header-hamberg-color:$private-left-side-color;
$theme-header-hamberg-color-hover:$private-menu-active-background-color;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 头部背景色 --- limin
$theme-header-background-color:#F3F3F4;
//logo 背景色 --- limin
$theme-header-logo-background-color:$private-left-side-color;
// 顶栏上的文字颜色
$theme-header-item-color: #666;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFF;
$theme-header-item-border-color-hover:rgba($theme-header-item-color-hover,1);
$theme-header-item-background-color-hover: $private-item-hover;
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFF;
$theme-header-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFF;
$theme-header-item-background-color-active: rgba($private-menu-active-background-color, 1);
$theme-container-aside-background-color:'transparent';
// 侧边栏上的文字颜色
$theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover;
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147;
$theme-aside-menu-empty-text-color: #1F3147;
$theme-aside-menu-empty-background-color: rgba(#FFF, .1);
$theme-aside-menu-empty-icon-color-hover: #FFEBA4;
$theme-aside-menu-empty-text-color-hover: #FFEBA4;
$theme-aside-menu-empty-background-color-hover: rgba(#FFF, .2);
\ No newline at end of file
// 主题名称
$theme-name: 'd2';
// 主题背景颜色
$theme-bg-color: #ebf1f6;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// container组件
$theme-container-background-color: rgba(#FFF, 1);
$theme-container-header-footer-background-color: #FFF;
$theme-container-border-inner: 1px solid #cfd7e5;
$theme-container-border-outer: 1px solid #cfd7e5;
$theme-multiple-page-control-color: $color-text-normal;
$theme-multiple-page-control-color-active: #2f74ff;
$theme-multiple-page-control-nav-prev-color: #cfd7e5;
$theme-multiple-page-control-nav-next-color: #cfd7e5;
$theme-multiple-page-control-border-color: #cfd7e5;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#000, .03);
$theme-multiple-page-control-background-color-active: #FFF;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 顶栏上的文字颜色
$theme-header-item-color: $color-text-normal;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #2f74ff;
$theme-header-item-background-color-hover: rgba(#FFF, .5);
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #2f74ff;
$theme-header-item-background-color-focus: rgba(#FFF, .5);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #2f74ff;
$theme-header-item-background-color-active: rgba(#FFF, .5);
// 侧边栏上的文字颜色
$theme-aside-item-color: $color-text-normal;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #2f74ff;
$theme-aside-item-background-color-hover: rgba(#FFF, .5);
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #2f74ff;
$theme-aside-item-background-color-focus: rgba(#FFF, .5);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #2f74ff;
$theme-aside-item-background-color-active: rgba(#FFF, .5);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: $color-text-normal;
$theme-aside-menu-empty-text-color: $color-text-normal;
$theme-aside-menu-empty-background-color: rgba(#000, .03);
$theme-aside-menu-empty-icon-color-hover: $color-text-main;
$theme-aside-menu-empty-text-color-hover: $color-text-main;
$theme-aside-menu-empty-background-color-hover: rgba(#000, .05);
\ No newline at end of file
// 主题名称
$theme-name: 'dark';
$private-left-side-color:#314256;
$private-menu-active-background-color:#1F3147;
$private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF;
// 主题背景颜色
$theme-bg-color: $private-left-side-color;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// 主区域背景色 --- limin
$theme-container-main-background-color:#F5F5F5;
// container组件
$theme-container-background-color: rgba(#FFF, 1);
$theme-container-header-footer-background-color: #FFF;
$theme-container-border-inner: 1px solid $color-border-1;
$theme-container-border-outer: 1px solid #E7EAEC;
$theme-multiple-page-control-color: #888;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: $private-menu-text-color;
$theme-multiple-page-control-nav-next-color: $private-menu-text-color;
$theme-multiple-page-control-border-color: #E7EAEC;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .2);
$theme-multiple-page-control-background-color-active: #FFF;
// hamberg --limin
$theme-header-hamberg-color:#FFF;
$theme-header-hamberg-color-hover:$private-menu-active-background-color;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 头部背景色 --- limin
$theme-header-background-color:#3B4F67;
//logo 背景色 --- limin
$theme-header-logo-background-color:$private-left-side-color;
// 顶栏上的文字颜色
$theme-header-item-color: $private-menu-text-color;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFF;
$theme-header-item-border-color-hover:rgba($theme-header-item-color-hover,.1);
$theme-header-item-background-color-hover: $private-item-hover;
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFF;
$theme-header-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFF;
$theme-header-item-background-color-active: rgba($private-menu-active-background-color, 1);
$theme-container-aside-background-color:'transparent';
// 侧边栏上的文字颜色
$theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover;
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147;
$theme-aside-menu-empty-text-color: #1F3147;
$theme-aside-menu-empty-background-color: rgba(#FFF, .1);
$theme-aside-menu-empty-icon-color-hover: #FFEBA4;
$theme-aside-menu-empty-text-color-hover: #FFEBA4;
$theme-aside-menu-empty-background-color-hover: rgba(#FFF, .2);
\ No newline at end of file
// 主题名称
$theme-name: 'line';
// 主题背景颜色
$theme-bg-color: #f8f8f9;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// container组件
$theme-container-background-color: rgba(#FFF, .8);
$theme-container-header-footer-background-color: #FFF;
$theme-container-border-inner: 1px solid $color-border-2;
$theme-container-border-outer: 1px solid #cfd7e5;
$theme-multiple-page-control-color: #FFF;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: #cfd7e5;
$theme-multiple-page-control-nav-next-color: #cfd7e5;
$theme-multiple-page-control-border-color: #cfd7e5;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: #cfd7e5;
$theme-multiple-page-control-background-color-active: #FFF;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #EFEFEF;
// 顶栏上的文字颜色
$theme-header-item-color: $color-text-normal;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: $color-text-main;
$theme-header-item-background-color-hover: rgba(#000, .02);
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: $color-text-main;
$theme-header-item-background-color-focus: rgba(#000, .02);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: $color-text-main;
$theme-header-item-background-color-active: rgba(#000, .03);
// 侧边栏上的文字颜色
$theme-aside-item-color: $color-text-normal;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: $color-text-main;
$theme-aside-item-background-color-hover: rgba(#000, .02);
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: $color-text-main;
$theme-aside-item-background-color-focus: rgba(#000, .02);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: $color-text-main;
$theme-aside-item-background-color-active: rgba(#000, .03);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: $color-text-normal;
$theme-aside-menu-empty-text-color: $color-text-normal;
$theme-aside-menu-empty-background-color: rgba(#000, .03);
$theme-aside-menu-empty-icon-color-hover: $color-text-main;
$theme-aside-menu-empty-text-color-hover: $color-text-main;
$theme-aside-menu-empty-background-color-hover: rgba(#000, .05);
\ No newline at end of file
// 主题名称
$theme-name: 'plane';
// diff
$private-left-side-color:transparent;
// diff
$private-menu-active-background-color:#002253;
$private-item-hover:rgba(#000,.05);
$private-menu-text-color:#C4D0DF;
// 主题背景颜色
$theme-bg-color: $private-left-side-color;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// 主区域背景色 --- limin diff
$theme-container-main-background-color:transparent;
// container组件
$theme-container-background-color: rgba(#FFF, 1);
$theme-container-header-footer-background-color: rgb(255, 255, 255);
$theme-container-border-inner: 1px solid $color-border-1;
$theme-container-border-outer: 1px solid #E7EAEC;
$theme-multiple-page-control-color: #888;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: $private-menu-text-color;
$theme-multiple-page-control-nav-next-color: $private-menu-text-color;
$theme-multiple-page-control-border-color: #E7EAEC;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .8);
$theme-multiple-page-control-background-color-active: #FFF;
// hamberg --limin diff
$theme-header-hamberg-color:#FFF;
$theme-header-hamberg-color-hover:$private-menu-active-background-color;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 头部背景色 --- limin
$theme-header-background-color:$private-left-side-color;
//logo 背景色 --- limin
$theme-header-logo-background-color:$private-left-side-color;
// 顶栏上的文字颜色 diff
$theme-header-item-color: $private-menu-text-color;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFF;
$theme-header-item-border-color-hover:rgba($theme-header-item-color-hover,.1);
$theme-header-item-background-color-hover: $private-item-hover;
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFF;
$theme-header-item-background-color-focus: rgba($private-menu-active-background-color, .2);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFF;
$theme-header-item-background-color-active: rgba($private-menu-active-background-color, 1);
$theme-container-aside-background-color:'transparent';
// 侧边栏上的文字颜色
$theme-aside-item-color: $private-menu-text-color;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: $private-item-hover;
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba($private-menu-active-background-color, 1);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba($private-menu-active-background-color, 1);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #1F3147;
$theme-aside-menu-empty-text-color: #1F3147;
$theme-aside-menu-empty-background-color: rgba(#FFF, .1);
$theme-aside-menu-empty-icon-color-hover: #FFEBA4;
$theme-aside-menu-empty-text-color-hover: #FFEBA4;
$theme-aside-menu-empty-background-color-hover: rgba(#FFF, .2);
\ No newline at end of file
@import '~@/assets/style/theme/theme-base.scss';
@import '~@/assets/style/theme/d2/index.scss';
@import '~@/assets/style/theme/line/index.scss';
@import '~@/assets/style/theme/star/index.scss';
@import '~@/assets/style/theme/tomorrow-night-blue/index.scss';
@import '~@/assets/style/theme/violet/index.scss';
\ No newline at end of file
// @import '~@/assets/style/theme/d2/index.scss';
// @import '~@/assets/style/theme/line/index.scss';
// @import '~@/assets/style/theme/star/index.scss';
// @import '~@/assets/style/theme/tomorrow-night-blue/index.scss';
// @import '~@/assets/style/theme/violet/index.scss';
@import '~@/assets/style/theme/classic/index.scss';
@import '~@/assets/style/theme/dark/index.scss';
@import '~@/assets/style/theme/blue/index.scss';
@import '~@/assets/style/theme/plane/index.scss';
\ No newline at end of file
// 主题名称
$theme-name: 'star';
// 主题背景颜色
$theme-bg-color: #EFF4F8;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, .3);
// container组件
$theme-container-background-color: rgba(#FFF, .9);
$theme-container-header-footer-background-color: #FFF;
$theme-container-border-inner: 1px solid $color-border-1;
$theme-container-border-outer: 1px solid #114450;
$theme-multiple-page-control-color: #FFF;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: #FFF;
$theme-multiple-page-control-nav-next-color: #FFF;
$theme-multiple-page-control-border-color: #114450;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .5);
$theme-multiple-page-control-background-color-active: #FFF;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 顶栏上的文字颜色
$theme-header-item-color: #FFF;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFF;
$theme-header-item-background-color-hover: rgba(#000, .2);
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFF;
$theme-header-item-background-color-focus: rgba(#000, .2);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFF;
$theme-header-item-background-color-active: rgba(#000, .3);
// 侧边栏上的文字颜色
$theme-aside-item-color: #FFF;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: rgba(#000, .2);
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: rgba(#000, .2);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: rgba(#000, .3);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #FFF;
$theme-aside-menu-empty-text-color: #FFF;
$theme-aside-menu-empty-background-color: rgba(#FFF, .2);
$theme-aside-menu-empty-icon-color-hover: #FFF;
$theme-aside-menu-empty-text-color-hover: #FFF;
$theme-aside-menu-empty-background-color-hover: rgba(#FFF, .3);
\ No newline at end of file
......@@ -27,7 +27,7 @@
.d2-layout-header-aside-content {
@extend %full;
.d2-theme-header {
height: 60px;
height: 58px;
.d2-theme-header-menu {
overflow: hidden;
&.is-scrollable {
......@@ -85,9 +85,10 @@
padding: 0px;
position: relative;
overflow: hidden;
transition: .1s ease;
.d2-theme-container-main-layer {
position: absolute;
top: 0px;
top: 2px;
bottom: 0px;
left: 0px;
right: 0px;
......@@ -109,6 +110,7 @@
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
transition: 3s ease;
}
// 主体
.d2-layout-header-aside-content {
......@@ -120,23 +122,14 @@
float: left;
text-align: center;
img {
height: 60px;
height: 65px;
transform: translateX(-16px);
}
}
// 折叠侧边栏切换按钮
// .toggle-aside-btn {
// float: left;
// height: 60px;
// width: 60px;
// display: flex;
// justify-content: center;
// align-items: center;
// @extend %unable-select;
// i {
// font-size: 20px;
// margin-top: 4px;
// }
// }
.toggle-aside-btn {
margin-left: 26px;
}
// [菜单] 顶栏
.el-menu {
float: left;
......
......@@ -17,7 +17,6 @@
background: $theme-bg-mask;
}
}
// 菜单项目
@mixin theme-menu-hover-style {
color: $theme-menu-item-color-hover;
......@@ -63,6 +62,10 @@
// 顶栏
.d2-theme-header {
background-color: $theme-header-background-color;
.d2-theme-header-logo{
background-color: $theme-header-logo-background-color
}
// 顶栏菜单空间不足时显示的滚动控件
.d2-theme-header-menu {
.d2-theme-header-menu__prev, .d2-theme-header-menu__next {
......@@ -77,10 +80,10 @@
// 切换按钮
.toggle-aside-btn {
// i {
fill: $theme-header-item-color;
fill: $theme-header-hamberg-color;
background: $theme-header-item-background-color;
&:hover {
fill: $theme-header-item-color-hover;
fill: $theme-header-hamberg-color-hover;
}
// }
}
......@@ -149,7 +152,8 @@
&.can-hover {
&:hover {
color: $theme-header-item-color-hover;
background: $theme-header-item-background-color-hover;
background-color: $theme-header-item-background-color-hover;
border-color:$theme-header-item-border-color-hover;
}
}
}
......@@ -159,6 +163,7 @@
.d2-theme-container {
// 侧边栏
.d2-theme-container-aside {
background: $theme-container-aside-background-color;
// 菜单为空的时候显示的信息
.d2-layout-header-aside-menu-empty {
background: $theme-aside-menu-empty-background-color;
......@@ -236,6 +241,10 @@
}
}
.d2-theme-container-main {
background-color: $theme-container-main-background-color;
&.is-search{
background-color: rgba($theme-header-background-color,.5)
}
// 主体部分分为多页面控制器 和主体
.d2-theme-container-main-header {
// 多页面控制器
......
// 主题名称
$theme-name: 'tomorrow-night-blue';
// 主题背景颜色
$theme-bg-color: #002253;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// container组件
$theme-container-background-color: rgba(#FFF, 1);
$theme-container-header-footer-background-color: #FFF;
$theme-container-border-inner: 1px solid $color-border-1;
$theme-container-border-outer: 1px solid #002253;
$theme-multiple-page-control-color: #FFF;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: #FFF;
$theme-multiple-page-control-nav-next-color: #FFF;
$theme-multiple-page-control-border-color: #002253;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .2);
$theme-multiple-page-control-background-color-active: #FFF;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 顶栏上的文字颜色
$theme-header-item-color: #FF929A;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFEBA4;
$theme-header-item-background-color-hover: rgba(#FFF, .05);
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFB870;
$theme-header-item-background-color-focus: rgba(#FFF, .05);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFB870;
$theme-header-item-background-color-active: rgba(#FFF, .05);
// 侧边栏上的文字颜色
$theme-aside-item-color: #FF929A;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFEBA4;
$theme-aside-item-background-color-hover: rgba(#FFF, .05);
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFB870;
$theme-aside-item-background-color-focus: rgba(#FFF, .05);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFB870;
$theme-aside-item-background-color-active: rgba(#FFF, .05);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #FFB870;
$theme-aside-menu-empty-text-color: #FFB870;
$theme-aside-menu-empty-background-color: rgba(#FFF, .1);
$theme-aside-menu-empty-icon-color-hover: #FFEBA4;
$theme-aside-menu-empty-text-color-hover: #FFEBA4;
$theme-aside-menu-empty-background-color-hover: rgba(#FFF, .2);
\ No newline at end of file
@import './setting.scss';
@import '../theme.scss';
.theme-#{$theme-name} {
.d2-layout-header-aside-group {
background: #bc00e3;
background: linear-gradient(120deg, #bc00e3 0%, #4EFFFB 100%);
}
}
\ No newline at end of file
// 主题名称
$theme-name: 'violet';
// 主题背景颜色
$theme-bg-color: #000;
// 主题背景图片遮罩
$theme-bg-mask: rgba(#000, 0);
// container组件
$theme-container-background-color: #FFF;
$theme-container-header-footer-background-color: #FFF;
$theme-container-border-inner: 1px solid $color-border-2;
$theme-container-border-outer: 1px solid #8C40E2;
$theme-multiple-page-control-color: #FFF;
$theme-multiple-page-control-color-active: $color-text-normal;
$theme-multiple-page-control-nav-prev-color: #FFF;
$theme-multiple-page-control-nav-next-color: #FFF;
$theme-multiple-page-control-border-color: #8C40E2;
$theme-multiple-page-control-border-color-active: #FFF;
$theme-multiple-page-control-background-color: rgba(#FFF, .3);
$theme-multiple-page-control-background-color-active: #FFF;
// 顶栏和侧边栏中展开的菜单 hover 状态下
$theme-menu-item-color-hover: #293849;
$theme-menu-item-background-color-hover: #ecf5ff;
// 顶栏上的文字颜色
$theme-header-item-color: #FFF;
$theme-header-item-background-color: transparent;
// 顶栏上的项目在 hover 时
$theme-header-item-color-hover: #FFF;
$theme-header-item-background-color-hover: linear-gradient(-180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.12) 100%);
// 顶栏上的项目在 focus 时
$theme-header-item-color-focus: #FFF;
$theme-header-item-background-color-focus: linear-gradient(-180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.12) 100%);
// 顶栏上的项目在 active 时
$theme-header-item-color-active: #FFF;
$theme-header-item-background-color-active: linear-gradient(-180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.12) 100%);
// 侧边栏上的文字颜色
$theme-aside-item-color: #FFF;
$theme-aside-item-background-color: transparent;
// 侧边栏上的项目在 hover 时
$theme-aside-item-color-hover: #FFF;
$theme-aside-item-background-color-hover: linear-gradient(90deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.00) 100%);
// 侧边栏上的项目在 focus 时
$theme-aside-item-color-focus: #FFF;
$theme-aside-item-background-color-focus: linear-gradient(90deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.00) 100%);
// 侧边栏上的项目在 active 时
$theme-aside-item-color-active: #FFF;
$theme-aside-item-background-color-active: linear-gradient(90deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.00) 100%);
// 侧边栏菜单为空的时候显示的元素
$theme-aside-menu-empty-icon-color: #FFF;
$theme-aside-menu-empty-text-color: #FFF;
$theme-aside-menu-empty-background-color: rgba(#000, .1);
$theme-aside-menu-empty-icon-color-hover: #FFF;
$theme-aside-menu-empty-text-color-hover: #FFF;
$theme-aside-menu-empty-background-color-hover: rgba(#000, .15);
\ No newline at end of file
/*
* @Author: limin
* @Date: 2019-09-01 19:06:01
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 19:06:01
*/
export const BaseData = {
ROLE: 'role',
COMPANY: 'company',
DEPART: 'depart',
STATION: 'station'
}
......@@ -9,7 +9,7 @@
</template>
<script>
import {mapGetters} from 'vuex'
import { mapGetters } from 'vuex'
export default {
name: 'AuthButton',
props: {
......@@ -43,20 +43,18 @@ export default {
},
data () {
return {
isInRole:false
isInRole: false
}
},
created () {
// this.$vrm.setRoles(this.btnIdAll)
const {action,operation} = this.curBtns
this.isInRole = [...action,...operation].find(obj=>obj.id===this.id||obj.label===this.label)
const { action, operation } = this.curBtns
this.isInRole = [...action, ...operation].find(obj => obj.id === this.id || obj.label === this.label)
},
methods: {
handleClick: function () {
this.$emit('e-auth-click', {})
}
},
mounted () {
}
}
</script>
......
......@@ -5,7 +5,7 @@ import d2ContainerGhost from './components/d2-container-ghost.vue'
import d2ContainerGhostBs from './components/d2-container-ghost-bs.vue'
import d2ContainerCard from './components/d2-container-card.vue'
import d2ContainerCardBs from './components/d2-container-card-bs.vue'
import d2Source from './components/d2-source.vue'
// import d2Source from './components/d2-source.vue'
export default {
name: 'd2-container',
......@@ -51,8 +51,8 @@ export default {
on: {
scroll: e => this.$emit('scroll', e)
}
}, slots),
h(d2Source)
}, slots)
// h(d2Source)
])
},
methods: {
......
/*
* @Author: limin
* @Date: 2019-08-31 12:44:16
* @Last Modified by: limin
* @Last Modified time: 2019-08-31 12:44:16
*/
import Vue from 'vue'
import focus from './src/focus'
Vue.directive(focus.name, focus)
/*
* @Author: limin
* @Date: 2019-08-31 12:44:08
* @Last Modified by: limin
* @Last Modified time: 2019-08-31 12:44:08
*/
export default {
name: 'focus',
inserted: function (el) {
el.querySelector('input').focus()
}
}
......@@ -15,26 +15,24 @@ export default {
data () {
return {
predefine: [
'#ff4500',
'#ff8c00',
'#ffd700',
'#90ee90',
'#00ced1',
'#1e90ff',
'#c71585'
'#FF0000', '#008000', '#0000FF'
]
}
},
computed: {
...mapState('d2admin/color', [
'value'
])
...mapState('d2admin', {
value: state => state.color.value,
listTheme: state => state.theme.list
})
},
watch: {
value (value) {
this.set(value)
}
},
mounted () {
this.predefine = [...this.predefine, ...this.listTheme.map(theme => theme.color)]
},
methods: {
...mapActions('d2admin/color', [
'set'
......
......@@ -39,12 +39,12 @@ export default {
}),
handleChange (value) {
this.sizeSet(value)
this.$notify({
title: '提示',
dangerouslyUseHTMLString: true,
message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>',
type: 'success'
})
// this.$notify({
// title: '提示',
// dangerouslyUseHTMLString: true,
// message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>',
// type: 'success'
// })
},
iconName (name) {
return name === this.value ? 'dot-circle-o' : 'circle-o'
......
......@@ -23,15 +23,16 @@
<template slot-scope="scope">
<el-button
v-if="activeName === scope.row.name"
type="success"
type="primary"
icon="el-icon-check"
class="btn-active-success"
round>
已激活
</el-button>
<el-button
v-else
round
@click="handleSelectTheme(scope.row.name)">
@click="handleSelectTheme(scope.row)">
使用
</el-button>
</template>
......@@ -61,8 +62,11 @@ export default {
...mapActions('d2admin/theme', [
'set'
]),
handleSelectTheme (name) {
...mapActions('d2admin/color', { setColor: 'set' }),
handleSelectTheme (row) {
const { name, color } = row
this.set(name)
this.setColor(color)
}
}
}
......@@ -77,3 +81,10 @@ export default {
border: 1px solid $color-border-1;
}
</style>
<style lang="scss">
.btn-active-success{
&:hover{
background-color: "#67C23A" !important;
}
}
</style>
......@@ -10,8 +10,8 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>-->
<div v-popover:popover-personal class="d2-mr">
<span class="btn-text">{{info.name ? `你好 ${info.name}` : '未登录'}}</span>
<div v-popover:popover-personal class="d2-mr personal-wrap">
<span class="btn-text">{{info.name ? `${info.name}` : '未登录'}}</span>
<el-popover ref="popover-personal" placement="bottom-end" trigger="hover">
<personal-panel :user="info"></personal-panel>
</el-popover>
......@@ -66,3 +66,11 @@ export default {
}
}
</script>
<style lang="scss" scoped>
.personal-wrap{
transform: translateY(-3px);
.btn-text{
text-shadow: 0 1px 1px#666;
}
}
</style>
......@@ -121,13 +121,6 @@ export default {
// }
// }
},
watch: {
// passwordDialogVisible(val) {
// this.$validator.errors.clear()
// }
},
mounted () {
},
methods: {
// 修改密码
......
......@@ -121,8 +121,6 @@ export default {
// }
// }
},
mounted () {
},
methods: {
// getPersonalType() {
// const params = {}
......
......@@ -9,8 +9,7 @@ export default {
menuMixin
],
render (createElement) {
return createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-side' }
}, [
return createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-side' } }, [
createElement('el-menu', {
props: { collapse: this.asideCollapse, uniqueOpened: true, defaultActive: this.active },
ref: 'menu',
......@@ -71,9 +70,6 @@ export default {
// }
})
},
test () {
alert(111)
},
scrollDestroy () {
// https://github.com/d2-projects/d2-admin/issues/75
try {
......
......@@ -7,9 +7,10 @@
flex-box="0"
flex="dir:top main:center cross:center"
@click.self="handlePanelClick">
<d2-icon-svg
<!-- <d2-icon-svg
class="panel-search__logo"
name="d2-admin-text"/>
name="d2-admin-text"/> -->
<img src="./image/logo.png" alt="">
<el-autocomplete
class="panel-search__input"
ref="input"
......
<template>
<div class="personal-panel">
<div class="personal-desc" >
<div class="personal-desc">
<div class="avatar-container">
<avatar :username="user.name"></avatar>
<!-- <img class="avatar" :src="require('@/assets/user.png')" /> -->
<el-avatar
:size="'large'"
:src="'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'"
></el-avatar>
</div>
<div class="name-role">
<span class="sender">{{ user.name }} - {{ user.role||'超级管理员' }}</span>
......@@ -19,53 +21,35 @@
<span class="relation-item">followers</span>
<span class="relation-item">watches</span>
<span class="relation-item">friends</span>
</div> -->
</div>-->
<div class="main-operation">
<span class="main-operation-item">
<el-button size="small" icon="fa fa-male" @click="openUserMsgDialog()"> 个人中心</el-button>
<el-button size="small" icon="fa fa-male" @click="openUserMsgDialog()">个人中心</el-button>
</span>
<span class="main-operation-item">
<el-button size="small" icon="fa fa-key"> 修改密码</el-button>
<el-button size="small" icon="fa fa-key">修改密码</el-button>
</span>
</div>
<div class="other-operation">
<div class="other-operation" @click="clear">
<div class="other-operation-item">
<li class="fa fa-eraser"></li>
<i class="fa fa-eraser"></i>
清除缓存
</div>
<!-- <div class="other-operation-item">
<li class="fa fa-user"></li>
在线人数
</div>
<div class="other-operation-item">
<li class="fa fa-bell"></li>
访问次数
</div>
<div class="other-operation-item" @click="showBackupDialog">
<li class="fa fa-undo"></li>
{{$t("common.backupRestore")}}
</div> -->
</div>
<div class="personal-footer" @click="logout">
<li class="fa fa-sign-out"></li>
<div class="personal-footer" @click="logOut">
<i class="fa fa-sign-out"></i>
注销
</div>
<!--备份还原界面-->
<!-- <backup ref="backupDialog" @afterRestore="afterRestore"></backup> -->
</div>
</template>
<script>
import Cookies from 'js-cookie'
// import Backup from "@/views/Backup/Backup"
import Avatar from 'vue-avatar'
import { mapState, mapActions } from 'vuex'
import { Message, MessageBox } from 'element-ui'
export default {
name: 'PersonalPanel',
components: {
// Backup
Avatar
},
props: {
user: {
type: Object,
......@@ -77,51 +61,78 @@ export default {
}
}
},
computed: {
...mapState('d2admin/user', ['info'])
},
data () {
return {
}
return {}
},
methods: {
// 退出登录
logout: function () {
this.$confirm('确认退出吗?', '提示', {
...mapActions('d2admin/account', ['logout']),
/**
* @description 登出
*/
logOut () {
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm('确定要注销当前用户吗', '注销用户', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
sessionStorage.removeItem('user')
this.deleteCookie('token')
}).then(async () => {
await this.$store.commit('d2admin/gray/set', false)
// await this.$store.dispatch('d2admin/user/set', {})
await this.logout()
this.$router.push('/login')
this.$api.login.logout().then((res) => {
}).catch(function (res) {
})
.catch(() => {
this.$store.commit('d2admin/gray/set', false)
Message({
message: '取消注销操作'
})
})
.catch(() => {})
},
// 删除cookie
deleteCookie: function (name) {
Cookies.remove(name)
},
// 打开备份还原界面
showBackupDialog: function () {
this.$refs.backupDialog.setBackupVisible(true)
clear () {
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm('清空缓存将重置所有个性化设置并退出到登录界面', '清空缓存', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await this.$store.commit('d2admin/gray/set', false)
localStorage.clear();
window.location.reload()
})
.catch(() => {
this.$store.commit('d2admin/gray/set', false)
Message({
message: '取消清除缓存操作'
})
})
},
// 成功还原之后,重新登录
afterRestore: function () {
this.$refs.backupDialog.setBackupVisible(false)
sessionStorage.removeItem('user')
this.deleteCookie('token')
this.$router.push('/login')
this.$api.login.logout().then((res) => {
}).catch(function (res) {
comfirm (text, title, cancleText) {
return new Promise((reject, resolve) => {
this.$store.commit('d2admin/gray/set', true)
MessageBox.confirm(text, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
await this.$store.commit('d2admin/gray/set', false)
resolve(true)
})
.catch(() => {
this.$store.commit('d2admin/gray/set', false)
Message({
message: cancleText
})
reject()
})
})
},
// 打开个人信息弹出框
openUserMsgDialog: function () {
console.log('aaaa')
}
},
mounted () {
}
}
</script>
......@@ -147,9 +158,9 @@ export default {
height: 80px;
border-radius: 90px;
}
.avatar-container{
display:inline-block;
align:center;
.avatar-container {
display: inline-block;
text-align: center;
}
.name-role {
font-size: 14px;
......@@ -180,7 +191,7 @@ export default {
margin: 4px;
}
.other-operation {
padding: 15px;
padding: 10px;
margin-right: 1px;
text-align: left;
border-color: rgba(180, 190, 190, 0.2);
......@@ -188,7 +199,7 @@ export default {
border-top-style: solid;
}
.other-operation-item {
padding:0 12px;
padding: 4px 8px;
}
.other-operation-item:hover {
cursor: pointer;
......
......@@ -15,7 +15,7 @@
}"
flex-box="0"
flex>
<div class="logo-group" :style="{width: asideCollapse ? asideWidthCollapse : asideWidth}" flex-box="0">
<div class="logo-group d2-theme-header-logo" :class="asideCollapse ? 'logo-only' : 'logo-all'" flex-box="0">
<img v-if="asideCollapse" :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/icon-only.png`">
<img v-else :src="`${$baseUrl}image/theme/${themeActiveSetting.name}/logo/all.png`">
</div>
......@@ -28,10 +28,10 @@
<div class="d2-header-right" flex-box="0">
<!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" -->
<d2-header-search @click="handleSearchClick"/>
<d2-header-log />
<!-- <d2-header-size /> -->
<d2-header-log v-if="$env === 'development'"/>
<d2-header-size/>
<d2-header-fullscreen/>
<d2-header-locales />
<d2-header-locales v-if="$env === 'development'"/>
<d2-header-theme/>
<d2-header-color/>
<d2-header-user/>
......@@ -51,7 +51,7 @@
<d2-menu-side/>
</div>
<!-- 主体 -->
<div class="d2-theme-container-main" flex-box="1" flex>
<div class="d2-theme-container-main" :class="this.searchActive ? 'is-search' : ''" flex-box="1" flex>
<!-- 搜索 -->
<transition name="fade-scale">
<div v-if="searchActive" class="d2-theme-container-main-layer" flex>
......@@ -69,7 +69,7 @@
</div>
<!-- 页面 -->
<div class="d2-theme-container-main-body" flex-box="1">
<transition :name="transitionActive ? 'fade-transverse' : ''" mode="in-out">
<transition :name="transitionActive ? 'el-fade-in' : ''" mode="linear">
<keep-alive :include="keepAlive">
<router-view/>
</keep-alive>
......@@ -125,6 +125,8 @@ export default {
asideWidthCollapse: '65px'
}
},
mounted () {
},
computed: {
...mapState('d2admin', {
keepAlive: state => state.page.keepAlive,
......@@ -163,4 +165,20 @@ export default {
<style lang="scss">
// 注册主题
@import '~@/assets/style/theme/register.scss';
.d2-theme-header-logo{
}
.logo-all{
width: 200px;
img{
height: 75px !important;
transform: translate3d(-8px, -6px, 0) !important;
}
}
.logo-only{
width:65px;
img{
height: 35px !important;
transform: translate3d(0px,12px,0) !important;
}
}
</style>
......@@ -14,23 +14,23 @@ permision.packRoutesBtns = function (resources, idsInPermision) {
if (!resources || !idsInPermision || !idsInPermision.length) {
throw new Error('参数错误')
}
let __aRouteInPermision = [],
__oBtnInPermision = {},
let __aRouteInPermision = []
let __oBtnInPermision = {}
// __aBtnIdAll=[],
__objResource = null
let __objResource = null
idsInPermision.forEach(obj => {
__objResource = resources[obj.id]
if(__objResource){//直接能取到的为路由 (也可以在routes 中定标识变量)
__aRouteInPermision.push(resources[obj.id])//push 进 路由数组
}else{ //如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
if (__objResource) { // 直接能取到的为路由 (也可以在routes 中定标识变量)
__aRouteInPermision.push(resources[obj.id])// push 进 路由数组
} else { // 如果取不到 判断是否有父节点 并且父节点是否有auth属性 有 则视为按钮 (同样可以定义标识变量)
__objResource = resources[obj.pid]
if(__objResource && __objResource.auth && !__oBtnInPermision[obj.pid]){
__oBtnInPermision[obj.pid]=__objResource.auth
if (__objResource && __objResource.auth && !__oBtnInPermision[obj.pid]) {
__oBtnInPermision[obj.pid] = __objResource.auth
// __aBtnIdAll = __aBtnIdAll.concat([...__objResource.auth.action.map(o=>o.id),...__objResource.auth.operation.map(o=>o.id)])
}
}
})
return {'route':__aRouteInPermision,'btn':__oBtnInPermision}
return { 'route': __aRouteInPermision, 'btn': __oBtnInPermision }
}
/**
......@@ -49,12 +49,12 @@ permision.packAsideMenus = function (resources, idsInPermision) {
*/
idsInPermision.forEach(obj => {
const __oMenu = permision.format2Menu(resources[obj.id])
if(!__oMenu){ //不存在 可能是 按钮 直接继续循环
if (!__oMenu) { // 不存在 可能是 按钮 直接继续循环
return true
}
if (obj.pid === '0') {//取出1级菜单
if (obj.pid === '0') { // 取出1级菜单
__aMenusInPermision.push(__oMenu)
} else {//取出子菜单
} else { // 取出子菜单
__aSub.push(__oMenu)
}
})
......@@ -77,7 +77,7 @@ permision.packAsideMenus = function (resources, idsInPermision) {
* 格式化菜单 封装成系统所需格式
*/
permision.format2Menu = function (oMenu) {
if(!oMenu) return null
if (!oMenu) return null
const { icon, path, meta } = oMenu
const { title, id, pid } = meta
return { title, icon, path, id, pid }
......
......@@ -7,30 +7,28 @@ import d2Admin from '@/plugin/d2admin'
// store
import store from '@/store/index'
import D2Crud from '@d2-projects/d2-crud'
// import D2Crud from '@d2-projects/d2-crud'
// 菜单和路由设置
import router from './router'
// import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes'
import echarts from 'echarts'
import VRM from 'vue-role-manager'
Vue.use(VRM, {
router,
redirect: '403',
enabled: false
})
// import VRM from 'vue-role-manager'
// Vue.use(VRM, {
// router,
// redirect: '403',
// enabled: false
// })
// 核心插件
Vue.use(d2Admin)
Vue.use(D2Crud)
Vue.prototype.$echarts = echarts
// Vue.use(D2Crud)
new Vue({
router,
store,
i18n,
render: h => h(App),
created () {
// created () {
// 处理路由 得到每一级的路由设置
// this.$store.commit('d2admin/page/init', frameInRoutes)
// 设置顶栏菜单 (暂时不需要)
......@@ -39,7 +37,7 @@ new Vue({
// this.$store.commit('d2admin/menu/asideSet', menuAside)
// 初始化菜单搜索功能
// this.$store.commit('d2admin/search/init', menuHeader)
},
// },
mounted () {
// 展示系统信息
this.$store.commit('d2admin/releases/versionShow')
......
// Element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import 'element-ui/lib/theme-chalk/index.css'
// flex 布局库
import 'flex.css'
// 组件
import '@/components'
// svg 图标
import '@/assets/svg-icons'
// 指令
import '@/directives'
// 功能插件
import pluginError from '@/plugin/error'
......@@ -29,7 +31,7 @@ export default {
// 事件传递
Vue.prototype.$event = new Vue()
// Element
Vue.use(ElementUI)
Vue.use(ElementUI, { size: 'medium', zIndex: 3000 })
// 插件
Vue.use(pluginError)
Vue.use(pluginLog)
......
......@@ -14,7 +14,7 @@ import routes from './routes'
const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin
VueRouter.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
return originalPush.call(this, location) && originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
......@@ -39,6 +39,7 @@ router.beforeEach(async (to, from, next) => {
store.commit('d2admin/search/set', false)
if (from.name === null && to.path !== '/login' && !source) { // 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
await store.dispatch('d2admin/auth/init')
await store.dispatch('d2admin/account/load')
next(to.path)
} else if (to.matched.some(r => r.meta.auth)) { // 验证当前路由所有的匹配中是否需要有登录验证的
// 这里暂时将cookie里是否存有token作为验证是否登录的条件
......@@ -55,7 +56,6 @@ router.beforeEach(async (to, from, next) => {
redirect: to.fullPath
}
})
// https://github.com/d2-projects/d2-admin/issues/138
NProgress.done()
}
} else {
......
......@@ -17,7 +17,7 @@ const frameIn = [{
* 首页
*/
export const home = {
path: 'index',
path: '/index',
name: 'index',
icon: 'desktop',
meta: {
......@@ -28,10 +28,10 @@ export const home = {
},
component: _import('systemMonitor')
}
export const sys =[
export const sys = [
// 系统 前端日志
{
path: 'log',
path: '/log',
name: 'log',
meta: {
title: '前端日志',
......@@ -41,7 +41,7 @@ export const sys =[
},
// 刷新页面 必须保留
{
path: 'refresh',
path: '/refresh',
name: 'refresh',
hidden: true,
component: _import('system/function/refresh')
......@@ -60,45 +60,48 @@ export const sys =[
*/
export const resources = {
'102': {
path: 'page',
path: '/page',
icon: 'folder-o',
name: '页面',
meta: {
auth: true,
title: '页面',
id: '102',
pid: '0'
pid: '0',
cache: true
}
},
'10201': {
path: '/page1',
name: '页面 1',
name: 'page1',
meta: {
auth: true,
title: '页面 1',
id: '10201',
pid: '102'
pid: '102',
cache: true
},
component: _import('demo/page1')
},
'10202': {
path: '/page2',
name: '页面 2',
name: 'page2',
meta: {
auth: true,
title: '页面 2',
id: '10202',
pid: '102'
pid: '102',
cache: true
},
component: _import('demo/page2'),
auth: {
'operation': [{ // 列表操作
id: '1020201',
pid:'10202',
pid: '10202',
label: '查看'
}, { //
id: '1020202',
pid:'10202',
pid: '10202',
label: '编辑'
}],
'action': [] // 按钮操作
......@@ -116,11 +119,11 @@ export const resources = {
auth: {
'operation': [{ // 列表操作
id: '1020301',
pid:'10203',
pid: '10203',
label: '查看'
}, { //
id: '1020302',
pid:'10203',
pid: '10203',
label: '编辑'
}],
'action': [] // 按钮操作
......@@ -129,7 +132,7 @@ export const resources = {
},
// '102': {
// path: 'trafficManagement',
// icon: 'folder-o',
// icon: 'train',
// name: '车辆管理',
// meta: {
// auth: true,
......@@ -140,8 +143,8 @@ export const resources = {
// component: _import('trafficManagement')
// },
'103': {
path: 'subSysManagement',
icon: 'folder-o',
path: '/subSysManagement',
icon: 'th-list',
name: '子系统管理',
meta: {
auth: true,
......@@ -152,55 +155,55 @@ export const resources = {
component: _import('subSysManagement')
},
'104': {
path: 'trafficManagement',
icon: 'folder-o',
path: '/trafficManagement',
icon: 'train',
name: '车辆管理',
meta: {
auth: true,
title: '车辆管理',
title: '物料管理',
id: '104',
pid: '0'
},
component: _import('trafficManagement')
component: _import('deviceManagement')
},
'105': {
path: 'bb',
icon: 'folder-o',
path: '/bb',
icon: 'file-text-o',
name: '单据管理',
meta: {
auth: true,
title: '单据管理',
id: '105',
id: '106',
pid: '0'
}
},
'10501': {
path: '/cc',
icon: 'folder-o',
'10601': {
path: '/materiaOrderManagement',
icon: 'archive',
name: '物料订单管理',
meta: {
auth: true,
title: '物料订单管理',
id: '10501',
pid: '105'
id: '10601',
pid: '106'
},
component: _import('trafficManagement')
component: _import('materiaOrderManagement')
},
'10502': {
path: '/dd',
icon: 'folder-o',
'10602': {
path: '/maintainManagement',
icon: 'list-ol',
name: '作业单管理',
meta: {
auth: true,
title: '作业单管理',
id: '10502',
pid: '105'
id: '10602',
pid: '106'
},
component: _import('trafficManagement')
component: _import('maintainManagement')
},
'107': {
path: 'user',
icon: 'folder-o',
path: '/user',
icon: 'users',
name: '用户管理',
meta: {
auth: true,
......@@ -212,6 +215,7 @@ export const resources = {
'10701': {
path: '/userManage',
name: '用户管理',
icon: 'user',
meta: {
auth: true,
title: '用户管理',
......@@ -223,6 +227,7 @@ export const resources = {
'10702': {
path: '/jurisdictionManage',
name: '权限管理',
icon: 'sitemap',
meta: {
auth: true,
title: '权限管理',
......@@ -234,6 +239,7 @@ export const resources = {
'10703': {
path: '/loginLogs',
name: '登录日志',
icon: 'file-text',
meta: {
auth: true,
title: '登录日志',
......@@ -243,8 +249,8 @@ export const resources = {
component: _import('userManage/loginLogs')
},
'108': {
path: 'reportingLogs',
icon: 'folder-o',
path: '/reportingLogs',
icon: 'upload',
name: '上报日志',
meta: {
auth: true,
......
......@@ -32,32 +32,57 @@ export default {
theme: {
list: [
{
title: 'd2admin 经典',
name: 'd2',
preview: 'image/theme/d2/preview@2x.png'
title: 'classic',
name: 'classic',
color: '#2A58AD',
preview: 'image/theme/classic/preview@2x.png'
},
{
title: '紫罗兰',
name: 'violet',
preview: 'image/theme/violet/preview@2x.png'
title: 'dark',
name: 'dark',
color: '#314256',
preview: 'image/theme/dark/preview@2x.png'
},
{
title: '简约线条',
name: 'line',
backgroundImage: 'image/theme/line/bg.jpg',
preview: 'image/theme/line/preview@2x.png'
title: 'blue',
name: 'blue',
color: '#652DED',
preview: 'image/theme/blue/preview@2x.png'
},
{
title: '流星',
name: 'star',
backgroundImage: 'image/theme/star/bg.jpg',
preview: 'image/theme/star/preview@2x.png'
},
{
title: 'Tomorrow Night Blue (vsCode)',
name: 'tomorrow-night-blue',
preview: 'image/theme/tomorrow-night-blue/preview@2x.png'
title: 'plane',
name: 'plane',
color: '#377DE7',
backgroundImage: 'image/theme/plane/bg.jpg',
preview: 'image/theme/plane/preview@2x.png'
}
// {
// title: 'd2admin 经典',
// name: 'd2',
// preview: 'image/theme/d2/preview@2x.png'
// },
// {
// title: '紫罗兰',
// name: 'violet',
// preview: 'image/theme/violet/preview@2x.png'
// },
// {
// title: '简约线条',
// name: 'line',
// backgroundImage: 'image/theme/line/bg.jpg',
// preview: 'image/theme/line/preview@2x.png'
// },
// {
// title: '流星',
// name: 'star',
// backgroundImage: 'image/theme/star/bg.jpg',
// preview: 'image/theme/star/preview@2x.png'
// },
// {
// title: 'Tomorrow Night Blue (vsCode)',
// name: 'tomorrow-night-blue',
// preview: 'image/theme/tomorrow-night-blue/preview@2x.png'
// }
]
},
// 是否默认开启页面切换动画
......
import { Message, MessageBox } from 'element-ui'
import util from '@/libs/util.js'
import router from '@/router'
import { AccountLogin } from '@api/sys.login'
import { AccountLogin } from '@api/sys.account'
export default {
namespaced: true,
actions: {
......@@ -32,17 +31,13 @@ export default {
util.cookies.set('uuid', res.uuid)
util.cookies.set('token', res.token)
const { user, resources } = res
// const __aRoutesInPermisions= util.permision.packRoutes(sources,resources)
// frameInRoutes[0].children=[dashboard,...__aRoutesInPermisions];
// router.addRoutes(frameInRoutes)
// const __aMenusInPermisions = util.permision.packAsideMenus(sources,resources)
// await commit('d2admin/page/init', frameInRoutes, { root: true })
// await commit('d2admin/menu/asideSet', [dashboard,...__aMenusInPermisions], { root: true })
await dispatch('d2admin/auth/set', resources, { root: true })
// 设置 vuex 用户信息
await dispatch('d2admin/user/set', {
name: user.name
}, { root: true })
// 强制初始化基础数据
await dispatch('d2admin/base/init', null, { root: true })
// 用户登录后从持久化数据加载一系列的设置
await dispatch('load')
// 结束
......@@ -63,38 +58,15 @@ export default {
/**
* @description 注销
*/
async function logout () {
return new Promise(async resolve => {
// 删除cookie
util.cookies.remove('token')
util.cookies.remove('uuid')
// 清空 vuex 用户信息
await dispatch('d2admin/user/set', {}, { root: true })
// await dispatch('d2admin/user/clear', null, { root: true })
// 跳转路由
router.push({
name: 'login'
})
}
// 判断是否需要确认
if (confirm) {
commit('d2admin/gray/set', true, { root: true })
MessageBox.confirm('确定要注销当前用户吗', '注销用户', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
commit('d2admin/gray/set', false, { root: true })
logout()
})
.catch(() => {
commit('d2admin/gray/set', false, { root: true })
Message({
message: '取消注销操作'
})
resolve()
})
} else {
logout()
}
},
/**
* @description 用户登录后从持久化数据加载一系列的设置
......@@ -112,8 +84,13 @@ export default {
await dispatch('d2admin/page/openedLoad', null, { root: true })
// DB -> store 持久化数据加载侧边栏折叠状态
await dispatch('d2admin/menu/asideCollapseLoad', null, { root: true })
// await dispatch('d2admin/size/set', 'medium', { root: true })
// DB -> store 持久化数据加载全局尺寸
await dispatch('d2admin/size/load', null, { root: true })
// DB - > 初始化 基础数据
// await dispatch('d2admin/base/init', null, { root: true })
// // store 设置系统主色
// await dispatch('d2admin/color/set', process.env.VUE_APP_MAIN_COLOR)
// 后台接口 -> store
// await dispatch('d2admin/auth/init', null, { root: true })
// end
......
......@@ -2,18 +2,18 @@
* @Author: limin
* @Date: 2019-08-27 17:25:12
* @Last Modified by: limin
* @Last Modified time: 2019-08-29 00:53:59
* @Last Modified time: 2019-09-01 19:00:46
*/
import util from '@/libs/util.js'
import router from '@/router'
import { resources as sources, home, frameInRoutes,sys } from '@/router/routes'
import { resources as sources, home, frameInRoutes, sys } from '@/router/routes'
export default {
namespaced: true,
state: {
source:null,
meta:{},
btns:{},
btnIdAll:[]
source: null,
meta: {},
btns: {},
btnIdAll: []
},
getters: {
/**
......@@ -41,14 +41,14 @@ export default {
* 返回当前页面的btn
* @param {*} state
*/
curBtns(state){
curBtns (state) {
return state.btns[state.meta.id]
},
/**
* 返回当前页面的btn
* @param {*} state
*/
btnIdAll(state){
btnIdAll (state) {
return state.btnIdAll
}
},
......@@ -57,7 +57,7 @@ export default {
return new Promise(async resolve => {
// 设置数据
dispatch('d2admin/db/set', {
dbName: 'sys',
dbName: 'database',
path: 'source',
value: state.source,
user: true
......@@ -99,7 +99,7 @@ export default {
return new Promise(async resolve => {
if (!state.source) {
state.source = await dispatch('d2admin/db/get', {
dbName: 'sys',
dbName: 'database',
path: 'source',
user: true
}, { root: true })
......@@ -118,8 +118,8 @@ export default {
// 获取权限资源点
const __source = await dispatch('load')
// 过滤资源点 并动态添加到路由
const { route,btn } = util.permision.packRoutesBtns(sources, __source)
frameInRoutes[0].children = [home, ...route,...sys]
const { route, btn } = util.permision.packRoutesBtns(sources, __source)
frameInRoutes[0].children = [home, ...route, ...sys]
router.addRoutes(frameInRoutes)
state.btns = btn
await commit('d2admin/page/init', frameInRoutes, { root: true })
......
/*
* @Author: limin
* @Date: 2019-09-01 17:56:57
* @Last Modified by: limin
* @Last Modified time: 2019-09-01 18:57:45
*/
import { FetchRoleList, CompanyList, DepartList, StationList } from '@/api/sys.base'
import { BaseData } from '@/common/constants'
const map = {
[BaseData.ROLE]: FetchRoleList,
[BaseData.COMPANY]: CompanyList,
[BaseData.DEPART]: DepartList,
[BaseData.STATION]: StationList
}
export default {
namespaced: true,
state: {
// 所属公司
company: [],
// 角色
role: [],
// 部门
depart: [],
// 站点
station: []
},
actions: {
/**
* 初始化获取 基础数据 并 前端持久化
* 每次登录会强制 初始化
* @param {*} param0
*/
init ({ state, dispatch, commit }) {
return new Promise(async resolve => {
Promise.all([
FetchRoleList(),
CompanyList(),
DepartList(),
StationList()
]).then( async ([role, company, depart, station] = res) => {
state.role = role
state.station = station
state.depart = depart
state.company = company
await dispatch('save2db', {path: `base`,value: {role, company, depart, station}})
resolve({ role, company, depart, station })
})
})
},
/**
* 根据名字获取基础数据
* 获取步骤:
* 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0
* @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改
*/
get ({ state, dispatch }, name) {
return new Promise(async resolve => {
let __data = state[name]
if (!__data.length) {
__data = await dispatch('getFromdb', `base.${name}`) || await dispatch('getFromAjax', name)
state[name] = __data
await dispatch('save2db', {path: `base.${name}`,value: __data})
}
resolve(__data)
})
},
/**
* 获取所有基础数据
* 获取步骤:
* 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0
*/
load ({ state,dispatch }) {
return new Promise(async resolve => {
if (state.role.length === 0) {
state = await dispatch('getFromdb','base') || await dispatch('init')
}
const {role, company, depart, station} = state
resolve({role, company, depart, station})
})
},
/**
* 内部方法 从前端持久化数据库 获取指定数据
* @param {*} param0
* @param {*} path 数据 路径
*/
getFromdb ({ dispatch }, path) {
return new Promise(async resolve => {
const value = await dispatch('d2admin/db/get', {
dbName: 'database',
path,
user: true
}, { root: true })
resolve(value)
})
},
/**
* 内部方法 前端持久化 一个 数据
* @param {*} param0
* @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径
*/
save2db ({ dispatch }, {value,path}) {
return new Promise(async resolve => {
await dispatch('d2admin/db/set', {
dbName: 'database',
path,
value,
user: true
}, { root: true })
resolve(value)
})
},
/**
* 从后端获取一个数据
* @param {*} param0
* @param {*} name @/common/constants/BaseData 中的常量
*/
getFromAjax ({ state, dispatch, commit }, name) {
return new Promise(async resolve => {
const value = await map[name]()
resolve(value)
})
}
},
mutations: {
}
}
......@@ -5,7 +5,7 @@ export default {
namespaced: true,
state: {
// 尺寸
value: '' // medium small mini
value: 'medium' // medium small mini
},
actions: {
/**
......
......@@ -53,10 +53,12 @@ export default {
user: true
}, { root: true })
// 检查这个主题在主题列表里是否存在
if (state.list.find(e => e.name === activeName)) {
let __theme = state.list.find(e => e.name === activeName)
if (__theme) {
state.activeName = activeName
} else {
state.activeName = state.list[0].name
__theme = state.list[0]
state.activeName = __theme.name
// 持久化
await dispatch('d2admin/db/set', {
dbName: 'sys',
......@@ -65,6 +67,8 @@ export default {
user: true
}, { root: true })
}
// 设置ui 颜色
await dispatch('d2admin/color/set', __theme.color, { root: true })
// 将 vuex 中的主题应用到 dom
commit('dom')
// end
......
......@@ -41,6 +41,13 @@ export default {
// end
resolve()
})
},
clear ({ state, dispatch }) {
return new Promise(async resolve => {
await dispatch('set', {})
resolve()
})
}
}
}
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
</style>
......@@ -43,26 +43,25 @@
<auth-button label="查看" @e-auth-click="handleClick(scope.row)"/>
<auth-button label="编辑" @e-auth-click="handleClick(scope.row)"/>
<auth-button label="看不见我" @e-auth-click="handleClick(scope.row)"/>
<el-button label="222222" v-auth></el-button>
</template>
</el-table-column>
</el-table>
<el-input v-model="testCache" type="text"></el-input>
</d2-container>
</template>
<script>
export default {
name: 'page2',
methods: {
handleClick (row) {
alert(JSON.stringify(row))
}
},
components: {
},
mounted () {
},
data () {
return {
testCache: '',
btn: {
lable: '测试',
action: 'test'
......
<!-- 编辑物料弹窗 -->
<template>
<div>
<el-dialog
title="编辑物料"
:visible.sync="isVisible"
:before-close="handleClose"
>
<el-form
:model="editForm"
:rules="rules"
ref="editRuleForm"
label-width="100px"
>
<el-form-item
label="物料代码"
prop="deviceNum">
<el-input
:disabled="disabled" v-model="editForm.deviceNum" placeholder="请输入物料代码" clearable
></el-input>
</el-form-item>
<el-form-item
label="物料编码"
prop="deviceCode">
<el-input
:disabled="disabled" v-model="editForm.deviceCode" placeholder="请输入物料编码" clearable
></el-input>
</el-form-item>
<el-form-item
label="CRC物料号"
prop="crcCode">
<el-input
:disabled="disabled" v-model="editForm.crcCode" placeholder="请输入CRC物料号" clearable
></el-input>
</el-form-item>
<el-form-item
label="图号"
prop="drawNum">
<el-input
:disabled="disabled" v-model="editForm.drawNum" placeholder="请输入图号" clearable
></el-input>
</el-form-item>
<el-form-item
label="物料名称"
prop="deviceName">
<el-input
:disabled="disabled" v-model="editForm.deviceName" placeholder="请输入物料名称" clearable
></el-input>
</el-form-item>
<el-form-item
label="规格"
prop="specifications">
<el-input
:disabled="disabled" v-model="editForm.specifications" placeholder="请输入规格" clearable
></el-input>
</el-form-item>
<el-form-item label="所在地" prop="stationName">
<el-select v-model="editForm.stationName" placeholder="请选择所在地" clearable filterable>
<el-option label="仓库" value="1"></el-option>
<el-option label="广州站" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="库存数量"
prop="stockCount">
<el-input
:disabled="disabled" v-model="editForm.stockCount" placeholder="请输入库存数量" clearable
></el-input>
</el-form-item>
<el-form-item
label="责任人"
prop="responsible">
<el-input
:disabled="disabled" v-model="editForm.responsible" placeholder="请输入责任人" clearable
></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="handleConfirm"
>保存</el-button>
<el-button
@click="handleClose"
>取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'EditDialog',
data () {
return {
disabled: false,
rules: {
deviceNum: [
{ required: true, message: '请输入物料代码', trigger: 'blur' }
],
deviceCode: [
{ required: true, message: '请输入物料编码', trigger: 'blur' }
],
crcCode: [
{ required: true, message: '请输入CRC物料号', trigger: 'blur' }
],
drawNum: [
{ required: true, message: '请输入图号', trigger: 'blur' }
],
deviceName: [
{ required: true, message: '请输入物料名称', trigger: 'blur' }
],
specifications: [
{ required: true, message: '请输入规格', trigger: 'blur' }
],
stationName: [
{ required: true, message: '请选择所在地', trigger: 'change' }
],
stockCount: [
{ required: true, message: '请输入库存数量', trigger: 'blur' }
],
responsible: [
{ required: true, message: '请输入责任人', trigger: 'blur' }
]
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
editForm: Object
},
watch: {
isVisible (val) {
// this.disabled = this.editForm.trafficCode ? true : false
this.$refs.editRuleForm && this.$refs.editRuleForm.resetFields()
}
},
mounted () {},
methods: {
handleClose () {
this.$emit('closeDialog')
},
handleConfirm () {
this.$refs.editRuleForm.validate((vaild) => {
if (vaild) {
this.$emit('confirmDialog')
}
})
}
}
}
</script>
<style scoped>
</style>
<!-- 物料管理 -->
<template>
<d2-container>
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
>
<el-form-item label="物料">
<el-input v-model="searchForm.keyWord" placeholder="请输入物料代码/编码/名称" clearable></el-input>
</el-form-item>
<el-form-item label="所在地">
<el-select v-model="searchForm.stationCode" placeholder="请选择所在地" clearable filterable>
<el-option value="1" label="仓库"></el-option>
<el-option value="2" label="广州站"></el-option>
</el-select>
</el-form-item>
<el-form-item label="责任人">
<el-select v-model="searchForm.responsible" placeholder="请选择责任人" clearable filterable>
<el-option value="1" label="张三"></el-option>
<el-option value="2" label="李四"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<el-row style="height: 40px; line-height: 40px">
<el-col :span="12">物料列表</el-col>
<el-col :span="12" style="text-align: right">
<el-button class="import-button" style="">导入
<input
type="file"
class="import-input"
accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)" />
</el-button>
<el-button>导出</el-button>
</el-col>
</el-row>
<el-table
:data="tableData"
v-loading="tableLoading"
border
style="margin: 20px 0;"
>
<el-table-column
align="center"
width="60px"
label="序号"
type='index'
></el-table-column>
<el-table-column
v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
align="center"
>
<!-- <template slot-scope="scope">
<template v-if="item.formatter">
{{item.formatter(scope.row)}}
</template>
<template v-else>
{{tableData[scope.$index][item.prop]}}
</template>
</template> -->
</el-table-column>
<el-table-column
align="center"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
@click="handleEdit(scope.row, scope.$index)"
>编辑</el-button>
<el-button
type="text"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,30,40]"
:page-size="pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
<edit-dialog
:isVisible="editVisible"
:editForm="editForm"
@closeDialog="handleEditClose"
@confirmDialog="handleEditConfirm"
></edit-dialog>
</d2-container>
</template>
<script>
import EditDialog from './editDialog'
import { getListApi, editApi, removeApi, importApi, exportApi } from '@api/deviceManagement'
import notice from '@/common/notice'
export default {
name: 'deviceManagement',
components: {
EditDialog
},
data () {
return {
// 编辑弹窗
editVisible: false,
editForm: {
id: '',
deviceNum: '',
deviceCode: '',
crcCode: '',
drawNum: '',
deviceName: '',
specifications: '',
stationCode: '',
stationName: '',
stockCount: '',
responsible: ''
},
// 搜索
searchForm: {
keyWord: '',
stationCode: '',
responsible: ''
},
// 表格
tableLoading: false,
tableData: [],
tableColumns: [{
label: '物料代码',
prop: 'deviceNum'
}, {
label: '物料编码',
prop: 'deviceCode'
}, {
label: 'CRC物料号',
prop: 'crcCode'
}, {
label: '图号',
prop: 'drawNum'
}, {
label: '物料名称',
prop: 'deviceName'
}, {
label: '规格',
prop: 'specifications'
}, {
label: '所在地',
prop: 'stationName'
}, {
label: '库存',
prop: 'stockCount'
}, {
label: '责任人',
prop: 'responsible'
}],
// 页码
currentPage: 1,
pageSize: 10,
total: 30
}
},
mounted () {
this.loadingGetList()
},
methods: {
loadingGetList () {
this.tableLoading = true
this.getList()
},
/* 接口请求-start */
getParams () {
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
...this.searchForm
}
},
getList () {
const params = this.getParams()
getListApi(params).then(res => {
this.tableData = res
this.tableLoading = false
}).catch(err => {
notice.errorTips(err)
this.tableLoading = false
})
},
editDevice (params) {
editApi(params).then(res => {
// console.log(res)
this.handleEditClose()
notice.okTips()
this.loadingGetList()
}).catch(err => {
notice.errorTips()
})
},
// 导入
importFile (e) {
const params = {
file: e.target.files[0]
}
console.log(params)
importApi(params).then(res => {
notice.okTips()
}).catch(err => {
notice.errorTips()
})
},
/* 接口请求-end */
// 搜索
handleSearch () {
console.log(this.searchForm)
this.loadingGetList()
},
// 页码
handleSizeChange (value) {
// console.log(value)
this.pageSize = value
// 调接口
this.loadingGetList()
},
handleCurrentChange (value) {
// console.log(value)
this.currentPage = value
// 调接口
this.loadingGetList()
},
handleEditClose () {
this.editVisible = !this.editVisible
},
handleEditConfirm () {
// console.log(JSON.parse(JSON.stringify(this.editForm)))
var editParams = JSON.parse(JSON.stringify(this.editForm))
this.editDevice(editParams)
},
// 表格-编辑
handleEdit (row, index = -1) {
// console.log(index)
// console.log(row)
console.log(row)
this.editForm = JSON.parse(JSON.stringify(row))
this.editVisible = !this.editVisible
},
handleDelete (index, row) {
this.$confirm('确认删除?', '删除', {
comfirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(index)
console.log(row)
this.$message({
type: 'success',
message: '删除成功'
})
}).catch(err => {})
}
}
}
</script>
<style scoped>
.import-button {
width: 70px;
height: 40px;
overflow: hidden;
position: relative;
cursor: pointer;
}
.import-input {
opacity: 0;
position: absolute;
left: 0;
top: 0;
width: 70px;
height: 100%;
cursor: pointer;
font-size:0
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!