Compare commits
178 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c84fca443 | ||
|
|
e89b752667 | ||
|
|
3739071bd6 | ||
|
|
2c876a2a11 | ||
|
|
d2f0af59b1 | ||
|
|
543afadea4 | ||
|
|
95290a4ecb | ||
|
|
8089e8b193 | ||
|
|
9e874e9b5f | ||
|
|
66e24cfea0 | ||
|
|
170d309978 | ||
|
|
1f09f74e61 | ||
|
|
9edc5df08d | ||
|
|
7ea91bebb6 | ||
|
|
ba00fd21ed | ||
|
|
d4736aaa77 | ||
|
|
13ddb22e1c | ||
|
|
65c85de7ec | ||
|
|
97383cc86f | ||
|
|
eedf463e8e | ||
|
|
f339e2a5d8 | ||
|
|
6dc44b74a4 | ||
|
|
3b84681c4b | ||
|
|
97c8066dbb | ||
|
|
18437610b7 | ||
|
|
ea203cfa10 | ||
|
|
11662dcd46 | ||
|
|
792c05306a | ||
|
|
20af998dfe | ||
|
|
159e24537f | ||
|
|
5a71ef7e0d | ||
|
|
972cb5f85f | ||
|
|
f0c82679bf | ||
|
|
4c50a23279 | ||
|
|
0551231c45 | ||
|
|
f744856aff | ||
|
|
dd112fec77 | ||
|
|
456f5e4a5c | ||
|
|
97201b84df | ||
|
|
e4e72887ba | ||
|
|
5362555d06 | ||
|
|
5c501a048a | ||
|
|
de479a837b | ||
|
|
35775bb798 | ||
|
|
f3650cd8f8 | ||
|
|
07a3c94e4f | ||
|
|
cd0f9e9628 | ||
|
|
dd5a6c4bb5 | ||
|
|
f7edbf1f05 | ||
|
|
fa1ce408d4 | ||
|
|
6d606f855e | ||
|
|
f89361f5f7 | ||
|
|
bf2d89dc1a | ||
|
|
1729cf896e | ||
|
|
a033c4592d | ||
|
|
b1bb76f607 | ||
|
|
ea5ac0476e | ||
|
|
54bbf6d1fb | ||
|
|
183c0c5acf | ||
|
|
18228ef862 | ||
|
|
fa8b8bcc22 | ||
|
|
27e01670ba | ||
|
|
6ffcc5435f | ||
|
|
325c8652d2 | ||
|
|
d75f006641 | ||
|
|
2a38d50e88 | ||
|
|
ff0aa185f1 | ||
|
|
92b292aa05 | ||
|
|
fdaa75d5a4 | ||
|
|
bbb6f45f39 | ||
|
|
b67b0d272d | ||
|
|
2b1ea1e7a2 | ||
|
|
dbf21b3aff | ||
|
|
73d312f873 | ||
|
|
a7c03882f4 | ||
|
|
5cc21ac695 | ||
|
|
0a54c2301a | ||
|
|
9568c9a777 | ||
|
|
197d557e87 | ||
|
|
d508df1cc1 | ||
|
|
ed9df3b2ff | ||
|
|
5c82de2403 | ||
|
|
7a1b10291e | ||
|
|
842d37d80d | ||
|
|
5c013311e8 | ||
|
|
bfb9fe84b1 | ||
|
|
6bf9906b27 | ||
|
|
b656275d7b | ||
|
|
231171c5b3 | ||
|
|
c623b13d0b | ||
|
|
07930da9e2 | ||
|
|
1e8e332a71 | ||
|
|
7f8b593128 | ||
|
|
64c577430e | ||
|
|
55acfe0fdc | ||
|
|
e5e9ff4471 | ||
|
|
ea0a8a4efc | ||
|
|
09cc9f9cdf | ||
|
|
25c4435c50 | ||
|
|
7b0422f829 | ||
|
|
58b3b28c36 | ||
|
|
82fc65e9e2 | ||
|
|
e9805a1b77 | ||
|
|
6ef98efb60 | ||
|
|
94783d9fc6 | ||
|
|
2fea143bd9 | ||
|
|
ad1002a06b | ||
|
|
9b90e37dcd | ||
|
|
4e91ae792d | ||
|
|
f904fa7641 | ||
|
|
82c0d2156e | ||
|
|
072a20c9fc | ||
|
|
c3ed96296f | ||
|
|
6bade995fe | ||
|
|
0c81b66cd9 | ||
|
|
a0cfe3084e | ||
|
|
e11383a425 | ||
|
|
9321d8c6c3 | ||
|
|
260f435d0e | ||
|
|
862d809708 | ||
|
|
fa1193a86e | ||
|
|
7523925106 | ||
|
|
4fb81774c7 | ||
|
|
4f1af630d1 | ||
|
|
b8d030fa38 | ||
|
|
d6d2cf87a5 | ||
|
|
06f1f53dad | ||
|
|
337794ee6f | ||
|
|
31c465972e | ||
|
|
a9cf39a336 | ||
|
|
bfb8ca4c4d | ||
|
|
7b8cc4c9ba | ||
|
|
1ff0d86f95 | ||
|
|
cede3cf12a | ||
|
|
4ad591131e | ||
|
|
d646e9a531 | ||
|
|
6ed6bec8b3 | ||
|
|
e34fe60bb5 | ||
|
|
6597befc68 | ||
|
|
12be6a4f2c | ||
|
|
1ef9ab619d | ||
|
|
6089399de5 | ||
|
|
1cecb3cfb4 | ||
|
|
79319b292b | ||
|
|
c9fd78ee30 | ||
|
|
0a50a26be3 | ||
|
|
cc52edefd1 | ||
|
|
b458cd0736 | ||
|
|
2c60f27175 | ||
|
|
5bd03ab67f | ||
|
|
b0f0a6e130 | ||
|
|
76c5bf588e | ||
|
|
035167e508 | ||
|
|
3655497ace | ||
|
|
36ca073c81 | ||
|
|
16b4dfa6c0 | ||
|
|
084818431a | ||
|
|
e7ebdb71ee | ||
|
|
1bac787019 | ||
|
|
6517e00b69 | ||
|
|
fa12a2ec18 | ||
|
|
732b6ed1db | ||
|
|
1dc8c34504 | ||
|
|
770798ee71 | ||
|
|
14ec29e4c5 | ||
|
|
07bee16eee | ||
|
|
035f28b63b | ||
|
|
9aa26a9996 | ||
|
|
b423fbeebc | ||
|
|
5efa89e2e4 | ||
|
|
4e5520ba25 | ||
|
|
3f51dc143e | ||
|
|
ea256201f5 | ||
|
|
74db4fb6e1 | ||
|
|
7a37201b69 | ||
|
|
c0e8d19035 | ||
|
|
cd75c09c2e | ||
|
|
fac3078d8d |
@@ -1,7 +1,7 @@
|
||||
ENV = 'development'
|
||||
|
||||
# 接口地址
|
||||
VUE_APP_BASE_API = 'http://localhost:8000'
|
||||
VUE_APP_BASE_API = 'https://eladmin.vip'
|
||||
VUE_APP_WS_API = 'ws://localhost:8000'
|
||||
|
||||
# 是否启用 babel-plugin-dynamic-import-node插件
|
||||
|
||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
||||
|
||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||
VUE_APP_BASE_API = 'https://eladmin.vip'
|
||||
VUE_APP_BASE_API = '/'
|
||||
# 如果接口是 http 形式, wss 需要改为 ws
|
||||
VUE_APP_WS_API = 'wss://eladmin.vip'
|
||||
VUE_APP_WS_API = '/'
|
||||
|
||||
71
README.md
71
README.md
@@ -1,70 +1,7 @@
|
||||
# ELADMIN-WEB
|
||||
# 注意
|
||||
|
||||
ELADMIN 前端源码
|
||||
该分支仅用于 预览服务器 Jenkins 自动部署
|
||||
|
||||
#### 项目源码
|
||||
# 请勿使用该分支进行开发
|
||||
|
||||
| | 后端源码 | 前端源码 |
|
||||
|--- |--- | --- |
|
||||
| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-web |
|
||||
| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-web |
|
||||
|
||||
#### 开发文档
|
||||
[https://eladmin.vip](https://eladmin.vip)
|
||||
|
||||
#### 体验地址
|
||||
[https://eladmin.vip/demo](https://eladmin.vip/demo)
|
||||
|
||||
#### 前端模板
|
||||
|
||||
初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
|
||||
|
||||
模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
|
||||
|
||||
#### Build Setup
|
||||
**推荐 node 版本:12-16**
|
||||
``` bash
|
||||
# 配置镜像加速
|
||||
https://www.ydyno.com/archives/1219.html
|
||||
|
||||
# 安装依赖
|
||||
npm install
|
||||
|
||||
# 启动服务 localhost:8013
|
||||
npm run dev
|
||||
|
||||
# 构建生产环境
|
||||
npm run build:prod
|
||||
```
|
||||
|
||||
#### 常见问题
|
||||
|
||||
1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
|
||||
|
||||
解决方案:
|
||||
```
|
||||
1. 单独安装:npm install --unsafe-perm node-sass
|
||||
2. 直接使用:npm install --unsafe-perm
|
||||
```
|
||||
|
||||
2、加速node-sass安装
|
||||
|
||||
https://www.ydyno.com/archives/1219.html
|
||||
|
||||
#### 特别鸣谢
|
||||
|
||||
- 感谢 [JetBrains](https://www.jetbrains.com/) 提供的非商业开源软件开发授权
|
||||
|
||||
- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
|
||||
|
||||
- 感谢 [Moxun](https://github.com/moxun1639) 大佬提供的前端 Crud 通用组件
|
||||
|
||||
- 感谢 [zhy6599](https://gitee.com/zhy6599) 大佬提供的后端运维管理相关功能
|
||||
|
||||
- 感谢 [j.yao.SUSE](https://github.com/everhopingandwaiting) 大佬提供的匿名接口与Redis限流等功能
|
||||
|
||||
- 感谢 [d15801543974](https://github.com/d15801543974) 大佬提供的基于注解的通用查询方式
|
||||
|
||||
#### 反馈交流
|
||||
|
||||
- QQ交流群:891137268 、947578238、659622532
|
||||
# 开发请选择 master 分支
|
||||
@@ -6,7 +6,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:prod": "vue-cli-service build --max_old_space_size=8096",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
@@ -36,7 +36,7 @@
|
||||
"@riophae/vue-treeselect": "^0.4.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^1.0.2",
|
||||
"axios": "^0.21.1",
|
||||
"axios": "^1.6.0",
|
||||
"clipboard": "2.0.4",
|
||||
"codemirror": "^5.49.2",
|
||||
"core-js": "^2.6.12",
|
||||
@@ -66,8 +66,7 @@
|
||||
"vuedraggable": "2.20.0",
|
||||
"vuex": "3.1.0",
|
||||
"wangeditor": "^4.7.11",
|
||||
"webpack": "^4.46.0",
|
||||
"xlsx": "^0.18.5"
|
||||
"webpack": "^4.46.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/parser": "^7.7.4",
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta base="/demo/">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<link href="<%= BASE_URL %>favicon.ico" rel="icon">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
|
||||
Allow: /
|
||||
|
||||
@@ -8,10 +8,11 @@ export function getDepts(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getDeptSuperior(ids) {
|
||||
export function getDeptSuperior(ids, exclude) {
|
||||
exclude = exclude !== undefined ? exclude : false
|
||||
const data = ids.length || ids.length === 0 ? ids : Array.of(ids)
|
||||
return request({
|
||||
url: 'api/dept/superior',
|
||||
url: 'api/dept/superior?exclude=' + exclude,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
||||
@@ -45,6 +45,14 @@ export function updatePass(user) {
|
||||
})
|
||||
}
|
||||
|
||||
export function resetPwd(ids) {
|
||||
return request({
|
||||
url: 'api/users/resetPwd',
|
||||
method: 'put',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function updateEmail(form) {
|
||||
const data = {
|
||||
password: encrypt(form.pass),
|
||||
@@ -57,5 +65,5 @@ export function updateEmail(form) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export default { add, edit, del, resetPwd }
|
||||
|
||||
|
||||
1
src/assets/icons/svg/vps.svg
Normal file
1
src/assets/icons/svg/vps.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1690351561879" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10676" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M832 320H362.666667c-46.933333 0-85.333333 38.4-85.333334 85.333333v298.666667c0 46.933333 38.4 85.333333 85.333334 85.333333h149.333333l-21.333333 64h-74.666667c-17.066667 0-32 14.933333-32 32s14.933333 32 32 32h362.666667c17.066667 0 32-14.933333 32-32s-14.933333-32-32-32H704l-21.333333-64h149.333333c46.933333 0 85.333333-38.4 85.333333-85.333333V405.333333c0-46.933333-38.4-85.333333-85.333333-85.333333z" p-id="10677" fill="#bfbfbf"></path><path d="M320 885.333333c0-12.8 2.133333-25.6 6.4-36.266666-64-14.933333-113.066667-74.666667-113.066667-145.066667V405.333333c0-83.2 66.133333-149.333333 149.333334-149.333333h170.666666V192c0-46.933333-38.4-85.333333-85.333333-85.333333H192C145.066667 106.666667 106.666667 145.066667 106.666667 192v640c0 46.933333 38.4 85.333333 85.333333 85.333333h134.4c-4.266667-10.666667-6.4-21.333333-6.4-32z" p-id="10678" fill="#bfbfbf"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/images/background.jpeg
Normal file
BIN
src/assets/images/background.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 236 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 152 KiB |
@@ -207,3 +207,81 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-container-ad {
|
||||
transition: width 0.28s;
|
||||
width: $sideBarWidth !important;
|
||||
background-color: $menuBg;
|
||||
height: 30%;
|
||||
position: fixed;
|
||||
font-size: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1001;
|
||||
overflow: hidden;
|
||||
|
||||
// reset element-ui css
|
||||
.horizontal-collapse-transition {
|
||||
transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
|
||||
}
|
||||
|
||||
.scrollbar-wrapper {
|
||||
overflow-x: hidden !important;
|
||||
}
|
||||
|
||||
.el-scrollbar__bar.is-vertical {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.el-scrollbar {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
&.has-logo {
|
||||
.el-scrollbar {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
}
|
||||
|
||||
.is-horizontal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.svg-icon {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
border: none;
|
||||
height: 100%;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
// menu hover
|
||||
.submenu-title-noDropdown,
|
||||
.el-submenu__title {
|
||||
&:hover {
|
||||
background-color: $menuHover !important;
|
||||
}
|
||||
}
|
||||
|
||||
.is-active>.el-submenu__title {
|
||||
color: $subMenuActiveText !important;
|
||||
}
|
||||
|
||||
& .nest-menu .el-submenu>.el-submenu__title,
|
||||
& .el-submenu .el-menu-item {
|
||||
min-width: $sideBarWidth !important;
|
||||
background-color: $subMenuBg !important;
|
||||
|
||||
&:hover {
|
||||
background-color: $subMenuHover !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ function CRUD(options) {
|
||||
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
|
||||
sort: ['id,desc'],
|
||||
// 等待时间
|
||||
time: 50,
|
||||
time: 1,
|
||||
// CRUD Method
|
||||
crudMethod: {
|
||||
add: (form) => {},
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<input ref="excel-upload-input" class="excel-upload-input" type="file" accept=".xlsx, .xls" @change="handleClick">
|
||||
<div class="drop" @drop="handleDrop" @dragover="handleDragover" @dragenter="handleDragover">
|
||||
拖拽excel文件到此处 或者
|
||||
<el-button :loading="loading" style="margin-left:16px;" size="mini" type="primary" @click="handleUpload">
|
||||
浏览
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
beforeUpload: Function, // eslint-disable-line
|
||||
onSuccess: Function// eslint-disable-line
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
excelData: {
|
||||
header: null,
|
||||
results: null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
generateData({ header, results }) {
|
||||
this.excelData.header = header
|
||||
this.excelData.results = results
|
||||
this.onSuccess && this.onSuccess(this.excelData)
|
||||
},
|
||||
handleDrop(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
if (this.loading) return
|
||||
const files = e.dataTransfer.files
|
||||
if (files.length !== 1) {
|
||||
this.$message.error('只支持单个文件上传!')
|
||||
return
|
||||
}
|
||||
const rawFile = files[0]
|
||||
|
||||
if (!this.isExcel(rawFile)) {
|
||||
this.$message.error('只支持.xlsx, .xls, .csv 格式文件')
|
||||
return false
|
||||
}
|
||||
this.upload(rawFile)
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
},
|
||||
handleDragover(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
e.dataTransfer.dropEffect = 'copy'
|
||||
},
|
||||
handleUpload() {
|
||||
this.$refs['excel-upload-input'].click()
|
||||
},
|
||||
handleClick(e) {
|
||||
const files = e.target.files
|
||||
const rawFile = files[0] // only use files[0]
|
||||
if (!rawFile) return
|
||||
this.upload(rawFile)
|
||||
},
|
||||
upload(rawFile) {
|
||||
this.$refs['excel-upload-input'].value = null // fix can't select the same excel
|
||||
|
||||
if (!this.beforeUpload) {
|
||||
this.readerData(rawFile)
|
||||
return
|
||||
}
|
||||
const before = this.beforeUpload(rawFile)
|
||||
if (before) {
|
||||
this.readerData(rawFile)
|
||||
}
|
||||
},
|
||||
readerData(rawFile) {
|
||||
this.loading = true
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader()
|
||||
reader.onload = e => {
|
||||
const data = e.target.result
|
||||
const workbook = XLSX.read(data, { type: 'array' })
|
||||
const firstSheetName = workbook.SheetNames[0]
|
||||
const worksheet = workbook.Sheets[firstSheetName]
|
||||
const header = this.getHeaderRow(worksheet)
|
||||
const results = XLSX.utils.sheet_to_json(worksheet)
|
||||
this.generateData({ header, results })
|
||||
this.loading = false
|
||||
resolve()
|
||||
}
|
||||
reader.readAsArrayBuffer(rawFile)
|
||||
})
|
||||
},
|
||||
getHeaderRow(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r
|
||||
/* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
|
||||
/* find the cell in the first row */
|
||||
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
},
|
||||
isExcel(file) {
|
||||
return /\.(xlsx|xls|csv)$/.test(file.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.excel-upload-input{
|
||||
display: none;
|
||||
z-index: -9999;
|
||||
}
|
||||
.drop{
|
||||
border: 2px dashed #bbb;
|
||||
width: 600px;
|
||||
height: 160px;
|
||||
line-height: 160px;
|
||||
margin: 0 auto;
|
||||
font-size: 24px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
color: #bbb;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,6 @@
|
||||
<router-view :key="key" />
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<el-backtop :bottom="50" :right="40"><i class="el-icon-caret-top" /></el-backtop>
|
||||
<div v-if="$store.state.settings.showFooter" id="el-main-footer">
|
||||
<span v-html="$store.state.settings.footerTxt" />
|
||||
<span v-if="$store.state.settings.caseNumber"> ⋅ </span>
|
||||
|
||||
@@ -13,7 +13,7 @@ const whiteList = ['/login']// no redirect whitelist
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta.title) {
|
||||
document.title = to.meta.title + ' - ' + Config.title
|
||||
document.title = Config.title + ' - ' + to.meta.title
|
||||
}
|
||||
NProgress.start()
|
||||
if (getToken()) {
|
||||
|
||||
@@ -61,8 +61,9 @@ export const constantRouterMap = [
|
||||
]
|
||||
|
||||
export default new Router({
|
||||
// mode: 'hash',
|
||||
mode: 'history',
|
||||
mode: 'hash',
|
||||
base: '/demo/',
|
||||
// mode: 'history',
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRouterMap
|
||||
})
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<upload-excel-component :on-success="handleSuccess" :before-upload="beforeUpload" />
|
||||
<el-table :data="tableData" border highlight-current-row style="width: 100%;margin-top:20px;">
|
||||
<el-table-column v-for="item of tableHeader" :key="item" :prop="item" :label="item" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UploadExcelComponent from '@/components/UploadExcel/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'UploadExcel',
|
||||
components: { UploadExcelComponent },
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
tableHeader: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeUpload(file) {
|
||||
const isLt1M = file.size / 1024 / 1024 < 1
|
||||
if (isLt1M) {
|
||||
return true
|
||||
}
|
||||
|
||||
this.$message({
|
||||
message: '请不要上传大于1m的文件.',
|
||||
type: 'warning'
|
||||
})
|
||||
return false
|
||||
},
|
||||
handleSuccess({ results, header }) {
|
||||
this.tableData = results
|
||||
this.tableHeader = header
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -47,7 +47,7 @@ import Config from '@/settings'
|
||||
import { getCodeImg } from '@/api/login'
|
||||
import Cookies from 'js-cookie'
|
||||
import qs from 'qs'
|
||||
import Background from '@/assets/images/background.webp'
|
||||
import Background from '@/assets/images/background.jpeg'
|
||||
export default {
|
||||
name: 'Login',
|
||||
data() {
|
||||
|
||||
@@ -147,7 +147,7 @@ export default {
|
||||
})
|
||||
},
|
||||
initWebSocket() {
|
||||
const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'webSocket/deploy'
|
||||
const wsUri = process.env.VUE_APP_WS_API + '/webSocket/deploy'
|
||||
this.websock = new WebSocket(wsUri)
|
||||
this.websock.onerror = this.webSocketOnError
|
||||
this.websock.onmessage = this.webSocketOnMessage
|
||||
|
||||
@@ -161,10 +161,10 @@ export default {
|
||||
}
|
||||
},
|
||||
getSupDepts(id) {
|
||||
crudDept.getDeptSuperior(id).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
crudDept.getDeptSuperior(id, true).then(res => {
|
||||
const data = res.content
|
||||
this.buildDepts(data)
|
||||
this.depts = data
|
||||
})
|
||||
},
|
||||
buildDepts(depts) {
|
||||
|
||||
@@ -57,7 +57,19 @@
|
||||
</el-select>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation show="" :permission="permission" />
|
||||
<crudOperation show="" :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
v-permission="['admin','user:add']"
|
||||
:disabled="crud.selections.length === 0"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetPwd(crud.selections)"
|
||||
>重置密码
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
</div>
|
||||
<!--表单渲染-->
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="570px">
|
||||
@@ -471,6 +483,23 @@ export default {
|
||||
},
|
||||
checkboxT(row, rowIndex) {
|
||||
return row.id !== this.user.id
|
||||
},
|
||||
resetPwd(datas) {
|
||||
this.$confirm(`你选中了 ${datas.length} 位用户,确认重置用户的密码吗?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const ids = []
|
||||
datas.forEach(val => {
|
||||
ids.push(val.id)
|
||||
})
|
||||
console.log(ids)
|
||||
crudUser.resetPwd(ids).then(() => {
|
||||
this.crud.notify('重置成功, 用户新密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
:action="fileUploadApi + '?name=' + form.name"
|
||||
>
|
||||
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加文件</div>
|
||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
||||
<div slot="tip" class="el-upload__tip">请勿上传违法文件,演示环境带宽有限,限制文件大小小于50KB</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -145,10 +145,10 @@ export default {
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 / 1024 < 100
|
||||
isLt2M = file.size / 1024 < 52
|
||||
if (!isLt2M) {
|
||||
this.loading = false
|
||||
this.$message.error('上传文件大小不能超过 100MB!')
|
||||
this.$message.error('上传文件大小超出限制:50KB')
|
||||
}
|
||||
this.form.name = file.name
|
||||
return isLt2M
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:before-upload="beforeUpload"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:action="qiNiuUploadApi"
|
||||
@@ -39,7 +40,7 @@
|
||||
multiple
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
<div slot="tip" style="display: block;" class="el-upload__tip">请勿上传违法文件,且文件不超过15M</div>
|
||||
<div slot="tip" style="display: block;" class="el-upload__tip">请勿上传违法文件,演示环境带宽有限,限制文件大小小于50KB</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSubmit">确认</el-button>
|
||||
@@ -120,6 +121,15 @@ export default {
|
||||
_this.init()
|
||||
_this.dialog = true
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 < 52
|
||||
if (!isLt2M) {
|
||||
this.loading = false
|
||||
this.$message.error('上传文件大小超出限制:50KB')
|
||||
}
|
||||
return isLt2M
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const uid = file.uid
|
||||
const id = response.id
|
||||
|
||||
@@ -13,9 +13,8 @@ const port = 8013 // 端口配置
|
||||
// All configuration item explanations can be find in https://cli.vuejs.org/config/
|
||||
module.exports = {
|
||||
// hash 模式下可使用
|
||||
// publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
|
||||
publicPath: '/',
|
||||
outputDir: 'dist',
|
||||
publicPath: process.env.NODE_ENV === 'development' ? '/' : '/demo/',
|
||||
outputDir: 'demo',
|
||||
assetsDir: 'static',
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
productionSourceMap: false,
|
||||
|
||||
Reference in New Issue
Block a user