diff --git a/data/magic-api/api/系统管理/日志管理/操作日志.ms b/data/magic-api/api/系统管理/日志管理/操作日志.ms index ed0ca78..9303cf2 100644 --- a/data/magic-api/api/系统管理/日志管理/操作日志.ms +++ b/data/magic-api/api/系统管理/日志管理/操作日志.ms @@ -5,7 +5,7 @@ "groupId" : "9ec6f9ec92d24a369952bb13eddc134f", "name" : "操作日志", "createTime" : null, - "updateTime" : 1646552462421, + "updateTime" : 1649001507013, "lock" : "0", "createBy" : null, "updateBy" : null, @@ -252,7 +252,13 @@ ================================ return db.page(""" select sol.*,su.username from sys_oper_log sol left join sys_user su on sol.create_by = su.id where 1=1 + ?{userIp, and sol.user_ip like concat('%', #{userIp}, '%')} + ?{username, and su.username like concat('%', #{username}, '%')} + ?{apiName, and sol.api_name like concat('%', #{apiName}, '%')} + ?{apiPath, and sol.api_path like concat('%', #{apiPath}, '%')} ?{createDate && createDate.split(',')[0], and sol.create_date >= #{createDate.split(',')[0]}} ?{createDate && createDate.split(',')[1], and sol.create_date <= #{createDate.split(',')[1]}} + ?{costTime && costTime.split(',')[0], and sol.cost_time >= #{costTime.split(',')[0]}} + ?{costTime && costTime.split(',')[1], and sol.cost_time <= #{costTime.split(',')[1]}} order by create_date desc """) \ No newline at end of file diff --git a/magic-boot-ui/package.json b/magic-boot-ui/package.json index 3aa5e0c..ddfeeba 100644 --- a/magic-boot-ui/package.json +++ b/magic-boot-ui/package.json @@ -16,7 +16,8 @@ "vue-cropper": "^1.0.2", "vue-router": "^4.0.0-0", "vue3-treeselect": "^0.1.10", - "vuedraggable": "^4.1.0" + "vuedraggable": "^4.1.0", + "xlsx": "^0.18.3" }, "devDependencies": { "@vitejs/plugin-vue": "^2.2.0", diff --git a/magic-boot-ui/src/assets/css/common.css b/magic-boot-ui/src/assets/css/common.css index f51696f..f78e207 100644 --- a/magic-boot-ui/src/assets/css/common.css +++ b/magic-boot-ui/src/assets/css/common.css @@ -52,10 +52,12 @@ body{ .toolbar-container{ margin-bottom: 10px } -.toolbar-container > div{ +.toolbar-container > div, +.toolbar-container > button{ margin-left: 12px; } -.toolbar-container > div:nth-child(1){ +.toolbar-container > div:nth-child(1), +.toolbar-container > button:nth-child(1){ margin-left: 0px; } .clear{ diff --git a/magic-boot-ui/src/components/magic/basic/mb-search.vue b/magic-boot-ui/src/components/magic/basic/mb-search.vue index d9e051f..73b885c 100644 --- a/magic-boot-ui/src/components/magic/basic/mb-search.vue +++ b/magic-boot-ui/src/components/magic/basic/mb-search.vue @@ -17,6 +17,9 @@ :placeholder="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'" > + + + @@ -27,8 +30,6 @@ 清空 - - @@ -67,7 +68,7 @@ function input(input){ function search(){ for(var key in props.where){ if(props.where[key] instanceof Object){ - if(props.where[key].type && props.where[key].type.startsWith('date') && props.where[key].value instanceof Array){ + if(props.where[key].type && props.where[key].type.startsWith('date') && props.where[key].value instanceof Array && props.where[key].value.join(',')){ props.where[key].value = props.where[key].value.join(',') } } @@ -76,7 +77,7 @@ function search(){ emit('search') for(var key in props.where){ if(props.where[key] instanceof Object){ - if(props.where[key].type && props.where[key].type.startsWith('date')){ + if(props.where[key].type && props.where[key].type.startsWith('date') && props.where[key].value){ props.where[key].value = props.where[key].value.split(',') } } diff --git a/magic-boot-ui/src/components/magic/basic/mb-table.vue b/magic-boot-ui/src/components/magic/basic/mb-table.vue index 95b5a3e..f4d2813 100644 --- a/magic-boot-ui/src/components/magic/basic/mb-table.vue +++ b/magic-boot-ui/src/components/magic/basic/mb-table.vue @@ -38,7 +38,7 @@ diff --git a/magic-boot-ui/src/components/magic/form/mb-inputrange.vue b/magic-boot-ui/src/components/magic/form/mb-inputrange.vue new file mode 100644 index 0000000..b355aed --- /dev/null +++ b/magic-boot-ui/src/components/magic/form/mb-inputrange.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/magic-boot-ui/src/components/magic/form/mb-upload-file.vue b/magic-boot-ui/src/components/magic/form/mb-upload-file.vue index 027a9d2..306eb2b 100644 --- a/magic-boot-ui/src/components/magic/form/mb-upload-file.vue +++ b/magic-boot-ui/src/components/magic/form/mb-upload-file.vue @@ -16,7 +16,7 @@ :before-upload="beforeAvatarUpload" :on-success="handleAvatarSuccess" > - {{ label }} + {{ label }}
支持上传{{ getSettingSuffixs().replaceAll(',', ',') }}文件,且不超过{{ maxFileSize }}MB
diff --git a/magic-boot-ui/src/icons/database.svg b/magic-boot-ui/src/icons/database.svg index c46913f..a8b8942 100644 --- a/magic-boot-ui/src/icons/database.svg +++ b/magic-boot-ui/src/icons/database.svg @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/interface.svg b/magic-boot-ui/src/icons/interface.svg index 182c616..39fc373 100644 --- a/magic-boot-ui/src/icons/interface.svg +++ b/magic-boot-ui/src/icons/interface.svg @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/login-log.svg b/magic-boot-ui/src/icons/login-log.svg index 4a669d5..ec896a9 100644 --- a/magic-boot-ui/src/icons/login-log.svg +++ b/magic-boot-ui/src/icons/login-log.svg @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/oper-log.svg b/magic-boot-ui/src/icons/oper-log.svg index 57a884c..5a2db7c 100644 --- a/magic-boot-ui/src/icons/oper-log.svg +++ b/magic-boot-ui/src/icons/oper-log.svg @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/verification-code.svg b/magic-boot-ui/src/icons/verification-code.svg index b0ae608..a105f8e 100644 --- a/magic-boot-ui/src/icons/verification-code.svg +++ b/magic-boot-ui/src/icons/verification-code.svg @@ -1 +1,2 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/magic-boot-ui/src/layout/layout.vue b/magic-boot-ui/src/layout/layout.vue index c9fcf13..aa4126c 100644 --- a/magic-boot-ui/src/layout/layout.vue +++ b/magic-boot-ui/src/layout/layout.vue @@ -116,5 +116,6 @@ import { logout } from '@/scripts/auth' background-color: white; height: 100%; overflow: auto; + position: relative; } diff --git a/magic-boot-ui/src/scripts/common.js b/magic-boot-ui/src/scripts/common.js index 38d0f5c..1a3bfda 100644 --- a/magic-boot-ui/src/scripts/common.js +++ b/magic-boot-ui/src/scripts/common.js @@ -1,6 +1,7 @@ import request from '@/scripts/request' import { ElMessageBox, ElNotification } from 'element-plus' import global from '@/scripts/global' +import { utils, writeFile } from 'xlsx' const common = {} @@ -175,4 +176,12 @@ common.isComma = (value) => { return value.toString().indexOf(',') !== -1 } +common.exportExcel = (options) => { + options.suffix = options.suffix || 'xlsx' + const workBook = utils.json_to_sheet(options.data); + const wb = utils.book_new() + utils.book_append_sheet(wb, workBook, 'sheet1'); + writeFile(wb, `${options.fileName}.${options.suffix || 'xlsx'}`); +} + export default common diff --git a/magic-boot-ui/src/views/login.vue b/magic-boot-ui/src/views/login.vue index e675d3c..64d521c 100644 --- a/magic-boot-ui/src/views/login.vue +++ b/magic-boot-ui/src/views/login.vue @@ -5,16 +5,16 @@
{{ $global.title }}
{{ error }}
- +
- +
- +
@@ -208,6 +208,9 @@ label { .magic-login-box .magic-input:focus{ border-color:#0784de; } +.magic-login-box .magic-input:focus + svg{ + fill: #0784de; +} .magic-login-box .magic-button{ width: 100%; height: 50px; diff --git a/magic-boot-ui/src/views/lowcode/magic-editor.vue b/magic-boot-ui/src/views/lowcode/magic-editor.vue index d53e4dd..df96158 100644 --- a/magic-boot-ui/src/views/lowcode/magic-editor.vue +++ b/magic-boot-ui/src/views/lowcode/magic-editor.vue @@ -1,3 +1,13 @@ + + diff --git a/magic-boot-ui/src/views/system/monitor/oper-log.vue b/magic-boot-ui/src/views/system/monitor/oper-log.vue index 2988afa..8819377 100644 --- a/magic-boot-ui/src/views/system/monitor/oper-log.vue +++ b/magic-boot-ui/src/views/system/monitor/oper-log.vue @@ -1,6 +1,12 @@ @@ -11,10 +17,25 @@ const tableOptions = reactive({ url: '/system/log/oper/list', where: { + userIp: { + label: 'IP' + }, + username: { + label: '操作人' + }, + apiName: { + label: '接口名' + }, + apiPath: { + label: '路径' + }, + costTime: { + label: '耗时区间', + type: 'inputrange' + }, createDate: { type: 'datetimerange', - label: '创建时间', - value: '' + label: '创建时间' } }, cols: [ diff --git a/magic-boot-ui/src/views/system/user/user-list.vue b/magic-boot-ui/src/views/system/user/user-list.vue index 5e80f69..08899c0 100644 --- a/magic-boot-ui/src/views/system/user/user-list.vue +++ b/magic-boot-ui/src/views/system/user/user-list.vue @@ -28,7 +28,7 @@ @@ -163,6 +163,9 @@ const tableOptions = reactive({ field: 'isLogin', label: '禁止登录', type: 'switch', + exportTemplet: (row) => { + return row.isLogin == 1 ? '已禁用' : '未禁用' + }, width: 100, if: (row) => { return row.id != '1' @@ -259,13 +262,4 @@ function handleUpdate(row) { }) } -function handleDownload() { - proxy.$common.exportExcel({ - url: tableOptions.url, - headers: ['登录名称', '姓名'], - columns: ['username', 'name'], - where: tableOptions.where - }) -} -