diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java index bbec2702d..59b6bb6fe 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysUser.java @@ -56,8 +56,8 @@ public class SysUser extends BaseEntity /** 密码 */ private String password; - /** 帐号状态(0正常 1停用) */ - @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") + /** 账号状态(0正常 1停用) */ + @Excel(name = "账号状态", readConverterExp = "0=正常,1=停用") private String status; /** 删除标志(0代表存在 2代表删除) */ @@ -311,6 +311,7 @@ public class SysUser extends BaseEntity { this.roleId = roleId; } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index 3f6ccfb65..b9284df43 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -390,7 +390,7 @@ public class ExcelUtil if (String.class == fieldType) { String s = Convert.toStr(val); - if (StringUtils.endsWith(s, ".0")) + if (s.matches("^\\d+\\.0$")) { val = StringUtils.substringBefore(s, ".0"); } diff --git a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/CacheRequestFilter.java b/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/CacheRequestFilter.java deleted file mode 100644 index 94c6cb56a..000000000 --- a/ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/CacheRequestFilter.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.ruoyi.gateway.filter; - -import java.util.Collections; -import java.util.List; -import org.springframework.cloud.gateway.filter.GatewayFilter; -import org.springframework.cloud.gateway.filter.GatewayFilterChain; -import org.springframework.cloud.gateway.filter.OrderedGatewayFilter; -import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; -import org.springframework.cloud.gateway.support.ServerWebExchangeUtils; -import org.springframework.http.HttpMethod; -import org.springframework.stereotype.Component; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Mono; - -/** - * 获取body请求数据(解决流不能重复读取问题) - * - * @author ruoyi - */ -@Component -public class CacheRequestFilter extends AbstractGatewayFilterFactory -{ - public CacheRequestFilter() - { - super(Config.class); - } - - @Override - public String name() - { - return "CacheRequestFilter"; - } - - @Override - public GatewayFilter apply(Config config) - { - CacheRequestGatewayFilter cacheRequestGatewayFilter = new CacheRequestGatewayFilter(); - Integer order = config.getOrder(); - if (order == null) - { - return cacheRequestGatewayFilter; - } - return new OrderedGatewayFilter(cacheRequestGatewayFilter, order); - } - - public static class CacheRequestGatewayFilter implements GatewayFilter - { - @Override - public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) - { - // GET DELETE 不过滤 - HttpMethod method = exchange.getRequest().getMethod(); - if (method == null || method == HttpMethod.GET || method == HttpMethod.DELETE) - { - return chain.filter(exchange); - } - return ServerWebExchangeUtils.cacheRequestBodyAndRequest(exchange, (serverHttpRequest) -> { - if (serverHttpRequest == exchange.getRequest()) - { - return chain.filter(exchange); - } - return chain.filter(exchange.mutate().request(serverHttpRequest).build()); - }); - } - } - - @Override - public List shortcutFieldOrder() - { - return Collections.singletonList("order"); - } - - static class Config - { - private Integer order; - - public Integer getOrder() - { - return order; - } - - public void setOrder(Integer order) - { - this.order = order; - } - } -} \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm index b0233bc9a..2bd928991 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm @@ -283,9 +283,9 @@ diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm index ce2b47a91..725326659 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm @@ -353,7 +353,7 @@ diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm index cd7c5b513..765a5e300 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index-tree.vue.vm @@ -271,26 +271,26 @@ diff --git a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm index ca79b3563..936b4651f 100644 --- a/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm +++ b/ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/v3/index.vue.vm @@ -343,33 +343,33 @@ diff --git a/ruoyi-ui/src/App.vue b/ruoyi-ui/src/App.vue index cc29b4663..86d4d48f8 100644 --- a/ruoyi-ui/src/App.vue +++ b/ruoyi-ui/src/App.vue @@ -6,7 +6,7 @@ + diff --git a/ruoyi-ui/src/components/ImagePreview/index.vue b/ruoyi-ui/src/components/ImagePreview/index.vue index 2fa02d71e..0cbb79db9 100644 --- a/ruoyi-ui/src/components/ImagePreview/index.vue +++ b/ruoyi-ui/src/components/ImagePreview/index.vue @@ -31,30 +31,30 @@ export default { computed: { realSrc() { if (!this.src) { - return; + return } - let real_src = this.src.split(",")[0]; - return real_src; + let real_src = this.src.split(",")[0] + return real_src }, realSrcList() { if (!this.src) { - return; + return } - let real_src_list = this.src.split(","); - let srcList = []; + let real_src_list = this.src.split(",") + let srcList = [] real_src_list.forEach(item => { - return srcList.push(item); - }); - return srcList; + return srcList.push(item) + }) + return srcList }, realWidth() { - return typeof this.width == "string" ? this.width : `${this.width}px`; + return typeof this.width == "string" ? this.width : `${this.width}px` }, realHeight() { - return typeof this.height == "string" ? this.height : `${this.height}px`; + return typeof this.height == "string" ? this.height : `${this.height}px` } }, -}; +} diff --git a/ruoyi-ui/src/components/RightToolbar/index.vue b/ruoyi-ui/src/components/RightToolbar/index.vue index 67da29300..786521486 100644 --- a/ruoyi-ui/src/components/RightToolbar/index.vue +++ b/ruoyi-ui/src/components/RightToolbar/index.vue @@ -12,9 +12,14 @@ + + + 列展示 + +
@@ -41,42 +46,51 @@ export default { // 弹出层标题 title: "显示/隐藏", // 是否显示弹出层 - open: false, - }; + open: false + } }, props: { /* 是否显示检索条件 */ showSearch: { type: Boolean, - default: true, + default: true }, /* 显隐列信息 */ columns: { - type: Array, + type: Array }, /* 是否显示检索图标 */ search: { type: Boolean, - default: true, + default: true }, /* 显隐列类型(transfer穿梭框、checkbox复选框) */ showColumnsType: { type: String, - default: "checkbox", + default: "checkbox" }, /* 右外边距 */ gutter: { type: Number, - default: 10, + default: 10 }, }, computed: { style() { - const ret = {}; + const ret = {} if (this.gutter) { - ret.marginRight = `${this.gutter / 2}px`; + ret.marginRight = `${this.gutter / 2}px` } - return ret; + return ret + }, + isChecked: { + get() { + return this.columns.every((col) => col.visible) + }, + set() {} + }, + isIndeterminate() { + return this.columns.some((col) => col.visible) && !this.isChecked } }, created() { @@ -84,7 +98,7 @@ export default { // 显隐列初始默认隐藏列 for (let item in this.columns) { if (this.columns[item].visible === false) { - this.value.push(parseInt(item)); + this.value.push(parseInt(item)) } } } @@ -92,29 +106,34 @@ export default { methods: { // 搜索 toggleSearch() { - this.$emit("update:showSearch", !this.showSearch); + this.$emit("update:showSearch", !this.showSearch) }, // 刷新 refresh() { - this.$emit("queryTable"); + this.$emit("queryTable") }, // 右侧列表元素变化 dataChange(data) { for (let item in this.columns) { - const key = this.columns[item].key; - this.columns[item].visible = !data.includes(key); + const key = this.columns[item].key + this.columns[item].visible = !data.includes(key) } }, // 打开显隐列dialog showColumn() { - this.open = true; + this.open = true }, - // 勾选 + // 单勾选 checkboxChange(event, label) { - this.columns.filter(item => item.label == label)[0].visible = event; + this.columns.filter(item => item.label == label)[0].visible = event + }, + // 切换全选/反选 + toggleCheckAll() { + const newValue = !this.isChecked + this.columns.forEach((col) => (col.visible = newValue)) } }, -}; +} diff --git a/ruoyi-ui/src/components/SizeSelect/index.vue b/ruoyi-ui/src/components/SizeSelect/index.vue index 00496f71d..3c75530ef 100644 --- a/ruoyi-ui/src/components/SizeSelect/index.vue +++ b/ruoyi-ui/src/components/SizeSelect/index.vue @@ -51,6 +51,5 @@ export default { }) } } - } diff --git a/ruoyi-ui/src/components/TopNav/index.vue b/ruoyi-ui/src/components/TopNav/index.vue index e27a12f6e..b3f333145 100644 --- a/ruoyi-ui/src/components/TopNav/index.vue +++ b/ruoyi-ui/src/components/TopNav/index.vue @@ -32,11 +32,11 @@