优化代码

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/iconfont/1.0.0/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>
<style>
html,

View File

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

View File

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

View File

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

View File

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

View File

@ -1,51 +1,51 @@
import request from '@/router/axios';
import { baseUrl } from '@/config/env';
import {baseUrl} from '@/config/env';
export const loginByUsername = (account, password, type) => request({
url: 'api/blade-auth/token',
method: 'post',
data: {
account,
password,
type
},
meta: {
isSerialize: true,
}
url: 'api/blade-auth/token',
method: 'post',
data: {
account,
password,
type
},
meta: {
isSerialize: true,
}
})
export const getButtons = () => request({
url: 'api/blade-system/menu/buttons',
method: 'get'
url: 'api/blade-system/menu/buttons',
method: 'get'
});
export const getUserInfo = () => request({
url: baseUrl + '/user/getUserInfo',
method: 'get'
url: baseUrl + '/user/getUserInfo',
method: 'get'
});
export const refeshToken = () => request({
url: baseUrl + '/user/refesh',
method: 'post'
url: baseUrl + '/user/refesh',
method: 'post'
})
export const getMenu = () => request({
url: 'api/blade-system/menu/routes',
method: 'get'
url: 'api/blade-system/menu/routes',
method: 'get'
});
export const getTopMenu = () => request({
url: baseUrl + '/user/getTopMenu',
method: 'get'
url: baseUrl + '/user/getTopMenu',
method: 'get'
});
export const sendLogs = (list) => request({
url: baseUrl + '/user/logout',
method: 'post',
data: list
url: baseUrl + '/user/logout',
method: 'post',
data: list
})
export const logout = () => request({
url: baseUrl + '/user/logout',
method: 'get'
url: baseUrl + '/user/logout',
method: 'get'
})

View File

@ -7,6 +7,6 @@ import menu from './menu';
* mock是否开启模拟数据拦截
*/
user({ mock: true});
user({mock: true});
menu({ mock: true });
menu({mock: true});

View File

@ -1,46 +1,47 @@
import Mock from 'mockjs'
const top = [{
label: "首页",
path: "/wel/index",
icon: 'el-icon-menu',
meta: {
i18n: 'dashboard',
},
parentId: 0
label: "首页",
path: "/wel/index",
icon: 'el-icon-menu',
meta: {
i18n: 'dashboard',
},
parentId: 0
},
{
{
label: "bladex官网",
icon: 'el-icon-document',
meta: {
i18n: 'website',
i18n: 'website',
},
path: "https://bladex.vip/#/",
parentId: 1
},
{
},
{
label: "avuex官网",
icon: 'el-icon-document',
meta: {
i18n: 'avuexwebsite',
i18n: 'avuexwebsite',
},
path: "https://avuex.avue.top",
parentId: 2
},
{
},
{
label: "测试",
icon: 'el-icon-document',
path: "/test/index",
meta: {
i18n: 'test',
i18n: 'test',
},
parentId: 3
}]
export default ({ mock }) => {
if (!mock) return;
Mock.mock('/user/getTopMenu', 'get', () => {
return {
data: top
}
})
}]
export default ({mock}) => {
if (!mock) return;
Mock.mock('/user/getTopMenu', 'get', () => {
return {
data: top
}
})
}

View File

