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", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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