初始项目

This commit is contained in:
liupopo
2023-02-11 12:55:02 +08:00
parent 1748bda84a
commit 0b89e36064
3363 changed files with 506201 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
<template> 
<adminLog-detail :is-edit='false'></adminLog-detail>
</template>
<script>
import AdminLogDetail from './components/AdminLogDetail'
export default {
name: 'addAdminLog',
components: { AdminLogDetail }
}
</script>
<style>
</style>

View File

@@ -0,0 +1,261 @@
<template> 
<div class="app-container">
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="searchAdminLogList()"
type="primary"
size="small">
查询结果
</el-button>
</div>
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:">
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
</el-form-item>
<el-form-item label="提交时间:">
<el-date-picker
class="input-width"
v-model="listQuery.startTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="提交时间:">
<el-date-picker
class="input-width"
v-model="listQuery.endTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择结束时间">
</el-date-picker>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
</el-card>
<div class="table-container">
<el-table ref="adminLogStatic"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
v-loading="listLoading"
border>
<el-table-column label="接口名" align="center">
<template slot-scope="scope">{{scope.row.method}}</template>
</el-table-column>
<el-table-column label="调用次数" align="center">
<template slot-scope="scope">{{scope.row.count}}</template>
</el-table-column>
<el-table-column label="平均时长" align="center">
<template slot-scope="scope">{{scope.row.avgMin}}</template>
</el-table-column>
<el-table-column label="总时长" align="center">
<template slot-scope="scope">{{scope.row.sum}}</template>
</el-table-column>
<el-table-column label="超过0.1秒个数" align="center">
<template slot-scope="scope">{{scope.row.count1}}</template>
</el-table-column>
<el-table-column label="超过0.3秒个数" align="center">
<template slot-scope="scope">{{scope.row.count2}}</template>
</el-table-column>
<el-table-column label="超过0.6秒个数" align="center">
<template slot-scope="scope">{{scope.row.count3}}</template>
</el-table-column>
<el-table-column label="超过1秒个数" align="center">
<template slot-scope="scope">{{scope.row.count4}}</template>
</el-table-column>
<el-table-column label="超过1.5秒个数" align="center">
<template slot-scope="scope">{{scope.row.count5}}</template>
</el-table-column>
<el-table-column label="超过3秒个数" align="center">
<template slot-scope="scope">{{scope.row.count6}}</template>
</el-table-column>
<el-table-column label="超过0.1秒总时长" align="center">
<template slot-scope="scope">{{scope.row.sum1}}</template>
</el-table-column>
<el-table-column label="超过0.3秒总时长" align="center">
<template slot-scope="scope">{{scope.row.sum2}}</template>
</el-table-column>
<el-table-column label="超过0.6秒总时长" align="center">
<template slot-scope="scope">{{scope.row.sum3}}</template>
</el-table-column>
<el-table-column label="超过1秒总时长" align="center">
<template slot-scope="scope">{{scope.row.sum4}}</template>
</el-table-column>
<el-table-column label="超过1.5秒总时长" align="center">
<template slot-scope="scope">{{scope.row.sum5}}</template>
</el-table-column>
<el-table-column label="超过3秒总时长" align="center">
<template slot-scope="scope">{{scope.row.sum6}}</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import {fetchList, deleteAdminLog,logStatic} from '@/api/sys/adminLog'
import {formatDate} from '@/utils/date';
export default {
name: 'adminLogList',
data() {
return {
operates: [
{
label: "显示品牌",
value: "showAdminLog"
},
{
label: "隐藏品牌",
value: "hideAdminLog"
}
],
operateType: null,
listQuery: {
keyword: null,
pageNum: 1,
pageSize: 10
},
list: null,
total: null,
listLoading: true,
multipleSelection: []
}
},
created() {
this.getList();
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStatus(value) {
if (value === 1) {
return '未开始';
} else if (value === 2) {
return '活动中';
} else if (value === 3) {
return '已结束';
} else if (value === 4) {
return '已失效';
}
},
},
methods: {
getList() {
this.listLoading = true;
logStatic(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data;
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleUpdate(index, row) {
this.$router.push({path: '/sys/updateAdminLog', query: {id: row.id}})
},
handleDelete(index, row) {
this.$confirm('是否要删除该品牌', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteAdminLog(row.id).then(response => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1000
});
this.getList();
});
});
},
getProductList(index, row) {
console.log(index, row);
},
getProductCommentList(index, row) {
console.log(index, row);
},
handleSizeChange(val) {
this.listQuery.pageNum = 1;
this.listQuery.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.pageNum = val;
this.getList();
},
searchAdminLogList() {
this.listQuery.pageNum = 1;
this.getList();
},
handleBatchOperate() {
console.log(this.multipleSelection);
if (this.multipleSelection < 1) {
this.$message({
message: '请选择一条记录',
type: 'warning',
duration: 1000
});
return;
}
let showStatus = 0;
if (this.operateType === 'showAdminLog') {
showStatus = 1;
} else if (this.operateType === 'hideAdminLog') {
showStatus = 0;
} else {
this.$message({
message: '请选择批量操作类型',
type: 'warning',
duration: 1000
});
return;
}
let ids = [];
for (let i = 0; i < this.multipleSelection.length; i++) {
ids.push(this.multipleSelection[i].id);
}
let data = new URLSearchParams();
data.append("ids", ids);
data.append("showStatus", showStatus);
updateShowStatus(data).then(response => {
this.getList();
this.$message({
message: '修改成功',
type: 'success',
duration: 1000
});
});
},
addAdminLog() {
this.$router.push({path: '/build/add${className}'})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@@ -0,0 +1,151 @@
<template> 
<el-card class="form-container" shadow="never">
<el-form :model="adminLog" :rules="rules" ref="adminLogFrom" label-width="150px">
<el-form-item label="编号:" prop="id">
<el-input v-model="adminLog.id"></el-input>
</el-form-item>
<el-form-item label="用户编号:" prop="userId">
<el-input v-model="adminLog.userId"></el-input>
</el-form-item>
<el-form-item label="用户名:" prop="userName">
<el-input v-model="adminLog.userName"></el-input>
</el-form-item>
<el-form-item label="模块名:" prop="serviceName">
<el-input v-model="adminLog.serviceName"></el-input>
</el-form-item>
<el-form-item label="记录类名+方法名:" prop="method">
<el-input v-model="adminLog.method"></el-input>
</el-form-item>
<el-form-item label="描述:" prop="operationDesc">
<el-input v-model="adminLog.operationDesc"></el-input>
</el-form-item>
<el-form-item label="创建时间:" prop="createTime">
<el-input v-model="adminLog.createTime"></el-input>
</el-form-item>
<el-form-item label="IP:" prop="ip">
<el-input v-model="adminLog.ip"></el-input>
</el-form-item>
<el-form-item label="参数:" prop="params">
<el-input v-model="adminLog.params"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('adminLogFrom')">提交</el-button>
<el-button v-if="!isEdit" @click="resetForm('adminLogFrom')">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import {createAdminLog, getAdminLog, updateAdminLog} from '@/api/sys/adminLog'
import SingleUpload from '@/components/Upload/singleUpload'
import {formatDate} from '@/utils/date';
const defaultAdminLog={
name: ''
};
export default {
name: 'AdminLogDetail',
components:{SingleUpload},
props: {
isEdit: {
type: Boolean,
default: false
}
},
data() {
return {
adminLog:Object.assign({}, defaultAdminLog),
rules: {
name: [
{required: true, message: '请输入品牌名称', trigger: 'blur'},
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
],
logo: [
{required: true, message: '请输入品牌logo', trigger: 'blur'}
],
sort: [
{type: 'number', message: '排序必须为数字'}
],
}
}
},
created() {
if (this.isEdit) {
getAdminLog(this.$route.query.id).then(response => {
this.adminLog = response.data;
});
}else{
this.adminLog = Object.assign({},defaultAdminLog);
}
},
methods: {
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$confirm('是否提交数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.isEdit) {
updateAdminLog(this.$route.query.id, this.adminLog).then(response => {
if(response.code==200){
this.$refs[formName].resetFields();
this.$message({
message: '修改成功',
type: 'success',
duration:1000
});
this.$router.back();
}else{
this.$message({
message: response.msg,
type: 'error',
duration:1000
});
}
});
} else {
createAdminLog(this.adminLog).then(response => {
if(response.code==200){
this.$refs[formName].resetFields();
this.adminLog = Object.assign({},defaultAdminLog);
this.$message({
message: '提交成功',
type: 'success',
duration:1000
});
this.$router.back();
}else{
this.$message({
message: response.msg,
type: 'error',
duration:1000
});
}
});
}
});
} else {
this.$message({
message: '验证失败',
type: 'error',
duration:1000
});
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.adminLog = Object.assign({},defaultAdminLog);
}
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,231 @@
<template> 
<div class="app-container">
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="searchAdminLogList()"
type="primary"
size="small">
查询结果
</el-button>
</div>
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:">
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
</el-card>
<div class="table-container">
<el-table ref="adminLogTable"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
v-loading="listLoading"
border>
<el-table-column label="用户名" align="center">
<template slot-scope="scope">{{scope.row.userName}}</template>
</el-table-column>
<el-table-column label="接口类型" align="center">
<template slot-scope="scope">{{scope.row.serviceName}}</template>
</el-table-column>
<el-table-column label="接口" align="center">
<template slot-scope="scope">{{scope.row.method}}</template>
</el-table-column>
<el-table-column label="时长" align="center">
<template slot-scope="scope">{{scope.row.timeMin}}</template>
</el-table-column>
<el-table-column label="创建时间" align="center">
<template slot-scope="scope">{{scope.row.createTime|formatCreateTime}}</template>
</el-table-column>
<el-table-column label="IP" align="center">
<template slot-scope="scope">{{scope.row.ip}}</template>
</el-table-column>
<el-table-column label="参数数据显示xxxxxxxx" align="center">
<template slot-scope="scope">{{scope.row.params}}</template>
</el-table-column>
</el-table>
</div>
<div class="batch-operate-container">
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {fetchList, deleteAdminLog} from '@/api/sys/adminLog'
import {formatDate} from '@/utils/date';
export default {
name: 'adminLogList',
data() {
return {
operates: [
{
label: "显示品牌",
value: "showAdminLog"
},
{
label: "隐藏品牌",
value: "hideAdminLog"
}
],
operateType: null,
listQuery: {
keyword: null,
pageNum: 1,
pageSize: 10
},
list: null,
total: null,
listLoading: true,
multipleSelection: []
}
},
created() {
this.getList();
},
filters: {
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStatus(value) {
if (value === 1) {
return '未开始';
} else if (value === 2) {
return '活动中';
} else if (value === 3) {
return '已结束';
} else if (value === 4) {
return '已失效';
}
},
},
methods: {
getList() {
this.listLoading = true;
fetchList(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data.records;
this.total = response.data.total;
this.totalPage = response.data.pages;
this.pageSize = response.data.size;
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleUpdate(index, row) {
this.$router.push({path: '/sys/updateAdminLog', query: {id: row.id}})
},
handleDelete(index, row) {
this.$confirm('是否要删除该品牌', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteAdminLog(row.id).then(response => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1000
});
this.getList();
});
});
},
getProductList(index, row) {
console.log(index, row);
},
getProductCommentList(index, row) {
console.log(index, row);
},
handleSizeChange(val) {
this.listQuery.pageNum = 1;
this.listQuery.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.pageNum = val;
this.getList();
},
searchAdminLogList() {
this.listQuery.pageNum = 1;
this.getList();
},
handleBatchOperate() {
console.log(this.multipleSelection);
if (this.multipleSelection < 1) {
this.$message({
message: '请选择一条记录',
type: 'warning',
duration: 1000
});
return;
}
let showStatus = 0;
if (this.operateType === 'showAdminLog') {
showStatus = 1;
} else if (this.operateType === 'hideAdminLog') {
showStatus = 0;
} else {
this.$message({
message: '请选择批量操作类型',
type: 'warning',
duration: 1000
});
return;
}
let ids = [];
for (let i = 0; i < this.multipleSelection.length; i++) {
ids.push(this.multipleSelection[i].id);
}
let data = new URLSearchParams();
data.append("ids", ids);
data.append("showStatus", showStatus);
updateShowStatus(data).then(response => {
this.getList();
this.$message({
message: '修改成功',
type: 'success',
duration: 1000
});
});
},
addAdminLog() {
this.$router.push({path: '/build/add${className}'})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@@ -0,0 +1,14 @@
<template> 
<adminLog-detail :is-edit='true'></adminLog-detail>
</template>
<script>
import AdminLogDetail from './components/AdminLogDetail'
export default {
name: 'updateAdminLog',
components: { AdminLogDetail }
}
</script>
<style>
</style>