From 0f0d9178eb886612e2310514383d2b057779042b Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期二, 22 十月 2024 14:42:11 +0800 Subject: [PATCH] 日志管理 --- Source/plt-web/plt-web-ui/src/api/log/logBasic.js | 37 +++++ Source/plt-web/plt-web-ui/src/views/system/user/index.vue | 4 Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue | 2 Source/plt-web/plt-web-ui/src/views/log/basicConf.vue | 138 +++++++++++++++++++ Source/plt-web/plt-web-ui/src/views/log/index.vue | 171 ++++++++++++++++++++++++ Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue | 28 ---- 6 files changed, 348 insertions(+), 32 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/api/log/logBasic.js b/Source/plt-web/plt-web-ui/src/api/log/logBasic.js new file mode 100644 index 0000000..7125024 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/api/log/logBasic.js @@ -0,0 +1,37 @@ +import request from '@/router/axios'; + +// 鏃ュ織淇濆瓨鏈熼檺鏌ヨ +export function getPeroid(params) { + return request({ + url: "/api/loginBasicController/getPeroid", + method: "get", + params + }); +} +// 淇濆瓨鏈熼檺淇濆瓨 +export function savePeriod(params) { + return request({ + url: "/api/loginBasicController/savePeriod", + method: "post", + params: params + }); +} +export function deleteLog(params) { + return request({ + url: "/api/loginBasicController/deleteLog", + method: "delete", + params + }) +} + +export function getLogListByContion(page, limit, params) { + return request({ + url: "/api/loginBasicController/getLogListByContion", + method: "post", + data: { + 'pageNo':page, + 'pageSize':limit, + ...params + } + }); +} diff --git a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue index 9e71cbf..4c265d2 100644 --- a/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/authority/ui/uiAuthorization/index.vue @@ -274,7 +274,7 @@ roleId: this.nodeRow.oid, type: this.type, context: this.context, - selectTreeList: data + selectTreeList: selectTreeList } authorizedUI(formData).then(res => { if (res.data.success) { diff --git a/Source/plt-web/plt-web-ui/src/views/log/basicConf.vue b/Source/plt-web/plt-web-ui/src/views/log/basicConf.vue new file mode 100644 index 0000000..bf2c0e4 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/log/basicConf.vue @@ -0,0 +1,138 @@ +<template> + <!--鏃ュ織鍩虹閰嶇疆--> + <el-container> + <el-main> + <basic-container> + <div style="margin: 0 0 10px 20px"> + <el-button v-if="form.delType==0" icon="el-icon-check" size="small" type="primary" @click="saveHandler">淇濆瓨</el-button> + <el-button v-else icon="el-icon-delete" size="small" type="danger" @click="delHandler">鍒犻櫎</el-button> + </div> + <avue-form ref="form" v-model="form" :option="formOption"></avue-form> + <div class="tip"> + <div style="color: #D40000;margin-left: 0;">鏃ュ織鍩虹閰嶇疆璇存槑锛�</div> + <div>1銆佹棩蹇楀垹闄ゅ寘鍚墜鍔ㄥ垹闄ゅ拰鑷姩鍒犻櫎銆�</div> + <div>2銆佽嚜鍔ㄥ垹闄や細鏍规嵁鏃ュ織鐨勪繚瀛樻湡闄愭潵杩涜鏃ュ織鍒犻櫎銆�</div> + <div>3銆佹墜鍔ㄥ垹闄ゆ牴鎹�夊畾鐨勬椂闂存潵杩涜鏃ュ織鍒犻櫎銆�</div> + </div> + </basic-container> + </el-main> + + </el-container> +</template> + +<script> +import {getPeroid,savePeriod,deleteLog} from "@/api/log/logBasic"; +export default { + name: "basicConf", + data: function () { + return { + form:{ + period:'', + }, + periodData:[], + formOption:{ + submitBtn: false, + emptyBtn: false, + column: [{ + label: '鏃ュ織鍒犻櫎', + prop: 'delType', + span: 24, + labelWidth:120, + type: 'radio', + value: 0, + dicData: [ + { label: '鑷姩鍒犻櫎', value: 0 }, + { label: '鎵嬪姩鍒犻櫎', value: 1 }, + ] + }, { + label: '淇濆瓨鏃ユ湡', + prop: 'period', + type: 'select', + labelWidth:120, + dicData: this.periodData, + props:{ + label:'value', + value:'code' + }, + rules: [{ + required: true, + message: "璇烽�夋嫨淇濆瓨鏃ユ湡", + trigger: "blur" + }] + }, { + label: '璇烽�夋嫨鏃ユ湡', + prop: 'deleteDate', + type: 'date', + valueFormat:'yyyy-MM-dd', + labelWidth:120, + display: false, + rules: [{ + required: true, + message: "璇烽�夋嫨鏃ユ湡", + trigger: "blur" + }] + }] + }, + } + }, + created() { + this.getPeroid(); + }, + watch: { + 'form.delType': { + handler(newval) { + if (newval ==0) { + this.formOption.column[1].display=true; + this.formOption.column[2].display=false; + }else { + this.formOption.column[1].display=false; + this.formOption.column[2].display=true; + } + } + }, + }, + methods:{ + getPeroid:function (){ + getPeroid().then(res => { + this.$refs.form.updateDic('period', res.data.data); + this.periodData=res.data.data; + this.form.period=res.data.data.filter(item=>{ + return item.choose + })[0].code + }).catch(error => { + }) + }, + saveHandler:function (){ + savePeriod({'period':this.form.period}).then(res => { + if (res.data.success) { + this.$message.success('淇濆瓨鎴愬姛') + } + }); + }, + delHandler() { + this.$refs.form.validate((valid,done) => { + if(valid){ + deleteLog({'deleteDate':this.form.deleteDate}).then(res => { + if (res.data.success) { + this.$message.success('鍒犻櫎鎴愬姛') + } + }); + done() + } + }) + }, + } +} +</script> + +<style scoped> +.tip{ + font-size: 12px; + line-height: 24px; + color: #909399; + margin: 0 0 10px 20px; +} +.tip div{ + margin-left: 30px; +} +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/log/index.vue b/Source/plt-web/plt-web-ui/src/views/log/index.vue new file mode 100644 index 0000000..3e88d1d --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/views/log/index.vue @@ -0,0 +1,171 @@ +<template> + <basic-container> + <avue-crud + ref="userCrud" + :before-open="beforeOpen" + :data="tableData" + :option="option" + :page.sync="page" + :table-loading="tableLoading" + @on-load="getTableList" + @refresh-change="handleRefresh" + @search-change="handleSearch" + @search-reset="handleReset" + @size-change="sizeChange" + @current-change="currentChange" + @selection-change="selectChange" + @row-click="rowClickHandler" + @row-save="rowSaveHandler" + @row-update="rowUpdateHandler" + > + <!-- 閮ㄩ棬澶撮儴鎼滅储鎻掓Ы --> + <template slot-scope="{disabled,size}" slot="pkDepartmentNameSearch"> + <div style="display: flex;gap: 5px"> + <el-select v-model="departSearchValue" clearable placeholder="璇烽�夋嫨閮ㄩ棬"> + <el-option :label="departSearchObj.name" :value="departSearchObj.oid"></el-option> + </el-select> + <el-button size="small" type="success" @click="dialogDepartSearchHandler">閫夋嫨閮ㄩ棬</el-button> + </div> + </template> + + <template #menu="{row,index,size}"> + <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">瀵煎嚭</el-button> + </template> + + <template slot="menuLeft" slot-scope="scope"> + <el-button icon="el-icon-delete" plain size="small" type="danger" @click="allDelHandler">瀵煎嚭</el-button> + </template> + </avue-crud> + </basic-container> +</template> + +<script> +import basicOption from "@/util/basic-option"; +import {getLogListByContion} from "@/api/log/logBasic"; +import func from "@/util/func"; + +export default { +name: "index", + data: function () { + return { + tableLoading: false, + tableData: [], + option: { + ...basicOption, + editBtn: false, + delBtn: false, + calcHeight: -60, + column: [ + { + label: '鐢ㄦ埛鍚�', + prop: 'truename', + search:true, + sortable:true, + }, { + label: '濮撳悕', + prop: 'username', + search:true, + sortable:true, + },{ + label: '鐢ㄦ埛IP', + prop: 'userIp', + search:true, + sortable:true, + },{ + label: '妯″潡', + prop: 'moduleName', + search:true, + sortable:true, + },{ + label: '鎿嶄綔', + prop: 'type', + search:true, + sortable:true, + },{ + label: '鏃堕棿', + prop: 'startDate', + search:true, + sortable:true, + },{ + label: '鎿嶄綔缁撴灉', + prop: 'result', + search:true, + sortable:true, + },{ + label: '鎻忚堪', + prop: 'startDate', + search:true, + sortable:true, + }, + ] + }, + page: { + currentPage: 1, + pageSize: 50, + total: 0, + pageSizes: [10, 30, 50, 100], + }, + searchParams: {} + } + }, + methods: { + // 琛ㄦ牸璇锋眰 + getTableList() { + this.tableLoading = true; + getLogListByContion(this.page.currentPage, this.page.pageSize, this.searchParams).then(res => { + const data = res.data.data; + this.tableData = data; + this.page.total = res.data.total; + this.tableLoading = false; + }) + }, + + // 鎼滅储鏌ヨ + handleSearch(params, done) { + this.searchParams = {}; + if(this.departSearchObj && this.departSearchValue){ + this.searchParams['conditionMap["pkDepartment"]'] = this.departSearchValue; + } + + if (!func.isEmptyObject(params)) { + for (let key in params) { + if (params.hasOwnProperty(key)) { + // 鍒ゆ柇濡傛灉 key 鏄� 'pkPersonName'锛屽垯鏀逛负 'pkPerson' 鍒嗗埆涓烘樉绀哄�煎拰淇濆瓨鍊� + let newKey = key === 'pkPersonName' ? 'pkPerson' : key; + this.searchParams[`conditionMap["${newKey}"]`] = params[key]; + } + } + } + + if (func.isEmptyObject(params) && !this.departSearchValue) { + this.searchParams = {}; + } + + this.getTableList(); + done(); + }, + + // 閲嶇疆鎼滅储鏉′欢 + handleReset() { + this.departSearchObj = {}; + this.departSearchValue = ""; + this.searchParams = {}; + this.getTableList(); + }, + + // 鏉℃暟 + sizeChange(val) { + this.page.pageSize = val; + }, + + // 椤电爜 + currentChange(val) { + this.page.currentPage = val; + }, + } +} +</script> + +<style scoped> + +</style> diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue index 9c6c63e..873a1b4 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/Aciton/index.vue @@ -718,34 +718,6 @@ .el-scrollbar__wrap { overflow: auto !important; } - - .headerCon { - .el-button { - width: 82px; - } - } -} - -.headerCon { - display: flex; - flex-wrap: wrap; - margin-bottom: 5px; - - .el-button + .el-button { - margin-left: 5px; - } - - .el-button { - margin-top: 5px; - } -} - -.headerCon > .el-button:nth-child(4) { - margin-left: 0; -} - -.headerCon > .el-button:nth-child(7) { - margin-left: 0; } .smallBtn { diff --git a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue index ee786da..f51774b 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue @@ -238,9 +238,7 @@ this.tableData = data; this.page.total = res.data.total; this.tableLoading = false; - }).catch(err => { - this.$message.error(err) - }); + }) }, // 琛ㄦ牸鍙充晶鍒锋柊鍥炬爣 -- Gitblit v1.9.3