@ -19,7 +19,8 @@
icon="el-icon-delete"
plain
v-if="permission.notice_delete"
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
</template>
<template slot-scope="{row}"
slot="category">
@ -30,167 +31,168 @@
</template>
<script>
import { getList, remove, update, add, getNotice } from "@/api/dept/notice";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: {
border: true,
index: true,
viewBtn: true,
selection: true,
column: [
{
label: "通知标题",
prop: "title",
row: true,
search: true
},
{
label: "通知类型",
type: "select",
row: true,
dicUrl: "/api/blade-system/dict/dictionary?code=notice",
props: {
label: "dictValue",
value: "dictKey"
},
slot: true,
prop: "category",
search: true
},
{
label: "通知内容",
prop: "content",
span: 24,
minRows: 6,
type: "textarea"
},
{
label: "通知日期",
type: "date",
prop: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss"
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {getList, remove, update, add, getNotice} from "@/api/dept/notice";
import {mapGetters} from "vuex";
export default {
data() {
return {
addBtn: this.permission.notice_add,
viewBtn: this.permission.notice_view,
delBtn: this.permission.notice_delete,
editBtn: this.permission.notice_edit
form: {},
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
selectionList: [],
option: {
border: true,
index: true,
viewBtn: true,
selection: true,
column: [
{
label: "通知标题",
prop: "title",
row: true,
search: true
},
{
label: "通知类型",
type: "select",
row: true,
dicUrl: "/api/blade-system/dict/dictionary?code=notice",
props: {
label: "dictValue",
value: "dictKey"
},
slot: true,
prop: "category",
search: true
},
{
label: "通知内容",
prop: "content",
span: 24,
minRows: 6,
type: "textarea"
},
{
label: "通知日期",
type: "date",
prop: "date",
format: "yyyy-MM-dd hh:mm:ss",
valueFormat: "yyyy-MM-dd hh:mm:ss"
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.notice_add,
viewBtn: this.permission.notice_view,
delBtn: this.permission.notice_delete,
editBtn: this.permission.notice_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
return ids.join(",");
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getNotice(this.form.id).then(res => {
this.form = res.data.data;
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getNotice(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
};
};
</script>
<style>

View File

@ -23,121 +23,122 @@
</template>
<script>
import { getApiList, getApiLogs } from "@/api/logs";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
viewBtn: true,
editBtn: false,
addBtn: false,
delBtn: false,
menuWidth: 120,
column: [
{
label: "服务id",
prop: "serviceId",
search: true
},
{
label: "服务host",
prop: "serverHost",
search: true
},
{
label: "服务ip",
prop: "serverIp"
},
{
label: "软件环境",
prop: "env"
},
{
label: "日志名",
prop: "title"
},
{
label: "请求方法",
prop: "method"
},
{
label: "请求接口",
prop: "requestUri"
},
{
label: "日志时间",
prop: "createTime"
},
{
label: "用户代理",
prop: "userAgent",
span: 24,
hide: true
},
{
label: "请求数据",
prop: "params",
type: "textarea",
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
},
import {getApiList, getApiLogs} from "@/api/logs";
import {mapGetters} from "vuex";
computed: {
...mapGetters(["permission"]),
permissionList() {
export default {
data() {
return {
viewBtn: this.permission.log_api_view
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
viewBtn: true,
editBtn: false,
addBtn: false,
delBtn: false,
menuWidth: 120,
column: [
{
label: "服务id",
prop: "serviceId",
search: true
},
{
label: "服务host",
prop: "serverHost",
search: true
},
{
label: "服务ip",
prop: "serverIp"
},
{
label: "软件环境",
prop: "env"
},
{
label: "日志名",
prop: "title"
},
{
label: "请求方法",
prop: "method"
},
{
label: "请求接口",
prop: "requestUri"
},
{
label: "日志时间",
prop: "createTime"
},
{
label: "用户代理",
prop: "userAgent",
span: 24,
hide: true
},
{
label: "请求数据",
prop: "params",
type: "textarea",
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
}
},
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
viewBtn: this.permission.log_api_view
};
}
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getApiLogs(this.form.strId).then(res => {
this.form = res.data.data;
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getApiLogs(this.form.strId).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getApiList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
done();
},
onLoad(page, params = {}) {
getApiList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
};
};
</script>
<style>

View File

@ -23,120 +23,121 @@
</template>
<script>
import { getErrorList, getErrorLogs } from "@/api/logs";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
viewBtn: true,
editBtn: false,
addBtn: false,
delBtn: false,
menuWidth: 120,
column: [
{
label: "服务id",
prop: "serviceId",
search: true
},
{
label: "服务host",
prop: "serverHost",
search: true
},
{
label: "服务ip",
prop: "serverIp"
},
{
label: "软件环境",
prop: "env"
},
{
label: "日志名",
prop: "title"
},
{
label: "请求方法",
prop: "method"
},
{
label: "请求接口",
prop: "requestUri"
},
{
label: "日志时间",
prop: "createTime"
},
{
label: "用户代理",
prop: "userAgent",
span: 24,
hide: true
},
{
label: "请求数据",
prop: "params",
type: "textarea",
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {getErrorList, getErrorLogs} from "@/api/logs";
import {mapGetters} from "vuex";
export default {
data() {
return {
viewBtn: this.permission.log_error_view
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
viewBtn: true,
editBtn: false,
addBtn: false,
delBtn: false,
menuWidth: 120,
column: [
{
label: "服务id",
prop: "serviceId",
search: true
},
{
label: "服务host",
prop: "serverHost",
search: true
},
{
label: "服务ip",
prop: "serverIp"
},
{
label: "软件环境",
prop: "env"
},
{
label: "日志名",
prop: "title"
},
{
label: "请求方法",
prop: "method"
},
{
label: "请求接口",
prop: "requestUri"
},
{
label: "日志时间",
prop: "createTime"
},
{
label: "用户代理",
prop: "userAgent",
span: 24,
hide: true
},
{
label: "请求数据",
prop: "params",
type: "textarea",
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
}
},
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
viewBtn: this.permission.log_error_view
};
}
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getErrorLogs(this.form.strId).then(res => {
this.form = res.data.data;
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getErrorLogs(this.form.strId).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getErrorList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
done();
},
onLoad(page, params = {}) {
getErrorList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
};
};
</script>
<style>

View File

@ -23,120 +23,121 @@
</template>
<script>
import { getUsualList, getUsualLogs } from "@/api/logs";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
viewBtn: true,
editBtn: false,
addBtn: false,
delBtn: false,
menuWidth: 120,
column: [
{
label: "服务id",
prop: "serviceId",
search: true
},
{
label: "服务host",
prop: "serverHost",
search: true
},
{
label: "服务ip",
prop: "serverIp"
},
{
label: "软件环境",
prop: "env"
},
{
label: "日志级别",
prop: "logLevel"
},
{
label: "日志id",
prop: "logId"
},
{
label: "请求接口",
prop: "requestUri"
},
{
label: "日志时间",
prop: "logData"
},
{
label: "用户代理",
prop: "userAgent",
span: 24,
hide: true
},
{
label: "请求数据",
prop: "params",
type: "textarea",
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {getUsualList, getUsualLogs} from "@/api/logs";
import {mapGetters} from "vuex";
export default {
data() {
return {
viewBtn: this.permission.log_usual_view
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
viewBtn: true,
editBtn: false,
addBtn: false,
delBtn: false,
menuWidth: 120,
column: [
{
label: "服务id",
prop: "serviceId",
search: true
},
{
label: "服务host",
prop: "serverHost",
search: true
},
{
label: "服务ip",
prop: "serverIp"
},
{
label: "软件环境",
prop: "env"
},
{
label: "日志级别",
prop: "logLevel"
},
{
label: "日志id",
prop: "logId"
},
{
label: "请求接口",
prop: "requestUri"
},
{
label: "日志时间",
prop: "logData"
},
{
label: "用户代理",
prop: "userAgent",
span: 24,
hide: true
},
{
label: "请求数据",
prop: "params",
type: "textarea",
span: 24,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "stackTrace",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
}
},
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
viewBtn: this.permission.log_usual_view
};
}
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getUsualLogs(this.form.strId).then(res => {
this.form = res.data.data;
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getUsualLogs(this.form.strId).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getUsualList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
done();
},
onLoad(page, params = {}) {
getUsualList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
};
};
</script>
<style>

View File

@ -19,7 +19,8 @@
icon="el-icon-delete"
v-if="permission.dept_delete"
plain
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -34,170 +35,171 @@
</template>
<script>
import {
getList,
remove,
update,
add,
getDept,
getDeptTree
} from "@/api/system/dept";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "部门名称",
prop: "deptName",
search: true
},
{
label: "部门全称",
prop: "fullName",
search: true
},
{
label: "上级部门",
prop: "parentId",
dicData: [],
type: "tree",
hide: true,
props: {
label: "title"
}
},
import {
getList,
remove,
update,
add,
getDept,
getDeptTree
} from "@/api/system/dept";
import {mapGetters} from "vuex";
{
label: "排序",
prop: "sort"
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
export default {
data() {
return {
addBtn: this.permission.dept_add,
viewBtn: this.permission.dept_view,
delBtn: this.permission.dept_delete,
editBtn: this.permission.dept_edit
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "部门名称",
prop: "deptName",
search: true
},
{
label: "部门全称",
prop: "fullName",
search: true
},
{
label: "上级部门",
prop: "parentId",
dicData: [],
type: "tree",
hide: true,
props: {
label: "title"
}
},
{
label: "排序",
prop: "sort"
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.dept_add,
viewBtn: this.permission.dept_view,
delBtn: this.permission.dept_delete,
editBtn: this.permission.dept_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
return ids.join(",");
}
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDept(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
getDeptTree().then(res => {
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDept(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId");
this.option.column[index].dicData = data;
this.data = data;
getDeptTree().then(res => {
const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId");
this.option.column[index].dicData = data;
});
});
});
}
}
}
};
};
</script>
<style>

View File

@ -19,7 +19,8 @@
icon="el-icon-delete"
v-if="permission.dict_delete"
plain
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -34,173 +35,174 @@
</template>
<script>
import {
getList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dict";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "字典名称",
prop: "dictValue",
search: true
},
{
label: "字典编号",
prop: "code",
search: true
},
{
label: "上级字典",
prop: "parentId",
type: "tree",
dicData: [],
hide: true,
props: {
label: "title"
}
},
{
label: "字典键值",
prop: "dictKey"
},
{
label: "排序",
prop: "sort"
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {
getList,
remove,
update,
add,
getDict,
getDictTree
} from "@/api/system/dict";
import {mapGetters} from "vuex";
export default {
data() {
return {
addBtn: this.permission.dict_add,
viewBtn: this.permission.dict_view,
delBtn: this.permission.dict_delete,
editBtn: this.permission.dict_edit
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "字典名称",
prop: "dictValue",
search: true
},
{
label: "字典编号",
prop: "code",
search: true
},
{
label: "上级字典",
prop: "parentId",
type: "tree",
dicData: [],
hide: true,
props: {
label: "title"
}
},
{
label: "字典键值",
prop: "dictKey"
},
{
label: "排序",
prop: "sort"
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.dict_add,
viewBtn: this.permission.dict_view,
delBtn: this.permission.dict_delete,
editBtn: this.permission.dict_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
return ids.join(",");
}
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDict(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
getDictTree().then(res => {
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getDict(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId");
this.option.column[index].dicData = data;
this.data = data;
getDictTree().then(res => {
const data = res.data.data;
const index = this.$refs.crud.findColumnIndex("parentId");
this.option.column[index].dicData = data;
});
});
});
}
}
}
};
};
</script>
<style>

View File

@ -19,7 +19,8 @@
icon="el-icon-delete"
v-if="permission.menu_delete"
plain
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -34,213 +35,214 @@
</template>
<script>
import { getList, remove, update, add, getMenu } from "@/api/system/menu";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
dialogWidth: "70%",
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "菜单名称",
prop: "name",
search: true
},
{
label: "菜单编号",
prop: "code",
search: true
},
{
label: "菜单别名",
prop: "alias"
},
{
label: "路由地址",
prop: "path"
},
import {getList, remove, update, add, getMenu} from "@/api/system/menu";
import {mapGetters} from "vuex";
{
label: "上级菜单",
prop: "parentId",
type: "tree",
dicUrl: "/api/blade-system/menu/tree",
hide: true,
props: {
label: "title"
}
},
{
label: "菜单类型",
prop: "category",
type: "radio",
dicData: [
{
label: "菜单",
value: 1
},
{
label: "按钮",
value: 2
}
],
hide: true
},
{
label: "排序",
prop: "sort"
},
{
label: "按钮功能",
prop: "action",
type: "radio",
dicData: [
{
label: "工具栏",
value: 0
},
{
label: "操作栏",
value: 1
},
{
label: "工具操作栏",
value: 2
}
],
hide: true
},
{
label: "菜单备注",
prop: "remark",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
export default {
data() {
return {
addBtn: this.permission.menu_add,
viewBtn: this.permission.menu_view,
delBtn: this.permission.menu_delete,
editBtn: this.permission.menu_edit
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
dialogWidth: "70%",
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "菜单名称",
prop: "name",
search: true
},
{
label: "菜单编号",
prop: "code",
search: true
},
{
label: "菜单别名",
prop: "alias"
},
{
label: "路由地址",
prop: "path"
},
{
label: "上级菜单",
prop: "parentId",
type: "tree",
dicUrl: "/api/blade-system/menu/tree",
hide: true,
props: {
label: "title"
}
},
{
label: "菜单类型",
prop: "category",
type: "radio",
dicData: [
{
label: "菜单",
value: 1
},
{
label: "按钮",
value: 2
}
],
hide: true
},
{
label: "排序",
prop: "sort"
},
{
label: "按钮功能",
prop: "action",
type: "radio",
dicData: [
{
label: "工具栏",
value: 0
},
{
label: "操作栏",
value: 1
},
{
label: "工具操作栏",
value: 2
}
],
hide: true
},
{
label: "菜单备注",
prop: "remark",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.menu_add,
viewBtn: this.permission.menu_view,
delBtn: this.permission.menu_delete,
editBtn: this.permission.menu_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
return ids.join(",");
}
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getMenu(this.form.id).then(res => {
this.form = res.data.data;
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getMenu(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});
}
}
};
};
</script>
<style>

View File

@ -18,7 +18,8 @@
size="small"
icon="el-icon-delete"
plain
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -33,138 +34,139 @@
</template>
<script>
import { getList, remove, update, add } from "@/api/system/param";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "参数名称",
prop: "paramName",
search: true
},
{
label: "参数键名",
prop: "paramKey",
search: true
},
{
label: "参数键值",
prop: "paramValue"
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {getList, remove, update, add} from "@/api/system/param";
import {mapGetters} from "vuex";
export default {
data() {
return {
addBtn: this.permission.param_add,
viewBtn: this.permission.param_view,
delBtn: this.permission.param_delete,
editBtn: this.permission.param_edit
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "参数名称",
prop: "paramName",
search: true
},
{
label: "参数键名",
prop: "paramKey",
search: true
},
{
label: "参数键值",
prop: "paramValue"
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.param_add,
viewBtn: this.permission.param_view,
delBtn: this.permission.param_delete,
editBtn: this.permission.param_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
return ids.join(",");
}
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
}
};
};
</script>
<style>

View File

@ -17,11 +17,13 @@
size="small"
icon="el-icon-delete"
plain
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
<el-button size="small"
icon="el-icon-delete"
@click="handleRole"
plain>权限设置</el-button>
plain>权限设置
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -54,181 +56,182 @@
</template>
<script>
import {
getList,
remove,
update,
add,
grant,
getTree,
getRole
} from "@/api/system/role";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
box: false,
props: {
label: "title",
valie: "key"
},
list: [],
defaultObj: [],
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "角色名称",
prop: "roleName",
search: true
},
{
label: "角色别名",
prop: "roleAlias",
search: true
},
{
label: "排序",
prop: "sort"
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {
getList,
remove,
update,
add,
grant,
getTree,
getRole
} from "@/api/system/role";
import {mapGetters} from "vuex";
export default {
data() {
return {
addBtn: this.permission.role_add,
viewBtn: this.permission.role_view,
delBtn: this.permission.role_delete,
editBtn: this.permission.role_edit
form: {},
box: false,
props: {
label: "title",
valie: "key"
},
list: [],
defaultObj: [],
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
tree: true,
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "角色名称",
prop: "roleName",
search: true
},
{
label: "角色别名",
prop: "roleAlias",
search: true
},
{
label: "排序",
prop: "sort"
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
submit() {
const menuLIst = this.$refs.tree.getCheckedKeys().join(",");
grant(this.ids[0], menuLIst).then(() => {
this.box = false;
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.role_add,
viewBtn: this.permission.role_view,
delBtn: this.permission.role_delete,
editBtn: this.permission.role_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
this.onLoad(this.page);
});
return ids.join(",");
}
},
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
methods: {
submit() {
const menuLIst = this.$refs.tree.getCheckedKeys().join(",");
grant(this.ids[0], menuLIst).then(() => {
this.box = false;
this.$message({
type: "success",
message: "操作成功!"
});
this.onLoad(this.page);
});
});
},
rowUpdate(row, index, loading) {
update(row).then(() => {
this.onLoad(this.page);
loading();
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
},
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
},
rowUpdate(row, index, loading) {
update(row).then(() => {
this.onLoad(this.page);
loading();
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleRole() {
if (this.selectionList.length !== 1) {
this.$message.warning("请选择至少一条数据");
return;
}
getTree()
.then(res => {
this.list = res.data.data;
return getRole(this.ids[0]);
})
.then(res => {
this.defaultObj = res.data.data;
this.box = true;
});
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleRole() {
if (this.selectionList.length !== 1) {
this.$message.warning("请选择至少一条数据");
return;
}
getTree()
.then(res => {
this.list = res.data.data;
return getRole(this.ids[0]);
})
.then(res => {
this.defaultObj = res.data.data;
this.box = true;
});
this.$refs.crud.toggleSelection();
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});
}
}
}
};
};
</script>
<style>

View File

@ -20,13 +20,15 @@
icon="el-icon-delete"
plain
v-if="permission.user_delete"
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
<el-button type="primary"
size="small"
plain
v-if="permission. user_reset"
icon="el-icon-refresh"
@click="handleReset">密码重置</el-button>
@click="handleReset">密码重置
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -41,224 +43,225 @@
</template>
<script>
import {
getList,
getUser,
remove,
update,
add,
resetPassword
} from "@/api/system/user";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "登录账号",
prop: "account",
search: true
},
{
label: "用户昵称",
prop: "name",
search: true
},
{
label: "用户姓名",
prop: "realName"
},
{
label: "所属角色",
prop: "roleId",
multiple: true,
type: "tree",
dicUrl: "/api/blade-system/role/tree",
props: {
label: "title"
},
slot: true
},
{
label: "所属部门",
prop: "deptId",
type: "tree",
multiple: true,
dicUrl: "/api/blade-system/dept/tree",
props: {
label: "title"
},
slot: true
},
{
label: "手机号码",
prop: "phone",
overHidden: true
},
{
label: "电子邮箱",
prop: "email",
overHidden: true
},
{
label: "账号状态",
prop: "statusName",
display: false
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {
getList,
getUser,
remove,
update,
add,
resetPassword
} from "@/api/system/user";
import {mapGetters} from "vuex";
export default {
data() {
return {
addBtn: this.permission.user_add,
viewBtn: this.permission.user_view,
delBtn: this.permission.user_delete,
editBtn: this.permission.user_edit
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
selection: true,
viewBtn: true,
column: [
{
label: "登录账号",
prop: "account",
search: true
},
{
label: "用户昵称",
prop: "name",
search: true
},
{
label: "用户姓名",
prop: "realName"
},
{
label: "所属角色",
prop: "roleId",
multiple: true,
type: "tree",
dicUrl: "/api/blade-system/role/tree",
props: {
label: "title"
},
slot: true
},
{
label: "所属部门",
prop: "deptId",
type: "tree",
multiple: true,
dicUrl: "/api/blade-system/dept/tree",
props: {
label: "title"
},
slot: true
},
{
label: "手机号码",
prop: "phone",
overHidden: true
},
{
label: "电子邮箱",
prop: "email",
overHidden: true
},
{
label: "账号状态",
prop: "statusName",
display: false
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
row.deptId = row.deptId.join(",");
row.roleId = row.roleId.join(",");
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.user_add,
viewBtn: this.permission.user_view,
delBtn: this.permission.user_delete,
editBtn: this.permission.user_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
return ids.join(",");
}
},
rowUpdate(row, index, loading) {
row.deptId = row.deptId.join(",");
row.roleId = row.roleId.join(",");
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
methods: {
rowSave(row, loading) {
row.deptId = row.deptId.join(",");
row.roleId = row.roleId.join(",");
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
},
rowUpdate(row, index, loading) {
row.deptId = row.deptId.join(",");
row.roleId = row.roleId.join(",");
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
handleReset() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号密码重置为123456?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return resetPassword(this.ids);
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!"
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getUser(this.form.id).then(res => {
this.form = res.data.data;
this.form.deptId = this.form.deptId.split(",");
this.form.deptId.forEach((ele, index) => {
this.form.deptId[index] = Number(ele);
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
this.form.roleId = this.form.roleId.split(",");
this.form.roleId.forEach((ele, index) => {
this.form.roleId[index] = Number(ele);
},
handleReset() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号密码重置为123456?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return resetPassword(this.ids);
})
.then(() => {
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getUser(this.form.id).then(res => {
this.form = res.data.data;
this.form.deptId = this.form.deptId.split(",");
this.form.deptId.forEach((ele, index) => {
this.form.deptId[index] = Number(ele);
});
this.form.roleId = this.form.roleId.split(",");
this.form.roleId.forEach((ele, index) => {
this.form.roleId[index] = Number(ele);
});
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
};
};
</script>
<style>

View File

@ -1,9 +1,9 @@
<template>
<basic-container>测试页 </basic-container>
<basic-container>测试页</basic-container>
</template>
<script>
export default {};
export default {};
</script>
<style>

View File

@ -19,12 +19,14 @@
size="small"
icon="el-icon-delete"
plain
@click="handleDelete"> </el-button>
@click="handleDelete">
</el-button>
<el-button type="primary"
size="small"
plain
icon="el-icon-refresh"
@click="handleBuild">代码生成</el-button>
@click="handleBuild">代码生成
</el-button>
</template>
<template slot-scope="{row}"
slot="roleId">
@ -39,198 +41,199 @@
</template>
<script>
import { getList, getCode, build, remove, add, update } from "@/api/tool/code";
import { mapGetters } from "vuex";
export default {
data() {
return {
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
selection: true,
labelWidth: 120,
viewBtn: true,
column: [
{
label: "模块名",
prop: "codeName",
search: true
},
{
label: "服务名",
prop: "serviceName",
search: true
},
{
label: "表名",
prop: "tableName"
},
{
label: "表前缀",
prop: "tablePrefix"
},
{
label: "主键名",
prop: "pkName"
},
{
label: "包名",
prop: "packageName",
overHidden: true
},
{
label: "后端生成路径",
prop: "apiPath",
span: 24,
hide: true
},
{
label: "前端生成路径",
prop: "webPath",
span: 24,
hide: true
}
]
},
data: []
};
},
computed: {
...mapGetters(["permission"]),
permissionList() {
import {getList, getCode, build, remove, add, update} from "@/api/tool/code";
import {mapGetters} from "vuex";
export default {
data() {
return {
addBtn: this.permission.code_add,
viewBtn: this.permission.code_view,
delBtn: this.permission.code_delete,
editBtn: this.permission.code_edit
form: {},
selectionList: [],
page: {
pageSize: 10,
currentPage: 1,
total: 0
},
option: {
border: true,
index: true,
selection: true,
labelWidth: 120,
viewBtn: true,
column: [
{
label: "模块名",
prop: "codeName",
search: true
},
{
label: "服务名",
prop: "serviceName",
search: true
},
{
label: "表名",
prop: "tableName"
},
{
label: "表前缀",
prop: "tablePrefix"
},
{
label: "主键名",
prop: "pkName"
},
{
label: "包名",
prop: "packageName",
overHidden: true
},
{
label: "后端生成路径",
prop: "apiPath",
span: 24,
hide: true
},
{
label: "前端生成路径",
prop: "webPath",
span: 24,
hide: true
}
]
},
data: []
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
return ids.join(",");
}
},
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
computed: {
...mapGetters(["permission"]),
permissionList() {
return {
addBtn: this.permission.code_add,
viewBtn: this.permission.code_view,
delBtn: this.permission.code_delete,
editBtn: this.permission.code_edit
};
},
ids() {
let ids = [];
this.selectionList.forEach(ele => {
ids.push(ele.id);
});
});
return ids.join(",");
}
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
methods: {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
},
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
rowDel(row) {
this.$confirm("确定将选删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return remove(this.ids);
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("确定将选择账号删除?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
.then(() => {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
this.$refs.crud.toggleSelection();
});
},
handleBuild() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("是否生成选中模块的代码?", {
title: "代码生成确认",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return build(this.ids);
},
handleBuild() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.$confirm("是否生成选中模块的代码?", {
title: "代码生成确认",
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
.then(() => {
return build(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
this.$refs.crud.toggleSelection();
});
this.$refs.crud.toggleSelection();
});
},
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getCode(this.form.id).then(res => {
this.form = res.data.data;
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getCode(this.form.id).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
done();
},
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;
});
}
}
};
};
</script>
<style>

View File

@ -10,47 +10,48 @@
</template>
<script>
import option from "@/const/user/info";
export default {
data() {
return {
type: "info",
option: option,
form: {}
};
},
created() {
this.handleWitch();
},
methods: {
handleSubmit() {
this.$message({
message: this.form,
type: "success"
});
import option from "@/const/user/info";
export default {
data() {
return {
type: "info",
option: option,
form: {}
};
},
handleWitch() {
if (this.type === "info") {
this.form = {
username: "smallwei",
name: "smallwei",
phone: "1888888888888",
detail: "这是一个个性签名"
};
} else if (this.type === "password") {
this.form = {
oldpassword: 11111111,
newpassword: 22222222,
newpasswords: 22222222
};
}
},
handleChange(item) {
this.type = item.prop;
created() {
this.handleWitch();
},
methods: {
handleSubmit() {
this.$message({
message: this.form,
type: "success"
});
},
handleWitch() {
if (this.type === "info") {
this.form = {
username: "smallwei",
name: "smallwei",
phone: "1888888888888",
detail: "这是一个个性签名"
};
} else if (this.type === "password") {
this.form = {
oldpassword: 11111111,
newpassword: 22222222,
newpasswords: 22222222
};
}
},
handleChange(item) {
this.type = item.prop;
this.handleWitch();
}
}
}
};
};
</script>
<style>

View File

@ -6,194 +6,194 @@
</template>
<script>
export default {
data() {
return {
option: {
span: 8,
data: [
{
title: "后台模版",
src: "/img/bg/vip1.png",
money: "299",
dismoney: "199",
tip: "/永久",
color: "#808695",
subtext: "购买",
click: () => {
this.box = true;
export default {
data() {
return {
option: {
span: 8,
data: [
{
title: "后台模版",
src: "/img/bg/vip1.png",
money: "299",
dismoney: "199",
tip: "/永久",
color: "#808695",
subtext: "购买",
click: () => {
this.box = true;
},
list: [
{
title: "点击体验",
href: "https://cli1.avue.top",
check: true
},
{
title: "面向全屏幕尺寸的响应式适配能力",
check: true
},
{
title: "支持IE9+等系列浏览器",
check: true
},
{
title: "全新的前端错误日志监控机制",
check: true
},
{
title: "基于最新的avuex底层开发",
check: true
},
{
title: "前端路由动态服务端加载",
check: true
},
{
title: "灵活的多款主题自由配置",
check: true
},
{
title: "模块的可拆卸化,达到开箱即用",
check: true
},
{
title: "免费的私人git私服"
},
{
title: "专属会员群"
},
{
title: "前端最新干货分享"
},
{
title: "赠送 Avue-cli脚手架文档价值¥59.99",
href: "https://www.kancloud.cn/smallwei/avue"
},
{
title: "赠送 Avue 修仙系列视频教程",
href: "https://www.bilibili.com/video/av24644922",
check: true
}
]
},
list: [
{
title: "点击体验",
href: "https://cli1.avue.top",
check: true
{
title: "Avuex源码",
src: "/img/bg/vip2.png",
color: "#ffa820",
money: "999",
dismoney: "399",
tip: "/永久",
subtext: "购买",
click: () => {
this.box = true;
},
{
title: "面向全屏幕尺寸的响应式适配能力",
check: true
},
{
title: "支持IE9+等系列浏览器",
check: true
},
{
title: "全新的前端错误日志监控机制",
check: true
},
{
title: "基于最新的avuex底层开发",
check: true
},
{
title: "前端路由动态服务端加载",
check: true
},
{
title: "灵活的多款主题自由配置",
check: true
},
{
title: "模块的可拆卸化,达到开箱即用",
check: true
},
{
title: "免费的私人git私服"
},
{
title: "专属会员群"
},
{
title: "前端最新干货分享"
},
{
title: "赠送 Avue-cli脚手架文档价值¥59.99",
href: "https://www.kancloud.cn/smallwei/avue"
},
{
title: "赠送 Avue 修仙系列视频教程",
href: "https://www.bilibili.com/video/av24644922",
check: true
}
]
},
{
title: "Avuex源码",
src: "/img/bg/vip2.png",
color: "#ffa820",
money: "999",
dismoney: "399",
tip: "/永久",
subtext: "购买",
click: () => {
this.box = true;
list: [
{
title: "一键集成表格的导出excel,打印,等功能",
check: true
},
{
title: "底层代码可重用轻松对接多个UI框架",
check: true
},
{
title: "底层更加完善的开发错误调试机制",
check: true
},
{
title: "一套代码多个终端自适应",
check: true
},
{
title: "一键集成表格的导出excel打印等常用功能",
check: true
},
{
title: "表格的批量操作,表单的级联操作更加便捷",
check: true
},
{
title: "新增大量常用组件(搜索,选项卡)",
check: true
},
{
title: "新增大量全新可配置的骚属性",
check: true
},
{
title: "丰富的数据展示模版组件包",
check: true
},
{
title: "专属的开发者文档,助你快速掌握",
check: true
},
{
title: "赠送 Avue-cli脚手架文档价值¥59.99",
href: "https://www.kancloud.cn/smallwei/avue",
check: true
},
{
title: "赠送 Avue 修仙系列视频教程",
href: "https://www.bilibili.com/video/av24644922",
check: true
}
]
},
list: [
{
title: "一键集成表格的导出excel,打印,等功能",
check: true
{
title: "全家桶",
src: "/img/bg/vip3.png",
color: "#ef4868",
money: "999.99",
dismoney: "399.99",
tip: "/永久",
subtext: "购买",
click: () => {
this.box = true;
},
{
title: "底层代码可重用轻松对接多个UI框架",
check: true
},
{
title: "底层更加完善的开发错误调试机制",
check: true
},
{
title: "一套代码多个终端自适应",
check: true
},
{
title: "一键集成表格的导出excel打印等常用功能",
check: true
},
{
title: "表格的批量操作,表单的级联操作更加便捷",
check: true
},
{
title: "新增大量常用组件(搜索,选项卡)",
check: true
},
{
title: "新增大量全新可配置的骚属性",
check: true
},
{
title: "丰富的数据展示模版组件包",
check: true
},
{
title: "专属的开发者文档,助你快速掌握",
check: true
},
{
title: "赠送 Avue-cli脚手架文档价值¥59.99",
href: "https://www.kancloud.cn/smallwei/avue",
check: true
},
{
title: "赠送 Avue 修仙系列视频教程",
href: "https://www.bilibili.com/video/av24644922",
check: true
}
]
},
{
title: "全家桶",
src: "/img/bg/vip3.png",
color: "#ef4868",
money: "999.99",
dismoney: "399.99",
tip: "/永久",
subtext: "购买",
click: () => {
this.box = true;
},
list: [
{
title: "授权商业化开发,永久更新授权使用",
check: true
},
{
title: "后期更新和新产品将全部免费",
check: true
},
{
title: "拥有avuex系列的全部特权和全部源码",
check: true
},
{
title: "免费的私人git私服",
check: true
},
{
title: "专属会员群",
check: true
},
{
title: "前端最新干货分享",
check: true
},
{
title: "赠送 Avue-cli脚手架文档价值¥59.99",
href: "https://www.kancloud.cn/smallwei/avue",
check: true
},
{
title: "赠送 Avue 修仙系列视频教程",
href: "https://www.bilibili.com/video/av24644922",
check: true
}
]
}
]
}
};
}
};
list: [
{
title: "授权商业化开发,永久更新授权使用",
check: true
},
{
title: "后期更新和新产品将全部免费",
check: true
},
{
title: "拥有avuex系列的全部特权和全部源码",
check: true
},
{
title: "免费的私人git私服",
check: true
},
{
title: "专属会员群",
check: true
},
{
title: "前端最新干货分享",
check: true
},
{
title: "赠送 Avue-cli脚手架文档价值¥59.99",
href: "https://www.kancloud.cn/smallwei/avue",
check: true
},
{
title: "赠送 Avue 修仙系列视频教程",
href: "https://www.bilibili.com/video/av24644922",
check: true
}
]
}
]
}
};
}
};
</script>
<style>
</style>

View File

@ -7,48 +7,48 @@
</template>
<script>
export default {
data() {
return {
form: {},
option: {
labelWidth: 110,
column: [
{
label: "用户名",
prop: "username",
row: true
},
{
label: "密码",
prop: "password",
type: "password",
row: true
},
{
label: "再次输入密码",
prop: "password",
type: "newpassword",
row: true
},
{
label: "申请日期",
prop: "date",
type: "date",
row: true
},
{
label: "个性签名",
prop: "textarea",
type: "textarea",
minRows: 8,
row: true
}
]
}
};
}
};
export default {
data() {
return {
form: {},
option: {
labelWidth: 110,
column: [
{
label: "用户名",
prop: "username",
row: true
},
{
label: "密码",
prop: "password",
type: "password",
row: true
},
{
label: "再次输入密码",
prop: "password",
type: "newpassword",
row: true
},
{
label: "申请日期",
prop: "date",
type: "date",
row: true
},
{
label: "个性签名",
prop: "textarea",
type: "textarea",
minRows: 8,
row: true
}
]
}
};
}
};
</script>
<style>

View File

@ -3,16 +3,17 @@
<h3>请打开浏览器控制台然后点击下面的按钮</h3>
<el-button type="danger"
size="small"
@click="handleNewError">触发一个错误</el-button>
@click="handleNewError">触发一个错误
</el-button>
</basic-container>
</template>
<script>
export default {
methods: {
handleNewError() {
console.log(a); // eslint-disable-line
export default {
methods: {
handleNewError() {
console.log(a); // eslint-disable-line
}
}
}
};
</script>
};
</script>

View File

@ -14,66 +14,69 @@
</avue-crud>
</basic-container>
<basic-container>
权限开关<el-switch :active-value="false"
权限开关
<el-switch :active-value="false"
:inactive-value="true"
v-model="text"
active-color="#13ce66"
inactive-color="#ff4949">
</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>
</div>
</template>
<script>
export default {
data() {
return {
text: false,
permission: {},
option: {
expand: true,
column: [
export default {
data() {
return {
text: false,
permission: {},
option: {
expand: true,
column: [
{
label: "姓名",
prop: "name"
},
{
label: "年龄",
prop: "sex"
}
]
},
data: [
{
label: "姓名",
prop: "name"
id: 1,
name: "张三",
sex: 12
},
{
label: "年龄",
prop: "sex"
id: 2,
name: "李四",
sex: 20
}
]
},
data: [
{
id: 1,
name: "张三",
sex: 12
},
{
id: 2,
name: "李四",
sex: 20
};
},
watch: {
text() {
if (this.text === true) {
this.permission = {
delBtn: false,
addBtn: false
};
} else {
this.permission = {
delBtn: true,
addBtn: true
};
}
]
};
},
watch: {
text() {
if (this.text === true) {
this.permission = {
delBtn: false,
addBtn: false
};
} else {
this.permission = {
delBtn: true,
addBtn: true
};
}
}
}
};
};
</script>
<style>

View File

@ -2,106 +2,121 @@
<basic-container>
<h3>存储</h3>
<el-tag class="title"
size="small">基本读写删(持久化存储)</el-tag>
size="small">基本读写删(持久化存储)
</el-tag>
<div class="box">
<el-button type="primary"
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"
size="small"
@click="getItem({name:'username'});">get('username')</el-button>
@click="getItem({name:'username'});">get('username')
</el-button>
<el-button type="danger"
size="small"
@click="delItem({name:'username'});">remove('username')</el-button>
@click="delItem({name:'username'});">remove('username')
</el-button>
</div>
<el-tag class="title"
size="small">设置session(session存储)</el-tag>
size="small">设置session(session存储)
</el-tag>
<div class="box">
<el-button type="primary"
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"
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"
size="small"
@click="delItem({name:'username',type:'session'});">remove('username')</el-button>
@click="delItem({name:'username',type:'session'});">remove('username')
</el-button>
</div>
<el-tag class="title"
size="small">获取所有可以获得的数据</el-tag>
size="small">获取所有可以获得的数据
</el-tag>
<div class="box">
<el-button type="success"
size="small"
@click="getAll()">getAll(持久化存储)</el-button>
@click="getAll()">getAll(持久化存储)
</el-button>
<el-button type="success"
size="small"
@click="getAll({type:'session'})">getAll(session存储)</el-button>
@click="getAll({type:'session'})">getAll(session存储)
</el-button>
<el-button type="danger"
size="small"
@click="clearAll()">delAll(持久化存储)</el-button>
@click="clearAll()">delAll(持久化存储)
</el-button>
<el-button type="danger"
size="small"
@click="clearAll({type:'session'})">delAll(session存储)</el-button>
@click="clearAll({type:'session'})">delAll(session存储)
</el-button>
</div>
</basic-container>
</template>
<script>
import {
setStore,
getStore,
removeStore,
clearStore,
getAllStore
} from "@/util/store";
export default {
name: "store",
methods: {
setItem(params = {}) {
const { name, value, type } = params;
setStore({
name: name,
content: value,
type: type
});
this.$message(`设置数据 ${name} = ${value}`);
},
getItem(params = {}) {
const { name, type } = params;
const content = getStore({
name: name,
type: type
});
this.$message(`获取数据 ${name} = ${content}`);
},
delItem(params = {}) {
const { name, type } = params;
removeStore({ name, type });
this.$message(`删除数据 ${name}`);
},
clearAll(params = {}) {
clearStore(params);
this.$message(`清除全部数据完成`);
},
getAll(params = {}) {
const list = getAllStore(params);
console.log(list);
this.$message(`结果已经打印到控制台`);
import {
setStore,
getStore,
removeStore,
clearStore,
getAllStore
} from "@/util/store";
export default {
name: "store",
methods: {
setItem(params = {}) {
const {name, value, type} = params;
setStore({
name: name,
content: value,
type: type
});
this.$message(`设置数据 ${name} = ${value}`);
},
getItem(params = {}) {
const {name, type} = params;
const content = getStore({
name: name,
type: type
});
this.$message(`获取数据 ${name} = ${content}`);
},
delItem(params = {}) {
const {name, type} = params;
removeStore({name, type});
this.$message(`删除数据 ${name}`);
},
clearAll(params = {}) {
clearStore(params);
this.$message(`清除全部数据完成`);
},
getAll(params = {}) {
const list = getAllStore(params);
console.log(list);
this.$message(`结果已经打印到控制台`);
}
}
}
};
};
</script>
<style lang="scss">
.title {
margin-bottom: 10px;
}
.box {
margin-bottom: 20px;
}
.title {
margin-bottom: 10px;
}
.box {
margin-bottom: 20px;
}
</style>

View File

@ -8,121 +8,121 @@
</template>
<script>
export default {
data() {
return {
page: {
total: 122
},
data: [
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
export default {
data() {
return {
page: {
total: 122
},
data: [
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
}
],
option: {
column: [
{
label: "用户名",
prop: "username",
span: 14,
row: true
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
label: "姓名",
prop: "name",
span: 14,
row: true
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
label: "密码",
prop: "password",
type: "password",
span: 14,
row: true
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
label: "确认密码",
prop: "newpassword",
type: "password",
hide: true,
span: 14,
row: true
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
},
{
label: "申请日期",
prop: "date",
type: "date",
span: 14,
row: true
},
{
label: "个性签名",
prop: "textarea",
type: "textarea",
minRows: 8,
span: 24,
overHidden: true,
row: true
username: "smallwei",
name: "avue",
password: "123456",
newpassword: "123456",
date: "2019-01-01",
textarea: "这是一条很长很长很长很长很长很长很长很长的个性签名"
}
]
}
};
}
};
],
option: {
column: [
{
label: "用户名",
prop: "username",
span: 14,
row: true
},
{
label: "姓名",
prop: "name",
span: 14,
row: true
},
{
label: "密码",
prop: "password",
type: "password",
span: 14,
row: true
},
{
label: "确认密码",
prop: "newpassword",
type: "password",
hide: true,
span: 14,
row: true
},
{
label: "申请日期",
prop: "date",
type: "date",
span: 14,
row: true
},
{
label: "个性签名",
prop: "textarea",
type: "textarea",
minRows: 8,
span: 24,
overHidden: true,
row: true
}
]
}
};
}
};
</script>
<style>

View File

@ -3,22 +3,25 @@
<h3>标签</h3>
<el-button type="primary"
size="small"
@click="$router.push('/test/index')">打开一个页面</el-button>
@click="$router.push('/test/index')">打开一个页面
</el-button>
<el-button type="primary"
size="small"
@click="$router.$avueRouter.closeTag('/test/index')">关闭打开的页面</el-button>
@click="$router.$avueRouter.closeTag('/test/index')">关闭打开的页面
</el-button>
<el-button type="primary"
size="small"
@click="$router.$avueRouter.closeTag()">关闭本标签</el-button>
@click="$router.$avueRouter.closeTag()">关闭本标签
</el-button>
</basic-container>
</template>
<script>
export default {
methods: {}
};
export default {
methods: {}
};
</script>
<style>
</style>
</style>

View File

@ -5,15 +5,16 @@
</template>
<script>
export default {
name: "wel",
data() {
return {};
},
computed: {},
created() {},
methods: {}
};
export default {
name: "wel",
data() {
return {};
},
computed: {},
created() {
},
methods: {}
};
</script>
<style scoped="scoped" lang="scss">

View File

@ -69,280 +69,294 @@
</template>
<script>
import { mapGetters } from "vuex";
export default {
name: "wel",
data() {
return {
data: [
{
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
},
{
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
},
{
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
},
{
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
}
]
};
},
computed: {
...mapGetters(["userInfo"]),
option1() {
import {mapGetters} from "vuex";
export default {
name: "wel",
data() {
return {
span: 6,
data: [
{
title: this.$t("wel.data4.column1"),
count: 12332,
icon: "el-icon-warning",
color: "rgb(49, 180, 141)",
href: "https://avue.top",
target: "_blank"
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
},
{
title: this.$t("wel.data4.column2"),
count: 33,
icon: "el-icon-view",
color: "rgb(56, 161, 242)",
href: "https://avue.top",
target: "_blank"
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
},
{
title: this.$t("wel.data4.column3"),
count: 2223,
icon: "el-icon-setting",
color: "rgb(117, 56, 199)",
href: "https://avue.top",
target: "_blank"
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
},
{
title: this.$t("wel.data4.column4"),
count: 2223,
icon: "el-icon-setting",
color: "rgb(230, 71, 88)",
href: "https://avue.top",
target: "_blank"
rw: "这是一条工作任务",
nr: "这是一条很长很长很长很长很长很长很长很长很长的工作内容",
sj: "2019-01-01"
}
]
};
},
option3() {
return {
span: 8,
data: [
{
title: this.$t("wel.data3.column1"),
color: "rgb(178, 159, 255)",
count: 32,
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data3.column2"),
color: "rgb(230, 71, 88)",
count: 32,
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data3.column3"),
color: "rgb(230, 71, 88)",
count: 32,
href: "https://avue.top",
target: "_blank"
}
]
};
computed: {
...mapGetters(["userInfo"]),
option1() {
return {
span: 6,
data: [
{
title: this.$t("wel.data4.column1"),
count: 12332,
icon: "el-icon-warning",
color: "rgb(49, 180, 141)",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data4.column2"),
count: 33,
icon: "el-icon-view",
color: "rgb(56, 161, 242)",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data4.column3"),
count: 2223,
icon: "el-icon-setting",
color: "rgb(117, 56, 199)",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data4.column4"),
count: 2223,
icon: "el-icon-setting",
color: "rgb(230, 71, 88)",
href: "https://avue.top",
target: "_blank"
}
]
};
},
option3() {
return {
span: 8,
data: [
{
title: this.$t("wel.data3.column1"),
color: "rgb(178, 159, 255)",
count: 32,
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data3.column2"),
color: "rgb(230, 71, 88)",
count: 32,
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data3.column3"),
color: "rgb(230, 71, 88)",
count: 32,
href: "https://avue.top",
target: "_blank"
}
]
};
},
option2() {
return {
span: 12,
data: [
{
title: this.$t("wel.data2.column1"),
count: 12678,
icon: "el-icon-tickets",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data2.column2"),
count: 22139,
icon: "el-icon-success",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data2.column3"),
count: 35623,
icon: "el-icon-info",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data2.column4"),
count: 16826,
icon: "el-icon-message",
href: "https://avue.top",
target: "_blank"
}
]
};
},
option() {
return {
span: 8,
data: [
{
title: this.$t("wel.data.column1"),
subtitle: this.$t("wel.data.subtitle"),
count: 7993,
allcount: 10222,
text: this.$t("wel.data.text1"),
color: "rgb(27, 201, 142)",
key: this.$t("wel.data.key1")
},
{
title: this.$t("wel.data.column2"),
subtitle: this.$t("wel.data.subtitle"),
count: 3112,
allcount: 10222,
text: this.$t("wel.data.text2"),
color: "rgb(230, 71, 88)",
key: this.$t("wel.data.key2")
},
{
title: this.$t("wel.data.column3"),
subtitle: this.$t("wel.data.subtitle"),
count: 908,
allcount: 10222,
text: this.$t("wel.data.text3"),
color: "rgb(56, 161, 242)",
key: this.$t("wel.data.key3")
}
]
};
},
option4() {
return {
index: true,
column: [
{
label: this.$t("wel.table.rw"),
prop: "rw"
},
{
width: 500,
label: this.$t("wel.table.nr"),
prop: "nr",
overHidden: true
},
{
label: this.$t("wel.table.sj"),
prop: "sj"
}
]
};
}
},
option2() {
return {
span: 12,
data: [
{
title: this.$t("wel.data2.column1"),
count: 12678,
icon: "el-icon-tickets",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data2.column2"),
count: 22139,
icon: "el-icon-success",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data2.column3"),
count: 35623,
icon: "el-icon-info",
href: "https://avue.top",
target: "_blank"
},
{
title: this.$t("wel.data2.column4"),
count: 16826,
icon: "el-icon-message",
href: "https://avue.top",
target: "_blank"
}
]
};
created() {
},
option() {
return {
span: 8,
data: [
{
title: this.$t("wel.data.column1"),
subtitle: this.$t("wel.data.subtitle"),
count: 7993,
allcount: 10222,
text: this.$t("wel.data.text1"),
color: "rgb(27, 201, 142)",
key: this.$t("wel.data.key1")
},
{
title: this.$t("wel.data.column2"),
subtitle: this.$t("wel.data.subtitle"),
count: 3112,
allcount: 10222,
text: this.$t("wel.data.text2"),
color: "rgb(230, 71, 88)",
key: this.$t("wel.data.key2")
},
{
title: this.$t("wel.data.column3"),
subtitle: this.$t("wel.data.subtitle"),
count: 908,
allcount: 10222,
text: this.$t("wel.data.text3"),
color: "rgb(56, 161, 242)",
key: this.$t("wel.data.key3")
}
]
};
},
option4() {
return {
index: true,
column: [
{
label: this.$t("wel.table.rw"),
prop: "rw"
},
{
width: 500,
label: this.$t("wel.table.nr"),
prop: "nr",
overHidden: true
},
{
label: this.$t("wel.table.sj"),
prop: "sj"
}
]
};
}
},
created() {},
methods: {}
};
methods: {}
};
</script>
<style scoped="scoped" lang="scss">
.wel {
&__header {
padding: 25px 40px;
border-bottom: 1px solid #e8e8e8;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
}
&__info {
display: flex;
align-items: center;
&-img {
border-radius: 72px;
display: block;
width: 72px;
height: 72px;
img {
width: 100%;
height: 100%;
.wel {
&__header {
padding: 25px 40px;
border-bottom: 1px solid #e8e8e8;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
}
&__info {
display: flex;
align-items: center;
&-img {
border-radius: 72px;
display: block;
}
}
&-content {
position: relative;
margin-left: 24px;
color: rgba(0, 0, 0, 0.45);
line-height: 22px;
}
&-title {
font-size: 20px;
line-height: 28px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
}
&-subtitle {
position: relative;
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 22px;
}
}
&__extra {
&-item {
position: relative;
padding: 0 32px;
display: inline-block;
&:last-child {
&::after {
display: none;
width: 72px;
height: 72px;
img {
width: 100%;
height: 100%;
display: block;
}
}
&:after {
background-color: #e8e8e8;
position: absolute;
top: 30px;
right: 0;
width: 1px;
height: 40px;
content: "";
&-content {
position: relative;
margin-left: 24px;
color: rgba(0, 0, 0, 0.45);
line-height: 22px;
}
&-title {
font-size: 20px;
line-height: 28px;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
}
&-subtitle {
position: relative;
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 22px;
}
}
&-title {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
line-height: 22px;
margin-bottom: 4px;
}
&-subtitle {
color: rgba(0, 0, 0, 0.85);
font-size: 30px;
line-height: 38px;
margin: 0;
span {
&__extra {
&-item {
position: relative;
padding: 0 32px;
display: inline-block;
&:last-child {
&::after {
display: none;
}
}
&:after {
background-color: #e8e8e8;
position: absolute;
top: 30px;
right: 0;
width: 1px;
height: 40px;
content: "";
}
}
&-title {
color: rgba(0, 0, 0, 0.45);
font-size: 20px;
font-size: 14px;
line-height: 22px;
margin-bottom: 4px;
}
&-subtitle {
color: rgba(0, 0, 0, 0.85);
font-size: 30px;
line-height: 38px;
margin: 0;
span {
color: rgba(0, 0, 0, 0.45);
font-size: 20px;
}
}
}
}
}
</style>