From a8c1d02ee14a3aa01dc02f496a9e4a61b6abdf99 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 17 六月 2021 18:15:34 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev
---
ruoyi-ui/src/permission.js | 1
ruoyi-ui/src/components/Pagination/index.vue | 6 ++
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java | 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java | 4
ruoyi-ui/src/settings.js | 7 +
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java | 14 ++++
ruoyi-ui/src/App.vue | 10 +++
ruoyi-ui/vue.config.js | 3
ruoyi-ui/src/layout/components/Settings/index.vue | 19 ++++++
ruoyi-ui/src/views/system/user/index.vue | 2
pom.xml | 2
ruoyi-ui/src/assets/styles/ruoyi.scss | 9 +++
ruoyi-ui/src/views/monitor/operlog/index.vue | 19 ++++-
ruoyi-ui/src/store/modules/settings.js | 11 +++
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java | 2
ruoyi-ui/.env.production | 3 +
ruoyi-ui/.env.staging | 3 +
ruoyi-ui/package.json | 3
ruoyi-ui/.env.development | 3 +
ruoyi-ui/src/main.js | 3 +
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java | 5 +
ruoyi-ui/src/layout/components/Sidebar/Logo.vue | 4
ruoyi-ui/src/views/monitor/logininfor/index.vue | 19 ++++-
23 files changed, 125 insertions(+), 29 deletions(-)
diff --git a/pom.xml b/pom.xml
index e0f42f5..967354c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<spring-boot.version>2.3.11.RELEASE</spring-boot.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <java.version>11</java.version>
+ <java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.6</druid.version>
<knife4j.version>3.0.2</knife4j.version>
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
index 137969a..a871178 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
@@ -128,6 +128,11 @@
public static final String RESOURCE_PREFIX = "/profile";
/**
+ * RMI 杩滅▼鏂规硶璋冪敤
+ */
+ public static final String LOOKUP_RMI = "rmi://";
+
+ /**
* 璧勬簮鏄犲皠璺緞 鍓嶇紑
*/
public static final String REDIS_LOCK_KEY = "redis_lock:";
diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
index d67ef79..619bab4 100644
--- a/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
+++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
@@ -443,7 +443,7 @@
/**
* 鑾峰彇浠g爜鐢熸垚鍦板潃
*
- * @param table 涓氬姟琛ㄤ俊鎭�
+ * @param table 涓氬姟琛ㄤ俊鎭�
* @param template 妯℃澘鏂囦欢璺緞
* @return 鐢熸垚鍦板潃
*/
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
index 4289d32..97be717 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
@@ -1,12 +1,14 @@
package com.ruoyi.quartz.controller;
import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.job.TaskException;
import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.service.ISysJobService;
@@ -73,7 +75,11 @@
{
if (!CronUtils.isValid(sysJob.getCronExpression()))
{
- return AjaxResult.error("cron琛ㄨ揪寮忎笉姝g‘");
+ return AjaxResult.error("鏂板浠诲姟'" + sysJob.getJobName() + "'澶辫触锛孋ron琛ㄨ揪寮忎笉姝g‘");
+ }
+ else if (StringUtils.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
+ {
+ return AjaxResult.error("鏂板浠诲姟'" + sysJob.getJobName() + "'澶辫触锛岀洰鏍囧瓧绗︿覆涓嶅厑璁�'rmi://'璋冪敤");
}
sysJob.setCreateBy(SecurityUtils.getUsername());
return toAjax(jobService.insertJob(sysJob));
@@ -89,7 +95,11 @@
{
if (!CronUtils.isValid(sysJob.getCronExpression()))
{
- return AjaxResult.error("cron琛ㄨ揪寮忎笉姝g‘");
+ return AjaxResult.error("淇敼浠诲姟'" + sysJob.getJobName() + "'澶辫触锛孋ron琛ㄨ揪寮忎笉姝g‘");
+ }
+ else if (StringUtils.containsIgnoreCase(sysJob.getInvokeTarget(), Constants.LOOKUP_RMI))
+ {
+ return AjaxResult.error("淇敼浠诲姟'" + sysJob.getJobName() + "'澶辫触锛岀洰鏍囧瓧绗︿覆涓嶅厑璁�'rmi://'璋冪敤");
}
sysJob.setUpdateBy(SecurityUtils.getUsername());
return toAjax(jobService.updateJob(sysJob));
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
index 54fe261..f1df4f3 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -24,7 +24,7 @@
/**
* 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戜俊鎭�
*
- * @param roleId 瑙掕壊ID
+ * @param roleId 瑙掕壊ID
* @param deptCheckStrictly 閮ㄩ棬鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀�
* @return 閫変腑閮ㄩ棬鍒楄〃
*/
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
index 7cdda23..3bba548 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
@@ -208,7 +208,7 @@
int result = baseMapper.updateById(dept);
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) {
// 濡傛灉璇ラ儴闂ㄦ槸鍚敤鐘舵�侊紝鍒欏惎鐢ㄨ閮ㄩ棬鐨勬墍鏈変笂绾ч儴闂�
- updateParentDeptStatus(dept);
+ updateParentDeptStatusNormal(dept);
}
return result;
}
@@ -233,7 +233,7 @@
/**
* 淇敼瀛愬厓绱犲叧绯�
*
- * @param deptId 琚慨鏀圭殑閮ㄩ棬ID
+ * @param deptId 琚慨鏀圭殑閮ㄩ棬ID
* @param newAncestors 鏂扮殑鐖禝D闆嗗悎
* @param oldAncestors 鏃х殑鐖禝D闆嗗悎
*/
diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development
index 28b97c7..302ecd1 100644
--- a/ruoyi-ui/.env.development
+++ b/ruoyi-ui/.env.development
@@ -1,3 +1,6 @@
+# 椤甸潰鏍囬
+VUE_APP_TITLE = 鑻ヤ緷绠$悊绯荤粺
+
# 寮�鍙戠幆澧冮厤缃�
ENV = 'development'
diff --git a/ruoyi-ui/.env.production b/ruoyi-ui/.env.production
index 27c717e..b4893b0 100644
--- a/ruoyi-ui/.env.production
+++ b/ruoyi-ui/.env.production
@@ -1,3 +1,6 @@
+# 椤甸潰鏍囬
+VUE_APP_TITLE = 鑻ヤ緷绠$悊绯荤粺
+
# 鐢熶骇鐜閰嶇疆
ENV = 'production'
diff --git a/ruoyi-ui/.env.staging b/ruoyi-ui/.env.staging
index 6195736..361859f 100644
--- a/ruoyi-ui/.env.staging
+++ b/ruoyi-ui/.env.staging
@@ -1,3 +1,6 @@
+# 椤甸潰鏍囬
+VUE_APP_TITLE = 鑻ヤ緷绠$悊绯荤粺
+
NODE_ENV = production
# 娴嬭瘯鐜閰嶇疆
diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json
index d90fdba..48009be 100644
--- a/ruoyi-ui/package.json
+++ b/ruoyi-ui/package.json
@@ -41,7 +41,7 @@
"clipboard": "2.0.6",
"core-js": "3.8.1",
"echarts": "4.9.0",
- "element-ui": "2.15.0",
+ "element-ui": "2.15.2",
"file-saver": "2.0.4",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
@@ -55,6 +55,7 @@
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
+ "vue-meta": "^2.4.0",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",
"vuex": "3.6.0"
diff --git a/ruoyi-ui/src/App.vue b/ruoyi-ui/src/App.vue
index e448b11..391d951 100644
--- a/ruoyi-ui/src/App.vue
+++ b/ruoyi-ui/src/App.vue
@@ -6,6 +6,14 @@
<script>
export default {
- name: 'App'
+ name: 'App',
+ metaInfo() {
+ return {
+ title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
+ titleTemplate: title => {
+ return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
+ }
+ }
+ }
}
</script>
diff --git a/ruoyi-ui/src/assets/styles/ruoyi.scss b/ruoyi-ui/src/assets/styles/ruoyi.scss
index de1db7f..dee6d09 100644
--- a/ruoyi-ui/src/assets/styles/ruoyi.scss
+++ b/ruoyi-ui/src/assets/styles/ruoyi.scss
@@ -105,6 +105,15 @@
position: absolute;
}
+@media ( max-width : 768px) {
+ .pagination-container .el-pagination > .el-pagination__jump {
+ display: none !important;
+ }
+ .pagination-container .el-pagination > .el-pagination__sizes {
+ display: none !important;
+ }
+}
+
.el-table .fixed-width .el-button--mini {
padding-left: 0;
padding-right: 0;
diff --git a/ruoyi-ui/src/components/Pagination/index.vue b/ruoyi-ui/src/components/Pagination/index.vue
index c815e13..5e5d890 100644
--- a/ruoyi-ui/src/components/Pagination/index.vue
+++ b/ruoyi-ui/src/components/Pagination/index.vue
@@ -6,6 +6,7 @@
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
+ :pager-count="pagerCount"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@@ -38,6 +39,11 @@
return [10, 20, 30, 50]
}
},
+ // 绉诲姩绔〉鐮佹寜閽殑鏁伴噺绔粯璁ゅ��5
+ pagerCount: {
+ type: Number,
+ default: document.body.clientWidth < 992 ? 5 : 7
+ },
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue
index 3895199..a96b73f 100644
--- a/ruoyi-ui/src/layout/components/Settings/index.vue
+++ b/ruoyi-ui/src/layout/components/Settings/index.vue
@@ -41,7 +41,7 @@
<el-divider/>
<h3 class="drawer-title">绯荤粺甯冨眬閰嶇疆</h3>
-
+
<div class="drawer-item">
<span>寮�鍚� TopNav</span>
<el-switch v-model="topNav" class="drawer-switch" />
@@ -60,6 +60,11 @@
<div class="drawer-item">
<span>鏄剧ず Logo</span>
<el-switch v-model="sidebarLogo" class="drawer-switch" />
+ </div>
+
+ <div class="drawer-item">
+ <span>鍔ㄦ�佹爣棰�</span>
+ <el-switch v-model="dynamicTitle" class="drawer-switch" />
</div>
<el-divider/>
@@ -129,6 +134,17 @@
})
}
},
+ dynamicTitle: {
+ get() {
+ return this.$store.state.settings.dynamicTitle
+ },
+ set(val) {
+ this.$store.dispatch('settings/changeSetting', {
+ key: 'dynamicTitle',
+ value: val
+ })
+ }
+ },
},
methods: {
themeChange(val) {
@@ -160,6 +176,7 @@
"tagsView":${this.tagsView},
"fixedHeader":${this.fixedHeader},
"sidebarLogo":${this.sidebarLogo},
+ "dynamicTitle":${this.dynamicTitle},
"sideTheme":"${this.sideTheme}",
"theme":"${this.theme}"
}`
diff --git a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue
index 4c26fd3..0de00ce 100644
--- a/ruoyi-ui/src/layout/components/Sidebar/Logo.vue
+++ b/ruoyi-ui/src/layout/components/Sidebar/Logo.vue
@@ -2,11 +2,11 @@
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
- <img v-if="logo" :src="logo" class="sidebar-logo">
+ <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
- <img v-if="logo" :src="logo" class="sidebar-logo">
+ <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.sidebarTitle : variables.sidebarLightTitle }">{{ title }} </h1>
</router-link>
</transition>
diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js
index 5668d91..7d0ac8d 100644
--- a/ruoyi-ui/src/main.js
+++ b/ruoyi-ui/src/main.js
@@ -20,6 +20,8 @@
import Pagination from "@/components/Pagination";
// 鑷畾涔夎〃鏍煎伐鍏锋墿灞�
import RightToolbar from "@/components/RightToolbar"
+// 澶撮儴鏍囩鎻掍欢
+import VueMeta from 'vue-meta'
// 鍏ㄥ眬鏂规硶鎸傝浇
Vue.prototype.getDicts = getDicts
@@ -49,6 +51,7 @@
Vue.component('RightToolbar', RightToolbar)
Vue.use(permission)
+Vue.use(VueMeta)
/**
* If you don't want to use mock-server
diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js
index 5632e7d..7e770d4 100644
--- a/ruoyi-ui/src/permission.js
+++ b/ruoyi-ui/src/permission.js
@@ -12,6 +12,7 @@
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
+ to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/
if (to.path === '/login') {
next({ path: '/' })
diff --git a/ruoyi-ui/src/settings.js b/ruoyi-ui/src/settings.js
index 5d177b2..6a0b09f 100644
--- a/ruoyi-ui/src/settings.js
+++ b/ruoyi-ui/src/settings.js
@@ -1,6 +1,4 @@
module.exports = {
- title: 'RuoYi-Vue-Plus鍚庡彴绠$悊绯荤粺',
-
/**
* 渚ц竟鏍忎富棰� 娣辫壊涓婚theme-dark锛屾祬鑹蹭富棰榯heme-light
*/
@@ -32,6 +30,11 @@
sidebarLogo: true,
/**
+ * 鏄惁鏄剧ず鍔ㄦ�佹爣棰�
+ */
+ dynamicTitle: false,
+
+ /**
* @type {string | array} 'production' | ['production', 'development']
* @description Need show err logs component.
* The default is only used in the production env
diff --git a/ruoyi-ui/src/store/modules/settings.js b/ruoyi-ui/src/store/modules/settings.js
index 93f7c04..647a8ce 100644
--- a/ruoyi-ui/src/store/modules/settings.js
+++ b/ruoyi-ui/src/store/modules/settings.js
@@ -1,17 +1,19 @@
import variables from '@/assets/styles/element-variables.scss'
import defaultSettings from '@/settings'
-const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo } = defaultSettings
+const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || ''
const state = {
+ title: '',
theme: storageSetting.theme || variables.theme,
sideTheme: storageSetting.sideTheme || sideTheme,
showSettings: showSettings,
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader,
- sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo
+ sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo,
+ dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle
}
const mutations = {
CHANGE_SETTING: (state, { key, value }) => {
@@ -22,8 +24,13 @@
}
const actions = {
+ // 淇敼甯冨眬璁剧疆
changeSetting({ commit }, data) {
commit('CHANGE_SETTING', data)
+ },
+ // 璁剧疆缃戦〉鏍囬
+ setTitle({ commit }, title) {
+ state.title = title
}
}
diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue
index 92baaa9..07937b4 100644
--- a/ruoyi-ui/src/views/monitor/logininfor/index.vue
+++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue
@@ -91,17 +91,17 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
- <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
+ <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="璁块棶缂栧彿" align="center" prop="infoId" />
- <el-table-column label="鐢ㄦ埛鍚嶇О" align="center" prop="userName" />
+ <el-table-column label="鐢ㄦ埛鍚嶇О" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="鐧诲綍鍦板潃" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="鐧诲綍鍦扮偣" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
- <el-table-column label="娴忚鍣�" align="center" prop="browser" />
+ <el-table-column label="娴忚鍣�" align="center" prop="browser" :show-overflow-tooltip="true" />
<el-table-column label="鎿嶄綔绯荤粺" align="center" prop="os" />
<el-table-column label="鐧诲綍鐘舵��" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="鎿嶄綔淇℃伅" align="center" prop="msg" />
- <el-table-column label="鐧诲綍鏃ユ湡" align="center" prop="loginTime" width="180">
+ <el-table-column label="鐧诲綍鏃ユ湡" align="center" prop="loginTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
</template>
@@ -143,6 +143,8 @@
statusOptions: [],
// 鏃ユ湡鑼冨洿
dateRange: [],
+ // 榛樿鎺掑簭
+ defaultSort: {prop: 'loginTime', order: 'descending'},
// 鏌ヨ鍙傛暟
queryParams: {
pageNum: 1,
@@ -183,13 +185,20 @@
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
+ this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
this.handleQuery();
},
- // 澶氶�夋閫変腑鏁版嵁
+ /** 澶氶�夋閫変腑鏁版嵁 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.infoId)
this.multiple = !selection.length
},
+ /** 鎺掑簭瑙﹀彂浜嬩欢 */
+ handleSortChange(column, prop, order) {
+ this.queryParams.orderByColumn = column.prop;
+ this.queryParams.isAsc = column.order;
+ this.getList();
+ },
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
const infoIds = row.infoId || this.ids;
diff --git a/ruoyi-ui/src/views/monitor/operlog/index.vue b/ruoyi-ui/src/views/monitor/operlog/index.vue
index d45f6e9..ff6c798 100644
--- a/ruoyi-ui/src/views/monitor/operlog/index.vue
+++ b/ruoyi-ui/src/views/monitor/operlog/index.vue
@@ -107,17 +107,17 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
- <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
+ <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="鏃ュ織缂栧彿" align="center" prop="operId" />
<el-table-column label="绯荤粺妯″潡" align="center" prop="title" />
<el-table-column label="鎿嶄綔绫诲瀷" align="center" prop="businessType" :formatter="typeFormat" />
<el-table-column label="璇锋眰鏂瑰紡" align="center" prop="requestMethod" />
- <el-table-column label="鎿嶄綔浜哄憳" align="center" prop="operName" />
- <el-table-column label="涓绘満" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
+ <el-table-column label="鎿嶄綔浜哄憳" align="center" prop="operName" width="100" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
+ <el-table-column label="鎿嶄綔鍦板潃" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
<el-table-column label="鎿嶄綔鍦扮偣" align="center" prop="operLocation" :show-overflow-tooltip="true" />
<el-table-column label="鎿嶄綔鐘舵��" align="center" prop="status" :formatter="statusFormat" />
- <el-table-column label="鎿嶄綔鏃ユ湡" align="center" prop="operTime" width="180">
+ <el-table-column label="鎿嶄綔鏃ユ湡" align="center" prop="operTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
@@ -216,6 +216,8 @@
statusOptions: [],
// 鏃ユ湡鑼冨洿
dateRange: [],
+ // 榛樿鎺掑簭
+ defaultSort: {prop: 'operTime', order: 'descending'},
// 琛ㄥ崟鍙傛暟
form: {},
// 鏌ヨ鍙傛暟
@@ -266,13 +268,20 @@
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
+ this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
this.handleQuery();
},
- // 澶氶�夋閫変腑鏁版嵁
+ /** 澶氶�夋閫変腑鏁版嵁 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.operId)
this.multiple = !selection.length
},
+ /** 鎺掑簭瑙﹀彂浜嬩欢 */
+ handleSortChange(column, prop, order) {
+ this.queryParams.orderByColumn = column.prop;
+ this.queryParams.isAsc = column.order;
+ this.getList();
+ },
/** 璇︾粏鎸夐挳鎿嶄綔 */
handleView(row) {
this.open = true;
diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index 1a89876..2c924fb 100644
--- a/ruoyi-ui/src/views/system/user/index.vue
+++ b/ruoyi-ui/src/views/system/user/index.vue
@@ -545,7 +545,7 @@
},
/** 鎼滅储鎸夐挳鎿嶄綔 */
handleQuery() {
- this.queryParams.page = 1;
+ this.queryParams.pageNum = 1;
this.getList();
},
/** 閲嶇疆鎸夐挳鎿嶄綔 */
diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js
index 5eb7edd..a051c87 100644
--- a/ruoyi-ui/vue.config.js
+++ b/ruoyi-ui/vue.config.js
@@ -1,12 +1,11 @@
'use strict'
const path = require('path')
-const defaultSettings = require('./src/settings.js')
function resolve(dir) {
return path.join(__dirname, dir)
}
-const name = defaultSettings.title || 'RuoYi-Vue-Plus鍚庡彴绠$悊绯荤粺' // 鏍囬
+const name = defaultSettings.title || 'RuoYi-Vue-Plus鍚庡彴绠$悊绯荤粺' // 缃戦〉鏍囬
const port = process.env.port || process.env.npm_config_port || 80 // 绔彛
--
Gitblit v1.9.3