页面效果调整

This commit is contained in:
曹前明 2022-07-18 01:19:44 +08:00
parent 759e87d621
commit 5d492ff497
27 changed files with 785 additions and 604 deletions

View File

@ -30,11 +30,11 @@
<% })%>
<el-table-column label="操作" fixed="right" align="right" width="140">
<template #default="scope">
<el-button type="text" size="small" @click="table_show(scope.row, scope.$index)">查看</el-button>
<el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
<el-button link size="small" @click="table_show(scope.row, scope.$index)">查看</el-button>
<el-button link size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>
</template>

View File

@ -10,5 +10,20 @@ export default {
return await http.get(this.url, data);
}
}
}
},
file_logs: {
list: {
url: `${config.API_URL}/monitor/log/`,
name: "文件日志",
req: async function(data){
return await http.get(this.url, data);
}
},
detail: {
name: "文件日志",
req: async function(name){
return await http.get(`${config.API_URL}/monitor/log/${name}/`);
}
}
},
}

View File

@ -332,7 +332,7 @@ export default {
},
runOnce: {
name: "执行一次",
req: async function(data,id){
req: async function(data, id){
return await http.post(`${config.API_URL}/system/ptask/${id}/run_once/`,data);
}
},

View File

@ -83,7 +83,7 @@
></el-button>
<el-button
v-if="!hideRefresh"
@click="reload(null)"
@click="reload"
icon="el-icon-refresh-right"
circle
style="margin-left: 15px"
@ -178,6 +178,7 @@ export default {
pageStr: { type: String, default: config.request.page },
pageSizeStr: { type: String, default: config.request.pageSize },
orderStr: { type: String, default: config.request.order },
isTree: { type: Boolean, default: false },
parseData: { type: Function, default: config.parseData },
rowKey: { type: String, default: "" },
summaryMethod: { type: Function, default: null },
@ -198,7 +199,7 @@ export default {
this.total = this.tableData.length;
},
apiObj() {
this.tableParams = this.params;
// this.tableParams = this.params;
this.refresh();
},
},
@ -223,7 +224,7 @@ export default {
order: null,
loading: false,
tableHeight: "100%",
tableParams: this.params,
tableParams: Object.assign({}, this.params),
userColumn: [],
customColumnShow: false,
summary: {},
@ -235,7 +236,6 @@ export default {
};
},
mounted() {
console.log(this.parseData);
//
if (this.column) {
this.getCustomColumn();
@ -246,7 +246,11 @@ export default {
if (this.apiObj) {
this.getData();
} else if (this.data) {
this.tableData = this.data;
if (this.isTree) {
this.tableData = this.redata(this.data);
} else {
this.tableData = this.data;
}
this.total = this.tableData.length;
}
},
@ -284,29 +288,6 @@ export default {
Object.assign(reqData, this.tableParams);
try {
var res = await this.apiObj.req(reqData);
if (this.hidePagination) {
if (res.length == 0) {
this.emptyText = "暂无数据";
}
if (
this.$route.path === "/sys/dept" ||
this.$route.path === "/sys/perm"
) {
this.tableData = this.redata(res);
console.log(this.tableData);
} else {
this.tableData = res || [];
}
this.loading = false;
this.$refs.scTable.setScrollTop(0);
this.$emit("dataChange", res, this.tableData);
}
} catch (error) {
this.loading = false;
this.emptyText = error.response.data.err_msg || error.statusText;
return false;
}
try {
var response = this.parseData(res);
if (response.total === 0) {
this.emptyText = "暂无数据";
@ -315,14 +296,10 @@ export default {
if (this.hidePagination) {
dataList = response.data || [];
} else {
dataList = response.rows
dataList = response.rows;
}
if (
this.$route.path === "/sys/dept" ||
this.$route.path === "/ops/menu"
) {
if (this.isTree) {
this.tableData = this.redata(dataList);
console.log(this.tableData);
} else {
this.tableData = dataList || [];
}
@ -333,7 +310,11 @@ export default {
this.$emit("dataChange", res, this.tableData);
} catch (error) {
this.loading = false;
this.emptyText = "数据格式错误";
if(error.response.data){
this.emptyText = error.response.data.err_msg;
}else{
this.emptyText = error.statusText || "数据格式错误";
}
return false;
}
},
@ -388,10 +369,10 @@ export default {
this.$refs.scTable.clearFilter();
this.getData();
},
// params
reload(params, page = 1) {
this.currentPage = page;
this.tableParams = params || this.params;
// tableParamsparams
reload() {
this.currentPage = 1;
this.tableParams = Object.assign({}, this.params);
this.$refs.scTable.clearSelection();
this.$refs.scTable.clearSort();
this.$refs.scTable.clearFilter();

View File

@ -592,7 +592,7 @@ const routes = [
"name": "user",
"meta": {
"title": "账户管理",
"icon": "el-icon-user-filled",
"icon": "el-icon-user",
"type": "menu"
},
"component": "sys/user"
@ -612,7 +612,7 @@ const routes = [
"name": "post",
"meta": {
"title": "岗位管理",
"icon": "sc-icon-organization",
"icon": "el-icon-postcard",
"type": "menu"
},
"component": "sys/post"
@ -674,7 +674,7 @@ const routes = [
"path": "/ops/log",
"meta": {
"title": "请求日志",
"icon": "el-icon-fold",
"icon": "el-icon-document",
"perms": ["log"]
},
"component": "ops/log_request"
@ -684,20 +684,20 @@ const routes = [
"path": "/ops/thirdLogs",
"meta": {
"title": "第三方日志",
"icon": "el-icon-fold",
"icon": "el-icon-document",
"perms": ["third_log"]
},
"component": "ops/thirdLogs"
},
{
"name": "files",
"path": "/ops/files",
"name": "fileLogs",
"path": "/ops/fileLogs",
"meta": {
"title": "文件日志",
"icon": "el-icon-fold",
"icon": "el-icon-document",
"perms": ["file_log"]
},
"component": "ops/files"
"component": "ops/fileLogs"
},
]
},

View File

@ -271,7 +271,10 @@ body .tox-tinymce-aux {
}
.el-table--medium td,   .el-table--medium th {
padding: 2px 0;
}
.el-form-item {
margin-bottom: 16px;
}

View File

@ -25,7 +25,7 @@
<el-col :md="10" :sm="24" style="padding-left: 7.5px;padding-right: 7.5px;
">
<el-card shadow="hover" header="今日事件">
<el-button style="float: right; padding: 3px;margin-top: -44px;" type="text" @click="moreEvent">更多</el-button>
<el-button style="float: right; padding: 3px;margin-top: -44px;" link @click="moreEvent">更多</el-button>
<div class="welcome">
<scTable
ref="table"

View File

@ -0,0 +1,94 @@
<template>
<el-container>
<el-header>
<div class="left-panel"></div>
<div class="right-panel">
<div class="right-panel-search">
<el-input
v-model="query.name"
placeholder="日志名称"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
highlightCurrentRow
hidePagination
@row-click="rowClick"
@resetQuery="resetQuery"
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column
label="名称"
prop="name"
min-width="80"
></el-table-column>
<el-table-column
label="大小(KB)"
prop="size"
min-width="150"
></el-table-column>
</scTable>
</el-main>
<el-drawer
v-model="infoDrawer"
title="日志详情"
:size="'50%'"
destroy-on-close
>
<div v-html="logText" style="white-space: pre-wrap; font-size: 14px"></div>
</el-drawer>
</el-container>
</template>
<script>
export default {
name: "file_logs",
data() {
return {
apiObj: this.$API.ops.file_logs.list,
query: {},
logLists: [],
infoDrawer: false,
logDetailVisible: false,
logText:null
};
},
mounted() {},
methods: {
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
rowClick(row) {
this.$API.ops.file_logs.detail.req(row.name).then((res) => {
this.logText = res
});
this.infoDrawer = true;
// this.$nextTick(() => {
// this.$refs.logInfo.setData(row);
// });
},
},
};
</script>
<style scoped>
.treeMain {
height: 280px;
overflow: auto;
border: 1px solid #dcdfe6;
margin-bottom: 10px;
}
</style>

View File

@ -1,71 +0,0 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<div class="right-panel-search">
<el-input v-model="search.id" placeholder="logId" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="getSearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow @row-click="rowClick">
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="名称" prop="name" min-width="80"></el-table-column>
<el-table-column label="id" prop="id" min-width="200"></el-table-column>
<el-table-column label="路径" prop="path" min-width="150"></el-table-column>
<el-table-column label="类型" prop="type" min-width="80">
<template #default="scope">
<el-tag class="ml-2" type="success" v-if="scope.row.type===1">成功</el-tag>
<el-tag class="ml-2" type="warning" v-if="scope.row.type===2">报错</el-tag>
<el-tag class="ml-2" type="danger" v-if="scope.row.type===40">图片</el-tag>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="requested_at" min-width="150"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<el-button type="text" size="small">查看详情</el-button>
</el-table-column>
</scTable>
</el-main>
<el-drawer v-model="infoDrawer" title="日志详情" :size="'50%'" destroy-on-close>
<logInfo ref="logInfo"></logInfo>
</el-drawer>
</el-container>
</template>
<script>
import logInfo from './logInfo'
export default {
name: 'files',
components: {
logInfo
},
data() {
return {
apiObj: this.$API.common.file.list,
search:{
id:null,
},
logLists:[],
infoDrawer:false,
logDetailVisible:false,
}
},
mounted() {
},
methods: {
getSearch(){
this.$refs.table.reload(this.search);
},
rowClick(row){
this.infoDrawer = true;
this.$nextTick(() => {
this.$refs.logInfo.setData(row)
})
}
}
}
</script>
<style scoped>
.treeMain {height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
</style>

View File

@ -1,74 +1,130 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<div class="right-panel-search">
<el-input v-model="search.id" placeholder="logId" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="getSearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow @row-click="rowClick">
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="日志id" prop="id" min-width="200"></el-table-column>
<el-table-column label="路径" prop="path" min-width="150"></el-table-column>
<el-table-column label="method" prop="method" min-width="80">
</el-table-column>
<el-table-column label="view" prop="view" min-width="150"></el-table-column>
<el-table-column label="状态码" prop="status_code" min-width="80">
<template #default="scope">
<el-tag class="ml-2" type="success" v-if="scope.row.status_code>=200&&scope.row.status_code<300">{{scope.row.status_code}}</el-tag>
<el-tag class="ml-2" type="warning" v-if="scope.row.status_code>=400&&scope.row.status_code<500">{{scope.row.status_code}}</el-tag>
<el-tag class="ml-2" type="danger" v-if="scope.row.status_code>=500">{{scope.row.status_code}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="requested_at" min-width="150"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<el-button type="text" size="small">查看详情</el-button>
</el-table-column>
</scTable>
</el-main>
<el-drawer v-model="infoDrawer" title="日志详情" :size="'50%'" destroy-on-close>
<logInfo ref="logInfo"></logInfo>
</el-drawer>
</el-container>
<el-container>
<el-header>
<div class="left-panel"></div>
<div class="right-panel">
<div class="right-panel-search">
<el-input
v-model="query.id"
placeholder="logId"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
highlightCurrentRow
@row-click="rowClick"
@resetQuery="resetQuery"
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column
label="日志id"
prop="id"
min-width="200"
></el-table-column>
<el-table-column
label="地址"
prop="path"
min-width="220"
></el-table-column>
<el-table-column label="method" prop="method" min-width="80">
</el-table-column>
<el-table-column
label="view"
prop="view"
min-width="150"
></el-table-column>
<el-table-column label="状态码" prop="status_code" min-width="50">
<template #default="scope">
<el-tag
class="ml-2"
type="success"
v-if="scope.row.status_code >= 200 && scope.row.status_code < 300"
>{{ scope.row.status_code }}</el-tag
>
<el-tag
class="ml-2"
type="warning"
v-if="scope.row.status_code >= 400 && scope.row.status_code < 500"
>{{ scope.row.status_code }}</el-tag
>
<el-tag
class="ml-2"
type="danger"
v-if="scope.row.status_code >= 500"
>{{ scope.row.status_code }}</el-tag
>
</template>
</el-table-column>
<el-table-column
label="操作时间"
prop="requested_at"
min-width="100"
></el-table-column>
<el-table-column label="操作" align="center" width="80">
<el-button type="text" size="small">查看</el-button>
</el-table-column>
</scTable>
</el-main>
<el-drawer
v-model="infoDrawer"
title="日志详情"
:size="'50%'"
destroy-on-close
>
<logInfo ref="logInfo"></logInfo>
</el-drawer>
</el-container>
</template>
<script>
import logInfo from './logInfo'
export default {
name: 'logs',
components: {
logInfo
},
data() {
return {
apiObj: this.$API.ops.logs.list,
search:{
id:null,
},
logLists:[],
infoDrawer:false,
logDetailVisible:false,
}
},
mounted() {
},
methods: {
getSearch(){
this.$refs.table.reload(this.search);
},
rowClick(row){
this.infoDrawer = true;
this.$nextTick(() => {
this.$refs.logInfo.setData(row)
})
}
}
}
import logInfo from "./logInfo";
export default {
name: "logs",
components: {
logInfo,
},
data() {
return {
apiObj: this.$API.ops.logs.list,
query: {},
logLists: [],
infoDrawer: false,
logDetailVisible: false,
};
},
mounted() {},
methods: {
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
rowClick(row) {
this.infoDrawer = true;
this.$nextTick(() => {
this.$refs.logInfo.setData(row);
});
},
},
};
</script>
<style scoped>
.treeMain {height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
.treeMain {
height: 280px;
overflow: auto;
border: 1px solid #dcdfe6;
margin-bottom: 10px;
}
</style>

View File

@ -1,285 +1,328 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="addDept"></el-button>
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="部门名称" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" :params="params" row-key="id" @selection-change="selectionChange"
hidePagination>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="菜单名称" prop="name" min-width="200"></el-table-column>
<el-table-column label="类型" prop="type" min-width="200">
<template #default="scope">
<span>{{types[scope.row.type]}}</span>
</template>
</el-table-column>
<el-table-column label="代号" prop="codes" min-width="200"></el-table-column>
<el-table-column label="排序" prop="sort" min-width="200"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button text type="primary" size="small" @click="editMenu(scope.row, scope.$index)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-button text type="danger" size="small" @click="delMenu(scope.row.id)">删除</el-button>
<!--<el-popconfirm title="确定删除吗?" @confirm="delMenu(scope.row, scope.$index)">
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="addMenu"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:isTree="true"
:apiObj="apiObj"
:params="params"
row-key="id"
@selection-change="selectionChange"
hidePagination
>
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column
label="菜单名称"
prop="name"
min-width="200"
></el-table-column>
<el-table-column label="类型" prop="type" min-width="200">
<template #default="scope">
<span>{{ types[scope.row.type] }}</span>
</template>
</el-table-column>
<el-table-column label="标识" prop="codes" min-width="200">
<template #default="scope">
<el-tag v-for="i in scope.row.codes" v-bind:key="i">{{ i }}</el-tag>
</template>
</el-table-column>
<el-table-column
label="排序"
prop="sort"
min-width="200"
></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button
text
type="primary"
size="small"
@click="editMenu(scope.row, scope.$index)"
>编辑</el-button
>
<el-divider direction="vertical"></el-divider>
<el-button
text
type="danger"
size="small"
@click="delMenu(scope.row.id)"
>删除</el-button
>
<!--<el-popconfirm title="确定删除吗?" @confirm="delMenu(scope.row, scope.$index)">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>-->
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<el-dialog :title="titleMap[type]" v-model="limitedVisible" :width="600">
<el-form :model="addForm" :rules="rules" ref="addForm" label-width="100px" label-position="right">
<el-form-item label="类型" prop="type">
<el-radio-group v-model="addForm.type">
<el-radio :label="10">目录</el-radio>
<el-radio :label="20">菜单</el-radio>
<el-radio :label="30">按钮</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="addForm.name" clearable></el-input>
</el-form-item>
<el-form-item label="标识">
<el-input v-model="codes" clearable style="width: 90%;"></el-input>
</el-form-item>
<el-form-item label="父级">
<el-cascader
v-model="addForm.parent"
:options="group"
:props="groupsProps"
:show-all-levels="false"
clearable
style="width: 100%"
@change="handleChange"
></el-cascader>
</el-form-item>
<el-form-item label="排序">
<el-input-number v-model="addForm.sort" controls-position="right" :min="1" style="width: 100%;"></el-input-number>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="limitedVisible=false"> </el-button>
<el-button type="primary" :loading="isSaving" @click="submitHandle()"> </el-button>
</template>
</el-dialog>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<el-dialog :title="titleMap[type]" v-model="limitedVisible" :width="600">
<el-form
:model="addForm"
:rules="rules"
ref="addForm"
label-width="100px"
label-position="right"
>
<el-form-item label="类型" prop="type">
<el-radio-group v-model="addForm.type">
<el-radio :label="10">目录</el-radio>
<el-radio :label="20">菜单</el-radio>
<el-radio :label="30">按钮</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="addForm.name" clearable></el-input>
</el-form-item>
<el-form-item label="标识">
<!-- <el-input v-model="codes" clearable style="width: 90%;"></el-input> -->
<el-select
v-model="addForm.codes"
multiple
filterable
allow-create
default-first-option
:reserve-keyword="false"
placeholder="权限标识(回车添加多个)"
style="width: 100%"
>
<el-option
v-for="item in permCodes"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="父级">
<el-cascader
v-model="addForm.parent"
:options="group"
:props="groupsProps"
:show-all-levels="false"
clearable
style="width: 100%"
@change="handleChange"
></el-cascader>
</el-form-item>
<el-form-item label="排序">
<el-input-number
v-model="addForm.sort"
controls-position="right"
:min="1"
style="width: 100%"
></el-input-number>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="limitedVisible = false"> </el-button>
<el-button type="primary" :loading="isSaving" @click="submitHandle()"
> </el-button
>
</template>
</el-dialog>
</template>
<script>
import {genTree} from "@/utils/verificate";
export default {
name: 'dept',
data() {
return {
dialog: {
save: false,
permission: false
},
apiObj: this.$API.system.permission.list,
selection: [],
search: {
keyword: null
},
params: {
page: 0
},
isSaving: false,
codesLimited: false,
limitedVisible: false,
type: "add",
codes:'',
titleMap: {
add: '新增',
edit: '编辑',
},
import { genTree } from "@/utils/verificate";
export default {
name: "dept",
data() {
return {
dialog: {
save: false,
permission: false,
},
apiObj: this.$API.system.permission.list,
selection: [],
search: {
keyword: null,
},
params: {
page: 0,
},
isSaving: false,
limitedVisible: false,
type: "add",
titleMap: {
add: "新增",
edit: "编辑",
},
//
addForm: {
id: "",
name: "",
codes:[],
type: 10,
sort: 1,
parent: null,
},
//
rules: {
name: [
{required: true, message: '请输入名称'}
],
type: [
{required: true, message: '请选择类型'}
],
},
types:{
10:'目录',
20:'菜单',
30:'按钮',
},
groupsProps: {
// value: "id",
multiple: false,
emitPath: false,
checkStrictly: true,
},
group: [],
permList: [],
permCodes: [],
}
},
//
addForm: {
id: "",
name: "",
codes: [],
type: 10,
sort: 1,
parent: null,
},
//
rules: {
name: [{ required: true, message: "请输入名称" }],
type: [{ required: true, message: "请选择类型" }],
},
types: {
10: "目录",
20: "菜单",
30: "按钮",
},
groupsProps: {
// value: "id",
multiple: false,
emitPath: false,
checkStrictly: true,
},
group: [],
permList: [],
permCodes: [],
};
},
mounted() {
this.getGroup();
this.getPermCodes();
},
methods: {
getPermCodes(){
this.permCodes = this.$API.system.permission.codes.req();
},
handleChange(value) {
// this.menu.checked = check.checkedKeys;
// debugger;
console.log(value);
console.log(this.addForm.parent);
},
//
async getGroup() {
var res = await this.$API.system.permission.list.req({page: 0});
this.group =genTree(res);
},
mounted() {
this.getGroup();
this.getPermCodes();
},
methods: {
getPermCodes() {
this.permCodes = this.$API.system.permission.codes.req();
},
handleChange(value) {
// this.menu.checked = check.checkedKeys;
// debugger;
console.log(value);
console.log(this.addForm.parent);
},
//
async getGroup() {
var res = await this.$API.system.permission.list.req({ page: 0 });
this.group = genTree(res);
},
//
addDept() {
this.type = 'add';
this.limitedVisible = true;
},
addCodes(){
this.codesLimited = true;
},
saveCodes(){
// debugger;console.log(this.addForm.codes);
this.addForm.codes.push(this.codes);
this.codes = ''
},
delCodes(){
this.codesLimited = false;
this.codes = ''
},
//
editMenu(row) {
this.type = 'edit';
this.addForm.id = row.id;
this.addForm.name = row.name;
this.codes = row.codes.join(',');
this.addForm.parent = row.parent;
this.addForm.type = row.type ;
this.addForm.sort = row.sort;
this.limitedVisible = true;
},
//
addMenu() {
this.type = "add";
this.limitedVisible = true;
this.$nextTick(() => {
this.$refs.addForm.resetFields();
});
},
//
editMenu(row) {
this.type = "edit";
this.addForm = row;
this.limitedVisible = true;
},
//
delMenu(id) {
this.$confirm(`确定删除吗?`, '提示', {
type: 'warning',
confirmButtonText: '删除',
confirmButtonClass: 'el-button--danger'
}).then(() => {
this.$API.system.permission.delete.req(id).then(res=>{
if(res.err_msg){
this.$message.error(res.err_msg);
this.$refs.table.refresh()
}else{
this.$message.success("操作成功");
}
});
})
},
submitHandle() {
let that = this;
if(this.codes.indexOf(','>-1)){
this.addForm.codes = this.codes.split(',');
}else{
this.addForm.codes.push(this.codes)
}
this.$refs.addForm.validate((valid) => {
// debugger;
if (valid) {
this.isSaveing = true;
var res;
if (this.type === 'add') {
res = this.$API.system.permission.create.req(that.addForm);
} else {
res = this.$API.system.permission.update.req(that.addForm.id, that.addForm);
}
console.log(res);
debugger;
if(res.err_msg){
this.$message.error(res.err_msg)
}else{
this.isSaveing = false;
this.limitedVisible = false;
this.$refs.table.refresh();
}
}
})
},
//
selectionChange(selection) {
this.selection = selection;
},
//
upsearch() {
let params = {search:this.search.keyword};
this.$refs.table.queryData(params);
},
//
handleSaveSuccess(data, mode) {
if (mode == 'add') {
this.$refs.table.refresh()
} else if (mode == 'edit') {
this.$refs.table.refresh()
}
}
}
}
//
delMenu(id) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
confirmButtonText: "删除",
confirmButtonClass: "el-button--danger",
}).then(() => {
this.$API.system.permission.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
this.$refs.table.refresh();
} else {
this.$message.success("操作成功");
}
});
});
},
submitHandle() {
let that = this;
this.$refs.addForm.validate((valid) => {
// debugger;
if (valid) {
this.isSaveing = true;
var res;
if (this.type === "add") {
this.$API.system.permission.create
.req(that.addForm)
.then((res) => {
this.isSaveing = false;
this.limitedVisible = false;
this.$refs.table.refresh();
})
.catch((e) => {
this.isSaveing = false;
});
} else {
this.$API.system.permission.update
.req(that.addForm.id, that.addForm)
.then((res) => {
this.isSaveing = false;
this.limitedVisible = false;
this.$refs.table.refresh();
})
.catch((e) => {
this.isSaveing = false;
});
}
}
});
},
//
selectionChange(selection) {
this.selection = selection;
},
//
upsearch() {
let params = { search: this.search.keyword };
this.$refs.table.queryData(params);
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
},
},
};
</script>
<style>
.formAddButton{
width: 32px;
height: 32px;
padding: 0;
text-align: center;
line-height: 32px;
border-radius: 16px;
position: absolute;
right: 0;
top : 0
}
.formSaveButton,.formDelButton{
padding: 0;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
border-radius: 15px;
position: absolute;
left: 20px;
top : 0
}
.formDelButton{
left: 60px;
}
.formAddButton {
width: 32px;
height: 32px;
padding: 0;
text-align: center;
line-height: 32px;
border-radius: 16px;
position: absolute;
right: 0;
top: 0;
}
.formSaveButton,
.formDelButton {
padding: 0;
width: 30px;
height: 30px;
text-align: center;
line-height: 30px;
border-radius: 15px;
position: absolute;
left: 20px;
top: 0;
}
.formDelButton {
left: 60px;
}
</style>

View File

@ -1,72 +1,148 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<div class="right-panel-search">
<el-input v-model="search.id" placeholder="logId" clearable></el-input>
<el-button type="primary" icon="el-icon-search" @click="getSearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow @row-click="rowClick">
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="method" prop="method" min-width="80"></el-table-column>
<el-table-column label="id" prop="id" min-width="200"></el-table-column>
<el-table-column label="路径" prop="path" min-width="150"></el-table-column>
<el-table-column label="target" prop="target" min-width="80"></el-table-column>
<el-table-column label="状态" prop="status_code" min-width="80">
<template #default="scope">
<el-tag class="ml-2" type="success" v-if="scope.row.result==='success'">成功</el-tag>
<el-tag class="ml-2" type="warning" v-if="scope.row.result==='fail'">报错</el-tag>
<el-tag class="ml-2" type="danger" v-if="scope.row.result==='error'">失败</el-tag>
</template>
</el-table-column>
<el-table-column label="操作时间" prop="requested_at" min-width="150"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<el-button type="text" size="small">查看详情</el-button>
</el-table-column>
</scTable>
</el-main>
<el-drawer v-model="infoDrawer" title="日志详情" :size="'50%'" destroy-on-close>
<logInfo ref="logInfo"></logInfo>
</el-drawer>
</el-container>
<el-container>
<el-header>
<div class="left-panel">
<el-select v-model="query.result" clearable placeholder="请求结果" @change="handleQuery">
<el-option
v-for="item in resultOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<div class="left-panel">
<div class="right-panel-search">
<el-input v-model="query.id" placeholder="logId" clearable></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
highlightCurrentRow
@row-click="rowClick"
@resetQuery="resetQuery"
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="id" prop="id" min-width="150"></el-table-column>
<el-table-column
label="target"
prop="target"
min-width="50"
></el-table-column>
<el-table-column
label="method"
prop="method"
min-width="50"
></el-table-column>
<el-table-column
label="地址"
prop="path"
min-width="220"
></el-table-column>
<el-table-column label="状态" prop="status_code" min-width="50">
<template #default="scope">
<el-tag
class="ml-2"
type="success"
v-if="scope.row.result === 'success'"
>成功</el-tag
>
<el-tag
class="ml-2"
type="warning"
v-if="scope.row.result === 'fail'"
>失败</el-tag
>
<el-tag
class="ml-2"
type="danger"
v-if="scope.row.result === 'error'"
>错误</el-tag
>
</template>
</el-table-column>
<el-table-column
label="操作时间"
prop="requested_at"
min-width="100"
></el-table-column>
<el-table-column label="操作" align="center" width="80">
<el-button link size="small">查看</el-button>
</el-table-column>
</scTable>
</el-main>
<el-drawer
v-model="infoDrawer"
title="日志详情"
:size="'50%'"
destroy-on-close
>
<logInfo ref="logInfo"></logInfo>
</el-drawer>
</el-container>
</template>
<script>
import logInfo from './logInfo'
export default {
name: 'thirdLogs',
components: {
logInfo
},
data() {
return {
apiObj: this.$API.third.thirdLog,
search:{
id:null,
},
logLists:[],
infoDrawer:false,
logDetailVisible:false,
}
},
mounted() {
},
methods: {
getSearch(){
this.$refs.table.reload(this.search);
},
rowClick(row){
this.infoDrawer = true;
this.$nextTick(() => {
this.$refs.logInfo.setData(row)
})
}
}
}
import logInfo from "./logInfo";
export default {
name: "thirdLogs",
components: {
logInfo,
},
data() {
return {
apiObj: this.$API.third.thirdLog,
query: {},
logLists: [],
infoDrawer: false,
logDetailVisible: false,
resultOptions: [
{
value: "success",
label: "成功",
},
{
value: "fail",
label: "失败",
},
{
value: "error",
label: "错误",
},
],
};
},
mounted() {},
methods: {
handleQuery() {
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {}
},
rowClick(row) {
this.infoDrawer = true;
this.$nextTick(() => {
this.$refs.logInfo.setData(row);
});
},
},
};
</script>
<style scoped>
.treeMain {height:280px;overflow: auto;border: 1px solid #dcdfe6;margin-bottom: 10px;}
.treeMain {
height: 280px;
overflow: auto;
border: 1px solid #dcdfe6;
margin-bottom: 10px;
}
</style>

View File

@ -20,7 +20,7 @@
</el-table-column>
<el-table-column label="执行日志" prop="logs" width="100" fixed="right">
<template #default="scope">
<el-button size="small" @click="show(scope.row)" type="text">日志</el-button>
<el-button size="small" @click="show(scope.row)" link>日志</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -13,19 +13,19 @@
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe @resetQuery="resetQuery" >
<el-table-column type="selection" width="50"></el-table-column>
<scTable ref="table" :isTree="true" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe default-expand-all hidePagination>
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="部门名称" prop="name" min-width="200"></el-table-column>
<el-table-column label="部门类型" prop="type" min-width="200"></el-table-column>
<el-table-column label="创建日期" prop="create_time" min-width="200"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope">
<el-button type="text" size="small" @click="editDept(scope.row, scope.$index)">编辑</el-button>
<el-button link type="primary" size="small" @click="editDept(scope.row, scope.$index)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="delDept(scope.row, scope.$index)">
<template #reference>
<el-button text type="danger" size="small">删除</el-button>
<el-button link type="danger" size="small">删除</el-button>
</template>
</el-popconfirm>
</template>
@ -82,9 +82,7 @@
search: {
keyword: null
},
params:{
page:0
},
params:{},
isSaving: false,
limitedVisible : false,
type: "add",

View File

@ -49,11 +49,11 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope">
<el-button type="text" size="small" @click="editDic(scope.row)">编辑</el-button>
<el-button link size="small" @click="editDic(scope.row)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="delDic(scope.row,scope.$index)">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>
</template>

View File

@ -11,7 +11,7 @@
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" stripe highlightCurrentRow @row-click="rowClick"
:hidePagination="true">
<el-table-column type="selection" width="50"></el-table-column>
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column label="" type="index"></el-table-column>
<el-table-column label="名称" prop="name" width="120"></el-table-column>
<el-table-column label="标识" prop="code" width="60"></el-table-column>
@ -30,26 +30,23 @@
<el-container>
<el-header>
<div class="left-panel">
<div style="margin-right: 20px">岗位关系</div>
<div style="margin-right: 20px">岗位权限</div>
<el-button type="primary" icon="el-icon-plus" @click="addPostRole"></el-button>
<el-button type="danger" plain icon="el-icon-delete" @click="delPostRole"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table2" :apiObj="apiObj2" row-key="id" stripe :hidePagination="true">
<el-table-column type="selection" width="50"></el-table-column>
<!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column label="" type="index"></el-table-column>
<el-table-column label="权限范围" prop="data_range" min-width="80">
<template #default="scope">{{options[scope.row.data_range]}}</template>
</el-table-column>
<el-table-column label="关联岗位" prop="post" min-width="80">
<el-table-column label="所属岗位" prop="post" min-width="80">
<template #default="scope">{{scope.row.post_.name}}</template>
</el-table-column>
<el-table-column label="关联角色" prop="role" min-width="80">
<el-table-column label="拥有角色" prop="role" min-width="80">
<template #default="scope">{{scope.row.role_.name}}</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time" min-width="80">
<template #default="scope">{{scope.row.create_time}}</template>
<el-table-column label="权限范围" prop="data_range" min-width="80">
<template #default="scope">{{options[scope.row.data_range]}}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="right">
<template #default="scope">

View File

@ -22,11 +22,11 @@
<el-table-column label="角色描述" prop="description" width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<template #default="scope">
<el-button type="text" size="small" @click="roleEdit(scope.row, scope.$index)">编辑</el-button>
<el-button link size="small" @click="roleEdit(scope.row, scope.$index)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="roleDel(scope.row, scope.$index)">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>
</template>

View File

@ -3,21 +3,21 @@
<el-row :gutter="15">
<el-col :xl="6" :lg="6" :md="8" :sm="12" :xs="24" v-for="item in list" :key="item.id">
<el-card class="task task-item" shadow="hover">
<h2>{{item.title}}</h2>
<h2>{{item.name}}</h2>
<ul>
<li>
<h4>执行</h4>
<p>{{item.handler}}</p>
<h4>执行方法</h4>
<p>{{item.task}}</p>
</li>
<li>
<h4>定时规则</h4>
<p>{{item.cron}}</p>
<h4>时间策略</h4>
<p>{{item.timetype}}-{{item.schedule}}</p>
</li>
</ul>
<div class="bottom">
<div class="state">
<el-tag v-if="item.state=='1'" size="mini">准备就绪</el-tag>
<el-tag v-if="item.state=='-1'" size="mini" type="info">停用</el-tag>
<el-tag v-if="item.enabled" size="mini">启用</el-tag>
<el-tag v-if="!item.enabled" size="mini" type="danger">停用</el-tag>
</div>
<div class="handler">
<el-popconfirm title="确定立即执行吗?" @confirm="run(item)">
@ -92,15 +92,7 @@
},
data() {
return {
list: [
{
id: "1",
title: "清理服务器缓存",
handler: "cleanUpCacheHandler",
cron: "59 59 23 * * ? *",
state: "1"
}
],
list: [],
mode: "add",
editId:null,
titleMap: {
@ -133,13 +125,8 @@
},
methods: {
getList(){
this.$API.system.task.list.req().then(res=>{
if(res.err_msg){
this.message.error(res.err_msg)
}else{
debugger;
this.list.concat(res.results)
}
this.$API.system.task.list.req({page:0}).then(res=>{
this.list = res
})
},
addTask(){

View File

@ -11,7 +11,7 @@
</el-table-column>
<el-table-column label="执行日志" prop="logs" width="100" fixed="right">
<template #default="scope">
<el-button size="mini" @click="show(scope.row)" type="text">日志</el-button>
<el-button size="mini" @click="show(scope.row)" link>日志</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -1,6 +1,6 @@
<template>
<el-container>
<el-aside width="200px" v-loading="showGrouploading">
<el-aside width="300px" v-loading="showGrouploading">
<el-container>
<el-header style="border-bottom: none">
<el-input
@ -16,6 +16,7 @@
node-key="id"
:data="group"
:current-node-key="''"
default-expand-all
:highlight-current="true"
:expand-on-click-node="false"
:filter-node-method="groupFilterNode"
@ -32,19 +33,19 @@
icon="el-icon-plus"
@click="add"
></el-button>
<el-button
<!-- <el-button
type="danger"
plain
icon="el-icon-delete"
:disabled="selection.length == 0"
@click="batch_del"
></el-button>
<el-button
></el-button> -->
<!-- <el-button
type="primary"
plain
:disabled="selection.length == 0"
>密码重置
</el-button>
</el-button> -->
</div>
<div class="right-panel">
<div class="right-panel-search">
@ -90,18 +91,19 @@
<el-table-column
label="加入时间"
prop="create_time"
min-width="150"
min-width="100"
sortable="custom"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="160"
width="200"
>
<template #default="scope">
<el-button
type="text"
type="success"
link
size="small"
@click="formSetting(scope.row)"
>
@ -110,7 +112,7 @@
<el-button
type="text"
link
size="small"
@click="formEdit(scope.row, '2')"
>
@ -122,7 +124,7 @@
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
<el-button text type="danger" size="small">
<el-button link type="danger" size="small">
删除
</el-button>
</template>

View File

@ -32,7 +32,7 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="是否在职">
<el-form-item label="是否启用">
<span>{{job_states[form.is_active]}}</span>
</el-form-item>
</el-col>
@ -40,11 +40,17 @@
</el-form>
<!--drag-sort -->
<sc-form-table v-model="userPostForm.list" :addTemplate="addTemplate" placeholder="暂无数据">
<el-table-column prop="val" label="名称" min-width="150">
<!-- <el-table-column prop="val" label="名称" min-width="150">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.name}}</span>
<el-input v-else v-model="scope.row.name" placeholder="名称"></el-input>
</template>
</el-table-column> -->
<el-table-column prop="val" label="排序" min-width="80">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.sort}}</span>
<el-input v-else v-model="scope.row.sort" placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<el-table-column prop="time" label="部门" min-width="150">
<template #default="scope">
@ -69,12 +75,6 @@
</el-select>
</template>
</el-table-column>
<el-table-column prop="val" label="排序" min-width="80">
<template #default="scope">
<span v-if="scope.row.id">{{scope.row.sort}}</span>
<el-input v-else v-model="scope.row.sort" placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="80" align="center">
<template #default="scope">
<el-button v-if="scope.row.id" text type="danger" size="small" @click="userPostDel(scope.row.id)">删除</el-button>
@ -105,7 +105,7 @@
list: []
},
loading: false,
job_states: { true: "在职",false: "离职"},
job_states: { true: "启用",false: "禁用"},
visible: false,
isSaveing: false,
form: {},

View File

@ -35,7 +35,7 @@
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<template #default="scope">
<el-button type="text" size="small" @click="handleShow(scope.row)">查看详情</el-button>
<el-button link size="small" @click="handleShow(scope.row)">查看详情</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -16,10 +16,10 @@
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<template #default="scope">
<el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
<el-button link size="small" @click="handleEdit(scope.row)">编辑</el-button>
<el-popconfirm title="确定删除吗?">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>
</template>

View File

@ -35,7 +35,7 @@
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="160">
<template #default="scope">
<el-button type="text" size="small" @click="handleShow(scope.row)">查看详情</el-button>
<el-button link size="small" @click="handleShow(scope.row)">查看详情</el-button>
<!--创建人在初始状态-->
<el-link
v-if="scope.row.state_.type===1&&userId===scope.row.create_by"

View File

@ -53,12 +53,12 @@
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<template #default="scope">
<el-button type="text" size="small" @click="handleEdit(scope.row)"
<el-button link size="small" @click="handleEdit(scope.row)"
>编辑</el-button
>
<el-popconfirm title="确定删除吗?">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>
</template>

View File

@ -35,7 +35,7 @@
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<template #default="scope">
<el-button type="text" size="small" @click="handleShow(scope.row)">查看详情</el-button>
<el-button link size="small" @click="handleShow(scope.row)">查看详情</el-button>
</template>
</el-table-column>
</scTable>

View File

@ -28,13 +28,13 @@
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="220">
<template #default="scope">
<el-button type="text" size="small" @click="workflowShow(scope.row)">配置</el-button>
<el-button link size="small" @click="workflowShow(scope.row)">配置</el-button>
<el-divider direction="vertical"></el-divider>
<el-button type="text" size="small" @click="workflowEdit(scope.row)">编辑</el-button>
<el-button link size="small" @click="workflowEdit(scope.row)">编辑</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="workflowDel(scope.row)">
<template #reference>
<el-button type="text" size="small">删除</el-button>
<el-button link size="small">删除</el-button>
</template>
</el-popconfirm>
</template>