From 4470052c3b6bdeb18e45987f8aa293d1e93d0552 Mon Sep 17 00:00:00 2001
From: Ludc <2870569285@qq.com>
Date: 星期二, 18 十一月 2025 11:59:12 +0800
Subject: [PATCH] 所有文件上传接口增加文件安全校验逻辑。
---
Source/UBCS-WEB/src/views/monitor/log/operateLog.vue | 377 ++++++++++++++++++++++++++++++++---------------------
1 files changed, 227 insertions(+), 150 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue b/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue
index 0a8653f..ccf7420 100644
--- a/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue
+++ b/Source/UBCS-WEB/src/views/monitor/log/operateLog.vue
@@ -1,176 +1,253 @@
<template>
<basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- ref="crud"
+ <avue-crud ref="crud"
v-model="form"
- :permission="permissionList"
- :page.sync="page"
:before-open="beforeOpen"
+ :data="data"
+ :option="option"
+ :page.sync="page"
+ :permission="permissionList"
+ :table-loading="loading"
@search-change="searchChange"
@search-reset="searchReset"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad">
- <template slot="description" slot-scope="scope">
- <avue-text-ellipsis :text="scope.row.description" :height="50">
- <small slot="more">...</small>
- </avue-text-ellipsis>
- </template>
+ <template slot="description" slot-scope="scope">
+ <avue-text-ellipsis :height="50" :text="scope.row.description">
+ <small slot="more">...</small>
+ </avue-text-ellipsis>
+ </template>
+ <template slot="menuLeft">
+ <span style="width: 200px;display: inline-block">
+ <el-select slot="prepend" v-model="searchSelect" placeholder="璇烽�夋嫨" size="small">
+ <el-option v-for="item in searchData" :key="item.prop" :label="item.label" :value="item.prop"
+ ></el-option>
+ </el-select>
+ </span>
+ <span style="margin-left: 5px">
+ <el-input v-model="searchValue" class="attrSearch" clearable placeholder="璇疯緭鍏ュ唴瀹�"
+ prefix-icon="el-icon-search"
+ size="small" type="text"></el-input>
+ <el-button icon="el-icon-search" plain size="small" type="primary"
+ @click="searchHandler"> 鎼滅储</el-button>
+ </span>
+ </template>
+ <template slot="menu" slot-scope="scope">
+ <el-button type="text" icon="el-icon-view" size="mini" @click="rowView(scope.row)">鏌ョ湅</el-button>
+ </template>
</avue-crud>
</basic-container>
</template>
<script>
- import { listLogOperate } from "@/api/logs";
- import {mapGetters} from "vuex";
+import {listLogOperate,detailByOid} from "@/api/logs";
+import {mapGetters} from "vuex";
- export default {
- data() {
+export default {
+ data() {
+ return {
+ searchSelect: "userName",
+ searchValue: '',
+ searchData: [
+ {
+ label: "鐢ㄦ埛鍚�",
+ prop: "userName",
+ align: "left",
+ display: false,
+ width: 200,
+ required: true
+ }, {
+ label: "濮撳悕",
+ prop: "realName",
+ align: "left",
+ display: false
+ },
+ {
+ label: "鐢ㄦ埛ip",
+ prop: "ip",
+ },
+ {
+ label: "妯″潡",
+ prop: "model",
+
+ },
+ {
+ label: "鏃堕棿",
+ prop: "time",
+
+ },
+ {
+ label: "鎿嶄綔缁撴灉",
+ prop: "operateResult",
+
+ },
+ {
+ label: "鎻忚堪",
+ prop: "description",
+ span: 24,
+ minRows: 20,
+ },
+ ],
+ form: {},
+ selectionList: [],
+ query: {},
+ //鏄惁鏄笁鍛樼鐞嗗憳鏃ュ織
+ isAdmin: '',
+ // LoginOrLogout:鐧诲綍鏃ュ織,grant:鎺堟潈鏃ュ織,operate:鎿嶄綔鏃ュ織
+ logType: '',
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0
+ },
+ option: {
+ height: 'auto',
+ calcHeight: 20,
+ columnBtn: false,
+ tip: false,
+ searchShow: false,
+ searchMenuSpan: 6,
+ border: true,
+ index: true,
+ viewBtn: false,
+ editBtn: false,
+ addBtn: false,
+ delBtn: false,
+ menuWidth: 120,
+ dialogType: 'drawer',
+ column: [
+ {
+ label: "鐢ㄦ埛鍚�",
+ prop: "userName",
+ search: true,
+ width: '120'
+ },
+ {
+ label: "濮撳悕",
+ prop: "realName",
+ search: true,
+ width: '120'
+ },
+ {
+ label: "鐢ㄦ埛ip",
+ prop: "ip",
+ },
+ {
+ label: "妯″潡",
+ prop: "model",
+
+ },
+ {
+ label: "鏃堕棿",
+ prop: "time",
+
+ },
+ {
+ label: "鎿嶄綔缁撴灉",
+ prop: "operateResult",
+
+ },
+ {
+ label: "鎻忚堪",
+ prop: "description",
+ span: 24,
+ minRows: 20,
+ type: "textarea",
+ hide: true,
+ slot: true,
+ },
+ ]
+ },
+ data: []
+ };
+ },
+ computed: {
+ ...mapGetters(["permission"]),
+ permissionList() {
return {
- form: {},
- selectionList: [],
- query: {},
- //鏄惁鏄笁鍛樼鐞嗗憳鏃ュ織
- isAdmin: '',
- // LoginOrLogout:鐧诲綍鏃ュ織,grant:鎺堟潈鏃ュ織,operate:鎿嶄綔鏃ュ織
- logType: '',
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- option: {
- height: 'auto',
- calcHeight: 30,
- columnBtn:false,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: true,
- editBtn: false,
- addBtn: false,
- delBtn: false,
- menuWidth: 120,
- dialogType: 'drawer',
- column: [
- {
- label: "鐢ㄦ埛鍚�",
- prop: "userName",
- search: true,
- width:'100'
- },
- {
- label: "濮撳悕",
- prop: "realName",
- search: true,
- width:'100'
- },
- {
- label: "鐢ㄦ埛ip",
- prop: "ip",
- width:'100'
- },
- {
- label: "妯″潡",
- prop: "model",
- width:'140'
- },
- {
- label: "鏃堕棿",
- prop: "time",
- width:'160'
- },
- {
- label: "鎿嶄綔缁撴灉",
- prop: "operateResult",
- width:'100'
- },
- {
- label: "鎻忚堪",
- prop: "description",
- span: 24,
- minRows: 20,
- type: "textarea",
- slot: true,
- },
- ]
- },
- data: []
+ viewBtn: this.vaildData(this.permission.log_usual.log_usual_view, false)
};
},
- computed: {
- ...mapGetters(["permission"]),
- permissionList() {
- return {
- viewBtn: this.vaildData(this.permission.log_usual.log_usual_view, false)
- };
- },
- },
- created() {
- this.getRouteParam()
- },
- methods: {
- //鑾峰彇鏁版嵁
- getRouteParam() {
- const logType = this.$route.query.log_type; // 鑾峰彇log_type鍙傛暟鐨勫��
- const result = logType.substring(0, logType.indexOf(':')); // 鎴彇浠�0鍒癅涔嬮棿鐨勫瓙瀛楃涓�
- const isAdmin = logType.substring(logType.indexOf(':')+1, logType.indexOf('@')); // 浠嶡涔嬪悗鎴彇鍒版湯灏剧殑瀛愬瓧绗︿覆
- this.logType = result;
- this.isAdmin = isAdmin;
- //console.log(this.logType)
- //console.log(this.isAdmin)
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- underscoreName(key) {
- return key.replace(/([A-Z])/g, "_$1").toLowerCase();
- },
- currentChange(currentPage){
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize){
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- let conditionMaps = {};
- conditionMaps["conditionMap[is_admin]"] = this.isAdmin;
- conditionMaps["conditionMap[log_type]"] = this.logType.trim();
- if (params) {
- Object.keys(params).forEach((key) => {
- conditionMaps["conditionMap[" + this.underscoreName(key) + "_like]"] = params[key].trim();
- });
+ },
+ created() {
+ this.getRouteParam()
+ },
+ methods: {
+ rowView(row){
+ this.loading = true;
+ detailByOid({oid:row.oid}).then(res =>{
+ if(res.data.data){
+ this.loading = false
+ this.$refs.crud.rowView(res.data.data)
}
- this.loading = true;
- listLogOperate(
- page.currentPage,
- page.pageSize,
- conditionMaps
- ).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
+ })
+ },
+ searchHandler() {
+
+ let params = {
+ [this.searchSelect]: this.searchValue
+ };
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ },
+ //鑾峰彇鏁版嵁
+ getRouteParam() {
+ const logType = this.$route.query.log_type; // 鑾峰彇log_type鍙傛暟鐨勫��
+ const result = logType.substring(0, logType.indexOf(':')); // 鎴彇浠�0鍒癅涔嬮棿鐨勫瓙瀛楃涓�
+ const isAdmin = logType.substring(logType.indexOf(':') + 1, logType.indexOf('@')); // 浠嶡涔嬪悗鎴彇鍒版湯灏剧殑瀛愬瓧绗︿覆
+ this.logType = result;
+ this.isAdmin = isAdmin;
+ //console.log(this.logType)
+ //console.log(this.isAdmin)
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ underscoreName(key) {
+ return key.replace(/([A-Z])/g, "_$1").toLowerCase();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ let conditionMaps = {};
+ conditionMaps["conditionMap[is_admin]"] = this.isAdmin;
+ conditionMaps["conditionMap[log_type]"] = this.logType.trim();
+ if (params) {
+ Object.keys(params).forEach((key) => {
+ conditionMaps["conditionMap[" + this.underscoreName(key) + "_like]"] = params[key].trim();
});
}
+ this.loading = true;
+ listLogOperate(
+ page.currentPage,
+ page.pageSize,
+ conditionMaps
+ ).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ this.loading = false;
+ });
}
- };
+ }
+};
</script>
<style>
--
Gitblit v1.9.3