search all page

This commit is contained in:
smallwei 2019-02-15 14:33:39 +08:00
parent d0cf933810
commit 01a42029f6
26 changed files with 253 additions and 75 deletions

View File

@ -1,5 +1,5 @@
{
"name": "avue-cli-sword",
"name": "saber-admin",
"version": "1.0.0",
"private": true,
"scripts": {

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ export default {
dangerouslyUseHTMLString: true,
message:
'<a target="_blank" href="https://www.kancloud.cn/smallwei/avue">点击查看</a>',
duration: 0,
duration: 3000,
type: "success"
});
},

View File

@ -1,21 +1,21 @@
import request from '@/router/axios';
export const getList = (current, size, dateRange, begin_date, end_date, ) => {
export const getList = (current, size, dateRange, begin_date, end_date, params) => {
return request({
url: 'api/blade-desk/notice/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size,
dateRange,
begin_date,
end_date,
}
})
})
}
export const remove = (ids) => {
return request({
url: 'api/blade-system/dept/remove',
url: 'api/blade-system/notice/remove',
method: 'post',
data: {
ids,
@ -41,3 +41,14 @@ export const update = (row) => {
data: row
})
}
export const getNotice = (id) => {
return request({
url: 'api/blade-desk/notice/detail',
method: 'get',
params: {
id
}
})
}

View File

@ -33,7 +33,7 @@ export const getErrorList = (current, size) => {
}
export const getLogs = (id) => {
export const getUsualLogs = (id) => {
return request({
url: 'api/blade-log/usual/detail',
method: 'get',
@ -42,3 +42,22 @@ export const getLogs = (id) => {
}
})
}
export const getApiLogs = (id) => {
return request({
url: 'api/blade-log/api/detail',
method: 'get',
params: {
id,
}
})
}
export const getErrorLogs = (id) => {
return request({
url: 'api/blade-log/error/detail',
method: 'get',
params: {
id,
}
})
}

View File

@ -1,13 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size) => {
export const getList = (current, size, params) => {
return request({
url: 'api/blade-system/dept/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size
}
})
})
}
export const remove = (ids) => {

View File

@ -1,13 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size) => {
export const getList = (current, size, params) => {
return request({
url: 'api/blade-system/dict/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size
}
})
})
}
export const remove = (ids) => {

View File

@ -1,13 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size) => {
export const getList = (current, size, params) => {
return request({
url: 'api/blade-system/menu/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size
}
})
})
}
export const remove = (ids) => {

View File

@ -1,13 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size) => {
export const getList = (current, size, params) => {
return request({
url: 'api/blade-system/param/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size
}
})
})
}
export const remove = (ids) => {

View File

@ -1,13 +1,13 @@
import request from '@/router/axios';
export const getList = (current, size) => {
export const getList = (current, size, params) => {
return request({
url: 'api/blade-system/role/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size
}
})
})
}
export const getTree = () => {

View File

@ -6,14 +6,14 @@ export const resetPassword = (userIds) => {
data: userIds
})
}
export const getList = (current, size) => {
export const getList = (current, size, params) => {
return request({
url: 'api/blade-user/list',
method: 'get',
params: {
params: Object.assign(params, {
current,
size
}
})
})
}
export const remove = (ids) => {

View File

@ -3,9 +3,9 @@
*/
export default {
title: "sword",
logo: "A",
key: 'avue',//配置主键,目前用于存储
indexTitle: 'avue-cli-sword By smallwei',
logo: "S",
key: 'sword',//配置主键,目前用于存储
indexTitle: 'Saber Admin',
lockPage: '/lock',
tokenTime: 6000,
//http的status默认放行不才用统一处理的,

View File

@ -1,5 +1,5 @@
export default {
title: 'Avuex is a framework',
title: 'Avue is a framework',
tip: 'tip',
logoutTip: 'Exit the system, do you want to continue?',
submitText: 'submit',

View File

@ -1,6 +1,6 @@
export default {
tip: '提示',
title: 'Avuex 通用管理 系统快速开发框架',
title: 'Avue 通用管理 系统快速开发框架',
logoutTip: '退出系统, 是否继续?',
submitText: '确定',
cancelText: '取消',

View File

@ -23,7 +23,7 @@ const common = {
showMenu: true,
showColor: true,
colorName: getStore({ name: 'colorName' }) || '#409EFF',
themeName: getStore({ name: 'themeName' }) || 'theme-white',
themeName: getStore({ name: 'themeName' }) || 'theme-default',
lockPasswd: getStore({ name: 'lockPasswd' }) || '',
website: website,
},

View File

@ -4,9 +4,13 @@
:data="data"
:page="page"
@row-del="rowDel"
@selection-change="selectionChange"
v-model="form"
@row-update="rowUpdate"
@row-save="rowSave"
:before-open="beforeOpen"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
<el-button type="danger"
@ -16,7 +20,7 @@
@click="handleDelete"> </el-button>
</template>
<template slot-scope="{row}"
slot="categoryId">
slot="category">
<el-tag>{{row.categoryName}}</el-tag>
</template>
</avue-crud>
@ -24,10 +28,11 @@
</template>
<script>
import { getList, remove, update, add } from "@/api/dept/notice";
import { getList, remove, update, add, getNotice } from "@/api/dept/notice";
export default {
data() {
return {
form: {},
page: {
pageSize: 10,
currentPage: 1,
@ -56,7 +61,7 @@ export default {
value: "dictKey"
},
slot: true,
prop: "categoryId",
prop: "category",
search: true
},
{
@ -91,6 +96,7 @@ export default {
rowSave(row, loading) {
add(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
@ -100,6 +106,7 @@ export default {
rowUpdate(row, index, loading) {
update(row).then(() => {
loading();
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
@ -107,13 +114,28 @@ export default {
});
},
rowDel(row) {
remove(row.id).then(() => {
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;
},
@ -131,6 +153,7 @@ export default {
return remove(this.ids);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
@ -138,8 +161,17 @@ export default {
this.$refs.crud.toggleSelection();
});
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
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;

View File

@ -6,6 +6,8 @@
v-model="form"
:before-open="beforeOpen"
:page="page"
@search-change="searchChange"
@search-reset="searchReset"
@on-load="onLoad">
<template slot-scope="{row}"
slot="roleId">
@ -20,7 +22,7 @@
</template>
<script>
import { getApiList, getLogs } from "@/api/logs";
import { getApiList, getApiLogs } from "@/api/logs";
export default {
data() {
return {
@ -85,13 +87,15 @@ export default {
prop: "params",
type: "textarea",
span: 24,
minRows: 6,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "logData",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
@ -100,16 +104,22 @@ export default {
};
},
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getLogs(this.form.id).then(res => {
getApiLogs(this.form.strId).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page) {
getApiList(page.currentPage, page.pageSize).then(res => {
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;

View File

@ -6,6 +6,8 @@
:before-open="beforeOpen"
v-model="form"
:page="page"
@search-change="searchChange"
@search-reset="searchReset"
@on-load="onLoad">
<template slot-scope="{row}"
slot="roleId">
@ -20,7 +22,7 @@
</template>
<script>
import { getErrorList, getLogs } from "@/api/logs";
import { getErrorList, getErrorLogs } from "@/api/logs";
export default {
data() {
return {
@ -85,13 +87,15 @@ export default {
prop: "params",
type: "textarea",
span: 24,
minRows: 6,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "logData",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
@ -100,16 +104,22 @@ export default {
};
},
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getLogs(this.form.id).then(res => {
getErrorLogs(this.form.strId).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page) {
getErrorList(page.currentPage, page.pageSize).then(res => {
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;

View File

@ -6,6 +6,8 @@
v-model="form"
:page="page"
:before-open="beforeOpen"
@search-change="searchChange"
@search-reset="searchReset"
@on-load="onLoad">
<template slot-scope="{row}"
slot="roleId">
@ -20,7 +22,7 @@
</template>
<script>
import { getUsualList, getLogs } from "@/api/logs";
import { getUsualList, getUsualLogs } from "@/api/logs";
export default {
data() {
return {
@ -85,13 +87,15 @@ export default {
prop: "params",
type: "textarea",
span: 24,
minRows: 6,
minRows: 2,
hide: true
},
{
label: "日志数据",
prop: "logData",
type: "textarea",
span: 24,
minRows: 6,
hide: true
}
]
@ -100,16 +104,22 @@ export default {
};
},
methods: {
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
beforeOpen(done, type) {
if (["edit", "view"].includes(type)) {
getLogs(this.form.id).then(res => {
getUsualLogs(this.form.strId).then(res => {
this.form = res.data.data;
});
}
done();
},
onLoad(page) {
getUsualList(page.currentPage, page.pageSize).then(res => {
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;

View File

@ -9,6 +9,8 @@
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -148,7 +150,12 @@ export default {
this.$refs.crud.toggleSelection();
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -160,8 +167,8 @@ export default {
}
done();
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});

View File

@ -9,6 +9,8 @@
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -129,6 +131,12 @@ export default {
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -162,8 +170,8 @@ export default {
}
done();
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});

View File

@ -9,6 +9,8 @@
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -43,6 +45,7 @@ export default {
total: 0
},
option: {
dialogWidth: "70%",
tree: true,
border: true,
index: true,
@ -86,11 +89,11 @@ export default {
dicData: [
{
label: "菜单",
value: "1"
value: 1
},
{
label: "按钮",
value: "2"
value: 2
}
],
hide: true
@ -98,6 +101,34 @@ export default {
{
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
}
]
},
@ -152,6 +183,12 @@ export default {
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -185,8 +222,8 @@ export default {
}
done();
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});

View File

@ -8,6 +8,8 @@
@row-del="rowDel"
@row-update="rowUpdate"
@row-save="rowSave"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -113,6 +115,12 @@ export default {
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -137,8 +145,8 @@ export default {
this.$refs.crud.toggleSelection();
});
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
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;

View File

@ -8,6 +8,8 @@
@row-update="rowUpdate"
@row-save="rowSave"
:page="page"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -158,6 +160,13 @@ export default {
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -198,8 +207,8 @@ export default {
this.$refs.crud.toggleSelection();
});
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
onLoad(page, params = {}) {
getList(page.currentPage, page.pageSize, params).then(res => {
const data = res.data.data;
this.data = data;
});

View File

@ -9,6 +9,8 @@
@row-save="rowSave"
:before-open="beforeOpen"
:page="page"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -163,6 +165,12 @@ export default {
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -217,8 +225,8 @@ export default {
}
done();
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
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;

View File

@ -9,6 +9,8 @@
@row-update="rowUpdate"
@row-save="rowSave"
:before-open="beforeOpen"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@on-load="onLoad">
<template slot="menuLeft">
@ -145,6 +147,13 @@ export default {
});
});
},
searchReset() {
this.onLoad(this.page);
},
searchChange(params) {
this.onLoad(this.page, params);
},
selectionChange(list) {
this.selectionList = list;
},
@ -202,8 +211,8 @@ export default {
}
done();
},
onLoad(page) {
getList(page.currentPage, page.pageSize).then(res => {
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;