Compare commits
44 Commits
a7606b1f20
...
dev-qsh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe708bd2a8 | ||
| fd24f914f7 | |||
| 59f5885669 | |||
| f83a81c02a | |||
| 153e7e766c | |||
| 8bc6ec10c4 | |||
| 85a36e7fd9 | |||
| f727796d1f | |||
|
|
e756980625 | ||
| be38cebe38 | |||
|
|
3454ff1bd5 | ||
| 50a64770ee | |||
|
|
cf049fc1e8 | ||
|
|
00fa8e4d84 | ||
|
|
dd53612b39 | ||
| 25cd675698 | |||
| 15622a2e5a | |||
| ca533e85e3 | |||
| b27a46f037 | |||
| 7b1afb53da | |||
| 63eb91e64c | |||
| ba59394115 | |||
| 2cdb072ab8 | |||
|
|
155f9009fc | ||
| 9800001876 | |||
| 60a2a27e61 | |||
| 01d8c27b48 | |||
| 054e739905 | |||
| 9a14b99b18 | |||
|
|
d03f08dcd4 | ||
| 7d026fd682 | |||
| a4cf773aaa | |||
| 44c7642b9a | |||
| f6225b2afb | |||
| 1fd8a381ea | |||
|
|
c7a6210195 | ||
| 553cdd3657 | |||
|
|
fbbba80e23 | ||
| fc3f3fa3de | |||
| e151ad7c9c | |||
| 58d702f6f7 | |||
|
|
955687d473 | ||
| 953377e655 | |||
| bff5199726 |
@@ -1,11 +1,20 @@
|
|||||||
|
###
|
||||||
|
# @Author: riverQiu
|
||||||
|
# @Date: 2023-08-16 22:04:23
|
||||||
|
# @LastEditors: riverQiu
|
||||||
|
# @LastEditTime: 2023-08-18 23:22:27
|
||||||
|
# @Description:
|
||||||
|
###
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 对嘛管理系统
|
VUE_APP_TITLE = 莳松管理系统
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 对嘛管理系统/开发环境
|
# 莳松管理系统/开发环境
|
||||||
VUE_APP_BASE_API = '/dev-api'
|
VUE_APP_BASE_API = '/dev-api'
|
||||||
|
|
||||||
|
JWL_API = ''
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 对嘛管理系统
|
VUE_APP_TITLE = 莳松管理系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 对嘛管理系统/生产环境
|
# 莳松管理系统/生产环境
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = '/duima'
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 对嘛管理系统
|
VUE_APP_TITLE = 莳松管理系统
|
||||||
|
|
||||||
NODE_ENV = production
|
NODE_ENV = production
|
||||||
|
|
||||||
# 测试环境配置
|
# 测试环境配置
|
||||||
ENV = 'staging'
|
ENV = 'staging'
|
||||||
|
|
||||||
# 对嘛管理系统/测试环境
|
# 莳松管理系统/测试环境
|
||||||
VUE_APP_BASE_API = '/stage-api'
|
VUE_APP_BASE_API = '/stage-api'
|
||||||
|
|||||||
10
.eslintrc.js
@@ -14,7 +14,7 @@ module.exports = {
|
|||||||
// 添加全局变量
|
// 添加全局变量
|
||||||
globals: {
|
globals: {
|
||||||
uni: 'readonly',
|
uni: 'readonly',
|
||||||
wx: 'readonly'
|
wx: 'readonly',
|
||||||
},
|
},
|
||||||
extends: ['plugin:vue/recommended', 'eslint:recommended'], // 使用的默认的规则集
|
extends: ['plugin:vue/recommended', 'eslint:recommended'], // 使用的默认的规则集
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ module.exports = {
|
|||||||
'vue/max-attributes-per-line': [
|
'vue/max-attributes-per-line': [
|
||||||
2,
|
2,
|
||||||
{
|
{
|
||||||
singleline: 10, // 当开始标签位于单行时,每行的最大属性数
|
singleline: 20, // 当开始标签位于单行时,每行的最大属性数
|
||||||
// 当开始标签位于多行时,每行的最大属性数
|
// 当开始标签位于多行时,每行的最大属性数
|
||||||
multiline: {
|
multiline: {
|
||||||
max: 1,
|
max: 1,
|
||||||
@@ -75,7 +75,7 @@ module.exports = {
|
|||||||
curly: [2, 'multi-line'], // 强制所有控制语句使用一致的括号风格
|
curly: [2, 'multi-line'], // 强制所有控制语句使用一致的括号风格
|
||||||
'dot-location': [2, 'property'], // 在点之前和之后执行一致的换行符
|
'dot-location': [2, 'property'], // 在点之前和之后执行一致的换行符
|
||||||
'eol-last': 2, // 要求或禁止文件末尾存在空行
|
'eol-last': 2, // 要求或禁止文件末尾存在空行
|
||||||
eqeqeq: ['error', 'always', { null: 'ignore' }], // 要求使用 === 和 !==
|
// eqeqeq: ['error', 'never', { null: 'ignore' }], // 要求使用 === 和 !==
|
||||||
// 强制 generator 函数中 * 号周围使用一致的空格
|
// 强制 generator 函数中 * 号周围使用一致的空格
|
||||||
'generator-star-spacing': [
|
'generator-star-spacing': [
|
||||||
2,
|
2,
|
||||||
@@ -290,6 +290,8 @@ module.exports = {
|
|||||||
objectsInObjects: false
|
objectsInObjects: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'array-bracket-spacing': [2, 'never'] // 该规则在数组括号内强制实现一致的间距
|
'array-bracket-spacing': [2, 'never'], // 该规则在数组括号内强制实现一致的间距
|
||||||
|
'vue/require-default-prop': 'off',
|
||||||
|
'vue/require-prop-types': 'off'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
28
package.json
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "river",
|
"name": "river",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "对嘛管理系统",
|
"description": "莳松管理系统",
|
||||||
"author": "对嘛",
|
"author": "莳松",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
@@ -17,9 +17,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"src/**/*.{js,vue}": ["eslint --fix", "git add"]
|
"src/**/*.{js,vue}": [
|
||||||
|
"eslint --fix",
|
||||||
|
"git add"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"keywords": ["vue", "admin", "dashboard", "element-ui", "boilerplate", "admin-template", "management-system"],
|
"keywords": [
|
||||||
|
"vue",
|
||||||
|
"admin",
|
||||||
|
"dashboard",
|
||||||
|
"element-ui",
|
||||||
|
"boilerplate",
|
||||||
|
"admin-template",
|
||||||
|
"management-system"
|
||||||
|
],
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
|
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
|
||||||
@@ -42,6 +53,7 @@
|
|||||||
"screenfull": "5.0.2",
|
"screenfull": "5.0.2",
|
||||||
"sortablejs": "1.10.2",
|
"sortablejs": "1.10.2",
|
||||||
"vue": "2.6.12",
|
"vue": "2.6.12",
|
||||||
|
"vue-amap": "^0.5.10",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-cropper": "0.5.5",
|
"vue-cropper": "0.5.5",
|
||||||
"vue-meta": "2.4.0",
|
"vue-meta": "2.4.0",
|
||||||
@@ -66,11 +78,15 @@
|
|||||||
"sass-loader": "10.1.1",
|
"sass-loader": "10.1.1",
|
||||||
"script-ext-html-webpack-plugin": "2.1.5",
|
"script-ext-html-webpack-plugin": "2.1.5",
|
||||||
"svg-sprite-loader": "5.1.1",
|
"svg-sprite-loader": "5.1.1",
|
||||||
"vue-template-compiler": "2.6.12"
|
"vue-template-compiler": "2.6.12",
|
||||||
|
"vue-wxlogin": "^1.0.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.9",
|
"node": ">=8.9",
|
||||||
"npm": ">= 3.0.0"
|
"npm": ">= 3.0.0"
|
||||||
},
|
},
|
||||||
"browserslist": ["> 1%", "last 2 versions"]
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 137 KiB |
BIN
public/favicon1.ico
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
@@ -1,208 +1,104 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<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 rel="icon" href="<%= BASE_URL %>favicon.ico" />
|
||||||
<title><%= webpackConfig.name %></title>
|
<title><%= webpackConfig.name %></title>
|
||||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
<!--[if lt IE 11
|
||||||
<style>
|
]><script>
|
||||||
html,
|
window.location.href = '/html/ie.html';
|
||||||
body,
|
</script><!
|
||||||
#app {
|
[endif]-->
|
||||||
height: 100%;
|
<style>
|
||||||
margin: 0px;
|
html,
|
||||||
padding: 0px;
|
body,
|
||||||
}
|
#app {
|
||||||
.chromeframe {
|
height: 100%;
|
||||||
margin: 0.2em 0;
|
margin: 0px;
|
||||||
background: #ccc;
|
padding: 0px;
|
||||||
color: #000;
|
|
||||||
padding: 0.2em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader-wrapper {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 999999;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader {
|
|
||||||
display: block;
|
|
||||||
position: relative;
|
|
||||||
left: 50%;
|
|
||||||
top: 50%;
|
|
||||||
width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
margin: -75px 0 0 -75px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 3px solid transparent;
|
|
||||||
border-top-color: #FFF;
|
|
||||||
-webkit-animation: spin 2s linear infinite;
|
|
||||||
-ms-animation: spin 2s linear infinite;
|
|
||||||
-moz-animation: spin 2s linear infinite;
|
|
||||||
-o-animation: spin 2s linear infinite;
|
|
||||||
animation: spin 2s linear infinite;
|
|
||||||
z-index: 1001;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader:before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 5px;
|
|
||||||
left: 5px;
|
|
||||||
right: 5px;
|
|
||||||
bottom: 5px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 3px solid transparent;
|
|
||||||
border-top-color: #FFF;
|
|
||||||
-webkit-animation: spin 3s linear infinite;
|
|
||||||
-moz-animation: spin 3s linear infinite;
|
|
||||||
-o-animation: spin 3s linear infinite;
|
|
||||||
-ms-animation: spin 3s linear infinite;
|
|
||||||
animation: spin 3s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader:after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
top: 15px;
|
|
||||||
left: 15px;
|
|
||||||
right: 15px;
|
|
||||||
bottom: 15px;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 3px solid transparent;
|
|
||||||
border-top-color: #FFF;
|
|
||||||
-moz-animation: spin 1.5s linear infinite;
|
|
||||||
-o-animation: spin 1.5s linear infinite;
|
|
||||||
-ms-animation: spin 1.5s linear infinite;
|
|
||||||
-webkit-animation: spin 1.5s linear infinite;
|
|
||||||
animation: spin 1.5s linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@-webkit-keyframes spin {
|
|
||||||
0% {
|
|
||||||
-webkit-transform: rotate(0deg);
|
|
||||||
-ms-transform: rotate(0deg);
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
}
|
||||||
100% {
|
.chromeframe {
|
||||||
-webkit-transform: rotate(360deg);
|
margin: 0.2em 0;
|
||||||
-ms-transform: rotate(360deg);
|
background: #ccc;
|
||||||
transform: rotate(360deg);
|
color: #000;
|
||||||
|
padding: 0.2em 0;
|
||||||
}
|
}
|
||||||
}
|
.logo {
|
||||||
|
/* position: absolute; */
|
||||||
@keyframes spin {
|
display: block;
|
||||||
0% {
|
/* left: 50%;
|
||||||
-webkit-transform: rotate(0deg);
|
top: 50%; */
|
||||||
-ms-transform: rotate(0deg);
|
width: 100px;
|
||||||
transform: rotate(0deg);
|
/* height: 162px; */
|
||||||
|
/* transform: translate3d(-50%, -80px, 0); */
|
||||||
|
animation: twinkling 1.2s infinite ease-in-out;
|
||||||
}
|
}
|
||||||
100% {
|
/* .animated {
|
||||||
-webkit-transform: rotate(360deg);
|
-webkit-animation-duration: 1s;
|
||||||
-ms-transform: rotate(360deg);
|
animation-duration: 1s;
|
||||||
transform: rotate(360deg);
|
-webkit-animation-fill-mode: both;
|
||||||
|
animation-fill-mode: both;
|
||||||
|
} */
|
||||||
|
@keyframes twinkling {
|
||||||
|
0% {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 0.4;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
.loading {
|
||||||
|
/* position: absolute; */
|
||||||
|
margin-top: 40px;
|
||||||
|
display: block;
|
||||||
|
/* left: 50%; */
|
||||||
|
/* top: 50%; */
|
||||||
|
/* transform: translate3d(-50%, 80px, 0); */
|
||||||
|
color: #fefeff;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
/* canvas {
|
||||||
|
display: block;
|
||||||
|
left: 50%;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate3d(-50%, 100px, 0);
|
||||||
|
} */
|
||||||
|
|
||||||
|
#loader-wrapper {
|
||||||
#loader-wrapper .loader-section {
|
position: relative;
|
||||||
position: fixed;
|
width: 100%;
|
||||||
top: 0;
|
height: 100%;
|
||||||
width: 51%;
|
background: #1a1a34;
|
||||||
height: 100%;
|
z-index: 1000;
|
||||||
background: #7171C6;
|
display: flex;
|
||||||
z-index: 1000;
|
flex-direction: column;
|
||||||
-webkit-transform: translateX(0);
|
justify-content: center;
|
||||||
-ms-transform: translateX(0);
|
align-items: center;
|
||||||
transform: translateX(0);
|
}
|
||||||
}
|
</style>
|
||||||
|
<script src="/loading/prefixfree.min.js"></script>
|
||||||
#loader-wrapper .loader-section.section-left {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader-wrapper .loader-section.section-right {
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.loaded #loader-wrapper .loader-section.section-left {
|
|
||||||
-webkit-transform: translateX(-100%);
|
|
||||||
-ms-transform: translateX(-100%);
|
|
||||||
transform: translateX(-100%);
|
|
||||||
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
|
||||||
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
|
||||||
}
|
|
||||||
|
|
||||||
.loaded #loader-wrapper .loader-section.section-right {
|
|
||||||
-webkit-transform: translateX(100%);
|
|
||||||
-ms-transform: translateX(100%);
|
|
||||||
transform: translateX(100%);
|
|
||||||
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
|
||||||
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
|
|
||||||
}
|
|
||||||
|
|
||||||
.loaded #loader {
|
|
||||||
opacity: 0;
|
|
||||||
-webkit-transition: all 0.3s ease-out;
|
|
||||||
transition: all 0.3s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loaded #loader-wrapper {
|
|
||||||
visibility: hidden;
|
|
||||||
-webkit-transform: translateY(-100%);
|
|
||||||
-ms-transform: translateY(-100%);
|
|
||||||
transform: translateY(-100%);
|
|
||||||
-webkit-transition: all 0.3s 1s ease-out;
|
|
||||||
transition: all 0.3s 1s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-js #loader-wrapper {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-js h1 {
|
|
||||||
color: #222222;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader-wrapper .load_title {
|
|
||||||
font-family: 'Open Sans';
|
|
||||||
color: #FFF;
|
|
||||||
font-size: 19px;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
z-index: 9999999999999;
|
|
||||||
position: absolute;
|
|
||||||
top: 60%;
|
|
||||||
opacity: 1;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loader-wrapper .load_title span {
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: italic;
|
|
||||||
font-size: 13px;
|
|
||||||
color: #FFF;
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div id="loader-wrapper">
|
<div id="loader-wrapper">
|
||||||
<div id="loader"></div>
|
<img class="logo animated" src="/logo.png" alt="" srcset="" />
|
||||||
<div class="loader-section section-left"></div>
|
<div class="loading">资源加载中...</div>
|
||||||
<div class="loader-section section-right"></div>
|
</div>
|
||||||
<div class="load_title">正在加载系统资源,请耐心等待</div>
|
</div>
|
||||||
</div>
|
<script src="/loading/index.js"></script>
|
||||||
</div>
|
<script type="text/javascript">
|
||||||
|
window._AMapSecurityConfig = {
|
||||||
|
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
|
||||||
|
<script src="https://webapi.amap.com/maps?v=1.4.15&key=713d839ff505943b0f18e6df45f3b0dc&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder,AMap.Scale"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
208
public/loading/index.js
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
/* ========================================================*/
|
||||||
|
/* Light Loader
|
||||||
|
/*========================================================*/
|
||||||
|
var lightLoader = function (c, cw, ch) {
|
||||||
|
var _this = this;
|
||||||
|
this.c = c;
|
||||||
|
this.ctx = c.getContext('2d');
|
||||||
|
this.cw = cw;
|
||||||
|
this.ch = ch;
|
||||||
|
|
||||||
|
this.loaded = 0;
|
||||||
|
this.loaderSpeed = 1.5;
|
||||||
|
this.loaderHeight = 8;
|
||||||
|
this.loaderWidth = 428;
|
||||||
|
this.loader = {
|
||||||
|
x: this.cw / 2 - this.loaderWidth / 2,
|
||||||
|
y: this.ch / 2 - this.loaderHeight / 2
|
||||||
|
};
|
||||||
|
this.particles = [];
|
||||||
|
this.particleLift = 180;
|
||||||
|
this.gravity = 0.15;
|
||||||
|
this.particleRate = 8;
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Initialize
|
||||||
|
/*========================================================*/
|
||||||
|
this.init = function () {
|
||||||
|
this.loop();
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Utility Functions
|
||||||
|
/*========================================================*/
|
||||||
|
this.rand = function (rMi, rMa) {
|
||||||
|
return ~~(Math.random() * (rMa - rMi + 1) + rMi);
|
||||||
|
};
|
||||||
|
this.hitTest = function (x1, y1, w1, h1, x2, y2, w2, h2) {
|
||||||
|
return !(x1 + w1 < x2 || x2 + w2 < x1 || y1 + h1 < y2 || y2 + h2 < y1);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Update Loader
|
||||||
|
/*========================================================*/
|
||||||
|
this.updateLoader = function () {
|
||||||
|
if (this.loaded < 100) {
|
||||||
|
this.loaded += this.loaderSpeed;
|
||||||
|
} else {
|
||||||
|
this.loaded = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Render Loader
|
||||||
|
/*========================================================*/
|
||||||
|
this.renderLoader = function () {
|
||||||
|
this.ctx.fillStyle = '#2F2F47';
|
||||||
|
this.ctx.fillRect(this.loader.x, this.loader.y, this.loaderWidth, this.loaderHeight);
|
||||||
|
|
||||||
|
var newWidth = (this.loaded / 100) * this.loaderWidth;
|
||||||
|
var linearGrad = this.ctx.createLinearGradient(0, 0, this.loaderWidth, 0);
|
||||||
|
linearGrad.addColorStop(0.0, '#24DED0');
|
||||||
|
linearGrad.addColorStop(1.0, '#1490EA');
|
||||||
|
this.ctx.fillStyle = linearGrad;
|
||||||
|
this.ctx.fillRect(this.loader.x, this.loader.y, newWidth, this.loaderHeight);
|
||||||
|
|
||||||
|
// this.ctx.fillStyle = '#2F2F47';
|
||||||
|
// this.ctx.fillRect(
|
||||||
|
// this.loader.x,
|
||||||
|
// this.loader.y,
|
||||||
|
// newWidth,
|
||||||
|
// this.loaderHeight
|
||||||
|
// );
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Particles
|
||||||
|
/*========================================================*/
|
||||||
|
this.Particle = function () {
|
||||||
|
this.x = _this.loader.x + (_this.loaded / 100) * _this.loaderWidth - _this.rand(0, 1);
|
||||||
|
this.y = _this.ch / 2 + _this.rand(0, _this.loaderHeight) - _this.loaderHeight / 2;
|
||||||
|
this.vx = (_this.rand(0, 4) - 2) / 100;
|
||||||
|
this.vy = (_this.rand(0, _this.particleLift) - _this.particleLift * 2) / 100;
|
||||||
|
this.width = _this.rand(1, 4) / 2;
|
||||||
|
this.height = _this.rand(1, 4) / 2;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.Particle.prototype.update = function (i) {
|
||||||
|
this.vx += (_this.rand(0, 6) - 3) / 100;
|
||||||
|
this.vy += _this.gravity;
|
||||||
|
this.x += this.vx;
|
||||||
|
this.y += this.vy;
|
||||||
|
|
||||||
|
if (this.y > _this.ch) {
|
||||||
|
_this.particles.splice(i, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.Particle.prototype.render = function () {
|
||||||
|
_this.ctx.fillStyle = 'rgba(50, 213, 203, 0.4)';
|
||||||
|
_this.ctx.fillRect(this.x, this.y, this.width, this.height);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.createParticles = function () {
|
||||||
|
var i = this.particleRate;
|
||||||
|
while (i--) {
|
||||||
|
this.particles.push(new this.Particle());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.updateParticles = function () {
|
||||||
|
var i = this.particles.length;
|
||||||
|
while (i--) {
|
||||||
|
var p = this.particles[i];
|
||||||
|
p.update(i);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.renderParticles = function () {
|
||||||
|
var i = this.particles.length;
|
||||||
|
while (i--) {
|
||||||
|
var p = this.particles[i];
|
||||||
|
p.render();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Clear Canvas
|
||||||
|
/*========================================================*/
|
||||||
|
this.clearCanvas = function () {
|
||||||
|
this.ctx.globalCompositeOperation = 'source-over';
|
||||||
|
this.ctx.clearRect(0, 0, this.cw, this.ch);
|
||||||
|
this.ctx.globalCompositeOperation = 'lighter';
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Animation Loop
|
||||||
|
/*========================================================*/
|
||||||
|
this.loop = function () {
|
||||||
|
var loopIt = function () {
|
||||||
|
requestAnimationFrame(loopIt, _this.c);
|
||||||
|
_this.clearCanvas();
|
||||||
|
|
||||||
|
_this.createParticles();
|
||||||
|
|
||||||
|
_this.updateLoader();
|
||||||
|
_this.updateParticles();
|
||||||
|
|
||||||
|
_this.renderLoader();
|
||||||
|
_this.renderParticles();
|
||||||
|
};
|
||||||
|
loopIt();
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Check Canvas Support
|
||||||
|
/*========================================================*/
|
||||||
|
var isCanvasSupported = function () {
|
||||||
|
var elem = document.createElement('canvas');
|
||||||
|
return !!(elem.getContext && elem.getContext('2d'));
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Setup requestAnimationFrame
|
||||||
|
/*========================================================*/
|
||||||
|
var setupRAF = function () {
|
||||||
|
var lastTime = 0;
|
||||||
|
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||||
|
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||||
|
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
||||||
|
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!window.requestAnimationFrame) {
|
||||||
|
window.requestAnimationFrame = function (callback, element) {
|
||||||
|
var currTime = new Date().getTime();
|
||||||
|
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||||
|
var id = window.setTimeout(function () {
|
||||||
|
callback(currTime + timeToCall);
|
||||||
|
}, timeToCall);
|
||||||
|
lastTime = currTime + timeToCall;
|
||||||
|
return id;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!window.cancelAnimationFrame) {
|
||||||
|
window.cancelAnimationFrame = function (id) {
|
||||||
|
clearTimeout(id);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* ========================================================*/
|
||||||
|
/* Define Canvas and Initialize
|
||||||
|
/*========================================================*/
|
||||||
|
if (isCanvasSupported) {
|
||||||
|
var c = document.createElement('canvas');
|
||||||
|
c.width = 428;
|
||||||
|
c.height = 100;
|
||||||
|
var cw = c.width;
|
||||||
|
var ch = c.height;
|
||||||
|
// document.body.appendChild(c);
|
||||||
|
document.getElementById('loader-wrapper').appendChild(c);
|
||||||
|
var cl = new lightLoader(c, cw, ch);
|
||||||
|
|
||||||
|
setupRAF();
|
||||||
|
cl.init();
|
||||||
|
}
|
||||||
477
public/loading/prefixfree.min.js
vendored
Normal file
@@ -0,0 +1,477 @@
|
|||||||
|
(function () {
|
||||||
|
if (!window.addEventListener) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = (window.StyleFix = {
|
||||||
|
link: function (link) {
|
||||||
|
try {
|
||||||
|
// Ignore stylesheets with data-noprefix attribute as well as alternate stylesheets
|
||||||
|
if (link.rel !== 'stylesheet' || link.hasAttribute('data-noprefix')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var url = link.href || link.getAttribute('data-href');
|
||||||
|
var base = url.replace(/[^\/]+$/, '');
|
||||||
|
var base_scheme = (/^[a-z]{3,10}:/.exec(base) || [''])[0];
|
||||||
|
var base_domain = (/^[a-z]{3,10}:\/\/[^\/]+/.exec(base) || [''])[0];
|
||||||
|
var base_query = /^([^?]*)\??/.exec(url)[1];
|
||||||
|
var parent = link.parentNode;
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
var process;
|
||||||
|
|
||||||
|
xhr.onreadystatechange = function () {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
process();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
process = function () {
|
||||||
|
var css = xhr.responseText;
|
||||||
|
|
||||||
|
if (css && link.parentNode && (!xhr.status || xhr.status < 400 || xhr.status > 600)) {
|
||||||
|
css = self.fix(css, true, link);
|
||||||
|
|
||||||
|
// Convert relative URLs to absolute, if needed
|
||||||
|
if (base) {
|
||||||
|
css = css.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi, function ($0, quote, url) {
|
||||||
|
if (/^([a-z]{3,10}:|#)/i.test(url)) {
|
||||||
|
// Absolute & or hash-relative
|
||||||
|
return $0;
|
||||||
|
} else if (/^\/\//.test(url)) {
|
||||||
|
// Scheme-relative
|
||||||
|
// May contain sequences like /../ and /./ but those DO work
|
||||||
|
return 'url("' + base_scheme + url + '")';
|
||||||
|
} else if (/^\//.test(url)) {
|
||||||
|
// Domain-relative
|
||||||
|
return 'url("' + base_domain + url + '")';
|
||||||
|
} else if (/^\?/.test(url)) {
|
||||||
|
// Query-relative
|
||||||
|
return 'url("' + base_query + url + '")';
|
||||||
|
} else {
|
||||||
|
// Path-relative
|
||||||
|
return 'url("' + base + url + '")';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// behavior URLs shoudn’t be converted (Issue #19)
|
||||||
|
// base should be escaped before added to RegExp (Issue #81)
|
||||||
|
var escaped_base = base.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g, '\\$1');
|
||||||
|
css = css.replace(RegExp('\\b(behavior:\\s*?url\\(\'?"?)' + escaped_base, 'gi'), '$1');
|
||||||
|
}
|
||||||
|
|
||||||
|
var style = document.createElement('style');
|
||||||
|
style.textContent = css;
|
||||||
|
style.media = link.media;
|
||||||
|
style.disabled = link.disabled;
|
||||||
|
style.setAttribute('data-href', link.getAttribute('href'));
|
||||||
|
|
||||||
|
parent.insertBefore(style, link);
|
||||||
|
parent.removeChild(link);
|
||||||
|
|
||||||
|
style.media = link.media; // Duplicate is intentional. See issue #31
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
xhr.open('GET', url);
|
||||||
|
xhr.send(null);
|
||||||
|
} catch (e) {
|
||||||
|
// Fallback to XDomainRequest if available
|
||||||
|
if (typeof XDomainRequest !== 'undefined') {
|
||||||
|
xhr = new XDomainRequest();
|
||||||
|
xhr.onerror = xhr.onprogress = function () {};
|
||||||
|
xhr.onload = process;
|
||||||
|
xhr.open('GET', url);
|
||||||
|
xhr.send(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
link.setAttribute('data-inprogress', '');
|
||||||
|
},
|
||||||
|
|
||||||
|
styleElement: function (style) {
|
||||||
|
if (style.hasAttribute('data-noprefix')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var disabled = style.disabled;
|
||||||
|
|
||||||
|
style.textContent = self.fix(style.textContent, true, style);
|
||||||
|
|
||||||
|
style.disabled = disabled;
|
||||||
|
},
|
||||||
|
|
||||||
|
styleAttribute: function (element) {
|
||||||
|
var css = element.getAttribute('style');
|
||||||
|
|
||||||
|
css = self.fix(css, false, element);
|
||||||
|
|
||||||
|
element.setAttribute('style', css);
|
||||||
|
},
|
||||||
|
|
||||||
|
process: function () {
|
||||||
|
// Linked stylesheets
|
||||||
|
$('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);
|
||||||
|
|
||||||
|
// Inline stylesheets
|
||||||
|
$('style').forEach(StyleFix.styleElement);
|
||||||
|
|
||||||
|
// Inline styles
|
||||||
|
$('[style]').forEach(StyleFix.styleAttribute);
|
||||||
|
},
|
||||||
|
|
||||||
|
register: function (fixer, index) {
|
||||||
|
(self.fixers = self.fixers || []).splice(index === undefined ? self.fixers.length : index, 0, fixer);
|
||||||
|
},
|
||||||
|
|
||||||
|
fix: function (css, raw, element) {
|
||||||
|
for (var i = 0; i < self.fixers.length; i++) {
|
||||||
|
css = self.fixers[i](css, raw, element) || css;
|
||||||
|
}
|
||||||
|
|
||||||
|
return css;
|
||||||
|
},
|
||||||
|
|
||||||
|
camelCase: function (str) {
|
||||||
|
return str
|
||||||
|
.replace(/-([a-z])/g, function ($0, $1) {
|
||||||
|
return $1.toUpperCase();
|
||||||
|
})
|
||||||
|
.replace('-', '');
|
||||||
|
},
|
||||||
|
|
||||||
|
deCamelCase: function (str) {
|
||||||
|
return str.replace(/[A-Z]/g, function ($0) {
|
||||||
|
return '-' + $0.toLowerCase();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/** ************************************
|
||||||
|
* Process styles
|
||||||
|
**************************************/
|
||||||
|
(function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$('link[rel="stylesheet"]').forEach(StyleFix.link);
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', StyleFix.process, false);
|
||||||
|
})();
|
||||||
|
|
||||||
|
function $(expr, con) {
|
||||||
|
return [].slice.call((con || document).querySelectorAll(expr));
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PrefixFree
|
||||||
|
*/
|
||||||
|
(function (root) {
|
||||||
|
if (!window.StyleFix || !window.getComputedStyle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Private helper
|
||||||
|
function fix(what, before, after, replacement, css) {
|
||||||
|
what = self[what];
|
||||||
|
|
||||||
|
if (what.length) {
|
||||||
|
var regex = RegExp(before + '(' + what.join('|') + ')' + after, 'gi');
|
||||||
|
|
||||||
|
css = css.replace(regex, replacement);
|
||||||
|
}
|
||||||
|
|
||||||
|
return css;
|
||||||
|
}
|
||||||
|
|
||||||
|
var self = (window.PrefixFree = {
|
||||||
|
prefixCSS: function (css, raw, element) {
|
||||||
|
var prefix = self.prefix;
|
||||||
|
|
||||||
|
// Gradient angles hotfix
|
||||||
|
if (self.functions.indexOf('linear-gradient') > -1) {
|
||||||
|
// Gradients are supported with a prefix, convert angles to legacy
|
||||||
|
css = css.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/gi, function ($0, delim, repeating, deg) {
|
||||||
|
return delim + (repeating || '') + 'linear-gradient(' + (90 - deg) + 'deg';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
css = fix('functions', '(\\s|:|,)', '\\s*\\(', '$1' + prefix + '$2(', css);
|
||||||
|
css = fix('keywords', '(\\s|:)', '(\\s|;|\\}|$)', '$1' + prefix + '$2$3', css);
|
||||||
|
css = fix('properties', '(^|\\{|\\s|;)', '\\s*:', '$1' + prefix + '$2:', css);
|
||||||
|
|
||||||
|
// Prefix properties *inside* values (issue #8)
|
||||||
|
if (self.properties.length) {
|
||||||
|
var regex = RegExp('\\b(' + self.properties.join('|') + ')(?!:)', 'gi');
|
||||||
|
|
||||||
|
css = fix(
|
||||||
|
'valueProperties',
|
||||||
|
'\\b',
|
||||||
|
':(.+?);',
|
||||||
|
function ($0) {
|
||||||
|
return $0.replace(regex, prefix + '$1');
|
||||||
|
},
|
||||||
|
css
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (raw) {
|
||||||
|
css = fix('selectors', '', '\\b', self.prefixSelector, css);
|
||||||
|
css = fix('atrules', '@', '\\b', '@' + prefix + '$1', css);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix double prefixing
|
||||||
|
css = css.replace(RegExp('-' + prefix, 'g'), '-');
|
||||||
|
|
||||||
|
// Prefix wildcard
|
||||||
|
css = css.replace(/-\*-(?=[a-z]+)/gi, self.prefix);
|
||||||
|
|
||||||
|
return css;
|
||||||
|
},
|
||||||
|
|
||||||
|
property: function (property) {
|
||||||
|
return (self.properties.indexOf(property) ? self.prefix : '') + property;
|
||||||
|
},
|
||||||
|
|
||||||
|
value: function (value, property) {
|
||||||
|
value = fix('functions', '(^|\\s|,)', '\\s*\\(', '$1' + self.prefix + '$2(', value);
|
||||||
|
value = fix('keywords', '(^|\\s)', '(\\s|$)', '$1' + self.prefix + '$2$3', value);
|
||||||
|
|
||||||
|
// TODO properties inside values
|
||||||
|
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Warning: Prefixes no matter what, even if the selector is supported prefix-less
|
||||||
|
prefixSelector: function (selector) {
|
||||||
|
return selector.replace(/^:{1,2}/, function ($0) {
|
||||||
|
return $0 + self.prefix;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// Warning: Prefixes no matter what, even if the property is supported prefix-less
|
||||||
|
prefixProperty: function (property, camelCase) {
|
||||||
|
var prefixed = self.prefix + property;
|
||||||
|
|
||||||
|
return camelCase ? StyleFix.camelCase(prefixed) : prefixed;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/** ************************************
|
||||||
|
* Properties
|
||||||
|
**************************************/
|
||||||
|
(function () {
|
||||||
|
var prefixes = {};
|
||||||
|
var properties = [];
|
||||||
|
var shorthands = {};
|
||||||
|
var style = getComputedStyle(document.documentElement, null);
|
||||||
|
var dummy = document.createElement('div').style;
|
||||||
|
|
||||||
|
// Why are we doing this instead of iterating over properties in a .style object? Cause Webkit won't iterate over those.
|
||||||
|
var iterate = function (property) {
|
||||||
|
if (property.charAt(0) === '-') {
|
||||||
|
properties.push(property);
|
||||||
|
|
||||||
|
var parts = property.split('-');
|
||||||
|
var prefix = parts[1];
|
||||||
|
|
||||||
|
// Count prefix uses
|
||||||
|
prefixes[prefix] = ++prefixes[prefix] || 1;
|
||||||
|
|
||||||
|
// This helps determining shorthands
|
||||||
|
while (parts.length > 3) {
|
||||||
|
parts.pop();
|
||||||
|
|
||||||
|
var shorthand = parts.join('-');
|
||||||
|
|
||||||
|
if (supported(shorthand) && properties.indexOf(shorthand) === -1) {
|
||||||
|
properties.push(shorthand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var supported = function (property) {
|
||||||
|
return StyleFix.camelCase(property) in dummy;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Some browsers have numerical indices for the properties, some don't
|
||||||
|
if (style.length > 0) {
|
||||||
|
for (var i = 0; i < style.length; i++) {
|
||||||
|
iterate(style[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (var property in style) {
|
||||||
|
iterate(StyleFix.deCamelCase(property));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find most frequently used prefix
|
||||||
|
var highest = { uses: 0 };
|
||||||
|
for (var prefix in prefixes) {
|
||||||
|
var uses = prefixes[prefix];
|
||||||
|
|
||||||
|
if (highest.uses < uses) {
|
||||||
|
highest = { prefix: prefix, uses: uses };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.prefix = '-' + highest.prefix + '-';
|
||||||
|
self.Prefix = StyleFix.camelCase(self.prefix);
|
||||||
|
|
||||||
|
self.properties = [];
|
||||||
|
|
||||||
|
// Get properties ONLY supported with a prefix
|
||||||
|
for (var i = 0; i < properties.length; i++) {
|
||||||
|
var property = properties[i];
|
||||||
|
|
||||||
|
if (property.indexOf(self.prefix) === 0) {
|
||||||
|
// we might have multiple prefixes, like Opera
|
||||||
|
var unprefixed = property.slice(self.prefix.length);
|
||||||
|
|
||||||
|
if (!supported(unprefixed)) {
|
||||||
|
self.properties.push(unprefixed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IE fix
|
||||||
|
if (self.Prefix == 'Ms' && !('transform' in dummy) && !('MsTransform' in dummy) && 'msTransform' in dummy) {
|
||||||
|
self.properties.push('transform', 'transform-origin');
|
||||||
|
}
|
||||||
|
|
||||||
|
self.properties.sort();
|
||||||
|
})();
|
||||||
|
|
||||||
|
/** ************************************
|
||||||
|
* Values
|
||||||
|
**************************************/
|
||||||
|
(function () {
|
||||||
|
// Values that might need prefixing
|
||||||
|
var functions = {
|
||||||
|
'linear-gradient': {
|
||||||
|
property: 'backgroundImage',
|
||||||
|
params: 'red, teal'
|
||||||
|
},
|
||||||
|
calc: {
|
||||||
|
property: 'width',
|
||||||
|
params: '1px + 5%'
|
||||||
|
},
|
||||||
|
element: {
|
||||||
|
property: 'backgroundImage',
|
||||||
|
params: '#foo'
|
||||||
|
},
|
||||||
|
'cross-fade': {
|
||||||
|
property: 'backgroundImage',
|
||||||
|
params: 'url(a.png), url(b.png), 50%'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
functions['repeating-linear-gradient'] = functions['repeating-radial-gradient'] = functions['radial-gradient'] = functions['linear-gradient'];
|
||||||
|
|
||||||
|
// Note: The properties assigned are just to *test* support.
|
||||||
|
// The keywords will be prefixed everywhere.
|
||||||
|
var keywords = {
|
||||||
|
initial: 'color',
|
||||||
|
'zoom-in': 'cursor',
|
||||||
|
'zoom-out': 'cursor',
|
||||||
|
box: 'display',
|
||||||
|
flexbox: 'display',
|
||||||
|
'inline-flexbox': 'display',
|
||||||
|
flex: 'display',
|
||||||
|
'inline-flex': 'display',
|
||||||
|
grid: 'display',
|
||||||
|
'inline-grid': 'display',
|
||||||
|
'min-content': 'width'
|
||||||
|
};
|
||||||
|
|
||||||
|
self.functions = [];
|
||||||
|
self.keywords = [];
|
||||||
|
|
||||||
|
var style = document.createElement('div').style;
|
||||||
|
|
||||||
|
function supported(value, property) {
|
||||||
|
style[property] = '';
|
||||||
|
style[property] = value;
|
||||||
|
|
||||||
|
return !!style[property];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var func in functions) {
|
||||||
|
var test = functions[func];
|
||||||
|
var property = test.property;
|
||||||
|
var value = func + '(' + test.params + ')';
|
||||||
|
|
||||||
|
if (!supported(value, property) && supported(self.prefix + value, property)) {
|
||||||
|
// It's supported, but with a prefix
|
||||||
|
self.functions.push(func);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var keyword in keywords) {
|
||||||
|
var property = keywords[keyword];
|
||||||
|
|
||||||
|
if (!supported(keyword, property) && supported(self.prefix + keyword, property)) {
|
||||||
|
// It's supported, but with a prefix
|
||||||
|
self.keywords.push(keyword);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
/** ************************************
|
||||||
|
* Selectors and @-rules
|
||||||
|
**************************************/
|
||||||
|
(function () {
|
||||||
|
var selectors = {
|
||||||
|
':read-only': null,
|
||||||
|
':read-write': null,
|
||||||
|
':any-link': null,
|
||||||
|
'::selection': null
|
||||||
|
};
|
||||||
|
|
||||||
|
var atrules = {
|
||||||
|
keyframes: 'name',
|
||||||
|
viewport: null,
|
||||||
|
document: 'regexp(".")'
|
||||||
|
};
|
||||||
|
|
||||||
|
self.selectors = [];
|
||||||
|
self.atrules = [];
|
||||||
|
|
||||||
|
var style = root.appendChild(document.createElement('style'));
|
||||||
|
|
||||||
|
function supported(selector) {
|
||||||
|
style.textContent = selector + '{}'; // Safari 4 has issues with style.innerHTML
|
||||||
|
|
||||||
|
return !!style.sheet.cssRules.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var selector in selectors) {
|
||||||
|
var test = selector + (selectors[selector] ? '(' + selectors[selector] + ')' : '');
|
||||||
|
|
||||||
|
if (!supported(test) && supported(self.prefixSelector(test))) {
|
||||||
|
self.selectors.push(selector);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var atrule in atrules) {
|
||||||
|
var test = atrule + ' ' + (atrules[atrule] || '');
|
||||||
|
|
||||||
|
if (!supported('@' + test) && supported('@' + self.prefix + test)) {
|
||||||
|
self.atrules.push(atrule);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
root.removeChild(style);
|
||||||
|
})();
|
||||||
|
|
||||||
|
// Properties that accept properties as their value
|
||||||
|
self.valueProperties = ['transition', 'transition-property'];
|
||||||
|
|
||||||
|
// Add class for current prefix
|
||||||
|
root.className += ' ' + self.prefix;
|
||||||
|
|
||||||
|
StyleFix.register(self.prefixCSS);
|
||||||
|
})(document.documentElement);
|
||||||
BIN
public/logo.png
Normal file
|
After Width: | Height: | Size: 137 KiB |
54
src/api/finance/expense/accountExpense.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询报销列表
|
||||||
|
export function listExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/account/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报销
|
||||||
|
export function addExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/account',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报销
|
||||||
|
export function updateExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/account',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报销
|
||||||
|
export function removeExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/account/' + data,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出报销
|
||||||
|
export function exportExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/account/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核报销
|
||||||
|
export function checkExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/account/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
54
src/api/finance/expense/meituanExpense.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询报销列表
|
||||||
|
export function listExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/meituan/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报销
|
||||||
|
export function addExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/meituan',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报销
|
||||||
|
export function updateExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/meituan',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报销
|
||||||
|
export function removeExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/meituan/' + data,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出报销
|
||||||
|
export function exportExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/meituan/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核报销
|
||||||
|
export function checkExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/meituan/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
54
src/api/finance/expense/officeExpense.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询报销列表
|
||||||
|
export function listExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/office/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报销
|
||||||
|
export function addExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/office',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报销
|
||||||
|
export function updateExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/office',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报销
|
||||||
|
export function removeExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/office/remove/' + data,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出报销
|
||||||
|
export function exportExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/office/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核报销
|
||||||
|
export function checkExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/office/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
54
src/api/finance/expense/placeSignExpense.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询报销列表
|
||||||
|
export function listExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/placeSign/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报销
|
||||||
|
export function addExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/placeSign',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报销
|
||||||
|
export function updateExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/placeSign',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报销
|
||||||
|
export function removeExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/placeSign/' + data,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出报销
|
||||||
|
export function exportExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/placeSign/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核报销
|
||||||
|
export function checkExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/placeSign/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
54
src/api/finance/expense/signExpense.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询报销列表
|
||||||
|
export function listExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/sign/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报销
|
||||||
|
export function addExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/sign',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报销
|
||||||
|
export function updateExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/sign',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报销
|
||||||
|
export function removeExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/sign/remove/' + data,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出报销
|
||||||
|
export function exportExpense(query) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/sign/export',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核报销
|
||||||
|
export function checkExpense(data) {
|
||||||
|
return request({
|
||||||
|
url: '/finance/expense/sign/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
56
src/api/home.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取首页统计信息
|
||||||
|
export function getCount() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/count',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getTodayPeopleRange() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/range/today',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getMonthPeopleRange() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/range/month',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询成交率
|
||||||
|
export function dealRate() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/rate/total',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//查询本月成交率
|
||||||
|
export function getMonthDealRateRange() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/rate/month',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//查询上月成交率
|
||||||
|
export function getLastDealRateRange() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/rate/last',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询考勤异常信息
|
||||||
|
export function getCheckin() {
|
||||||
|
return request({
|
||||||
|
url: '/system/home/checkin',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 登录方法
|
// 登录方法
|
||||||
export function login(username, password, code, uuid) {
|
export function login(username, password, code, uuid) {
|
||||||
@@ -7,7 +7,7 @@ export function login(username, password, code, uuid) {
|
|||||||
password,
|
password,
|
||||||
code,
|
code,
|
||||||
uuid
|
uuid
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/login',
|
url: '/login',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -15,7 +15,18 @@ export function login(username, password, code, uuid) {
|
|||||||
},
|
},
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function wxLogin(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wx/login',
|
||||||
|
headers: {
|
||||||
|
isToken: false
|
||||||
|
},
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册方法
|
// 注册方法
|
||||||
@@ -27,7 +38,7 @@ export function register(data) {
|
|||||||
},
|
},
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户详细信息
|
// 获取用户详细信息
|
||||||
@@ -35,7 +46,7 @@ export function getInfo() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/getInfo',
|
url: '/getInfo',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 退出方法
|
// 退出方法
|
||||||
@@ -43,7 +54,7 @@ export function logout() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/logout',
|
url: '/logout',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
@@ -55,5 +66,14 @@ export function getCodeImg() {
|
|||||||
},
|
},
|
||||||
method: 'get',
|
method: 'get',
|
||||||
timeout: 20000
|
timeout: 20000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function getMsgCode(data) {
|
||||||
|
return request({
|
||||||
|
url: '/msgcode',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 获取路由
|
// 获取路由
|
||||||
export const getRouters = () => {
|
export const getRouters = () => {
|
||||||
return request({
|
return request({
|
||||||
url: '/getRouters',
|
url: '/getRouters',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询缓存详细
|
// 查询缓存详细
|
||||||
export function getCache() {
|
export function getCache() {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache',
|
url: '/monitor/cache',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询缓存名称列表
|
// 查询缓存名称列表
|
||||||
@@ -13,7 +13,7 @@ export function listCacheName() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/getNames',
|
url: '/monitor/cache/getNames',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询缓存键名列表
|
// 查询缓存键名列表
|
||||||
@@ -21,7 +21,7 @@ export function listCacheKey(cacheName) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/getKeys/' + cacheName,
|
url: '/monitor/cache/getKeys/' + cacheName,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询缓存内容
|
// 查询缓存内容
|
||||||
@@ -29,7 +29,7 @@ export function getCacheValue(cacheName, cacheKey) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
|
url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清理指定名称缓存
|
// 清理指定名称缓存
|
||||||
@@ -37,7 +37,7 @@ export function clearCacheName(cacheName) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/clearCacheName/' + cacheName,
|
url: '/monitor/cache/clearCacheName/' + cacheName,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清理指定键名缓存
|
// 清理指定键名缓存
|
||||||
@@ -45,7 +45,7 @@ export function clearCacheKey(cacheKey) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/clearCacheKey/' + cacheKey,
|
url: '/monitor/cache/clearCacheKey/' + cacheKey,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清理全部缓存
|
// 清理全部缓存
|
||||||
@@ -53,5 +53,5 @@ export function clearCacheAll() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/cache/clearCacheAll',
|
url: '/monitor/cache/clearCacheAll',
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询定时任务调度列表
|
// 查询定时任务调度列表
|
||||||
export function listJob(query) {
|
export function listJob(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listJob(query) {
|
|||||||
url: '/monitor/job/list',
|
url: '/monitor/job/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询定时任务调度详细
|
// 查询定时任务调度详细
|
||||||
@@ -14,7 +14,7 @@ export function getJob(jobId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/job/' + jobId,
|
url: '/monitor/job/' + jobId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增定时任务调度
|
// 新增定时任务调度
|
||||||
@@ -23,7 +23,7 @@ export function addJob(data) {
|
|||||||
url: '/monitor/job',
|
url: '/monitor/job',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改定时任务调度
|
// 修改定时任务调度
|
||||||
@@ -32,7 +32,7 @@ export function updateJob(data) {
|
|||||||
url: '/monitor/job',
|
url: '/monitor/job',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除定时任务调度
|
// 删除定时任务调度
|
||||||
@@ -40,7 +40,7 @@ export function delJob(jobId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/job/' + jobId,
|
url: '/monitor/job/' + jobId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 任务状态修改
|
// 任务状态修改
|
||||||
@@ -48,24 +48,23 @@ export function changeJobStatus(jobId, status) {
|
|||||||
const data = {
|
const data = {
|
||||||
jobId,
|
jobId,
|
||||||
status
|
status
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/job/changeStatus',
|
url: '/monitor/job/changeStatus',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 定时任务立即执行一次
|
// 定时任务立即执行一次
|
||||||
export function runJob(jobId, jobGroup) {
|
export function runJob(jobId, jobGroup) {
|
||||||
const data = {
|
const data = {
|
||||||
jobId,
|
jobId,
|
||||||
jobGroup
|
jobGroup
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/job/run',
|
url: '/monitor/job/run',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询调度日志列表
|
// 查询调度日志列表
|
||||||
export function listJobLog(query) {
|
export function listJobLog(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listJobLog(query) {
|
|||||||
url: '/monitor/jobLog/list',
|
url: '/monitor/jobLog/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除调度日志
|
// 删除调度日志
|
||||||
@@ -14,7 +14,7 @@ export function delJobLog(jobLogId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/jobLog/' + jobLogId,
|
url: '/monitor/jobLog/' + jobLogId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空调度日志
|
// 清空调度日志
|
||||||
@@ -22,5 +22,5 @@ export function cleanJobLog() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/jobLog/clean',
|
url: '/monitor/jobLog/clean',
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询登录日志列表
|
// 查询登录日志列表
|
||||||
export function list(query) {
|
export function list(query) {
|
||||||
@@ -6,7 +6,7 @@ export function list(query) {
|
|||||||
url: '/monitor/logininfor/list',
|
url: '/monitor/logininfor/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除登录日志
|
// 删除登录日志
|
||||||
@@ -14,7 +14,7 @@ export function delLogininfor(infoId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/logininfor/' + infoId,
|
url: '/monitor/logininfor/' + infoId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解锁用户登录状态
|
// 解锁用户登录状态
|
||||||
@@ -22,7 +22,7 @@ export function unlockLogininfor(userName) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/logininfor/unlock/' + userName,
|
url: '/monitor/logininfor/unlock/' + userName,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空登录日志
|
// 清空登录日志
|
||||||
@@ -30,5 +30,5 @@ export function cleanLogininfor() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/logininfor/clean',
|
url: '/monitor/logininfor/clean',
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询在线用户列表
|
// 查询在线用户列表
|
||||||
export function list(query) {
|
export function list(query) {
|
||||||
@@ -6,7 +6,7 @@ export function list(query) {
|
|||||||
url: '/monitor/online/list',
|
url: '/monitor/online/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 强退用户
|
// 强退用户
|
||||||
@@ -14,5 +14,5 @@ export function forceLogout(tokenId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/online/' + tokenId,
|
url: '/monitor/online/' + tokenId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询操作日志列表
|
// 查询操作日志列表
|
||||||
export function list(query) {
|
export function list(query) {
|
||||||
@@ -6,7 +6,7 @@ export function list(query) {
|
|||||||
url: '/monitor/operlog/list',
|
url: '/monitor/operlog/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除操作日志
|
// 删除操作日志
|
||||||
@@ -14,7 +14,7 @@ export function delOperlog(operId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/operlog/' + operId,
|
url: '/monitor/operlog/' + operId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清空操作日志
|
// 清空操作日志
|
||||||
@@ -22,5 +22,5 @@ export function cleanOperlog() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/monitor/operlog/clean',
|
url: '/monitor/operlog/clean',
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 获取服务信息
|
// 获取服务信息
|
||||||
export function getServer() {
|
export function getServer() {
|
||||||
return request({
|
return request({
|
||||||
url: '/monitor/server',
|
url: '/monitor/server',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
35
src/api/question.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* @Author: riverQiu
|
||||||
|
* @Date: 2023-08-17 20:30:56
|
||||||
|
* @LastEditors: riverQiu
|
||||||
|
* @LastEditTime: 2023-08-19 00:26:04
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 获取首页统计信息
|
||||||
|
export function searchQuestion(param) {
|
||||||
|
return request({
|
||||||
|
url: '/driver-api/tdQuestion/duima/list',
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateQuestion(data) {
|
||||||
|
return request({
|
||||||
|
url: '/driver-api/tdQuestion/duima/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addQuestion(data) {
|
||||||
|
return request({
|
||||||
|
url: '/driver-api/tdQuestion/duima/add',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
53
src/api/sch/classType.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询班型列表
|
||||||
|
export function getClassTypeTableList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/classType/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询班型列表
|
||||||
|
export function getAllList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/classType/all',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增班型
|
||||||
|
export function insertClassType(params) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/classType',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 修改班型
|
||||||
|
export function updateClassType(params) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/classType',
|
||||||
|
method: 'put',
|
||||||
|
data: params
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 删除班型
|
||||||
|
export function deleteClassType(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/classType/' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 克隆班型
|
||||||
|
export function cloneClassType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/classType/clone',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
20
src/api/sch/file.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询文件列表
|
||||||
|
export function listFile(query) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/file/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 删除文件
|
||||||
|
export function delFile(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/file',
|
||||||
|
method: 'delete',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
48
src/api/sch/place.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 获取地图数据
|
||||||
|
export function getMapData() {
|
||||||
|
return request({
|
||||||
|
url: '/sch/place/list',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新驾校状态
|
||||||
|
export async function updateSchoolStatus(data) {
|
||||||
|
return await request({
|
||||||
|
url: '/sch/place/updateSchool',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export function addPlace(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/place',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 修改场地
|
||||||
|
export function updatePlace(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/place',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询场地
|
||||||
|
export function getAllPlaces(param) {
|
||||||
|
return request({
|
||||||
|
url: `/sch/place/all`,
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
44
src/api/sch/rules.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询规章制度列表
|
||||||
|
export function listRules(query) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/rules/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询规章制度详细
|
||||||
|
export function getRules(ruleId) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/rules/' + ruleId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增规章制度
|
||||||
|
export function addRules(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/rules',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改规章制度
|
||||||
|
export function updateRules(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/rules',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除规章制度
|
||||||
|
export function delRules(ruleId) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/rules/' + ruleId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
43
src/api/sch/school.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
export default {
|
||||||
|
pageList(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/school/list',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
allList(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/school/all',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getById(id) {
|
||||||
|
return request({
|
||||||
|
url: `/sch/school/${id}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/school',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
update(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/sch/school',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delete(id) {
|
||||||
|
return request({
|
||||||
|
url: `/sch/school/${id}`,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
10
src/api/statistic/areaStudent.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询场地学员统计
|
||||||
|
export function listReport(query) {
|
||||||
|
return request({
|
||||||
|
url: '/statistic/area/student/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
10
src/api/statistic/placeStudent.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询场地学员统计
|
||||||
|
export function listReport(query) {
|
||||||
|
return request({
|
||||||
|
url: '/statistic/place/student/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询参数列表
|
// 查询参数列表
|
||||||
export function listConfig(query) {
|
export function listConfig(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listConfig(query) {
|
|||||||
url: '/system/config/list',
|
url: '/system/config/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询参数详细
|
// 查询参数详细
|
||||||
@@ -14,7 +14,7 @@ export function getConfig(configId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/config/' + configId,
|
url: '/system/config/' + configId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据参数键名查询参数值
|
// 根据参数键名查询参数值
|
||||||
@@ -22,7 +22,7 @@ export function getConfigKey(configKey) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/config/configKey/' + configKey,
|
url: '/system/config/configKey/' + configKey,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增参数配置
|
// 新增参数配置
|
||||||
@@ -31,7 +31,7 @@ export function addConfig(data) {
|
|||||||
url: '/system/config',
|
url: '/system/config',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改参数配置
|
// 修改参数配置
|
||||||
@@ -40,7 +40,7 @@ export function updateConfig(data) {
|
|||||||
url: '/system/config',
|
url: '/system/config',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除参数配置
|
// 删除参数配置
|
||||||
@@ -48,7 +48,7 @@ export function delConfig(configId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/config/' + configId,
|
url: '/system/config/' + configId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新参数缓存
|
// 刷新参数缓存
|
||||||
@@ -56,5 +56,5 @@ export function refreshCache() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/config/refreshCache',
|
url: '/system/config/refreshCache',
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询部门列表
|
// 查询部门列表
|
||||||
export function listDept(query) {
|
export function listDept(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listDept(query) {
|
|||||||
url: '/system/dept/list',
|
url: '/system/dept/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询部门列表(排除节点)
|
// 查询部门列表(排除节点)
|
||||||
@@ -14,7 +14,7 @@ export function listDeptExcludeChild(deptId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dept/list/exclude/' + deptId,
|
url: '/system/dept/list/exclude/' + deptId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询部门详细
|
// 查询部门详细
|
||||||
@@ -22,7 +22,7 @@ export function getDept(deptId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dept/' + deptId,
|
url: '/system/dept/' + deptId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增部门
|
// 新增部门
|
||||||
@@ -31,7 +31,7 @@ export function addDept(data) {
|
|||||||
url: '/system/dept',
|
url: '/system/dept',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改部门
|
// 修改部门
|
||||||
@@ -40,7 +40,7 @@ export function updateDept(data) {
|
|||||||
url: '/system/dept',
|
url: '/system/dept',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除部门
|
// 删除部门
|
||||||
@@ -48,5 +48,12 @@ export function delDept(deptId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dept/' + deptId,
|
url: '/system/dept/' + deptId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
// 查询部门下拉树结构
|
||||||
|
export function deptTreeSelect() {
|
||||||
|
return request({
|
||||||
|
url: '/system/dept/deptTree',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询字典数据列表
|
// 查询字典数据列表
|
||||||
export function listData(query) {
|
export function listData(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listData(query) {
|
|||||||
url: '/system/dict/data/list',
|
url: '/system/dict/data/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询字典数据详细
|
// 查询字典数据详细
|
||||||
@@ -14,7 +14,7 @@ export function getData(dictCode) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/' + dictCode,
|
url: '/system/dict/data/' + dictCode,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据字典类型查询字典数据信息
|
// 根据字典类型查询字典数据信息
|
||||||
@@ -22,7 +22,7 @@ export function getDicts(dictType) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/type/' + dictType,
|
url: '/system/dict/data/type/' + dictType,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增字典数据
|
// 新增字典数据
|
||||||
@@ -31,7 +31,7 @@ export function addData(data) {
|
|||||||
url: '/system/dict/data',
|
url: '/system/dict/data',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改字典数据
|
// 修改字典数据
|
||||||
@@ -40,7 +40,7 @@ export function updateData(data) {
|
|||||||
url: '/system/dict/data',
|
url: '/system/dict/data',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除字典数据
|
// 删除字典数据
|
||||||
@@ -48,5 +48,5 @@ export function delData(dictCode) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/data/' + dictCode,
|
url: '/system/dict/data/' + dictCode,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询字典类型列表
|
// 查询字典类型列表
|
||||||
export function listType(query) {
|
export function listType(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listType(query) {
|
|||||||
url: '/system/dict/type/list',
|
url: '/system/dict/type/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询字典类型详细
|
// 查询字典类型详细
|
||||||
@@ -14,7 +14,7 @@ export function getType(dictId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/' + dictId,
|
url: '/system/dict/type/' + dictId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增字典类型
|
// 新增字典类型
|
||||||
@@ -23,7 +23,7 @@ export function addType(data) {
|
|||||||
url: '/system/dict/type',
|
url: '/system/dict/type',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改字典类型
|
// 修改字典类型
|
||||||
@@ -32,7 +32,7 @@ export function updateType(data) {
|
|||||||
url: '/system/dict/type',
|
url: '/system/dict/type',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除字典类型
|
// 删除字典类型
|
||||||
@@ -40,7 +40,7 @@ export function delType(dictId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/' + dictId,
|
url: '/system/dict/type/' + dictId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 刷新字典缓存
|
// 刷新字典缓存
|
||||||
@@ -48,7 +48,7 @@ export function refreshCache() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/refreshCache',
|
url: '/system/dict/type/refreshCache',
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取字典选择框列表
|
// 获取字典选择框列表
|
||||||
@@ -56,5 +56,5 @@ export function optionselect() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/dict/type/optionselect',
|
url: '/system/dict/type/optionselect',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
49
src/api/system/employee.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
export default {
|
||||||
|
pageList(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/system/employee/list',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getById(id) {
|
||||||
|
return request({
|
||||||
|
url: `/system/employee/${id}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/system/employee',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
update(data = {}) {
|
||||||
|
return request({
|
||||||
|
url: '/system/employee',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delete(id) {
|
||||||
|
return request({
|
||||||
|
url: `/system/employee/${id}`,
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getEmployee() {
|
||||||
|
return request({
|
||||||
|
url: '/system/employee/getEmployees',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
getSignPlace(userId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/employee/signPlace/' + userId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
35
src/api/system/maillist.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询通讯录列表
|
||||||
|
export function getMaillistTableList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/maillist/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增通讯录
|
||||||
|
export function insertMaillist(params) {
|
||||||
|
return request({
|
||||||
|
url: '/system/maillist',
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 修改通讯录
|
||||||
|
export function updateMaillist(params) {
|
||||||
|
return request({
|
||||||
|
url: '/system/maillist',
|
||||||
|
method: 'put',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除通讯录
|
||||||
|
export function deleteMaillist(params) {
|
||||||
|
return request({
|
||||||
|
url: '/system/maillist/' + params,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询菜单列表
|
// 查询菜单列表
|
||||||
export function listMenu(query) {
|
export function listMenu(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listMenu(query) {
|
|||||||
url: '/system/menu/list',
|
url: '/system/menu/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询菜单详细
|
// 查询菜单详细
|
||||||
@@ -14,7 +14,7 @@ export function getMenu(menuId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/menu/' + menuId,
|
url: '/system/menu/' + menuId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询菜单下拉树结构
|
// 查询菜单下拉树结构
|
||||||
@@ -22,7 +22,7 @@ export function treeselect() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/menu/treeselect',
|
url: '/system/menu/treeselect',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据角色ID查询菜单下拉树结构
|
// 根据角色ID查询菜单下拉树结构
|
||||||
@@ -30,7 +30,7 @@ export function roleMenuTreeselect(roleId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/menu/roleMenuTreeselect/' + roleId,
|
url: '/system/menu/roleMenuTreeselect/' + roleId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增菜单
|
// 新增菜单
|
||||||
@@ -39,7 +39,7 @@ export function addMenu(data) {
|
|||||||
url: '/system/menu',
|
url: '/system/menu',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改菜单
|
// 修改菜单
|
||||||
@@ -48,7 +48,7 @@ export function updateMenu(data) {
|
|||||||
url: '/system/menu',
|
url: '/system/menu',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除菜单
|
// 删除菜单
|
||||||
@@ -56,5 +56,5 @@ export function delMenu(menuId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/menu/' + menuId,
|
url: '/system/menu/' + menuId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询公告列表
|
// 查询公告列表
|
||||||
export function listNotice(query) {
|
export function listNotice(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listNotice(query) {
|
|||||||
url: '/system/notice/list',
|
url: '/system/notice/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询公告详细
|
// 查询公告详细
|
||||||
@@ -14,7 +14,7 @@ export function getNotice(noticeId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/notice/' + noticeId,
|
url: '/system/notice/' + noticeId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增公告
|
// 新增公告
|
||||||
@@ -23,7 +23,7 @@ export function addNotice(data) {
|
|||||||
url: '/system/notice',
|
url: '/system/notice',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改公告
|
// 修改公告
|
||||||
@@ -32,7 +32,7 @@ export function updateNotice(data) {
|
|||||||
url: '/system/notice',
|
url: '/system/notice',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除公告
|
// 删除公告
|
||||||
@@ -40,5 +40,5 @@ export function delNotice(noticeId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/notice/' + noticeId,
|
url: '/system/notice/' + noticeId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询岗位列表
|
// 查询岗位列表
|
||||||
export function listPost(query) {
|
export function listPost(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listPost(query) {
|
|||||||
url: '/system/post/list',
|
url: '/system/post/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询岗位详细
|
// 查询岗位详细
|
||||||
@@ -14,7 +14,7 @@ export function getPost(postId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/post/' + postId,
|
url: '/system/post/' + postId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增岗位
|
// 新增岗位
|
||||||
@@ -23,7 +23,7 @@ export function addPost(data) {
|
|||||||
url: '/system/post',
|
url: '/system/post',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改岗位
|
// 修改岗位
|
||||||
@@ -32,7 +32,7 @@ export function updatePost(data) {
|
|||||||
url: '/system/post',
|
url: '/system/post',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除岗位
|
// 删除岗位
|
||||||
@@ -40,5 +40,5 @@ export function delPost(postId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/post/' + postId,
|
url: '/system/post/' + postId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询角色列表
|
// 查询角色列表
|
||||||
export function listRole(query) {
|
export function listRole(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listRole(query) {
|
|||||||
url: '/system/role/list',
|
url: '/system/role/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询角色详细
|
// 查询角色详细
|
||||||
@@ -14,7 +14,7 @@ export function getRole(roleId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/role/' + roleId,
|
url: '/system/role/' + roleId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增角色
|
// 新增角色
|
||||||
@@ -23,7 +23,7 @@ export function addRole(data) {
|
|||||||
url: '/system/role',
|
url: '/system/role',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改角色
|
// 修改角色
|
||||||
@@ -32,7 +32,7 @@ export function updateRole(data) {
|
|||||||
url: '/system/role',
|
url: '/system/role',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 角色数据权限
|
// 角色数据权限
|
||||||
@@ -41,7 +41,7 @@ export function dataScope(data) {
|
|||||||
url: '/system/role/dataScope',
|
url: '/system/role/dataScope',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 角色状态修改
|
// 角色状态修改
|
||||||
@@ -49,12 +49,12 @@ export function changeRoleStatus(roleId, status) {
|
|||||||
const data = {
|
const data = {
|
||||||
roleId,
|
roleId,
|
||||||
status
|
status
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/system/role/changeStatus',
|
url: '/system/role/changeStatus',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除角色
|
// 删除角色
|
||||||
@@ -62,7 +62,7 @@ export function delRole(roleId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/role/' + roleId,
|
url: '/system/role/' + roleId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询角色已授权用户列表
|
// 查询角色已授权用户列表
|
||||||
@@ -71,7 +71,7 @@ export function allocatedUserList(query) {
|
|||||||
url: '/system/role/authUser/allocatedList',
|
url: '/system/role/authUser/allocatedList',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询角色未授权用户列表
|
// 查询角色未授权用户列表
|
||||||
@@ -80,7 +80,7 @@ export function unallocatedUserList(query) {
|
|||||||
url: '/system/role/authUser/unallocatedList',
|
url: '/system/role/authUser/unallocatedList',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消用户授权角色
|
// 取消用户授权角色
|
||||||
@@ -89,7 +89,7 @@ export function authUserCancel(data) {
|
|||||||
url: '/system/role/authUser/cancel',
|
url: '/system/role/authUser/cancel',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量取消用户授权角色
|
// 批量取消用户授权角色
|
||||||
@@ -98,7 +98,7 @@ export function authUserCancelAll(data) {
|
|||||||
url: '/system/role/authUser/cancelAll',
|
url: '/system/role/authUser/cancelAll',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: data
|
params: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 授权用户选择
|
// 授权用户选择
|
||||||
@@ -107,7 +107,7 @@ export function authUserSelectAll(data) {
|
|||||||
url: '/system/role/authUser/selectAll',
|
url: '/system/role/authUser/selectAll',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: data
|
params: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据角色ID查询部门树结构
|
// 根据角色ID查询部门树结构
|
||||||
@@ -115,5 +115,12 @@ export function deptTreeSelect(roleId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/role/deptTree/' + roleId,
|
url: '/system/role/deptTree/' + roleId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getRoleOptions() {
|
||||||
|
return request({
|
||||||
|
url: '/system/role/getRoles',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
28
src/api/system/summary.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询任务
|
||||||
|
export function getList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/summary/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询任务
|
||||||
|
export function getTask(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/summary',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存
|
||||||
|
export function saveTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/summary',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
import { parseStrEmpty } from "@/utils/ruoyi";
|
import { parseStrEmpty } from '@/utils/ruoyi';
|
||||||
|
|
||||||
// 查询用户列表
|
// 查询用户列表
|
||||||
export function listUser(query) {
|
export function listUser(query) {
|
||||||
@@ -7,7 +7,7 @@ export function listUser(query) {
|
|||||||
url: '/system/user/list',
|
url: '/system/user/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户详细
|
// 查询用户详细
|
||||||
@@ -15,7 +15,7 @@ export function getUser(userId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/user/' + parseStrEmpty(userId),
|
url: '/system/user/' + parseStrEmpty(userId),
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增用户
|
// 新增用户
|
||||||
@@ -24,7 +24,7 @@ export function addUser(data) {
|
|||||||
url: '/system/user',
|
url: '/system/user',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户
|
// 修改用户
|
||||||
@@ -33,7 +33,7 @@ export function updateUser(data) {
|
|||||||
url: '/system/user',
|
url: '/system/user',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除用户
|
// 删除用户
|
||||||
@@ -41,7 +41,7 @@ export function delUser(userId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/user/' + userId,
|
url: '/system/user/' + userId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
@@ -49,12 +49,12 @@ export function resetUserPwd(userId, password) {
|
|||||||
const data = {
|
const data = {
|
||||||
userId,
|
userId,
|
||||||
password
|
password
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/resetPwd',
|
url: '/system/user/resetPwd',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户状态修改
|
// 用户状态修改
|
||||||
@@ -62,12 +62,12 @@ export function changeUserStatus(userId, status) {
|
|||||||
const data = {
|
const data = {
|
||||||
userId,
|
userId,
|
||||||
status
|
status
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/changeStatus',
|
url: '/system/user/changeStatus',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询用户个人信息
|
// 查询用户个人信息
|
||||||
@@ -75,7 +75,7 @@ export function getUserProfile() {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile',
|
url: '/system/user/profile',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改用户个人信息
|
// 修改用户个人信息
|
||||||
@@ -84,7 +84,7 @@ export function updateUserProfile(data) {
|
|||||||
url: '/system/user/profile',
|
url: '/system/user/profile',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户密码重置
|
// 用户密码重置
|
||||||
@@ -92,12 +92,12 @@ export function updateUserPwd(oldPassword, newPassword) {
|
|||||||
const data = {
|
const data = {
|
||||||
oldPassword,
|
oldPassword,
|
||||||
newPassword
|
newPassword
|
||||||
}
|
};
|
||||||
return request({
|
return request({
|
||||||
url: '/system/user/profile/updatePwd',
|
url: '/system/user/profile/updatePwd',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: data
|
params: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用户头像上传
|
// 用户头像上传
|
||||||
@@ -106,7 +106,7 @@ export function uploadAvatar(data) {
|
|||||||
url: '/system/user/profile/avatar',
|
url: '/system/user/profile/avatar',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询授权角色
|
// 查询授权角色
|
||||||
@@ -114,7 +114,7 @@ export function getAuthRole(userId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/system/user/authRole/' + userId,
|
url: '/system/user/authRole/' + userId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存授权角色
|
// 保存授权角色
|
||||||
@@ -123,13 +123,5 @@ export function updateAuthRole(data) {
|
|||||||
url: '/system/user/authRole',
|
url: '/system/user/authRole',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: data
|
params: data
|
||||||
})
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// 查询部门下拉树结构
|
|
||||||
export function deptTreeSelect() {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/deptTree',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|||||||
0
src/api/tool/common.js
Normal file
@@ -1,4 +1,4 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 查询生成表数据
|
// 查询生成表数据
|
||||||
export function listTable(query) {
|
export function listTable(query) {
|
||||||
@@ -6,7 +6,7 @@ export function listTable(query) {
|
|||||||
url: '/tool/gen/list',
|
url: '/tool/gen/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 查询db数据库列表
|
// 查询db数据库列表
|
||||||
export function listDbTable(query) {
|
export function listDbTable(query) {
|
||||||
@@ -14,7 +14,7 @@ export function listDbTable(query) {
|
|||||||
url: '/tool/gen/db/list',
|
url: '/tool/gen/db/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询表详细信息
|
// 查询表详细信息
|
||||||
@@ -22,7 +22,7 @@ export function getGenTable(tableId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/tool/gen/' + tableId,
|
url: '/tool/gen/' + tableId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改代码生成信息
|
// 修改代码生成信息
|
||||||
@@ -31,7 +31,7 @@ export function updateGenTable(data) {
|
|||||||
url: '/tool/gen',
|
url: '/tool/gen',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导入表
|
// 导入表
|
||||||
@@ -40,7 +40,7 @@ export function importTable(data) {
|
|||||||
url: '/tool/gen/importTable',
|
url: '/tool/gen/importTable',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: data
|
params: data
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 预览生成代码
|
// 预览生成代码
|
||||||
@@ -48,7 +48,7 @@ export function previewTable(tableId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/tool/gen/preview/' + tableId,
|
url: '/tool/gen/preview/' + tableId,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除表数据
|
// 删除表数据
|
||||||
@@ -56,7 +56,7 @@ export function delTable(tableId) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/tool/gen/' + tableId,
|
url: '/tool/gen/' + tableId,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成代码(自定义路径)
|
// 生成代码(自定义路径)
|
||||||
@@ -64,7 +64,7 @@ export function genCode(tableName) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/tool/gen/genCode/' + tableName,
|
url: '/tool/gen/genCode/' + tableName,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同步数据库
|
// 同步数据库
|
||||||
@@ -72,5 +72,5 @@ export function synchDb(tableName) {
|
|||||||
return request({
|
return request({
|
||||||
url: '/tool/gen/synchDb/' + tableName,
|
url: '/tool/gen/synchDb/' + tableName,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
0
src/api/tool/map.js
Normal file
212
src/api/zs/clue.js
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询线索列表
|
||||||
|
export function getClueList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询线索列表
|
||||||
|
export function getClueInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/' + id,
|
||||||
|
method: 'get',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 新增线索
|
||||||
|
export function addClue(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改线索
|
||||||
|
export function updateClue(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export function deleteClue(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue',
|
||||||
|
method: 'delete',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 导出
|
||||||
|
export function exportData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/export',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入模板
|
||||||
|
export function importTemplate(param) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/importTemplate',
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 导入
|
||||||
|
export function importData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/importData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询登记getSign
|
||||||
|
export function getSign(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/sign',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 保存登记
|
||||||
|
export function saveSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/sign',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 甩单
|
||||||
|
export function saveDistribute(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/distribute',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 驳回
|
||||||
|
export function refuse(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/refuse',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询甩单记录
|
||||||
|
export function getDistributeRecord(param) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/clue/distributerecord',
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询跟踪记录
|
||||||
|
export function getFollowRecord(param) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/followrecord/list',
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询咨询记录
|
||||||
|
export function getConsultRecord(param) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/consultrecord/list',
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 获取已过期
|
||||||
|
export function getClueCountBadge() {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/badgeCount`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量更新
|
||||||
|
export function batchUpdate(data) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/batchUpdate`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 公海线索 getPublicList
|
||||||
|
export function getPublicList(param) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/public/list`,
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拾取线索
|
||||||
|
export function pickupClue(data) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/public/pickup`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 丢弃线索
|
||||||
|
export function discardClue(data) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/public/discard`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询接收
|
||||||
|
export function getAccept() {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/accept`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 丢弃线索
|
||||||
|
export function updateAccept(data) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/accept`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询线索分发信息
|
||||||
|
export function getCluePlaceList(data) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/place/info`,
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存线索分发信息
|
||||||
|
export function saveCluePlace(data) {
|
||||||
|
return request({
|
||||||
|
url: `/zs/clue/place`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
44
src/api/zs/office.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询报名点列表
|
||||||
|
export function listOffice(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/office/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询报名点详细
|
||||||
|
export function getOffice(officeId) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/office/' + officeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报名点
|
||||||
|
export function addOffice(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/office',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报名点
|
||||||
|
export function updateOffice(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/office',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报名点
|
||||||
|
export function delOffice(officeId) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/office/' + officeId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
53
src/api/zs/placeSign.js
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询报名点成交登记列表
|
||||||
|
export function listSign(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/placeSign/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询报名点成交登记详细
|
||||||
|
export function getSign(placeSignId) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/placeSign/' + placeSignId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增报名点成交登记
|
||||||
|
export function addSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/placeSign',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改报名点成交登记
|
||||||
|
export function updateSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/placeSign',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除报名点成交登记
|
||||||
|
export function delSign(placeSignId) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/placeSign/' + placeSignId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//审核登记
|
||||||
|
export function checkSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/placeSign/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
93
src/api/zs/sign.js
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// 查询线索列表
|
||||||
|
export function getSignList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询线索列表
|
||||||
|
export function getSign(id) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/' + id,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
export function exportData(query) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/export',
|
||||||
|
method: 'post',
|
||||||
|
data: query
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入模板
|
||||||
|
export function importTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/importTemplate',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 导入
|
||||||
|
export function importData(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/importData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getClues(param) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/clue',
|
||||||
|
method: 'get',
|
||||||
|
params: param
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign',
|
||||||
|
method: 'delete',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核登记
|
||||||
|
export function checkSign(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/check',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核记录
|
||||||
|
export function getCheckRecord(data) {
|
||||||
|
return request({
|
||||||
|
url: '/zs/sign/check',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue';
|
||||||
import SvgIcon from '@/components/SvgIcon'// svg component
|
import SvgIcon from '@/components/SvgIcon'; // svg component
|
||||||
|
|
||||||
// register globally
|
// register globally
|
||||||
Vue.component('svg-icon', SvgIcon)
|
Vue.component('SvgIcon', SvgIcon);
|
||||||
|
|
||||||
const req = require.context('./svg', false, /\.svg$/)
|
const req = require.context('./svg', false, /\.svg$/);
|
||||||
const requireAll = requireContext => requireContext.keys().map(requireContext)
|
const requireAll = (requireContext) => requireContext.keys().map(requireContext);
|
||||||
requireAll(req)
|
requireAll(req);
|
||||||
|
|||||||
BIN
src/assets/images/place/flag_black.png
Normal file
|
After Width: | Height: | Size: 341 B |
BIN
src/assets/images/place/flag_blue.png
Normal file
|
After Width: | Height: | Size: 357 B |
BIN
src/assets/images/place/flag_green.png
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
src/assets/images/place/flag_purple.png
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
src/assets/images/place/flag_red.png
Normal file
|
After Width: | Height: | Size: 358 B |
BIN
src/assets/images/place/flag_yellow.png
Normal file
|
After Width: | Height: | Size: 355 B |
BIN
src/assets/images/place/position_black.png
Normal file
|
After Width: | Height: | Size: 903 B |
BIN
src/assets/images/place/position_blue.png
Normal file
|
After Width: | Height: | Size: 958 B |
BIN
src/assets/images/place/position_green.png
Normal file
|
After Width: | Height: | Size: 926 B |
BIN
src/assets/images/place/position_purple.png
Normal file
|
After Width: | Height: | Size: 926 B |
BIN
src/assets/images/place/position_red.png
Normal file
|
After Width: | Height: | Size: 950 B |
BIN
src/assets/images/place/position_yellow.png
Normal file
|
After Width: | Height: | Size: 970 B |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 137 KiB |
BIN
src/assets/logo/logo1.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
85
src/assets/styles/element-ui.css
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
@charset "UTF-8";
|
||||||
|
.el-breadcrumb__inner,
|
||||||
|
.el-breadcrumb__inner a {
|
||||||
|
font-weight: 400 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload input[type="file"] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-upload__input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell .el-tag {
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.small-padding .cell {
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fixed-width .el-button--mini {
|
||||||
|
padding: 7px 10px;
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-col .cell {
|
||||||
|
padding: 0 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-col .cell .el-tag {
|
||||||
|
margin-right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dialog {
|
||||||
|
transform: none;
|
||||||
|
left: 0;
|
||||||
|
position: relative;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-container .el-upload {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-container .el-upload .el-upload-dragger {
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-dropdown-menu a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-textarea__inner {
|
||||||
|
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-range-editor.el-input__inner {
|
||||||
|
display: inline-flex !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-range-separator {
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-menu--collapse
|
||||||
|
> div
|
||||||
|
> .el-submenu
|
||||||
|
> .el-submenu__title
|
||||||
|
.el-submenu__icon-arrow {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-card {
|
||||||
|
border-radius: 0;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-form-item--mini.el-form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
1
src/assets/styles/element-ui.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.el-breadcrumb__inner,.el-breadcrumb__inner a{font-weight:400 !important}.el-upload input[type="file"]{display:none !important}.el-upload__input{display:none}.cell .el-tag{margin-right:0px}.small-padding .cell{padding-left:5px;padding-right:5px}.fixed-width .el-button--mini{padding:7px 10px;width:60px}.status-col .cell{padding:0 10px;text-align:center}.status-col .cell .el-tag{margin-right:0px}.el-dialog{transform:none;left:0;position:relative;margin:0 auto}.upload-container .el-upload{width:100%}.upload-container .el-upload .el-upload-dragger{width:100%;height:200px}.el-dropdown-menu a{display:block}.el-textarea__inner{font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif}.el-range-editor.el-input__inner{display:inline-flex !important}.el-range-separator{box-sizing:content-box}.el-menu--collapse>div>.el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}.el-card{border-radius:0;border:none}.el-form-item--mini.el-form-item{margin-bottom:10px}
|
||||||
@@ -99,3 +99,6 @@
|
|||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
.el-form-item--mini.el-form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
@@ -233,3 +233,13 @@ aside {
|
|||||||
padding: 15px 20px 0 20px;
|
padding: 15px 20px 0 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.amap-sug-result {
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.impowerBox .qrcode {
|
||||||
|
width: 80px;
|
||||||
|
margin-top: 15px;
|
||||||
|
border: 1px solid #e2e2e2;
|
||||||
|
}
|
||||||
5
src/assets/styles/wx.scss
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
.impowerBox .qrcode {width: 200px;}
|
||||||
|
.impowerBox .title {display: none;}
|
||||||
|
.impowerBox .info {width: 200px;}
|
||||||
|
.status_icon {display: none}
|
||||||
|
.impowerBox .status {text-align: center;}
|
||||||
@@ -14,49 +14,54 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
levelList: null
|
levelList: null
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
$route(route) {
|
$route(route) {
|
||||||
// if you go to the redirect page, do not update the breadcrumbs
|
// if you go to the redirect page, do not update the breadcrumbs
|
||||||
if (route.path.startsWith('/redirect/')) {
|
if (route.path.startsWith('/redirect/')) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
this.getBreadcrumb()
|
this.getBreadcrumb();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getBreadcrumb()
|
this.getBreadcrumb();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getBreadcrumb() {
|
getBreadcrumb() {
|
||||||
// only show routes with meta.title
|
// only show routes with meta.title
|
||||||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
|
let matched = this.$route.matched.filter((item) => item.meta && item.meta.title);
|
||||||
const first = matched[0]
|
const first = matched[0];
|
||||||
|
|
||||||
if (!this.isDashboard(first)) {
|
if (!this.isDashboard(first)) {
|
||||||
matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched)
|
matched = [
|
||||||
|
{
|
||||||
|
path: '/index',
|
||||||
|
meta: { title: '首页' }
|
||||||
|
}
|
||||||
|
].concat(matched);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
this.levelList = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
|
||||||
},
|
},
|
||||||
isDashboard(route) {
|
isDashboard(route) {
|
||||||
const name = route && route.name
|
const name = route && route.name;
|
||||||
if (!name) {
|
if (!name) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
return name.trim() === 'Index'
|
return name.trim() === 'Index';
|
||||||
},
|
},
|
||||||
handleLink(item) {
|
handleLink(item) {
|
||||||
const { redirect, path } = item
|
const { redirect, path } = item;
|
||||||
if (redirect) {
|
if (redirect) {
|
||||||
this.$router.push(redirect)
|
this.$router.push(redirect);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
this.$router.push(path)
|
this.$router.push(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -1,161 +1,162 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1">
|
||||||
日,允许的通配符[, - * ? / L W]
|
日,允许的通配符[, - * ? / L W]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
不指定
|
不指定
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="1" :max="30" /> -
|
<el-input-number v-model="cycle01" :min="1" :max="30" /> -
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 2" :max="31" /> 日
|
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="31" /> 日
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="1" :max="30" /> 号开始,每
|
<el-input-number v-model="average01" :min="1" :max="30" /> 号开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="31 - average01 || 1" /> 日执行一次
|
<el-input-number v-model="average02" :min="1" :max="31 - average01 || 1" /> 日执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="5">
|
<el-radio v-model="radioValue" :label="5">
|
||||||
每月
|
每月
|
||||||
<el-input-number v-model='workday' :min="1" :max="31" /> 号最近的那个工作日
|
<el-input-number v-model="workday" :min="1" :max="31" /> 号最近的那个工作日
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="6">
|
<el-radio v-model="radioValue" :label="6">
|
||||||
本月最后一天
|
本月最后一天
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="7">
|
<el-radio v-model="radioValue" :label="7">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
|
||||||
<el-option v-for="item in 31" :key="item" :value="item">{{item}}</el-option>
|
<el-option v-for="item in 31" :key="item" :value="item">{{ item }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabDay',
|
||||||
return {
|
// eslint-disable-next-line vue/require-prop-types
|
||||||
radioValue: 1,
|
props: ['check', 'cron'],
|
||||||
workday: 1,
|
data() {
|
||||||
cycle01: 1,
|
return {
|
||||||
cycle02: 2,
|
radioValue: 1,
|
||||||
average01: 1,
|
workday: 1,
|
||||||
average02: 1,
|
cycle01: 1,
|
||||||
checkboxList: [],
|
cycle02: 2,
|
||||||
checkNum: this.$options.propsData.check
|
average01: 1,
|
||||||
}
|
average02: 1,
|
||||||
},
|
checkboxList: [],
|
||||||
name: 'crontab-day',
|
checkNum: this.$options.propsData.check
|
||||||
props: ['check', 'cron'],
|
};
|
||||||
methods: {
|
},
|
||||||
// 单选按钮值变化时
|
computed: {
|
||||||
radioChange() {
|
// 计算两个周期值
|
||||||
('day rachange');
|
cycleTotal: function () {
|
||||||
if (this.radioValue !== 2 && this.cron.week !== '?') {
|
const cycle01 = this.checkNum(this.cycle01, 1, 30);
|
||||||
this.$emit('update', 'week', '?', 'day')
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 31, 31);
|
||||||
}
|
return cycle01 + '-' + cycle02;
|
||||||
|
},
|
||||||
|
// 计算平均用到的值
|
||||||
|
averageTotal: function () {
|
||||||
|
const average01 = this.checkNum(this.average01, 1, 30);
|
||||||
|
const average02 = this.checkNum(this.average02, 1, 31 - average01 || 0);
|
||||||
|
return average01 + '/' + average02;
|
||||||
|
},
|
||||||
|
// 计算工作日格式
|
||||||
|
workdayCheck: function () {
|
||||||
|
const workday = this.checkNum(this.workday, 1, 31);
|
||||||
|
return workday;
|
||||||
|
},
|
||||||
|
// 计算勾选的checkbox值合集
|
||||||
|
checkboxString: function () {
|
||||||
|
const str = this.checkboxList.join();
|
||||||
|
return str === '' ? '*' : str;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
radioValue: 'radioChange',
|
||||||
|
cycleTotal: 'cycleChange',
|
||||||
|
averageTotal: 'averageChange',
|
||||||
|
workdayCheck: 'workdayChange',
|
||||||
|
checkboxString: 'checkboxChange'
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 单选按钮值变化时
|
||||||
|
radioChange() {
|
||||||
|
('day rachange');
|
||||||
|
if (this.radioValue !== 2 && this.cron.week !== '?') {
|
||||||
|
this.$emit('update', 'week', '?', 'day');
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.radioValue) {
|
switch (this.radioValue) {
|
||||||
case 1:
|
case 1:
|
||||||
this.$emit('update', 'day', '*');
|
this.$emit('update', 'day', '*');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
this.$emit('update', 'day', '?');
|
this.$emit('update', 'day', '?');
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
this.$emit('update', 'day', this.cycleTotal);
|
this.$emit('update', 'day', this.cycleTotal);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
this.$emit('update', 'day', this.averageTotal);
|
this.$emit('update', 'day', this.averageTotal);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
this.$emit('update', 'day', this.workday + 'W');
|
this.$emit('update', 'day', this.workday + 'W');
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
this.$emit('update', 'day', 'L');
|
this.$emit('update', 'day', 'L');
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
this.$emit('update', 'day', this.checkboxString);
|
this.$emit('update', 'day', this.checkboxString);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
('day rachange end');
|
('day rachange end');
|
||||||
},
|
},
|
||||||
// 周期两个值变化时
|
// 周期两个值变化时
|
||||||
cycleChange() {
|
cycleChange() {
|
||||||
if (this.radioValue == '3') {
|
if (this.radioValue === '3') {
|
||||||
this.$emit('update', 'day', this.cycleTotal);
|
this.$emit('update', 'day', this.cycleTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 平均两个值变化时
|
// 平均两个值变化时
|
||||||
averageChange() {
|
averageChange() {
|
||||||
if (this.radioValue == '4') {
|
if (this.radioValue === '4') {
|
||||||
this.$emit('update', 'day', this.averageTotal);
|
this.$emit('update', 'day', this.averageTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 最近工作日值变化时
|
// 最近工作日值变化时
|
||||||
workdayChange() {
|
workdayChange() {
|
||||||
if (this.radioValue == '5') {
|
if (this.radioValue === '5') {
|
||||||
this.$emit('update', 'day', this.workdayCheck + 'W');
|
this.$emit('update', 'day', this.workdayCheck + 'W');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// checkbox值变化时
|
// checkbox值变化时
|
||||||
checkboxChange() {
|
checkboxChange() {
|
||||||
if (this.radioValue == '7') {
|
if (this.radioValue === '7') {
|
||||||
this.$emit('update', 'day', this.checkboxString);
|
this.$emit('update', 'day', this.checkboxString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
watch: {
|
};
|
||||||
'radioValue': 'radioChange',
|
|
||||||
'cycleTotal': 'cycleChange',
|
|
||||||
'averageTotal': 'averageChange',
|
|
||||||
'workdayCheck': 'workdayChange',
|
|
||||||
'checkboxString': 'checkboxChange',
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 计算两个周期值
|
|
||||||
cycleTotal: function () {
|
|
||||||
const cycle01 = this.checkNum(this.cycle01, 1, 30)
|
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 31, 31)
|
|
||||||
return cycle01 + '-' + cycle02;
|
|
||||||
},
|
|
||||||
// 计算平均用到的值
|
|
||||||
averageTotal: function () {
|
|
||||||
const average01 = this.checkNum(this.average01, 1, 30)
|
|
||||||
const average02 = this.checkNum(this.average02, 1, 31 - average01 || 0)
|
|
||||||
return average01 + '/' + average02;
|
|
||||||
},
|
|
||||||
// 计算工作日格式
|
|
||||||
workdayCheck: function () {
|
|
||||||
const workday = this.checkNum(this.workday, 1, 31)
|
|
||||||
return workday;
|
|
||||||
},
|
|
||||||
// 计算勾选的checkbox值合集
|
|
||||||
checkboxString: function () {
|
|
||||||
let str = this.checkboxList.join();
|
|
||||||
return str == '' ? '*' : str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,114 +1,115 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1">
|
||||||
小时,允许的通配符[, - * /]
|
小时,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="0" :max="22" /> -
|
<el-input-number v-model="cycle01" :min="0" :max="22" /> -
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
|
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="0" :max="22" /> 小时开始,每
|
<el-input-number v-model="average01" :min="0" :max="22" /> 小时开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="23 - average01 || 0" /> 小时执行一次
|
<el-input-number v-model="average02" :min="1" :max="23 - average01 || 0" /> 小时执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
|
||||||
<el-option v-for="item in 24" :key="item" :value="item-1">{{item-1}}</el-option>
|
<el-option v-for="item in 24" :key="item" :value="item-1">{{ item-1 }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabHour',
|
||||||
return {
|
// eslint-disable-next-line vue/require-prop-types
|
||||||
radioValue: 1,
|
props: ['check', 'cron'],
|
||||||
cycle01: 0,
|
data() {
|
||||||
cycle02: 1,
|
return {
|
||||||
average01: 0,
|
radioValue: 1,
|
||||||
average02: 1,
|
cycle01: 0,
|
||||||
checkboxList: [],
|
cycle02: 1,
|
||||||
checkNum: this.$options.propsData.check
|
average01: 0,
|
||||||
}
|
average02: 1,
|
||||||
},
|
checkboxList: [],
|
||||||
name: 'crontab-hour',
|
checkNum: this.$options.propsData.check
|
||||||
props: ['check', 'cron'],
|
};
|
||||||
methods: {
|
},
|
||||||
// 单选按钮值变化时
|
computed: {
|
||||||
radioChange() {
|
// 计算两个周期值
|
||||||
switch (this.radioValue) {
|
cycleTotal: function () {
|
||||||
case 1:
|
const cycle01 = this.checkNum(this.cycle01, 0, 22);
|
||||||
this.$emit('update', 'hour', '*')
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 23);
|
||||||
break;
|
return cycle01 + '-' + cycle02;
|
||||||
case 2:
|
},
|
||||||
this.$emit('update', 'hour', this.cycleTotal);
|
// 计算平均用到的值
|
||||||
break;
|
averageTotal: function () {
|
||||||
case 3:
|
const average01 = this.checkNum(this.average01, 0, 22);
|
||||||
this.$emit('update', 'hour', this.averageTotal);
|
const average02 = this.checkNum(this.average02, 1, 23 - average01 || 0);
|
||||||
break;
|
return average01 + '/' + average02;
|
||||||
case 4:
|
},
|
||||||
this.$emit('update', 'hour', this.checkboxString);
|
// 计算勾选的checkbox值合集
|
||||||
break;
|
checkboxString: function () {
|
||||||
}
|
const str = this.checkboxList.join();
|
||||||
},
|
return str === '' ? '*' : str;
|
||||||
// 周期两个值变化时
|
}
|
||||||
cycleChange() {
|
},
|
||||||
if (this.radioValue == '2') {
|
watch: {
|
||||||
this.$emit('update', 'hour', this.cycleTotal);
|
radioValue: 'radioChange',
|
||||||
}
|
cycleTotal: 'cycleChange',
|
||||||
},
|
averageTotal: 'averageChange',
|
||||||
// 平均两个值变化时
|
checkboxString: 'checkboxChange'
|
||||||
averageChange() {
|
},
|
||||||
if (this.radioValue == '3') {
|
methods: {
|
||||||
this.$emit('update', 'hour', this.averageTotal);
|
// 单选按钮值变化时
|
||||||
}
|
radioChange() {
|
||||||
},
|
switch (this.radioValue) {
|
||||||
// checkbox值变化时
|
case 1:
|
||||||
checkboxChange() {
|
this.$emit('update', 'hour', '*');
|
||||||
if (this.radioValue == '4') {
|
break;
|
||||||
this.$emit('update', 'hour', this.checkboxString);
|
case 2:
|
||||||
}
|
this.$emit('update', 'hour', this.cycleTotal);
|
||||||
}
|
break;
|
||||||
},
|
case 3:
|
||||||
watch: {
|
this.$emit('update', 'hour', this.averageTotal);
|
||||||
'radioValue': 'radioChange',
|
break;
|
||||||
'cycleTotal': 'cycleChange',
|
case 4:
|
||||||
'averageTotal': 'averageChange',
|
this.$emit('update', 'hour', this.checkboxString);
|
||||||
'checkboxString': 'checkboxChange'
|
break;
|
||||||
},
|
}
|
||||||
computed: {
|
},
|
||||||
// 计算两个周期值
|
// 周期两个值变化时
|
||||||
cycleTotal: function () {
|
cycleChange() {
|
||||||
const cycle01 = this.checkNum(this.cycle01, 0, 22)
|
if (this.radioValue === '2') {
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 23)
|
this.$emit('update', 'hour', this.cycleTotal);
|
||||||
return cycle01 + '-' + cycle02;
|
}
|
||||||
},
|
},
|
||||||
// 计算平均用到的值
|
// 平均两个值变化时
|
||||||
averageTotal: function () {
|
averageChange() {
|
||||||
const average01 = this.checkNum(this.average01, 0, 22)
|
if (this.radioValue === '3') {
|
||||||
const average02 = this.checkNum(this.average02, 1, 23 - average01 || 0)
|
this.$emit('update', 'hour', this.averageTotal);
|
||||||
return average01 + '/' + average02;
|
}
|
||||||
},
|
},
|
||||||
// 计算勾选的checkbox值合集
|
// checkbox值变化时
|
||||||
checkboxString: function () {
|
checkboxChange() {
|
||||||
let str = this.checkboxList.join();
|
if (this.radioValue === '4') {
|
||||||
return str == '' ? '*' : str;
|
this.$emit('update', 'hour', this.checkboxString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,67 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="秒" v-if="shouldHide('second')">
|
<el-tab-pane v-if="shouldHide('second')" label="秒">
|
||||||
<CrontabSecond
|
<CrontabSecond ref="cronsecond" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronsecond"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="分钟" v-if="shouldHide('min')">
|
<el-tab-pane v-if="shouldHide('min')" label="分钟">
|
||||||
<CrontabMin
|
<CrontabMin ref="cronmin" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronmin"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="小时" v-if="shouldHide('hour')">
|
<el-tab-pane v-if="shouldHide('hour')" label="小时">
|
||||||
<CrontabHour
|
<CrontabHour ref="cronhour" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronhour"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="日" v-if="shouldHide('day')">
|
<el-tab-pane v-if="shouldHide('day')" label="日">
|
||||||
<CrontabDay
|
<CrontabDay ref="cronday" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronday"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="月" v-if="shouldHide('month')">
|
<el-tab-pane v-if="shouldHide('month')" label="月">
|
||||||
<CrontabMonth
|
<CrontabMonth ref="cronmonth" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronmonth"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="周" v-if="shouldHide('week')">
|
<el-tab-pane v-if="shouldHide('week')" label="周">
|
||||||
<CrontabWeek
|
<CrontabWeek ref="cronweek" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronweek"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
|
||||||
<el-tab-pane label="年" v-if="shouldHide('year')">
|
<el-tab-pane v-if="shouldHide('year')" label="年">
|
||||||
<CrontabYear
|
<CrontabYear ref="cronyear" :check="checkNumber" :cron="crontabValueObj" @update="updateCrontabValue" />
|
||||||
@update="updateCrontabValue"
|
|
||||||
:check="checkNumber"
|
|
||||||
:cron="crontabValueObj"
|
|
||||||
ref="cronyear"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
@@ -70,38 +35,38 @@
|
|||||||
<p class="title">时间表达式</p>
|
<p class="title">时间表达式</p>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<th v-for="item of tabTitles" width="40" :key="item">{{item}}</th>
|
<th v-for="item of tabTitles" :key="item" width="40">{{ item }}</th>
|
||||||
<th>Cron 表达式</th>
|
<th>Cron 表达式</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.second}}</span>
|
<span>{{ crontabValueObj.second }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.min}}</span>
|
<span>{{ crontabValueObj.min }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.hour}}</span>
|
<span>{{ crontabValueObj.hour }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.day}}</span>
|
<span>{{ crontabValueObj.day }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.month}}</span>
|
<span>{{ crontabValueObj.month }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.week}}</span>
|
<span>{{ crontabValueObj.week }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueObj.year}}</span>
|
<span>{{ crontabValueObj.year }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span>{{crontabValueString}}</span>
|
<span>{{ crontabValueString }}</span>
|
||||||
</td>
|
</td>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<CrontabResult :ex="crontabValueString"></CrontabResult>
|
<CrontabResult :ex="crontabValueString" />
|
||||||
|
|
||||||
<div class="pop_btn">
|
<div class="pop_btn">
|
||||||
<el-button size="small" type="primary" @click="submitFill">确定</el-button>
|
<el-button size="small" type="primary" @click="submitFill">确定</el-button>
|
||||||
@@ -113,34 +78,62 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CrontabSecond from "./second.vue";
|
import CrontabSecond from './second.vue';
|
||||||
import CrontabMin from "./min.vue";
|
import CrontabMin from './min.vue';
|
||||||
import CrontabHour from "./hour.vue";
|
import CrontabHour from './hour.vue';
|
||||||
import CrontabDay from "./day.vue";
|
import CrontabDay from './day.vue';
|
||||||
import CrontabMonth from "./month.vue";
|
import CrontabMonth from './month.vue';
|
||||||
import CrontabWeek from "./week.vue";
|
import CrontabWeek from './week.vue';
|
||||||
import CrontabYear from "./year.vue";
|
import CrontabYear from './year.vue';
|
||||||
import CrontabResult from "./result.vue";
|
import CrontabResult from './result.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'Vcrontab',
|
||||||
|
components: {
|
||||||
|
CrontabSecond,
|
||||||
|
CrontabMin,
|
||||||
|
CrontabHour,
|
||||||
|
CrontabDay,
|
||||||
|
CrontabMonth,
|
||||||
|
CrontabWeek,
|
||||||
|
CrontabYear,
|
||||||
|
CrontabResult
|
||||||
|
},
|
||||||
|
// eslint-disable-next-line vue/require-prop-types
|
||||||
|
props: ['expression', 'hideComponent'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tabTitles: ["秒", "分钟", "小时", "日", "月", "周", "年"],
|
tabTitles: ['秒', '分钟', '小时', '日', '月', '周', '年'],
|
||||||
tabActive: 0,
|
tabActive: 0,
|
||||||
myindex: 0,
|
myindex: 0,
|
||||||
crontabValueObj: {
|
crontabValueObj: {
|
||||||
second: "*",
|
second: '*',
|
||||||
min: "*",
|
min: '*',
|
||||||
hour: "*",
|
hour: '*',
|
||||||
day: "*",
|
day: '*',
|
||||||
month: "*",
|
month: '*',
|
||||||
week: "?",
|
week: '?',
|
||||||
year: "",
|
year: ''
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
name: "vcrontab",
|
computed: {
|
||||||
props: ["expression", "hideComponent"],
|
crontabValueString: function () {
|
||||||
|
const obj = this.crontabValueObj;
|
||||||
|
const str =
|
||||||
|
obj.second + ' ' + obj.min + ' ' + obj.hour + ' ' + obj.day + ' ' + obj.month + ' ' + obj.week + (obj.year == '' ? '' : ' ' + obj.year);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
expression: 'resolveExp',
|
||||||
|
hideComponent(value) {
|
||||||
|
// 隐藏部分组件
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.resolveExp();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
shouldHide(key) {
|
shouldHide(key) {
|
||||||
if (this.hideComponent && this.hideComponent.includes(key)) return false;
|
if (this.hideComponent && this.hideComponent.includes(key)) return false;
|
||||||
@@ -149,22 +142,22 @@ export default {
|
|||||||
resolveExp() {
|
resolveExp() {
|
||||||
// 反解析 表达式
|
// 反解析 表达式
|
||||||
if (this.expression) {
|
if (this.expression) {
|
||||||
let arr = this.expression.split(" ");
|
const arr = this.expression.split(' ');
|
||||||
if (arr.length >= 6) {
|
if (arr.length >= 6) {
|
||||||
//6 位以上是合法表达式
|
// 6 位以上是合法表达式
|
||||||
let obj = {
|
const obj = {
|
||||||
second: arr[0],
|
second: arr[0],
|
||||||
min: arr[1],
|
min: arr[1],
|
||||||
hour: arr[2],
|
hour: arr[2],
|
||||||
day: arr[3],
|
day: arr[3],
|
||||||
month: arr[4],
|
month: arr[4],
|
||||||
week: arr[5],
|
week: arr[5],
|
||||||
year: arr[6] ? arr[6] : "",
|
year: arr[6] ? arr[6] : ''
|
||||||
};
|
};
|
||||||
this.crontabValueObj = {
|
this.crontabValueObj = {
|
||||||
...obj,
|
...obj
|
||||||
};
|
};
|
||||||
for (let i in obj) {
|
for (const i in obj) {
|
||||||
if (obj[i]) this.changeRadio(i, obj[i]);
|
if (obj[i]) this.changeRadio(i, obj[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -179,7 +172,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 由子组件触发,更改表达式组成的字段值
|
// 由子组件触发,更改表达式组成的字段值
|
||||||
updateCrontabValue(name, value, from) {
|
updateCrontabValue(name, value, from) {
|
||||||
"updateCrontabValue", name, value, from;
|
// eslint-disable-next-line no-sequences
|
||||||
|
'updateCrontabValue', name, value, from;
|
||||||
this.crontabValueObj[name] = value;
|
this.crontabValueObj[name] = value;
|
||||||
if (from && from !== name) {
|
if (from && from !== name) {
|
||||||
console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
|
console.log(`来自组件 ${from} 改变了 ${name} ${value}`);
|
||||||
@@ -188,104 +182,88 @@ export default {
|
|||||||
},
|
},
|
||||||
// 赋值到组件
|
// 赋值到组件
|
||||||
changeRadio(name, value) {
|
changeRadio(name, value) {
|
||||||
let arr = ["second", "min", "hour", "month"],
|
const arr = ['second', 'min', 'hour', 'month'];
|
||||||
refName = "cron" + name,
|
const refName = 'cron' + name;
|
||||||
insValue;
|
let insValue;
|
||||||
|
|
||||||
if (!this.$refs[refName]) return;
|
if (!this.$refs[refName]) return;
|
||||||
|
|
||||||
if (arr.includes(name)) {
|
if (arr.includes(name)) {
|
||||||
if (value === "*") {
|
if (value === '*') {
|
||||||
insValue = 1;
|
insValue = 1;
|
||||||
} else if (value.indexOf("-") > -1) {
|
} else if (value.indexOf('-') > -1) {
|
||||||
let indexArr = value.split("-");
|
const indexArr = value.split('-');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].cycle01 = 0) : (this.$refs[refName].cycle01 = indexArr[0]);
|
||||||
? (this.$refs[refName].cycle01 = 0)
|
|
||||||
: (this.$refs[refName].cycle01 = indexArr[0]);
|
|
||||||
this.$refs[refName].cycle02 = indexArr[1];
|
this.$refs[refName].cycle02 = indexArr[1];
|
||||||
insValue = 2;
|
insValue = 2;
|
||||||
} else if (value.indexOf("/") > -1) {
|
} else if (value.indexOf('/') > -1) {
|
||||||
let indexArr = value.split("/");
|
const indexArr = value.split('/');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].average01 = 0) : (this.$refs[refName].average01 = indexArr[0]);
|
||||||
? (this.$refs[refName].average01 = 0)
|
|
||||||
: (this.$refs[refName].average01 = indexArr[0]);
|
|
||||||
this.$refs[refName].average02 = indexArr[1];
|
this.$refs[refName].average02 = indexArr[1];
|
||||||
insValue = 3;
|
insValue = 3;
|
||||||
} else {
|
} else {
|
||||||
insValue = 4;
|
insValue = 4;
|
||||||
this.$refs[refName].checkboxList = value.split(",");
|
this.$refs[refName].checkboxList = value.split(',');
|
||||||
}
|
}
|
||||||
} else if (name == "day") {
|
} else if (name == 'day') {
|
||||||
if (value === "*") {
|
if (value === '*') {
|
||||||
insValue = 1;
|
insValue = 1;
|
||||||
} else if (value == "?") {
|
} else if (value == '?') {
|
||||||
insValue = 2;
|
insValue = 2;
|
||||||
} else if (value.indexOf("-") > -1) {
|
} else if (value.indexOf('-') > -1) {
|
||||||
let indexArr = value.split("-");
|
const indexArr = value.split('-');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].cycle01 = 0) : (this.$refs[refName].cycle01 = indexArr[0]);
|
||||||
? (this.$refs[refName].cycle01 = 0)
|
|
||||||
: (this.$refs[refName].cycle01 = indexArr[0]);
|
|
||||||
this.$refs[refName].cycle02 = indexArr[1];
|
this.$refs[refName].cycle02 = indexArr[1];
|
||||||
insValue = 3;
|
insValue = 3;
|
||||||
} else if (value.indexOf("/") > -1) {
|
} else if (value.indexOf('/') > -1) {
|
||||||
let indexArr = value.split("/");
|
const indexArr = value.split('/');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].average01 = 0) : (this.$refs[refName].average01 = indexArr[0]);
|
||||||
? (this.$refs[refName].average01 = 0)
|
|
||||||
: (this.$refs[refName].average01 = indexArr[0]);
|
|
||||||
this.$refs[refName].average02 = indexArr[1];
|
this.$refs[refName].average02 = indexArr[1];
|
||||||
insValue = 4;
|
insValue = 4;
|
||||||
} else if (value.indexOf("W") > -1) {
|
} else if (value.indexOf('W') > -1) {
|
||||||
let indexArr = value.split("W");
|
const indexArr = value.split('W');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].workday = 0) : (this.$refs[refName].workday = indexArr[0]);
|
||||||
? (this.$refs[refName].workday = 0)
|
|
||||||
: (this.$refs[refName].workday = indexArr[0]);
|
|
||||||
insValue = 5;
|
insValue = 5;
|
||||||
} else if (value === "L") {
|
} else if (value === 'L') {
|
||||||
insValue = 6;
|
insValue = 6;
|
||||||
} else {
|
} else {
|
||||||
this.$refs[refName].checkboxList = value.split(",");
|
this.$refs[refName].checkboxList = value.split(',');
|
||||||
insValue = 7;
|
insValue = 7;
|
||||||
}
|
}
|
||||||
} else if (name == "week") {
|
} else if (name == 'week') {
|
||||||
if (value === "*") {
|
if (value === '*') {
|
||||||
insValue = 1;
|
insValue = 1;
|
||||||
} else if (value == "?") {
|
} else if (value == '?') {
|
||||||
insValue = 2;
|
insValue = 2;
|
||||||
} else if (value.indexOf("-") > -1) {
|
} else if (value.indexOf('-') > -1) {
|
||||||
let indexArr = value.split("-");
|
const indexArr = value.split('-');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].cycle01 = 0) : (this.$refs[refName].cycle01 = indexArr[0]);
|
||||||
? (this.$refs[refName].cycle01 = 0)
|
|
||||||
: (this.$refs[refName].cycle01 = indexArr[0]);
|
|
||||||
this.$refs[refName].cycle02 = indexArr[1];
|
this.$refs[refName].cycle02 = indexArr[1];
|
||||||
insValue = 3;
|
insValue = 3;
|
||||||
} else if (value.indexOf("#") > -1) {
|
} else if (value.indexOf('#') > -1) {
|
||||||
let indexArr = value.split("#");
|
const indexArr = value.split('#');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].average01 = 1) : (this.$refs[refName].average01 = indexArr[0]);
|
||||||
? (this.$refs[refName].average01 = 1)
|
|
||||||
: (this.$refs[refName].average01 = indexArr[0]);
|
|
||||||
this.$refs[refName].average02 = indexArr[1];
|
this.$refs[refName].average02 = indexArr[1];
|
||||||
insValue = 4;
|
insValue = 4;
|
||||||
} else if (value.indexOf("L") > -1) {
|
} else if (value.indexOf('L') > -1) {
|
||||||
let indexArr = value.split("L");
|
const indexArr = value.split('L');
|
||||||
isNaN(indexArr[0])
|
isNaN(indexArr[0]) ? (this.$refs[refName].weekday = 1) : (this.$refs[refName].weekday = indexArr[0]);
|
||||||
? (this.$refs[refName].weekday = 1)
|
|
||||||
: (this.$refs[refName].weekday = indexArr[0]);
|
|
||||||
insValue = 5;
|
insValue = 5;
|
||||||
} else {
|
} else {
|
||||||
this.$refs[refName].checkboxList = value.split(",");
|
this.$refs[refName].checkboxList = value.split(',');
|
||||||
insValue = 6;
|
insValue = 6;
|
||||||
}
|
}
|
||||||
} else if (name == "year") {
|
} else if (name == 'year') {
|
||||||
if (value == "") {
|
if (value == '') {
|
||||||
insValue = 1;
|
insValue = 1;
|
||||||
} else if (value == "*") {
|
} else if (value == '*') {
|
||||||
insValue = 2;
|
insValue = 2;
|
||||||
} else if (value.indexOf("-") > -1) {
|
} else if (value.indexOf('-') > -1) {
|
||||||
insValue = 3;
|
insValue = 3;
|
||||||
} else if (value.indexOf("/") > -1) {
|
} else if (value.indexOf('/') > -1) {
|
||||||
insValue = 4;
|
insValue = 4;
|
||||||
} else {
|
} else {
|
||||||
this.$refs[refName].checkboxList = value.split(",");
|
this.$refs[refName].checkboxList = value.split(',');
|
||||||
insValue = 5;
|
insValue = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -304,68 +282,30 @@ export default {
|
|||||||
},
|
},
|
||||||
// 隐藏弹窗
|
// 隐藏弹窗
|
||||||
hidePopup() {
|
hidePopup() {
|
||||||
this.$emit("hide");
|
this.$emit('hide');
|
||||||
},
|
},
|
||||||
// 填充表达式
|
// 填充表达式
|
||||||
submitFill() {
|
submitFill() {
|
||||||
this.$emit("fill", this.crontabValueString);
|
this.$emit('fill', this.crontabValueString);
|
||||||
this.hidePopup();
|
this.hidePopup();
|
||||||
},
|
},
|
||||||
clearCron() {
|
clearCron() {
|
||||||
// 还原选择项
|
// 还原选择项
|
||||||
("准备还原");
|
('准备还原');
|
||||||
this.crontabValueObj = {
|
this.crontabValueObj = {
|
||||||
second: "*",
|
second: '*',
|
||||||
min: "*",
|
min: '*',
|
||||||
hour: "*",
|
hour: '*',
|
||||||
day: "*",
|
day: '*',
|
||||||
month: "*",
|
month: '*',
|
||||||
week: "?",
|
week: '?',
|
||||||
year: "",
|
year: ''
|
||||||
};
|
};
|
||||||
for (let j in this.crontabValueObj) {
|
for (const j in this.crontabValueObj) {
|
||||||
this.changeRadio(j, this.crontabValueObj[j]);
|
this.changeRadio(j, this.crontabValueObj[j]);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
computed: {
|
|
||||||
crontabValueString: function() {
|
|
||||||
let obj = this.crontabValueObj;
|
|
||||||
let str =
|
|
||||||
obj.second +
|
|
||||||
" " +
|
|
||||||
obj.min +
|
|
||||||
" " +
|
|
||||||
obj.hour +
|
|
||||||
" " +
|
|
||||||
obj.day +
|
|
||||||
" " +
|
|
||||||
obj.month +
|
|
||||||
" " +
|
|
||||||
obj.week +
|
|
||||||
(obj.year == "" ? "" : " " + obj.year);
|
|
||||||
return str;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
CrontabSecond,
|
|
||||||
CrontabMin,
|
|
||||||
CrontabHour,
|
|
||||||
CrontabDay,
|
|
||||||
CrontabMonth,
|
|
||||||
CrontabWeek,
|
|
||||||
CrontabYear,
|
|
||||||
CrontabResult,
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
expression: "resolveExp",
|
|
||||||
hideComponent(value) {
|
|
||||||
// 隐藏部分组件
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted: function() {
|
|
||||||
this.resolveExp();
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -1,116 +1,115 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1">
|
||||||
分钟,允许的通配符[, - * /]
|
分钟,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="0" :max="58" /> -
|
<el-input-number v-model="cycle01" :min="0" :max="58" /> -
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟
|
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 分钟
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="0" :max="58" /> 分钟开始,每
|
<el-input-number v-model="average01" :min="0" :max="58" /> 分钟开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="59 - average01 || 0" /> 分钟执行一次
|
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 分钟执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
|
||||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabMin',
|
||||||
return {
|
props: ['check', 'cron'],
|
||||||
radioValue: 1,
|
data() {
|
||||||
cycle01: 1,
|
return {
|
||||||
cycle02: 2,
|
radioValue: 1,
|
||||||
average01: 0,
|
cycle01: 1,
|
||||||
average02: 1,
|
cycle02: 2,
|
||||||
checkboxList: [],
|
average01: 0,
|
||||||
checkNum: this.$options.propsData.check
|
average02: 1,
|
||||||
}
|
checkboxList: [],
|
||||||
},
|
checkNum: this.$options.propsData.check
|
||||||
name: 'crontab-min',
|
};
|
||||||
props: ['check', 'cron'],
|
},
|
||||||
methods: {
|
computed: {
|
||||||
// 单选按钮值变化时
|
// 计算两个周期值
|
||||||
radioChange() {
|
cycleTotal: function () {
|
||||||
switch (this.radioValue) {
|
const cycle01 = this.checkNum(this.cycle01, 0, 58);
|
||||||
case 1:
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59);
|
||||||
this.$emit('update', 'min', '*', 'min');
|
return cycle01 + '-' + cycle02;
|
||||||
break;
|
},
|
||||||
case 2:
|
// 计算平均用到的值
|
||||||
this.$emit('update', 'min', this.cycleTotal, 'min');
|
averageTotal: function () {
|
||||||
break;
|
const average01 = this.checkNum(this.average01, 0, 58);
|
||||||
case 3:
|
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0);
|
||||||
this.$emit('update', 'min', this.averageTotal, 'min');
|
return average01 + '/' + average02;
|
||||||
break;
|
},
|
||||||
case 4:
|
// 计算勾选的checkbox值合集
|
||||||
this.$emit('update', 'min', this.checkboxString, 'min');
|
checkboxString: function () {
|
||||||
break;
|
const str = this.checkboxList.join();
|
||||||
}
|
return str == '' ? '*' : str;
|
||||||
},
|
}
|
||||||
// 周期两个值变化时
|
},
|
||||||
cycleChange() {
|
watch: {
|
||||||
if (this.radioValue == '2') {
|
radioValue: 'radioChange',
|
||||||
this.$emit('update', 'min', this.cycleTotal, 'min');
|
cycleTotal: 'cycleChange',
|
||||||
}
|
averageTotal: 'averageChange',
|
||||||
},
|
checkboxString: 'checkboxChange'
|
||||||
// 平均两个值变化时
|
},
|
||||||
averageChange() {
|
methods: {
|
||||||
if (this.radioValue == '3') {
|
// 单选按钮值变化时
|
||||||
this.$emit('update', 'min', this.averageTotal, 'min');
|
radioChange() {
|
||||||
}
|
switch (this.radioValue) {
|
||||||
},
|
case 1:
|
||||||
// checkbox值变化时
|
this.$emit('update', 'min', '*', 'min');
|
||||||
checkboxChange() {
|
break;
|
||||||
if (this.radioValue == '4') {
|
case 2:
|
||||||
this.$emit('update', 'min', this.checkboxString, 'min');
|
this.$emit('update', 'min', this.cycleTotal, 'min');
|
||||||
}
|
break;
|
||||||
},
|
case 3:
|
||||||
|
this.$emit('update', 'min', this.averageTotal, 'min');
|
||||||
},
|
break;
|
||||||
watch: {
|
case 4:
|
||||||
'radioValue': 'radioChange',
|
this.$emit('update', 'min', this.checkboxString, 'min');
|
||||||
'cycleTotal': 'cycleChange',
|
break;
|
||||||
'averageTotal': 'averageChange',
|
}
|
||||||
'checkboxString': 'checkboxChange',
|
},
|
||||||
},
|
// 周期两个值变化时
|
||||||
computed: {
|
cycleChange() {
|
||||||
// 计算两个周期值
|
if (this.radioValue == '2') {
|
||||||
cycleTotal: function () {
|
this.$emit('update', 'min', this.cycleTotal, 'min');
|
||||||
const cycle01 = this.checkNum(this.cycle01, 0, 58)
|
}
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
|
},
|
||||||
return cycle01 + '-' + cycle02;
|
// 平均两个值变化时
|
||||||
},
|
averageChange() {
|
||||||
// 计算平均用到的值
|
if (this.radioValue == '3') {
|
||||||
averageTotal: function () {
|
this.$emit('update', 'min', this.averageTotal, 'min');
|
||||||
const average01 = this.checkNum(this.average01, 0, 58)
|
}
|
||||||
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
|
},
|
||||||
return average01 + '/' + average02;
|
// checkbox值变化时
|
||||||
},
|
checkboxChange() {
|
||||||
// 计算勾选的checkbox值合集
|
if (this.radioValue == '4') {
|
||||||
checkboxString: function () {
|
this.$emit('update', 'min', this.checkboxString, 'min');
|
||||||
let str = this.checkboxList.join();
|
}
|
||||||
return str == '' ? '*' : str;
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
</script>
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -1,114 +1,114 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size='small'>
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1">
|
||||||
月,允许的通配符[, - * /]
|
月,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="1" :max="11" /> -
|
<el-input-number v-model="cycle01" :min="1" :max="11" /> -
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月
|
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 2" :max="12" /> 月
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="1" :max="11" /> 月开始,每
|
<el-input-number v-model="average01" :min="1" :max="11" /> 月开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="12 - average01 || 0" /> 月月执行一次
|
<el-input-number v-model="average02" :min="1" :max="12 - average01 || 0" /> 月月执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
|
||||||
<el-option v-for="item in 12" :key="item" :value="item">{{item}}</el-option>
|
<el-option v-for="item in 12" :key="item" :value="item">{{ item }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabMonth',
|
||||||
return {
|
props: ['check', 'cron'],
|
||||||
radioValue: 1,
|
data() {
|
||||||
cycle01: 1,
|
return {
|
||||||
cycle02: 2,
|
radioValue: 1,
|
||||||
average01: 1,
|
cycle01: 1,
|
||||||
average02: 1,
|
cycle02: 2,
|
||||||
checkboxList: [],
|
average01: 1,
|
||||||
checkNum: this.check
|
average02: 1,
|
||||||
}
|
checkboxList: [],
|
||||||
},
|
checkNum: this.check
|
||||||
name: 'crontab-month',
|
};
|
||||||
props: ['check', 'cron'],
|
},
|
||||||
methods: {
|
computed: {
|
||||||
// 单选按钮值变化时
|
// 计算两个周期值
|
||||||
radioChange() {
|
cycleTotal: function () {
|
||||||
switch (this.radioValue) {
|
const cycle01 = this.checkNum(this.cycle01, 1, 11);
|
||||||
case 1:
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 12);
|
||||||
this.$emit('update', 'month', '*');
|
return cycle01 + '-' + cycle02;
|
||||||
break;
|
},
|
||||||
case 2:
|
// 计算平均用到的值
|
||||||
this.$emit('update', 'month', this.cycleTotal);
|
averageTotal: function () {
|
||||||
break;
|
const average01 = this.checkNum(this.average01, 1, 11);
|
||||||
case 3:
|
const average02 = this.checkNum(this.average02, 1, 12 - average01 || 0);
|
||||||
this.$emit('update', 'month', this.averageTotal);
|
return average01 + '/' + average02;
|
||||||
break;
|
},
|
||||||
case 4:
|
// 计算勾选的checkbox值合集
|
||||||
this.$emit('update', 'month', this.checkboxString);
|
checkboxString: function () {
|
||||||
break;
|
const str = this.checkboxList.join();
|
||||||
}
|
return str == '' ? '*' : str;
|
||||||
},
|
}
|
||||||
// 周期两个值变化时
|
},
|
||||||
cycleChange() {
|
watch: {
|
||||||
if (this.radioValue == '2') {
|
radioValue: 'radioChange',
|
||||||
this.$emit('update', 'month', this.cycleTotal);
|
cycleTotal: 'cycleChange',
|
||||||
}
|
averageTotal: 'averageChange',
|
||||||
},
|
checkboxString: 'checkboxChange'
|
||||||
// 平均两个值变化时
|
},
|
||||||
averageChange() {
|
methods: {
|
||||||
if (this.radioValue == '3') {
|
// 单选按钮值变化时
|
||||||
this.$emit('update', 'month', this.averageTotal);
|
radioChange() {
|
||||||
}
|
switch (this.radioValue) {
|
||||||
},
|
case 1:
|
||||||
// checkbox值变化时
|
this.$emit('update', 'month', '*');
|
||||||
checkboxChange() {
|
break;
|
||||||
if (this.radioValue == '4') {
|
case 2:
|
||||||
this.$emit('update', 'month', this.checkboxString);
|
this.$emit('update', 'month', this.cycleTotal);
|
||||||
}
|
break;
|
||||||
}
|
case 3:
|
||||||
},
|
this.$emit('update', 'month', this.averageTotal);
|
||||||
watch: {
|
break;
|
||||||
'radioValue': 'radioChange',
|
case 4:
|
||||||
'cycleTotal': 'cycleChange',
|
this.$emit('update', 'month', this.checkboxString);
|
||||||
'averageTotal': 'averageChange',
|
break;
|
||||||
'checkboxString': 'checkboxChange'
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
// 周期两个值变化时
|
||||||
// 计算两个周期值
|
cycleChange() {
|
||||||
cycleTotal: function () {
|
if (this.radioValue == '2') {
|
||||||
const cycle01 = this.checkNum(this.cycle01, 1, 11)
|
this.$emit('update', 'month', this.cycleTotal);
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 2, 12)
|
}
|
||||||
return cycle01 + '-' + cycle02;
|
},
|
||||||
},
|
// 平均两个值变化时
|
||||||
// 计算平均用到的值
|
averageChange() {
|
||||||
averageTotal: function () {
|
if (this.radioValue == '3') {
|
||||||
const average01 = this.checkNum(this.average01, 1, 11)
|
this.$emit('update', 'month', this.averageTotal);
|
||||||
const average02 = this.checkNum(this.average02, 1, 12 - average01 || 0)
|
}
|
||||||
return average01 + '/' + average02;
|
},
|
||||||
},
|
// checkbox值变化时
|
||||||
// 计算勾选的checkbox值合集
|
checkboxChange() {
|
||||||
checkboxString: function () {
|
if (this.radioValue == '4') {
|
||||||
let str = this.checkboxList.join();
|
this.$emit('update', 'month', this.checkboxString);
|
||||||
return str == '' ? '*' : str;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,117 +1,117 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1">
|
||||||
秒,允许的通配符[, - * /]
|
秒,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min="0" :max="58" /> -
|
<el-input-number v-model="cycle01" :min="0" :max="58" /> -
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 秒
|
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : 1" :max="59" /> 秒
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min="0" :max="58" /> 秒开始,每
|
<el-input-number v-model="average01" :min="0" :max="58" /> 秒开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="59 - average01 || 0" /> 秒执行一次
|
<el-input-number v-model="average02" :min="1" :max="59 - average01 || 0" /> 秒执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
|
||||||
<el-option v-for="item in 60" :key="item" :value="item-1">{{item-1}}</el-option>
|
<el-option v-for="item in 60" :key="item" :value="item-1">{{ item-1 }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabSecond',
|
||||||
return {
|
props: ['check', 'radioParent'],
|
||||||
radioValue: 1,
|
data() {
|
||||||
cycle01: 1,
|
return {
|
||||||
cycle02: 2,
|
radioValue: 1,
|
||||||
average01: 0,
|
cycle01: 1,
|
||||||
average02: 1,
|
cycle02: 2,
|
||||||
checkboxList: [],
|
average01: 0,
|
||||||
checkNum: this.$options.propsData.check
|
average02: 1,
|
||||||
}
|
checkboxList: [],
|
||||||
},
|
checkNum: this.$options.propsData.check
|
||||||
name: 'crontab-second',
|
};
|
||||||
props: ['check', 'radioParent'],
|
},
|
||||||
methods: {
|
computed: {
|
||||||
// 单选按钮值变化时
|
// 计算两个周期值
|
||||||
radioChange() {
|
cycleTotal: function () {
|
||||||
switch (this.radioValue) {
|
const cycle01 = this.checkNum(this.cycle01, 0, 58);
|
||||||
case 1:
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59);
|
||||||
this.$emit('update', 'second', '*', 'second');
|
return cycle01 + '-' + cycle02;
|
||||||
break;
|
},
|
||||||
case 2:
|
// 计算平均用到的值
|
||||||
this.$emit('update', 'second', this.cycleTotal);
|
averageTotal: function () {
|
||||||
break;
|
const average01 = this.checkNum(this.average01, 0, 58);
|
||||||
case 3:
|
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0);
|
||||||
this.$emit('update', 'second', this.averageTotal);
|
return average01 + '/' + average02;
|
||||||
break;
|
},
|
||||||
case 4:
|
// 计算勾选的checkbox值合集
|
||||||
this.$emit('update', 'second', this.checkboxString);
|
checkboxString: function () {
|
||||||
break;
|
const str = this.checkboxList.join();
|
||||||
}
|
return str == '' ? '*' : str;
|
||||||
},
|
}
|
||||||
// 周期两个值变化时
|
},
|
||||||
cycleChange() {
|
watch: {
|
||||||
if (this.radioValue == '2') {
|
radioValue: 'radioChange',
|
||||||
this.$emit('update', 'second', this.cycleTotal);
|
cycleTotal: 'cycleChange',
|
||||||
}
|
averageTotal: 'averageChange',
|
||||||
},
|
checkboxString: 'checkboxChange',
|
||||||
// 平均两个值变化时
|
radioParent() {
|
||||||
averageChange() {
|
this.radioValue = this.radioParent;
|
||||||
if (this.radioValue == '3') {
|
}
|
||||||
this.$emit('update', 'second', this.averageTotal);
|
},
|
||||||
}
|
methods: {
|
||||||
},
|
// 单选按钮值变化时
|
||||||
// checkbox值变化时
|
radioChange() {
|
||||||
checkboxChange() {
|
switch (this.radioValue) {
|
||||||
if (this.radioValue == '4') {
|
case 1:
|
||||||
this.$emit('update', 'second', this.checkboxString);
|
this.$emit('update', 'second', '*', 'second');
|
||||||
}
|
break;
|
||||||
}
|
case 2:
|
||||||
},
|
this.$emit('update', 'second', this.cycleTotal);
|
||||||
watch: {
|
break;
|
||||||
'radioValue': 'radioChange',
|
case 3:
|
||||||
'cycleTotal': 'cycleChange',
|
this.$emit('update', 'second', this.averageTotal);
|
||||||
'averageTotal': 'averageChange',
|
break;
|
||||||
'checkboxString': 'checkboxChange',
|
case 4:
|
||||||
radioParent() {
|
this.$emit('update', 'second', this.checkboxString);
|
||||||
this.radioValue = this.radioParent
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
// 周期两个值变化时
|
||||||
// 计算两个周期值
|
cycleChange() {
|
||||||
cycleTotal: function () {
|
if (this.radioValue == '2') {
|
||||||
const cycle01 = this.checkNum(this.cycle01, 0, 58)
|
this.$emit('update', 'second', this.cycleTotal);
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 59)
|
}
|
||||||
return cycle01 + '-' + cycle02;
|
},
|
||||||
},
|
// 平均两个值变化时
|
||||||
// 计算平均用到的值
|
averageChange() {
|
||||||
averageTotal: function () {
|
if (this.radioValue == '3') {
|
||||||
const average01 = this.checkNum(this.average01, 0, 58)
|
this.$emit('update', 'second', this.averageTotal);
|
||||||
const average02 = this.checkNum(this.average02, 1, 59 - average01 || 0)
|
}
|
||||||
return average01 + '/' + average02;
|
},
|
||||||
},
|
// checkbox值变化时
|
||||||
// 计算勾选的checkbox值合集
|
checkboxChange() {
|
||||||
checkboxString: function () {
|
if (this.radioValue == '4') {
|
||||||
let str = this.checkboxList.join();
|
this.$emit('update', 'second', this.checkboxString);
|
||||||
return str == '' ? '*' : str;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,202 +1,191 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form size='small'>
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="1">
|
<el-radio v-model="radioValue" :label="1">
|
||||||
周,允许的通配符[, - * ? / L #]
|
周,允许的通配符[, - * ? / L #]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="2">
|
<el-radio v-model="radioValue" :label="2">
|
||||||
不指定
|
不指定
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="3">
|
<el-radio v-model="radioValue" :label="3">
|
||||||
周期从星期
|
周期从星期
|
||||||
<el-select clearable v-model="cycle01">
|
<el-select v-model="cycle01" clearable>
|
||||||
<el-option
|
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key" :disabled="item.key === 1">{{ item.value }}</el-option>
|
||||||
v-for="(item,index) of weekList"
|
</el-select>
|
||||||
:key="index"
|
-
|
||||||
:label="item.value"
|
<el-select v-model="cycle02" clearable>
|
||||||
:value="item.key"
|
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key" :disabled="item.key < cycle01 && item.key !== 1">{{ item.value }}</el-option>
|
||||||
:disabled="item.key === 1"
|
</el-select>
|
||||||
>{{item.value}}</el-option>
|
</el-radio>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
-
|
|
||||||
<el-select clearable v-model="cycle02">
|
|
||||||
<el-option
|
|
||||||
v-for="(item,index) of weekList"
|
|
||||||
:key="index"
|
|
||||||
:label="item.value"
|
|
||||||
:value="item.key"
|
|
||||||
:disabled="item.key < cycle01 && item.key !== 1"
|
|
||||||
>{{item.value}}</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="4">
|
<el-radio v-model="radioValue" :label="4">
|
||||||
第
|
第
|
||||||
<el-input-number v-model='average01' :min="1" :max="4" /> 周的星期
|
<el-input-number v-model="average01" :min="1" :max="4" /> 周的星期
|
||||||
<el-select clearable v-model="average02">
|
<el-select v-model="average02" clearable>
|
||||||
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{item.value}}</el-option>
|
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{ item.value }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="5">
|
<el-radio v-model="radioValue" :label="5">
|
||||||
本月最后一个星期
|
本月最后一个星期
|
||||||
<el-select clearable v-model="weekday">
|
<el-select v-model="weekday" clearable>
|
||||||
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{item.value}}</el-option>
|
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="item.key">{{ item.value }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio v-model='radioValue' :label="6">
|
<el-radio v-model="radioValue" :label="6">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple style="width:100%">
|
||||||
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="String(item.key)">{{item.value}}</el-option>
|
<el-option v-for="(item,index) of weekList" :key="index" :label="item.value" :value="String(item.key)">{{ item.value }}</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- eslint-disable vue/no-side-effects-in-computed-properties -->
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabWeek',
|
||||||
return {
|
props: ['check', 'cron'],
|
||||||
radioValue: 2,
|
data() {
|
||||||
weekday: 2,
|
return {
|
||||||
cycle01: 2,
|
radioValue: 2,
|
||||||
cycle02: 3,
|
weekday: 2,
|
||||||
average01: 1,
|
cycle01: 2,
|
||||||
average02: 2,
|
cycle02: 3,
|
||||||
checkboxList: [],
|
average01: 1,
|
||||||
weekList: [
|
average02: 2,
|
||||||
{
|
checkboxList: [],
|
||||||
key: 2,
|
weekList: [
|
||||||
value: '星期一'
|
{
|
||||||
},
|
key: 2,
|
||||||
{
|
value: '星期一'
|
||||||
key: 3,
|
},
|
||||||
value: '星期二'
|
{
|
||||||
},
|
key: 3,
|
||||||
{
|
value: '星期二'
|
||||||
key: 4,
|
},
|
||||||
value: '星期三'
|
{
|
||||||
},
|
key: 4,
|
||||||
{
|
value: '星期三'
|
||||||
key: 5,
|
},
|
||||||
value: '星期四'
|
{
|
||||||
},
|
key: 5,
|
||||||
{
|
value: '星期四'
|
||||||
key: 6,
|
},
|
||||||
value: '星期五'
|
{
|
||||||
},
|
key: 6,
|
||||||
{
|
value: '星期五'
|
||||||
key: 7,
|
},
|
||||||
value: '星期六'
|
{
|
||||||
},
|
key: 7,
|
||||||
{
|
value: '星期六'
|
||||||
key: 1,
|
},
|
||||||
value: '星期日'
|
{
|
||||||
}
|
key: 1,
|
||||||
],
|
value: '星期日'
|
||||||
checkNum: this.$options.propsData.check
|
}
|
||||||
}
|
],
|
||||||
},
|
checkNum: this.$options.propsData.check
|
||||||
name: 'crontab-week',
|
};
|
||||||
props: ['check', 'cron'],
|
},
|
||||||
methods: {
|
computed: {
|
||||||
// 单选按钮值变化时
|
// 计算两个周期值
|
||||||
radioChange() {
|
cycleTotal: function () {
|
||||||
if (this.radioValue !== 2 && this.cron.day !== '?') {
|
this.cycle01 = this.checkNum(this.cycle01, 1, 7);
|
||||||
this.$emit('update', 'day', '?', 'week');
|
this.cycle02 = this.checkNum(this.cycle02, 1, 7);
|
||||||
}
|
return this.cycle01 + '-' + this.cycle02;
|
||||||
switch (this.radioValue) {
|
},
|
||||||
case 1:
|
// 计算平均用到的值
|
||||||
this.$emit('update', 'week', '*');
|
averageTotal: function () {
|
||||||
break;
|
this.average01 = this.checkNum(this.average01, 1, 4);
|
||||||
case 2:
|
this.average02 = this.checkNum(this.average02, 1, 7);
|
||||||
this.$emit('update', 'week', '?');
|
return this.average02 + '#' + this.average01;
|
||||||
break;
|
},
|
||||||
case 3:
|
// 最近的工作日(格式)
|
||||||
this.$emit('update', 'week', this.cycleTotal);
|
weekdayCheck: function () {
|
||||||
break;
|
this.weekday = this.checkNum(this.weekday, 1, 7);
|
||||||
case 4:
|
return this.weekday;
|
||||||
this.$emit('update', 'week', this.averageTotal);
|
},
|
||||||
break;
|
// 计算勾选的checkbox值合集
|
||||||
case 5:
|
checkboxString: function () {
|
||||||
this.$emit('update', 'week', this.weekdayCheck + 'L');
|
const str = this.checkboxList.join();
|
||||||
break;
|
return str == '' ? '*' : str;
|
||||||
case 6:
|
}
|
||||||
this.$emit('update', 'week', this.checkboxString);
|
},
|
||||||
break;
|
watch: {
|
||||||
}
|
radioValue: 'radioChange',
|
||||||
},
|
cycleTotal: 'cycleChange',
|
||||||
|
averageTotal: 'averageChange',
|
||||||
|
weekdayCheck: 'weekdayChange',
|
||||||
|
checkboxString: 'checkboxChange'
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 单选按钮值变化时
|
||||||
|
radioChange() {
|
||||||
|
if (this.radioValue !== 2 && this.cron.day !== '?') {
|
||||||
|
this.$emit('update', 'day', '?', 'week');
|
||||||
|
}
|
||||||
|
switch (this.radioValue) {
|
||||||
|
case 1:
|
||||||
|
this.$emit('update', 'week', '*');
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.$emit('update', 'week', '?');
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.$emit('update', 'week', this.cycleTotal);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
this.$emit('update', 'week', this.averageTotal);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
this.$emit('update', 'week', this.weekdayCheck + 'L');
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
this.$emit('update', 'week', this.checkboxString);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 周期两个值变化时
|
// 周期两个值变化时
|
||||||
cycleChange() {
|
cycleChange() {
|
||||||
if (this.radioValue == '3') {
|
if (this.radioValue == '3') {
|
||||||
this.$emit('update', 'week', this.cycleTotal);
|
this.$emit('update', 'week', this.cycleTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 平均两个值变化时
|
// 平均两个值变化时
|
||||||
averageChange() {
|
averageChange() {
|
||||||
if (this.radioValue == '4') {
|
if (this.radioValue == '4') {
|
||||||
this.$emit('update', 'week', this.averageTotal);
|
this.$emit('update', 'week', this.averageTotal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 最近工作日值变化时
|
// 最近工作日值变化时
|
||||||
weekdayChange() {
|
weekdayChange() {
|
||||||
if (this.radioValue == '5') {
|
if (this.radioValue == '5') {
|
||||||
this.$emit('update', 'week', this.weekday + 'L');
|
this.$emit('update', 'week', this.weekday + 'L');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// checkbox值变化时
|
// checkbox值变化时
|
||||||
checkboxChange() {
|
checkboxChange() {
|
||||||
if (this.radioValue == '6') {
|
if (this.radioValue == '6') {
|
||||||
this.$emit('update', 'week', this.checkboxString);
|
this.$emit('update', 'week', this.checkboxString);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
watch: {
|
};
|
||||||
'radioValue': 'radioChange',
|
|
||||||
'cycleTotal': 'cycleChange',
|
|
||||||
'averageTotal': 'averageChange',
|
|
||||||
'weekdayCheck': 'weekdayChange',
|
|
||||||
'checkboxString': 'checkboxChange',
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// 计算两个周期值
|
|
||||||
cycleTotal: function () {
|
|
||||||
this.cycle01 = this.checkNum(this.cycle01, 1, 7)
|
|
||||||
this.cycle02 = this.checkNum(this.cycle02, 1, 7)
|
|
||||||
return this.cycle01 + '-' + this.cycle02;
|
|
||||||
},
|
|
||||||
// 计算平均用到的值
|
|
||||||
averageTotal: function () {
|
|
||||||
this.average01 = this.checkNum(this.average01, 1, 4)
|
|
||||||
this.average02 = this.checkNum(this.average02, 1, 7)
|
|
||||||
return this.average02 + '#' + this.average01;
|
|
||||||
},
|
|
||||||
// 最近的工作日(格式)
|
|
||||||
weekdayCheck: function () {
|
|
||||||
this.weekday = this.checkNum(this.weekday, 1, 7)
|
|
||||||
return this.weekday;
|
|
||||||
},
|
|
||||||
// 计算勾选的checkbox值合集
|
|
||||||
checkboxString: function () {
|
|
||||||
let str = this.checkboxList.join();
|
|
||||||
return str == '' ? '*' : str;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,131 +1,131 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="small">
|
<el-form size="small">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio :label="1" v-model='radioValue'>
|
<el-radio v-model="radioValue" :label="1">
|
||||||
不填,允许的通配符[, - * /]
|
不填,允许的通配符[, - * /]
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio :label="2" v-model='radioValue'>
|
<el-radio v-model="radioValue" :label="2">
|
||||||
每年
|
每年
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio :label="3" v-model='radioValue'>
|
<el-radio v-model="radioValue" :label="3">
|
||||||
周期从
|
周期从
|
||||||
<el-input-number v-model='cycle01' :min='fullYear' :max="2098" /> -
|
<el-input-number v-model="cycle01" :min="fullYear" :max="2098" /> -
|
||||||
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : fullYear + 1" :max="2099" />
|
<el-input-number v-model="cycle02" :min="cycle01 ? cycle01 + 1 : fullYear + 1" :max="2099" />
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio :label="4" v-model='radioValue'>
|
<el-radio v-model="radioValue" :label="4">
|
||||||
从
|
从
|
||||||
<el-input-number v-model='average01' :min='fullYear' :max="2098"/> 年开始,每
|
<el-input-number v-model="average01" :min="fullYear" :max="2098" /> 年开始,每
|
||||||
<el-input-number v-model='average02' :min="1" :max="2099 - average01 || fullYear" /> 年执行一次
|
<el-input-number v-model="average02" :min="1" :max="2099 - average01 || fullYear" /> 年执行一次
|
||||||
</el-radio>
|
</el-radio>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-radio :label="5" v-model='radioValue'>
|
<el-radio v-model="radioValue" :label="5">
|
||||||
指定
|
指定
|
||||||
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple>
|
<el-select v-model="checkboxList" clearable placeholder="可多选" multiple>
|
||||||
<el-option v-for="item in 9" :key="item" :value="item - 1 + fullYear" :label="item -1 + fullYear" />
|
<el-option v-for="item in 9" :key="item" :value="item - 1 + fullYear" :label="item -1 + fullYear" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'CrontabYear',
|
||||||
return {
|
props: ['check', 'month', 'cron'],
|
||||||
fullYear: 0,
|
data() {
|
||||||
radioValue: 1,
|
return {
|
||||||
cycle01: 0,
|
fullYear: 0,
|
||||||
cycle02: 0,
|
radioValue: 1,
|
||||||
average01: 0,
|
cycle01: 0,
|
||||||
average02: 1,
|
cycle02: 0,
|
||||||
checkboxList: [],
|
average01: 0,
|
||||||
checkNum: this.$options.propsData.check
|
average02: 1,
|
||||||
}
|
checkboxList: [],
|
||||||
},
|
checkNum: this.$options.propsData.check
|
||||||
name: 'crontab-year',
|
};
|
||||||
props: ['check', 'month', 'cron'],
|
},
|
||||||
methods: {
|
computed: {
|
||||||
// 单选按钮值变化时
|
// 计算两个周期值
|
||||||
radioChange() {
|
cycleTotal: function () {
|
||||||
switch (this.radioValue) {
|
const cycle01 = this.checkNum(this.cycle01, this.fullYear, 2098);
|
||||||
case 1:
|
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : this.fullYear + 1, 2099);
|
||||||
this.$emit('update', 'year', '');
|
return cycle01 + '-' + cycle02;
|
||||||
break;
|
},
|
||||||
case 2:
|
// 计算平均用到的值
|
||||||
this.$emit('update', 'year', '*');
|
averageTotal: function () {
|
||||||
break;
|
const average01 = this.checkNum(this.average01, this.fullYear, 2098);
|
||||||
case 3:
|
const average02 = this.checkNum(this.average02, 1, 2099 - average01 || this.fullYear);
|
||||||
this.$emit('update', 'year', this.cycleTotal);
|
return average01 + '/' + average02;
|
||||||
break;
|
},
|
||||||
case 4:
|
// 计算勾选的checkbox值合集
|
||||||
this.$emit('update', 'year', this.averageTotal);
|
checkboxString: function () {
|
||||||
break;
|
const str = this.checkboxList.join();
|
||||||
case 5:
|
return str;
|
||||||
this.$emit('update', 'year', this.checkboxString);
|
}
|
||||||
break;
|
},
|
||||||
}
|
watch: {
|
||||||
},
|
radioValue: 'radioChange',
|
||||||
// 周期两个值变化时
|
cycleTotal: 'cycleChange',
|
||||||
cycleChange() {
|
averageTotal: 'averageChange',
|
||||||
if (this.radioValue == '3') {
|
checkboxString: 'checkboxChange'
|
||||||
this.$emit('update', 'year', this.cycleTotal);
|
},
|
||||||
}
|
mounted: function () {
|
||||||
},
|
// 仅获取当前年份
|
||||||
// 平均两个值变化时
|
this.fullYear = Number(new Date().getFullYear());
|
||||||
averageChange() {
|
this.cycle01 = this.fullYear;
|
||||||
if (this.radioValue == '4') {
|
this.average01 = this.fullYear;
|
||||||
this.$emit('update', 'year', this.averageTotal);
|
},
|
||||||
}
|
methods: {
|
||||||
},
|
// 单选按钮值变化时
|
||||||
// checkbox值变化时
|
radioChange() {
|
||||||
checkboxChange() {
|
switch (this.radioValue) {
|
||||||
if (this.radioValue == '5') {
|
case 1:
|
||||||
this.$emit('update', 'year', this.checkboxString);
|
this.$emit('update', 'year', '');
|
||||||
}
|
break;
|
||||||
}
|
case 2:
|
||||||
},
|
this.$emit('update', 'year', '*');
|
||||||
watch: {
|
break;
|
||||||
'radioValue': 'radioChange',
|
case 3:
|
||||||
'cycleTotal': 'cycleChange',
|
this.$emit('update', 'year', this.cycleTotal);
|
||||||
'averageTotal': 'averageChange',
|
break;
|
||||||
'checkboxString': 'checkboxChange'
|
case 4:
|
||||||
},
|
this.$emit('update', 'year', this.averageTotal);
|
||||||
computed: {
|
break;
|
||||||
// 计算两个周期值
|
case 5:
|
||||||
cycleTotal: function () {
|
this.$emit('update', 'year', this.checkboxString);
|
||||||
const cycle01 = this.checkNum(this.cycle01, this.fullYear, 2098)
|
break;
|
||||||
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : this.fullYear + 1, 2099)
|
}
|
||||||
return cycle01 + '-' + cycle02;
|
},
|
||||||
},
|
// 周期两个值变化时
|
||||||
// 计算平均用到的值
|
cycleChange() {
|
||||||
averageTotal: function () {
|
if (this.radioValue == '3') {
|
||||||
const average01 = this.checkNum(this.average01, this.fullYear, 2098)
|
this.$emit('update', 'year', this.cycleTotal);
|
||||||
const average02 = this.checkNum(this.average02, 1, 2099 - average01 || this.fullYear)
|
}
|
||||||
return average01 + '/' + average02;
|
},
|
||||||
},
|
// 平均两个值变化时
|
||||||
// 计算勾选的checkbox值合集
|
averageChange() {
|
||||||
checkboxString: function () {
|
if (this.radioValue == '4') {
|
||||||
let str = this.checkboxList.join();
|
this.$emit('update', 'year', this.averageTotal);
|
||||||
return str;
|
}
|
||||||
}
|
},
|
||||||
},
|
// checkbox值变化时
|
||||||
mounted: function () {
|
checkboxChange() {
|
||||||
// 仅获取当前年份
|
if (this.radioValue == '5') {
|
||||||
this.fullYear = Number(new Date().getFullYear());
|
this.$emit('update', 'year', this.checkboxString);
|
||||||
this.cycle01 = this.fullYear
|
}
|
||||||
this.average01 = this.fullYear
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
268
src/components/CustomColumnTable/index.vue
Normal file
@@ -0,0 +1,268 @@
|
|||||||
|
<!--
|
||||||
|
组件方法:
|
||||||
|
getlist: 将分页组件合并,所以需要分页查询列表的数据的方法
|
||||||
|
selectRow:选择行时触发 【配合selectable使用】
|
||||||
|
callFunc: 操作按钮点击时触发 【配合tableBtns使用】 会传递按钮的方法名和行数据
|
||||||
|
clickColumn: 点击表格列时触发 【配合clickColumns使用】 传递到父级时,接受两个参数,(column,row)点击的列名,行数据
|
||||||
|
clickRow: 点击表格行时触发 ps: 建议不要与点击表格列方法同时使用
|
||||||
|
changeSort: 表格列排序
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="table-custom">
|
||||||
|
<span class="custom-table-btn" @click="showCustomClick">自定义列表</span>
|
||||||
|
<el-table v-loading="tableLoading" :data="tableList" border stripe max-height="500" @selection-change="handleSelectionChange" @sort-change="changeSort" @row-click="handleRowClick">
|
||||||
|
<el-table-column v-if="selectable" type="selection" width="60" />
|
||||||
|
<el-table-column type="index" :index="(index)=>((queryParams.pageNum - 1)*queryParams.pageSize + index + 1)" label="序号" width="60" />
|
||||||
|
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :width="item.width" :prop="item.prop" :sortable="sortableColumns.includes(item.prop)" :min-width="clickColumns.includes(item.prop)?150:100">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<el-button v-if="clickColumns.includes(item.prop)" type="text" size="mini" @click="$emit('clickColumn', item.prop, row)">{{ row[item.prop] }}</el-button>
|
||||||
|
<span v-else>{{ row[item.prop] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<slot name="appendColumn" />
|
||||||
|
<el-table-column v-if="tableBtns.length > 0" label="操作" fixed="right" :width="getOpearateWidth()">
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
<template v-if="tableBtns">
|
||||||
|
<template v-for="(item, index) in tableBtns.slice(0, 2)">
|
||||||
|
<el-button v-if="btnShow(row, item)" :key="index" type="text" @click.native.stop="call(item.buttonTrigger, row)">{{ item.buttonName }}</el-button>
|
||||||
|
</template>
|
||||||
|
<template v-if="tableBtns.length > 2">
|
||||||
|
<el-dropdown class="ml0" trigger="click">
|
||||||
|
<el-button type="primary" size="mini">
|
||||||
|
更多
|
||||||
|
<i class="el-icon-arrow-down el-icon--right" />
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<template v-for="(btn, idx) in tableBtns.slice(2, tableBtns.length)">
|
||||||
|
<el-dropdown-item v-if="btnShow(row, item)" :key="idx" @click.native.stop="call(btn.buttonTrigger, row)">{{ btn.buttonName }}</el-dropdown-item>
|
||||||
|
</template>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<pagination :page-sizes="[10, 20, 30, 50, 100, 200]" :total="queryParams.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="_getTableList" />
|
||||||
|
<el-dialog title="自定义字段配置" :visible.sync="columnsetDialogShow" append-to-body class="dialog500" width="60%">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="18">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<div slot="header">
|
||||||
|
<el-checkbox v-model="columnCheckAll" @change="val => dialogSelectColumn = val ? tableAllFields.map(item=>item.prop):[] ">可选显示数据列</el-checkbox>
|
||||||
|
</div>
|
||||||
|
<el-checkbox-group v-model="dialogSelectColumn" style="line-height: 32px">
|
||||||
|
<el-checkbox v-for="item in tableAllFields" :key="item.prop" :label="item.prop">{{ item.label }}</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<div slot="header">
|
||||||
|
已选{{ dialogSelectColumn.length }}项
|
||||||
|
<span class="ml0" style="font-size: 8px">(可拖动排序)</span>
|
||||||
|
</div>
|
||||||
|
<draggable :list="dialogSelectColumn" :animation="340" group="column">
|
||||||
|
<div v-for="item in dialogSelectColumn" :key="item" class="hover-pointer">
|
||||||
|
<div style="line-height: 24px;">{{ tableAllFields.find(column=> column.prop === item).label }}</div>
|
||||||
|
</div>
|
||||||
|
</draggable>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button @click="columnsetDialogShow = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="handleChangeColumns">确定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import draggable from 'vuedraggable';
|
||||||
|
export default {
|
||||||
|
components: { draggable },
|
||||||
|
props: {
|
||||||
|
tableList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
tableLoading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
queryParams: {
|
||||||
|
required: true,
|
||||||
|
type: Object,
|
||||||
|
default: () => ({
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表格操作按钮
|
||||||
|
tableBtns: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
// 表格可选
|
||||||
|
selectable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 接口访问得到的所有表格列/或者写死的表格列格
|
||||||
|
* 格式是: { pror: '', label: '' }
|
||||||
|
*/
|
||||||
|
tableAllFields: {
|
||||||
|
required: true,
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 默认表格列
|
||||||
|
* 字符串数组: prop 对应值(字段名)
|
||||||
|
*/
|
||||||
|
defaultColumns: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
tablename: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 可点击的列
|
||||||
|
clickColumns: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
// 控制按钮隐藏
|
||||||
|
btnShowValid: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
// 可排序的列
|
||||||
|
sortableColumns: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
columnsetDialogShow: false,
|
||||||
|
columnCheckAll: false,
|
||||||
|
dialogSelectColumn: [],
|
||||||
|
name: this.tablename || this.$route.name,
|
||||||
|
customColumns: [], // 本地缓存的表格列
|
||||||
|
tableColumns: [] // 实际展示表格列
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
tableAllFields: {
|
||||||
|
handler(val) {
|
||||||
|
const localStr = localStorage.getItem(this.name);
|
||||||
|
const arr = localStr ? localStr.split(',') : [];
|
||||||
|
if (this.isNullOrEmpty(arr)) {
|
||||||
|
this.tableColumns = val
|
||||||
|
.filter((item) => this.defaultColumns.includes(item.prop))
|
||||||
|
.sort((a, b) => this.defaultColumns.indexOf(a.prop) - this.defaultColumns.indexOf(b.prop));
|
||||||
|
this.customColumns = this.defaultColumns;
|
||||||
|
} else {
|
||||||
|
this.tableColumns = val.filter((item) => arr.includes(item.prop)).sort((a, b) => arr.indexOf(a.prop) - arr.indexOf(b.prop));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.isNullOrEmpty(this.customColumns)) {
|
||||||
|
const localStr = localStorage.getItem(this.name);
|
||||||
|
this.customColumns = localStr ? localStr.split(',') : [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showCustomClick() {
|
||||||
|
this.columnsetDialogShow = true;
|
||||||
|
this.dialogSelectColumn = [...this.customColumns];
|
||||||
|
},
|
||||||
|
handleChangeColumns() {
|
||||||
|
this.customColumns = this.dialogSelectColumn;
|
||||||
|
this.tableColumns = this.tableAllFields
|
||||||
|
.filter((item) => this.customColumns.includes(item.prop))
|
||||||
|
.sort((a, b) => this.customColumns.indexOf(a.prop) - this.customColumns.indexOf(b.prop));
|
||||||
|
localStorage.setItem(this.name, this.customColumns.join(','));
|
||||||
|
this.columnsetDialogShow = false;
|
||||||
|
},
|
||||||
|
_getTableList() {
|
||||||
|
this.$emit('update:queryParams', this.queryParams);
|
||||||
|
this.$emit('getlist');
|
||||||
|
},
|
||||||
|
handleSelectionChange(row) {
|
||||||
|
this.selectable && this.$emit('selectRow', row);
|
||||||
|
},
|
||||||
|
changeSort(val) {
|
||||||
|
this.$emit('changeSort', val);
|
||||||
|
},
|
||||||
|
handleRowClick(row) {
|
||||||
|
this.$emit('clickRow', row);
|
||||||
|
},
|
||||||
|
call(funcName, row) {
|
||||||
|
this.$emit('callFunc', funcName, row);
|
||||||
|
},
|
||||||
|
getOpearateWidth() {
|
||||||
|
let width = 30;
|
||||||
|
for (let index = 0; index < this.tableBtns.length; index++) {
|
||||||
|
if (index < 2) {
|
||||||
|
const column = this.tableBtns[index];
|
||||||
|
width += column.buttonName.length * 15;
|
||||||
|
column.buttonColor !== 'text' && (width += 30);
|
||||||
|
} else {
|
||||||
|
width += 70; // 更多
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return width;
|
||||||
|
},
|
||||||
|
btnShow(row, btn) {
|
||||||
|
if (this.isNullOrEmpty(this.btnShowValid)) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
let show = true;
|
||||||
|
for (let i = 0; i < this.btnShowValid.length; i++) {
|
||||||
|
const valid = this.btnShowValid[i];
|
||||||
|
if (row[valid.key] === valid.value) {
|
||||||
|
show = btn.buttonName !== valid.btnName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return show;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.table-custom {
|
||||||
|
width: calc(100% - 30px);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.custom-table-btn {
|
||||||
|
width: 30px;
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
right: -31px;
|
||||||
|
top: 0;
|
||||||
|
text-align: center;
|
||||||
|
color: cadetblue;
|
||||||
|
border: 1px solid #e6ebf5;
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 5px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
92
src/components/DMCheckbox/index.vue
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<template>
|
||||||
|
<el-checkbox-group v-model="modelValue">
|
||||||
|
<el-checkbox v-if="allText" class="no-cicrle" label="全部" @change="handleAll">全部</el-checkbox>
|
||||||
|
<el-checkbox v-for="(item, index) in list" :key="index" class="no-cicrle" :label="item[name]" @change="handleChange">
|
||||||
|
{{ item[label] }}
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
allText: {
|
||||||
|
// 是否展示 "全部",有字则展示
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
showBottomLine: {
|
||||||
|
// 是否展示底部下划线,类似tab标签页
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
// key
|
||||||
|
type: String,
|
||||||
|
default: 'label'
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
// value
|
||||||
|
type: String,
|
||||||
|
default: 'value'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
modelValue: undefined
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
handler(val) {
|
||||||
|
if (this.allText) {
|
||||||
|
this.modelValue = val.length > 0 ? val : ['全部'];
|
||||||
|
} else {
|
||||||
|
this.modelValue = val.filter((item) => item !== '全部');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleAll() {
|
||||||
|
this.modelValue = ['全部'];
|
||||||
|
this.$emit('input', []);
|
||||||
|
},
|
||||||
|
handleChange() {
|
||||||
|
if (this.modelValue.some((item) => item === '全部')) {
|
||||||
|
this.modelValue.shift();
|
||||||
|
} else if (this.modelValue.length == 0) {
|
||||||
|
this.modelValue = ['全部'];
|
||||||
|
}
|
||||||
|
this.$emit('input', this.modelValue.every((item) => item === '全部') ? [] : this.modelValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.no-cicrle {
|
||||||
|
::v-deep .el-checkbox__input,
|
||||||
|
.el-checkbox__input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
::v-deep .el-checkbox__label {
|
||||||
|
padding-left: 0;
|
||||||
|
color: rgba($color: #000000, $alpha: 0.6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.no-cicrle.is-checked ::v-deep .el-checkbox__label {
|
||||||
|
color: #0075ff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
102
src/components/DMRadio/index.vue
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
<template>
|
||||||
|
<div :class="{ 'border-bottom': showBottomLine }">
|
||||||
|
<el-radio-group v-model="modelValue" @change="handleChange">
|
||||||
|
<el-radio v-if="allText" class="no-cicrle" :style="{'margin-bottom': gutter}" label="全部">全部</el-radio>
|
||||||
|
<el-radio v-for="(item,index) in list" :key="index" class="no-cicrle" :style="{'margin-bottom': gutter}" :label="item[name]">
|
||||||
|
{{ item[label] }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: [String, Number],
|
||||||
|
allText: {
|
||||||
|
// 是否展示 "全部",有字则展示
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
showBottomLine: {
|
||||||
|
// 是否展示底部下划线,类似tab标签页
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
// key
|
||||||
|
type: String,
|
||||||
|
default: 'label'
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
// value
|
||||||
|
type: String,
|
||||||
|
default: 'value'
|
||||||
|
},
|
||||||
|
gutter: {
|
||||||
|
// 上下间隔
|
||||||
|
type: String,
|
||||||
|
default: '0'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
modelValue: undefined
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
value: {
|
||||||
|
handler(val) {
|
||||||
|
this.modelValue = val === undefined ? '全部' : val;
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleChange(value) {
|
||||||
|
this.$emit('input', this.modelValue === '全部' ? undefined : this.modelValue);
|
||||||
|
this.$emit('change', this.modelValue === '全部' ? undefined : this.modelValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.border-bottom {
|
||||||
|
width: 100%;
|
||||||
|
border-bottom: 2px solid rgba($color: #000000, $alpha: 0.08);
|
||||||
|
::v-deep .is-checked .el-radio__label {
|
||||||
|
position: relative;
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: -10.5px;
|
||||||
|
right: 0;
|
||||||
|
height: 2px;
|
||||||
|
background-color: #0075ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.no-cicrle {
|
||||||
|
::v-deep .el-radio__input,
|
||||||
|
.el-checkbox__input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
::v-deep .el-radio__label {
|
||||||
|
padding-left: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 14px;
|
||||||
|
color: rgba($color: #000000, $alpha: 0.6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.no-cicrle.is-checked ::v-deep .el-radio__label {
|
||||||
|
color: #0075ff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue';
|
||||||
import store from '@/store'
|
import store from '@/store';
|
||||||
import DataDict from '@/utils/dict'
|
import DataDict from '@/utils/dict';
|
||||||
import { getDicts as getDicts } from '@/api/system/dict/data'
|
import { getDicts as getDicts } from '@/api/system/dict/data';
|
||||||
|
|
||||||
function searchDictByKey(dict, key) {
|
function searchDictByKey(dict, key) {
|
||||||
if (key == null && key == "") {
|
if (key == null && key == '') {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < dict.length; i++) {
|
for (let i = 0; i < dict.length; i++) {
|
||||||
if (dict[i].key == key) {
|
if (dict[i].key == key) {
|
||||||
return dict[i].value
|
return dict[i].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,25 +25,29 @@ function install() {
|
|||||||
labelField: 'dictLabel',
|
labelField: 'dictLabel',
|
||||||
valueField: 'dictValue',
|
valueField: 'dictValue',
|
||||||
request(dictMeta) {
|
request(dictMeta) {
|
||||||
const storeDict = searchDictByKey(store.getters.dict, dictMeta.type)
|
const storeDict = searchDictByKey(store.getters.dict, dictMeta.type);
|
||||||
if (storeDict) {
|
if (storeDict) {
|
||||||
return new Promise(resolve => { resolve(storeDict) })
|
return new Promise((resolve) => {
|
||||||
|
resolve(storeDict);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getDicts(dictMeta.type).then(res => {
|
getDicts(dictMeta.type)
|
||||||
store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data })
|
.then((res) => {
|
||||||
resolve(res.data)
|
store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data });
|
||||||
}).catch(error => {
|
resolve(res.data);
|
||||||
reject(error)
|
})
|
||||||
})
|
.catch((error) => {
|
||||||
})
|
reject(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install,
|
install
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -2,21 +2,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<template v-for="(item, index) in options">
|
<template v-for="(item, index) in options">
|
||||||
<template v-if="values.includes(item.value)">
|
<template v-if="values.includes(item.value)">
|
||||||
<span
|
<span v-if="item.raw.listClass == 'default' || item.raw.listClass == ''" :key="item.value" :index="index" :class="item.raw.cssClass">{{ item.label }}</span>
|
||||||
v-if="item.raw.listClass == 'default' || item.raw.listClass == ''"
|
<el-tag v-else :key="item.value" :disable-transitions="true" :index="index" :type="item.raw.listClass == 'primary' ? '' : item.raw.listClass" :class="item.raw.cssClass">
|
||||||
:key="item.value"
|
|
||||||
:index="index"
|
|
||||||
:class="item.raw.cssClass"
|
|
||||||
>{{ item.label }}</span
|
|
||||||
>
|
|
||||||
<el-tag
|
|
||||||
v-else
|
|
||||||
:disable-transitions="true"
|
|
||||||
:key="item.value"
|
|
||||||
:index="index"
|
|
||||||
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
|
|
||||||
:class="item.raw.cssClass"
|
|
||||||
>
|
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
@@ -26,13 +13,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "DictTag",
|
name: 'DictTag',
|
||||||
props: {
|
props: {
|
||||||
options: {
|
options: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: null,
|
default: null
|
||||||
},
|
},
|
||||||
value: [Number, String, Array],
|
value: [Number, String, Array]
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
values() {
|
values() {
|
||||||
@@ -41,12 +28,12 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-tag + .el-tag {
|
.el-tag + .el-tag {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,98 +1,86 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-upload
|
<el-upload v-if="type == 'url'" ref="upload" :action="uploadUrl" :before-upload="handleBeforeUpload" :on-success="handleUploadSuccess" :on-error="handleUploadError" name="file" :show-file-list="false" :headers="headers" style="display: none" />
|
||||||
:action="uploadUrl"
|
<div ref="editor" class="editor" :style="styles" />
|
||||||
:before-upload="handleBeforeUpload"
|
|
||||||
:on-success="handleUploadSuccess"
|
|
||||||
:on-error="handleUploadError"
|
|
||||||
name="file"
|
|
||||||
:show-file-list="false"
|
|
||||||
:headers="headers"
|
|
||||||
style="display: none"
|
|
||||||
ref="upload"
|
|
||||||
v-if="this.type == 'url'"
|
|
||||||
>
|
|
||||||
</el-upload>
|
|
||||||
<div class="editor" ref="editor" :style="styles"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Quill from "quill";
|
import Quill from 'quill';
|
||||||
import "quill/dist/quill.core.css";
|
import 'quill/dist/quill.core.css';
|
||||||
import "quill/dist/quill.snow.css";
|
import 'quill/dist/quill.snow.css';
|
||||||
import "quill/dist/quill.bubble.css";
|
import 'quill/dist/quill.bubble.css';
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Editor",
|
name: 'Editor',
|
||||||
props: {
|
props: {
|
||||||
/* 编辑器的内容 */
|
/* 编辑器的内容 */
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: ''
|
||||||
},
|
},
|
||||||
/* 高度 */
|
/* 高度 */
|
||||||
height: {
|
height: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null
|
||||||
},
|
},
|
||||||
/* 最小高度 */
|
/* 最小高度 */
|
||||||
minHeight: {
|
minHeight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: null,
|
default: null
|
||||||
},
|
},
|
||||||
/* 只读 */
|
/* 只读 */
|
||||||
readOnly: {
|
readOnly: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
},
|
||||||
// 上传文件大小限制(MB)
|
// 上传文件大小限制(MB)
|
||||||
fileSize: {
|
fileSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
/* 类型(base64格式、url格式) */
|
/* 类型(base64格式、url格式) */
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "url",
|
default: 'url'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
uploadUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传的图片服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken()
|
Authorization: 'Bearer ' + getToken()
|
||||||
},
|
},
|
||||||
Quill: null,
|
Quill: null,
|
||||||
currentValue: "",
|
currentValue: '',
|
||||||
options: {
|
options: {
|
||||||
theme: "snow",
|
theme: 'snow',
|
||||||
bounds: document.body,
|
bounds: document.body,
|
||||||
debug: "warn",
|
debug: 'warn',
|
||||||
modules: {
|
modules: {
|
||||||
// 工具栏配置
|
// 工具栏配置
|
||||||
toolbar: [
|
toolbar: [
|
||||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
|
||||||
["blockquote", "code-block"], // 引用 代码块
|
['blockquote', 'code-block'], // 引用 代码块
|
||||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
|
||||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
[{ indent: '-1' }, { indent: '+1' }], // 缩进
|
||||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
[{ size: ['small', false, 'large', 'huge'] }], // 字体大小
|
||||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||||
[{ align: [] }], // 对齐方式
|
[{ align: [] }], // 对齐方式
|
||||||
["clean"], // 清除文本格式
|
['clean'], // 清除文本格式
|
||||||
["link", "image", "video"] // 链接、图片、视频
|
['link', 'image', 'video'] // 链接、图片、视频
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
placeholder: "请输入内容",
|
placeholder: '请输入内容',
|
||||||
readOnly: this.readOnly,
|
readOnly: this.readOnly
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
styles() {
|
styles() {
|
||||||
let style = {};
|
const style = {};
|
||||||
if (this.minHeight) {
|
if (this.minHeight) {
|
||||||
style.minHeight = `${this.minHeight}px`;
|
style.minHeight = `${this.minHeight}px`;
|
||||||
}
|
}
|
||||||
@@ -100,20 +88,20 @@ export default {
|
|||||||
style.height = `${this.height}px`;
|
style.height = `${this.height}px`;
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val !== this.currentValue) {
|
if (val !== this.currentValue) {
|
||||||
this.currentValue = val === null ? "" : val;
|
this.currentValue = val === null ? '' : val;
|
||||||
if (this.Quill) {
|
if (this.Quill) {
|
||||||
this.Quill.pasteHTML(this.currentValue);
|
this.Quill.pasteHTML(this.currentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true,
|
immediate: true
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
@@ -127,33 +115,33 @@ export default {
|
|||||||
this.Quill = new Quill(editor, this.options);
|
this.Quill = new Quill(editor, this.options);
|
||||||
// 如果设置了上传地址则自定义图片上传事件
|
// 如果设置了上传地址则自定义图片上传事件
|
||||||
if (this.type == 'url') {
|
if (this.type == 'url') {
|
||||||
let toolbar = this.Quill.getModule("toolbar");
|
const toolbar = this.Quill.getModule('toolbar');
|
||||||
toolbar.addHandler("image", (value) => {
|
toolbar.addHandler('image', (value) => {
|
||||||
this.uploadType = "image";
|
this.uploadType = 'image';
|
||||||
if (value) {
|
if (value) {
|
||||||
this.$refs.upload.$children[0].$refs.input.click();
|
this.$refs.upload.$children[0].$refs.input.click();
|
||||||
} else {
|
} else {
|
||||||
this.quill.format("image", false);
|
this.quill.format('image', false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.Quill.pasteHTML(this.currentValue);
|
this.Quill.pasteHTML(this.currentValue);
|
||||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
this.Quill.on('text-change', (delta, oldDelta, source) => {
|
||||||
const html = this.$refs.editor.children[0].innerHTML;
|
const html = this.$refs.editor.children[0].innerHTML;
|
||||||
const text = this.Quill.getText();
|
const text = this.Quill.getText();
|
||||||
const quill = this.Quill;
|
const quill = this.Quill;
|
||||||
this.currentValue = html;
|
this.currentValue = html;
|
||||||
this.$emit("input", html);
|
this.$emit('input', html);
|
||||||
this.$emit("on-change", { html, text, quill });
|
this.$emit('on-change', { html, text, quill });
|
||||||
});
|
});
|
||||||
this.Quill.on("text-change", (delta, oldDelta, source) => {
|
this.Quill.on('text-change', (delta, oldDelta, source) => {
|
||||||
this.$emit("on-text-change", delta, oldDelta, source);
|
this.$emit('on-text-change', delta, oldDelta, source);
|
||||||
});
|
});
|
||||||
this.Quill.on("selection-change", (range, oldRange, source) => {
|
this.Quill.on('selection-change', (range, oldRange, source) => {
|
||||||
this.$emit("on-selection-change", range, oldRange, source);
|
this.$emit('on-selection-change', range, oldRange, source);
|
||||||
});
|
});
|
||||||
this.Quill.on("editor-change", (eventName, ...args) => {
|
this.Quill.on('editor-change', (eventName, ...args) => {
|
||||||
this.$emit("on-editor-change", eventName, ...args);
|
this.$emit('on-editor-change', eventName, ...args);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 上传前校检格式和大小
|
// 上传前校检格式和大小
|
||||||
@@ -170,103 +158,104 @@ export default {
|
|||||||
},
|
},
|
||||||
handleUploadSuccess(res, file) {
|
handleUploadSuccess(res, file) {
|
||||||
// 获取富文本组件实例
|
// 获取富文本组件实例
|
||||||
let quill = this.Quill;
|
const quill = this.Quill;
|
||||||
// 如果上传成功
|
// 如果上传成功
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// 获取光标所在位置
|
// 获取光标所在位置
|
||||||
let length = quill.getSelection().index;
|
const length = quill.getSelection().index;
|
||||||
// 插入图片 res.url为服务器返回的图片地址
|
// 插入图片 res.url为服务器返回的图片地址
|
||||||
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
|
quill.insertEmbed(length, 'image', process.env.VUE_APP_BASE_API + res.fileName);
|
||||||
// 调整光标到最后
|
// 调整光标到最后
|
||||||
quill.setSelection(length + 1);
|
quill.setSelection(length + 1);
|
||||||
} else {
|
} else {
|
||||||
this.$message.error("图片插入失败");
|
this.$message.error('图片插入失败');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleUploadError() {
|
handleUploadError() {
|
||||||
this.$message.error("图片插入失败");
|
this.$message.error('图片插入失败');
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.editor, .ql-toolbar {
|
.editor,
|
||||||
|
.ql-toolbar {
|
||||||
white-space: pre-wrap !important;
|
white-space: pre-wrap !important;
|
||||||
line-height: normal !important;
|
line-height: normal !important;
|
||||||
}
|
}
|
||||||
.quill-img {
|
.quill-img {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.ql-snow .ql-tooltip[data-mode="link"]::before {
|
.ql-snow .ql-tooltip[data-mode='link']::before {
|
||||||
content: "请输入链接地址:";
|
content: '请输入链接地址:';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
.ql-snow .ql-tooltip.ql-editing a.ql-action::after {
|
||||||
border-right: 0px;
|
border-right: 0px;
|
||||||
content: "保存";
|
content: '保存';
|
||||||
padding-right: 0px;
|
padding-right: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-snow .ql-tooltip[data-mode="video"]::before {
|
.ql-snow .ql-tooltip[data-mode='video']::before {
|
||||||
content: "请输入视频地址:";
|
content: '请输入视频地址:';
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
|
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
.ql-snow .ql-picker.ql-size .ql-picker-item::before {
|
||||||
content: "14px";
|
content: '14px';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
|
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='small']::before,
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before {
|
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='small']::before {
|
||||||
content: "10px";
|
content: '10px';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
|
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='large']::before,
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before {
|
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='large']::before {
|
||||||
content: "18px";
|
content: '18px';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
|
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value='huge']::before,
|
||||||
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before {
|
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value='huge']::before {
|
||||||
content: "32px";
|
content: '32px';
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
|
||||||
content: "文本";
|
content: '文本';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='1']::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='1']::before {
|
||||||
content: "标题1";
|
content: '标题1';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='2']::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='2']::before {
|
||||||
content: "标题2";
|
content: '标题2';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='3']::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='3']::before {
|
||||||
content: "标题3";
|
content: '标题3';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='4']::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='4']::before {
|
||||||
content: "标题4";
|
content: '标题4';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='5']::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='5']::before {
|
||||||
content: "标题5";
|
content: '标题5';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before,
|
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value='6']::before,
|
||||||
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
|
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value='6']::before {
|
||||||
content: "标题6";
|
content: '标题6';
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
|
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
|
||||||
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
|
||||||
content: "标准字体";
|
content: '标准字体';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
|
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='serif']::before,
|
||||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before {
|
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='serif']::before {
|
||||||
content: "衬线字体";
|
content: '衬线字体';
|
||||||
}
|
}
|
||||||
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="monospace"]::before,
|
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value='monospace']::before,
|
||||||
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="monospace"]::before {
|
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value='monospace']::before {
|
||||||
content: "等宽字体";
|
content: '等宽字体';
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,23 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="upload-file">
|
<div class="upload-file">
|
||||||
<el-upload
|
<el-upload ref="fileUpload" multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload" :file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :show-file-list="false" :headers="headers" class="upload-file-uploader">
|
||||||
multiple
|
|
||||||
:action="uploadFileUrl"
|
|
||||||
:before-upload="handleBeforeUpload"
|
|
||||||
:file-list="fileList"
|
|
||||||
:limit="limit"
|
|
||||||
:on-error="handleUploadError"
|
|
||||||
:on-exceed="handleExceed"
|
|
||||||
:on-success="handleUploadSuccess"
|
|
||||||
:show-file-list="false"
|
|
||||||
:headers="headers"
|
|
||||||
class="upload-file-uploader"
|
|
||||||
ref="fileUpload"
|
|
||||||
>
|
|
||||||
<!-- 上传按钮 -->
|
<!-- 上传按钮 -->
|
||||||
<el-button size="mini" type="primary">选取文件</el-button>
|
<el-button size="mini" type="primary">选取文件</el-button>
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
||||||
请上传
|
请上传
|
||||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||||
@@ -27,12 +14,12 @@
|
|||||||
|
|
||||||
<!-- 文件列表 -->
|
<!-- 文件列表 -->
|
||||||
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
<transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
||||||
<li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
<li v-for="(file, index) in fileList" :key="file.url" class="el-upload-list__item ele-upload-list__item-content">
|
||||||
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
<el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
|
||||||
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
<span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
||||||
</el-link>
|
</el-link>
|
||||||
<div class="ele-upload-list__item-content-action">
|
<div class="ele-upload-list__item-content-action">
|
||||||
<el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link>
|
<el-link :underline="false" type="danger" @click="handleDelete(index)">删除</el-link>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</transition-group>
|
</transition-group>
|
||||||
@@ -40,27 +27,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "FileUpload",
|
name: 'FileUpload',
|
||||||
props: {
|
props: {
|
||||||
// 值
|
// 值
|
||||||
value: [String, Object, Array],
|
value: [String, Object, Array],
|
||||||
// 数量限制
|
// 数量限制
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
// 大小限制(MB)
|
// 大小限制(MB)
|
||||||
fileSize: {
|
fileSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
fileType: {
|
fileType: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
|
default: () => ['doc', 'xls', 'ppt', 'txt', 'pdf']
|
||||||
},
|
},
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
isShowTip: {
|
isShowTip: {
|
||||||
@@ -73,13 +60,19 @@ export default {
|
|||||||
number: 0,
|
number: 0,
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
baseUrl: process.env.VUE_APP_BASE_API,
|
baseUrl: process.env.VUE_APP_BASE_API,
|
||||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传文件服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: 'Bearer ' + getToken()
|
||||||
},
|
},
|
||||||
fileList: [],
|
fileList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 是否显示提示
|
||||||
|
showTip() {
|
||||||
|
return this.isShowTip && (this.fileType || this.fileSize);
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
@@ -88,8 +81,8 @@ export default {
|
|||||||
// 首先将值转为数组
|
// 首先将值转为数组
|
||||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
const list = Array.isArray(val) ? val : this.value.split(',');
|
||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map((item) => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === 'string') {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: item };
|
||||||
}
|
}
|
||||||
item.uid = item.uid || new Date().getTime() + temp++;
|
item.uid = item.uid || new Date().getTime() + temp++;
|
||||||
@@ -104,12 +97,6 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
// 是否显示提示
|
|
||||||
showTip() {
|
|
||||||
return this.isShowTip && (this.fileType || this.fileSize);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 上传前校检格式和大小
|
// 上传前校检格式和大小
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
@@ -119,7 +106,7 @@ export default {
|
|||||||
const fileExt = fileName[fileName.length - 1];
|
const fileExt = fileName[fileName.length - 1];
|
||||||
const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
|
const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
|
||||||
if (!isTypeOk) {
|
if (!isTypeOk) {
|
||||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
|
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +118,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$modal.loading("正在上传文件,请稍候...");
|
this.$modal.loading('正在上传文件,请稍候...');
|
||||||
this.number++;
|
this.number++;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
@@ -140,9 +127,9 @@ export default {
|
|||||||
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
||||||
},
|
},
|
||||||
// 上传失败
|
// 上传失败
|
||||||
handleUploadError(err) {
|
handleUploadError() {
|
||||||
this.$modal.msgError("上传文件失败,请重试");
|
this.$modal.msgError('上传文件失败,请重试');
|
||||||
this.$modal.closeLoading()
|
this.$modal.closeLoading();
|
||||||
},
|
},
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res, file) {
|
handleUploadSuccess(res, file) {
|
||||||
@@ -160,7 +147,7 @@ export default {
|
|||||||
// 删除文件
|
// 删除文件
|
||||||
handleDelete(index) {
|
handleDelete(index) {
|
||||||
this.fileList.splice(index, 1);
|
this.fileList.splice(index, 1);
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit('input', this.listToString(this.fileList));
|
||||||
},
|
},
|
||||||
// 上传结束处理
|
// 上传结束处理
|
||||||
uploadedSuccessfully() {
|
uploadedSuccessfully() {
|
||||||
@@ -168,23 +155,23 @@ export default {
|
|||||||
this.fileList = this.fileList.concat(this.uploadList);
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
this.uploadList = [];
|
this.uploadList = [];
|
||||||
this.number = 0;
|
this.number = 0;
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit('input', this.listToString(this.fileList));
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取文件名称
|
// 获取文件名称
|
||||||
getFileName(name) {
|
getFileName(name) {
|
||||||
if (name.lastIndexOf("/") > -1) {
|
if (name.lastIndexOf('/') > -1) {
|
||||||
return name.slice(name.lastIndexOf("/") + 1);
|
return name.slice(name.lastIndexOf('/') + 1);
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 对象转成指定字符串分隔
|
// 对象转成指定字符串分隔
|
||||||
listToString(list, separator) {
|
listToString(list, separator) {
|
||||||
let strs = "";
|
let strs = '';
|
||||||
separator = separator || ",";
|
separator = separator || ',';
|
||||||
for (let i in list) {
|
for (const i in list) {
|
||||||
strs += list[i].url + separator;
|
strs += list[i].url + separator;
|
||||||
}
|
}
|
||||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="padding: 0 15px;" @click="toggleClick">
|
<div style="padding: 0 15px;" @click="toggleClick">
|
||||||
<svg
|
<svg :class="{'is-active':isActive}" class="hamburger" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="64" height="64">
|
||||||
:class="{'is-active':isActive}"
|
|
||||||
class="hamburger"
|
|
||||||
viewBox="0 0 1024 1024"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="64"
|
|
||||||
height="64"
|
|
||||||
>
|
|
||||||
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
|
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,10 +17,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleClick() {
|
toggleClick() {
|
||||||
this.$emit('toggleClick')
|
this.$emit('toggleClick');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{'show':show}" class="header-search">
|
<div :class="{'show':show}" class="header-search">
|
||||||
<svg-icon class-name="search-icon" icon-class="search" @click.stop="click" />
|
<svg-icon class-name="search-icon" icon-class="search" @click.stop="click" />
|
||||||
<el-select
|
<el-select ref="headerSearchSelect" v-model="search" :remote-method="querySearch" filterable default-first-option remote placeholder="Search" class="header-search-select" @change="change">
|
||||||
ref="headerSearchSelect"
|
|
||||||
v-model="search"
|
|
||||||
:remote-method="querySearch"
|
|
||||||
filterable
|
|
||||||
default-first-option
|
|
||||||
remote
|
|
||||||
placeholder="Search"
|
|
||||||
class="header-search-select"
|
|
||||||
@change="change"
|
|
||||||
>
|
|
||||||
<el-option v-for="option in options" :key="option.item.path" :value="option.item" :label="option.item.title.join(' > ')" />
|
<el-option v-for="option in options" :key="option.item.path" :value="option.item" :label="option.item.title.join(' > ')" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -20,8 +10,8 @@
|
|||||||
<script>
|
<script>
|
||||||
// fuse is a lightweight fuzzy-search module
|
// fuse is a lightweight fuzzy-search module
|
||||||
// make search results more in line with expectations
|
// make search results more in line with expectations
|
||||||
import Fuse from 'fuse.js/dist/fuse.min.js'
|
import Fuse from 'fuse.js/dist/fuse.min.js';
|
||||||
import path from 'path'
|
import path from 'path';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HeaderSearch',
|
name: 'HeaderSearch',
|
||||||
@@ -32,57 +22,57 @@ export default {
|
|||||||
searchPool: [],
|
searchPool: [],
|
||||||
show: false,
|
show: false,
|
||||||
fuse: undefined
|
fuse: undefined
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
routes() {
|
routes() {
|
||||||
return this.$store.getters.permission_routes
|
return this.$store.getters.permission_routes;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
routes() {
|
routes() {
|
||||||
this.searchPool = this.generateRoutes(this.routes)
|
this.searchPool = this.generateRoutes(this.routes);
|
||||||
},
|
},
|
||||||
searchPool(list) {
|
searchPool(list) {
|
||||||
this.initFuse(list)
|
this.initFuse(list);
|
||||||
},
|
},
|
||||||
show(value) {
|
show(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
document.body.addEventListener('click', this.close)
|
document.body.addEventListener('click', this.close);
|
||||||
} else {
|
} else {
|
||||||
document.body.removeEventListener('click', this.close)
|
document.body.removeEventListener('click', this.close);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.searchPool = this.generateRoutes(this.routes)
|
this.searchPool = this.generateRoutes(this.routes);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
click() {
|
click() {
|
||||||
this.show = !this.show
|
this.show = !this.show;
|
||||||
if (this.show) {
|
if (this.show) {
|
||||||
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus()
|
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.focus();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur()
|
this.$refs.headerSearchSelect && this.$refs.headerSearchSelect.blur();
|
||||||
this.options = []
|
this.options = [];
|
||||||
this.show = false
|
this.show = false;
|
||||||
},
|
},
|
||||||
change(val) {
|
change(val) {
|
||||||
const path = val.path;
|
const path = val.path;
|
||||||
if(this.ishttp(val.path)) {
|
if (this.ishttp(val.path)) {
|
||||||
// http(s):// 路径新窗口打开
|
// http(s):// 路径新窗口打开
|
||||||
const pindex = path.indexOf("http");
|
const pindex = path.indexOf('http');
|
||||||
window.open(path.substr(pindex, path.length), "_blank");
|
window.open(path.substr(pindex, path.length), '_blank');
|
||||||
} else {
|
} else {
|
||||||
this.$router.push(val.path)
|
this.$router.push(val.path);
|
||||||
}
|
}
|
||||||
this.search = ''
|
this.search = '';
|
||||||
this.options = []
|
this.options = [];
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.show = false
|
this.show = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
initFuse(list) {
|
initFuse(list) {
|
||||||
this.fuse = new Fuse(list, {
|
this.fuse = new Fuse(list, {
|
||||||
@@ -92,61 +82,66 @@ export default {
|
|||||||
distance: 100,
|
distance: 100,
|
||||||
maxPatternLength: 32,
|
maxPatternLength: 32,
|
||||||
minMatchCharLength: 1,
|
minMatchCharLength: 1,
|
||||||
keys: [{
|
keys: [
|
||||||
name: 'title',
|
{
|
||||||
weight: 0.7
|
name: 'title',
|
||||||
}, {
|
weight: 0.7
|
||||||
name: 'path',
|
},
|
||||||
weight: 0.3
|
{
|
||||||
}]
|
name: 'path',
|
||||||
})
|
weight: 0.3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// Filter out the routes that can be displayed in the sidebar
|
// Filter out the routes that can be displayed in the sidebar
|
||||||
// And generate the internationalized title
|
// And generate the internationalized title
|
||||||
generateRoutes(routes, basePath = '/', prefixTitle = []) {
|
generateRoutes(routes, basePath = '/', prefixTitle = []) {
|
||||||
let res = []
|
let res = [];
|
||||||
|
|
||||||
for (const router of routes) {
|
for (const router of routes) {
|
||||||
// skip hidden router
|
// skip hidden router
|
||||||
if (router.hidden) { continue }
|
if (router.hidden) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
path: !this.ishttp(router.path) ? path.resolve(basePath, router.path) : router.path,
|
path: !this.ishttp(router.path) ? path.resolve(basePath, router.path) : router.path,
|
||||||
title: [...prefixTitle]
|
title: [...prefixTitle]
|
||||||
}
|
};
|
||||||
|
|
||||||
if (router.meta && router.meta.title) {
|
if (router.meta && router.meta.title) {
|
||||||
data.title = [...data.title, router.meta.title]
|
data.title = [...data.title, router.meta.title];
|
||||||
|
|
||||||
if (router.redirect !== 'noRedirect') {
|
if (router.redirect !== 'noRedirect') {
|
||||||
// only push the routes with title
|
// only push the routes with title
|
||||||
// special case: need to exclude parent router without redirect
|
// special case: need to exclude parent router without redirect
|
||||||
res.push(data)
|
res.push(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursive child routes
|
// recursive child routes
|
||||||
if (router.children) {
|
if (router.children) {
|
||||||
const tempRoutes = this.generateRoutes(router.children, data.path, data.title)
|
const tempRoutes = this.generateRoutes(router.children, data.path, data.title);
|
||||||
if (tempRoutes.length >= 1) {
|
if (tempRoutes.length >= 1) {
|
||||||
res = [...res, ...tempRoutes]
|
res = [...res, ...tempRoutes];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res
|
return res;
|
||||||
},
|
},
|
||||||
querySearch(query) {
|
querySearch(query) {
|
||||||
if (query !== '') {
|
if (query !== '') {
|
||||||
this.options = this.fuse.search(query)
|
this.options = this.fuse.search(query);
|
||||||
} else {
|
} else {
|
||||||
this.options = []
|
this.options = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ishttp(url) {
|
ishttp(url) {
|
||||||
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1
|
return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -14,55 +14,55 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import icons from './requireIcons'
|
import icons from './requireIcons';
|
||||||
export default {
|
export default {
|
||||||
name: 'IconSelect',
|
name: 'IconSelect',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
name: '',
|
name: '',
|
||||||
iconList: icons
|
iconList: icons
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
filterIcons() {
|
filterIcons() {
|
||||||
this.iconList = icons
|
this.iconList = icons;
|
||||||
if (this.name) {
|
if (this.name) {
|
||||||
this.iconList = this.iconList.filter(item => item.includes(this.name))
|
this.iconList = this.iconList.filter((item) => item.includes(this.name));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedIcon(name) {
|
selectedIcon(name) {
|
||||||
this.$emit('selected', name)
|
this.$emit('selected', name);
|
||||||
document.body.click()
|
document.body.click();
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.name = ''
|
this.name = '';
|
||||||
this.iconList = icons
|
this.iconList = icons;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
.icon-body {
|
.icon-body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
.icon-list {
|
.icon-list {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
div {
|
div {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
margin-bottom: -5px;
|
margin-bottom: -5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 33%;
|
width: 33%;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
span {
|
span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: -0.15em;
|
vertical-align: -0.15em;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
|
const req = require.context('../../assets/icons/svg', false, /\.svg$/);
|
||||||
|
const requireAll = (requireContext) => requireContext.keys();
|
||||||
|
|
||||||
const req = require.context('../../assets/icons/svg', false, /\.svg$/)
|
const re = /\.\/(.*)\.svg/;
|
||||||
const requireAll = requireContext => requireContext.keys()
|
|
||||||
|
|
||||||
const re = /\.\/(.*)\.svg/
|
const icons = requireAll(req).map((i) => {
|
||||||
|
return i.match(re)[1];
|
||||||
|
});
|
||||||
|
|
||||||
const icons = requireAll(req).map(i => {
|
export default icons;
|
||||||
return i.match(re)[1]
|
|
||||||
})
|
|
||||||
|
|
||||||
export default icons
|
|
||||||
|
|||||||
@@ -1,33 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-image
|
<el-image :src="`${realSrc}`" fit="cover" :style="`width:${realWidth};height:${realHeight};`" :preview-src-list="realSrcList">
|
||||||
:src="`${realSrc}`"
|
|
||||||
fit="cover"
|
|
||||||
:style="`width:${realWidth};height:${realHeight};`"
|
|
||||||
:preview-src-list="realSrcList"
|
|
||||||
>
|
|
||||||
<div slot="error" class="image-slot">
|
<div slot="error" class="image-slot">
|
||||||
<i class="el-icon-picture-outline"></i>
|
<i class="el-icon-picture-outline" />
|
||||||
</div>
|
</div>
|
||||||
</el-image>
|
</el-image>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { isExternal } from "@/utils/validate";
|
import { isExternal } from '@/utils/validate';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ImagePreview",
|
name: 'ImagePreview',
|
||||||
props: {
|
props: {
|
||||||
src: {
|
src: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ""
|
default: ''
|
||||||
},
|
},
|
||||||
width: {
|
width: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: ""
|
default: ''
|
||||||
},
|
},
|
||||||
height: {
|
height: {
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: ""
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -35,7 +30,7 @@ export default {
|
|||||||
if (!this.src) {
|
if (!this.src) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let real_src = this.src.split(",")[0];
|
const real_src = this.src.split(',')[0];
|
||||||
if (isExternal(real_src)) {
|
if (isExternal(real_src)) {
|
||||||
return real_src;
|
return real_src;
|
||||||
}
|
}
|
||||||
@@ -45,9 +40,9 @@ export default {
|
|||||||
if (!this.src) {
|
if (!this.src) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let real_src_list = this.src.split(",");
|
const real_src_list = this.src.split(',');
|
||||||
let srcList = [];
|
const srcList = [];
|
||||||
real_src_list.forEach(item => {
|
real_src_list.forEach((item) => {
|
||||||
if (isExternal(item)) {
|
if (isExternal(item)) {
|
||||||
return srcList.push(item);
|
return srcList.push(item);
|
||||||
}
|
}
|
||||||
@@ -56,12 +51,12 @@ export default {
|
|||||||
return srcList;
|
return srcList;
|
||||||
},
|
},
|
||||||
realWidth() {
|
realWidth() {
|
||||||
return typeof this.width == "string" ? this.width : `${this.width}px`;
|
return typeof this.width == 'string' ? this.width : `${this.width}px`;
|
||||||
},
|
},
|
||||||
realHeight() {
|
realHeight() {
|
||||||
return typeof this.height == "string" ? this.height : `${this.height}px`;
|
return typeof this.height == 'string' ? this.height : `${this.height}px`;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="component-upload-image">
|
<div class="component-upload-image">
|
||||||
<el-upload
|
<el-upload ref="imageUpload" multiple :action="uploadImgUrl" list-type="picture-card" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed" :on-remove="handleDelete" :show-file-list="true" :headers="headers" :file-list="fileList" :on-preview="handlePictureCardPreview" :class="{hide: fileList.length >= limit}">
|
||||||
multiple
|
<i class="el-icon-plus" />
|
||||||
:action="uploadImgUrl"
|
|
||||||
list-type="picture-card"
|
|
||||||
:on-success="handleUploadSuccess"
|
|
||||||
:before-upload="handleBeforeUpload"
|
|
||||||
:limit="limit"
|
|
||||||
:on-error="handleUploadError"
|
|
||||||
:on-exceed="handleExceed"
|
|
||||||
ref="imageUpload"
|
|
||||||
:on-remove="handleDelete"
|
|
||||||
:show-file-list="true"
|
|
||||||
:headers="headers"
|
|
||||||
:file-list="fileList"
|
|
||||||
:on-preview="handlePictureCardPreview"
|
|
||||||
:class="{hide: this.fileList.length >= this.limit}"
|
|
||||||
>
|
|
||||||
<i class="el-icon-plus"></i>
|
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<!-- 上传提示 -->
|
<!-- 上传提示 -->
|
||||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
<div v-if="showTip" slot="tip" class="el-upload__tip">
|
||||||
请上传
|
请上传
|
||||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||||
的文件
|
的文件
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog :visible.sync="dialogVisible" title="预览" width="800" append-to-body>
|
||||||
:visible.sync="dialogVisible"
|
<img :src="dialogImageUrl" style="display: block; max-width: 100%; margin: 0 auto">
|
||||||
title="预览"
|
|
||||||
width="800"
|
|
||||||
append-to-body
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
:src="dialogImageUrl"
|
|
||||||
style="display: block; max-width: 100%; margin: 0 auto"
|
|
||||||
/>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getToken } from "@/utils/auth";
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@@ -51,17 +27,17 @@ export default {
|
|||||||
// 图片数量限制
|
// 图片数量限制
|
||||||
limit: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
// 大小限制(MB)
|
// 大小限制(MB)
|
||||||
fileSize: {
|
fileSize: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 5,
|
default: 5
|
||||||
},
|
},
|
||||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
fileType: {
|
fileType: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => ["png", "jpg", "jpeg"],
|
default: () => ['png', 'jpg', 'jpeg']
|
||||||
},
|
},
|
||||||
// 是否显示提示
|
// 是否显示提示
|
||||||
isShowTip: {
|
isShowTip: {
|
||||||
@@ -73,17 +49,23 @@ export default {
|
|||||||
return {
|
return {
|
||||||
number: 0,
|
number: 0,
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
dialogImageUrl: "",
|
dialogImageUrl: '',
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
hideUpload: false,
|
hideUpload: false,
|
||||||
baseUrl: process.env.VUE_APP_BASE_API,
|
baseUrl: process.env.VUE_APP_BASE_API,
|
||||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
|
uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传的图片服务器地址
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Bearer " + getToken(),
|
Authorization: 'Bearer ' + getToken()
|
||||||
},
|
},
|
||||||
fileList: []
|
fileList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 是否显示提示
|
||||||
|
showTip() {
|
||||||
|
return this.isShowTip && (this.fileType || this.fileSize);
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value: {
|
value: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
@@ -91,12 +73,12 @@ export default {
|
|||||||
// 首先将值转为数组
|
// 首先将值转为数组
|
||||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
const list = Array.isArray(val) ? val : this.value.split(',');
|
||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map((item) => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === 'string') {
|
||||||
if (item.indexOf(this.baseUrl) === -1) {
|
if (item.indexOf(this.baseUrl) === -1) {
|
||||||
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
item = { name: this.baseUrl + item, url: this.baseUrl + item };
|
||||||
} else {
|
} else {
|
||||||
item = { name: item, url: item };
|
item = { name: item, url: item };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
@@ -110,32 +92,26 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
// 是否显示提示
|
|
||||||
showTip() {
|
|
||||||
return this.isShowTip && (this.fileType || this.fileSize);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
// 上传前loading加载
|
// 上传前loading加载
|
||||||
handleBeforeUpload(file) {
|
handleBeforeUpload(file) {
|
||||||
let isImg = false;
|
let isImg = false;
|
||||||
if (this.fileType.length) {
|
if (this.fileType.length) {
|
||||||
let fileExtension = "";
|
let fileExtension = '';
|
||||||
if (file.name.lastIndexOf(".") > -1) {
|
if (file.name.lastIndexOf('.') > -1) {
|
||||||
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
fileExtension = file.name.slice(file.name.lastIndexOf('.') + 1);
|
||||||
}
|
}
|
||||||
isImg = this.fileType.some(type => {
|
isImg = this.fileType.some((type) => {
|
||||||
if (file.type.indexOf(type) > -1) return true;
|
if (file.type.indexOf(type) > -1) return true;
|
||||||
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
isImg = file.type.indexOf("image") > -1;
|
isImg = file.type.indexOf('image') > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isImg) {
|
if (!isImg) {
|
||||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
|
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join('/')}图片格式文件!`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.fileSize) {
|
if (this.fileSize) {
|
||||||
@@ -145,7 +121,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$modal.loading("正在上传图片,请稍候...");
|
this.$modal.loading('正在上传图片,请稍候...');
|
||||||
this.number++;
|
this.number++;
|
||||||
},
|
},
|
||||||
// 文件个数超出
|
// 文件个数超出
|
||||||
@@ -167,15 +143,15 @@ export default {
|
|||||||
},
|
},
|
||||||
// 删除图片
|
// 删除图片
|
||||||
handleDelete(file) {
|
handleDelete(file) {
|
||||||
const findex = this.fileList.map(f => f.name).indexOf(file.name);
|
const findex = this.fileList.map((f) => f.name).indexOf(file.name);
|
||||||
if(findex > -1) {
|
if (findex > -1) {
|
||||||
this.fileList.splice(findex, 1);
|
this.fileList.splice(findex, 1);
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit('input', this.listToString(this.fileList));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 上传失败
|
// 上传失败
|
||||||
handleUploadError() {
|
handleUploadError() {
|
||||||
this.$modal.msgError("上传图片失败,请重试");
|
this.$modal.msgError('上传图片失败,请重试');
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
},
|
},
|
||||||
// 上传结束处理
|
// 上传结束处理
|
||||||
@@ -184,7 +160,7 @@ export default {
|
|||||||
this.fileList = this.fileList.concat(this.uploadList);
|
this.fileList = this.fileList.concat(this.uploadList);
|
||||||
this.uploadList = [];
|
this.uploadList = [];
|
||||||
this.number = 0;
|
this.number = 0;
|
||||||
this.$emit("input", this.listToString(this.fileList));
|
this.$emit('input', this.listToString(this.fileList));
|
||||||
this.$modal.closeLoading();
|
this.$modal.closeLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -195,11 +171,11 @@ export default {
|
|||||||
},
|
},
|
||||||
// 对象转成指定字符串分隔
|
// 对象转成指定字符串分隔
|
||||||
listToString(list, separator) {
|
listToString(list, separator) {
|
||||||
let strs = "";
|
let strs = '';
|
||||||
separator = separator || ",";
|
separator = separator || ',';
|
||||||
for (let i in list) {
|
for (const i in list) {
|
||||||
if (list[i].url) {
|
if (list[i].url) {
|
||||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
strs += list[i].url.replace(this.baseUrl, '') + separator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
||||||
@@ -210,17 +186,18 @@ export default {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
// .el-upload--picture-card 控制加号部分
|
// .el-upload--picture-card 控制加号部分
|
||||||
::v-deep.hide .el-upload--picture-card {
|
::v-deep.hide .el-upload--picture-card {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
// 去掉动画效果
|
// 去掉动画效果
|
||||||
::v-deep .el-list-enter-active,
|
::v-deep .el-list-enter-active,
|
||||||
::v-deep .el-list-leave-active {
|
::v-deep .el-list-leave-active {
|
||||||
transition: all 0s;
|
transition: all 0s;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-list-enter, .el-list-leave-active {
|
::v-deep .el-list-enter,
|
||||||
opacity: 0;
|
.el-list-leave-active {
|
||||||
transform: translateY(0);
|
opacity: 0;
|
||||||
|
transform: translateY(0);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{'hidden':hidden}" class="pagination-container">
|
<div :class="{'hidden':hidden}" class="pagination-container">
|
||||||
<el-pagination
|
<el-pagination :background="background" :current-page.sync="currentPage" :page-size.sync="pageSize" :layout="layout" :page-sizes="pageSizes" :pager-count="pagerCount" :total="total" v-bind="$attrs" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
||||||
:background="background"
|
|
||||||
:current-page.sync="currentPage"
|
|
||||||
:page-size.sync="pageSize"
|
|
||||||
:layout="layout"
|
|
||||||
:page-sizes="pageSizes"
|
|
||||||
:pager-count="pagerCount"
|
|
||||||
:total="total"
|
|
||||||
v-bind="$attrs"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { scrollTo } from '@/utils/scroll-to'
|
import { scrollTo } from '@/utils/scroll-to';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Pagination',
|
name: 'Pagination',
|
||||||
@@ -36,7 +25,7 @@ export default {
|
|||||||
pageSizes: {
|
pageSizes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return [10, 20, 30, 50]
|
return [10, 20, 30, 50];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 移动端页码按钮的数量端默认值5
|
// 移动端页码按钮的数量端默认值5
|
||||||
@@ -62,45 +51,44 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {};
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
currentPage: {
|
currentPage: {
|
||||||
get() {
|
get() {
|
||||||
return this.page
|
return this.page;
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.$emit('update:page', val)
|
this.$emit('update:page', val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pageSize: {
|
pageSize: {
|
||||||
get() {
|
get() {
|
||||||
return this.limit
|
return this.limit;
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.$emit('update:limit', val)
|
this.$emit('update:limit', val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
if (this.currentPage * val > this.total) {
|
if (this.currentPage * val > this.total) {
|
||||||
this.currentPage = 1
|
this.currentPage = 1;
|
||||||
}
|
}
|
||||||
this.$emit('pagination', { page: this.currentPage, limit: val })
|
this.$emit('pagination', { page: this.currentPage, limit: val });
|
||||||
if (this.autoScroll) {
|
if (this.autoScroll) {
|
||||||
scrollTo(0, 800)
|
scrollTo(0, 800);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.$emit('pagination', { page: val, limit: this.pageSize })
|
this.$emit('pagination', { page: val, limit: this.pageSize });
|
||||||
if (this.autoScroll) {
|
if (this.autoScroll) {
|
||||||
scrollTo(0, 800)
|
scrollTo(0, 800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default {
|
|||||||
default: '150px'
|
default: '150px'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<template >
|
<template>
|
||||||
<router-view />
|
<router-view />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -21,49 +21,49 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
show: {
|
show: {
|
||||||
get() {
|
get() {
|
||||||
return this.$store.state.settings.showSettings
|
return this.$store.state.settings.showSettings;
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val) {
|
||||||
this.$store.dispatch('settings/changeSetting', {
|
this.$store.dispatch('settings/changeSetting', {
|
||||||
key: 'showSettings',
|
key: 'showSettings',
|
||||||
value: val
|
value: val
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
show(value) {
|
show(value) {
|
||||||
if (value && !this.clickNotClose) {
|
if (value && !this.clickNotClose) {
|
||||||
this.addEventClick()
|
this.addEventClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.insertToBody()
|
this.insertToBody();
|
||||||
this.addEventClick()
|
this.addEventClick();
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
const elx = this.$refs.rightPanel
|
const elx = this.$refs.rightPanel;
|
||||||
elx.remove()
|
elx.remove();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addEventClick() {
|
addEventClick() {
|
||||||
window.addEventListener('click', this.closeSidebar)
|
window.addEventListener('click', this.closeSidebar);
|
||||||
},
|
},
|
||||||
closeSidebar(evt) {
|
closeSidebar(evt) {
|
||||||
const parent = evt.target.closest('.el-drawer__body')
|
const parent = evt.target.closest('.el-drawer__body');
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
this.show = false
|
this.show = false;
|
||||||
window.removeEventListener('click', this.closeSidebar)
|
window.removeEventListener('click', this.closeSidebar);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
insertToBody() {
|
insertToBody() {
|
||||||
const elx = this.$refs.rightPanel
|
const elx = this.$refs.rightPanel;
|
||||||
const body = document.querySelector('body')
|
const body = document.querySelector('body');
|
||||||
body.insertBefore(elx, body.firstChild)
|
body.insertBefore(elx, body.firstChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -72,8 +72,8 @@ export default {
|
|||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity .3s cubic-bezier(.7, .3, .1, 1);
|
transition: opacity 0.3s cubic-bezier(0.7, 0.3, 0.1, 1);
|
||||||
background: rgba(0, 0, 0, .2);
|
background: rgba(0, 0, 0, 0.2);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ export default {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, .05);
|
box-shadow: 0px 0px 15px 0px rgba(0, 0, 0, 0.05);
|
||||||
transition: all .25s cubic-bezier(.7, .3, .1, 1);
|
transition: all 0.25s cubic-bezier(0.7, 0.3, 0.1, 1);
|
||||||
transform: translate(100%);
|
transform: translate(100%);
|
||||||
background: #fff;
|
background: #fff;
|
||||||
z-index: 40000;
|
z-index: 40000;
|
||||||
|
|||||||