dedsudiyu 1 yıl önce
ebeveyn
işleme
ee3277c683

+ 2 - 1
src/main.js

@@ -20,7 +20,7 @@ import './assets/icons' // icon
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, spaceJudgment, spaceJudgmentHTML, isNum, urlJudge } from "@/utils/ruoyi";
+import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree, spaceJudgment, spaceJudgmentHTML, isNum, urlJudge, clickCopy } from "@/utils/ruoyi";
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件
 import RightToolbar from "@/components/RightToolbar"
@@ -66,6 +66,7 @@ Vue.prototype.spaceJudgment = spaceJudgment
 Vue.prototype.spaceJudgmentHTML = spaceJudgmentHTML
 Vue.prototype.isNum = isNum
 Vue.prototype.urlJudge = urlJudge
+Vue.prototype.clickCopy = clickCopy
 Vue.prototype.judgmentNetworkReturnAddress = judgmentNetworkReturnAddress
 
 Vue.prototype.msgSuccess = function (msg) {

+ 20 - 0
src/utils/ruoyi.js

@@ -317,3 +317,23 @@ export function urlJudge(url) {
 export function versionField() {
   return process.env.VUE_APP_VERSION_DIFFERENCE_FIELD
 }
+
+/**
+ * 点击复制文本
+ */
+export function clickCopy(context,name) {
+  // 创建输入框元素
+  let oInput = document.createElement('input');
+  // 将想要复制的值
+  oInput.value = context;
+  // 页面底部追加输入框
+  document.body.appendChild(oInput);
+  // 选中输入框
+  oInput.select();
+  // 执行浏览器复制命令
+  document.execCommand('Copy');
+  // 弹出复制成功信息
+  this.msgSuccess(name?name+'复制成功':'复制成功');
+  // 复制后移除输入框
+  oInput.remove();
+}

+ 17 - 8
src/views/comprehensive/system/operlog/index.vue

@@ -59,21 +59,30 @@
     </el-form>
 
     <el-table ref="tables" border v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
-      <el-table-column label="操作人员" align="left" prop="operName"/>
-      <el-table-column label="操作内容" align="left" prop="businessType" :formatter="typeFormat"/>
-      <el-table-column label="操作模块" align="left" prop="title" />
-      <el-table-column label="操作页面" align="left" prop="title" />
-      <el-table-column label="登录IP" align="left" prop="operIp"/>
-      <el-table-column label="操作日期" align="left" prop="operTime">
+      <el-table-column label="主题" align="left" prop="title" width="200"  show-overflow-tooltip/>
+      <el-table-column label="类型" align="left" prop="businessType" width="80" :formatter="typeFormat"  show-overflow-tooltip/>
+      <el-table-column label="接口地址" align="left" prop="operUrl" width="200" show-overflow-tooltip>
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.operTime) }}</span>
+          <p @click="clickCopy(scope.row.operUrl,'接口地址')" style="cursor:pointer;">{{scope.row.operUrl}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="ip" align="left" prop="operIp" width="120" show-overflow-tooltip/>
+      <el-table-column label="参数" align="left" prop="operParam" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <p @click="clickCopy(scope.row.operParam,'参数')" style="cursor:pointer;">{{scope.row.operParam}}</p>
         </template>
       </el-table-column>
-      <el-table-column label="状态" align="left" prop="status">
+      <el-table-column label="状态" align="left" prop="status" width="80" show-overflow-tooltip>
         <template slot-scope="scope">
           {{scope.row.status==0?'正常':'异常'}}
         </template>
       </el-table-column>
+      <el-table-column label="操作人" align="left" prop="operName" width="140" show-overflow-tooltip/>
+      <el-table-column label="操作日期" align="left" prop="operTime" width="180" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.operTime) }}</span>
+        </template>
+      </el-table-column>
     </el-table>
 
     <pagination :page-sizes="[20, 30, 40, 50]"