From a2acbc0c3ae12c311506c0debe608c40ce1f6fe9 Mon Sep 17 00:00:00 2001 From: lijiahangmax Date: Thu, 20 Mar 2025 00:08:23 +0800 Subject: [PATCH] =?UTF-8?q?:hammer:=20=E6=8E=92=E5=BA=8F=E5=AD=97=E6=AE=B5?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../orion-server-module-entity-do.java.vm | 14 +- ...server-module-entity-request-query.java.vm | 6 +- .../orion-server-module-service-impl.java.vm | 13 +- .../resources/templates/orion-vue-api.ts.vm | 4 +- .../orion-vue-views-types-card.fields.ts.vm | 2 + .../orion-vue-views-types-const.ts.vm | 2 + .../orion-vue-views-types-table.columns.ts.vm | 2 + orion-visor-ui/src/api/asset/host-identity.ts | 4 +- orion-visor-ui/src/api/asset/host-key.ts | 4 +- orion-visor-ui/src/api/asset/host.ts | 4 +- .../src/api/asset/terminal-connect-log.ts | 4 +- orion-visor-ui/src/api/asset/terminal-sftp.ts | 4 +- orion-visor-ui/src/api/exec/exec-job.ts | 4 +- orion-visor-ui/src/api/exec/exec-log.ts | 4 +- orion-visor-ui/src/api/exec/exec-template.ts | 4 +- orion-visor-ui/src/api/exec/upload-task.ts | 4 +- orion-visor-ui/src/api/meta/history-value.ts | 4 +- orion-visor-ui/src/api/system/dict-key.ts | 4 +- orion-visor-ui/src/api/system/dict-value.ts | 4 +- orion-visor-ui/src/api/system/message.ts | 4 +- orion-visor-ui/src/api/user/operator-log.ts | 4 +- orion-visor-ui/src/api/user/role.ts | 4 +- orion-visor-ui/src/api/user/user.ts | 4 +- orion-visor-ui/src/assets/style/layout.less | 39 ++++- .../src/components/app/table-adjust/index.vue | 142 ++++++++++++++++++ .../components/card-field-adjust.vue | 78 ++++++++++ .../view/card-list/components/card-header.vue | 12 +- .../card-list/components/card-sort-adjust.vue | 72 +++++++++ .../src/components/view/card-list/index.vue | 6 +- .../components/view/card-list/types/props.ts | 6 +- orion-visor-ui/src/hooks/card.ts | 93 +++++++++++- orion-visor-ui/src/hooks/query-order.ts | 75 +++++++++ orion-visor-ui/src/hooks/table.ts | 88 ++++++++++- orion-visor-ui/src/types/arco.d.ts | 6 +- orion-visor-ui/src/types/card.ts | 1 + orion-visor-ui/src/types/global.ts | 4 + .../info/components/user-operator-log.vue | 2 +- 37 files changed, 663 insertions(+), 68 deletions(-) create mode 100644 orion-visor-ui/src/components/app/table-adjust/index.vue create mode 100644 orion-visor-ui/src/components/view/card-list/components/card-field-adjust.vue create mode 100644 orion-visor-ui/src/components/view/card-list/components/card-sort-adjust.vue create mode 100644 orion-visor-ui/src/hooks/query-order.ts diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm index e11b516b..25166243 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-do.java.vm @@ -26,6 +26,7 @@ import com.baomidou.mybatisplus.annotation.*; import io.swagger.v3.oas.annotations.media.Schema; import org.dromara.visor.framework.mybatis.core.domain.BaseDO; import lombok.*; +import lombok.experimental.SuperBuilder; import java.util.*; import java.math.*; @@ -38,7 +39,7 @@ import java.math.*; * @since ${date} */ @Data -@Builder +@SuperBuilder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) @@ -66,17 +67,8 @@ public class ${entity} { #if("$!field.comment" != "") @Schema(description = "${field.comment}") #end -#if(${field.keyFlag}) -## 主键 - #if(${field.keyIdentityFlag}) - @TableId(value = "${field.annotationColumnName}", type = IdType.AUTO) - #elseif(!$null.isNull(${idType}) && "$!idType" != "") - @TableId(value = "${field.annotationColumnName}", type = IdType.${idType}) - #elseif(${field.convert}) - @TableId("${field.annotationColumnName}") - #end ## 普通字段 -#elseif(${field.fill}) +#if(${field.fill}) ## ----- 存在字段填充设置 ----- #if(${field.convert}) @TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill}) diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm index ddb8269f..037c99e6 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-entity-request-query.java.vm @@ -25,11 +25,9 @@ package ${currentPackage}; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; -import org.dromara.visor.common.entity.PageRequest; +import org.dromara.visor.common.entity.BaseQueryRequest; import javax.validation.constraints.Size; -import java.util.*; -import java.math.*; /** * $!{table.comment} 查询请求对象 @@ -44,7 +42,7 @@ import java.math.*; @AllArgsConstructor @EqualsAndHashCode(callSuper = true) @Schema(name = "${type}QueryRequest", description = "$!{table.comment} 查询请求对象") -public class ${type}QueryRequest extends PageRequest { +public class ${type}QueryRequest extends BaseQueryRequest { @Schema(description = "搜索") private String searchValue; diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm index 839fd3e2..0e3e1090 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-server-module-service-impl.java.vm @@ -144,10 +144,11 @@ public class ${table.serviceImplName} implements ${table.serviceName} { @Override public List<${type}VO> get${type}List(${type}QueryRequest request) { // 条件 - LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request) - .orderByDesc(${type}DO::getId); + LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request); // 查询 - return ${typeLower}DAO.of(wrapper).list(${type}Convert.MAPPER::to); + return ${typeLower}DAO.of(wrapper) + .order(request, ${type}DO::getId) + .list(${type}Convert.MAPPER::to); } #if($meta.enableCache) @@ -176,12 +177,12 @@ public class ${table.serviceImplName} implements ${table.serviceName} { @Override public DataGrid<${type}VO> get${type}Page(${type}QueryRequest request) { // 条件 - LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request) - .orderByDesc(${type}DO::getId); + LambdaQueryWrapper<${type}DO> wrapper = this.buildQueryWrapper(request); // 查询 return ${typeLower}DAO.of() - .page(request) .wrapper(wrapper) + .page(request) + .order(request, ${type}DO::getId) .dataGrid(${type}Convert.MAPPER::to); } diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-api.ts.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-api.ts.vm index e5597b51..1d8ca732 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-api.ts.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-api.ts.vm @@ -1,5 +1,5 @@ -import type { DataGrid, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import axios from 'axios'; import qs from 'query-string'; @@ -32,7 +32,7 @@ export interface ${vue.featureEntity}UpdateRequest extends ${vue.featureEntity}C /** * ${table.comment}查询请求 */ -export interface ${vue.featureEntity}QueryRequest extends Pagination { +export interface ${vue.featureEntity}QueryRequest extends Pagination, OrderDirection { searchValue?: string; #foreach($field in ${table.fields}) #if("$field.propertyType" == "String" || "$field.propertyType" == "Date") diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-card.fields.ts.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-card.fields.ts.vm index 6ad2e6fa..38ac51c9 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-card.fields.ts.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-card.fields.ts.vm @@ -10,6 +10,7 @@ const fieldConfig = { label: 'id', dataIndex: 'id', slotName: 'id', + default: true, }, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){ label: '${field.comment}', dataIndex: '${field.propertyName}', @@ -21,6 +22,7 @@ const fieldConfig = { return record.${field.propertyName} && dateFormat(new Date(record.${field.propertyName})); }, #end + default: true, }, #end#end{ label: '创建时间', dataIndex: 'createTime', diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-const.ts.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-const.ts.vm index 803ab6cb..bf109351 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-const.ts.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-const.ts.vm @@ -1,3 +1,5 @@ +export const TABLE_NAME = '$table.name'; + #if($dictMap.entrySet().size() > 0) #foreach($enumEntity in $dictMap.entrySet()) // $enumEntity.value.comment diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-table.columns.ts.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-table.columns.ts.vm index 96febf32..d9af843a 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-table.columns.ts.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-types-table.columns.ts.vm @@ -9,6 +9,7 @@ const columns = [ width: 68, align: 'left', fixed: 'left', + default: true, }, #foreach($field in ${table.fields})#if("$!field.propertyName" != "id"){ title: '${field.comment}', dataIndex: '${field.propertyName}', @@ -24,6 +25,7 @@ const columns = [ return record.${field.propertyName} && dateFormat(new Date(record.${field.propertyName})); }, #end + default: true, }, #end#end{ title: '创建时间', dataIndex: 'createTime', diff --git a/orion-visor-ui/src/api/asset/host-identity.ts b/orion-visor-ui/src/api/asset/host-identity.ts index 09f6c7bf..85c96bc5 100644 --- a/orion-visor-ui/src/api/asset/host-identity.ts +++ b/orion-visor-ui/src/api/asset/host-identity.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -26,7 +26,7 @@ export interface HostIdentityUpdateRequest extends HostIdentityCreateRequest { /** * 主机身份查询请求 */ -export interface HostIdentityQueryRequest extends Pagination { +export interface HostIdentityQueryRequest extends Pagination, OrderDirection { searchValue?: string; id?: number; name?: string; diff --git a/orion-visor-ui/src/api/asset/host-key.ts b/orion-visor-ui/src/api/asset/host-key.ts index cb06e768..22fc233f 100644 --- a/orion-visor-ui/src/api/asset/host-key.ts +++ b/orion-visor-ui/src/api/asset/host-key.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -25,7 +25,7 @@ export interface HostKeyUpdateRequest extends HostKeyCreateRequest { /** * 主机密钥查询请求 */ -export interface HostKeyQueryRequest extends Pagination { +export interface HostKeyQueryRequest extends Pagination, OrderDirection { searchValue?: string; id?: number; name?: string; diff --git a/orion-visor-ui/src/api/asset/host.ts b/orion-visor-ui/src/api/asset/host.ts index 2f8394bc..14fdc6cf 100644 --- a/orion-visor-ui/src/api/asset/host.ts +++ b/orion-visor-ui/src/api/asset/host.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -47,7 +47,7 @@ export interface HostUpdateConfigRequest { /** * 主机查询请求 */ -export interface HostQueryRequest extends Pagination { +export interface HostQueryRequest extends Pagination, OrderDirection { searchValue?: string; id?: number; type?: string; diff --git a/orion-visor-ui/src/api/asset/terminal-connect-log.ts b/orion-visor-ui/src/api/asset/terminal-connect-log.ts index 3767f2bc..4e1984e1 100644 --- a/orion-visor-ui/src/api/asset/terminal-connect-log.ts +++ b/orion-visor-ui/src/api/asset/terminal-connect-log.ts @@ -1,4 +1,4 @@ -import type { ClearRequest, DataGrid, Pagination } from '@/types/global'; +import type { ClearRequest, DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -6,7 +6,7 @@ import qs from 'query-string'; /** * 终端连接日志查询请求 */ -export interface TerminalConnectLogQueryRequest extends Pagination { +export interface TerminalConnectLogQueryRequest extends Pagination, OrderDirection { id?: number; userId?: number; hostId?: number; diff --git a/orion-visor-ui/src/api/asset/terminal-sftp.ts b/orion-visor-ui/src/api/asset/terminal-sftp.ts index 12d58063..b42f12cc 100644 --- a/orion-visor-ui/src/api/asset/terminal-sftp.ts +++ b/orion-visor-ui/src/api/asset/terminal-sftp.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import { httpBaseUrl } from '@/utils/env'; import axios from 'axios'; @@ -7,7 +7,7 @@ import qs from 'query-string'; /** * SFTP 操作日志 查询请求 */ -export interface TerminalSftpLogQueryRequest extends Pagination { +export interface TerminalSftpLogQueryRequest extends Pagination, OrderDirection { userId?: number; hostId?: number; type?: string; diff --git a/orion-visor-ui/src/api/exec/exec-job.ts b/orion-visor-ui/src/api/exec/exec-job.ts index 688dfd3b..8a7402ac 100644 --- a/orion-visor-ui/src/api/exec/exec-job.ts +++ b/orion-visor-ui/src/api/exec/exec-job.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import type { HostQueryResponse } from '@/api/asset/host'; import axios from 'axios'; @@ -43,7 +43,7 @@ export interface ExecJobUpdateExecUserRequest { /** * 计划任务查询请求 */ -export interface ExecJobQueryRequest extends Pagination { +export interface ExecJobQueryRequest extends Pagination, OrderDirection { id?: number; name?: string; command?: string; diff --git a/orion-visor-ui/src/api/exec/exec-log.ts b/orion-visor-ui/src/api/exec/exec-log.ts index c2196ff8..11b64b58 100644 --- a/orion-visor-ui/src/api/exec/exec-log.ts +++ b/orion-visor-ui/src/api/exec/exec-log.ts @@ -1,11 +1,11 @@ -import type { ClearRequest, Pagination } from '@/types/global'; +import type { ClearRequest, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import { createAppWebSocket } from '@/utils/http'; /** * 执行日志查询请求 */ -export interface ExecLogQueryRequest extends Pagination { +export interface ExecLogQueryRequest extends Pagination, OrderDirection { id?: number; userId?: number; sourceId?: number; diff --git a/orion-visor-ui/src/api/exec/exec-template.ts b/orion-visor-ui/src/api/exec/exec-template.ts index 37fc5dbc..5f9c5731 100644 --- a/orion-visor-ui/src/api/exec/exec-template.ts +++ b/orion-visor-ui/src/api/exec/exec-template.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -25,7 +25,7 @@ export interface ExecTemplateUpdateRequest extends ExecTemplateCreateRequest { /** * 执行模板查询请求 */ -export interface ExecTemplateQueryRequest extends Pagination { +export interface ExecTemplateQueryRequest extends Pagination, OrderDirection { id?: number; name?: string; command?: string; diff --git a/orion-visor-ui/src/api/exec/upload-task.ts b/orion-visor-ui/src/api/exec/upload-task.ts index 8fa0a076..eabfddb1 100644 --- a/orion-visor-ui/src/api/exec/upload-task.ts +++ b/orion-visor-ui/src/api/exec/upload-task.ts @@ -1,4 +1,4 @@ -import type { ClearRequest, DataGrid, Pagination } from '@/types/global'; +import type { ClearRequest, DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -33,7 +33,7 @@ export interface UploadTaskCreateResponse { /** * 上传任务查询请求 */ -export interface UploadTaskQueryRequest extends Pagination { +export interface UploadTaskQueryRequest extends Pagination, OrderDirection { id?: number; userId?: number; remotePath?: string; diff --git a/orion-visor-ui/src/api/meta/history-value.ts b/orion-visor-ui/src/api/meta/history-value.ts index df3bde3a..45e4b0ad 100644 --- a/orion-visor-ui/src/api/meta/history-value.ts +++ b/orion-visor-ui/src/api/meta/history-value.ts @@ -1,11 +1,11 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; /** * 历史归档查询请求 */ -export interface HistoryValueQueryRequest extends Pagination { +export interface HistoryValueQueryRequest extends Pagination, OrderDirection { searchValue?: string; relId?: number; type?: string; diff --git a/orion-visor-ui/src/api/system/dict-key.ts b/orion-visor-ui/src/api/system/dict-key.ts index 43e68c9e..9eb1099a 100644 --- a/orion-visor-ui/src/api/system/dict-key.ts +++ b/orion-visor-ui/src/api/system/dict-key.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -23,7 +23,7 @@ export interface DictKeyUpdateRequest extends DictKeyCreateRequest { /** * 字典配置项查询请求 */ -export interface DictKeyQueryRequest extends Pagination { +export interface DictKeyQueryRequest extends Pagination, OrderDirection { searchValue?: string; id?: number; keyName?: string; diff --git a/orion-visor-ui/src/api/system/dict-value.ts b/orion-visor-ui/src/api/system/dict-value.ts index fe06bc16..222cd4d8 100644 --- a/orion-visor-ui/src/api/system/dict-value.ts +++ b/orion-visor-ui/src/api/system/dict-value.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Options, Pagination } from '@/types/global'; +import type { DataGrid, Options, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; import qs from 'query-string'; @@ -33,7 +33,7 @@ export interface DictValueRollbackRequest { /** * 字典配置值查询请求 */ -export interface DictValueQueryRequest extends Pagination { +export interface DictValueQueryRequest extends Pagination, OrderDirection { keyId?: number; keyName?: string; value?: string; diff --git a/orion-visor-ui/src/api/system/message.ts b/orion-visor-ui/src/api/system/message.ts index 8069f848..a845b9d3 100644 --- a/orion-visor-ui/src/api/system/message.ts +++ b/orion-visor-ui/src/api/system/message.ts @@ -1,10 +1,10 @@ -import type { Pagination } from '@/types/global'; +import type { OrderDirection, Pagination } from '@/types/global'; import axios from 'axios'; /** * 系统消息查询请求 */ -export interface MessageQueryRequest extends Pagination { +export interface MessageQueryRequest extends Pagination, OrderDirection { maxId?: number; classify?: string; queryUnread?: boolean; diff --git a/orion-visor-ui/src/api/user/operator-log.ts b/orion-visor-ui/src/api/user/operator-log.ts index 3d514c86..0d21a35a 100644 --- a/orion-visor-ui/src/api/user/operator-log.ts +++ b/orion-visor-ui/src/api/user/operator-log.ts @@ -1,11 +1,11 @@ -import type { ClearRequest, DataGrid, Pagination } from '@/types/global'; +import type { ClearRequest, DataGrid, OrderDirection, Pagination } from '@/types/global'; import axios from 'axios'; import qs from 'query-string'; /** * 操作日志查询参数 */ -export interface OperatorLogQueryRequest extends Pagination { +export interface OperatorLogQueryRequest extends Pagination, OrderDirection { userId?: number; username?: string; module?: string; diff --git a/orion-visor-ui/src/api/user/role.ts b/orion-visor-ui/src/api/user/role.ts index a77619ba..f1414f8a 100644 --- a/orion-visor-ui/src/api/user/role.ts +++ b/orion-visor-ui/src/api/user/role.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import axios from 'axios'; @@ -30,7 +30,7 @@ export interface RoleGrantMenuRequest extends RoleCreateRequest { /** * 角色查询请求 */ -export interface RoleQueryRequest extends Pagination { +export interface RoleQueryRequest extends Pagination, OrderDirection { id?: number; name?: string; code?: string; diff --git a/orion-visor-ui/src/api/user/user.ts b/orion-visor-ui/src/api/user/user.ts index c60cfc30..d682ebe5 100644 --- a/orion-visor-ui/src/api/user/user.ts +++ b/orion-visor-ui/src/api/user/user.ts @@ -1,4 +1,4 @@ -import type { DataGrid, Pagination } from '@/types/global'; +import type { DataGrid, OrderDirection, Pagination } from '@/types/global'; import type { TableData } from '@arco-design/web-vue'; import type { RoleQueryResponse } from '@/api/user/role'; import axios from 'axios'; @@ -29,7 +29,7 @@ export interface UserUpdateRequest extends UserCreateRequest { /** * 用户查询请求 */ -export interface UserQueryRequest extends Pagination { +export interface UserQueryRequest extends Pagination, OrderDirection { id?: number; username?: string; password?: string; diff --git a/orion-visor-ui/src/assets/style/layout.less b/orion-visor-ui/src/assets/style/layout.less index d9bbb29a..e7bbf85a 100644 --- a/orion-visor-ui/src/assets/style/layout.less +++ b/orion-visor-ui/src/assets/style/layout.less @@ -66,6 +66,43 @@ } } +.table-adjust-popover { + user-select: none; + + &-header { + padding: 4px 4px 4px 6px; + display: flex; + align-items: center; + justify-content: space-between; + + .table-adjust-title { + margin-left: 4px; + color: var(--color-text-1); + } + } + + .arco-checkbox-group { + min-width: 168px; + } + + .arco-radio-group { + min-width: 148px; + } + + .arco-checkbox-group, .arco-radio-group { + padding: 0 4px 4px 4px; + + .arco-checkbox, .radio-checkbox { + border-radius: 4px; + padding: 0 6px; + + &:hover { + background: var(--color-fill-2); + } + } + } +} + // -- drawer .drawer-form-small { padding: 20px 20px 2px 20px; @@ -196,7 +233,7 @@ .more-doption { min-width: 42px; padding: 0 4px; - font-size: 12px; + font-size: 13px; display: inline-block; svg { diff --git a/orion-visor-ui/src/components/app/table-adjust/index.vue b/orion-visor-ui/src/components/app/table-adjust/index.vue new file mode 100644 index 00000000..7d412f2f --- /dev/null +++ b/orion-visor-ui/src/components/app/table-adjust/index.vue @@ -0,0 +1,142 @@ + + + + + + + diff --git a/orion-visor-ui/src/components/view/card-list/components/card-field-adjust.vue b/orion-visor-ui/src/components/view/card-list/components/card-field-adjust.vue new file mode 100644 index 00000000..1ddde24c --- /dev/null +++ b/orion-visor-ui/src/components/view/card-list/components/card-field-adjust.vue @@ -0,0 +1,78 @@ + + + + + + + diff --git a/orion-visor-ui/src/components/view/card-list/components/card-header.vue b/orion-visor-ui/src/components/view/card-list/components/card-header.vue index 46f6eba4..57ad712d 100644 --- a/orion-visor-ui/src/components/view/card-list/components/card-header.vue +++ b/orion-visor-ui/src/components/view/card-list/components/card-header.vue @@ -90,6 +90,13 @@ @click="bubblesEmitter(HeaderEmitter.RESET)"> + + + + @@ -110,13 +117,14 @@ import { triggerMouseEvent } from '@/utils/event'; import { HeaderEmitter } from '../types/emits'; import useEmitter from '@/hooks/emitter'; + import CardFieldAdjust from './card-field-adjust.vue'; + import CardSortAdjust from './card-sort-adjust.vue'; const props = defineProps(); const emits = defineEmits(['emitter']); - const { bubblesEmitter } = useEmitter(emits); - const appStore = useAppStore(); + const { bubblesEmitter } = useEmitter(emits); const filterRef = ref(); diff --git a/orion-visor-ui/src/components/view/card-list/components/card-sort-adjust.vue b/orion-visor-ui/src/components/view/card-list/components/card-sort-adjust.vue new file mode 100644 index 00000000..8034e566 --- /dev/null +++ b/orion-visor-ui/src/components/view/card-list/components/card-sort-adjust.vue @@ -0,0 +1,72 @@ + + + + + + + diff --git a/orion-visor-ui/src/components/view/card-list/index.vue b/orion-visor-ui/src/components/view/card-list/index.vue index c4c769f8..d1d2454a 100644 --- a/orion-visor-ui/src/components/view/card-list/index.vue +++ b/orion-visor-ui/src/components/view/card-list/index.vue @@ -80,12 +80,12 @@