若依 2.0

This commit is contained in:
RuoYi
2020-06-10 11:31:13 +08:00
committed by 疯狂的狮子li
parent cc50a7c8d1
commit d5d7e9b782
61 changed files with 1306 additions and 305 deletions

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询终端配置列表
export function listClient(query) {
return request({
url: '/system/client/list',
method: 'get',
params: query
})
}
// 查询终端配置详细
export function getClient(clientId) {
return request({
url: '/system/client/' + clientId,
method: 'get'
})
}
// 新增终端配置
export function addClient(data) {
return request({
url: '/system/client',
method: 'post',
data: data
})
}
// 修改终端配置
export function updateClient(data) {
return request({
url: '/system/client',
method: 'put',
data: data
})
}
// 删除终端配置
export function delClient(clientId) {
return request({
url: '/system/client/' + clientId,
method: 'delete'
})
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1591754363642" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2753" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M921.6 51.2a51.2 51.2 0 0 1 51.2 51.2v665.6a51.2 51.2 0 0 1-51.2 51.2H102.4a51.2 51.2 0 0 1-51.2-51.2V102.4a51.2 51.2 0 0 1 51.2-51.2h819.2m0-51.2H102.4a102.4 102.4 0 0 0-102.4 102.4v665.6a102.4 102.4 0 0 0 102.4 102.4h819.2a102.4 102.4 0 0 0 102.4-102.4V102.4a102.4 102.4 0 0 0-102.4-102.4z" p-id="2754"></path><path d="M102.4 972.8l819.2 0 0 51.2-819.2 0 0-51.2Z" p-id="2755"></path><path d="M537.088 204.8a25.6 25.6 0 0 1 25.6 25.6v60.928a153.6 153.6 0 0 1 48.128 27.648l51.2-30.208a25.6 25.6 0 0 1 35.328 9.216l25.6 44.032a25.6 25.6 0 0 1-9.216 35.328l-51.2 30.208a139.776 139.776 0 0 1 0 55.808l51.2 30.208a25.6 25.6 0 0 1 9.216 35.328l-25.6 44.032a25.6 25.6 0 0 1-35.328 9.216l-51.2-30.208a153.6 153.6 0 0 1-48.128 27.648v60.416a25.6 25.6 0 0 1-25.6 25.6h-51.2a25.6 25.6 0 0 1-25.6-25.6v-60.416a153.6 153.6 0 0 1-48.128-27.648l-51.2 30.208a25.6 25.6 0 0 1-35.328-9.216l-25.6-44.032a25.6 25.6 0 0 1 7.168-35.84l51.2-30.208A139.776 139.776 0 0 1 360.96 409.6L307.2 377.344a25.6 25.6 0 0 1-9.216-35.328l25.6-44.032A25.6 25.6 0 0 1 358.4 288.768l51.2 30.208a153.6 153.6 0 0 1 51.2-27.648V230.4a25.6 25.6 0 0 1 25.6-25.6h51.2m0-51.2h-51.2A77.312 77.312 0 0 0 409.6 230.4V256l-23.552-13.824a76.8 76.8 0 0 0-104.96 28.16l-25.088 46.08a77.312 77.312 0 0 0 28.16 104.96L307.2 435.2l-23.552 13.824A77.312 77.312 0 0 0 256 553.984l25.6 44.032a76.8 76.8 0 0 0 104.96 28.16L409.6 614.4v27.136A77.312 77.312 0 0 0 486.4 716.8h51.2a77.312 77.312 0 0 0 76.8-76.8V614.4l23.552 13.824a76.8 76.8 0 0 0 104.96-28.16l25.6-44.032a77.312 77.312 0 0 0-28.16-104.96L716.8 435.2l23.552-13.824A77.312 77.312 0 0 0 768 316.416l-25.6-44.032a76.8 76.8 0 0 0-104.96-28.16L614.4 256v-25.6A77.312 77.312 0 0 0 537.088 153.6z" p-id="2756"></path><path d="M512 384a51.2 51.2 0 1 1-51.2 51.2 51.2 51.2 0 0 1 51.2-51.2m0-51.2a102.4 102.4 0 1 0 102.4 102.4 102.4 102.4 0 0 0-102.4-102.4z" p-id="2757"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1591690694719" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#F4F5F9" p-id="718"></path><path d="M695.04 258.2784H328.96a35.9296 35.9296 0 0 0-36.0448 36.0448v435.6352a35.9296 35.9296 0 0 0 36.0448 36.0448h366.08a35.9296 35.9296 0 0 0 36.0448-36.0448V294.3232a35.9296 35.9296 0 0 0-36.0448-36.0448z m-187.5456 39.424v183.6032L461.312 452.864a17.472 17.472 0 0 0-9.0112-2.5344c-3.0976 0-6.1952 0.8448-9.0112 2.5344l-45.6192 28.4416V297.7024h109.824z m-178.5344-5.632h34.9184v219.648c0 6.1952 3.3792 11.8272 8.7296 14.6432 5.3504 3.0976 11.8272 2.816 17.1776-0.2816l62.7968-38.8608 62.7968 38.8608c2.816 1.6896 5.9136 2.5344 9.0112 2.5344 2.816 0 5.632-0.8448 8.1664-2.2528 5.3504-3.0976 8.7296-8.7296 8.7296-14.6432v-219.648H695.04a2.432 2.432 0 0 1 2.2528 2.2528v351.7184H326.7072V294.3232c0-1.408 1.1264-2.2528 2.2528-2.2528z m366.08 439.8592H328.96a2.432 2.432 0 0 1-2.2528-2.2528V679.552h370.5856v50.1248c0 1.408-1.1264 2.2528-2.2528 2.2528z" fill="#3A7FF6" p-id="719"></path><path d="M378.3552 317.7344v-9.6768 423.872h318.9376V317.7344z" fill="#3A7FF6" fill-opacity=".15" p-id="720"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1591690642331" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="561" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M178.730368 448.278738v226.23413c0 175.689587-9.325063 154.471691 187.85271199 264.615547l145.95750301 84.466147v-108.116668l-229.747921-131.091461c-17.163521-11.487396-13.51458399-7.973604-13.514584-55.004356l241.775901 137.30817 1.081167-331.242444L269.818662 676.675201l0.810875-179.743962c81.087502-44.057543 160.01267-91.493731 240.965025-135.145836v-104.738023z" fill="#33E7D8" p-id="562"></path><path d="M511.594562 361.379966l244.208526 140.551669v43.787251l-243.938234-136.49729401v77.70885501l242.992213 138.524482v148.66042l-243.262505 141.767982v108.116669l216.233338-124.334169c130.550878-71.221856 116.360565-67.572918 116.360565-224.747526v-229.747921L511.459417 257.04738zM511.864854 211.503233l333.404778 189.204171V190.420483l-95.277815-51.490564v99.061898l-142.849148-79.330605V51.625709L512.135146 0l-0.270292 211.503233z" fill="#246ADF" p-id="563"></path><path d="M178.460077 402.329154l333.404777-190.825921L512.135146 0l-95.548106 55.544939v103.116273L277.65712 237.991817v-99.061898L178.460077 190.420483v211.908671z" fill="#33E7D8" p-id="564"></path><path d="M511.189125 866.690247l-0.135146 1.351458 202.583608-113.522502-0.405437-102.845981-201.097004-116.225419-0.946021 331.242444z" fill="#246ADF" p-id="565"></path><path d="M178.460077 402.329154l23.24508301 32.705292 309.75425699-177.987066 310.700277 174.338129 23.109938-30.678105-333.404778-189.204171L178.460077 402.329154zM512.135146 535.447803l201.097004 116.225419 0.405437 102.845981-202.583608 113.522502 0.675729 47.436189 243.262505-141.76798201V625.725221L511.594562 487.200739l0.540584 48.247064z" p-id="566"></path><path d="M512.135146 535.447803l-0.675729-48.247064-200.421275 114.468523c2.027188-97.710439-11.892834-71.221856 51.490563-108.116669l148.66042-84.06071v-48.111917c-81.087502 44.057543-159.336941 91.493731-240.965026 135.145836l-0.81087499 179.743962z" fill="#FFFFFF" p-id="567"></path><path d="M511.459417 487.200739V409.491883l-148.66042 84.06071c-63.383397 36.894813-49.463376 10.406229-51.490564 108.116669z" fill="#33E7D8" p-id="568"></path><path d="M511.729708 915.477894l-0.675729-46.76046L269.683516 729.382077c0 47.030751-4.054375 43.516959 13.514584 55.004356z" fill="#FFFFFF" p-id="569"></path><path d="M511.864854 409.627029l244.07338 136.091857v-43.787251l-244.343672-140.551669 0.270292 48.247063z" p-id="570"></path></svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,271 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="终端编号" prop="clientId">
<el-input
v-model="queryParams.clientId"
placeholder="终端编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:client:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:client:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:client:remove']"
>删除</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="clientList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="编号" align="center" prop="clientId" />
<el-table-column label="安全码" align="center" prop="clientSecret" :show-overflow-tooltip="true" />
<el-table-column label="授权范围" align="center" prop="scope" />
<el-table-column label="授权类型" align="center" prop="authorizedGrantTypes" :show-overflow-tooltip="true" />
<el-table-column label="令牌时效" align="center" prop="accessTokenValidity" />
<el-table-column label="刷新时效" align="center" prop="refreshTokenValidity" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:client:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:client:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改终端对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="编号" prop="clientId">
<el-input v-model="form.clientId" placeholder="请输入编号" :disabled="!isAdd" />
</el-form-item>
<el-form-item label="安全码" prop="clientSecret">
<el-input v-model="form.clientSecret" placeholder="请输入安全码" />
</el-form-item>
<el-form-item label="授权范围" prop="scope">
<el-input v-model="form.scope" placeholder="请输入授权范围" />
</el-form-item>
<el-form-item label="授权类型" prop="authorizedGrantTypes">
<el-input v-model="form.authorizedGrantTypes" placeholder="请输入授权类型" />
</el-form-item>
<el-form-item label="令牌时效" prop="accessTokenValidity">
<el-input-number v-model="form.accessTokenValidity" controls-position="right" :min="0" />
</el-form-item>
<el-form-item label="刷新时效" prop="refreshTokenValidity">
<el-input-number v-model="form.refreshTokenValidity" controls-position="right" :min="0" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listClient, getClient, delClient, addClient, updateClient } from "@/api/system/client";
export default {
name: "Client",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 终端表格数据
clientList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
clientId: undefined
},
// 是否新增
isAdd: false,
// 表单参数
form: {},
// 表单校验
rules: {
clientId: [
{ required: true, message: "编号不能为空", trigger: "blur" }
],
clientSecret: [
{ required: true, message: "安全码不能为空", trigger: "blur" }
],
scope: [
{ required: true, message: "授权范围不能为空", trigger: "blur" }
],
authorizedGrantTypes: [
{ required: true, message: "授权类型不能为空", trigger: "blur" }
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询终端列表 */
getList() {
this.loading = true;
listClient(this.queryParams).then(response => {
this.clientList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
clientId: undefined,
clientSecret: undefined,
scope: "server",
authorizedGrantTypes: "password,refresh_token",
accessTokenValidity: 3600,
refreshTokenValidity: 7200
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.clientId);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.isAdd = true;
this.title = "添加终端";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.isAdd = false;
const clientId = row.clientId || this.ids;
getClient(clientId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改终端";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (!this.isAdd && this.form.clientId != undefined) {
updateClient(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addClient(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const clientIds = row.clientId || this.ids;
this.$confirm('是否确认删除终端编号为"' + clientIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delClient(clientIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
}
}
};
</script>

View File

@@ -90,15 +90,12 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="访问编号" align="center" prop="infoId" />
<el-table-column label="用户名称" align="center" prop="userName" />
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" />
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="操作信息" align="center" prop="msg" />
<el-table-column label="登录日期" align="center" prop="loginTime" width="180">
<el-table-column label="地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="描述" align="center" prop="msg" />
<el-table-column label="访问时间" align="center" prop="accessTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
<span>{{ parseTime(scope.row.accessTime) }}</span>
</template>
</el-table-column>
</el-table>

View File

@@ -110,7 +110,6 @@
<el-table-column label="请求方式" align="center" prop="requestMethod" />
<el-table-column label="操作人员" align="center" prop="operName" />
<el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
<el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
<el-table-column label="操作状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="操作日期" align="center" prop="operTime" width="180">
<template slot-scope="scope">
@@ -146,7 +145,7 @@
<el-form-item label="操作模块:">{{ form.title }} / {{ typeFormat(form) }}</el-form-item>
<el-form-item
label="登录信息:"
>{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
>{{ form.operName }} / {{ form.operIp }}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="请求地址:">{{ form.operUrl }}</el-form-item>