@ -0,0 +1,3 @@ |
||||
> 1% |
||||
last 2 versions |
||||
not ie <= 8 |
@ -0,0 +1,22 @@ |
||||
.DS_Store |
||||
node_modules |
||||
/dist |
||||
example.html |
||||
favicon.ico |
||||
# local env files |
||||
.env.local |
||||
.env.*.local |
||||
|
||||
# Log files |
||||
npm-debug.log* |
||||
yarn-debug.log* |
||||
yarn-error.log* |
||||
|
||||
# Editor directories and files |
||||
.idea |
||||
.vscode |
||||
*.suo |
||||
*.ntvs* |
||||
*.njsproj |
||||
*.sln |
||||
*.sw* |
@ -0,0 +1,6 @@ |
||||
{ |
||||
"tabWidth": 4, |
||||
"singleQuote": true, |
||||
"trailingComma": "none", |
||||
"printWidth": 140 |
||||
} |
@ -0,0 +1,21 @@ |
||||
MIT License |
||||
|
||||
Copyright (c) 2016-2019 vue-manage-system |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,197 @@ |
||||
# vue-manage-system |
||||
|
||||
<a href="https://github.com/vuejs/vue"> |
||||
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen.svg" alt="vue"> |
||||
</a> |
||||
<a href="https://github.com/ElemeFE/element"> |
||||
<img src="https://img.shields.io/badge/element--ui-2.8.2-brightgreen.svg" alt="element-ui"> |
||||
</a> |
||||
<a href="https://github.com/lin-xin/vue-manage-system/blob/master/LICENSE"> |
||||
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license"> |
||||
</a> |
||||
<a href="https://github.com/lin-xin/vue-manage-system/releases"> |
||||
<img src="https://img.shields.io/github/release/lin-xin/vue-manage-system.svg" alt="GitHub release"> |
||||
</a> |
||||
<a href="https://lin-xin.gitee.io/example/work/#/donate"> |
||||
<img src="https://img.shields.io/badge/%24-donate-ff69b4.svg" alt="donate"> |
||||
</a> |
||||
|
||||
基于 Vue + Element UI 的后台管理系统解决方案。[线上地址](https://lin-xin.gitee.io/example/work/) |
||||
|
||||
> React + Ant Design 的版本正在开发中,仓库地址:[react-manage-system](https://github.com/lin-xin/react-manage-system) |
||||
|
||||
[English document](https://github.com/lin-xin/manage-system/blob/master/README_EN.md) |
||||
|
||||
## 项目截图 |
||||
|
||||
### 登录 |
||||
|
||||
![Image text](https://github.com/lin-xin/manage-system/raw/master/screenshots/wms3.png) |
||||
|
||||
### 默认皮肤 |
||||
|
||||
![Image text](https://github.com/lin-xin/manage-system/raw/master/screenshots/wms1.png) |
||||
|
||||
### 浅绿色皮肤 |
||||
|
||||
![Image text](https://github.com/lin-xin/manage-system/raw/master/screenshots/wms2.png) |
||||
|
||||
## 赞赏 |
||||
|
||||
请作者喝杯咖啡吧!(微信号:linxin_20) |
||||
|
||||
![微信扫一扫](https://lin-xin.gitee.io/images/weixin.jpg) |
||||
|
||||
## 特别鸣谢 |
||||
|
||||
- [实验楼](https://www.shiyanlou.com?source=vue-manage-system) |
||||
|
||||
## 前言 |
||||
|
||||
该方案作为一套多功能的后台框架模板,适用于绝大部分的后台管理系统(Web Management System)开发。基于 vue.js,使用 vue-cli3 脚手架,引用 Element UI 组件库,方便开发快速简洁好看的组件。分离颜色样式,支持手动切换主题色,而且很方便使用自定义主题色。 |
||||
|
||||
## 功能 |
||||
|
||||
- [x] Element UI |
||||
- [x] 登录/注销 |
||||
- [x] Dashboard |
||||
- [x] 表格 |
||||
- [x] Tab 选项卡 |
||||
- [x] 表单 |
||||
- [x] 图表 :bar_chart: |
||||
- [x] 富文本编辑器 |
||||
- [x] markdown 编辑器 |
||||
- [x] 图片拖拽/裁剪上传 |
||||
- [x] 支持切换主题色 :sparkles: |
||||
- [x] 列表拖拽排序 |
||||
- [x] 权限测试 |
||||
- [x] 404 / 403 |
||||
- [x] 三级菜单 |
||||
- [x] 自定义图标 |
||||
- [x] 可拖拽弹窗 |
||||
- [x] 国际化 |
||||
|
||||
## 安装步骤 |
||||
|
||||
``` |
||||
git clone https://github.com/lin-xin/vue-manage-system.git // 把模板下载到本地 |
||||
cd vue-manage-system // 进入模板目录 |
||||
npm install // 安装项目依赖,等待安装完成之后,安装失败可用 cnpm 或 yarn |
||||
|
||||
// 开启服务器,浏览器访问 http://localhost:8080 |
||||
npm run serve |
||||
|
||||
// 执行构建命令,生成的dist文件夹放在服务器下即可访问 |
||||
npm run build |
||||
``` |
||||
|
||||
## 组件使用说明与演示 |
||||
|
||||
### vue-schart |
||||
|
||||
vue.js 封装 sChart.js 的图表组件。访问地址:[vue-schart](https://github.com/linxin/vue-schart) |
||||
|
||||
<p><a href="https://www.npmjs.com/package/vue-schart"><img src="https://img.shields.io/npm/dm/vue-schart.svg" alt="Downloads"></a></p> |
||||
|
||||
```html |
||||
<template> |
||||
<div> |
||||
<schart class="wrapper" canvasId="myCanvas" :options="options"></schart> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Schart from 'vue-schart'; // 导入Schart组件 |
||||
export default { |
||||
data() { |
||||
return { |
||||
options: { |
||||
type: 'bar', |
||||
title: { |
||||
text: '最近一周各品类销售图' |
||||
}, |
||||
labels: ['周一', '周二', '周三', '周四', '周五'], |
||||
datasets: [ |
||||
{ |
||||
label: '家电', |
||||
data: [234, 278, 270, 190, 230] |
||||
}, |
||||
{ |
||||
label: '百货', |
||||
data: [164, 178, 190, 135, 160] |
||||
}, |
||||
{ |
||||
label: '食品', |
||||
data: [144, 198, 150, 235, 120] |
||||
} |
||||
] |
||||
} |
||||
}; |
||||
}, |
||||
components: { |
||||
Schart |
||||
} |
||||
}; |
||||
</script> |
||||
<style> |
||||
.wrapper { |
||||
width: 7rem; |
||||
height: 5rem; |
||||
} |
||||
</style> |
||||
``` |
||||
|
||||
## 其他注意事项 |
||||
|
||||
### 一、如果我不想用到上面的某些组件呢,那我怎么在模板中删除掉不影响到其他功能呢? |
||||
|
||||
举个栗子,我不想用 Vue-Quill-Editor 这个组件,那我需要分四步走。 |
||||
|
||||
第一步:删除该组件的路由,在目录 src/router/index.js 中,找到引入改组件的路由,删除下面这段代码。 |
||||
|
||||
```JavaScript |
||||
{ |
||||
// 富文本编辑器组件 |
||||
path: '/editor', |
||||
component: resolve => require(['../components/page/VueEditor.vue'], resolve) |
||||
}, |
||||
``` |
||||
|
||||
第二步:删除引入该组件的文件。在目录 src/components/page/ 删除 VueEditor.vue 文件。 |
||||
|
||||
第三步:删除该页面的入口。在目录 src/components/common/Sidebar.vue 中,找到该入口,删除下面这段代码。 |
||||
|
||||
```js |
||||
{ |
||||
index: 'editor', |
||||
title: '富文本编辑器' |
||||
}, |
||||
``` |
||||
|
||||
第四步:卸载该组件。执行以下命令: |
||||
npm un vue-quill-editor -S |
||||
|
||||
完成。 |
||||
|
||||
### 二、如何切换主题色呢? |
||||
|
||||
第一步:打开 src/main.js 文件,找到引入 element 样式的地方,换成浅绿色主题。 |
||||
|
||||
```javascript |
||||
import 'element-ui/lib/theme-default/index.css'; // 默认主题 |
||||
// import './assets/css/theme-green/index.css'; // 浅绿色主题 |
||||
``` |
||||
|
||||
第二步:打开 src/App.vue 文件,找到 style 标签引入样式的地方,切换成浅绿色主题。 |
||||
|
||||
```javascript |
||||
@import "./assets/css/main.css"; |
||||
@import "./assets/css/color-dark.css"; /*深色主题*/ |
||||
/*@import "./assets/css/theme-green/color-green.css"; !*浅绿色主题*!*/ |
||||
``` |
||||
|
||||
第三步:打开 src/components/common/Sidebar.vue 文件,找到 el-menu 标签,把 background-color/text-color/active-text-color 属性去掉即可。 |
||||
|
||||
## License |
||||
|
||||
[MIT](https://github.com/lin-xin/vue-manage-system/blob/master/LICENSE) |
@ -0,0 +1,196 @@ |
||||
# vue-manage-system |
||||
|
||||
<a href="https://github.com/vuejs/vue"> |
||||
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen.svg" alt="vue"> |
||||
</a> |
||||
<a href="https://github.com/ElemeFE/element"> |
||||
<img src="https://img.shields.io/badge/element--ui-2.8.2-brightgreen.svg" alt="element-ui"> |
||||
</a> |
||||
<a href="https://github.com/lin-xin/vue-manage-system/blob/master/LICENSE"> |
||||
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="license"> |
||||
</a> |
||||
<a href="https://github.com/lin-xin/vue-manage-system/releases"> |
||||
<img src="https://img.shields.io/github/release/lin-xin/vue-manage-system.svg" alt="GitHub release"> |
||||
</a> |
||||
<a href="https://lin-xin.gitee.io/example/work/#/donate"> |
||||
<img src="https://img.shields.io/badge/%24-donate-ff69b4.svg" alt="donate"> |
||||
</a> |
||||
|
||||
The web management system solution based on Vue2 and Element-UI。[live demo](https://lin-xin.gitee.io/example/work/) |
||||
|
||||
## Donation |
||||
|
||||
![WeChat](https://lin-xin.gitee.io/images/weixin.jpg) |
||||
|
||||
## Preface |
||||
|
||||
The scheme as a set of multi-function background frame templates, suitable for most of the WEB management system development. Convenient development fast simple good components based on Vue2 and Element-UI. Color separation of color style, support manual switch themes, and it is convenient to use a custom theme color. |
||||
|
||||
## Function |
||||
|
||||
- [x] Element-UI |
||||
- [x] Login/Logout |
||||
- [x] Dashboard |
||||
- [x] Table |
||||
- [x] Tabs |
||||
- [x] From |
||||
- [x] Chart :bar_chart: |
||||
- [x] Editor |
||||
- [x] Markdown |
||||
- [x] Upload pictures by clipping or dragging |
||||
- [x] Support manual switch themes :sparkles: |
||||
- [x] List drag sort |
||||
- [x] Permission |
||||
- [x] 404 / 403 |
||||
- [x] Three level menu |
||||
- [x] Custom icon |
||||
|
||||
## Installation steps |
||||
|
||||
git clone https://github.com/lin-xin/vue-manage-system.git // Clone templates |
||||
cd vue-manage-system // Enter template directory |
||||
npm install // Installation dependency |
||||
|
||||
## Local development |
||||
|
||||
// Open server and access http://localhost:8080 in browser |
||||
npm run serve |
||||
|
||||
## Constructing production |
||||
|
||||
// Constructing project |
||||
npm run build |
||||
|
||||
## Component description and presentation |
||||
|
||||
### vue-schart |
||||
|
||||
Vue.js wrapper for sChart.js. Github : [vue-schart](https://github.com/linxin/vue-schart) |
||||
|
||||
```html |
||||
<template> |
||||
<div> |
||||
<schart class="wrapper" canvasId="myCanvas" :options="options"></schart> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Schart from 'vue-schart'; // 导入Schart组件 |
||||
export default { |
||||
data() { |
||||
return { |
||||
options: { |
||||
type: 'bar', |
||||
title: { |
||||
text: '最近一周各品类销售图' |
||||
}, |
||||
labels: ['周一', '周二', '周三', '周四', '周五'], |
||||
datasets: [ |
||||
{ |
||||
label: '家电', |
||||
data: [234, 278, 270, 190, 230] |
||||
}, |
||||
{ |
||||
label: '百货', |
||||
data: [164, 178, 190, 135, 160] |
||||
}, |
||||
{ |
||||
label: '食品', |
||||
data: [144, 198, 150, 235, 120] |
||||
} |
||||
] |
||||
} |
||||
}; |
||||
}, |
||||
components: { |
||||
Schart |
||||
} |
||||
}; |
||||
</script> |
||||
<style> |
||||
.wrapper { |
||||
width: 7rem; |
||||
height: 5rem; |
||||
} |
||||
</style> |
||||
``` |
||||
|
||||
### element-ui |
||||
|
||||
A desktop component library based on vue.js2.0 . Github : [element](http://element.eleme.io/#/zh-CN/component/layout) |
||||
|
||||
### Vue-Quill-Editor |
||||
|
||||
Quill editor component for Vue2. Github : [vue-quill-editor](https://github.com/surmon-china/vue-quill-editor) |
||||
|
||||
### mavonEditor |
||||
|
||||
A markdown editor based on Vue that supports a variety of personalized features. Github: [mavonEditor](https://github.com/hinesboy/mavonEditor) |
||||
|
||||
### vue-cropperjs |
||||
|
||||
A Vue wrapper component for cropperjs. Github: [vue-cropperjs](https://github.com/Agontuk/vue-cropperjs) |
||||
|
||||
## Notice |
||||
|
||||
### 一、If I don't want to use some components, how can I delete it? |
||||
|
||||
For example, I don't want to use the Vue-Quill-Editor component, I need to take four steps. |
||||
|
||||
The first step to remove the component of the routing. Enter 'src/router/index.js' and delete the code below. |
||||
|
||||
```JavaScript |
||||
{ |
||||
path: '/editor', |
||||
component: resolve => require(['../components/page/VueEditor.vue'], resolve) |
||||
}, |
||||
``` |
||||
|
||||
Second,delete the component files. Enter 'src/components/page/' and delete 'VueEditor.vue' file. |
||||
|
||||
The third step is to delete the entry. Enter 'src/components/common/Sidebar.vue' and delete the code below. |
||||
|
||||
```js |
||||
{ |
||||
index: 'editor', |
||||
title: '富文本编辑器' |
||||
}, |
||||
``` |
||||
|
||||
Finally, uninstall this component. |
||||
npm un vue-quill-editor -S |
||||
|
||||
Complete! |
||||
|
||||
### 二、How to switch themes? |
||||
|
||||
The first step to enter 'src/main.js' and change into green theme. |
||||
|
||||
```javascript |
||||
import 'element-ui/lib/theme-default/index.css'; // default theme |
||||
// import '../static/css/theme-green/index.css'; // green theme |
||||
``` |
||||
|
||||
The second step to enter 'src/App.vue' and change into green theme. |
||||
|
||||
```javascript |
||||
@import "../static/css/main.css"; |
||||
@import "../static/css/color-dark.css"; /*深色主题*/ |
||||
/*@import "../static/css/theme-green/color-green.css"; !*浅绿色主题*!*/ |
||||
``` |
||||
|
||||
Finally,enter 'src/components/common/Sidebar.vue' and find el-menu Tags,delete 'background-color/text-color/active-text-color'。 |
||||
|
||||
## Screenshot |
||||
|
||||
### Default theme |
||||
|
||||
![Image text](https://github.com/lin-xin/manage-system/raw/master/screenshots/wms1.png) |
||||
|
||||
### Green theme |
||||
|
||||
![Image text](https://github.com/lin-xin/manage-system/raw/master/screenshots/wms2.png) |
||||
|
||||
## License |
||||
|
||||
[MIT](https://github.com/lin-xin/vue-manage-system/blob/master/LICENSE) |
@ -0,0 +1,5 @@ |
||||
module.exports = { |
||||
presets: [ |
||||
'@vue/app' |
||||
] |
||||
} |
@ -0,0 +1,37 @@ |
||||
{ |
||||
"name": "vue-manage-system", |
||||
"version": "4.2.0", |
||||
"private": true, |
||||
"scripts": { |
||||
"dev": "npm run serve", |
||||
"serve": "vue-cli-service serve", |
||||
"build": "vue-cli-service build" |
||||
}, |
||||
"dependencies": { |
||||
"axios": "^0.18.0", |
||||
"babel-polyfill": "^6.26.0", |
||||
"element-theme": "^2.0.1", |
||||
"element-ui": "^2.13.0", |
||||
"js-cookie": "^2.2.1", |
||||
"lodash": "^4.17.20", |
||||
"mavon-editor": "^2.6.17", |
||||
"postcss-px2rem": "^0.3.0", |
||||
"px2rem-loader": "^0.1.9", |
||||
"vue": "^2.6.10", |
||||
"vue-cropperjs": "^3.0.0", |
||||
"vue-i18n": "^8.10.0", |
||||
"vue-quill-editor": "^3.0.6", |
||||
"vue-router": "^3.0.3", |
||||
"vue-schart": "^2.0.0", |
||||
"vuedraggable": "^2.24.2", |
||||
"vuex": "^3.1.2" |
||||
}, |
||||
"devDependencies": { |
||||
"@vue/cli-plugin-babel": "^3.9.0", |
||||
"@vue/cli-service": "^3.9.0", |
||||
"element-theme-chalk": "^2.13.0", |
||||
"node-sass": "^4.14.1", |
||||
"sass-loader": "^8.0.0", |
||||
"vue-template-compiler": "^2.6.10" |
||||
} |
||||
} |
@ -0,0 +1,5 @@ |
||||
module.exports = { |
||||
plugins: { |
||||
autoprefixer: {} |
||||
} |
||||
} |
@ -0,0 +1,17 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"> |
||||
<link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css"> |
||||
<title>电子竞技在线教学资源管理平台</title> |
||||
</head> |
||||
<body> |
||||
<noscript> |
||||
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
||||
</noscript> |
||||
<div id="app"></div> |
||||
<!-- built files will be auto injected --> |
||||
</body> |
||||
</html> |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 112 KiB |
@ -0,0 +1,30 @@ |
||||
<template> |
||||
<div id="app"> |
||||
<router-view></router-view> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting'; |
||||
import util from '@/libs/util'; |
||||
export default { |
||||
name: 'App', |
||||
created () { |
||||
//在页面加载时读取sessionStorage里的状态信息 |
||||
if (util.session.get(Setting.storeKey) ) { |
||||
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(util.session.get(Setting.storeKey)))) |
||||
} |
||||
|
||||
//在页面刷新时将vuex里的信息保存到sessionStorage里 |
||||
window.addEventListener("beforeunload",()=>{ |
||||
util.session.get(Setting.usernameKey) && util.session.set(Setting.storeKey,JSON.stringify(this.$store.state)) |
||||
}) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
@import "./assets/css/main.css"; |
||||
/*深色主题*/ |
||||
@import "./assets/css/theme-green/color-green.css"; |
||||
</style> |
@ -0,0 +1,28 @@ |
||||
.header{ |
||||
background-color: #242f42; |
||||
} |
||||
.login-wrap{ |
||||
background: #324157; |
||||
} |
||||
.plugins-tips{ |
||||
background: #eef1f6; |
||||
} |
||||
.plugins-tips a{ |
||||
color: #20a0ff; |
||||
} |
||||
.el-upload--text em { |
||||
color: #20a0ff; |
||||
} |
||||
.pure-button{ |
||||
background: #20a0ff; |
||||
} |
||||
.tags-li.active { |
||||
border: 1px solid #cb221c; |
||||
background-color: #cb221c; |
||||
} |
||||
.message-title{ |
||||
color: #20a0ff; |
||||
} |
||||
.collapse-btn:hover{ |
||||
background: rgb(40,52,70); |
||||
} |
@ -0,0 +1,4 @@ |
||||
|
||||
[class*=" icon-"], [class^=icon-] { |
||||
font-family: iconfont!important; |
||||
} |
@ -0,0 +1,346 @@ |
||||
* { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
html, |
||||
body, |
||||
#app, |
||||
.wrapper { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
body { |
||||
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; |
||||
font-size: 14px; |
||||
background: #f0f0f0; |
||||
} |
||||
|
||||
a { |
||||
text-decoration: none |
||||
} |
||||
i{ |
||||
font-style: normal; |
||||
} |
||||
li { |
||||
list-style-type:none; |
||||
} |
||||
|
||||
|
||||
.content-box { |
||||
-webkit-transition: left .3s ease-in-out; |
||||
transition: left .3s ease-in-out; |
||||
} |
||||
|
||||
.content { |
||||
width: auto; |
||||
height: 100%; |
||||
padding: 20px; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
.content-collapse { |
||||
left: 65px; |
||||
} |
||||
|
||||
.container { |
||||
padding: 30px; |
||||
background: #fff; |
||||
border: 1px solid #ddd; |
||||
border-radius: 5px; |
||||
} |
||||
|
||||
.crumbs { |
||||
margin: 10px 0; |
||||
} |
||||
|
||||
.el-table th { |
||||
background-color: #f5f7fa !important; |
||||
} |
||||
|
||||
.pagination { |
||||
margin: 20px 0; |
||||
text-align: right; |
||||
} |
||||
|
||||
.plugins-tips { |
||||
padding: 20px 10px; |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.el-button+.el-tooltip { |
||||
margin-left: 10px; |
||||
} |
||||
|
||||
.el-table tr:hover { |
||||
background: #f6faff; |
||||
} |
||||
|
||||
.orderTable td .el-input{ |
||||
width: 60%; |
||||
} |
||||
|
||||
.orderTable .el-select>.el-input{ |
||||
display: inline-block; |
||||
} |
||||
|
||||
.mgb20 { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.move-enter-active, |
||||
.move-leave-active { |
||||
transition: opacity .5s; |
||||
} |
||||
|
||||
.move-enter, |
||||
.move-leave { |
||||
opacity: 0; |
||||
} |
||||
|
||||
/*BaseForm*/ |
||||
|
||||
.form-box { |
||||
width: 600px; |
||||
} |
||||
|
||||
.form-box .line { |
||||
text-align: center; |
||||
} |
||||
|
||||
.el-time-panel__content::after, |
||||
.el-time-panel__content::before { |
||||
margin-top: -7px; |
||||
} |
||||
|
||||
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) { |
||||
padding-bottom: 0; |
||||
} |
||||
|
||||
/*Upload*/ |
||||
|
||||
.pure-button { |
||||
width: 150px; |
||||
height: 40px; |
||||
line-height: 40px; |
||||
text-align: center; |
||||
color: #fff; |
||||
border-radius: 3px; |
||||
} |
||||
|
||||
.g-core-image-corp-container .info-aside { |
||||
height: 45px; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text { |
||||
background-color: #fff; |
||||
border: 1px dashed #d9d9d9; |
||||
border-radius: 6px; |
||||
box-sizing: border-box; |
||||
width: 360px; |
||||
height: 180px; |
||||
text-align: center; |
||||
cursor: pointer; |
||||
position: relative; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text .el-icon-upload { |
||||
font-size: 67px; |
||||
color: #97a8be; |
||||
margin: 40px 0 16px; |
||||
line-height: 50px; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text { |
||||
color: #97a8be; |
||||
font-size: 14px; |
||||
text-align: center; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text em { |
||||
font-style: normal; |
||||
} |
||||
|
||||
/* .link_upload .el-upload-list{ |
||||
width: 30%; |
||||
} */ |
||||
|
||||
/*VueEditor*/ |
||||
|
||||
.ql-container { |
||||
min-height: 400px; |
||||
} |
||||
|
||||
.ql-snow .ql-tooltip { |
||||
transform: translateX(117.5px) translateY(10px) !important; |
||||
} |
||||
|
||||
.editor-btn { |
||||
margin-top: 20px; |
||||
} |
||||
|
||||
/*markdown*/ |
||||
|
||||
.v-note-wrapper .v-note-panel { |
||||
min-height: 500px; |
||||
} |
||||
|
||||
.ms-login .el-tabs__nav-wrap::after{ |
||||
background-color: #fff; |
||||
opacity: 0; |
||||
} |
||||
.ms-login .el-tabs__item{ |
||||
padding: 0 90px; |
||||
color: #999; |
||||
} |
||||
.ms-login .el-tabs__item:hover{ |
||||
color: #000; |
||||
} |
||||
.ms-login .el-tabs__item.is-active{ |
||||
color: #333; |
||||
font-weight: bold; |
||||
} |
||||
.ms-login .el-tabs__active-bar{ |
||||
background-color: #000; |
||||
border-radius:2px; |
||||
} |
||||
.ms-login .el-tabs__nav-scroll{ |
||||
display: flex; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.ms-login .el-input__inner{ |
||||
height: 80px; |
||||
line-height: 80px; |
||||
border:1px solid rgba(220,220,220,1); |
||||
border-radius:2px; |
||||
} |
||||
|
||||
.el-row { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.mgb20 { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
#app .el-table thead{ |
||||
color: #fff; |
||||
} |
||||
#app .el-table th{ |
||||
background-color: #cb221c!important; |
||||
font-size: 16px; |
||||
font-weight: normal; |
||||
} |
||||
#app .el-select{ |
||||
display: unset; |
||||
} |
||||
|
||||
/*flex*/ |
||||
.flex-center{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.flex-between{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
} |
||||
.flex-around{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-around; |
||||
} |
||||
.flex-start-around{ |
||||
display: flex; |
||||
align-items: flex-start; |
||||
justify-content: center; |
||||
} |
||||
.flex-end-around{ |
||||
display: flex; |
||||
align-items: flex-end; |
||||
justify-content: center; |
||||
} |
||||
.flex-column{ |
||||
display: flex; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
} |
||||
.flex-start{ |
||||
display: flex; |
||||
align-items: flex-start; |
||||
} |
||||
.flex-end{ |
||||
display: flex; |
||||
align-items: flex-end; |
||||
} |
||||
|
||||
.hr_tag{ |
||||
background-color: #cb221c; |
||||
width: 3px; |
||||
height: 15px; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.user_header{ |
||||
padding: 20px 0; |
||||
border-bottom: 1px dashed #eee; |
||||
} |
||||
.addhr_tag{ |
||||
background-color: #666; |
||||
width: 6px; |
||||
height: 17px; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.per_title span{ |
||||
font-size: 16px; |
||||
font-weight: bold; |
||||
} |
||||
.per_back{ |
||||
margin-left: 5px; |
||||
} |
||||
.per_school{ |
||||
margin-left: 30px; |
||||
} |
||||
.per_title:hover{ |
||||
cursor:pointer; |
||||
} |
||||
|
||||
/* 溢出省略号 */ |
||||
.ellipsis{ |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
.userRadio .el-radio{ |
||||
margin-right: 10px!important; |
||||
} |
||||
.userRadio .el-radio__input{ |
||||
display: none!important; |
||||
} |
||||
.tabs{ |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 20px 1.5% 20px; |
||||
z-index: 999; |
||||
background-color: #fff; |
||||
} |
||||
.tabs .item{ |
||||
padding: 12px 20px; |
||||
margin-right: 10px; |
||||
color:#606266; |
||||
line-height: 1; |
||||
border-radius: 4px; |
||||
background-color: #fff; |
||||
border: 1px solid #dcdfe6; |
||||
cursor: pointer; |
||||
} |
||||
.tabs .active{ |
||||
color: #fff; |
||||
background-color: #cb221c; |
||||
border-color: #cb221c; |
||||
} |
@ -0,0 +1,29 @@ |
||||
.header{ |
||||
background-color: #fff; |
||||
} |
||||
.login-wrap{ |
||||
background: rgba(56, 157, 170, 0.82);; |
||||
} |
||||
.plugins-tips{ |
||||
background: #f2f2f2; |
||||
} |
||||
.plugins-tips a{ |
||||
color: #cb221c; |
||||
} |
||||
.el-upload--text em { |
||||
color: #cb221c; |
||||
} |
||||
.pure-button{ |
||||
background: #cb221c; |
||||
} |
||||
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { |
||||
background-color: #cb221c !important; |
||||
border-color: #cb221c !important; |
||||
} |
||||
.tags-li.active { |
||||
border: 1px solid #cb221c; |
||||
background-color: #cb221c; |
||||
} |
||||
.collapse-btn:hover{ |
||||
background: #cb221c; |
||||
} |
@ -0,0 +1,539 @@ |
||||
/* Logo 字体 */ |
||||
@font-face { |
||||
font-family: "iconfont logo"; |
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834'); |
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'), |
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'), |
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'), |
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg'); |
||||
} |
||||
|
||||
.logo { |
||||
font-family: "iconfont logo"; |
||||
font-size: 160px; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
/* tabs */ |
||||
.nav-tabs { |
||||
position: relative; |
||||
} |
||||
|
||||
.nav-tabs .nav-more { |
||||
position: absolute; |
||||
right: 0; |
||||
bottom: 0; |
||||
height: 42px; |
||||
line-height: 42px; |
||||
color: #666; |
||||
} |
||||
|
||||
#tabs { |
||||
border-bottom: 1px solid #eee; |
||||
} |
||||
|
||||
#tabs li { |
||||
cursor: pointer; |
||||
width: 100px; |
||||
height: 40px; |
||||
line-height: 40px; |
||||
text-align: center; |
||||
font-size: 16px; |
||||
border-bottom: 2px solid transparent; |
||||
position: relative; |
||||
z-index: 1; |
||||
margin-bottom: -1px; |
||||
color: #666; |
||||
} |
||||
|
||||
|
||||
#tabs .active { |
||||
border-bottom-color: #f00; |
||||
color: #222; |
||||
} |
||||
|
||||
.tab-container .content { |
||||
display: none; |
||||
} |
||||
|
||||
/* 页面布局 */ |
||||
.main { |
||||
padding: 30px 100px; |
||||
width: 960px; |
||||
margin: 0 auto; |
||||
} |
||||
|
||||
.main .logo { |
||||
color: #333; |
||||
text-align: left; |
||||
margin-bottom: 30px; |
||||
line-height: 1; |
||||
height: 110px; |
||||
margin-top: -50px; |
||||
overflow: hidden; |
||||
*zoom: 1; |
||||
} |
||||
|
||||
.main .logo a { |
||||
font-size: 160px; |
||||
color: #333; |
||||
} |
||||
|
||||
.helps { |
||||
margin-top: 40px; |
||||
} |
||||
|
||||
.helps pre { |
||||
padding: 20px; |
||||
margin: 10px 0; |
||||
border: solid 1px #e7e1cd; |
||||
background-color: #fffdef; |
||||
overflow: auto; |
||||
} |
||||
|
||||
.icon_lists { |
||||
width: 100% !important; |
||||
overflow: hidden; |
||||
*zoom: 1; |
||||
} |
||||
|
||||
.icon_lists li { |
||||
width: 100px; |
||||
margin-bottom: 10px; |
||||
margin-right: 20px; |
||||
text-align: center; |
||||
list-style: none !important; |
||||
cursor: default; |
||||
} |
||||
|
||||
.icon_lists li .code-name { |
||||
line-height: 1.2; |
||||
} |
||||
|
||||
.icon_lists .icon { |
||||
display: block; |
||||
height: 100px; |
||||
line-height: 100px; |
||||
font-size: 42px; |
||||
margin: 10px auto; |
||||
color: #333; |
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear; |
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear; |
||||
transition: font-size 0.25s linear, width 0.25s linear; |
||||
} |
||||
|
||||
.icon_lists .icon:hover { |
||||
font-size: 100px; |
||||
} |
||||
|
||||
.icon_lists .svg-icon { |
||||
/* 通过设置 font-size 来改变图标大小 */ |
||||
width: 1em; |
||||
/* 图标和文字相邻时,垂直对齐 */ |
||||
vertical-align: -0.15em; |
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */ |
||||
fill: currentColor; |
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示 |
||||
normalize.css 中也包含这行 */ |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.icon_lists li .name, |
||||
.icon_lists li .code-name { |
||||
color: #666; |
||||
} |
||||
|
||||
/* markdown 样式 */ |
||||
.markdown { |
||||
color: #666; |
||||
font-size: 14px; |
||||
line-height: 1.8; |
||||
} |
||||
|
||||
.highlight { |
||||
line-height: 1.5; |
||||
} |
||||
|
||||
.markdown img { |
||||
vertical-align: middle; |
||||
max-width: 100%; |
||||
} |
||||
|
||||
.markdown h1 { |
||||
color: #404040; |
||||
font-weight: 500; |
||||
line-height: 40px; |
||||
margin-bottom: 24px; |
||||
} |
||||
|
||||
.markdown h2, |
||||
.markdown h3, |
||||
.markdown h4, |
||||
.markdown h5, |
||||
.markdown h6 { |
||||
color: #404040; |
||||
margin: 1.6em 0 0.6em 0; |
||||
font-weight: 500; |
||||
clear: both; |
||||
} |
||||
|
||||
.markdown h1 { |
||||
font-size: 28px; |
||||
} |
||||
|
||||
.markdown h2 { |
||||
font-size: 22px; |
||||
} |
||||
|
||||
.markdown h3 { |
||||
font-size: 16px; |
||||
} |
||||
|
||||
.markdown h4 { |
||||
font-size: 14px; |
||||
} |
||||
|
||||
.markdown h5 { |
||||
font-size: 12px; |
||||
} |
||||
|
||||
.markdown h6 { |
||||
font-size: 12px; |
||||
} |
||||
|
||||
.markdown hr { |
||||
height: 1px; |
||||
border: 0; |
||||
background: #e9e9e9; |
||||
margin: 16px 0; |
||||
clear: both; |
||||
} |
||||
|
||||
.markdown p { |
||||
margin: 1em 0; |
||||
} |
||||
|
||||
.markdown>p, |
||||
.markdown>blockquote, |
||||
.markdown>.highlight, |
||||
.markdown>ol, |
||||
.markdown>ul { |
||||
width: 80%; |
||||
} |
||||
|
||||
.markdown ul>li { |
||||
list-style: circle; |
||||
} |
||||
|
||||
.markdown>ul li, |
||||
.markdown blockquote ul>li { |
||||
margin-left: 20px; |
||||
padding-left: 4px; |
||||
} |
||||
|
||||
.markdown>ul li p, |
||||
.markdown>ol li p { |
||||
margin: 0.6em 0; |
||||
} |
||||
|
||||
.markdown ol>li { |
||||
list-style: decimal; |
||||
} |
||||
|
||||
.markdown>ol li, |
||||
.markdown blockquote ol>li { |
||||
margin-left: 20px; |
||||
padding-left: 4px; |
||||
} |
||||
|
||||
.markdown code { |
||||
margin: 0 3px; |
||||
padding: 0 5px; |
||||
background: #eee; |
||||
border-radius: 3px; |
||||
} |
||||
|
||||
.markdown strong, |
||||
.markdown b { |
||||
font-weight: 600; |
||||
} |
||||
|
||||
.markdown>table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0px; |
||||
empty-cells: show; |
||||
border: 1px solid #e9e9e9; |
||||
width: 95%; |
||||
margin-bottom: 24px; |
||||
} |
||||
|
||||
.markdown>table th { |
||||
white-space: nowrap; |
||||
color: #333; |
||||
font-weight: 600; |
||||
} |
||||
|
||||
.markdown>table th, |
||||
.markdown>table td { |
||||
border: 1px solid #e9e9e9; |
||||
padding: 8px 16px; |
||||
text-align: left; |
||||
} |
||||
|
||||
.markdown>table th { |
||||
background: #F7F7F7; |
||||
} |
||||
|
||||
.markdown blockquote { |
||||
font-size: 90%; |
||||
color: #999; |
||||
border-left: 4px solid #e9e9e9; |
||||
padding-left: 0.8em; |
||||
margin: 1em 0; |
||||
} |
||||
|
||||
.markdown blockquote p { |
||||
margin: 0; |
||||
} |
||||
|
||||
.markdown .anchor { |
||||
opacity: 0; |
||||
transition: opacity 0.3s ease; |
||||
margin-left: 8px; |
||||
} |
||||
|
||||
.markdown .waiting { |
||||
color: #ccc; |
||||
} |
||||
|
||||
.markdown h1:hover .anchor, |
||||
.markdown h2:hover .anchor, |
||||
.markdown h3:hover .anchor, |
||||
.markdown h4:hover .anchor, |
||||
.markdown h5:hover .anchor, |
||||
.markdown h6:hover .anchor { |
||||
opacity: 1; |
||||
display: inline-block; |
||||
} |
||||
|
||||
.markdown>br, |
||||
.markdown>p>br { |
||||
clear: both; |
||||
} |
||||
|
||||
|
||||
.hljs { |
||||
display: block; |
||||
background: white; |
||||
padding: 0.5em; |
||||
color: #333333; |
||||
overflow-x: auto; |
||||
} |
||||
|
||||
.hljs-comment, |
||||
.hljs-meta { |
||||
color: #969896; |
||||
} |
||||
|
||||
.hljs-string, |
||||
.hljs-variable, |
||||
.hljs-template-variable, |
||||
.hljs-strong, |
||||
.hljs-emphasis, |
||||
.hljs-quote { |
||||
color: #df5000; |
||||
} |
||||
|
||||
.hljs-keyword, |
||||
.hljs-selector-tag, |
||||
.hljs-type { |
||||
color: #a71d5d; |
||||
} |
||||
|
||||
.hljs-literal, |
||||
.hljs-symbol, |
||||
.hljs-bullet, |
||||
.hljs-attribute { |
||||
color: #0086b3; |
||||
} |
||||
|
||||
.hljs-section, |
||||
.hljs-name { |
||||
color: #63a35c; |
||||
} |
||||
|
||||
.hljs-tag { |
||||
color: #333333; |
||||
} |
||||
|
||||
.hljs-title, |
||||
.hljs-attr, |
||||
.hljs-selector-id, |
||||
.hljs-selector-class, |
||||
.hljs-selector-attr, |
||||
.hljs-selector-pseudo { |
||||
color: #795da3; |
||||
} |
||||
|
||||
.hljs-addition { |
||||
color: #55a532; |
||||
background-color: #eaffea; |
||||
} |
||||
|
||||
.hljs-deletion { |
||||
color: #bd2c00; |
||||
background-color: #ffecec; |
||||
} |
||||
|
||||
.hljs-link { |
||||
text-decoration: underline; |
||||
} |
||||
|
||||
/* 代码高亮 */ |
||||
/* PrismJS 1.15.0 |
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */ |
||||
/** |
||||
* prism.js default theme for JavaScript, CSS and HTML |
||||
* Based on dabblet (http://dabblet.com) |
||||
* @author Lea Verou |
||||
*/ |
||||
code[class*="language-"], |
||||
pre[class*="language-"] { |
||||
color: black; |
||||
background: none; |
||||
text-shadow: 0 1px white; |
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; |
||||
text-align: left; |
||||
white-space: pre; |
||||
word-spacing: normal; |
||||
word-break: normal; |
||||
word-wrap: normal; |
||||
line-height: 1.5; |
||||
|
||||
-moz-tab-size: 4; |
||||
-o-tab-size: 4; |
||||
tab-size: 4; |
||||
|
||||
-webkit-hyphens: none; |
||||
-moz-hyphens: none; |
||||
-ms-hyphens: none; |
||||
hyphens: none; |
||||
} |
||||
|
||||
pre[class*="language-"]::-moz-selection, |
||||
pre[class*="language-"] ::-moz-selection, |
||||
code[class*="language-"]::-moz-selection, |
||||
code[class*="language-"] ::-moz-selection { |
||||
text-shadow: none; |
||||
background: #b3d4fc; |
||||
} |
||||
|
||||
pre[class*="language-"]::selection, |
||||
pre[class*="language-"] ::selection, |
||||
code[class*="language-"]::selection, |
||||
code[class*="language-"] ::selection { |
||||
text-shadow: none; |
||||
background: #b3d4fc; |
||||
} |
||||
|
||||
@media print { |
||||
|
||||
code[class*="language-"], |
||||
pre[class*="language-"] { |
||||
text-shadow: none; |
||||
} |
||||
} |
||||
|
||||
/* Code blocks */ |
||||
pre[class*="language-"] { |
||||
padding: 1em; |
||||
margin: .5em 0; |
||||
overflow: auto; |
||||
} |
||||
|
||||
:not(pre)>code[class*="language-"], |
||||
pre[class*="language-"] { |
||||
background: #f5f2f0; |
||||
} |
||||
|
||||
/* Inline code */ |
||||
:not(pre)>code[class*="language-"] { |
||||
padding: .1em; |
||||
border-radius: .3em; |
||||
white-space: normal; |
||||
} |
||||
|
||||
.token.comment, |
||||
.token.prolog, |
||||
.token.doctype, |
||||
.token.cdata { |
||||
color: slategray; |
||||
} |
||||
|
||||
.token.punctuation { |
||||
color: #999; |
||||
} |
||||
|
||||
.namespace { |
||||
opacity: .7; |
||||
} |
||||
|
||||
.token.property, |
||||
.token.tag, |
||||
.token.boolean, |
||||
.token.number, |
||||
.token.constant, |
||||
.token.symbol, |
||||
.token.deleted { |
||||
color: #905; |
||||
} |
||||
|
||||
.token.selector, |
||||
.token.attr-name, |
||||
.token.string, |
||||
.token.char, |
||||
.token.builtin, |
||||
.token.inserted { |
||||
color: #690; |
||||
} |
||||
|
||||
.token.operator, |
||||
.token.entity, |
||||
.token.url, |
||||
.language-css .token.string, |
||||
.style .token.string { |
||||
color: #9a6e3a; |
||||
background: hsla(0, 0%, 100%, .5); |
||||
} |
||||
|
||||
.token.atrule, |
||||
.token.attr-value, |
||||
.token.keyword { |
||||
color: #07a; |
||||
} |
||||
|
||||
.token.function, |
||||
.token.class-name { |
||||
color: #DD4A68; |
||||
} |
||||
|
||||
.token.regex, |
||||
.token.important, |
||||
.token.variable { |
||||
color: #e90; |
||||
} |
||||
|
||||
.token.important, |
||||
.token.bold { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.token.italic { |
||||
font-style: italic; |
||||
} |
||||
|
||||
.token.entity { |
||||
cursor: help; |
||||
} |
@ -0,0 +1,446 @@ |
||||
<!DOCTYPE html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"/> |
||||
<title>IconFont Demo</title> |
||||
<link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon"/> |
||||
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css"> |
||||
<link rel="stylesheet" href="demo.css"> |
||||
<link rel="stylesheet" href="iconfont.css"> |
||||
<script src="iconfont.js"></script> |
||||
<!-- jQuery --> |
||||
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script> |
||||
<!-- 代码高亮 --> |
||||
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script> |
||||
</head> |
||||
<body> |
||||
<div class="main"> |
||||
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank"></a></h1> |
||||
<div class="nav-tabs"> |
||||
<ul id="tabs" class="dib-box"> |
||||
<li class="dib active"><span>Unicode</span></li> |
||||
<li class="dib"><span>Font class</span></li> |
||||
<li class="dib"><span>Symbol</span></li> |
||||
</ul> |
||||
|
||||
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=1540265" target="_blank" class="nav-more">查看项目</a> |
||||
|
||||
</div> |
||||
<div class="tab-container"> |
||||
<div class="content unicode" style="display: block;"> |
||||
<ul class="icon_lists dib-box"> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">已勾选32</div> |
||||
<div class="code-name">&#xe63d;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">未勾选32</div> |
||||
<div class="code-name">&#xe63e;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">未勾选40</div> |
||||
<div class="code-name">&#xe64a;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">已勾选40</div> |
||||
<div class="code-name">&#xe64b;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">实 向右箭头-01</div> |
||||
<div class="code-name">&#xe626;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">实 向下箭头-01</div> |
||||
<div class="code-name">&#xe625;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">加号-填充</div> |
||||
<div class="code-name">&#xe72d;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">42指向上、上箭头</div> |
||||
<div class="code-name">&#xe769;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">44指向下、下箭头</div> |
||||
<div class="code-name">&#xe76b;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">群蜂删除-充</div> |
||||
<div class="code-name">&#xe6e9;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">qq</div> |
||||
<div class="code-name">&#xe614;</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont"></span> |
||||
<div class="name">微信-36</div> |
||||
<div class="code-name">&#xe68a;</div> |
||||
</li> |
||||
|
||||
</ul> |
||||
<div class="article markdown"> |
||||
<h2 id="unicode-">Unicode 引用</h2> |
||||
<hr> |
||||
|
||||
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p> |
||||
<ul> |
||||
<li>兼容性最好,支持 IE6+,及所有现代浏览器。</li> |
||||
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li> |
||||
<li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li> |
||||
</ul> |
||||
<blockquote> |
||||
<p>注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式</p> |
||||
</blockquote> |
||||
<p>Unicode 使用步骤如下:</p> |
||||
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3> |
||||
<pre><code class="language-css" |
||||
>@font-face { |
||||
font-family: 'iconfont'; |
||||
src: url('iconfont.eot'); |
||||
src: url('iconfont.eot?#iefix') format('embedded-opentype'), |
||||
url('iconfont.woff2') format('woff2'), |
||||
url('iconfont.woff') format('woff'), |
||||
url('iconfont.ttf') format('truetype'), |
||||
url('iconfont.svg#iconfont') format('svg'); |
||||
} |
||||
</code></pre> |
||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> |
||||
<pre><code class="language-css" |
||||
>.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 16px; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
</code></pre> |
||||
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3> |
||||
<pre> |
||||
<code class="language-html" |
||||
><span class="iconfont">&#x33;</span> |
||||
</code></pre> |
||||
<blockquote> |
||||
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p> |
||||
</blockquote> |
||||
</div> |
||||
</div> |
||||
<div class="content font-class"> |
||||
<ul class="icon_lists dib-box"> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-yigouxuan"></span> |
||||
<div class="name"> |
||||
已勾选32 |
||||
</div> |
||||
<div class="code-name">.icon-yigouxuan |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-weigouxuan"></span> |
||||
<div class="name"> |
||||
未勾选32 |
||||
</div> |
||||
<div class="code-name">.icon-weigouxuan |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-weigouxuan1"></span> |
||||
<div class="name"> |
||||
未勾选40 |
||||
</div> |
||||
<div class="code-name">.icon-weigouxuan1 |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-yigouxuan1"></span> |
||||
<div class="name"> |
||||
已勾选40 |
||||
</div> |
||||
<div class="code-name">.icon-yigouxuan1 |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-shixiangyoujiantou-"></span> |
||||
<div class="name"> |
||||
实 向右箭头-01 |
||||
</div> |
||||
<div class="code-name">.icon-shixiangyoujiantou- |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-shixiangxiajiantou-"></span> |
||||
<div class="name"> |
||||
实 向下箭头-01 |
||||
</div> |
||||
<div class="code-name">.icon-shixiangxiajiantou- |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-jiahao"></span> |
||||
<div class="name"> |
||||
加号-填充 |
||||
</div> |
||||
<div class="code-name">.icon-jiahao |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-up"></span> |
||||
<div class="name"> |
||||
42指向上、上箭头 |
||||
</div> |
||||
<div class="code-name">.icon-up |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-down"></span> |
||||
<div class="name"> |
||||
44指向下、下箭头 |
||||
</div> |
||||
<div class="code-name">.icon-down |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-delete"></span> |
||||
<div class="name"> |
||||
群蜂删除-充 |
||||
</div> |
||||
<div class="code-name">.icon-delete |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-qq"></span> |
||||
<div class="name"> |
||||
qq |
||||
</div> |
||||
<div class="code-name">.icon-qq |
||||
</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<span class="icon iconfont icon-weixin"></span> |
||||
<div class="name"> |
||||
微信-36 |
||||
</div> |
||||
<div class="code-name">.icon-weixin |
||||
</div> |
||||
</li> |
||||
|
||||
</ul> |
||||
<div class="article markdown"> |
||||
<h2 id="font-class-">font-class 引用</h2> |
||||
<hr> |
||||
|
||||
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p> |
||||
<p>与 Unicode 使用方式相比,具有如下特点:</p> |
||||
<ul> |
||||
<li>兼容性良好,支持 IE8+,及所有现代浏览器。</li> |
||||
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li> |
||||
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li> |
||||
<li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li> |
||||
</ul> |
||||
<p>使用步骤如下:</p> |
||||
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3> |
||||
<pre><code class="language-html"><link rel="stylesheet" href="./iconfont.css"> |
||||
</code></pre> |
||||
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3> |
||||
<pre><code class="language-html"><span class="iconfont icon-xxx"></span> |
||||
</code></pre> |
||||
<blockquote> |
||||
<p>" |
||||
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p> |
||||
</blockquote> |
||||
</div> |
||||
</div> |
||||
<div class="content symbol"> |
||||
<ul class="icon_lists dib-box"> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-yigouxuan"></use> |
||||
</svg> |
||||
<div class="name">已勾选32</div> |
||||
<div class="code-name">#icon-yigouxuan</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-weigouxuan"></use> |
||||
</svg> |
||||
<div class="name">未勾选32</div> |
||||
<div class="code-name">#icon-weigouxuan</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-weigouxuan1"></use> |
||||
</svg> |
||||
<div class="name">未勾选40</div> |
||||
<div class="code-name">#icon-weigouxuan1</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-yigouxuan1"></use> |
||||
</svg> |
||||
<div class="name">已勾选40</div> |
||||
<div class="code-name">#icon-yigouxuan1</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-shixiangyoujiantou-"></use> |
||||
</svg> |
||||
<div class="name">实 向右箭头-01</div> |
||||
<div class="code-name">#icon-shixiangyoujiantou-</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-shixiangxiajiantou-"></use> |
||||
</svg> |
||||
<div class="name">实 向下箭头-01</div> |
||||
<div class="code-name">#icon-shixiangxiajiantou-</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-jiahao"></use> |
||||
</svg> |
||||
<div class="name">加号-填充</div> |
||||
<div class="code-name">#icon-jiahao</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-up"></use> |
||||
</svg> |
||||
<div class="name">42指向上、上箭头</div> |
||||
<div class="code-name">#icon-up</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-down"></use> |
||||
</svg> |
||||
<div class="name">44指向下、下箭头</div> |
||||
<div class="code-name">#icon-down</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-delete"></use> |
||||
</svg> |
||||
<div class="name">群蜂删除-充</div> |
||||
<div class="code-name">#icon-delete</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-qq"></use> |
||||
</svg> |
||||
<div class="name">qq</div> |
||||
<div class="code-name">#icon-qq</div> |
||||
</li> |
||||
|
||||
<li class="dib"> |
||||
<svg class="icon svg-icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-weixin"></use> |
||||
</svg> |
||||
<div class="name">微信-36</div> |
||||
<div class="code-name">#icon-weixin</div> |
||||
</li> |
||||
|
||||
</ul> |
||||
<div class="article markdown"> |
||||
<h2 id="symbol-">Symbol 引用</h2> |
||||
<hr> |
||||
|
||||
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a> |
||||
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p> |
||||
<ul> |
||||
<li>支持多色图标了,不再受单色限制。</li> |
||||
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li> |
||||
<li>兼容性较差,支持 IE9+,及现代浏览器。</li> |
||||
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li> |
||||
</ul> |
||||
<p>使用步骤如下:</p> |
||||
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3> |
||||
<pre><code class="language-html"><script src="./iconfont.js"></script> |
||||
</code></pre> |
||||
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3> |
||||
<pre><code class="language-html"><style> |
||||
.icon { |
||||
width: 1em; |
||||
height: 1em; |
||||
vertical-align: -0.15em; |
||||
fill: currentColor; |
||||
overflow: hidden; |
||||
} |
||||
</style> |
||||
</code></pre> |
||||
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3> |
||||
<pre><code class="language-html"><svg class="icon" aria-hidden="true"> |
||||
<use xlink:href="#icon-xxx"></use> |
||||
</svg> |
||||
</code></pre> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
<script> |
||||
$(document).ready(function () { |
||||
$('.tab-container .content:first').show() |
||||
|
||||
$('#tabs li').click(function (e) { |
||||
var tabContent = $('.tab-container .content') |
||||
var index = $(this).index() |
||||
|
||||
if ($(this).hasClass('active')) { |
||||
return |
||||
} else { |
||||
$('#tabs li').removeClass('active') |
||||
$(this).addClass('active') |
||||
|
||||
tabContent.hide().eq(index).fadeIn() |
||||
} |
||||
}) |
||||
}) |
||||
</script> |
||||
</body> |
||||
</html> |
@ -0,0 +1,71 @@ |
||||
@font-face {font-family: "iconfont"; |
||||
src: url('iconfont.eot?t=1589437921018'); /* IE9 */ |
||||
src: url('iconfont.eot?t=1589437921018#iefix') format('embedded-opentype'), /* IE6-IE8 */ |
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAdgAAsAAAAADwwAAAcTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCESgqOeIt2ATYCJAM0CxwABCAFhG0HgTMbpQxRlHBSFNlX2JThXqSJ4cz0aLyxzNkVgYOP2N97wQhUeQbPDZA1QByDeHha+9+5M7PrD1FpdI8mCSqJLulDJPFDxCQTvUQS6Qtka3ukU0/kuK8wfBBwMr1kmeTIb8hUohVh6lTeCHDCrRPPf5v6f+sQfS+QqgmpiZLNw+ZI6zMXZGL3nXY47elJFnjALaE4zjzyjJN773yuzM/7H4oZ9NV+v/q1g1ddvP1QmE5JlPRM7uAv5klMk0vWTBWTLpoJEUIja6hWSkNhOklN/ds4n0BvhyLMuZ6hKdArLC1Q4a4iG0Gfi1JaHEMbXtfsW8S8SpsepzuAJ+HLx28hoSepMmvby3e6LdC2EN2eV0ykW36MR/MlQFiJjGNAEej7WvtLgB6aM6evXtwH1glnTloW1snRYnBhky+LxyuL9glaGNmaDbRsJYR1tl+seImrgUGtEtLc//GMeo1WR9QYfUSrp7nohWgXDRrJBqpBcoAqkGagAGkBSiADQBlkEKiAbAI/N/mCYHoWi1HDEgWoBbGjlg7M/OpbgEMgnUf0fxab8kjK0tvq8cZ6/dpKwk4bNsXFx4bHR4RHcty4LVnR4xp/2TFxDN42tgefhUpEMeeqppXCU50JyT/gkVCD+EiEgl56LOkMN+6cAfyKs3dvomHU7fvnq96Uc/duIXMMqWmhNRoax1m8jNWfPorp2jlqumvHrolfe/2TcuIPCt3K589dhUNiT5OSEh4KoM9Jp1vK2GMnFjDdyaeFMrd06ki1gn9CmEz3OErpebmp+GzyAN+lMLw6dwkKh6Ve5dOnzp4W0+Y25TTfhHB10isXpxIB5GHDKcggnof+NCpCD+okAFyTPNGuRVgahmhLjZo1rnqnMlpD0ORJSluuY6jT+gPWHtaIeDKOaoradNDPruOQzulPGcBtz0C2YdbLrSFPIMGTrcNRDGC3YnJOm1JLceYK2sCWY5lqxICXIEU0gki2nkPFUteBwoqLMyTdKE7ZlOzE3yHfdSyOU2shl8RoxPJlx1bQ6C0Li3DLg+Sdi+c5evEkhtF3rBdfXpe0IiNcfW27+x6u5U4vs8zZZdu1R7Gblyc6AV9OB4Xp65HRDqcvw0Pi1DGbddntOKzYgkbhXJq+Y4bRVqszl746KdRPFV5FxSUb6XmKomd1yCb0nJbpz+aOIZskx0phXx8sHfNKyRjPsM8LGU/xJ9Qrv2JugdVBkBg/ZpUIDvpN0jfHD550XPKNDgkKEZ46l4dwq0sOxIecJlX2pxxA8GTwkCGMFqxVFf5PRZplCky9uCIQL/s/RFabTYZNkhtkQXFR28vKXwKUP5rZbFg+s3VAFTu5dBZG4G07t5tHuM2cFirh2BisrHKYoE8lzO1h/LkwjSD+VZF0qs1hQVK+d0xHOLN80q4B/P9utxQDmGt4DaEKE6Lc5lnI6VxDf/35owQHCAuKw95VG6l1bvXPY3J1slpepPBXdCx8EM+ubbd2tV48b2UtWLtYb89PZhvg2jsq5+zkBdIVVTFHfhEwNv0CxNiT02LKVxGSus1dt9VsXDZulogOJB1AkGQVg4e833uzaWatx7bPrLKyhBeBqlC3xGqNoe3MVQHmDmBs4jm+xFjW/sjcAgOiPOFawwe3bUeTa20vGNZgbV6tCtL/qEL/fmiFLjqCCDpZdQpkdKgx6tSuzlCdqnrMFsLMhWn9sKH4ezmjmvpp9Selw9oCS0Vtcbox4f967yYpc1lNwUzPAUT3N0R32yz0bof5Wblw2jzkuw4VkWFptzoKckHRUwszvHJS8IgkAfys2IvKr/LtZBa1LzvfHBmFD6/V9enLD7LLJD2tz7n3E8BkFcwVyA/DL8P0fCpXAdLntBfy9tQCpuUP2QBAWkwyYccYGYFWWc/HS8Of6pVNf1r8p8n48bn+wPLzm5gyWoneAh3ivzATiiRKljoz8hQTN3S0itSojpnbgvjFod7uBf2Rtsa7dej63gKVRdenkDS2Q9baZyzWY1AZnIBa6yT0juo9eLCWhhOlwxFrCYRVjkKywhfIVrlrLNa3UNngB9RWBQe9mxF1zMGBUFCnRoyUWLBpCStm1SU5sRRFFSeI7HUYtawUeswQzaNk4PKSsmJBL3ERbY4dPD65glIJS5rqxD3kYsThULFbU23ETEuslLobSkuluh1LzKoTkLM0hBH1A1pgJku2CjOVizQ+hUrPP4GQeTkYaS0tarYzCI2HMnusXImyHsZe3dWrxb1U9/CRVaBMggS79TUqJ6yHSSAcdq4Kc9evZUOYUSWsI7LdGpQy7Ul99ZL1qfObT4CedX+zSJGjRBV1NNFGF30MMcYsVugeKLLqDXiNLuQnSQjRvRwtrRzlsSoBxeiSl1SvLVQoF1FcZj0Jqi46odWosl43b1H9Lp2FOAgl7OKibs6cgOICAA==') format('woff2'), |
||||
url('iconfont.woff?t=1589437921018') format('woff'), |
||||
url('iconfont.ttf?t=1589437921018') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ |
||||
url('iconfont.svg?t=1589437921018#iconfont') format('svg'); /* iOS 4.1- */ |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 16px; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
.icon-yigouxuan:before { |
||||
content: "\e63d"; |
||||
} |
||||
|
||||
.icon-weigouxuan:before { |
||||
content: "\e63e"; |
||||
} |
||||
|
||||
.icon-weigouxuan1:before { |
||||
content: "\e64a"; |
||||
} |
||||
|
||||
.icon-yigouxuan1:before { |
||||
content: "\e64b"; |
||||
} |
||||
|
||||
.icon-shixiangyoujiantou-:before { |
||||
content: "\e626"; |
||||
} |
||||
|
||||
.icon-shixiangxiajiantou-:before { |
||||
content: "\e625"; |
||||
} |
||||
|
||||
.icon-jiahao:before { |
||||
content: "\e72d"; |
||||
} |
||||
|
||||
.icon-up:before { |
||||
content: "\e769"; |
||||
} |
||||
|
||||
.icon-down:before { |
||||
content: "\e76b"; |
||||
} |
||||
|
||||
.icon-delete:before { |
||||
content: "\e6e9"; |
||||
} |
||||
|
||||
.icon-qq:before { |
||||
content: "\e614"; |
||||
font-size: 60px; |
||||
color: #22aaf8; |
||||
margin-left: 32px; |
||||
} |
||||
|
||||
.icon-weixin:before { |
||||
content: "\e68a"; |
||||
font-size: 60px; |
||||
color: #10b747; |
||||
margin-right: 32px; |
||||
} |
||||
|
@ -0,0 +1,71 @@ |
||||
@font-face {font-family: "iconfont"; |
||||
src: url('iconfont.eot?t=1589437921018'); /* IE9 */ |
||||
src: url('iconfont.eot?t=1589437921018#iefix') format('embedded-opentype'), /* IE6-IE8 */ |
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAdgAAsAAAAADwwAAAcTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCESgqOeIt2ATYCJAM0CxwABCAFhG0HgTMbpQxRlHBSFNlX2JThXqSJ4cz0aLyxzNkVgYOP2N97wQhUeQbPDZA1QByDeHha+9+5M7PrD1FpdI8mCSqJLulDJPFDxCQTvUQS6Qtka3ukU0/kuK8wfBBwMr1kmeTIb8hUohVh6lTeCHDCrRPPf5v6f+sQfS+QqgmpiZLNw+ZI6zMXZGL3nXY47elJFnjALaE4zjzyjJN773yuzM/7H4oZ9NV+v/q1g1ddvP1QmE5JlPRM7uAv5klMk0vWTBWTLpoJEUIja6hWSkNhOklN/ds4n0BvhyLMuZ6hKdArLC1Q4a4iG0Gfi1JaHEMbXtfsW8S8SpsepzuAJ+HLx28hoSepMmvby3e6LdC2EN2eV0ykW36MR/MlQFiJjGNAEej7WvtLgB6aM6evXtwH1glnTloW1snRYnBhky+LxyuL9glaGNmaDbRsJYR1tl+seImrgUGtEtLc//GMeo1WR9QYfUSrp7nohWgXDRrJBqpBcoAqkGagAGkBSiADQBlkEKiAbAI/N/mCYHoWi1HDEgWoBbGjlg7M/OpbgEMgnUf0fxab8kjK0tvq8cZ6/dpKwk4bNsXFx4bHR4RHcty4LVnR4xp/2TFxDN42tgefhUpEMeeqppXCU50JyT/gkVCD+EiEgl56LOkMN+6cAfyKs3dvomHU7fvnq96Uc/duIXMMqWmhNRoax1m8jNWfPorp2jlqumvHrolfe/2TcuIPCt3K589dhUNiT5OSEh4KoM9Jp1vK2GMnFjDdyaeFMrd06ki1gn9CmEz3OErpebmp+GzyAN+lMLw6dwkKh6Ve5dOnzp4W0+Y25TTfhHB10isXpxIB5GHDKcggnof+NCpCD+okAFyTPNGuRVgahmhLjZo1rnqnMlpD0ORJSluuY6jT+gPWHtaIeDKOaoradNDPruOQzulPGcBtz0C2YdbLrSFPIMGTrcNRDGC3YnJOm1JLceYK2sCWY5lqxICXIEU0gki2nkPFUteBwoqLMyTdKE7ZlOzE3yHfdSyOU2shl8RoxPJlx1bQ6C0Li3DLg+Sdi+c5evEkhtF3rBdfXpe0IiNcfW27+x6u5U4vs8zZZdu1R7Gblyc6AV9OB4Xp65HRDqcvw0Pi1DGbddntOKzYgkbhXJq+Y4bRVqszl746KdRPFV5FxSUb6XmKomd1yCb0nJbpz+aOIZskx0phXx8sHfNKyRjPsM8LGU/xJ9Qrv2JugdVBkBg/ZpUIDvpN0jfHD550XPKNDgkKEZ46l4dwq0sOxIecJlX2pxxA8GTwkCGMFqxVFf5PRZplCky9uCIQL/s/RFabTYZNkhtkQXFR28vKXwKUP5rZbFg+s3VAFTu5dBZG4G07t5tHuM2cFirh2BisrHKYoE8lzO1h/LkwjSD+VZF0qs1hQVK+d0xHOLN80q4B/P9utxQDmGt4DaEKE6Lc5lnI6VxDf/35owQHCAuKw95VG6l1bvXPY3J1slpepPBXdCx8EM+ubbd2tV48b2UtWLtYb89PZhvg2jsq5+zkBdIVVTFHfhEwNv0CxNiT02LKVxGSus1dt9VsXDZulogOJB1AkGQVg4e833uzaWatx7bPrLKyhBeBqlC3xGqNoe3MVQHmDmBs4jm+xFjW/sjcAgOiPOFawwe3bUeTa20vGNZgbV6tCtL/qEL/fmiFLjqCCDpZdQpkdKgx6tSuzlCdqnrMFsLMhWn9sKH4ezmjmvpp9Selw9oCS0Vtcbox4f967yYpc1lNwUzPAUT3N0R32yz0bof5Wblw2jzkuw4VkWFptzoKckHRUwszvHJS8IgkAfys2IvKr/LtZBa1LzvfHBmFD6/V9enLD7LLJD2tz7n3E8BkFcwVyA/DL8P0fCpXAdLntBfy9tQCpuUP2QBAWkwyYccYGYFWWc/HS8Of6pVNf1r8p8n48bn+wPLzm5gyWoneAh3ivzATiiRKljoz8hQTN3S0itSojpnbgvjFod7uBf2Rtsa7dej63gKVRdenkDS2Q9baZyzWY1AZnIBa6yT0juo9eLCWhhOlwxFrCYRVjkKywhfIVrlrLNa3UNngB9RWBQe9mxF1zMGBUFCnRoyUWLBpCStm1SU5sRRFFSeI7HUYtawUeswQzaNk4PKSsmJBL3ERbY4dPD65glIJS5rqxD3kYsThULFbU23ETEuslLobSkuluh1LzKoTkLM0hBH1A1pgJku2CjOVizQ+hUrPP4GQeTkYaS0tarYzCI2HMnusXImyHsZe3dWrxb1U9/CRVaBMggS79TUqJ6yHSSAcdq4Kc9evZUOYUSWsI7LdGpQy7Ul99ZL1qfObT4CedX+zSJGjRBV1NNFGF30MMcYsVugeKLLqDXiNLuQnSQjRvRwtrRzlsSoBxeiSl1SvLVQoF1FcZj0Jqi46odWosl43b1H9Lp2FOAgl7OKibs6cgOICAA==') format('woff2'), |
||||
url('iconfont.woff?t=1589437921018') format('woff'), |
||||
url('iconfont.ttf?t=1589437921018') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ |
||||
url('iconfont.svg?t=1589437921018#iconfont') format('svg'); /* iOS 4.1- */ |
||||
} |
||||
|
||||
.iconfont { |
||||
font-family: "iconfont" !important; |
||||
font-size: 16px; |
||||
font-style: normal; |
||||
-webkit-font-smoothing: antialiased; |
||||
-moz-osx-font-smoothing: grayscale; |
||||
} |
||||
|
||||
.icon-yigouxuan:before { |
||||
content: "\e63d"; |
||||
} |
||||
|
||||
.icon-weigouxuan:before { |
||||
content: "\e63e"; |
||||
} |
||||
|
||||
.icon-weigouxuan1:before { |
||||
content: "\e64a"; |
||||
} |
||||
|
||||
.icon-yigouxuan1:before { |
||||
content: "\e64b"; |
||||
} |
||||
|
||||
.icon-shixiangyoujiantou-:before { |
||||
content: "\e626"; |
||||
} |
||||
|
||||
.icon-shixiangxiajiantou-:before { |
||||
content: "\e625"; |
||||
} |
||||
|
||||
.icon-jiahao:before { |
||||
content: "\e72d"; |
||||
} |
||||
|
||||
.icon-up:before { |
||||
content: "\e769"; |
||||
} |
||||
|
||||
.icon-down:before { |
||||
content: "\e76b"; |
||||
} |
||||
|
||||
.icon-delete:before { |
||||
content: "\e6e9"; |
||||
} |
||||
|
||||
.icon-qq:before { |
||||
content: "\e614"; |
||||
font-size: 60px; |
||||
color: #22aaf8; |
||||
margin-left: 32px; |
||||
} |
||||
|
||||
.icon-weixin:before { |
||||
content: "\e68a"; |
||||
font-size: 60px; |
||||
color: #10b747; |
||||
margin-right: 32px; |
||||
} |
||||
|
@ -0,0 +1,93 @@ |
||||
{ |
||||
"id": "1540265", |
||||
"name": "education", |
||||
"font_family": "iconfont", |
||||
"css_prefix_text": "icon-", |
||||
"description": "", |
||||
"glyphs": [ |
||||
{ |
||||
"icon_id": "2716513", |
||||
"name": "已勾选32", |
||||
"font_class": "yigouxuan", |
||||
"unicode": "e63d", |
||||
"unicode_decimal": 58941 |
||||
}, |
||||
{ |
||||
"icon_id": "2716516", |
||||
"name": "未勾选32", |
||||
"font_class": "weigouxuan", |
||||
"unicode": "e63e", |
||||
"unicode_decimal": 58942 |
||||
}, |
||||
{ |
||||
"icon_id": "2892929", |
||||
"name": "未勾选40", |
||||
"font_class": "weigouxuan1", |
||||
"unicode": "e64a", |
||||
"unicode_decimal": 58954 |
||||
}, |
||||
{ |
||||
"icon_id": "2892954", |
||||
"name": "已勾选40", |
||||
"font_class": "yigouxuan1", |
||||
"unicode": "e64b", |
||||
"unicode_decimal": 58955 |
||||
}, |
||||
{ |
||||
"icon_id": "5979965", |
||||
"name": "实 向右箭头-01", |
||||
"font_class": "shixiangyoujiantou-", |
||||
"unicode": "e626", |
||||
"unicode_decimal": 58918 |
||||
}, |
||||
{ |
||||
"icon_id": "5979966", |
||||
"name": "实 向下箭头-01", |
||||
"font_class": "shixiangxiajiantou-", |
||||
"unicode": "e625", |
||||
"unicode_decimal": 58917 |
||||
}, |
||||
{ |
||||
"icon_id": "8349103", |
||||
"name": "加号-填充", |
||||
"font_class": "jiahao", |
||||
"unicode": "e72d", |
||||
"unicode_decimal": 59181 |
||||
}, |
||||
{ |
||||
"icon_id": "6129078", |
||||
"name": "42指向上、上箭头", |
||||
"font_class": "up", |
||||
"unicode": "e769", |
||||
"unicode_decimal": 59241 |
||||
}, |
||||
{ |
||||
"icon_id": "6129081", |
||||
"name": "44指向下、下箭头", |
||||
"font_class": "down", |
||||
"unicode": "e76b", |
||||
"unicode_decimal": 59243 |
||||
}, |
||||
{ |
||||
"icon_id": "410692", |
||||
"name": "群蜂删除-充", |
||||
"font_class": "delete", |
||||
"unicode": "e6e9", |
||||
"unicode_decimal": 59113 |
||||
}, |
||||
{ |
||||
"icon_id": "468193", |
||||
"name": "qq", |
||||
"font_class": "qq", |
||||
"unicode": "e614", |
||||
"unicode_decimal": 58900 |
||||
}, |
||||
{ |
||||
"icon_id": "7009153", |
||||
"name": "微信-36", |
||||
"font_class": "weixin", |
||||
"unicode": "e68a", |
||||
"unicode_decimal": 59018 |
||||
} |
||||
] |
||||
} |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 829 B |
After Width: | Height: | Size: 683 B |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 1.5 MiB |
After Width: | Height: | Size: 106 KiB |
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,173 @@ |
||||
<template> |
||||
<div class="quill" :class="classes"> |
||||
<div ref="editor" :style="styles" v-loading="loading"></div> |
||||
|
||||
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none"> |
||||
<el-button class="editorUpload" size="small" type="primary">点击上传</el-button> |
||||
</el-upload> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Quill from 'quill'; |
||||
import 'quill/dist/quill.core.css'; |
||||
import 'quill/dist/quill.snow.css'; |
||||
import 'quill/dist/quill.bubble.css'; |
||||
import toolbarOptions from './options' |
||||
|
||||
export default { |
||||
name: 'quill', |
||||
props: { |
||||
value: { |
||||
type: String, |
||||
default: '' |
||||
}, |
||||
readonly: { |
||||
type: Boolean, |
||||
default: false |
||||
}, |
||||
border: { |
||||
type: Boolean, |
||||
default: false |
||||
}, |
||||
height: { |
||||
type: Number |
||||
}, |
||||
minHeight: { |
||||
type: Number |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
Quill: null, |
||||
currentValue: '', |
||||
options: { |
||||
theme: 'snow', |
||||
bounds: document.body, |
||||
debug: 'warn', |
||||
modules: { |
||||
toolbar: { |
||||
container: toolbarOptions, |
||||
handlers: { |
||||
'image': function (value) { |
||||
if (value) { |
||||
// 调用iview图片上传 |
||||
document.querySelector('.editorUpload').click() |
||||
} else { |
||||
this.Quill.format('image', false); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
placeholder: '', |
||||
readOnly: this.readonly |
||||
}, |
||||
loading: false |
||||
} |
||||
}, |
||||
computed: { |
||||
classes () { |
||||
return [ |
||||
{ |
||||
'quill-no-border': !this.border |
||||
} |
||||
]; |
||||
}, |
||||
styles () { |
||||
let style = {}; |
||||
if (this.minHeight) { |
||||
style.minHeight = `${this.minHeight}px`; |
||||
} |
||||
if (this.height) { |
||||
style.height = `${this.height}px`; |
||||
} |
||||
return style; |
||||
} |
||||
}, |
||||
watch: { |
||||
value: { |
||||
handler (val) { |
||||
if (val !== this.currentValue) { |
||||
this.currentValue = val; |
||||
if (this.Quill) { |
||||
this.Quill.pasteHTML(this.value); |
||||
} |
||||
} |
||||
}, |
||||
immediate: true |
||||
} |
||||
}, |
||||
mounted () { |
||||
this.init(); |
||||
}, |
||||
beforeDestroy () { |
||||
// 在组件销毁后销毁实例 |
||||
this.Quill = null; |
||||
}, |
||||
methods: { |
||||
init () { |
||||
const editor = this.$refs.editor; |
||||
// 初始化编辑器 |
||||
this.Quill = new Quill(editor, this.options); |
||||
// 默认值 |
||||
this.Quill.pasteHTML(this.currentValue); |
||||
this.$nextTick(() => { |
||||
window.scrollTo(0,0) |
||||
}) |
||||
// 绑定事件 |
||||
this.Quill.on('text-change', (delta, oldDelta, source) => { |
||||
const html = this.$refs.editor.children[0].innerHTML; |
||||
const text = this.Quill.getText(); |
||||
const quill = this.Quill; |
||||
// 更新内部的值 |
||||
this.currentValue = html; |
||||
// 发出事件 v-model |
||||
this.$emit('input', html); |
||||
// 发出事件 |
||||
this.$emit('on-change', { html, text, quill }); |
||||
}); |
||||
// 将一些 quill 自带的事件传递出去 |
||||
this.Quill.on('text-change', (delta, oldDelta, source) => { |
||||
this.$emit('on-text-change', delta, oldDelta, source); |
||||
}); |
||||
this.Quill.on('selection-change', (range, oldRange, source) => { |
||||
this.$emit('on-selection-change', range, oldRange, source); |
||||
}); |
||||
this.Quill.on('editor-change', (eventName, ...args) => { |
||||
this.$emit('on-editor-change', eventName, ...args); |
||||
}); |
||||
}, |
||||
beforeUpload(file){ |
||||
this.loading = true |
||||
}, |
||||
editorUploadSuccess (res) { |
||||
// 获取富文本组件实例 |
||||
let quill = this.Quill |
||||
// 如果上传成功 |
||||
if (res.data.filesResult.fileUrl) { |
||||
// 获取光标所在位置 |
||||
let length = quill.getSelection().index; |
||||
// 插入图片,res为服务器返回的图片链接地址 |
||||
quill.insertEmbed(length, 'image', res.data.filesResult.fileUrl) |
||||
// 调整光标到最后 |
||||
quill.setSelection(length + 1) |
||||
} else { |
||||
this.$message.success('图片插入失败') |
||||
} |
||||
this.loading = false |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.quill-no-border{ |
||||
.ql-toolbar.ql-snow{ |
||||
border: none; |
||||
border-bottom: 1px solid #e8eaec; |
||||
} |
||||
.ql-container.ql-snow{ |
||||
border: none; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,15 @@ |
||||
export default [ |
||||
['bold', 'italic', 'underline', 'strike'], |
||||
['blockquote', 'code-block'], |
||||
[{ 'header': 1 }, { 'header': 2 }], |
||||
[{ 'list': 'ordered' }, { 'list': 'bullet' }], |
||||
[{ 'script': 'sub' }, { 'script': 'super' }], |
||||
[{ 'indent': '-1' }, { 'indent': '+1' }], |
||||
[{ 'direction': 'rtl' }], |
||||
[{ 'size': ['small', false, 'large', 'huge'] }], |
||||
[{ 'color': [] }, { 'background': [] }], |
||||
[{ 'font': [] }], |
||||
[{ 'align': [] }], |
||||
['clean'], |
||||
['link', 'image', 'video'] |
||||
] |
@ -0,0 +1,30 @@ |
||||
export const messages = { |
||||
'zh': { |
||||
i18n: { |
||||
breadcrumb: '国际化产品', |
||||
tips: '通过切换语言按钮,来改变当前内容的语言。', |
||||
btn: '切换英文', |
||||
title1: '常用用法', |
||||
p1: '要是你把你的秘密告诉了风,那就别怪风把它带给树。', |
||||
p2: '没有什么比信念更能支撑我们度过艰难的时光了。', |
||||
p3: '只要能把自己的事做好,并让自己快乐,你就领先于大多数人了。', |
||||
title2: '组件插值', |
||||
info: 'Element组件需要国际化,请参考 {action}。', |
||||
value: '文档' |
||||
} |
||||
}, |
||||
'en': { |
||||
i18n: { |
||||
breadcrumb: 'International Products', |
||||
tips: 'Click on the button to change the current language. ', |
||||
btn: 'Switch Chinese', |
||||
title1: 'Common usage', |
||||
p1: "If you reveal your secrets to the wind you should not blame the wind for revealing them to the trees.", |
||||
p2: "Nothing can help us endure dark times better than our faith. ", |
||||
p3: "If you can do what you do best and be happy, you're further along in life than most people.", |
||||
title2: 'Component interpolation', |
||||
info: 'The default language of Element is Chinese. If you wish to use another language, please refer to the {action}.', |
||||
value: 'documentation' |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,126 @@ |
||||
<template> |
||||
<div class="header flex-between"> |
||||
<div v-if="showBack" class="goBack" v-throttle @click="back"><i class="el-icon-arrow-left"></i>返回</div> |
||||
<div v-else class="logo"> |
||||
<img src="../../assets/img/logo.png"> |
||||
</div> |
||||
<div class="header-right"> |
||||
<div class="header-user-con"> |
||||
<div class="user" @click="toPerson"> |
||||
<el-avatar :size="40" :src="avatar"></el-avatar> |
||||
<span class="user-avator">{{userName}}</span> |
||||
</div> |
||||
<el-divider class="ml20" direction="vertical"></el-divider> |
||||
<el-button type="text" class="ml20" @click="loginout">退出</el-button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { mapState } from 'vuex'; |
||||
import { mapActions } from 'vuex'; |
||||
import bus from '@/libs/bus'; |
||||
import Setting from '@/setting'; |
||||
import util from '@/libs/util'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
collapse: false, |
||||
fullscreen: false, |
||||
name: 'huoran', |
||||
message: 2, |
||||
circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png", |
||||
showBackList: Setting.layout.hideNavList, |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'userName','avatar' |
||||
]), |
||||
showBack(){ |
||||
let route = this.$route.name |
||||
if(this.showBackList.includes(route)) return true |
||||
return false |
||||
} |
||||
}, |
||||
methods: { |
||||
...mapActions('user', [ |
||||
'logout' |
||||
]), |
||||
toPerson(){ |
||||
this.$router.push('/setting/person') |
||||
}, |
||||
loginout() { |
||||
this.logout() |
||||
} |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.goBack{ |
||||
cursor: pointer; |
||||
line-height: 60px; |
||||
height: 60px; |
||||
font-size: 16px; |
||||
font-weight: bold; |
||||
margin-left: 20px; |
||||
} |
||||
.goBack i{ |
||||
color: #cb221c; |
||||
font-size: 20px; |
||||
} |
||||
.header { |
||||
position: relative; |
||||
box-sizing: border-box; |
||||
width: 100%; |
||||
height: 60px; |
||||
font-size: 16px; |
||||
color: #333; |
||||
} |
||||
.header .logo { |
||||
float: left; |
||||
width: 170px; |
||||
height: 40px; |
||||
margin-left: 20px; |
||||
} |
||||
.header .logo img{ |
||||
height: 100%; |
||||
} |
||||
.header-right { |
||||
float: right; |
||||
padding-right: 50px; |
||||
} |
||||
.header-user-con { |
||||
display: flex; |
||||
height: 70px; |
||||
align-items: center; |
||||
|
||||
.user{ |
||||
display: inline-flex; |
||||
align-items: center; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
.user-avator { |
||||
margin-left: 10px; |
||||
} |
||||
.ml20{ |
||||
margin-left: 20px; |
||||
} |
||||
.user-avator img { |
||||
display: block; |
||||
width: 40px; |
||||
height: 40px; |
||||
border-radius: 50%; |
||||
} |
||||
.header-right .el-button--text{ |
||||
color: #333; |
||||
} |
||||
.header-right .el-divider--vertical{ |
||||
width: 2px; |
||||
height: 15px; |
||||
} |
||||
.header-right .el-divider{ |
||||
background-color: #333; |
||||
} |
||||
</style> |
@ -0,0 +1,81 @@ |
||||
<template> |
||||
<div class="wrapper"> |
||||
<div class="placeholder" :class="{mini: !hideNavList}"></div> |
||||
<div class="fixed"> |
||||
<v-head></v-head> |
||||
<v-navbar v-show="hideNavbar"></v-navbar> |
||||
</div> |
||||
<div class="content-box" :class="{'content-collapse':collapse}"> |
||||
<!-- <v-tags></v-tags> --> |
||||
<div class="content"> |
||||
<transition name="move" mode="out-in"> |
||||
<keep-alive :include="tagsList"> |
||||
<router-view></router-view> |
||||
</keep-alive> |
||||
</transition> |
||||
<el-backtop target=".content"></el-backtop> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import vHead from '../header/index.vue'; |
||||
import vNavbar from '../navbar/index.vue'; |
||||
import vTags from '../tags/index.vue'; |
||||
import bus from '@/libs/bus'; |
||||
import Setting from '@/setting'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
tagsList: [], |
||||
collapse: false, |
||||
hideNavList: Setting.layout.hideNavList |
||||
}; |
||||
}, |
||||
components: { |
||||
vHead, |
||||
vNavbar, |
||||
vTags |
||||
}, |
||||
computed: { |
||||
hideNavbar() { |
||||
let route = this.$route.name |
||||
if(this.hideNavList.includes(route)) return false |
||||
return true |
||||
} |
||||
}, |
||||
created() { |
||||
bus.$on('collapse-content', msg => { |
||||
this.collapse = msg; |
||||
}); |
||||
|
||||
// 只有在标签页列表里的页面才使用keep-alive,即关闭标签之后就不保存到内存中了。 |
||||
bus.$on('tags', msg => { |
||||
let arr = []; |
||||
for (let i = 0, len = msg.length; i < len; i++) { |
||||
msg[i].name && arr.push(msg[i].name); |
||||
} |
||||
this.tagsList = arr; |
||||
}); |
||||
} |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.sidebar+.content-box{ |
||||
margin-left: 210px !important; |
||||
} |
||||
.fixed{ |
||||
z-index: 10; |
||||
position: fixed; |
||||
top: 0; |
||||
width: 100%; |
||||
background-color: #fff; |
||||
} |
||||
.placeholder{ |
||||
height: 120px; |
||||
&.mini{ |
||||
height: 60px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,123 @@ |
||||
<template> |
||||
<div> |
||||
<el-menu |
||||
class="sidebar-el-menu" |
||||
:default-active="onRoutes" |
||||
:collapse="collapse" |
||||
background-color="#324157" |
||||
text-color="#bfcbd9" |
||||
active-text-color="#cb221c" |
||||
unique-opened |
||||
mode="horizontal" |
||||
router |
||||
> |
||||
<template v-for="item in menus"> |
||||
<template v-if="item.subs"> |
||||
<el-submenu :index="item.index" :key="item.index"> |
||||
<template slot="title"> |
||||
<i :class="item.icon"></i> |
||||
<span slot="title">{{ item.title }}</span> |
||||
</template> |
||||
<template v-for="subItem in item.subs"> |
||||
<el-submenu |
||||
v-if="subItem.subs" |
||||
:index="subItem.index" |
||||
:key="subItem.index" |
||||
> |
||||
<template slot="title">{{ subItem.title }}</template> |
||||
<el-menu-item |
||||
v-for="(threeItem,i) in subItem.subs" |
||||
:key="i" |
||||
:index="threeItem.index" |
||||
>{{ threeItem.title }}</el-menu-item> |
||||
</el-submenu> |
||||
<el-menu-item |
||||
v-else |
||||
:index="subItem.index" |
||||
:key="subItem.index" |
||||
>{{ subItem.title }}</el-menu-item> |
||||
</template> |
||||
</el-submenu> |
||||
</template> |
||||
<template v-else> |
||||
<el-menu-item :index="item.index" :key="item.index"> |
||||
<i :class="item.icon"></i> |
||||
<span slot="title">{{ item.title }}</span> |
||||
</el-menu-item> |
||||
</template> |
||||
</template> |
||||
</el-menu> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '@/libs/bus'; |
||||
import Setting from '@/setting'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
collapse: false, |
||||
defaultMenus: [ |
||||
{ |
||||
icon: 'el-icon-lx-home', |
||||
index: '/index/list', |
||||
title: '学校管理' |
||||
}, |
||||
{ |
||||
icon: 'el-icon-user', |
||||
index: '/user/list', |
||||
title: '用户管理' |
||||
}, |
||||
{ |
||||
icon: 'el-icon-monitor', |
||||
index: '/quesBank/list', |
||||
title: '题库管理' |
||||
}, |
||||
{ |
||||
icon: 'el-icon-takeaway-box', |
||||
index: '/system/list', |
||||
title: '系统设置' |
||||
} |
||||
], |
||||
menus: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
onRoutes() { |
||||
console.log(33,this.$route) |
||||
return this.$route.path |
||||
} |
||||
}, |
||||
created() { |
||||
this.initMenu() |
||||
// 通过 Event Bus 进行组件间通信,来折叠侧边栏 |
||||
bus.$on('collapse', msg => { |
||||
this.collapse = msg; |
||||
bus.$emit('collapse-content', msg); |
||||
}); |
||||
}, |
||||
methods: { |
||||
initMenu(){ |
||||
if(Setting.dynamicRoute){ |
||||
let routes = this.$store.state.routes[1].children |
||||
let menus = [] |
||||
this.defaultMenus.map(e => { |
||||
routes.find(n => n.path == e.index) && menus.push(e) |
||||
}) |
||||
this.menus = menus |
||||
}else{ |
||||
this.menus = this.defaultMenus |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.sidebar-el-menu:not(.el-menu--collapse) { |
||||
width: 100%; |
||||
} |
||||
.sidebar > ul { |
||||
height: 100%; |
||||
} |
||||
</style> |
@ -0,0 +1,185 @@ |
||||
<template> |
||||
<div class="tags" v-if="showTags"> |
||||
<ul> |
||||
<li class="tags-li" v-for="(item,index) in tagsList" :class="{'active': isActive(item.path)}" :key="index"> |
||||
<router-link :to="item.path" class="tags-li-title"> |
||||
{{item.title}} |
||||
</router-link> |
||||
<span class="tags-li-icon" @click="closeTags(index)"><i class="el-icon-close"></i></span> |
||||
</li> |
||||
</ul> |
||||
<div class="tags-close-box"> |
||||
<el-dropdown @command="handleTags"> |
||||
<el-button size="mini" type="primary"> |
||||
标签选项<i class="el-icon-arrow-down el-icon--right"></i> |
||||
</el-button> |
||||
<el-dropdown-menu size="small" slot="dropdown"> |
||||
<el-dropdown-item command="other">关闭其他</el-dropdown-item> |
||||
<el-dropdown-item command="all">关闭所有</el-dropdown-item> |
||||
</el-dropdown-menu> |
||||
</el-dropdown> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '@/libs/bus'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
tagsList: [] |
||||
} |
||||
}, |
||||
methods: { |
||||
isActive(path) { |
||||
return path === this.$route.fullPath; |
||||
}, |
||||
// 关闭单个标签 |
||||
closeTags(index) { |
||||
const delItem = this.tagsList.splice(index, 1)[0]; |
||||
const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1]; |
||||
if (item) { |
||||
delItem.path === this.$route.fullPath && this.$router.push(item.path); |
||||
}else{ |
||||
this.$router.push('/dashboard'); |
||||
} |
||||
}, |
||||
// 关闭全部标签 |
||||
closeAll(){ |
||||
this.tagsList = []; |
||||
this.$router.push('/dashboard'); |
||||
}, |
||||
// 关闭其他标签 |
||||
closeOther(){ |
||||
const curItem = this.tagsList.filter(item => { |
||||
return item.path === this.$route.fullPath; |
||||
}) |
||||
this.tagsList = curItem; |
||||
}, |
||||
// 设置标签 |
||||
setTags(route){ |
||||
const isExist = this.tagsList.some(item => { |
||||
return item.path === route.fullPath; |
||||
}) |
||||
if(!isExist){ |
||||
if(this.tagsList.length >= 8){ |
||||
this.tagsList.shift(); |
||||
} |
||||
this.tagsList.push({ |
||||
title: route.meta.title, |
||||
path: route.fullPath, |
||||
name: route.matched[1].components.default.name |
||||
}) |
||||
} |
||||
bus.$emit('tags', this.tagsList); |
||||
}, |
||||
handleTags(command){ |
||||
command === 'other' ? this.closeOther() : this.closeAll(); |
||||
} |
||||
}, |
||||
computed: { |
||||
showTags() { |
||||
return this.tagsList.length > 0; |
||||
} |
||||
}, |
||||
watch:{ |
||||
$route(newValue, oldValue){ |
||||
this.setTags(newValue); |
||||
} |
||||
}, |
||||
created(){ |
||||
this.setTags(this.$route); |
||||
// 监听关闭当前页面的标签页 |
||||
bus.$on('close_current_tags', () => { |
||||
for (let i = 0, len = this.tagsList.length; i < len; i++) { |
||||
const item = this.tagsList[i]; |
||||
if(item.path === this.$route.fullPath){ |
||||
if(i < len - 1){ |
||||
this.$router.push(this.tagsList[i+1].path); |
||||
}else if(i > 0){ |
||||
this.$router.push(this.tagsList[i-1].path); |
||||
}else{ |
||||
this.$router.push('/'); |
||||
} |
||||
this.tagsList.splice(i, 1); |
||||
break; |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
|
||||
</script> |
||||
|
||||
|
||||
<style lang="scss" scoped> |
||||
.tags { |
||||
position: relative; |
||||
height: 30px; |
||||
overflow: hidden; |
||||
background: #fff; |
||||
padding-right: 120px; |
||||
box-shadow: 0 5px 10px #ddd; |
||||
} |
||||
|
||||
.tags ul { |
||||
box-sizing: border-box; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.tags-li { |
||||
float: left; |
||||
margin: 3px 5px 2px 3px; |
||||
border-radius: 3px; |
||||
font-size: 12px; |
||||
overflow: hidden; |
||||
cursor: pointer; |
||||
height: 23px; |
||||
line-height: 23px; |
||||
border: 1px solid #e9eaec; |
||||
background: #fff; |
||||
padding: 0 5px 0 12px; |
||||
vertical-align: middle; |
||||
color: #666; |
||||
-webkit-transition: all .3s ease-in; |
||||
-moz-transition: all .3s ease-in; |
||||
transition: all .3s ease-in; |
||||
} |
||||
|
||||
.tags-li:not(.active):hover { |
||||
background: #f8f8f8; |
||||
} |
||||
|
||||
.tags-li.active { |
||||
color: #fff; |
||||
} |
||||
|
||||
.tags-li-title { |
||||
float: left; |
||||
max-width: 80px; |
||||
overflow: hidden; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
margin-right: 5px; |
||||
color: #666; |
||||
} |
||||
|
||||
.tags-li.active .tags-li-title { |
||||
color: #fff; |
||||
} |
||||
|
||||
.tags-close-box { |
||||
position: absolute; |
||||
right: 0; |
||||
top: 0; |
||||
box-sizing: border-box; |
||||
padding-top: 1px; |
||||
text-align: center; |
||||
width: 110px; |
||||
height: 30px; |
||||
background: #fff; |
||||
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, .1); |
||||
z-index: 10; |
||||
} |
||||
</style> |
@ -0,0 +1,26 @@ |
||||
/** |
||||
* @description 生成按钮级别权限组 |
||||
* */ |
||||
|
||||
import store from '@/store'; |
||||
export default function(data){ |
||||
let result = [] |
||||
data.map(e => { |
||||
if(e.select){ |
||||
e.children.map(n => { |
||||
if(n.select){ |
||||
if(n.children.length){ |
||||
result.push(`${e.name}:${n.name}`) |
||||
n.children.map(j => { |
||||
j.select && (e.component ? result.push(`${e.component}:${n.name}:${j.name}`) : result.push(`${n.component}:${j.name}`)) |
||||
}) |
||||
}else{ |
||||
result.push(`${e.component}:${n.name}`) |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
store.commit('addBtnPerData',{btnPermissions: result}) |
||||
// console.log('geneBtn:',result)
|
||||
} |
@ -0,0 +1,6 @@ |
||||
import Vue from 'vue'; |
||||
|
||||
// 使用 Event Bus
|
||||
const bus = new Vue(); |
||||
|
||||
export default bus; |
@ -0,0 +1,10 @@ |
||||
// 生成随机字符串
|
||||
export default function (len = 32) { |
||||
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; |
||||
const maxPos = $chars.length; |
||||
let str = ''; |
||||
for (let i = 0; i < len; i++) { |
||||
str += $chars.charAt(Math.floor(Math.random() * maxPos)); |
||||
} |
||||
return str; |
||||
} |
@ -0,0 +1,16 @@ |
||||
// rem等比适配配置文件
|
||||
// 基准大小
|
||||
const baseSize = 16 |
||||
// 设置 rem 函数
|
||||
function setRem () { |
||||
// 当前页面宽度相对于 1920宽的缩放比例,可根据自己需要修改。
|
||||
const scale = document.documentElement.clientWidth / 1920 |
||||
// 设置页面根节点字体大小(“Math.min(scale, 2)” 指最高放大比例为2,可根据实际业务需求调整)
|
||||
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px' |
||||
} |
||||
// 初始化
|
||||
setRem() |
||||
// 改变窗口大小时重新设置 rem
|
||||
window.onresize = function () { |
||||
setRem() |
||||
} |
@ -0,0 +1,41 @@ |
||||
import store from '@/store'; |
||||
import router from '@/router'; |
||||
import generateBtnPermission from '../auth/generateBtnPermission'; |
||||
|
||||
const infoSidebar = ['information','content'] |
||||
const matchSidebar = ['matchintro','matchprogress','matchsignup'] |
||||
const newRoutes = [] |
||||
|
||||
function createMeta(item){ |
||||
let meta = { title: item.name } |
||||
infoSidebar.includes(item.component) && (meta.sidebar = 'info') |
||||
matchSidebar.includes(item.component) && (meta.sidebar = 'match') |
||||
return meta |
||||
} |
||||
|
||||
function createRoute(data){ |
||||
data.map(e => { |
||||
if(e.select && e.component){ |
||||
let meta = createMeta(e) |
||||
newRoutes.push({ |
||||
name: e.component, |
||||
path: e.component, |
||||
component: () => import(`@/pages/${e.component}.vue`), |
||||
meta |
||||
}) |
||||
} |
||||
e.children && e.children.length && createRoute(e.children) |
||||
}) |
||||
} |
||||
|
||||
export default function(data,path){ |
||||
generateBtnPermission(data) |
||||
createRoute(data) |
||||
let routes = router.options.routes |
||||
routes[1].children = [...routes[1].children,...newRoutes] |
||||
store.commit("addRoutesData", { routes }) |
||||
router.addRoutes(routes) |
||||
setTimeout(() => { |
||||
!newRoutes.find(n => n.name == 'dashboard') && router.push(newRoutes[0].path) |
||||
},10) |
||||
} |
@ -0,0 +1,27 @@ |
||||
import store from '@/store'; |
||||
import router from '@/router'; |
||||
|
||||
export default function(){ |
||||
setTimeout(() => { |
||||
let routes = store.state.routes |
||||
console.log(333,routes) |
||||
routes.forEach(e => { |
||||
if(e.path == '/'){ |
||||
e.component = () => import('@/layouts/home/index.vue') |
||||
}else{ |
||||
e.component = () => import(`@/pages/${e.path}.vue`) |
||||
} |
||||
|
||||
e.children && e.children.forEach(n => { |
||||
n.path && (n.component = () => import(`@/pages/${n.path}.vue`)) |
||||
}) |
||||
}) |
||||
|
||||
routes.push({ |
||||
path: '*', |
||||
redirect: '404' |
||||
}) |
||||
|
||||
router.addRoutes(routes) |
||||
},500) |
||||
} |
@ -0,0 +1,6 @@ |
||||
import router from '@/router'; |
||||
|
||||
export default function(){ |
||||
const newRouter = createRouter() |
||||
router.matcher = newRouter.matcher |
||||
} |
@ -0,0 +1,43 @@ |
||||
import Cookies from 'js-cookie'; |
||||
import Setting from '@/setting'; |
||||
|
||||
const cookies = {}; |
||||
|
||||
/** |
||||
* @description 存储 cookie 值 |
||||
* @param {String} name cookie name |
||||
* @param {String} value cookie value |
||||
* @param {Object} cookieSetting cookie setting |
||||
*/ |
||||
cookies.set = function (name = 'default', value = '', cookieSetting = {}) { |
||||
let currentCookieSetting = { |
||||
expires: Setting.cookiesExpires |
||||
}; |
||||
Object.assign(currentCookieSetting, cookieSetting); |
||||
Cookies.set(`admin-${name}`, value, currentCookieSetting); |
||||
}; |
||||
|
||||
/** |
||||
* @description 拿到 cookie 值 |
||||
* @param {String} name cookie name |
||||
*/ |
||||
cookies.get = function (name = 'default') { |
||||
return Cookies.get(`admin-${name}`); |
||||
}; |
||||
|
||||
/** |
||||
* @description 拿到 cookie 全部的值 |
||||
*/ |
||||
cookies.getAll = function () { |
||||
return Cookies.get(); |
||||
}; |
||||
|
||||
/** |
||||
* @description 删除 cookie |
||||
* @param {String} name cookie name |
||||
*/ |
||||
cookies.remove = function (name = 'default') { |
||||
return Cookies.remove(`admin-${name}`); |
||||
}; |
||||
|
||||
export default cookies; |
@ -0,0 +1,82 @@ |
||||
/** |
||||
* localStorage |
||||
* @调用:_local.set('access_token', '123456', 5000); |
||||
* @调用:_local.get('access_token'); |
||||
*/ |
||||
|
||||
var _local = { |
||||
//存储,可设置过期时间
|
||||
set(key, value, expires) { |
||||
let params = { key, value, expires }; |
||||
if (expires) { |
||||
// 记录何时将值存入缓存,毫秒级
|
||||
var data = Object.assign(params, { startTime: new Date().getTime() }); |
||||
localStorage.setItem(key, JSON.stringify(data)); |
||||
} else { |
||||
if (Object.prototype.toString.call(value) == '[object Object]') { |
||||
value = JSON.stringify(value); |
||||
} |
||||
if (Object.prototype.toString.call(value) == '[object Array]') { |
||||
value = JSON.stringify(value); |
||||
} |
||||
localStorage.setItem(key, value); |
||||
} |
||||
}, |
||||
//取出
|
||||
get(key) { |
||||
let item = localStorage.getItem(key); |
||||
// 先将拿到的试着进行json转为对象的形式
|
||||
try { |
||||
item = JSON.parse(item); |
||||
} catch (error) { |
||||
// eslint-disable-next-line no-self-assign
|
||||
item = item; |
||||
} |
||||
// 如果有startTime的值,说明设置了失效时间
|
||||
if (item && item.startTime) { |
||||
let date = new Date().getTime(); |
||||
// 如果大于就是过期了,如果小于或等于就还没过期
|
||||
if (date - item.startTime > item.expires) { |
||||
localStorage.removeItem(name); |
||||
return false; |
||||
} else { |
||||
return item.value; |
||||
} |
||||
} else { |
||||
return item; |
||||
} |
||||
}, |
||||
// 删除
|
||||
remove(key) { |
||||
localStorage.removeItem(key); |
||||
}, |
||||
// 清除全部
|
||||
clear() { |
||||
localStorage.clear(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* sessionStorage |
||||
*/ |
||||
var _session = { |
||||
get: function (key) { |
||||
var data = sessionStorage[key]; |
||||
if (!data || data === "null") { |
||||
return null; |
||||
} |
||||
return data; |
||||
}, |
||||
set: function (key, value) { |
||||
sessionStorage[key] = value; |
||||
}, |
||||
// 删除
|
||||
remove(key) { |
||||
sessionStorage.removeItem(key); |
||||
}, |
||||
// 清除全部
|
||||
clear() { |
||||
sessionStorage.clear(); |
||||
} |
||||
} |
||||
export { _local, _session } |
@ -0,0 +1,54 @@ |
||||
import cookies from './util.cookies'; |
||||
import {_local,_session} from './util.db'; |
||||
|
||||
const util = { |
||||
cookies, |
||||
local: _local, |
||||
session: _session, |
||||
// 传入身份证获取生日
|
||||
getBirth(idCard) { |
||||
var birthday = ""; |
||||
if(idCard != null && idCard != ""){ |
||||
if(idCard.length == 15){ |
||||
birthday = "19"+idCard.slice(6,12); |
||||
} else if(idCard.length == 18){ |
||||
birthday = idCard.slice(6,14); |
||||
}
|
||||
birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-"); |
||||
//通过正则表达式来指定输出格式为:1990-01-01
|
||||
}
|
||||
return birthday; |
||||
}, |
||||
// new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/
|
||||
dateCompatible(date) { |
||||
return date.replace(/\-/g, '/') |
||||
}, |
||||
// 日期时间前面补零
|
||||
formateTime(num) { |
||||
return num < 10 ? `0${num}` : num |
||||
}, |
||||
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
|
||||
formatDate(fmt,date) { |
||||
var date = date ? date : new Date() |
||||
var o = {
|
||||
"M+" : date.getMonth()+1, //月份
|
||||
"d+" : date.getDate(), //日
|
||||
"h+" : date.getHours(), //小时
|
||||
"m+" : date.getMinutes(), //分
|
||||
"s+" : date.getSeconds(), //秒
|
||||
"q+" : Math.floor((date.getMonth()+3)/3), //季度
|
||||
"S" : date.getMilliseconds() //毫秒
|
||||
};
|
||||
if(/(y+)/.test(fmt)) { |
||||
fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
|
||||
} |
||||
for(var k in o) { |
||||
if(new RegExp("("+ k +")").test(fmt)){ |
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); |
||||
} |
||||
} |
||||
return fmt;
|
||||
}, |
||||
}; |
||||
|
||||
export default util; |
@ -0,0 +1,45 @@ |
||||
import Vue from 'vue'; |
||||
import App from '@/App.vue'; |
||||
import router from '@/router'; |
||||
import ElementUI from 'element-ui'; |
||||
import mixinApp from '@/mixins/app'; |
||||
import VueI18n from 'vue-i18n'; |
||||
import { messages } from '@/i18n'; |
||||
// import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
|
||||
import './assets/css/theme-green/index.css'; // 浅绿色主题
|
||||
import './assets/css/icon.css'; |
||||
import './assets/icon/iconfont.css'; |
||||
import 'babel-polyfill'; |
||||
import '@/libs/resize'; |
||||
import api from '@/api'; |
||||
import store from '@/store' |
||||
import {post,get,del,put} from '@/plugins/requests/index.js'; |
||||
import permission from '@/router/permission'; |
||||
import Setting from '@/setting'; |
||||
|
||||
// 插件
|
||||
import plugins from '@/plugins'; |
||||
|
||||
Vue.use(plugins); |
||||
|
||||
Vue.prototype.api = api; |
||||
Vue.prototype.$get = get; |
||||
Vue.prototype.$post = post; |
||||
Vue.prototype.$del = del; |
||||
Vue.prototype.$put = put; |
||||
|
||||
Vue.config.productionTip = false; |
||||
Vue.use(VueI18n); |
||||
Vue.use(ElementUI); |
||||
const i18n = new VueI18n({ |
||||
locale: Setting.i18n.default, |
||||
messages |
||||
}); |
||||
|
||||
new Vue({ |
||||
mixins: [mixinApp], |
||||
router, |
||||
store, |
||||
i18n, |
||||
render: h => h(App) |
||||
}).$mount('#app'); |
@ -0,0 +1,11 @@ |
||||
/** |
||||
* 通用混合 |
||||
* */ |
||||
export default { |
||||
methods: { |
||||
// 当 $route 更新时触发
|
||||
appRouteChange (to, from) { |
||||
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,8 @@ |
||||
export default { |
||||
beforeCreate() { |
||||
document.querySelector('body').setAttribute('style', 'background-color:#fff') |
||||
}, |
||||
beforeDestroy() { |
||||
document.body.removeAttribute('style') |
||||
} |
||||
} |
@ -0,0 +1,188 @@ |
||||
<template> |
||||
<div class="login-wrap"> |
||||
<div class="header"> |
||||
<div class="logo"> |
||||
<img src="../../../assets/img/logo.png"> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="ms-login"> |
||||
<div class="ms-title"> |
||||
<el-tabs v-model="activeName" @tab-click="handleClick"> |
||||
<el-tab-pane label="账号登录" name="first"> |
||||
<el-form :model="param" :rules="rules" ref="login" label-width="0px" style="margin-top: 40px"> |
||||
<el-form-item prop="username"> |
||||
<el-input v-model="param.username" placeholder="username"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="password"> |
||||
<el-input |
||||
type="password" |
||||
placeholder="password" |
||||
v-model="param.password" |
||||
@keyup.enter.native="submitForm()" |
||||
> |
||||
</el-input> |
||||
</el-form-item> |
||||
<el-button type="text" class="forget">忘记密码?</el-button> |
||||
<div class="login-btn"> |
||||
<el-button type="primary" @click="submitForm()">马上登录</el-button> |
||||
</div> |
||||
<!-- <p class="login-tips">使用第三方账号直接登录</p> |
||||
<p class="thirdParty"> |
||||
<i class="icon-weixin"></i> |
||||
<i class="icon-qq"></i> |
||||
</p> --> |
||||
</el-form> |
||||
</el-tab-pane> |
||||
|
||||
<el-tab-pane label="扫描登录" name="second">扫描登录</el-tab-pane> |
||||
</el-tabs> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapActions } from 'vuex'; |
||||
export default { |
||||
data: function() { |
||||
return { |
||||
param: { |
||||
username: 'admin', |
||||
password: 'admin', |
||||
// username: '12312', |
||||
// password: 'huoran123', |
||||
}, |
||||
rules: { |
||||
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], |
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
||||
}, |
||||
activeName: 'first' |
||||
}; |
||||
}, |
||||
methods: { |
||||
...mapActions('user', [ |
||||
'login' |
||||
]), |
||||
submitForm() { |
||||
this.$refs.login.validate(valid => { |
||||
if (valid) { |
||||
let data = { |
||||
username: this.param.username, |
||||
password: this.param.password |
||||
} |
||||
this.login(data).then(() => { |
||||
this.$router.replace('/index') |
||||
}) |
||||
.catch(() => { |
||||
|
||||
}) |
||||
} |
||||
}); |
||||
}, |
||||
handleClick(tab, event) { |
||||
console.log(tab, event); |
||||
} |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.login-wrap { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100%; |
||||
background-image: url(../../../assets/img/login-bg.png); |
||||
background-size: 100%; |
||||
} |
||||
.ms-title { |
||||
width: 548px; |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50px; |
||||
transform: translate(-50%,0); |
||||
} |
||||
.ms-login { |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 42px; |
||||
transform: translate(-50%,0); |
||||
width: 1200px; |
||||
height: 82%; |
||||
/* height: 884px; */ |
||||
margin-top: 60px; |
||||
background-image: url(../../../assets/img/login-input.png); |
||||
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36); |
||||
overflow: hidden; |
||||
} |
||||
.login-btn { |
||||
text-align: center; |
||||
} |
||||
.login-btn button { |
||||
width: 100%; |
||||
height: 88px; |
||||
margin-bottom: 50px; |
||||
font-weight: bold; |
||||
background:linear-gradient(90deg,rgba(94,206,253,1),rgba(91,67,231,1)); |
||||
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51); |
||||
border: 0; |
||||
border-radius:10px; |
||||
} |
||||
.login-tips { |
||||
text-align: center; |
||||
color: #999; |
||||
font-weight:bold; |
||||
} |
||||
.forget{ |
||||
width: 100%; |
||||
margin-bottom: 28px; |
||||
text-align: right; |
||||
color: #999; |
||||
font-weight:bold; |
||||
} |
||||
.thirdParty{ |
||||
width: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
margin-top: 33px; |
||||
} |
||||
|
||||
/* 头部 */ |
||||
.header{ |
||||
width: 100%; |
||||
height: 60px; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
background-color: #fff; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
font-size: 18px; |
||||
} |
||||
.logo{ |
||||
width: 171px; |
||||
height: 40px; |
||||
margin-left: 20px; |
||||
} |
||||
img{ |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
.header_title{ |
||||
width: 33%; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
} |
||||
.header_title a{ |
||||
cursor: pointer; |
||||
} |
||||
.header_title a:hover{ |
||||
color: blueviolet; |
||||
} |
||||
.nul{ |
||||
width:80px; |
||||
margin-right: 30px; |
||||
} |
||||
</style> |
@ -0,0 +1,232 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-throttle @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school" v-text="isDetail ? '查看用户' : (id != '' ? '编辑客户' : '新增客户')"></span> |
||||
</div> |
||||
<el-button type="primary" size="small" round class="mag" v-if="!isDetail" v-throttle @click="saveAdd">确定</el-button> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="addhr_tag"></p> |
||||
<span>基本信息</span> |
||||
</div> |
||||
|
||||
<div> |
||||
<el-form :model="form" :rules="rules" ref="form" label-width="100px" class="flex-start-around" :disabled="isDetail"> |
||||
<el-col :span="6" style="margin-right: 60px;"> |
||||
<el-form-item prop="countries" label="国家"> |
||||
<el-select v-model="form.countries" clearable placeholder="请选择国家"> |
||||
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item prop="provinceId" label="省份"> |
||||
<el-select v-model="form.provinceId" placeholder="" @change="getCity()" @clear="clearprovince()"> |
||||
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item prop="clientName" label="客户名称"> |
||||
<el-input placeholder="请输入客户名称" v-model="form.clientName" @change="nameChange"></el-input> |
||||
</el-form-item> |
||||
|
||||
<el-form-item prop="phone" label="手机号"> |
||||
<el-input placeholder="请输入手机号" v-model="form.phone" maxlength="11"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
|
||||
<el-col :span="6" style="margin-left: 60px;"> |
||||
<el-form-item prop="type" label="客户类型"> |
||||
<el-select v-model="form.type" placeholder=""> |
||||
<el-option v-for="(item,index) in clientTypeList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item prop="cityId" label="城市"> |
||||
<el-select v-model="form.cityId" :disabled="form.provinceId ? false : true" placeholder=""> |
||||
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item prop="contactPersonName" label="管理员姓名"> |
||||
<el-input placeholder="请输入管理员姓名" v-model="form.contactPersonName"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
name: 'index-add', |
||||
data() { |
||||
return { |
||||
id: this.$route.query.id, |
||||
isDetail: Boolean(this.$route.query.show), |
||||
form: { |
||||
countries: '中国', |
||||
clientName: '', |
||||
provinceId: '', |
||||
contactPersonName: '', |
||||
phone: '', |
||||
cityId: '', |
||||
type: 1, |
||||
}, |
||||
rules: { |
||||
type: [ |
||||
{ required: true, message: '请选择客户类型', trigger: 'change' } |
||||
], |
||||
countries: [ |
||||
{ required: true, message: '请选择国家', trigger: 'change' } |
||||
], |
||||
provinceId: [ |
||||
{ required: true, message: '请选择省份', trigger: 'change' } |
||||
], |
||||
cityId: [ |
||||
{ required: true, message: '请选择城市', trigger: 'change' } |
||||
], |
||||
contactPersonName: [ |
||||
{ required: true, message: '请输入管理员姓名', trigger: 'blur' } |
||||
], |
||||
phone: [ |
||||
{ required: true, message: '请输入手机号', trigger: 'blur' }, |
||||
{ |
||||
pattern: /^1[3456789]\d{9}$/, |
||||
message: '请输入正确的手机号', |
||||
trigger: 'blur' |
||||
} |
||||
], |
||||
clientName: [ |
||||
{ required: true, message: '请输入客户名称', trigger: 'blur' } |
||||
], |
||||
}, |
||||
clientTypeList: [{ |
||||
name: '正式', |
||||
value: 1 |
||||
}, |
||||
{ |
||||
name: '试用', |
||||
value: 2 |
||||
}, |
||||
{ |
||||
name: '到期', |
||||
value: 3 |
||||
}], |
||||
countryList: [{ |
||||
name:'中国' |
||||
}], |
||||
cityList: [], |
||||
originalName: '', |
||||
nameRepeat: false |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('client', [ |
||||
'provinceList' |
||||
]) |
||||
}, |
||||
mounted() { |
||||
this.id && this.getData() |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
this.$get(`${this.api.getClient}/${this.id}`).then((res) => { |
||||
this.form = res.data.client |
||||
this.originalName = res.data.client.clientName |
||||
this.form.countries = '中国' |
||||
this.getCityData() |
||||
}).catch((res) => { |
||||
}) |
||||
}, |
||||
nameChange(){ |
||||
if(this.form.clientName !== this.originalName){ |
||||
this.$get(`${this.api.getClientName}?clientName=${this.form.clientName}`).then(res => { |
||||
if(res.data.client.length){ |
||||
this.nameRepeat = true |
||||
this.$message.warning('该客户名称已存在') |
||||
}else{ |
||||
this.nameRepeat = false |
||||
} |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.nameRepeat = false |
||||
} |
||||
}, |
||||
// 清除省份 |
||||
clearprovince(){ |
||||
this.form.cityId = '' |
||||
}, |
||||
getCity(){ |
||||
this.clearprovince() |
||||
this.getCityData() |
||||
this.pageNo = 1 |
||||
}, |
||||
getCityData(){ |
||||
let data = { |
||||
provinceId: this.form.provinceId |
||||
} |
||||
this.$get(this.api.queryCity,data).then(res => { |
||||
this.cityList = res.data.list |
||||
}).catch(res => {}); |
||||
}, |
||||
saveAdd(){ |
||||
this.$refs.form.validate((valid) => { |
||||
if (valid) { |
||||
if(this.nameRepeat) return this.$message.warning('该客户名称已存在') |
||||
this.form.provinceName = this.provinceList.find(n => n.provinceId == this.form.provinceId).provinceName |
||||
this.form.cityName = this.cityList.find(n => n.cityId == this.form.cityId).cityName |
||||
let data = this.form |
||||
if(this.id){ |
||||
this.$post(this.api.updateClient,data).then((res) => { |
||||
this.$message.success('编辑成功'); |
||||
this.$router.back() |
||||
}).catch((res) => { |
||||
}) |
||||
}else{ |
||||
this.$post(this.api.addClient,data).then((res) => { |
||||
this.$message.success('添加成功'); |
||||
this.$router.back() |
||||
}).catch((res) => { |
||||
}) |
||||
} |
||||
} |
||||
}) |
||||
}, |
||||
goback() { |
||||
if(this.isDetail){ |
||||
this.$router.back() |
||||
}else{ |
||||
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$router.back() |
||||
}) |
||||
.catch(() => {}); |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.el-row{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
@ -0,0 +1,258 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px"> |
||||
<el-col :span="6"> |
||||
<el-form-item label="国家"> |
||||
<el-select v-model="form.countries" clearable placeholder="请选择国家"> |
||||
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="省份"> |
||||
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity()" @clear="clearprovince()"> |
||||
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="城市"> |
||||
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="getData()"> |
||||
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入客户名称/管理员姓名/电话" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
|
||||
<el-col :span="24"> |
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>客户列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="addcustomer" v-auth>新增客户</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="customerData" ref="table" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="clientName" label="客户名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="provinceName" label="省份" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="cityName" label="城市" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="contactPersonName" label="管理员姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="phone" label="手机号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button> |
||||
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> |
||||
<el-switch |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
style="margin: 0 10px 0 5px" |
||||
@change="switchOff($event,scope.row,scope.$index)" |
||||
v-auth="'dashboard:禁用'" |
||||
></el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapActions } from 'vuex'; |
||||
export default { |
||||
name: 'index', |
||||
data() { |
||||
return { |
||||
countryList: [{ |
||||
name:'中国' |
||||
}], |
||||
customerData: [], |
||||
keyword: '', |
||||
form: { |
||||
countries:'中国', |
||||
provinces: '', |
||||
city: '', |
||||
}, |
||||
multipleSelection: [], |
||||
provinceList: [], |
||||
cityList: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 1, |
||||
ruleIds: [], |
||||
searchTimer: null |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
this.getProvince() |
||||
}, |
||||
methods: { |
||||
...mapActions('client', [ |
||||
'setProvince' |
||||
]), |
||||
getData() { |
||||
let data = { |
||||
countries: this.form.countries, |
||||
provinceId: this.form.provinces, |
||||
cityId: this.form.city, |
||||
searchContent: this.keyword |
||||
} |
||||
this.$get(`${this.api.queryClient}/${this.pageNo}/${this.pageSize}`,data).then(res => { |
||||
this.customerData = res.data.list |
||||
this.totals = res.data.total |
||||
}).catch(res => {}); |
||||
}, |
||||
getProvince(){ |
||||
this.$get(this.api.queryProvince).then(res => { |
||||
this.provinceList = res.data.list |
||||
this.setProvince(res.data.list) |
||||
}).catch(res => {}); |
||||
}, |
||||
// 清除省份 |
||||
clearprovince(){ |
||||
this.form.city = '' |
||||
}, |
||||
getCity(){ |
||||
this.clearprovince() |
||||
this.getCityData() |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
getCityData(){ |
||||
if(this.form.provinces != ''){ |
||||
let data = { |
||||
provinceId: this.form.provinces |
||||
} |
||||
this.$get(this.api.queryCity,data).then(res => { |
||||
this.cityList = res.data.list |
||||
}).catch(res => {}); |
||||
} |
||||
}, |
||||
addcustomer(){ |
||||
this.$router.push('add'); |
||||
}, |
||||
show(row){ |
||||
this.$router.push(`add?id=${row.id}&show=1`); |
||||
}, |
||||
edit(row){ |
||||
this.$router.push(`add?id=${row.id}`); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteClient}?clientIds=${row.id}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.customerId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
switchOff(val,row,index) { |
||||
let data = { |
||||
id: row.id, |
||||
isDisable: val |
||||
} |
||||
this.$post(this.api.updateClient,data).then((res) => { |
||||
|
||||
}).catch((res) => { |
||||
}) |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteClient}?clientIds=${delList.join()}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据'); |
||||
} |
||||
}, |
||||
onSearch(){ |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.mag{ |
||||
margin-right: 20px; |
||||
} |
||||
/deep/.el-row{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,56 @@ |
||||
<template> |
||||
<div class="error-page"> |
||||
<div class="error-code">4<span>0</span>3</div> |
||||
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div> |
||||
<div class="error-handle"> |
||||
<router-link to="/"> |
||||
<el-button type="primary" size="large">返回首页</el-button> |
||||
</router-link> |
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
methods: { |
||||
goBack(){ |
||||
this.$router.go(-1); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
|
||||
<style scoped> |
||||
.error-page{ |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
width: 100%; |
||||
height: 100%; |
||||
background: #f3f3f3; |
||||
box-sizing: border-box; |
||||
} |
||||
.error-code{ |
||||
line-height: 1; |
||||
font-size: 250px; |
||||
font-weight: bolder; |
||||
color: #f02d2d; |
||||
} |
||||
.error-code span{ |
||||
color: #00a854; |
||||
} |
||||
.error-desc{ |
||||
font-size: 30px; |
||||
color: #777; |
||||
} |
||||
.error-handle{ |
||||
margin-top: 30px; |
||||
padding-bottom: 200px; |
||||
} |
||||
.error-btn{ |
||||
margin-left: 100px; |
||||
} |
||||
</style> |
@ -0,0 +1,56 @@ |
||||
<template> |
||||
<div class="error-page"> |
||||
<div class="error-code">4<span>0</span>4</div> |
||||
<div class="error-desc">啊哦~ 你所访问的页面不存在</div> |
||||
<div class="error-handle"> |
||||
<router-link to="/"> |
||||
<el-button type="primary" size="large">返回首页</el-button> |
||||
</router-link> |
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
methods: { |
||||
goBack(){ |
||||
this.$router.go(-1); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
|
||||
<style scoped> |
||||
.error-page{ |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
width: 100%; |
||||
height: 100%; |
||||
background: #f3f3f3; |
||||
box-sizing: border-box; |
||||
} |
||||
.error-code{ |
||||
line-height: 1; |
||||
font-size: 250px; |
||||
font-weight: bolder; |
||||
color: #2d8cf0; |
||||
} |
||||
.error-code span{ |
||||
color: #00a854; |
||||
} |
||||
.error-desc{ |
||||
font-size: 30px; |
||||
color: #777; |
||||
} |
||||
.error-handle{ |
||||
margin-top: 30px; |
||||
padding-bottom: 200px; |
||||
} |
||||
.error-btn{ |
||||
margin-left: 100px; |
||||
} |
||||
</style> |
@ -0,0 +1,46 @@ |
||||
<template> |
||||
<section class="main"> |
||||
<div class="crumbs"> |
||||
<el-breadcrumb separator="/"> |
||||
<el-breadcrumb-item><i class="el-icon-lx-global"></i> {{$t('i18n.breadcrumb')}}</el-breadcrumb-item> |
||||
</el-breadcrumb> |
||||
</div> |
||||
<div class="container"> |
||||
<span>{{$t('i18n.tips')}}</span> |
||||
<el-button type="primary" @click="$i18n.locale = $i18n.locale === 'zh'?'en':'zh';">{{$t('i18n.btn')}}</el-button> |
||||
<div class="list"> |
||||
<h2>{{$t('i18n.title1')}}</h2> |
||||
<p>{{$t('i18n.p1')}}</p> |
||||
<p>{{$t('i18n.p2')}}</p> |
||||
<p>{{$t('i18n.p3')}}</p> |
||||
</div> |
||||
<h2>{{$t('i18n.title2')}}</h2> |
||||
<div> |
||||
<i18n path="i18n.info" tag="p"> |
||||
<a place="action" href="https://element.eleme.cn/2.0/#/zh-CN/component/i18n">{{ $t('i18n.value') }}</a> |
||||
</i18n> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data(){ |
||||
return { |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.list{ |
||||
padding: 30px 0; |
||||
} |
||||
.list p{ |
||||
margin-bottom: 20px; |
||||
} |
||||
a{ |
||||
color: #cb221c; |
||||
} |
||||
</style> |
@ -0,0 +1,225 @@ |
||||
<template> |
||||
<div> |
||||
<div class="crumbs"> |
||||
<el-breadcrumb separator="/"> |
||||
<el-breadcrumb-item><i class="el-icon-lx-emoji"></i> 自定义图标</el-breadcrumb-item> |
||||
</el-breadcrumb> |
||||
</div> |
||||
<div class="container"> |
||||
<h2>使用方法</h2> |
||||
<p style="line-height: 50px;"> |
||||
直接通过设置类名为 el-icon-lx-iconName 来使用即可。例如:(共{{iconList.length}}个图标) |
||||
</p> |
||||
<p class="example-p"> |
||||
<i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i> |
||||
<span><i class="el-icon-lx-redpacket_fill"></i></span> |
||||
</p> |
||||
<p class="example-p"> |
||||
<i class="el-icon-lx-weibo" style="font-size: 30px;color:#fd5656"></i> |
||||
<span><i class="el-icon-lx-weibo"></i></span> |
||||
</p> |
||||
<p class="example-p"> |
||||
<i class="el-icon-lx-emojifill" style="font-size: 30px;color: #ffc300"></i> |
||||
<span><i class="el-icon-lx-emojifill"></i></span> |
||||
</p> |
||||
<br> |
||||
<h2>图标</h2> |
||||
<div class="search-box"> |
||||
<el-input class="search" size="large" v-model="keyword" clearable placeholder="请输入图标名称"></el-input> |
||||
</div> |
||||
<ul> |
||||
<li class="icon-li" v-for="(item,index) in list" :key="index"> |
||||
<div class="icon-li-content"> |
||||
<i :class="`el-icon-lx-${item}`"></i> |
||||
<span>{{item}}</span> |
||||
</div> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
|
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data: function(){ |
||||
return { |
||||
keyword: '', |
||||
iconList: [ |
||||
'attentionforbid', |
||||
'attentionforbidfill', |
||||
'attention', |
||||
'attentionfill', |
||||
'tag', |
||||
'tagfill', |
||||
'people', |
||||
'peoplefill', |
||||
'notice', |
||||
'noticefill', |
||||
'mobile', |
||||
'mobilefill', |
||||
'voice', |
||||
'voicefill', |
||||
'unlock', |
||||
'lock', |
||||
'home', |
||||
'homefill', |
||||
'delete', |
||||
'deletefill', |
||||
'notification', |
||||
'notificationfill', |
||||
'notificationforbidfill', |
||||
'like', |
||||
'likefill', |
||||
'comment', |
||||
'commentfill', |
||||
'camera', |
||||
'camerafill', |
||||
'warn', |
||||
'warnfill', |
||||
'time', |
||||
'timefill', |
||||
'location', |
||||
'locationfill', |
||||
'favor', |
||||
'favorfill', |
||||
'skin', |
||||
'skinfill', |
||||
'news', |
||||
'newsfill', |
||||
'record', |
||||
'recordfill', |
||||
'emoji', |
||||
'emojifill', |
||||
'message', |
||||
'messagefill', |
||||
'goods', |
||||
'goodsfill', |
||||
'crown', |
||||
'crownfill', |
||||
'move', |
||||
'add', |
||||
'hot', |
||||
'hotfill', |
||||
'service', |
||||
'servicefill', |
||||
'present', |
||||
'presentfill', |
||||
'pic', |
||||
'picfill', |
||||
'rank', |
||||
'rankfill', |
||||
'male', |
||||
'female', |
||||
'down', |
||||
'top', |
||||
'recharge', |
||||
'rechargefill', |
||||
'forward', |
||||
'forwardfill', |
||||
'info', |
||||
'infofill', |
||||
'redpacket', |
||||
'redpacket_fill', |
||||
'roundadd', |
||||
'roundaddfill', |
||||
'friendadd', |
||||
'friendaddfill', |
||||
'cart', |
||||
'cartfill', |
||||
'more', |
||||
'moreandroid', |
||||
'back', |
||||
'right', |
||||
'shop', |
||||
'shopfill', |
||||
'question', |
||||
'questionfill', |
||||
'roundclose', |
||||
'roundclosefill', |
||||
'roundcheck', |
||||
'roundcheckfill', |
||||
'global', |
||||
'mail', |
||||
'punch', |
||||
'exit', |
||||
'upload', |
||||
'read', |
||||
'file', |
||||
'link', |
||||
'full', |
||||
'group', |
||||
'friend', |
||||
'profile', |
||||
'addressbook', |
||||
'calendar', |
||||
'text', |
||||
'copy', |
||||
'share', |
||||
'wifi', |
||||
'vipcard', |
||||
'weibo', |
||||
'remind', |
||||
'refresh', |
||||
'filter', |
||||
'settings', |
||||
'scan', |
||||
'qrcode', |
||||
'cascades', |
||||
'apps', |
||||
'sort', |
||||
'searchlist', |
||||
'search', |
||||
'edit' |
||||
] |
||||
} |
||||
}, |
||||
computed: { |
||||
list(){ |
||||
return this.iconList.filter((item) => { |
||||
return item.indexOf(this.keyword) !== -1; |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.example-p{ |
||||
height: 45px; |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.search-box{ |
||||
text-align: center; |
||||
margin-top: 10px; |
||||
} |
||||
.search{ |
||||
width: 300px; |
||||
} |
||||
ul,li{ |
||||
list-style: none; |
||||
} |
||||
.icon-li{ |
||||
display: inline-block; |
||||
padding: 10px; |
||||
width: 120px; |
||||
height: 120px; |
||||
} |
||||
.icon-li-content{ |
||||
display: flex; |
||||
height: 100%; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
justify-content: center; |
||||
cursor: pointer; |
||||
} |
||||
.icon-li-content i{ |
||||
font-size: 36px; |
||||
color: #606266; |
||||
} |
||||
.icon-li-content span{ |
||||
margin-top: 10px; |
||||
color: #787878; |
||||
} |
||||
</style> |
@ -0,0 +1,230 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<div class="flex-between no-mb"> |
||||
<div> |
||||
<el-form label-width="80px" inline> |
||||
<el-form-item class="no-mb" label="创建人"> |
||||
<el-select v-model="createUser" clearable placeholder="请选择创建人" @change="getData"> |
||||
<el-option label="不限" value=""></el-option> |
||||
<el-option v-for="(item,index) in createUserList" :key="index" :label="item.name" :value="item.name"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item class="no-mb" label="试题类型"> |
||||
<el-select v-model="name" clearable placeholder="请选择试题类型" @change="getData"> |
||||
<el-option label="不限" value=""></el-option> |
||||
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
</div> |
||||
<div> |
||||
<el-input placeholder="请输入题库名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>分类管理</span> |
||||
</div> |
||||
<div> |
||||
<!-- <el-button type="primary" size="small" round @click="delAllData" v-auth>取消共享</el-button> --> |
||||
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="listData" class="table" stripe header-align="center" row-key="id" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="questionStem" label="题干" align="center"> |
||||
<template slot-scope="scope"> |
||||
<div v-html="scope.row.questionStem"></div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label="试题类型" align="center"></el-table-column> |
||||
<el-table-column prop="courses" label="对应课程" align="center"></el-table-column> |
||||
<el-table-column prop="typeName" label="所属题库" align="center"></el-table-column> |
||||
<el-table-column prop="knowledgePoints" label="知识点" align="center"></el-table-column> |
||||
<el-table-column prop="useNum" label="使用次数" align="center"></el-table-column> |
||||
<el-table-column prop="createTime" label="共享时间" align="center"></el-table-column> |
||||
<el-table-column prop="createUser" label="创建人" align="center"></el-table-column> |
||||
<el-table-column label="操作" align="center" width="120"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button> |
||||
<el-button v-if="scope.row.myShare" type="text" @click="cancelShare(scope.row)">取消共享</el-button> |
||||
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import quesDialog from './quesDialog'; |
||||
import { mapState,mapActions } from 'vuex'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
createUser: '', |
||||
createUserList: [ |
||||
{ |
||||
name: '系统内置' |
||||
},{ |
||||
name: '老师' |
||||
} |
||||
], |
||||
name: '', |
||||
typeList: [], |
||||
listData: [], |
||||
keyword: '', |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
multipleSelection: [], |
||||
searchTimer: null, |
||||
isDetail: false, |
||||
visible: false, |
||||
topicsTitle: '' |
||||
}; |
||||
}, |
||||
components: {quesDialog}, |
||||
mounted() { |
||||
this.getData() |
||||
this.getType() |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$post(this.api.pageByConditionSharing, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
questionStem: this.keyword, |
||||
createUser: this.createUser, |
||||
name: this.name |
||||
}) |
||||
.then(res => { |
||||
this.listData = res.data.list.list |
||||
this.total = res.data.list.currPage |
||||
this.$refs.table.clearSelection() |
||||
}) |
||||
.catch(err => {}) |
||||
}, |
||||
getType() { |
||||
this.$get(this.api.typesList) |
||||
.then(res => { |
||||
this.typeList = res.data.list |
||||
}) |
||||
.catch(err => {}) |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
cancelShare(row) { |
||||
this.$confirm('确定要取消共享吗?', '提示', { |
||||
type: 'info' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.cancelByMySharing}?ids=${row.sid}`).then(res => { |
||||
this.$message.success('取消共享成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteByMeSubject}?ids=${row.sid}`).then(res => { |
||||
this.$message.success('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.sid |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteByMeSubject}?ids=${delList.join()}`).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据!'); |
||||
} |
||||
}, |
||||
dialogGetData(){ |
||||
this.getData() |
||||
this.visible = false |
||||
}, |
||||
addTopics() { |
||||
this.topicsTitle = '新增题目' |
||||
this.visible = true |
||||
this.isDetail = false |
||||
}, |
||||
getDetail(id) { |
||||
this.$refs.quesDialog.getData(id) |
||||
}, |
||||
edit(row) { |
||||
this.topicsTitle = '编辑题目' |
||||
this.visible = true |
||||
this.isDetail = false |
||||
this.getDetail(row.id) |
||||
}, |
||||
show(row) { |
||||
this.topicsTitle = '查看题目' |
||||
this.isDetail = true |
||||
this.visible = true |
||||
this.getDetail(row.sid) |
||||
}, |
||||
closeTopics() { |
||||
this.isDetail = false |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
/deep/.no-mb.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
@ -0,0 +1,45 @@ |
||||
<template> |
||||
<div> |
||||
<div class="tabs mgb20"> |
||||
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> |
||||
</div> |
||||
|
||||
<ques-bank-type v-if="active == 'type'"></ques-bank-type> |
||||
<my-ques-bank v-else-if="active == 'my'"></my-ques-bank> |
||||
<global-ques-bank v-else></global-ques-bank> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import quesBankType from './quesBankType' |
||||
import myQuesBank from './myQuesBank' |
||||
import globalQuesBank from './globalQuesBank' |
||||
export default { |
||||
data() { |
||||
return { |
||||
active: 'type', |
||||
tabs: { |
||||
type: '题库分类', |
||||
my: '我上传的题库', |
||||
global: '公共题库' |
||||
} |
||||
}; |
||||
}, |
||||
components: { |
||||
quesBankType, |
||||
myQuesBank, |
||||
globalQuesBank, |
||||
}, |
||||
mounted() { |
||||
|
||||
}, |
||||
methods: { |
||||
tabChange(index){ |
||||
this.active = index |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
@ -0,0 +1,459 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>测评题库</span> |
||||
</div> |
||||
<div class="flex-between"> |
||||
<el-form label-width="80px"> |
||||
<el-form-item class="no-mb" label="试题类型"> |
||||
<el-select v-model="typeId" clearable placeholder="请选择试题类型" @change="getData"> |
||||
<el-option label="不限" value=""></el-option> |
||||
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.name"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
<div> |
||||
<el-input |
||||
placeholder="请输入题干" |
||||
prefix-icon="el-icon-search" |
||||
v-model="keyword" |
||||
clearable |
||||
></el-input> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
|
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>题目列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
round |
||||
@click="addTopics" |
||||
>单题上传</el-button> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
round |
||||
@click="showBatchUpload" |
||||
>批量上传</el-button> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
round |
||||
@click="shareDataBatch" |
||||
>批量共享</el-button> |
||||
<!-- <el-button |
||||
type="primary" |
||||
size="small" |
||||
round |
||||
@click="cancelShareBatch" |
||||
>取消共享</el-button> --> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
round |
||||
@click="delAllData" |
||||
>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table |
||||
:data="listData" |
||||
ref="table" |
||||
row-key="id" |
||||
class="table" |
||||
stripe |
||||
header-align="center" |
||||
@selection-change="handleSelectionChange" |
||||
> |
||||
<el-table-column |
||||
type="selection" |
||||
width="55" |
||||
align="center" |
||||
:reserve-selection="true" |
||||
></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template |
||||
slot-scope="scope" |
||||
>{{scope.$index + (page - 1) * pageSize + 1}}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="questionStem" label="题干" align="center"> |
||||
<template slot-scope="scope"> |
||||
<div v-html="scope.row.questionStem"></div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label="试题类型" align="center"></el-table-column> |
||||
<el-table-column prop="courses" label="对应课程" align="center"></el-table-column> |
||||
<el-table-column prop="typeName" label="所属题库" align="center"></el-table-column> |
||||
<el-table-column prop="knowledgePoints" label="知识点" align="center"></el-table-column> |
||||
<el-table-column prop="useNum" label="使用次数" align="center"></el-table-column> |
||||
<el-table-column prop="createTime" label="上传时间" align="center"></el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="show(scope.row)">查看</el-button> |
||||
<el-button type="text" @click="edit(scope.row)">修改</el-button> |
||||
<el-button type="text" @click="share(scope.row)">共享</el-button> |
||||
<el-button type="text" @click="delData(scope.row)">删除</el-button> |
||||
<!-- <el-button type="text" @click="cancelShare(scope.row)">取消共享</el-button> --> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination |
||||
background |
||||
@current-change="handleCurrentChange" |
||||
:current-page="page" |
||||
:page-size="pageSize" |
||||
layout="total,prev, pager, next" |
||||
:total="total" |
||||
></el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
</el-row> |
||||
|
||||
<ques-dialog ref="quesDialog" :title="topicsTitle" :visible.sync="visible" :isDetail.sync="isDetail" @getData="dialogGetData" @closeTopics="closeTopics"></ques-dialog> |
||||
|
||||
<el-dialog title="批量上传" :visible.sync="BatchUpload" width="30%" @close="closeUpload" :close-on-click-modal="false"> |
||||
<el-card shadow="hover" class="card_m" v-show="this.label=1"> |
||||
<div class="Upload"> |
||||
<div class="bt" @click="downloadTem"> |
||||
<el-link :underline="false"> |
||||
1.请下载模板 |
||||
<i class="el-icon-download"></i> |
||||
</el-link> |
||||
</div> |
||||
<div class="bt"> |
||||
<el-upload |
||||
accept=".xls,.xlsx" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.upload" |
||||
:file-list="uploadList" |
||||
name="file" |
||||
> |
||||
<el-link :underline="false"> |
||||
2.请点击上传模板 |
||||
<i class="el-icon-upload"></i> |
||||
</el-link> |
||||
</el-upload> |
||||
</div> |
||||
<div> |
||||
<el-upload |
||||
accept=".xls,.xlsx" |
||||
:on-remove="handleDataRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.import" |
||||
:file-list="uploadDataList" |
||||
name="file" |
||||
> |
||||
<el-link :underline="false"> |
||||
3.请点击批量导入 |
||||
<i class="el-icon-upload"></i> |
||||
</el-link> |
||||
</el-upload> |
||||
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败,查看原因</el-link> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="BatchUpload = false">取消</el-button> |
||||
<el-button type="primary" v-throttle @click="uploadSure">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import quesDialog from './quesDialog'; |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
keyword: '', |
||||
typeId: '', |
||||
typeList: [], |
||||
listData: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
visible: false, |
||||
BatchUpload: false, |
||||
multipleSelection: [], |
||||
isDetail: false, |
||||
topicsTitle: '', |
||||
uploadList: [], |
||||
uploadDataList: [], |
||||
searchTimer: null, |
||||
uploadFaild: false, |
||||
token: '', |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'userId' |
||||
]) |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
this.getType() |
||||
}, |
||||
components: {quesDialog}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$post(this.api.pageByCondition, { |
||||
name: this.typeId, |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
questionStem: this.keyword, |
||||
userId: this.userId |
||||
}) |
||||
.then(res => { |
||||
this.total = res.data.list.currPage; //总条数 |
||||
this.listData = res.data.list.list; |
||||
}) |
||||
.catch(err => {}) |
||||
}, |
||||
getType() { |
||||
this.$get(this.api.typesList) |
||||
.then(res => { |
||||
this.typeList = res.data.list |
||||
}) |
||||
.catch(err => {}) |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
dialogGetData(){ |
||||
this.getData() |
||||
this.visible = false |
||||
}, |
||||
addTopics() { |
||||
this.topicsTitle = '新增题目' |
||||
this.visible = true |
||||
this.isDetail = false |
||||
}, |
||||
getDetail(id) { |
||||
this.$refs.quesDialog.getData(id) |
||||
}, |
||||
edit(row) { |
||||
this.topicsTitle = '编辑题目' |
||||
this.visible = true |
||||
this.isDetail = false |
||||
this.getDetail(row.id) |
||||
}, |
||||
show(row) { |
||||
this.topicsTitle = '查看题目' |
||||
this.isDetail = true |
||||
this.visible = true |
||||
this.getDetail(row.id) |
||||
}, |
||||
closeTopics() { |
||||
this.isDetail = false |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteByMeSubject}?ids=${row.id}`).then(res => { |
||||
this.$message.success('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
share(row) { |
||||
this.$confirm('确定要共享吗?', '提示', { |
||||
type: 'info' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
userId: this.userId, |
||||
qid: row.id |
||||
} |
||||
this.$post(this.api.saveSharing,data).then(res => { |
||||
this.$message.success('共享成功') |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
cancelShare(row) { |
||||
this.$confirm('确定要取消共享吗?', '提示', { |
||||
type: 'info' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
userId: this.userId, |
||||
qid: row.id |
||||
} |
||||
this.$post(this.api.delete,data).then(res => { |
||||
this.$message.success('取消共享成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
shareDataBatch() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let shareList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
|
||||
this.$confirm('确定要共享吗?', '提示', { |
||||
type: 'info' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
userId: this.userId, |
||||
qid: shareList |
||||
} |
||||
this.$post(this.api.saveSharing,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('共享成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据!'); |
||||
} |
||||
}, |
||||
cancelShareBatch() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let shareList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
|
||||
this.$confirm('确定要取消共享吗?', '提示', { |
||||
type: 'info' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
userId: this.userId, |
||||
qid: shareList |
||||
} |
||||
this.$post(this.api.saveSharing,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('取消共享成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据!'); |
||||
} |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteByMeSubject}?ids=${delList.join()}`).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据!'); |
||||
} |
||||
}, |
||||
downloadTem() { |
||||
location.href = this.api.download |
||||
}, |
||||
showBatchUpload() { |
||||
this.BatchUpload = true |
||||
}, |
||||
handleExceed(files, fileList) { |
||||
this.$message.warning( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
); |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.uploadFaild = false |
||||
if(res.data.token){ |
||||
this.token = res.data.token |
||||
this.uploadFaild = true |
||||
} |
||||
}, |
||||
showFaild(){ |
||||
location.href = `${this.api.export_failure}?token=${this.token}` |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}); |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
}, |
||||
handleDataRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
}, |
||||
uploadSure(){ |
||||
this.BatchUpload = false |
||||
this.page = 1 |
||||
this.keyword = '' |
||||
this.getData() |
||||
}, |
||||
closeUpload() { |
||||
this.uploadList = [] |
||||
this.uploadDataList = [] |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.no-mb.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
||||
|
@ -0,0 +1,240 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<div style="display: flex;justify-content: flex-end;"> |
||||
<div> |
||||
<el-input placeholder="请输入分类名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>分类管理</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="addFirst" v-auth>添加一级分类</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="listData" class="table" stripe header-align="center" row-key="cid" :tree-props="treeProps"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="typeName" label="分类名称" align="center"></el-table-column> |
||||
<el-table-column label="操作" width="200"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" v-if="scope.row.parentId == 0" @click="addSecond(scope.row)" v-auth>添加</el-button> |
||||
<el-button type="text" @click="editType(scope.row)" v-auth>编辑</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog :title="isAddFirst ? '添加一级分类' : '编辑一级分类'" :visible.sync="firstVisible" width="24%" center @close="closeFirst" :close-on-click-modal="false"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入题库分类名称" v-model="firstName" maxlength="15"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="firstVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="firstSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog :title="isAddSecond ? '添加二级分类' : '编辑二级分类'" :visible.sync="secondVisible" width="24%" center @close="closeSecond" :close-on-click-modal="false"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入题库分类名称" v-model="secondName" maxlength="15"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="secondVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="secondSubmit">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
treeProps: {children: 'secondColumn', hasChildren: 'hasChildren'}, |
||||
listData: [], |
||||
keyword: '', |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
searchTimer: null, |
||||
firstVisible: false, |
||||
firstId: '', |
||||
firstName: '', |
||||
secondVisible: false, |
||||
secondName: '', |
||||
secondId: '', |
||||
curRow: {}, |
||||
isAddFirst: false, |
||||
isAddSecond: false, |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'userId' |
||||
]) |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize |
||||
} |
||||
this.$post(this.api.listByPage,data) |
||||
.then(res => { |
||||
this.listData = res.data.list.list |
||||
this.total = res.data.list.currPage |
||||
}) |
||||
.catch(err => {}) |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteById}?cid=${row.cid}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
addFirst(){ |
||||
this.isAddFirst = true |
||||
this.firstVisible = true |
||||
}, |
||||
firstSubmit(){ |
||||
if(!this.firstName) return this.$message.warning('请填写题库分类名称') |
||||
let data = { |
||||
userId: this.userId, |
||||
typeName: this.firstName |
||||
} |
||||
if(this.curRow.cid){ |
||||
data.cid = this.curRow.cid |
||||
this.$post(this.api.modifyLevel, data).then(res => { |
||||
if(res.success){ |
||||
this.$message.success('修改成功'); |
||||
this.firstVisible = false |
||||
this.getData() |
||||
} |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
}else{ |
||||
this.$post(this.api.AddOneLevel, data).then(res => { |
||||
if(res.success){ |
||||
this.$message.success('添加成功'); |
||||
this.firstVisible = false |
||||
this.getData() |
||||
} |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
}, |
||||
addSecond(row){ |
||||
console.log(22,row) |
||||
this.isAddSecond = true |
||||
this.curRow = row |
||||
this.secondVisible = true |
||||
}, |
||||
closeFirst(){ |
||||
this.curRow = {} |
||||
this.firstName = '' |
||||
}, |
||||
closeSecond(){ |
||||
this.curRow = {} |
||||
this.secondName = '' |
||||
}, |
||||
editType(row){ |
||||
this.curRow = row |
||||
if(row.parentId == 0){ |
||||
this.isAddFirst = false |
||||
this.firstVisible = true |
||||
this.firstName = row.typeName |
||||
}else{ |
||||
this.isAddSecond = false |
||||
this.secondVisible = true |
||||
this.secondName = row.typeName |
||||
} |
||||
}, |
||||
secondSubmit(){ |
||||
if(!this.secondName) return this.$message.warning('请填写题库分类名称') |
||||
|
||||
let data = { |
||||
typeName: this.secondName, |
||||
userId: this.userId, |
||||
} |
||||
if(this.curRow.parentId == 0){ |
||||
data.parentId = this.curRow.cid |
||||
this.$post(this.api.AddSecondLevel, data).then(res => { |
||||
this.$message.success('添加成功'); |
||||
this.secondVisible = false |
||||
this.getData() |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
}else{ |
||||
data.cid = this.curRow.cid |
||||
this.$post(this.api.modifyLevel, data).then(res => { |
||||
this.$message.success('修改成功'); |
||||
this.secondVisible = false |
||||
this.getData() |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,752 @@ |
||||
<template> |
||||
<div |
||||
style="width:100%;height:100%;display:flex; |
||||
align-items: center;flex-direction:column " |
||||
> |
||||
<!-- 头像部分 --> |
||||
<div class="header"> |
||||
<img :src="avatar" class="HeadPortrait" /> |
||||
<div style="color:#cb221c;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;"> |
||||
<el-upload |
||||
class="upload-demo" |
||||
action="http://www.liuwanr.cn:8080/user/uploadUserAvatars" |
||||
:data="{userId:this.userId}" |
||||
name="file" |
||||
:limit="3" |
||||
:on-success="getRes" |
||||
> |
||||
<div>点击更改头像</div> |
||||
</el-upload> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- 用户信息 --> |
||||
<div class="card"> |
||||
<p class="block-title" style="display: flex;justify-content: space-between;align-items: center;"> |
||||
用户信息 |
||||
<el-button type="success" size="small" v-throttle @click="save">更新资料</el-button> |
||||
</p> |
||||
<p class="meta-title">个人信息</p> |
||||
<div class="information"> |
||||
<div class="block"> |
||||
<p class="block-left">姓名</p> |
||||
<div class="block-right"> |
||||
<input |
||||
id="username" |
||||
type="text" |
||||
v-model="personalInformation.userName" |
||||
/> |
||||
<div class="ii"> |
||||
<label for="username"> |
||||
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">性别</p> |
||||
<el-select |
||||
v-model="personalInformation.sex" |
||||
placeholder |
||||
> |
||||
<el-option |
||||
v-for="item in sexList" |
||||
:key="item.value" |
||||
:label="item.name" |
||||
:value="item.value" |
||||
></el-option> |
||||
</el-select> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">所在国家</p> |
||||
<el-select |
||||
v-model="personalInformation.countries" |
||||
placeholder |
||||
> |
||||
<el-option |
||||
v-for="item in countryList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value" |
||||
></el-option> |
||||
</el-select> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">所在省份</p> |
||||
<el-select |
||||
v-model="personalInformation.provinceId" |
||||
placeholder |
||||
@change="id => getCity(id,1)" |
||||
> |
||||
<el-option |
||||
v-for="item in provinceList" |
||||
:key="item.provinceId" |
||||
:label="item.provinceName" |
||||
:value="item.provinceId" |
||||
></el-option> |
||||
</el-select> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">所在省市</p> |
||||
<el-select |
||||
v-model="personalInformation.cityId" |
||||
placeholder |
||||
:disabled="personalInformation.provinceId ? false : true" |
||||
> |
||||
<el-option |
||||
v-for="item in cityList" |
||||
:key="item.cityId" |
||||
:label="item.cityName" |
||||
:value="item.cityId" |
||||
></el-option> |
||||
</el-select> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">出生年月日</p> |
||||
<el-date-picker |
||||
v-model="personalInformation.dateBirth" |
||||
:clearable="false" |
||||
class="block-right" |
||||
type="date"> |
||||
</el-date-picker> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">证件</p> |
||||
<div class="block-right"> |
||||
<input |
||||
id="idnumber" |
||||
type="text" |
||||
v-model="personalInformation.idnumber" |
||||
/> |
||||
<div class="ii"> |
||||
<label for="idnumber"> |
||||
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">教育程度</p> |
||||
<el-select |
||||
v-model="personalInformation.educationDegree" |
||||
placeholder="请选择教育程度" |
||||
> |
||||
<el-option |
||||
v-for="(item,index) in educationDegreeList" |
||||
:key="index" |
||||
:label="item.name" |
||||
:value="item.value" |
||||
></el-option> |
||||
</el-select> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">当前所在学校</p> |
||||
<el-select v-model="personalInformation.clientId" filterable placeholder="请选择学校"> |
||||
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.clientName" :value="item.id"></el-option> |
||||
</el-select> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="card mgb20"> |
||||
<p class="block-title">账号信息</p> |
||||
<div class="information"> |
||||
<div class="block"> |
||||
<p class="block-left">用户账号</p> |
||||
<div class="block-right"> |
||||
<input |
||||
id="account" |
||||
type="text" |
||||
v-model="personalInformation.account" |
||||
@change="accountChange" |
||||
/> |
||||
<div class="ii"> |
||||
<label for="account"> |
||||
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">手机号</p> |
||||
<div class="block-right"> |
||||
<input |
||||
id="phone" |
||||
type="text" |
||||
maxlength="11" |
||||
v-model="personalInformation.phone" |
||||
/> |
||||
<div class="ii"> |
||||
<label for="phone"> |
||||
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
<!-- <div class="near-right"> |
||||
{{personalInformation.phone}} |
||||
<el-button size="small" @click="bindPhone">更换</el-button> |
||||
</div> --> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">邮箱</p> |
||||
<div class="block-right"> |
||||
<input |
||||
id="email" |
||||
type="text" |
||||
class="block-right" |
||||
v-model="personalInformation.email" |
||||
/> |
||||
<div class="ii"> |
||||
<label for="email"> |
||||
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i> |
||||
</label> |
||||
</div> |
||||
</div> |
||||
<!-- <div class="near-right"> --> |
||||
<!-- {{personalInformation.email}} --> |
||||
<!-- <el-button size="small" @click="bindEmail">绑定</el-button> --> |
||||
<!-- </div> --> |
||||
</div> |
||||
|
||||
<!-- <div class="block"> |
||||
<p class="block-left">微信</p> --> |
||||
<!-- <input |
||||
id="wechat" |
||||
type="text" |
||||
class="block-right" |
||||
v-model="personalInformation.weChatID" |
||||
/> |
||||
<div class="ii"> |
||||
<label for="wechat"> |
||||
<i class="el-icon-edit" style="color:rgba(255, 255, 255, 1)"></i> |
||||
</label> |
||||
</div> --> |
||||
<!-- <div class="near-right"> |
||||
{{personalInformation.weChatID}} |
||||
<el-button size="small">绑定</el-button> |
||||
</div> |
||||
</div> --> |
||||
|
||||
<div class="block"> |
||||
<p class="block-left">密码</p> |
||||
<div class="near-right"> |
||||
<el-button size="small" @click="bindPassword">更换密码</el-button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-dialog |
||||
title="更换密码" |
||||
:visible.sync="passwordVisible" |
||||
:close-on-click-modal="false" |
||||
@close="closePassword" |
||||
width="30%"> |
||||
<el-form ref="passwordForm" :model="form" label-width="60px"> |
||||
<el-form-item label="原密码"> |
||||
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="新密码"> |
||||
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="新密码"> |
||||
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="passwordVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="editPassword">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapState,mapActions } from 'vuex'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
personalInformation: { |
||||
name:'', |
||||
workNumber:'', |
||||
password:"", |
||||
phone:'', |
||||
email:'', |
||||
provinceName:'', |
||||
cityName:'', |
||||
schoolName:'', |
||||
professionalName:'', |
||||
}, |
||||
passwordVisible: false, |
||||
passwordForm: { |
||||
password: '', |
||||
newPassword: '', |
||||
reNewPassword: '' |
||||
}, |
||||
sexList: [ |
||||
{ |
||||
name: '男', |
||||
value: 1 |
||||
}, |
||||
{ |
||||
name: '女', |
||||
value: 2 |
||||
} |
||||
], |
||||
countryList: [ |
||||
{ |
||||
label: '中国' |
||||
} |
||||
], |
||||
form: {}, |
||||
provinceList: [], //省份 |
||||
cityList: [], //城市 |
||||
// 教育程度 |
||||
educationDegreeList: [ |
||||
{ |
||||
name: '专科', |
||||
value: 1 |
||||
}, |
||||
{ |
||||
name: '本科', |
||||
value: 2 |
||||
}, |
||||
{ |
||||
name: '硕士', |
||||
value: 3 |
||||
}, |
||||
{ |
||||
name: '博士', |
||||
value: 4 |
||||
}, |
||||
{ |
||||
name: '其他', |
||||
value: 5 |
||||
} |
||||
], |
||||
schoolList: [], |
||||
curPassword: '', |
||||
accountRepeat: false |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'userId','avatar' |
||||
]) |
||||
}, |
||||
mounted() { |
||||
this.getdata(); |
||||
this.getProvince() |
||||
this.getSchoolData() |
||||
}, |
||||
methods: { |
||||
...mapActions('user', [ |
||||
'setAvatar' |
||||
]), |
||||
getProvince(){ |
||||
this.$get(this.api.queryProvince).then(res => { |
||||
this.provinceList = res.data.list |
||||
}).catch(res => {}); |
||||
}, |
||||
// 获取城市 |
||||
getCity(id,type){ |
||||
this.personalInformation.cityId = 1 |
||||
this.getCityData() |
||||
}, |
||||
getCityData(index){ |
||||
let provinceId = this.personalInformation.provinceId |
||||
this.$get(this.api.queryCity,{provinceId}).then(res => { |
||||
this.cityList = res.data.list |
||||
}).catch(res => {}); |
||||
}, |
||||
// 获取学校名称 |
||||
getSchoolData(){ |
||||
let data = { |
||||
searchContent: '', |
||||
provinceId: '', |
||||
cityId: '' |
||||
} |
||||
this.$get(`${this.api.queryClient}/1/1000`,data).then(res => { |
||||
this.schoolList = res.data.list |
||||
}).catch(res => {}); |
||||
}, |
||||
accountChange(){ |
||||
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => { |
||||
if(res.data.userInfo){ |
||||
this.accountRepeat = true |
||||
this.$message.warning('该账号已存在') |
||||
}else{ |
||||
this.accountRepeat = false |
||||
} |
||||
}).catch(res => {}); |
||||
}, |
||||
//取得头像地址 |
||||
getRes(res) { |
||||
this.setAvatar(res.message) |
||||
}, |
||||
uploadHeadImg: function() { |
||||
this.$el.querySelector('.hiddenInput').click(); |
||||
}, |
||||
getdata() { |
||||
this.$get(`${this.api.userinfo}?userId=${this.userId}`) |
||||
.then(res => { |
||||
this.personalInformation = res.data.userInfo |
||||
this.personalInformation.countries = '中国' |
||||
this.curPassword = this.personalInformation.password |
||||
this.$nextTick(() => { |
||||
if(this.personalInformation.provinceId){ |
||||
this.getCityData(1) |
||||
} |
||||
}) |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
bindPassword() { |
||||
this.passwordVisible = true |
||||
}, |
||||
editPassword() { |
||||
if(!this.passwordForm.password) return this.$message.warning('请输入原密码') |
||||
if(!this.passwordForm.newPassword) return this.$message.warning('请输入新密码') |
||||
if(!this.passwordForm.reNewPassword) return this.$message.warning('请确认新密码') |
||||
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return this.$message.warning('请输入6位数以上的密码') |
||||
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return this.$message.warning('输入的新密码不一致,请重新确认') |
||||
if(this.curPassword === this.passwordForm.newPassword) return this.$message.warning('原密码跟新密码不能一致') |
||||
|
||||
let data = { |
||||
userId: this.personalInformation.userId, |
||||
password: this.passwordForm.password |
||||
} |
||||
this.$post(this.api.userinfoUpdate,data) |
||||
.then(res => { |
||||
if(res.success){ |
||||
this.$message.success('更换成功') |
||||
this.curPassword = this.passwordForm.newPassword |
||||
this.passwordVisible = false |
||||
}else{ |
||||
this.$message.error('更换失败') |
||||
} |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
closePassword() { |
||||
this.passwordForm = { |
||||
password: '', |
||||
newPassword: '', |
||||
reNewPassword: '' |
||||
} |
||||
}, |
||||
save() { |
||||
if(this.personalInformation.idnumber && !/(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/.test(this.personalInformation.idnumber)) return this.$message.warning('请输入正确的证件号码') |
||||
if(this.accountRepeat) return this.$message.warning('该账号已存在') |
||||
if(this.personalInformation.phone && !/^1[3456789]\d{9}$/.test(this.personalInformation.phone)) return this.$message.warning('请输入正确的手机号') |
||||
if(this.personalInformation.email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.personalInformation.email)) return this.$message.warning('请输入正确的邮箱') |
||||
let personalInformation = this.personalInformation |
||||
let userInfoEntity = { |
||||
idnumber: personalInformation.idnumber, |
||||
account: personalInformation.account, |
||||
cityId: personalInformation.cityId, |
||||
countries: personalInformation.countries, |
||||
dateBirth: personalInformation.dateBirth, |
||||
educationDegree: personalInformation.educationDegree, |
||||
email: personalInformation.email, |
||||
phone: personalInformation.phone, |
||||
provinceId: personalInformation.provinceId, |
||||
clientId: personalInformation.clientId, |
||||
clientName: this.schoolList.find(n => n.id == personalInformation.clientId).clientName, |
||||
sex: personalInformation.sex, |
||||
userId: personalInformation.userId, |
||||
userName: personalInformation.userName, |
||||
} |
||||
let data = userInfoEntity |
||||
this.$post(this.api.userinfoUpdate,data).then(res => { |
||||
if(res.success){ |
||||
this.$message.success('提交成功') |
||||
this.$router.back() |
||||
}else{ |
||||
this.$message.error('提交失败') |
||||
} |
||||
}).catch(res => {}); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.header{ |
||||
text-align: center; |
||||
} |
||||
.header /deep/.el-upload-list__item-name { |
||||
display: none; |
||||
} |
||||
|
||||
.header /deep/.el-icon-upload-success{ |
||||
display: none; |
||||
} |
||||
|
||||
.header /deep/.el-upload-list__item-status-label{ |
||||
display: none; |
||||
} |
||||
.header /deep/ .el-upload-list{ |
||||
display: none; |
||||
} |
||||
|
||||
/deep/.el-input__inner{ |
||||
height: 32px !important; |
||||
} |
||||
/deep/.el-select .el-input .el-select__caret{ |
||||
line-height: 32px; |
||||
} |
||||
input:focus { |
||||
outline: 0; |
||||
} |
||||
.header { |
||||
background: #f0f0f0; |
||||
} |
||||
.openfile { |
||||
cursor: pointer; |
||||
} |
||||
.HeadPortrait { |
||||
margin-top: 10px; |
||||
width: 80px; |
||||
height: 80px; |
||||
background: url('../../../assets/img/img.jpg'); |
||||
border-radius: 50%; |
||||
|
||||
.head { |
||||
width: 34px; |
||||
height: 34px; |
||||
background: rgba(255, 255, 255, 1); |
||||
border-radius: 50%; |
||||
display: flex; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
justify-content: center; |
||||
position: relative; |
||||
.eee { |
||||
height: 10px; |
||||
width: 16px; |
||||
background-color: rgba(255, 255, 255, 1); |
||||
margin-bottom: -10px; |
||||
position: absolute; |
||||
top: 8px; |
||||
z-index: 2; |
||||
} |
||||
.Semicircle { |
||||
width: 12px; |
||||
height: 12px; |
||||
border: 2px solid #cb221c; |
||||
border-radius: 50px; |
||||
margin-bottom: 10px; |
||||
position: absolute; |
||||
} |
||||
} |
||||
.body { |
||||
color: #cb221c; |
||||
width: 30px; |
||||
height: 20px; |
||||
border: 3px solid #f5f5f5; |
||||
border-radius: 100%; |
||||
margin-top: 5px; |
||||
margin-bottom: -10px; |
||||
} |
||||
.body::after { |
||||
content: ''; |
||||
width: 40px; |
||||
height: 30px; |
||||
display: inline-block; |
||||
background-color: #cb221c; |
||||
margin-top: 8px; |
||||
margin-left: -6px; |
||||
} |
||||
} |
||||
input { |
||||
height: 50px; |
||||
width: 300px; |
||||
border: 0; |
||||
text-align: right; |
||||
outline: none; |
||||
} |
||||
|
||||
.card { |
||||
margin-top: 10px; |
||||
width: 750px; |
||||
padding: 20px; |
||||
background: rgba(255, 255, 255, 1); |
||||
box-shadow: 0px 0px 21px 0px rgba(48, 115, 248, 0.1); |
||||
border-radius: 10px; |
||||
position: relative; |
||||
.block-title{ |
||||
font-weight: bold; |
||||
font-size: 20px; |
||||
} |
||||
.meta-title{ |
||||
margin: 10px 0 0; |
||||
color: #cdbcec; |
||||
font-size: 15px; |
||||
} |
||||
.el-icon-document { |
||||
color: #cb221c; |
||||
font-size: 30px; |
||||
} |
||||
.el-icon-collection { |
||||
color: #cb221c; |
||||
position: absolute; |
||||
left: 31px; |
||||
top: 31px; |
||||
font-size: 30px; |
||||
} |
||||
span { |
||||
color: #333333; |
||||
font-size: 20px; |
||||
} |
||||
.plus{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
i{ |
||||
font-size: 22px; |
||||
color: #21d749; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
.archives{ |
||||
padding: 10px 20px; |
||||
margin-top: 20px; |
||||
border: 1px dashed #bbb; |
||||
border-radius: 12px; |
||||
|
||||
&.default-arch{ |
||||
margin-bottom: 20px; |
||||
/deep/.el-select{ |
||||
width: 10rem; |
||||
} |
||||
/deep/input{ |
||||
background-color: transparent; |
||||
} |
||||
} |
||||
} |
||||
.archives-wrap{ |
||||
.block{ |
||||
display: flex; |
||||
align-items: center; |
||||
margin-bottom: 8px; |
||||
&:last-child{ |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
.block-left{ |
||||
width: 30%; |
||||
font-family: MicrosoftYaHei; |
||||
font-size: 14px; |
||||
color: #101010; |
||||
} |
||||
/deep/.el-input__inner{ |
||||
border-radius: 8px !important; |
||||
} |
||||
} |
||||
} |
||||
.information { |
||||
.block { |
||||
line-height: 38px; |
||||
position: relative; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
.block-left { |
||||
font-family: MicrosoftYaHei; |
||||
font-size: 14px; |
||||
color: #101010; |
||||
} |
||||
input{ |
||||
font-size: 16px; |
||||
} |
||||
/deep/.el-date-editor .el-input__prefix{ |
||||
line-height: 32px; |
||||
} |
||||
/deep/.el-input__prefix,/deep/.el-input__suffix{ |
||||
left: auto; |
||||
right: 0; |
||||
} |
||||
.block-right,.near-right { |
||||
display: inline-flex; |
||||
align-items: center; |
||||
margin: 0; |
||||
padding: 0; |
||||
color: #333333ff; |
||||
font-size: 18px; |
||||
} |
||||
.near-right{ |
||||
right: 0; |
||||
font-size: 18px; |
||||
} |
||||
.ii { |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
width: 22px; |
||||
height: 22px; |
||||
margin-left: 10px; |
||||
border-radius: 50%; |
||||
background-color: #cb221c; |
||||
i{ |
||||
font-size: 12px; |
||||
} |
||||
} |
||||
/deep/.el-input__inner { |
||||
padding-right: 1.8rem; |
||||
margin-right: 5px; |
||||
color: #333333ff; |
||||
font-size: 16px; |
||||
text-align: right; |
||||
border: 0px; |
||||
} |
||||
/deep/.el-input__icon { |
||||
background: #cb221c; |
||||
width: 22px; |
||||
height: 22px; |
||||
line-height: 22px; |
||||
color: rgba(255, 255, 255, 1); |
||||
border-radius: 50%; |
||||
|
||||
&.el-icon-date{ |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
|
||||
/deep/.el-icon-arrow-up:before { |
||||
content: '\e6e1'; |
||||
margin-top: 5px; |
||||
} |
||||
|
||||
&.readonly .block-left{ |
||||
color: #a5a7adff; |
||||
} |
||||
} |
||||
} |
||||
.fold{ |
||||
margin-top: 20px; |
||||
text-align: center; |
||||
i{ |
||||
font-size: 22px; |
||||
color: #8e8e8e; |
||||
cursor: pointer; |
||||
&:hover{ |
||||
opacity: .8; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,59 @@ |
||||
<template> |
||||
<div> |
||||
<div class="tabs mgb20" v-if="showTabs"> |
||||
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a> |
||||
</div> |
||||
|
||||
<div class="score-table" v-if="activeName == 'staff'" v-auth="'系统设置:员工管理'"> |
||||
<staff></staff> |
||||
</div> |
||||
<div class="score-table" v-else v-auth="'系统设置:角色权限'"> |
||||
<role></role> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting'; |
||||
import staff from './staff.vue'; |
||||
import role from './role.vue'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
activeName: 'staff', |
||||
userId: this.$store.state.userId, |
||||
tabs: { |
||||
staff: '员工管理', |
||||
role: '角色权限' |
||||
}, |
||||
showTabs: true |
||||
}; |
||||
}, |
||||
components: { |
||||
staff, |
||||
role |
||||
}, |
||||
created() { |
||||
Setting.dynamicRoute && this.initTabs() |
||||
}, |
||||
methods: { |
||||
tabChange(index){ |
||||
this.activeName = index |
||||
}, |
||||
initTabs(){ |
||||
let btnPermissions = this.$store.state.btnPermissions |
||||
let showStaff = btnPermissions.includes('系统设置:员工管理') |
||||
let showRole = btnPermissions.includes('系统设置:角色权限') |
||||
|
||||
if(!showStaff || !showRole){ |
||||
this.showTabs = false |
||||
} |
||||
!showStaff && showRole && (this.activeName = 'role') |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scopted> |
||||
|
||||
</style> |
@ -0,0 +1,296 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<div style="display: flex;"> |
||||
<div> |
||||
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>角色列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="addRole" v-auth="'system:角色权限:新增角色'">新增角色</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:角色权限:批量删除'">批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="roleData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="roleName" label="角色名称" align="center" width="100"> |
||||
</el-table-column> |
||||
<el-table-column label="角色描述" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-input disabled placeholder="该角色用于管理全部功能权限" v-model="scope.row.remark "></el-input> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" width="180"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button> |
||||
<template v-if="scope.row.id != 1"> |
||||
<el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button> |
||||
</template> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" |
||||
width="30%" center @close="closeRole" class="dialog" :close-on-click-modal="false"> |
||||
<el-form ref="form" :model="form" label-width="100px" :disabled="isDetail"> |
||||
<el-form-item label="角色名称"> |
||||
<el-input v-model="form.roleName " ref="account" placeholder="请输入角色名称"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="角色描述"> |
||||
<el-input v-model="form.remark " placeholder="请输入角色描述" type="textarea" rows="5"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="role" label="角色权限"> |
||||
<div class="per-wrap"> |
||||
<el-tree |
||||
ref="per" |
||||
:data="permissions" |
||||
show-checkbox |
||||
node-key="id" |
||||
:default-expanded-keys="checkedIds" |
||||
:default-checked-keys="checkedIds" |
||||
:props="defaultProps"> |
||||
</el-tree> |
||||
</div> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
||||
<el-button @click="roleVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="saveData">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
name: 'role', |
||||
data() { |
||||
return { |
||||
keyword: '', |
||||
form: { |
||||
roleName : '', |
||||
remark : '', |
||||
id: '' |
||||
}, |
||||
isDetail: false, |
||||
roleData:[], |
||||
defaultProps: { |
||||
children: 'children', |
||||
label: 'name' |
||||
}, |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 0, |
||||
multipleSelection: [], |
||||
importVisible: false, |
||||
isAdd: true, |
||||
roleVisible: false, |
||||
searchTimer: null, |
||||
permissions: [], |
||||
checkedIds: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'clientId','clientName' |
||||
]) |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
clientId: this.clientId |
||||
} |
||||
if(this.keyword.length){ |
||||
data.name = this.keyword |
||||
} |
||||
this.$get(`${this.api.queryRoles}/${this.pageNo}/${this.pageSize}`,data).then(res => { |
||||
this.roleData = res.data.items |
||||
this.totals = res.data.total |
||||
}).catch(res => {}); |
||||
}, |
||||
closeRole(){ |
||||
this.isDetail = false |
||||
this.form = { |
||||
roleName : '', |
||||
remark : '', |
||||
id: '' |
||||
} |
||||
this.checkedIds = [] |
||||
this.permissions = [] |
||||
}, |
||||
currentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
getPer(){ |
||||
if(!this.permissions.length){ |
||||
this.$get(this.api.queryPermissionMenu).then(res => { |
||||
this.permissions = res.data.children[0].children |
||||
}).catch(res => {}) |
||||
} |
||||
}, |
||||
addRole(){ |
||||
this.isAdd = true |
||||
this.getPer() |
||||
this.checkedIds = [] |
||||
this.permissions.length && this.$refs.per.setCheckedNodes([]) |
||||
this.roleVisible = true |
||||
}, |
||||
handleRolePer(data,permissions){ |
||||
let result = data |
||||
if(permissions.length){ |
||||
permissions.map(e => { |
||||
if(result.includes(e.id) && e.children.length){ |
||||
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1) |
||||
} |
||||
e.children.length && this.handleRolePer(data,e.children) |
||||
}) |
||||
} |
||||
return result |
||||
}, |
||||
async getDetail(row){ |
||||
this.getPer() |
||||
let roleRes = await this.$get(`${this.api.getRole}/${row.id}`) |
||||
if(roleRes.success){ |
||||
this.form = roleRes.data.item |
||||
let perRes = await this.$get(`${this.api.toAssign}/${row.id}`) |
||||
if(perRes.success){ |
||||
this.checkedIds = this.handleRolePer(perRes.data.rolePermissions,this.permissions) |
||||
this.$refs.per.setCheckedNodes(this.checkedIds) |
||||
} |
||||
} |
||||
}, |
||||
showRole(row){ |
||||
this.isDetail = true |
||||
this.isAdd = false |
||||
this.getDetail(row) |
||||
this.roleVisible = true |
||||
}, |
||||
editRole(row){ |
||||
this.isAdd = false |
||||
this.getDetail(row) |
||||
this.roleVisible = true |
||||
}, |
||||
async saveData() { |
||||
if(!this.form.roleName) return this.$message.warning('请填写角色名称') |
||||
if(!this.form.remark) return this.$message.warning('请填写角色描述') |
||||
// if(!this.$refs.per.getCheckedKeys().length) return this.$message.warning('请选择角色权限') |
||||
let roleData = { |
||||
clientId: this.clientId, |
||||
id: this.form.id, |
||||
roleName: this.form.roleName, |
||||
remark: this.form.remark, |
||||
isPort: 1 |
||||
} |
||||
let roleRes = await this.$post(this.api.saveOrUpdate,roleData) |
||||
if(roleRes.success){ |
||||
let permissionId = [...this.$refs.per.getHalfCheckedKeys(),...this.$refs.per.getCheckedKeys()] |
||||
let perData = { |
||||
clientId: this.clientId, |
||||
roleId: roleRes.data.roleId, |
||||
permissionId, |
||||
isPort: 1 |
||||
} |
||||
let perRes = await this.$post(this.api.doAssign,perData) |
||||
if(perRes.success){ |
||||
this.$message.success('新增成功') |
||||
this.getData() |
||||
this.roleVisible = false |
||||
} |
||||
} |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('该角色下已有账号,删除角色会将该角色下的账号一并删除,是否继续删除?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.removeRole}?roleIds=${row.id}`).then(res => { |
||||
if(res.success){ |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
} |
||||
}).catch(res => {}) |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.id; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
// 批量删除 |
||||
this.$confirm('确定要删除选中角色吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$del(`${this.api.removeRole}?roleIds=${delList.join()}`).then(res => { |
||||
if(res.success){ |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
} |
||||
}).catch(res => {}) |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据 !'); |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.no-mb /deep/.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
/deep/.el-row{ |
||||
padding: 0 !important; |
||||
margin-bottom: 0; |
||||
} |
||||
.per-wrap{ |
||||
max-height: 300px; |
||||
overflow: auto; |
||||
} |
||||
</style> |
@ -0,0 +1,597 @@ |
||||
<template> |
||||
<div> |
||||
<el-container> |
||||
<el-aside width="350px"> |
||||
<TeacherSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @getData="getData"></TeacherSide> |
||||
</el-aside> |
||||
|
||||
<el-main style="padding-top: 0"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20 teacher_tab"> |
||||
<div class="flex-between mgb20"> |
||||
<div> |
||||
<el-input placeholder="请输入员工姓名/工号" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="addTeacher" v-auth="'system:员工管理:新增员工'">新增员工</el-button> |
||||
<el-button type="primary" size="small" round @click="batchImport" v-auth="'system:员工管理:批量导入'">批量导入</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:员工管理:批量删除'">批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55" align="center"></el-table-column> |
||||
<el-table-column type="index" label="序号" width="55" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="userName" label="职工姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="account" label="账号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="workNumber" label="职工工号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="staffProfessionalArchitectureName" label="一级部门" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="staffGradeName" label="二级部门" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="roleName" label="账号角色" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="loginNumber" label="登录次数" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="lastLoginTime" label="上次登录时间" width="160" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="showTeacher(scope.row)" v-auth="'system:员工管理:查看'">查看</el-button> |
||||
<el-button type="text" @click="editTeacher(scope.row)" v-auth="'system:员工管理:编辑'">编辑</el-button> |
||||
<el-button type="text" @click="delTeacher(scope.row)" v-auth="'system:员工管理:删除'">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="prev, pager, next" :current-page="pageNo" @current-change="handleCurrentChange" :total="pages"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
</el-main> |
||||
</el-container> |
||||
|
||||
<!-- 新增用户 --> |
||||
<el-dialog :title="isDetail ? '查看员工' : (isAddManage ? '新增员工' : '编辑员工')" :visible.sync="manageVisible" |
||||
width="30%" :center="!isIE" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> |
||||
<el-form ref="manageForm" :model="manageForm" :rules="rules" label-width="100px" :disabled="isDetail"> |
||||
<el-form-item prop="userAccount" label="账号"> |
||||
<el-input v-model="manageForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="userName" label="用户姓名"> |
||||
<el-input v-model="manageForm.userName" placeholder="请输入员工姓名"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="roleValue" label="账号角色"> |
||||
<el-select v-model="manageForm.roleValue" placeholder="请选择账号角色" :disabled="!isAddManage"> |
||||
<el-option v-for="(item,index) in roleList" :key="index" :label="item.roleName" :value="item.id"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识"> |
||||
<el-input disabled v-model="manageForm.uniqueIdentificationAccount" placeholder="请输入职工工号获取唯一标识"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="workNumber" label="职工工号"> |
||||
<el-input v-model="manageForm.workNumber" placeholder="请输入职工工号" @change="workNumberChange"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="major" label="一级部门"> |
||||
<el-select v-model="manageForm.major" placeholder="请选择一级部门" @change="getDepartment"> |
||||
<el-option v-for="(item,index) in majorList" :key="index" |
||||
:label="item.staffProfessionalArchitectureName" :value="item.staffProfessionalArchitectureId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item prop="managerDepartment" label="二级部门"> |
||||
<el-select v-model="manageForm.managerDepartment" placeholder="请选择二级部门" :disabled="manageForm.major ? false : true"> |
||||
<el-option v-for="(item,index) in managerDepartmentList" :key="index" |
||||
:label="item.staffGradeName" :value="item.staffGradeId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item prop="phone" label="手机号"> |
||||
<el-input v-model="manageForm.phone" placeholder="请输入手机号" maxlength="11"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="email" label="邮箱"> |
||||
<el-input v-model="manageForm.email" placeholder="请输入邮箱"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="email" label="默认密码"> |
||||
<el-input v-model="password" disabled></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
||||
<el-button @click="manageVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="saveSure('manageForm')">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<!-- 批量导入 --> |
||||
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false"> |
||||
<div style="text-align: center"> |
||||
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div> |
||||
<el-upload |
||||
accept=".xls,.xlsx" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.uploadFileStaff" |
||||
:file-list="uploadList" |
||||
name="file" |
||||
> |
||||
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
||||
</el-upload> |
||||
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败,查看原因</el-link> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="importVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="uploadSure">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import Setting from '@/setting'; |
||||
import TeacherSide from './staffside.vue'; |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
pages: 10, |
||||
isDetail: false, |
||||
isAddManage: false, |
||||
manageVisible: false, |
||||
roleList: [], |
||||
manageForm: { |
||||
clientId: this.clientId, |
||||
clientName: this.clientName, |
||||
manageId: '', |
||||
userName: '', |
||||
roleValue: '', |
||||
phone: '', |
||||
uniqueIdentificationAccount: '', |
||||
workNumber: '', |
||||
email: '', |
||||
major: '', |
||||
managerDepartment: '', |
||||
userAccount: '', |
||||
major: '', |
||||
schoolId: this.clientId |
||||
}, |
||||
rules: { |
||||
userAccount: [ |
||||
{ required: true, message: '请输入账号', trigger: 'blur' }, |
||||
{ |
||||
pattern: /^[A-Za-z0-9]+$/, |
||||
message: '请输入正确的账号', |
||||
trigger: 'blur' |
||||
} |
||||
], |
||||
userName: [ |
||||
{ required: true, message: '请输入用户姓名', trigger: 'blur' } |
||||
], |
||||
roleValue: [ |
||||
{ required: true, message: '请选择账号角色', trigger: 'change' } |
||||
], |
||||
uniqueIdentificationAccount: [ |
||||
// { required: true, message: '请输入唯一标识', trigger: 'blur' }, |
||||
], |
||||
major: [ |
||||
{ required: true, message: '请选择一级部门', trigger: 'change' } |
||||
], |
||||
workNumber: [ |
||||
{ required: true, message: '请输入职工工号', trigger: 'blur' }, |
||||
{ |
||||
pattern: /^[A-Za-z0-9]+$/, |
||||
message: '请输入正确的职工工号', |
||||
trigger: 'blur' |
||||
} |
||||
], |
||||
managerDepartment: [ |
||||
{ required: true, message: '请选择二级部门', trigger: 'change' } |
||||
], |
||||
phone: [ |
||||
// { required: true, message: '请输入职工手机号', trigger: 'blur' }, |
||||
{ |
||||
pattern: /^1[3456789]\d{9}$/, |
||||
message: '请输入正确的手机号', |
||||
trigger: 'blur' |
||||
} |
||||
], |
||||
email: [ |
||||
// { required: true, message: '请输入邮箱', trigger: 'blur' }, |
||||
{ |
||||
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/, |
||||
message: '请输入正确的邮箱', |
||||
trigger: 'blur' |
||||
} |
||||
], |
||||
// schoolId: [ |
||||
// { required: true, message: '请选择所在院校', trigger: 'change' } |
||||
// ], |
||||
}, |
||||
listData: [], |
||||
importVisible: false, |
||||
keyword: '', |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
managerDepartmentList: [], |
||||
teacherDepartmentList: [], |
||||
staffstateProfessId: '', |
||||
staffGradeId: '', |
||||
multipleSelection: [], |
||||
uploadList: [], |
||||
provinceId: this.$store.state.provinceId, |
||||
cityId: this.$store.state.cityId, |
||||
userId: this.$store.state.userId, |
||||
oneDepartmentIds: '', |
||||
twoDepartmentIds: '', |
||||
ProfessionalClassList: [], |
||||
subjectList: [], |
||||
ProfessionalList: [], |
||||
NoAdd: '', |
||||
AccountNoAdd: '', |
||||
NumberNoAdd: '', |
||||
platformId: this.$store.state.platformId, |
||||
schoolList: [], |
||||
uploadFaild: false, |
||||
token: '', |
||||
majorList: [], |
||||
accountRepeat: false, |
||||
workNumberRepeat: false, |
||||
originalAccount: '', |
||||
originalWorkNumber: '', |
||||
password: Setting.initialPassword |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'clientId','clientName' |
||||
]), |
||||
...mapState('layout', [ |
||||
'isIE' |
||||
]) |
||||
}, |
||||
components: { |
||||
TeacherSide |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.getData() |
||||
this.getRoles() |
||||
}, |
||||
methods: { |
||||
handleCheck(data){ |
||||
let oneDepartmentIds = [] |
||||
let twoDepartmentIds = [] |
||||
|
||||
data.forEach( e => { |
||||
if(e.ischeck){ |
||||
oneDepartmentIds.push(e.staffProfessionalArchitectureId) |
||||
}else{ |
||||
this.removeByValue(oneDepartmentIds, e.staffProfessionalArchitectureId); |
||||
} |
||||
e.children.forEach( r => { |
||||
if(r.ischeck){ |
||||
twoDepartmentIds.push(r.staffGradeId) |
||||
}else{ |
||||
this.removeByValue(twoDepartmentIds, r.staffGradeId); |
||||
} |
||||
}) |
||||
}) |
||||
this.oneDepartmentIds = oneDepartmentIds.toString() |
||||
this.twoDepartmentIds = twoDepartmentIds.toString() |
||||
this.getData() |
||||
}, |
||||
fircheck(val,val2){ |
||||
val.ischeck = !val.ischeck |
||||
val.children.map( e => e.ischeck = val.ischeck) |
||||
this.handleCheck(val2) |
||||
}, |
||||
twocheck(val,val2){ |
||||
this.handleCheck(val2) |
||||
}, |
||||
getData(){ |
||||
let data = { |
||||
staffProfessionalArchitectureIds: this.oneDepartmentIds, |
||||
staffGradeIds: this.twoDepartmentIds, |
||||
searchContent: this.keyword, |
||||
schoolId: this.clientId |
||||
} |
||||
this.$get(`${this.api.queryStaff}/${this.pageNo}/${this.pageSize}`,data).then(res => { |
||||
this.listData = res.data.staffList |
||||
this.total = res.data.total |
||||
}).catch(res => {}); |
||||
}, |
||||
getRoles() { |
||||
let data = { |
||||
clientId: this.clientId |
||||
} |
||||
this.$get(`${this.api.queryRoles}/1/100`,data).then(res => { |
||||
this.roleList = res.data.items |
||||
}).catch(res => {}); |
||||
}, |
||||
getSchoolData(){ |
||||
let data = { |
||||
schoolName: '' |
||||
} |
||||
this.$get(this.api.querySchool,data).then(res => { |
||||
this.schoolList = res.message |
||||
}).catch(res => {}); |
||||
}, |
||||
closeTeacher(){ |
||||
this.$refs.manageForm.resetFields() |
||||
this.manageForm.managerDepartment = '' |
||||
this.manageForm.major = '' |
||||
this.manageForm.workNumber = '' |
||||
this.manageForm.teacherDepartment = '' |
||||
this.manageForm.teacherMajor = '' |
||||
this.manageForm.teacherWorkNumber = '' |
||||
this.manageForm.userId = '' |
||||
this.manageForm.staffId = '' |
||||
}, |
||||
addTeacher(){ |
||||
this.isDetail = false |
||||
this.manageVisible = true |
||||
this.isAddManage = true |
||||
this.manageForm.manageId = '' |
||||
this.majorList = this.$refs.getSelectData.majorList |
||||
}, |
||||
getStaffDetail(userId){ |
||||
this.$get(`${this.api.getStaff}/${userId}`).then(res => { |
||||
let user = res.data.userInfo; |
||||
let or = res.data.staff; |
||||
this.manageForm.uniqueIdentificationAccount = user.uniqueIdentificationAccount |
||||
this.manageForm.clientId = user.clientId |
||||
this.manageForm.clientName = user.clientName |
||||
this.manageForm.userName = user.userName |
||||
this.manageForm.phone = user.phone |
||||
this.manageForm.email = user.email |
||||
this.manageForm.userAccount = user.account |
||||
this.originalAccount = Number(user.account) |
||||
this.manageForm.userId = user.userId |
||||
this.manageForm.schoolId = user.schoolId |
||||
this.manageForm.roleValue = or.roleId |
||||
|
||||
this.manageForm.major = or.staffProfessionalArchitectureId |
||||
this.manageForm.managerDepartment = or.staffGradeId |
||||
this.manageForm.workNumber = or.workNumber |
||||
this.originalWorkNumber = or.workNumber |
||||
this.manageForm.staffId = or.staffId |
||||
this.getDepartment() |
||||
}).catch(res => {}); |
||||
}, |
||||
editTeacher(row){ |
||||
this.isDetail = false |
||||
this.manageVisible = true |
||||
this.isAddManage = false |
||||
this.AccountNoAdd = false |
||||
this.manageForm.manageId = row.staffId |
||||
this.majorList = this.$refs.getSelectData.majorList |
||||
this.getStaffDetail(row.staffId) |
||||
}, |
||||
showTeacher(row){ |
||||
this.isDetail = true |
||||
this.manageVisible = true |
||||
this.isAddManage = false |
||||
this.AccountNoAdd = false |
||||
this.manageForm.manageId = row.staffId |
||||
this.majorList = this.$refs.getSelectData.majorList |
||||
this.getStaffDetail(row.staffId) |
||||
}, |
||||
getDepartment(){ |
||||
let data = { |
||||
staffProfessionalArchitectureId: this.manageForm.major |
||||
} |
||||
this.$get(this.api.queryStaffGrade,data).then(res => { |
||||
this.managerDepartmentList = res.data.staffGradeList |
||||
}).catch(res => {}); |
||||
}, |
||||
accountChange(){ |
||||
if(this.manageForm.userAccount !== this.originalAccount){ |
||||
this.$get(`${this.api.getAccount}?account=${this.manageForm.userAccount}`).then(res => { |
||||
if(res.data.userInfo){ |
||||
this.accountRepeat = true |
||||
this.$message.warning('该账号已存在') |
||||
}else{ |
||||
this.accountRepeat = false |
||||
} |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.accountRepeat = false |
||||
} |
||||
}, |
||||
workNumberChange(){ |
||||
if(this.manageForm.workNumber !== this.originalWorkNumber){ |
||||
this.$get(`${this.api.getWorkNumber}?workNumber=${this.manageForm.workNumber}`).then(res => { |
||||
if(res.data.staff){ |
||||
this.workNumberRepeat = true |
||||
this.$message.warning('该工号已存在') |
||||
}else{ |
||||
this.workNumberRepeat = false |
||||
} |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.workNumberRepeat = false |
||||
} |
||||
}, |
||||
async saveSure(manageForm){ |
||||
this.$refs[manageForm].validate((valid) => { |
||||
if (valid) { |
||||
if(this.accountRepeat) return this.$message.warning('该账号已存在') |
||||
if(this.workNumberRepeat) return this.$message.warning('该工号已存在') |
||||
let data = { |
||||
userInfo: { |
||||
userId: this.manageForm.userId, |
||||
userName: this.manageForm.userName, |
||||
account: this.manageForm.userAccount, |
||||
schoolId: this.clientId, |
||||
clientId: this.manageForm.clientId, |
||||
clientName: this.manageForm.clientName, |
||||
roleId: this.manageForm.roleValue, |
||||
phone: this.manageForm.phone, |
||||
email: this.manageForm.email, |
||||
isPort: 1, |
||||
uniqueIdentificationAccount: this.manageForm.uniqueIdentificationAccount ? this.manageForm.uniqueIdentificationAccount : Date.parse(new Date()), |
||||
} |
||||
} |
||||
let oneDepartmentName = ''; |
||||
for(let i in this.majorList){ |
||||
if(this.majorList[i].staffProfessionalArchitectureId == this.manageForm.major) { |
||||
oneDepartmentName = this.majorList[i].staffProfessionalArchitectureName |
||||
break; |
||||
} |
||||
} |
||||
let twoDepartmentName = this.managerDepartmentList.find((n) => { |
||||
return n.staffGradeId == this.manageForm.managerDepartment |
||||
}).staffGradeName; |
||||
data.staff = { |
||||
roleId: this.manageForm.roleValue, |
||||
isPort: 1, |
||||
schoolId: this.clientId, |
||||
clientId: this.manageForm.clientId, |
||||
clientName: this.manageForm.clientName, |
||||
staffId: this.manageForm.staffId, |
||||
userId: this.manageForm.userId, |
||||
workNumber: this.manageForm.workNumber, |
||||
staffProfessionalArchitectureId: this.manageForm.major, |
||||
staffGradeId: this.manageForm.managerDepartment, |
||||
staffProfessionalArchitectureName: oneDepartmentName, |
||||
staffGradeName: twoDepartmentName, |
||||
}; |
||||
if(this.manageForm.manageId){ |
||||
this.$post(this.api.updateStaff,data).then(res => { |
||||
this.manageVisible = false |
||||
this.$message.success('编辑成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.$post(this.api.addStaff,data).then(res => { |
||||
this.manageVisible = false |
||||
this.$message.success('添加成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
} |
||||
}else{ |
||||
return false; |
||||
} |
||||
}) |
||||
}, |
||||
delTeacher(row){ |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
staffIds: row.staffId |
||||
} |
||||
this.$del(this.api.deleteStaffs,data).then(res => { |
||||
this.$message.success('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.staffId |
||||
}) |
||||
// 批量删除 |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
staffIds: delList.join(',') |
||||
} |
||||
this.$del(this.api.deleteStaffs,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据 !') |
||||
} |
||||
}, |
||||
batchImport(){ |
||||
this.importVisible = true |
||||
this.uploadList = [] |
||||
this.uploadFaild = false |
||||
}, |
||||
searchTeacher(){ |
||||
this.pageNo = 1; |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
downLoad(){ |
||||
location.href = this.api.downloadStaffTemp |
||||
}, |
||||
showFaild(){ |
||||
location.href = `${this.api.exportFailureStaff}?token=${this.token}` |
||||
}, |
||||
// 上传文件 |
||||
handleExceed(files, fileList) { |
||||
this.$message.warning( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
); |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.uploadFaild = false |
||||
if(res.success){ |
||||
if(res.data.data.token){ |
||||
this.token = res.data.data.token |
||||
this.uploadFaild = true |
||||
}else{ |
||||
this.$message.success('上传成功') |
||||
} |
||||
}else{ |
||||
res.data.message ? this.$message.error(res.data.message) : this.$message.error('上传失败,请检查数据') |
||||
} |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}); |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
this.uploadFaild = false |
||||
}, |
||||
uploadSure(){ |
||||
this.importVisible = false |
||||
this.pageNo = 1 |
||||
this.keyword = '' |
||||
this.getData() |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.el-container{ |
||||
background-color: #f0f0f0; |
||||
} |
||||
</style> |
@ -0,0 +1,488 @@ |
||||
<template> |
||||
<div> |
||||
<div> |
||||
<div class="side_view"> |
||||
<p class="side_icon mab20"> |
||||
<i class="icon-jiahao mar20" @click="addMajor"></i> |
||||
<!-- <i class="icon-delete"></i> --> |
||||
</p> |
||||
<div class="side_tree" @click.stop="open(item)" v-for="(item,index) in majorList" :key="index"> |
||||
<div class="item" @click.stop="open(item)"> |
||||
<!-- <i :class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" class="icon-shixiangyoujiantou-"></i> --> |
||||
<img |
||||
v-if="item.children&&item.children.length!=0" |
||||
:class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" |
||||
src="../../../assets/img/icon-xiangyou.png" |
||||
alt |
||||
/> |
||||
<i v-else class="empty"></i> |
||||
<i :class="item.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="fircheckitem(item)"></i> |
||||
<span @click.stop="fircheckitem(item)">{{item.staffProfessionalArchitectureName}}</span> |
||||
<svg t="1604370117041" class="ft edit icon" @click.stop="editMajor(item)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16"><path d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z" p-id="9030" fill="#cb221c"></path></svg> |
||||
<i class="el-icon-circle-plus ft" @click.stop="addDepartment(item)"></i> |
||||
<i class="icon-delete ft" @click.stop="delMajor(item,index)"></i> |
||||
</div> |
||||
|
||||
<div v-show="item.ifVisible" v-if="item.children&&item.children.length!=0"> |
||||
<div v-for="(item1,index1) in item.children" :key="index1"> |
||||
<div class="item2" @click.stop="open(item1)"> |
||||
<i :class="item1.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="twocheckitem(item1)"></i> |
||||
<span @click.stop="twocheckitem(item1)">{{item1.label}}</span> |
||||
<svg t="1604312541925" class="ft edit icon" @click.stop="editDepartment(item1)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1129" width="14" height="14"><path d="M323.608576 658.725888 366.068736 701.303808 468.333568 664.004608 360.828928 556.619776ZM513.3056 63.31904c-248.041472 0-449.069056 201.05216-449.069056 449.072128 0 247.994368 201.028608 449.069056 449.069056 449.069056 247.994368 0 449.07008-201.074688 449.07008-449.069056C962.37568 264.3712 761.299968 63.31904 513.3056 63.31904zM490.842112 686.511104l-0.239616-0.279552c-1.241088 1.040384-2.60096 1.999872-4.200448 2.56l-206.849024 75.480064c-5.398528 1.918976-11.474944 0.638976-15.471616-3.519488-4.07552-3.997696-5.397504-10.075136-3.398656-15.429632l75.399168-206.773248c0.562176-1.557504 1.440768-2.878464 2.51904-4.158464l-0.161792-0.198656L524.184576 348.490752c20.150272 20.108288 36.739072 36.658176 36.739072 36.658176l-145.522688 145.28512c-2.358272 2.279424-3.398656 5.276672-3.398656 8.31488 0 2.998272 1.040384 5.998592 3.398656 8.316928 2.280448 2.23744 5.27872 3.477504 8.395776 3.477504 3.117056 0 6.07744-1.240064 8.353792-3.477504L577.596416 401.861632l45.693952 45.617152L478.487552 592.12288c-4.557824 4.595712-4.557824 12.071936 0 16.668672 2.238464 2.200576 5.27872 3.438592 8.3968 3.438592 3.15904 0 6.115328-1.238016 8.354816-3.398656 0-0.039936 144.763904-144.643072 144.763904-144.643072s21.269504 21.269504 36.54144 36.620288L490.842112 686.511104zM751.264768 426.20928l-57.969664 57.929728c-29.78304-29.744128-98.985984-98.99008-152.357888-152.260608l58.047488-58.008576c20.789248-20.769792 54.771712-20.809728 75.522048 0l76.75904 76.8C772.054016 371.438592 772.015104 405.34016 751.264768 426.20928z" p-id="1130" fill="#cb221c"></path></svg> |
||||
<i class="icon-delete ft" @click.stop="delDepartment(item1,index1)"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- 添加专业 --> |
||||
<el-dialog :title="Form.MajorId ? '编辑专业' : '新增专业'" :visible.sync="isaddMajor" width="24%" center @close="closeAdd" :close-on-click-modal="false"> |
||||
<el-form ref="Form" :model="Form"> |
||||
<el-form-item prop="majorName"> |
||||
<el-input placeholder="请输入专业名称" v-model="Form.majorName" @change="majorChange"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="isaddMajor = false">取 消</el-button> |
||||
<el-button type="primary" @click="sure('Form')">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<!-- 添加部门 --> |
||||
<el-dialog :title="Form.departmentId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" width="24%" center @close="closeAdd" :close-on-click-modal="false"> |
||||
<el-form ref="Form" :model="Form"> |
||||
<el-form-item prop="departmentName"> |
||||
<el-input placeholder="请输入部门名称" v-model="Form.departmentName" @change="depChange"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="isAddDepartment = false">取 消</el-button> |
||||
<el-button type="primary" @click="sureDepartment('Form')">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
props:["Data"], |
||||
data() { |
||||
return { |
||||
majorList: [], |
||||
firactive: 0, |
||||
twoactive: 0, |
||||
isaddMajor: false, |
||||
isAddDepartment: false, |
||||
Form: { |
||||
MajorId: '', |
||||
majorName: '', |
||||
departmentId: '', |
||||
departmentName: '' |
||||
}, |
||||
staffstateProfessId: '', |
||||
staffstateId: '', |
||||
majorNoAdd: true, |
||||
depNoAdd: true |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'clientId','clientName' |
||||
]) |
||||
}, |
||||
mounted(){ |
||||
this.getStaff() |
||||
}, |
||||
methods: { |
||||
getStaff(majorIds){ |
||||
let data = { |
||||
schoolId: this.clientId |
||||
} |
||||
this.$get(this.api.queryStaffPro,data).then(res => { |
||||
let firList = res.data.StaffProfessionalArchitectureList |
||||
if(firList){ |
||||
firList.map(e => { |
||||
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffProfessionalArchitectureName); |
||||
majorIds && majorIds.includes(e.staffProfessionalArchitectureId) && (e.ifVisible = true) |
||||
let data = { |
||||
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId |
||||
} |
||||
this.$get(this.api.queryStaffGrade,data).then(res1 => { |
||||
res1.data.staffGradeList.map(e => { |
||||
(e.ischeck = false), (e.label = e.staffGradeName); |
||||
}) |
||||
e.children = res1.data.staffGradeList |
||||
}).catch(res1 => {}); |
||||
}) |
||||
} |
||||
setTimeout(() => { |
||||
this.majorList = firList |
||||
majorIds || (this.majorList[0].ifVisible = true) |
||||
}, 500); |
||||
}).catch(res => {}); |
||||
}, |
||||
//点击节点时伸展或收缩列表 |
||||
open(item) { |
||||
item.ifVisible = !item.ifVisible; |
||||
}, |
||||
|
||||
//选中叶子节点时将选中的叶子节点添加进数组,如果叶子节点存在则删除,removeByvalue函数定义在main.js中 |
||||
choose(item) { |
||||
item.ifVisible = !item.ifVisible; |
||||
if (item.ifVisible) { |
||||
this.chooseList.push(item); |
||||
} else { |
||||
this.chooseList.removeByValue(item); |
||||
} |
||||
}, |
||||
// 选择专业 |
||||
fircheckitem(item){ |
||||
this.$emit("fircheck",item,this.majorList) |
||||
}, |
||||
// 选择部门 |
||||
twocheckitem(item){ |
||||
item.ischeck = !item.ischeck |
||||
this.majorList.forEach( e => { |
||||
e.children.forEach( r => { |
||||
if(r.staffGradeId == item.staffGradeId){ |
||||
if(e.children.every(i => i.ischeck)){ |
||||
e.ischeck = true |
||||
}else{ |
||||
e.ischeck = false |
||||
} |
||||
} |
||||
}) |
||||
}) |
||||
this.$emit("twocheck",item,this.majorList) |
||||
}, |
||||
closeAdd(){ |
||||
this.$refs.Form.resetFields() |
||||
}, |
||||
// 新增编辑专业 |
||||
addMajor(){ |
||||
this.Form.MajorId = '' |
||||
this.Form.majorName = '' |
||||
this.isaddMajor = true |
||||
}, |
||||
editMajor(item){ |
||||
this.Form.MajorId = item.staffProfessionalArchitectureId, |
||||
this.Form.majorName = item.staffProfessionalArchitectureName |
||||
this.isaddMajor = true |
||||
}, |
||||
async majorChange(){ |
||||
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName,schoolId: this.clientId }); |
||||
if(res.data.StaffProfessionalArchitecture != null){ |
||||
this.$message.warning('该一级部门已存在'); |
||||
this.majorNoAdd = false |
||||
}else{ |
||||
this.majorNoAdd = true |
||||
} |
||||
}, |
||||
async depChange(){ |
||||
let res = await this.$get(this.api.queryStaffName, { staffGradeName: this.Form.departmentName,staffProfessionalArchitectureId: this.Form.MajorId }); |
||||
if(res.data.staffGrade != null){ |
||||
this.$message.warning('该二级部门已存在'); |
||||
this.depNoAdd = false |
||||
}else{ |
||||
this.depNoAdd = true |
||||
} |
||||
}, |
||||
sure(Form){ |
||||
if(!this.Form.majorName) return this.$message.warning('请输入专业名称'); |
||||
if(!this.majorNoAdd) return this.$message.warning('该一级部门已存在'); |
||||
let data = { |
||||
staffProfessionalArchitectureName: this.Form.majorName, |
||||
staffProfessionalArchitectureId: this.Form.MajorId, |
||||
schoolId: this.clientId, |
||||
} |
||||
if(this.Form.MajorId){ |
||||
this.$post(this.api.updateStaffPro,data).then(res => { |
||||
this.$message.success('编辑成功'); |
||||
this.isaddMajor = false |
||||
this.getStaff() |
||||
this.$emit('getData') |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.$post(this.api.addStaffPro,data).then(res => { |
||||
this.$message.success('添加成功'); |
||||
this.isaddMajor = false |
||||
this.getStaff() |
||||
}).catch(res => {}); |
||||
} |
||||
}, |
||||
// 新增编辑部门 |
||||
addDepartment(item){ |
||||
this.Form.departmentId = '' |
||||
this.Form.departmentName = '' |
||||
this.isAddDepartment = true |
||||
this.Form.MajorId = item.staffProfessionalArchitectureId |
||||
}, |
||||
editDepartment(item){ |
||||
this.Form.departmentId = item.staffGradeId, |
||||
this.Form.departmentName = item.staffGradeName |
||||
this.isAddDepartment = true |
||||
for (let j = 0; j < this.majorList.length; j++) { |
||||
for (let k = 0; k < this.majorList[j].children.length; k++) { |
||||
if(this.majorList[j].children[k].staffGradeId == item.staffGradeId){ |
||||
this.Form.MajorId = this.majorList[j].staffProfessionalArchitectureId |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
sureDepartment(Form){ |
||||
if(!this.Form.departmentName) return this.$message.warning('请输入部门名称'); |
||||
if(!this.depNoAdd) return this.$message.warning('该二级部门已存在'); |
||||
let data = { |
||||
schoolId: this.clientId, |
||||
staffGradeName: this.Form.departmentName, |
||||
staffProfessionalArchitectureId: this.Form.MajorId, |
||||
staffGradeId: this.Form.departmentId |
||||
} |
||||
if(this.Form.departmentId){ |
||||
this.$post(this.api.updateStaffGrade,data).then(res => { |
||||
this.$message.success('编辑成功'); |
||||
this.isAddDepartment = false |
||||
this.majorList.map(e =>{ |
||||
e.children.map(r =>{ |
||||
if(r.staffGradeId == this.Form.departmentId){ |
||||
r.staffGradeName = this.Form.departmentName |
||||
r.label = this.Form.departmentName |
||||
} |
||||
}) |
||||
}) |
||||
}).catch(res => {}); |
||||
}else{ |
||||
let showMajorIds = this.majorList.map(e => {if(e.ifVisible) return e.staffProfessionalArchitectureId}).filter(n => n) |
||||
this.$post(this.api.addStaffGrade,data).then(res => { |
||||
this.$message.success('添加成功'); |
||||
this.isAddDepartment = false |
||||
this.getStaff(showMajorIds) |
||||
}).catch(res => {}); |
||||
} |
||||
}, |
||||
delMajor(item,index){ |
||||
this.$confirm('确定要删除该专业吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteStaffPro}?staffProfessionalArchitectureIds=${item.staffProfessionalArchitectureId}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.majorList.splice(index, 1) |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delDepartment(item,indx){ |
||||
this.$confirm('确定要删除该部门吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteStaffGrade}?staffGradeIds=${item.staffGradeId}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.majorList.map(e =>{ |
||||
e.children.map(r =>{ |
||||
if(r.staffGradeId == item.staffGradeId){ |
||||
e.children.splice(indx,1) |
||||
if(e.children.length == 0){ |
||||
e.ifVisible = false |
||||
} |
||||
} |
||||
}) |
||||
}) |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
$insideColor: rgba(245, 242, 255, 0.8); //内部节点的边框颜色 |
||||
$outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色 |
||||
|
||||
//混合代码,提取item共同样式 |
||||
@mixin public { |
||||
cursor: pointer; |
||||
font-size: 16px; |
||||
color: #333333; |
||||
display: flex; |
||||
align-items: center; |
||||
img { |
||||
height: 20px; |
||||
width: 20px; |
||||
margin-left: 10px; |
||||
} |
||||
} |
||||
|
||||
.main { |
||||
width: 100%; |
||||
} |
||||
|
||||
.item { |
||||
@include public; |
||||
width: 100%; |
||||
padding: 15px 0; |
||||
background:rgba(255,255,255,1); |
||||
box-shadow:1px 14px 29px 0px rgba(255,69,69,0.19); |
||||
border-radius:10px; |
||||
text-align: left; |
||||
margin-top: 20px; |
||||
} |
||||
.item:first{ |
||||
margin-top: 0; |
||||
} |
||||
.item2 { |
||||
@include public; |
||||
margin-top: 20px; |
||||
margin-left:50px |
||||
} |
||||
.item2:hover{ |
||||
color: #cb221c; |
||||
} |
||||
.item .empty{ |
||||
width: 20px; |
||||
} |
||||
.edit{ |
||||
width: 17px !important; |
||||
height: 17px !important; |
||||
margin-left: 5px; |
||||
} |
||||
|
||||
//清除ul,li的默认样式 |
||||
ul, |
||||
li { |
||||
padding: 0; |
||||
margin: 0; |
||||
list-style: none; |
||||
} |
||||
|
||||
// 使三角形旋转动画 |
||||
.arrowTransform { |
||||
transition: 0.4s; |
||||
transform-origin: center; |
||||
transform: rotateZ(0deg); |
||||
} |
||||
.arrowTransformReturn { |
||||
transition: 0.4s; |
||||
transform-origin: center; |
||||
transform: rotateZ(90deg); |
||||
} |
||||
|
||||
//复选框样式 |
||||
.checkBox { |
||||
width: 14px; |
||||
height: 14px; |
||||
border-radius: 7px; |
||||
margin-left: 10px; |
||||
margin-right: 10px; |
||||
border: 2px solid rgba(146, 120, 255, 1); |
||||
} |
||||
|
||||
//当点击复选框时候切换背景图片 |
||||
.isActive { |
||||
background: url('../../../assets/img/icon-yigouxuan.png'); |
||||
background-size: 14px 14px; /*按比例缩放*/ |
||||
} |
||||
|
||||
.side_view{ |
||||
padding: 40px 20px; |
||||
background-color: #fff; |
||||
i { |
||||
color: #cb221c; |
||||
} |
||||
} |
||||
.side_icon{ |
||||
text-align: right; |
||||
} |
||||
.side_icon i{ |
||||
cursor:pointer; |
||||
font-size: 16px; |
||||
} |
||||
.side_tree{ |
||||
width: 100%; |
||||
font-size: 14px; |
||||
color: #333; |
||||
i{ |
||||
color: #cb221c; |
||||
margin-left: 5px; |
||||
font-size: 17px; |
||||
} |
||||
span{ |
||||
margin-left: 5px; |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
|
||||
.side_view{ |
||||
height: 800px; |
||||
padding: 40px 20px; |
||||
background-color: #fff; |
||||
overflow: auto; |
||||
} |
||||
.side_icon{ |
||||
text-align: right; |
||||
} |
||||
.side_icon i{ |
||||
cursor:pointer; |
||||
font-size: 20px; |
||||
color: #cb221c; |
||||
} |
||||
|
||||
.fir_back{ |
||||
width: 100%; |
||||
padding: 15px 0; |
||||
background:rgba(255,255,255,1); |
||||
/* box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); */ |
||||
border-radius:10px; |
||||
text-align: left; |
||||
} |
||||
.fir_back:first-child{ |
||||
margin-top: 20px; |
||||
} |
||||
.fir_back:hover{ |
||||
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); |
||||
cursor:pointer; |
||||
} |
||||
.fir_back span{ |
||||
margin-left: 10px; |
||||
} |
||||
.two_active{ |
||||
color: #cb221c; |
||||
} |
||||
/* .two_active:hover{ |
||||
color: #cb221c; |
||||
cursor:pointer; |
||||
} */ |
||||
.two_back:hover{ |
||||
cursor:pointer; |
||||
color: #cb221c; |
||||
} |
||||
.mar_top{ |
||||
margin-top: 20px; |
||||
} |
||||
.back_active{ |
||||
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); |
||||
} |
||||
.bor_lef{ |
||||
padding: 20px 0 0 0; |
||||
margin-left: 40px; |
||||
} |
||||
.three_lef{ |
||||
margin-left: 60px; |
||||
padding: 20px 0; |
||||
} |
||||
.three_text{ |
||||
font-size: 14px; |
||||
margin-top: 10px; |
||||
} |
||||
.teacher_tab{ |
||||
margin-left: 20px; |
||||
} |
||||
.icon_select:before{ |
||||
transform: rotate(180deg); |
||||
} |
||||
.list-enter-active, .list-leave-active { transition: all 1s; } |
||||
.list-enter, .list-leave-to { opacity: 0; transform: translateY(-30px); } |
||||
</style> |
@ -0,0 +1,256 @@ |
||||
<template> |
||||
<div class="side_view"> |
||||
<p class="side_icon mab20"> |
||||
<i class="icon-jiahao mar20" @click="addMajor"></i> |
||||
<!-- <i class="icon-delete"></i> --> |
||||
</p> |
||||
<div class="side_tree" @click.stop="open(item)" v-for="(item,index) in data" :key="index"> |
||||
<div class="item" @click.stop="open(item)"> |
||||
<!-- <i :class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" class="icon-shixiangyoujiantou-"></i> --> |
||||
<img |
||||
:class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" |
||||
src="../../../assets/img/icon-xiangyou.png" |
||||
alt |
||||
/> |
||||
{{item.ischeck}} |
||||
<i :class="item.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="fircheckitem(item)"></i> |
||||
<span>{{item.staffProfessionalArchitectureName}}</span> |
||||
<i class="el-icon-info ft" @click.stop="editMajor(item)"></i> |
||||
<i class="el-icon-circle-plus ft" @click.stop="addDepartment(item)"></i> |
||||
<i class="icon-delete ft" @click.stop="delMajor(item,index)"></i> |
||||
</div> |
||||
|
||||
<div v-show="item.ifVisible" v-if="item.children&&item.children.length!=0"> |
||||
<div v-for="(item1,index1) in item.children" :key="index1"> |
||||
<div class="item2" @click.stop="open(item1)"> |
||||
{{item1.ischeck}} |
||||
<i :class="item1.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="twocheckitem(item1)"></i> |
||||
<span>{{item1.label}}</span> |
||||
<i class="el-icon-info ft" @click.stop="editDepartment(item1)"></i> |
||||
<i class="icon-delete ft" @click.stop="delDepartment(item1,index1)"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
Array.prototype.removeByValue = function (val) { |
||||
for (var i = 0; i < this.length; i++) { |
||||
if (JSON.stringify(this[i]).indexOf(JSON.stringify(val)) != -1) { |
||||
this.splice(i, 1); |
||||
break; |
||||
} |
||||
} |
||||
}; |
||||
export default { |
||||
data() { |
||||
return { |
||||
chooseList: [] |
||||
}; |
||||
}, |
||||
watch: { |
||||
chooseList(n, o) { |
||||
this.$emit('chooseNode', n); |
||||
} |
||||
}, |
||||
|
||||
props: { |
||||
data: { |
||||
type: Array |
||||
} |
||||
}, |
||||
methods: { |
||||
//点击节点时伸展或收缩列表 |
||||
open(item) { |
||||
item.ifVisible = !item.ifVisible; |
||||
}, |
||||
|
||||
//选中叶子节点时将选中的叶子节点添加进数组,如果叶子节点存在则删除,removeByvalue函数定义在main.js中 |
||||
choose(item) { |
||||
item.ifVisible = !item.ifVisible; |
||||
if (item.ifVisible) { |
||||
this.chooseList.push(item); |
||||
} else { |
||||
this.chooseList.removeByValue(item); |
||||
} |
||||
}, |
||||
fircheckitem(item){ |
||||
this.$emit('fircheckitem',item); |
||||
}, |
||||
twocheckitem(item){ |
||||
console.log(11,item) |
||||
item.ischeck = !item.ischeck |
||||
console.log(22,item) |
||||
|
||||
this.data.map( e => { |
||||
e.children.map( r => { |
||||
if(r.staffGradeId == item.staffGradeId){ |
||||
if(r.ischeck){ |
||||
e.ischeck = true |
||||
} else { |
||||
e.ischeck = false |
||||
} |
||||
} |
||||
}) |
||||
}) |
||||
// this.$emit('twocheckitem',item); |
||||
}, |
||||
// 专业 |
||||
addMajor(){ |
||||
this.$emit('addMajor'); |
||||
}, |
||||
editMajor(item){ |
||||
this.$emit('editMajor',item); |
||||
}, |
||||
delMajor(item,index){ |
||||
this.$emit('delMajor',item,index); |
||||
}, |
||||
// 年级 |
||||
addDepartment(item){ |
||||
this.$emit('addDepartment',item); |
||||
}, |
||||
editDepartment(item){ |
||||
this.$emit('editDepartment',item); |
||||
}, |
||||
delDepart(item,index){ |
||||
this.$emit('delDepart',item,index); |
||||
}, |
||||
// 班级 |
||||
addClass(item){ |
||||
this.$emit('addClass',item); |
||||
}, |
||||
editDepartment(item){ |
||||
this.$emit('editDepartment',item); |
||||
}, |
||||
delDepartment(item,index){ |
||||
this.$emit('delDepartment',item,index); |
||||
}, |
||||
//判断数组中是否包含某个对象 |
||||
isHasObj(arr, val) { |
||||
var flag = 0; //1为有 0为没有 |
||||
for (var i = 0; i < arr.length; i++) { |
||||
if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) { |
||||
flag = 1; |
||||
} |
||||
} |
||||
if (flag == 1) { |
||||
return true; |
||||
} else { |
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
$insideColor: rgba(245, 242, 255, 0.8); //内部节点的边框颜色 |
||||
$outColor: rgba(255, 255, 255, 0.8); //外部节点的边框颜色 |
||||
|
||||
//混合代码,提取item共同样式 |
||||
@mixin public { |
||||
cursor: pointer; |
||||
font-size: 16px; |
||||
color: #333333; |
||||
display: flex; |
||||
align-items: center; |
||||
img { |
||||
height: 20px; |
||||
width: 20px; |
||||
margin-left: 10px; |
||||
} |
||||
} |
||||
|
||||
.main { |
||||
width: 100%; |
||||
} |
||||
|
||||
.item { |
||||
@include public; |
||||
width: 100%; |
||||
padding: 15px 0; |
||||
background:rgba(255,255,255,1); |
||||
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); |
||||
border-radius:10px; |
||||
text-align: left; |
||||
margin-top: 20px; |
||||
} |
||||
.item:first{ |
||||
margin-top: 0; |
||||
} |
||||
.item2 { |
||||
@include public; |
||||
margin-top: 20px; |
||||
margin-left:60px |
||||
} |
||||
.item2:hover{ |
||||
color: #cb221c; |
||||
} |
||||
|
||||
//清除ul,li的默认样式 |
||||
ul, |
||||
li { |
||||
padding: 0; |
||||
margin: 0; |
||||
list-style: none; |
||||
} |
||||
|
||||
// 使三角形旋转动画 |
||||
.arrowTransform { |
||||
transition: 0.4s; |
||||
transform-origin: center; |
||||
transform: rotateZ(0deg); |
||||
} |
||||
.arrowTransformReturn { |
||||
transition: 0.4s; |
||||
transform-origin: center; |
||||
transform: rotateZ(90deg); |
||||
} |
||||
|
||||
//复选框样式 |
||||
.checkBox { |
||||
width: 14px; |
||||
height: 14px; |
||||
border-radius: 7px; |
||||
margin-left: 10px; |
||||
margin-right: 10px; |
||||
border: 2px solid rgba(146, 120, 255, 1); |
||||
} |
||||
|
||||
//当点击复选框时候切换背景图片 |
||||
.isActive { |
||||
background: url('../../../assets/img/icon-yigouxuan.png'); |
||||
background-size: 14px 14px; /*按比例缩放*/ |
||||
} |
||||
|
||||
.side_view{ |
||||
// height: 800px; |
||||
padding: 40px 20px; |
||||
background-color: #fff; |
||||
box-shadow:-2px 0px 57px 0px rgba(192,189,216,0.39); |
||||
i { |
||||
color: #cb221c; |
||||
} |
||||
} |
||||
.side_icon{ |
||||
text-align: right; |
||||
} |
||||
.side_icon i{ |
||||
cursor:pointer; |
||||
font-size: 20px; |
||||
} |
||||
.side_tree{ |
||||
width: 100%; |
||||
font-size: 16px; |
||||
color: #333; |
||||
i{ |
||||
margin-left: 10px; |
||||
} |
||||
span{ |
||||
margin-left: 5px; |
||||
font-size: 14px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,439 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<div style="display: flex;justify-content: flex-end;"> |
||||
<div> |
||||
<el-input placeholder="请输入用户姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>用户列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="adduser" v-auth>新增用户</el-button> |
||||
<el-button type="primary" size="small" round @click="batchImport" v-auth>批量导入</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllSelection" v-auth>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="userData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="clientName" label="客户名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label="姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="account" label="账号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="role" label="账号角色" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{getRole(scope.row.roleId)}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="loginNumber" label="登录次数" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.row.lastLoginTime == '0000-00-00 00:00:00' ? '' : scope.row.lastLoginTime}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="200"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button> |
||||
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button> |
||||
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog :title="isDetail ? '查看用户' : (isAdd ? '新增用户' : '编辑用户')" :visible.sync="userVisible" |
||||
width="30%" :center="!isIE" @close="closeTeacher" class="dialog" :close-on-click-modal="false"> |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="isDetail"> |
||||
<el-form-item prop="account" label="账号"> |
||||
<el-input v-model="form.account" ref="account" placeholder="请输入账号" @change="accountChange"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="name" label="用户姓名"> |
||||
<el-input v-model="form.name" placeholder="请输入用户姓名"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="roleValue" label="账号角色"> |
||||
<el-checkbox-group v-model="form.roleValue" :disabled="true"> |
||||
<el-checkbox label="超级管理员"></el-checkbox> |
||||
</el-checkbox-group> |
||||
</el-form-item> |
||||
<el-form-item prop="clientId" label="客户名称"> |
||||
<el-select v-model="form.clientId" clearable placeholder="请选择客户名称" filterable> |
||||
<el-option v-for="(item,index) in clientList" :key="index" :label="item.clientName" :value="item.id"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer" v-if="!isDetail"> |
||||
<el-button @click="userVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="saveData">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
|
||||
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false"> |
||||
<div style="text-align: center"> |
||||
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div> |
||||
<el-upload |
||||
accept=".xls,.xlsx" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.uploadFileUser" |
||||
:file-list="uploadList" |
||||
name="file" |
||||
> |
||||
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button> |
||||
</el-upload> |
||||
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败,查看原因</el-link> |
||||
</div> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="importVisible = false">取消</el-button> |
||||
<el-button type="primary" @click="uploadSure">确定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting'; |
||||
import { mapActions } from 'vuex'; |
||||
import { mapState } from 'vuex'; |
||||
export default { |
||||
name: 'user', |
||||
data() { |
||||
return { |
||||
form: { |
||||
id: '', |
||||
name: '', |
||||
account: '', |
||||
roleValue: ['超级管理员'], |
||||
clientId: '', |
||||
clientName: '' |
||||
}, |
||||
rules: { |
||||
account: [ |
||||
{ required: true, message: '请输入账号', trigger: 'blur' }, |
||||
// { |
||||
// pattern: /^[A-Za-z0-9]*$/, |
||||
// message: '用户账号必须为数字', |
||||
// trigger: 'blur' |
||||
// } |
||||
], |
||||
name: [ |
||||
{ required: true, message: '请输入用户姓名', trigger: 'blur' } |
||||
], |
||||
clientId: [ |
||||
{ required: true, message: '请选择客户名称', trigger: 'change' }, |
||||
] |
||||
}, |
||||
userData:[], |
||||
keyword: '', |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 0, |
||||
multipleSelection: [], |
||||
clientList: [], |
||||
isAdd: true, |
||||
isDetail: false, |
||||
userVisible: false, |
||||
searchTimer: null, |
||||
curRow: {}, |
||||
accountRepeat: false, |
||||
uploadList: [], |
||||
importVisible: false, |
||||
uploadFaild: false, |
||||
token: '', |
||||
originalAccount: '', |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
computed: { |
||||
...mapState('layout', [ |
||||
'isIE' |
||||
]) |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
this.getClient() |
||||
}, |
||||
methods: { |
||||
...mapActions('common', [ |
||||
'getRole' |
||||
]), |
||||
getData() { |
||||
let data = { |
||||
searchContent: this.keyword, |
||||
current: this.pageNo, |
||||
pageSize: this.pageSize |
||||
} |
||||
this.$get(`${this.api.queryUser}/${this.pageNo}/${this.pageSize}`,data).then(res => { |
||||
this.userData = res.data.list |
||||
this.totals = res.data.total |
||||
}).catch(res => {}); |
||||
}, |
||||
accountChange(){ |
||||
if(this.form.account !== this.originalAccount){ |
||||
this.$get(`${this.api.getAccount}?account=${this.form.account}`).then(res => { |
||||
if(res.data.userInfo){ |
||||
this.accountRepeat = true |
||||
this.$message.warning('该账号已存在') |
||||
}else{ |
||||
this.accountRepeat = false |
||||
} |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.accountRepeat = false |
||||
} |
||||
}, |
||||
getClient(){ |
||||
let data = { |
||||
searchContent: '', |
||||
provinceId: '', |
||||
cityId: '' |
||||
} |
||||
this.$get(`${this.api.queryClient}/1/1000`,data).then(res => { |
||||
this.clientList = res.data.list |
||||
}).catch(res => {}); |
||||
}, |
||||
closeTeacher(){ |
||||
this.$refs.form.clearValidate() |
||||
this.form = { |
||||
id: '', |
||||
name: '', |
||||
account: '', |
||||
roleValue: ['超级管理员'], |
||||
clientId: '', |
||||
clientName: '' |
||||
} |
||||
this.curRow = {} |
||||
}, |
||||
currentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
adduser(){ |
||||
this.isDetail = false |
||||
this.isAdd = true |
||||
this.userVisible = true |
||||
}, |
||||
fillForm(row){ |
||||
this.form.id = row.id |
||||
this.form.userId = row.userId |
||||
this.form.account = row.account |
||||
this.originalAccount = Number(row.account) |
||||
this.form.name = row.name |
||||
this.form.clientId = row.clientId |
||||
this.form.clientName = row.clientName |
||||
this.userVisible = true |
||||
}, |
||||
show(row){ |
||||
this.isDetail = true |
||||
this.isAdd = false |
||||
this.fillForm(row) |
||||
}, |
||||
edit(row){ |
||||
this.isDetail = false |
||||
this.isAdd = false |
||||
this.fillForm(row) |
||||
}, |
||||
saveData() { |
||||
this.$refs.form.validate((valid) => { |
||||
if (valid) { |
||||
if(this.accountRepeat) return this.$message.warning('该账号已存在') |
||||
this.form.clientName = this.clientList.find(n => n.id == this.form.clientId).clientName |
||||
let form = this.form |
||||
let data = { |
||||
userInfo: { |
||||
id: form.id, |
||||
isPort: 1, |
||||
userId: form.userId, |
||||
account: form.account, |
||||
clientId: form.clientId, |
||||
clientName: form.clientName, |
||||
creationTime: this.formatDate(new Date().getTime()), |
||||
roleId: 1, |
||||
uniqueIdentificationAccount: new Date().getTime(), |
||||
userName: form.name, |
||||
}, |
||||
userManagement: { |
||||
id: form.id, |
||||
isPort: 1, |
||||
userId: form.userId, |
||||
account: form.account, |
||||
clientId: form.clientId, |
||||
clientName: form.clientName, |
||||
name: form.name, |
||||
roleId: 1, |
||||
} |
||||
} |
||||
if(this.form.id) { |
||||
this.$post(this.api.updateUser,data).then(res => { |
||||
if(res.success) { |
||||
this.$message.success('修改成功'); |
||||
this.userVisible = false |
||||
this.getData() |
||||
}else{ |
||||
this.$message.error(res.message); |
||||
} |
||||
}).catch(res => {}); |
||||
}else{ |
||||
this.$post(this.api.addUser,data).then(res => { |
||||
if(res.success) { |
||||
this.$message.success('新增成功'); |
||||
this.userVisible = false |
||||
this.getData() |
||||
}else{ |
||||
this.$message.error(res.message); |
||||
} |
||||
}).catch(res => {}); |
||||
} |
||||
}else{ |
||||
return false; |
||||
} |
||||
}) |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteUser}?userIds=${row.id}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
resetPassword(row){ |
||||
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', { |
||||
}).then(() => { |
||||
let data = { |
||||
userId: row.userId, |
||||
password: Setting.initialPassword |
||||
} |
||||
this.$post(this.api.userinfoUpdate,data).then(res => { |
||||
if(res.success){ |
||||
this.$message.success('重置成功') |
||||
}else{ |
||||
this.$message.error('重置失败') |
||||
} |
||||
}).catch(res => {}); |
||||
}).catch(() => { |
||||
}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.userId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
// 批量删除 |
||||
this.$confirm('确定要删除选中用户吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteUser}?userIds=${delList.join(',')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据 !'); |
||||
} |
||||
}, |
||||
|
||||
batchImport(){ |
||||
this.importVisible = true |
||||
this.uploadList = [] |
||||
this.uploadFaild = false |
||||
}, |
||||
handleExceed(files, fileList) { |
||||
this.$message.warning( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
); |
||||
}, |
||||
downLoad(){ |
||||
location.href = this.api.downloadUserTemp |
||||
}, |
||||
showFaild(){ |
||||
location.href = `${this.api.exportFailureUser}?token=${this.token}` |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.uploadFaild = false |
||||
if(res.success){ |
||||
if(res.data.data.token){ |
||||
this.token = res.data.data.token |
||||
this.uploadFaild = true |
||||
}else{ |
||||
this.$message.success('上传成功') |
||||
} |
||||
}else{ |
||||
res.data.message ? this.$message.error(res.data.message) : this.$message.error('上传失败,请检查数据') |
||||
} |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}); |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
this.uploadFaild = false |
||||
}, |
||||
uploadSure(){ |
||||
this.importVisible = false |
||||
this.pageNo = 1 |
||||
this.keyword = '' |
||||
this.getData() |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
@ -0,0 +1,26 @@ |
||||
/** |
||||
* @description 鉴权指令 |
||||
* 当传入的权限当前用户没有时,会移除该组件 |
||||
* 用例:<Tag v-auth">text</Tag> 或者:<Tag v-auth="'user:编辑'">text</Tag> |
||||
* */ |
||||
import store from '@/store'; |
||||
|
||||
export default { |
||||
inserted (el, binding, vnode) { |
||||
let btnText = '' |
||||
if(binding.value){ |
||||
btnText = binding.value |
||||
}else{ |
||||
btnText = `${vnode.context.$route.name}:${el.innerText}` |
||||
} |
||||
const btnPermissions = store.state.btnPermissions; |
||||
// console.log(22,btnText,btnPermissions)
|
||||
|
||||
if (btnText && btnPermissions && btnPermissions.length) { |
||||
const isPermission = btnPermissions.includes(btnText); |
||||
if (!isPermission) { |
||||
el.parentNode && el.parentNode.removeChild(el); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
/** |
||||
* 插件 |
||||
* */ |
||||
|
||||
// 鉴权指令
|
||||
import directiveAuth from '@/plugins/auth'; |
||||
import throttle from '@/plugins/throttle'; |
||||
|
||||
export default { |
||||
async install (Vue, options) { |
||||
// 指令
|
||||
Vue.directive('auth', directiveAuth); |
||||
Vue.directive('throttle', throttle); |
||||
} |
||||
} |
@ -0,0 +1,163 @@ |
||||
import axios from 'axios'; |
||||
import QS from 'qs'; |
||||
// import store from '../store/index'
|
||||
import { Message } from 'element-ui' |
||||
import router from '@/router/index' |
||||
import Setting from '@/setting' |
||||
|
||||
const service = axios.create({ |
||||
baseURL: Setting.apiBaseURL, |
||||
timeout: 5000 |
||||
}) |
||||
|
||||
// post请求头
|
||||
service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'; |
||||
|
||||
// 请求拦截器
|
||||
// service.interceptors.request.use(config => {
|
||||
// if (sessionStorage.getItem('token')) {
|
||||
// // 存在将token写入 request header
|
||||
// config.headers.Authorization = `${sessionStorage.getItem('token')}`;
|
||||
// }
|
||||
// return config;
|
||||
// }, err => {
|
||||
// Message.error({
|
||||
// message: '退出登陆',
|
||||
// onClose: function () {
|
||||
// router.push({name: 'login'});
|
||||
// }
|
||||
// })
|
||||
// return Promise.reject(err);
|
||||
// })
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use( |
||||
response => { |
||||
const res = response.data |
||||
if (res.success) { |
||||
return Promise.resolve(res).catch(e => {}) |
||||
} else { |
||||
switch (res.code) { |
||||
case 201: |
||||
Message.error(res.message) |
||||
break; |
||||
default: |
||||
Promise.reject(res).catch(e => {}) |
||||
} |
||||
return Promise.reject(res).catch(e => {}) |
||||
} |
||||
}, |
||||
// 服务器状态码不是200的情况
|
||||
error => { |
||||
if (error.res.status) { |
||||
switch (error.res.status) { |
||||
// 401: 未登录
|
||||
// 未登录则跳转登录页面,并携带当前页面的路径
|
||||
// 在登录成功后返回当前页面,这一步需要在登录页操作。
|
||||
case 500: |
||||
router.replace({ |
||||
path: '/login', |
||||
// query: { redirect: router.currentRoute.fullPath }
|
||||
}); |
||||
break; |
||||
// 403 token过期
|
||||
// 登录过期对用户进行提示
|
||||
// 清除本地token和清空vuex中token对象
|
||||
// 跳转登录页面
|
||||
case 403: |
||||
// Toast({
|
||||
// message: '登录过期,请重新登录',
|
||||
// duration: 1000,
|
||||
// forbidClick: true
|
||||
// });
|
||||
// 清除token
|
||||
// store.commit('loginSuccess', null);
|
||||
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
|
||||
setTimeout(() => { |
||||
router.replace({ |
||||
path: '/login', |
||||
query: { |
||||
redirect: router.currentRoute.fullPath |
||||
} |
||||
}); |
||||
}, 1000); |
||||
break; |
||||
// 404请求不存在
|
||||
case 404: |
||||
router.replace({ |
||||
path: '/404', |
||||
}); |
||||
break; |
||||
// 其他错误,直接抛出错误提示
|
||||
default: |
||||
Promise.reject(res) |
||||
} |
||||
return Promise.reject(error.res); |
||||
} |
||||
} |
||||
); |
||||
|
||||
function get(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.get(url, {params: params}) |
||||
.then(res => { |
||||
if(res){ |
||||
resolve(res) |
||||
}else{ |
||||
reject() |
||||
} |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
|
||||
function post(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.post(url,params) |
||||
.then(res => { |
||||
if(res){ |
||||
resolve(res) |
||||
}else{ |
||||
reject() |
||||
} |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
|
||||
function del(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.delete(url, { |
||||
params |
||||
}) |
||||
.then(res => { |
||||
if(res){ |
||||
resolve(res) |
||||
}else{ |
||||
reject() |
||||
} |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
|
||||
function put(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.put(url, { |
||||
params |
||||
}) |
||||
.then(res => { |
||||
if(res){ |
||||
resolve(res) |
||||
}else{ |
||||
reject() |
||||
} |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
export { get,post,del,put } |
@ -0,0 +1,18 @@ |
||||
/** |
||||
* @description 节流指令 |
||||
* 限制连续快速点击按钮 |
||||
* 用例:<Tag v-throttle>text</Tag> |
||||
* */ |
||||
|
||||
export default{ |
||||
inserted (el, binding, vnode) { |
||||
el.addEventListener('click', () => { |
||||
if (!el.disabled) { |
||||
el.disabled = true |
||||
setTimeout(() => { |
||||
el.disabled = false |
||||
}, binding.value || 1000) |
||||
} |
||||
}) |
||||
} |
||||
} |
@ -0,0 +1,28 @@ |
||||
import BasicLayout from '@/layouts/home'; |
||||
|
||||
const meta = {}; |
||||
|
||||
const pre = 'index-'; |
||||
|
||||
export default { |
||||
path: '/index', |
||||
name: 'index', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/client/list'), |
||||
meta: { title: '学校管理' } |
||||
},{ |
||||
name: `${pre}add`, |
||||
path: `add`, |
||||
component: () => import('@/pages/client/add'), |
||||
meta: { title: '新增客户' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home'; |
||||
|
||||
const meta = {}; |
||||
|
||||
const pre = 'quesBank-'; |
||||
|
||||
export default { |
||||
path: '/quesBank', |
||||
name: 'quesBank', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/quesBank/list'), |
||||
meta: { title: '题库管理' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home'; |
||||
|
||||
const meta = {}; |
||||
|
||||
const pre = 'setting-'; |
||||
|
||||
export default { |
||||
path: '/setting', |
||||
name: 'setting', |
||||
redirect: { |
||||
name: `${pre}person` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}person`, |
||||
path: `person`, |
||||
component: () => import('@/pages/setting/person'), |
||||
meta: { title: '个人中心' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home'; |
||||
|
||||
const meta = {}; |
||||
|
||||
const pre = 'system-'; |
||||
|
||||
export default { |
||||
path: '/system', |
||||
name: 'system', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/system/list'), |
||||
meta: { title: '系统管理' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home'; |
||||
|
||||
const meta = {}; |
||||
|
||||
const pre = 'user-'; |
||||
|
||||
export default { |
||||
path: '/user', |
||||
name: 'user', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/user/list'), |
||||
meta: { title: '用户管理' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,24 @@ |
||||
import router from './index'; |
||||
import util from '@/libs/util'; |
||||
import Setting from '@/setting'; |
||||
import generateRoutes from '@/libs/route/generateRoutes'; |
||||
import bus from '@/libs/bus'; |
||||
|
||||
router.beforeEach((to, from, next) => { |
||||
document.title = to.meta.title ? `${to.meta.title} | ${Setting.titleSuffix}` : Setting.titleSuffix; |
||||
const role = util.session.get(Setting.usernameKey); |
||||
if (!role && to.path !== '/login') { |
||||
next('/login'); |
||||
} else if(role && to.path == '/login') { |
||||
next('/index') |
||||
} else { |
||||
if(to.meta.sidebar){ |
||||
bus.$emit('showMenu', true) |
||||
}else{ |
||||
bus.$emit('showMenu', false) |
||||
} |
||||
next(); |
||||
} |
||||
}); |
||||
|
||||
Setting.dynamicRoute && generateRoutes() |
@ -0,0 +1,74 @@ |
||||
import client from './modules/client'; |
||||
import user from './modules/user'; |
||||
import quesBank from './modules/quesBank'; |
||||
import system from './modules/system'; |
||||
import setting from './modules/setting'; |
||||
|
||||
import BasicLayout from '@/layouts/home'; |
||||
|
||||
/** |
||||
* 在主框架内显示 |
||||
*/ |
||||
|
||||
const frameIn = [ |
||||
{ |
||||
path: '/', |
||||
component: () => BasicLayout, |
||||
meta: { title: '首页' }, |
||||
children: [] |
||||
}, |
||||
client, |
||||
user, |
||||
quesBank, |
||||
system, |
||||
setting, |
||||
] |
||||
|
||||
/** |
||||
* 在主框架之外显示 |
||||
*/ |
||||
|
||||
const frameOut = [ |
||||
// 登录
|
||||
{ |
||||
path: '/login', |
||||
name: 'login', |
||||
meta: { |
||||
title: '登录' |
||||
}, |
||||
component: () => import('@/pages/account/login') |
||||
} |
||||
]; |
||||
|
||||
/** |
||||
* 错误页面 |
||||
*/ |
||||
|
||||
const errorPage = [ |
||||
{ |
||||
path: '/403', |
||||
name: '403', |
||||
meta: { |
||||
title: '403' |
||||
}, |
||||
component: () => import('@/pages/exception/error/403') |
||||
}, |
||||
{ |
||||
path: '*', |
||||
name: '404', |
||||
meta: { |
||||
title: '404' |
||||
}, |
||||
component: () => import('@/pages/exception/error/404') |
||||
} |
||||
]; |
||||
|
||||
// 导出需要显示菜单的
|
||||
export const frameInRoutes = frameIn; |
||||
|
||||
// 重新组织后导出
|
||||
export default [ |
||||
...frameIn, |
||||
...frameOut, |
||||
...errorPage |
||||
]; |
@ -0,0 +1,21 @@ |
||||
/** |
||||
* 开发配置 |
||||
* */ |
||||
|
||||
const env = process.env.NODE_ENV; |
||||
|
||||
const Setting = { |
||||
// 是否使用 Mock 的数据,默认 开发环境为 true,生产环境为 false
|
||||
isMock: true, |
||||
// 部署应用包时的基本 URL
|
||||
publicPath: env === 'development' ? './' : '', |
||||
// 生产环境构建文件的目录名
|
||||
outputDir: 'dist', |
||||
// 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
|
||||
assetsDir: 'static', |
||||
// 开发环境每次保存时 lint 代码,会将 lint 错误输出为编译警告
|
||||
// true || false || error
|
||||
lintOnSave: true, |
||||
}; |
||||
|
||||
module.exports = Setting; |
@ -0,0 +1,115 @@ |
||||
/** |
||||
* 业务配置 |
||||
* */ |
||||
|
||||
const env = process.env.NODE_ENV; |
||||
|
||||
const Setting = { |
||||
/** |
||||
* 基础配置 |
||||
* */ |
||||
// 网页标题的后缀
|
||||
titleSuffix: '电子竞技数字化考试系统-企业端', |
||||
// 路由模式,可选值为 history 或 hash
|
||||
routerMode: 'hash', |
||||
// 页面切换时,是否显示模拟的进度条
|
||||
showProgressBar: true, |
||||
// 接口请求地址
|
||||
apiBaseURL: env === 'development' ? 'http://39.108.250.202:8000' : 'http://39.108.250.202:8000', |
||||
// 接口请求返回错误时,弹窗的持续时间,单位:秒
|
||||
modalDuration: 3, |
||||
// 接口请求返回错误时,弹窗的类型,可选值为 Message 或 Notice
|
||||
errorModalType: 'Message', |
||||
// Cookies 默认保存时间,单位:天
|
||||
cookiesExpires: 1, |
||||
/** |
||||
* sessionStorage里state的key |
||||
*/ |
||||
storeKey: 'exa_ent_store', |
||||
/** |
||||
* sessionStorage里username的key |
||||
*/ |
||||
usernameKey: 'exa_ent_username', |
||||
/** |
||||
* 默认密码 |
||||
*/ |
||||
initialPassword: '111aaa', |
||||
/** |
||||
* 多语言配置 |
||||
* */ |
||||
i18n: { |
||||
// 默认语言
|
||||
default: 'zh', |
||||
// 是否根据用户电脑配置自动设置语言(仅第一次有效)
|
||||
auto: false |
||||
}, |
||||
/** |
||||
* 布局配置 |
||||
* */ |
||||
// 侧边菜单宽度,单位 px,不可动态修改,需与 setting.less 的 @menuSideWidth 保持一致
|
||||
menuSideWidth: 256, |
||||
layout: { |
||||
// 需要隐藏顶栏的页面路径
|
||||
hideNavList: [], |
||||
// 侧边栏风格,可选值为 dark 或 light
|
||||
siderTheme: 'dark', |
||||
// 顶栏风格,可选值为 light、dark 或 primary
|
||||
headerTheme: 'light', |
||||
// 顶栏是否置顶,开启后会覆盖侧边栏,需开启 headerFix
|
||||
headerStick: false, |
||||
// 是否开启多 Tabs 页签
|
||||
tabs: true, |
||||
// 多 Tabs 页签是否显示图标,开启 tabs 时有效
|
||||
showTabsIcon: true, |
||||
// 是否固定多 Tabs 多页签
|
||||
tabsFix: true, |
||||
// 是否固定侧边栏
|
||||
siderFix: true, |
||||
// 是否固定顶栏
|
||||
headerFix: true, |
||||
// 是否在下滑时隐藏顶栏,需开启 headerFix,如果开启了 tabsFix,Tabs 也会被隐藏
|
||||
headerHide: false, |
||||
// 是否显示顶部菜单栏
|
||||
// 一般来说,侧边的菜单栏足以满足大部分业务,如需动态切换侧边栏,可开启此选项启用顶部一级菜单,此时侧边栏将作为二级菜单
|
||||
headerMenu: false, |
||||
// 侧边菜单栏是否开启手风琴模式
|
||||
menuAccordion: true, |
||||
// 是否显示折叠侧边栏按钮,移动端下会自动强制开启
|
||||
showSiderCollapse: true, |
||||
// 侧边菜单栏是否默认折起
|
||||
menuCollapse: false, |
||||
// 侧边菜单折起时,是否在子菜单前显示父级菜单名称
|
||||
showCollapseMenuTitle: false, |
||||
// 是否显示重载按钮
|
||||
showReload: true, |
||||
// 是否显示搜索
|
||||
showSearch: true, |
||||
// 是否显示通知
|
||||
showNotice: true, |
||||
// 是否显示全屏
|
||||
showFullscreen: true, |
||||
// 在手机访问时,是否在顶部显示小尺寸 logo
|
||||
showMobileLogo: true, |
||||
// 是否显示全局面包屑,开启 headerMenu 时不可用
|
||||
showBreadcrumb: true, |
||||
// 全局面包屑是否显示图标,开启 showBreadcrumb 时有效
|
||||
showBreadcrumbIcon: false, |
||||
// 是否显示日志入口,开启与否,不影响日志记录,如不希望用户看到可关闭
|
||||
showLog: true, |
||||
// 是否显示多语言
|
||||
showI18n: true, |
||||
// 是否支持动态修改布局配置,移动端下会自动强制关闭
|
||||
enableSetting: true, |
||||
// 退出登录时,是否二次确认
|
||||
logoutConfirm: true |
||||
}, |
||||
/** |
||||
* 功能配置 |
||||
* */ |
||||
// 相同路由,不同参数间进行切换,是否强力更新
|
||||
sameRouteForceUpdate: false, |
||||
// 是否使用动态路由
|
||||
dynamicRoute: false |
||||
}; |
||||
|
||||
export default Setting; |
@ -0,0 +1,10 @@ |
||||
const getters = { |
||||
userId: state => state.user.info.userId, |
||||
roleId: state => state.user.info.roleId, |
||||
userName: state => state.user.info.userName, |
||||
account: state => state.user.info.account, |
||||
phone: state => state.user.info.phone, |
||||
clientId: state => state.user.info.clientId, |
||||
clientName: state => state.user.info.clientName, |
||||
} |
||||
export default getters |
@ -0,0 +1,25 @@ |
||||
import Vue from 'vue'; |
||||
import Vuex from 'vuex'; |
||||
import getters from './getters' |
||||
|
||||
Vue.use(Vuex); |
||||
|
||||
// https://webpack.js.org/guides/dependency-management/#requirecontext
|
||||
const modulesFiles = require.context('./modules', true, /\.js$/) |
||||
|
||||
// you do not need `import app from './modules/app'`
|
||||
// it will auto require all vuex module from modules file
|
||||
const modules = modulesFiles.keys().reduce((modules, modulePath) => { |
||||
// set './app.js' => 'app'
|
||||
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') |
||||
const value = modulesFiles(modulePath) |
||||
modules[moduleName] = value.default |
||||
return modules |
||||
}, {}) |
||||
|
||||
const store = new Vuex.Store({ |
||||
modules, |
||||
getters |
||||
}) |
||||
|
||||
export default store |
@ -0,0 +1,19 @@ |
||||
/** |
||||
* 客户管理 |
||||
* */ |
||||
export default { |
||||
namespaced: true, |
||||
state: { |
||||
provinceList: [] |
||||
}, |
||||
mutations: { |
||||
SET_PROVINCE: (state, provinceList) => { |
||||
state.provinceList = provinceList |
||||
}, |
||||
}, |
||||
actions: { |
||||
setProvince({ commit, state, dispatch },provinceList) { |
||||
commit('SET_PROVINCE',provinceList) |
||||
}, |
||||
} |
||||
} |