优化代码

This commit is contained in:
smallchill 2019-02-21 22:34:21 +08:00
parent d5e4c0f3cf
commit 9c6db088d1
33 changed files with 2478 additions and 2398 deletions

16
.editorconfig Normal file
View File

@ -0,0 +1,16 @@
# http://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -13,7 +13,7 @@
<link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css"> <link rel="stylesheet" href="<%= BASE_URL %>cdn/animate/3.5.2/animate.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/index.css"> <link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/index.css">
<link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/1.5.3/index.css"> <link rel="stylesheet" href="<%= BASE_URL %>cdn/avue/1.5.3/index.css">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>Saber企业级开发平台</title> <title>Saber企业级开发平台</title>
<style> <style>
html, html,

View File

@ -1,4 +1,5 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const getList = (current, size, params) => { export const getList = (current, size, params) => {
return request({ return request({
url: 'api/blade-desk/notice/list', url: 'api/blade-desk/notice/list',

View File

@ -1,4 +1,5 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const getUsualList = (current, size) => { export const getUsualList = (current, size) => {
return request({ return request({
url: 'api/blade-log/usual/list', url: 'api/blade-log/usual/list',

View File

@ -1,9 +1,12 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const resetPassword = (userIds) => { export const resetPassword = (userIds) => {
return request({ return request({
url: 'api/blade-user/reset-password', url: 'api/blade-user/reset-password',
method: 'post', method: 'post',
data: userIds params: {
userIds,
}
}) })
} }
export const getList = (current, size, params) => { export const getList = (current, size, params) => {
@ -18,13 +21,10 @@ export const getList = (current, size, params) => {
} }
export const remove = (ids) => { export const remove = (ids) => {
return request({ return request({
url: 'api/blade-system/user/remove', url: 'api/blade-user/remove',
method: 'post', method: 'post',
data: { params: {
ids, ids,
},
meta: {
isSerialize: true,
} }
}) })
} }

View File

@ -1,4 +1,5 @@
import request from '@/router/axios'; import request from '@/router/axios';
export const getList = (current, size) => { export const getList = (current, size) => {
return request({ return request({
url: 'api/blade-develop/code/list', url: 'api/blade-develop/code/list',

View File

@ -1,4 +1,5 @@
import Mock from 'mockjs' import Mock from 'mockjs'
const top = [{ const top = [{
label: "首页", label: "首页",
path: "/wel/index", path: "/wel/index",

View File

@ -19,7 +19,8 @@
icon="el-icon-delete" icon="el-icon-delete"
plain plain
v-if="permission.notice_delete" v-if="permission.notice_delete"
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="category"> slot="category">
@ -32,6 +33,7 @@
<script> <script>
import {getList, remove, update, add, getNotice} from "@/api/dept/notice"; import {getList, remove, update, add, getNotice} from "@/api/dept/notice";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -25,6 +25,7 @@
<script> <script>
import {getApiList, getApiLogs} from "@/api/logs"; import {getApiList, getApiLogs} from "@/api/logs";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -25,6 +25,7 @@
<script> <script>
import {getErrorList, getErrorLogs} from "@/api/logs"; import {getErrorList, getErrorLogs} from "@/api/logs";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -25,6 +25,7 @@
<script> <script>
import {getUsualList, getUsualLogs} from "@/api/logs"; import {getUsualList, getUsualLogs} from "@/api/logs";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -19,7 +19,8 @@
icon="el-icon-delete" icon="el-icon-delete"
v-if="permission.dept_delete" v-if="permission.dept_delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -43,6 +44,7 @@ import {
getDeptTree getDeptTree
} from "@/api/system/dept"; } from "@/api/system/dept";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -19,7 +19,8 @@
icon="el-icon-delete" icon="el-icon-delete"
v-if="permission.dict_delete" v-if="permission.dict_delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -43,6 +44,7 @@ import {
getDictTree getDictTree
} from "@/api/system/dict"; } from "@/api/system/dict";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -19,7 +19,8 @@
icon="el-icon-delete" icon="el-icon-delete"
v-if="permission.menu_delete" v-if="permission.menu_delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -36,6 +37,7 @@
<script> <script>
import {getList, remove, update, add, getMenu} from "@/api/system/menu"; import {getList, remove, update, add, getMenu} from "@/api/system/menu";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -18,7 +18,8 @@
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -35,6 +36,7 @@
<script> <script>
import {getList, remove, update, add} from "@/api/system/param"; import {getList, remove, update, add} from "@/api/system/param";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -17,11 +17,13 @@
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
<el-button size="small" <el-button size="small"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleRole" @click="handleRole"
plain>权限设置</el-button> plain>权限设置
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -64,6 +66,7 @@ import {
getRole getRole
} from "@/api/system/role"; } from "@/api/system/role";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -20,13 +20,15 @@
icon="el-icon-delete" icon="el-icon-delete"
plain plain
v-if="permission.user_delete" v-if="permission.user_delete"
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
plain plain
v-if="permission. user_reset" v-if="permission. user_reset"
icon="el-icon-refresh" icon="el-icon-refresh"
@click="handleReset">密码重置</el-button> @click="handleReset">密码重置
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -50,6 +52,7 @@ import {
resetPassword resetPassword
} from "@/api/system/user"; } from "@/api/system/user";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -19,12 +19,14 @@
size="small" size="small"
icon="el-icon-delete" icon="el-icon-delete"
plain plain
@click="handleDelete"> </el-button> @click="handleDelete">
</el-button>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
plain plain
icon="el-icon-refresh" icon="el-icon-refresh"
@click="handleBuild">代码生成</el-button> @click="handleBuild">代码生成
</el-button>
</template> </template>
<template slot-scope="{row}" <template slot-scope="{row}"
slot="roleId"> slot="roleId">
@ -41,6 +43,7 @@
<script> <script>
import {getList, getCode, build, remove, add, update} from "@/api/tool/code"; import {getList, getCode, build, remove, add, update} from "@/api/tool/code";
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
data() { data() {
return { return {

View File

@ -11,6 +11,7 @@
<script> <script>
import option from "@/const/user/info"; import option from "@/const/user/info";
export default { export default {
data() { data() {
return { return {

View File

@ -3,7 +3,8 @@
<h3>请打开浏览器控制台然后点击下面的按钮</h3> <h3>请打开浏览器控制台然后点击下面的按钮</h3>
<el-button type="danger" <el-button type="danger"
size="small" size="small"
@click="handleNewError">触发一个错误</el-button> @click="handleNewError">触发一个错误
</el-button>
</basic-container> </basic-container>
</template> </template>

View File

@ -14,13 +14,16 @@
</avue-crud> </avue-crud>
</basic-container> </basic-container>
<basic-container> <basic-container>
权限开关<el-switch :active-value="false" 权限开关
<el-switch :active-value="false"
:inactive-value="true" :inactive-value="true"
v-model="text" v-model="text"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949">
</el-switch> </el-switch>
<p> 具体参考<a href="https://avuex.avue.top/#/doc/crud-permission">https://avuex.avue.top/#/doc/crud-permission</a></p> <p> 具体参考<a
href="https://avuex.avue.top/#/doc/crud-permission">https://avuex.avue.top/#/doc/crud-permission</a>
</p>
</basic-container> </basic-container>
</div> </div>
</template> </template>

View File

@ -2,50 +2,63 @@
<basic-container> <basic-container>
<h3>存储</h3> <h3>存储</h3>
<el-tag class="title" <el-tag class="title"
size="small">基本读写删(持久化存储)</el-tag> size="small">基本读写删(持久化存储)
</el-tag>
<div class="box"> <div class="box">
<el-button type="primary" <el-button type="primary"
size="small" size="small"
@click="setItem({name:'username', value:'avuex'});">set('username', 'avuex')</el-button> @click="setItem({name:'username', value:'avuex'});">set('username', 'avuex')
</el-button>
<el-button type="success" <el-button type="success"
size="small" size="small"
@click="getItem({name:'username'});">get('username')</el-button> @click="getItem({name:'username'});">get('username')
</el-button>
<el-button type="danger" <el-button type="danger"
size="small" size="small"
@click="delItem({name:'username'});">remove('username')</el-button> @click="delItem({name:'username'});">remove('username')
</el-button>
</div> </div>
<el-tag class="title" <el-tag class="title"
size="small">设置session(session存储)</el-tag> size="small">设置session(session存储)
</el-tag>
<div class="box"> <div class="box">
<el-button type="primary" <el-button type="primary"
size="small" size="small"
@click="setItem({name:'username', value:'avuex',type:'session'});">set('username', 'avuex')</el-button> @click="setItem({name:'username', value:'avuex',type:'session'});">set('username', 'avuex')
</el-button>
<el-button type="success" <el-button type="success"
size="small" size="small"
@click="getItem({name:'username',type:'session'});">get('username')</el-button> @click="getItem({name:'username',type:'session'});">get('username')
</el-button>
<el-button type="danger" <el-button type="danger"
size="small" size="small"
@click="delItem({name:'username',type:'session'});">remove('username')</el-button> @click="delItem({name:'username',type:'session'});">remove('username')
</el-button>
</div> </div>
<el-tag class="title" <el-tag class="title"
size="small">获取所有可以获得的数据</el-tag> size="small">获取所有可以获得的数据
</el-tag>
<div class="box"> <div class="box">
<el-button type="success" <el-button type="success"
size="small" size="small"
@click="getAll()">getAll(持久化存储)</el-button> @click="getAll()">getAll(持久化存储)
</el-button>
<el-button type="success" <el-button type="success"
size="small" size="small"
@click="getAll({type:'session'})">getAll(session存储)</el-button> @click="getAll({type:'session'})">getAll(session存储)
</el-button>
<el-button type="danger" <el-button type="danger"
size="small" size="small"
@click="clearAll()">delAll(持久化存储)</el-button> @click="clearAll()">delAll(持久化存储)
</el-button>
<el-button type="danger" <el-button type="danger"
size="small" size="small"
@click="clearAll({type:'session'})">delAll(session存储)</el-button> @click="clearAll({type:'session'})">delAll(session存储)
</el-button>
</div> </div>
</basic-container> </basic-container>
@ -59,6 +72,7 @@ import {
clearStore, clearStore,
getAllStore getAllStore
} from "@/util/store"; } from "@/util/store";
export default { export default {
name: "store", name: "store",
methods: { methods: {
@ -101,6 +115,7 @@ export default {
.title { .title {
margin-bottom: 10px; margin-bottom: 10px;
} }
.box { .box {
margin-bottom: 20px; margin-bottom: 20px;
} }

View File

@ -3,13 +3,16 @@
<h3>标签</h3> <h3>标签</h3>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
@click="$router.push('/test/index')">打开一个页面</el-button> @click="$router.push('/test/index')">打开一个页面
</el-button>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
@click="$router.$avueRouter.closeTag('/test/index')">关闭打开的页面</el-button> @click="$router.$avueRouter.closeTag('/test/index')">关闭打开的页面
</el-button>
<el-button type="primary" <el-button type="primary"
size="small" size="small"
@click="$router.$avueRouter.closeTag()">关闭本标签</el-button> @click="$router.$avueRouter.closeTag()">关闭本标签
</el-button>
</basic-container> </basic-container>
</template> </template>

View File

@ -11,7 +11,8 @@ export default {
return {}; return {};
}, },
computed: {}, computed: {},
created() {}, created() {
},
methods: {} methods: {}
}; };
</script> </script>

View File

@ -70,6 +70,7 @@
<script> <script>
import {mapGetters} from "vuex"; import {mapGetters} from "vuex";
export default { export default {
name: "wel", name: "wel",
data() { data() {
@ -258,7 +259,8 @@ export default {
}; };
} }
}, },
created() {}, created() {
},
methods: {} methods: {}
}; };
</script> </script>
@ -273,26 +275,31 @@ export default {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
&__info { &__info {
display: flex; display: flex;
align-items: center; align-items: center;
&-img { &-img {
border-radius: 72px; border-radius: 72px;
display: block; display: block;
width: 72px; width: 72px;
height: 72px; height: 72px;
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block; display: block;
} }
} }
&-content { &-content {
position: relative; position: relative;
margin-left: 24px; margin-left: 24px;
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
line-height: 22px; line-height: 22px;
} }
&-title { &-title {
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 28px;
@ -300,6 +307,7 @@ export default {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px; margin-bottom: 12px;
} }
&-subtitle { &-subtitle {
position: relative; position: relative;
font-size: 14px; font-size: 14px;
@ -307,16 +315,19 @@ export default {
line-height: 22px; line-height: 22px;
} }
} }
&__extra { &__extra {
&-item { &-item {
position: relative; position: relative;
padding: 0 32px; padding: 0 32px;
display: inline-block; display: inline-block;
&:last-child { &:last-child {
&::after { &::after {
display: none; display: none;
} }
} }
&:after { &:after {
background-color: #e8e8e8; background-color: #e8e8e8;
position: absolute; position: absolute;
@ -327,17 +338,20 @@ export default {
content: ""; content: "";
} }
} }
&-title { &-title {
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
margin-bottom: 4px; margin-bottom: 4px;
} }
&-subtitle { &-subtitle {
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
font-size: 30px; font-size: 30px;
line-height: 38px; line-height: 38px;
margin: 0; margin: 0;
span { span {
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
font-size: 20px; font-size: 20px;