feat: add vue3(element-plus)

This commit is contained in:
xingyu
2022-07-18 19:06:37 +08:00
parent c6b58dca52
commit 80a3ae8d74
423 changed files with 41039 additions and 0 deletions

View File

@ -0,0 +1,63 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useAppStore } from '@/store/modules/app'
import { ConfigGlobal } from '@/components/ConfigGlobal'
import { isDark } from '@/utils/is'
import { useDesign } from '@/hooks/web/useDesign'
import { useCache } from '@/hooks/web/useCache'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('app')
const appStore = useAppStore()
const currentSize = computed(() => appStore.getCurrentSize)
const greyMode = computed(() => appStore.getGreyMode)
const { wsCache } = useCache()
// 根据浏览器当前主题设置系统主题色
const setDefaultTheme = () => {
if (wsCache.get('isDark')) {
appStore.setIsDark(wsCache.get('isDark'))
return
}
const isDarkTheme = isDark()
appStore.setIsDark(isDarkTheme)
}
setDefaultTheme()
</script>
<template>
<ConfigGlobal :size="currentSize">
<RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" />
</ConfigGlobal>
</template>
<style lang="less">
@prefix-cls: ~'@{namespace}-app';
.size {
width: 100%;
height: 100%;
}
html,
body {
padding: 0 !important;
margin: 0;
overflow: hidden;
.size;
#app {
.size;
}
}
.@{prefix-cls}-grey-mode {
filter: grayscale(100%);
}
</style>

View File

@ -0,0 +1,12 @@
import { defHttp } from '@/config/axios'
import { ApiAccessLogVO } from './types'
// 查询列表API 访问日志
export const getApiAccessLogPageApi = ({ params }) => {
return defHttp.get<PageResult<ApiAccessLogVO>>({ url: '/infra/api-access-log/page', params })
}
// 导出API 访问日志
export const exportApiAccessLogApi = (params) => {
return defHttp.get({ url: '/infra/api-access-log/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,14 @@
export type ApiAccessLogVO = {
id: number
traceId: string
userId: string
userType: string
applicationName: string
requestMethod: string
requestParams: string
requestUrl: string
beginTime: string
endTIme: string
duration: string
resultCode: number
}

View File

@ -0,0 +1,19 @@
import { defHttp } from '@/config/axios'
import { ApiErrorLogVO } from './types'
// 查询列表API 访问日志
export const getApiErrorLogPageApi = ({ params }) => {
return defHttp.get<PageResult<ApiErrorLogVO>>({ url: '/infra/api-error-log/page', params })
}
// 更新 API 错误日志的处理状态
export const updateApiErrorLogPageApi = (id: number, processStatus: number) => {
return defHttp.put({
url: '/infra/api-error-log/update-status?id=' + id + '&processStatus=' + processStatus
})
}
// 导出API 访问日志
export const exportApiErrorLogApi = ({ params }) => {
return defHttp.get({ url: '/infra/api-error-log/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,17 @@
export type ApiErrorLogVO = {
id: number
userId: string
userIp: string
userAgent: string
userType: string
applicationName: string
requestMethod: string
requestParams: string
requestUrl: string
exceptionTime: string
exceptionName: string
exceptionStackTrace: string
processUserId: string
processStatus: number
resultCode: number
}

View File

@ -0,0 +1,62 @@
import { defHttp } from '@/config/axios'
import type { CodegenDetailVO, CodegenPreviewVO, CodegenTableVO, DatabaseTableVO } from './types'
// 查询列表代码生成表定义
export const getCodegenTablePageApi = ({ params }) => {
return defHttp.get<PageResult<CodegenTableVO>>({ url: '/infra/codegen/table/page', params })
}
// 查询详情代码生成表定义
export const getCodegenTableApi = (id: number) => {
return defHttp.get<CodegenDetailVO>({ url: '/infra/codegen/detail?tableId=' + id })
}
// 新增代码生成表定义
export const createCodegenTableApi = (params: CodegenTableVO) => {
return defHttp.post({ url: '/infra/codegen/create', params })
}
// 修改代码生成表定义
export const updateCodegenTableApi = (params: CodegenTableVO) => {
return defHttp.put({ url: '/infra/codegen/update', params })
}
// 基于数据库的表结构,同步数据库的表和字段定义
export const syncCodegenFromDBApi = (id: number) => {
return defHttp.put({ url: '/infra/codegen/sync-from-db?tableId=' + id })
}
// 基于 SQL 建表语句,同步数据库的表和字段定义
export const syncCodegenFromSQLApi = (id: number, sql: string) => {
return defHttp.put({
url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql,
headers: {
'Content-type': 'application/x-www-form-urlencoded'
}
})
}
// 预览生成代码
export const previewCodegenApi = (id: number) => {
return defHttp.get<CodegenPreviewVO[]>({ url: '/infra/codegen/preview?tableId=' + id })
}
// 下载生成代码
export const downloadCodegenApi = (id: number) => {
return defHttp.get({ url: '/infra/codegen/download?tableId=' + id, responseType: 'blob' })
}
// 获得表定义
export const getSchemaTableListApi = (params) => {
return defHttp.get<DatabaseTableVO[]>({ url: '/infra/codegen/db/table/list', params })
}
// 基于数据库的表结构,创建代码生成器的表定义
export const createCodegenListApi = (params) => {
return defHttp.post({ url: '/infra/codegen/create-list', params })
}
// 删除代码生成表定义
export const deleteCodegenTableApi = (id: number) => {
return defHttp.delete({ url: '/infra/codegen/delete?tableId=' + id })
}

View File

@ -0,0 +1,51 @@
export type CodegenTableVO = {
id: number
dataSourceConfigId: number
scene: number
tableName: string
tableComment: string
remark: string
moduleName: string
businessName: string
className: string
classComment: string
author: string
createTime: string
updateTime: string
templateType: number
parentMenuId: number
}
export type CodegenColumnVO = {
id: number
tableId: number
columnName: string
dataType: string
columnComment: string
nullable: number
primaryKey: number
autoIncrement: string
ordinalPosition: number
javaType: string
javaField: string
dictType: string
example: string
createOperation: number
updateOperation: number
listOperation: number
listOperationCondition: string
listOperationResult: number
htmlType: string
}
export type DatabaseTableVO = {
name: string
comment: string
}
export type CodegenDetailVO = {
table: CodegenTableVO
columns: CodegenColumnVO[]
}
export type CodegenPreviewVO = {
filePath: string
code: string
}

View File

@ -0,0 +1,37 @@
import { defHttp } from '@/config/axios'
import type { ConfigVO } from './types'
// 查询参数列表
export const getConfigPageApi = ({ params }) => {
return defHttp.get<PageResult<ConfigVO>>({ url: '/infra/config/page', params })
}
// 查询参数详情
export const getConfigApi = (id: number) => {
return defHttp.get<ConfigVO>({ url: '/infra/config/get?id=' + id })
}
// 根据参数键名查询参数值
export const getConfigKeyApi = (configKey: string) => {
return defHttp.get<ConfigVO>({ url: '/infra/config/get-value-by-key?key=' + configKey })
}
// 新增参数
export const createConfigApi = (params: ConfigVO) => {
return defHttp.post({ url: '/infra/config/create', params })
}
// 修改参数
export const updateConfigApi = (params: ConfigVO) => {
return defHttp.put({ url: '/infra/config/update', params })
}
// 删除参数
export const deleteConfigApi = (id: number) => {
return defHttp.delete({ url: '/infra/config/delete?id=' + id })
}
// 导出参数
export const exportConfigApi = ({ params }) => {
return defHttp.get({ url: '/infra/config/export', params, responseType: 'blob' })
}

View File

@ -0,0 +1,11 @@
export type ConfigVO = {
id: number
group: string
name: string
key: string
value: string
type: string
visible: boolean
remark: string
createTime: string
}

View File

@ -0,0 +1,27 @@
import { defHttp } from '@/config/axios'
import type { DataSourceConfigVO } from './types'
// 查询数据源配置列表
export const getDataSourceConfigListApi = () => {
return defHttp.get<DataSourceConfigVO[]>({ url: '/infra/data-source-config/list' })
}
// 查询数据源配置详情
export const getDataSourceConfigApi = (id: number) => {
return defHttp.get<DataSourceConfigVO>({ url: '/infra/data-source-config/get?id=' + id })
}
// 新增数据源配置
export const createDataSourceConfigApi = (params: DataSourceConfigVO) => {
return defHttp.post({ url: '/infra/data-source-config/create', params })
}
// 修改数据源配置
export const updateDataSourceConfigApi = (params: DataSourceConfigVO) => {
return defHttp.put({ url: '/infra/data-source-config/update', params })
}
// 删除数据源配置
export const deleteDataSourceConfigApi = (id: number) => {
return defHttp.delete({ url: '/infra/data-source-config/delete?id=' + id })
}

View File

@ -0,0 +1,8 @@
export type DataSourceConfigVO = {
id: number
name: string
url: string
username: string
password: string
createTime: string
}

View File

@ -0,0 +1,16 @@
import { defHttp } from '@/config/axios'
// 导出Html
export const exportHtmlApi = () => {
return defHttp.get({ url: '/infra/db-doc/export-html', responseType: 'blob' })
}
// 导出Word
export const exportWordApi = () => {
return defHttp.get({ url: '/infra/db-doc/export-word', responseType: 'blob' })
}
// 导出Markdown
export const exportMarkdownApi = () => {
return defHttp.get({ url: '/infra/db-doc/export-markdown', responseType: 'blob' })
}

View File

@ -0,0 +1,12 @@
import { defHttp } from '@/config/axios'
import type { FileVO } from './types'
// 查询文件列表
export const getFilePageApi = ({ params }) => {
return defHttp.get<PageResult<FileVO>>({ url: '/infra/file/page', params })
}
// 删除文件
export const deleteFileApi = (id: number) => {
return defHttp.delete({ url: '/infra/file/delete?id=' + id })
}

View File

@ -0,0 +1,8 @@
export type FileVO = {
id: number
path: string
url: string
size: string
type: string
createTime: string
}

View File

@ -0,0 +1,37 @@
import { defHttp } from '@/config/axios'
import type { FileConfigVO } from './types'
// 查询文件配置列表
export const getFileConfigPageApi = ({ params }) => {
return defHttp.get<PageResult<FileConfigVO>>({ url: '/infra/file-config/page', params })
}
// 查询文件配置详情
export const getFileConfigApi = (id: number) => {
return defHttp.get<FileConfigVO>({ url: '/infra/file-config/get?id=' + id })
}
// 更新文件配置为主配置
export const updateFileConfigMasterApi = (id: number) => {
return defHttp.get<FileConfigVO>({ url: '/infra/file-config/update-master?id=' + id })
}
// 新增文件配置
export const createFileConfigApi = (params: FileConfigVO) => {
return defHttp.post({ url: '/infra/file-config/create', params })
}
// 修改文件配置
export const updateFileConfigApi = (params: FileConfigVO) => {
return defHttp.put({ url: '/infra/file-config/update', params })
}
// 删除文件配置
export const deleteFileConfigApi = (id: number) => {
return defHttp.delete({ url: '/infra/file-config/delete?id=' + id })
}
// 测试文件配置
export const testFileConfigApi = (id: number) => {
return defHttp.get({ url: '/infra/file-config/test?id=' + id })
}

View File

@ -0,0 +1,23 @@
export type ConfigType = {
basePath: string
host: string
port: string
username: string
password: string
mode: string
endpoint: string
bucket: string
accessKey: string
accessSecret: string
domain: string
}
export type FileConfigVO = {
id: number
name: string
storage: string
primary: number
visible: boolean
config: ConfigType
remark: string
createTime: string
}

View File

@ -0,0 +1,55 @@
import { defHttp } from '@/config/axios'
import type { JobVO } from './types'
// 任务列表
export const getJobPageApi = ({ params }) => {
return defHttp.get<PageResult<JobVO>>({ url: '/infra/job/page', params })
}
// 任务详情
export const getJobApi = (id: number) => {
return defHttp.get<JobVO>({ url: '/infra/job/get?id=' + id })
}
// 新增任务
export const createJobApi = (params: JobVO) => {
return defHttp.post({ url: '/infra/job/create', params })
}
// 修改定时任务调度
export const updateJobApi = (params: JobVO) => {
return defHttp.put({ url: '/infra/job/update', params })
}
// 删除定时任务调度
export const deleteJobApi = (id: number) => {
return defHttp.delete({ url: '/infra/job/delete?id=' + id })
}
// 导出定时任务调度
export const exportJobApi = (params) => {
return defHttp.get({
url: '/infra/job/export-excel',
params,
responseType: 'blob'
})
}
// 任务状态修改
export const updateJobStatusApi = (id: number, status: number) => {
const data = {
id,
status
}
return defHttp.put({ url: '/infra/job/update-status', data: data })
}
// 定时任务立即执行一次
export const runJobApi = (id: number) => {
return defHttp.put({ url: '/infra/job/trigger?id=' + id })
}
// 获得定时任务的下 n 次执行时间
export const getJobNextTimesApi = (id: number) => {
return defHttp.get({ url: '/infra/job/get_next_times?id=' + id })
}

View File

@ -0,0 +1,12 @@
export type JobVO = {
id: number
name: string
status: number
handlerName: string
handlerParam: string
cronExpression: string
retryCount: number
retryInterval: number
monitorTimeout: number
createTime: string
}

View File

@ -0,0 +1,21 @@
import { defHttp } from '@/config/axios'
import type { JobLogVO } from './types'
// 任务日志列表
export const getJobLogPageApi = ({ params }) => {
return defHttp.get<PageResult<JobLogVO>>({ url: '/infra/job-log/page', params })
}
// 任务日志详情
export const getJobLogApi = (id: number) => {
return defHttp.get<JobLogVO>({ url: '/infra/job-log/get?id=' + id })
}
// 导出定时任务日志
export const exportJobLogApi = (params) => {
return defHttp.get({
url: '/infra/job-log/export-excel',
params,
responseType: 'blob'
})
}

View File

@ -0,0 +1,13 @@
export type JobLogVO = {
id: number
jobId: number
handlerName: string
handlerParam: string
cronExpression: string
executeIndex: string
beginTime: Date
endTime: Date
duration: string
status: number
createTime: string
}

View File

@ -0,0 +1,16 @@
import { defHttp } from '@/config/axios'
import { RedisKeyInfo, RedisMonitorInfoVO } from '@/api/infra/redis/types'
/**
* 获取redis 监控信息
*/
export const redisMonitorInfo = () => {
return defHttp.get<RedisMonitorInfoVO>({ url: '/infra/redis/get-monitor-info' })
}
/**
* 获取redis key列表
*/
export const redisKeysInfo = () => {
return defHttp.get<RedisKeyInfo[]>({ url: '/infra/redis/get-key-list' })
}

View File

@ -0,0 +1,185 @@
export interface RedisMonitorInfoVO {
info: RedisInfoVO
dbSize: number
commandStats: RedisCommandStatsVO[]
}
export interface RedisInfoVO {
io_threaded_reads_processed: string
tracking_clients: string
uptime_in_seconds: string
cluster_connections: string
current_cow_size: string
maxmemory_human: string
aof_last_cow_size: string
master_replid2: string
mem_replication_backlog: string
aof_rewrite_scheduled: string
total_net_input_bytes: string
rss_overhead_ratio: string
hz: string
current_cow_size_age: string
redis_build_id: string
errorstat_BUSYGROUP: string
aof_last_bgrewrite_status: string
multiplexing_api: string
client_recent_max_output_buffer: string
allocator_resident: string
mem_fragmentation_bytes: string
aof_current_size: string
repl_backlog_first_byte_offset: string
tracking_total_prefixes: string
redis_mode: string
redis_git_dirty: string
aof_delayed_fsync: string
allocator_rss_bytes: string
repl_backlog_histlen: string
io_threads_active: string
rss_overhead_bytes: string
total_system_memory: string
loading: string
evicted_keys: string
maxclients: string
cluster_enabled: string
redis_version: string
repl_backlog_active: string
mem_aof_buffer: string
allocator_frag_bytes: string
io_threaded_writes_processed: string
instantaneous_ops_per_sec: string
used_memory_human: string
total_error_replies: string
role: string
maxmemory: string
used_memory_lua: string
rdb_current_bgsave_time_sec: string
used_memory_startup: string
used_cpu_sys_main_thread: string
lazyfree_pending_objects: string
aof_pending_bio_fsync: string
used_memory_dataset_perc: string
allocator_frag_ratio: string
arch_bits: string
used_cpu_user_main_thread: string
mem_clients_normal: string
expired_time_cap_reached_count: string
unexpected_error_replies: string
mem_fragmentation_ratio: string
aof_last_rewrite_time_sec: string
master_replid: string
aof_rewrite_in_progress: string
lru_clock: string
maxmemory_policy: string
run_id: string
latest_fork_usec: string
tracking_total_items: string
total_commands_processed: string
expired_keys: string
errorstat_ERR: string
used_memory: string
module_fork_in_progress: string
errorstat_WRONGPASS: string
aof_buffer_length: string
dump_payload_sanitizations: string
mem_clients_slaves: string
keyspace_misses: string
server_time_usec: string
executable: string
lazyfreed_objects: string
db0: string
used_memory_peak_human: string
keyspace_hits: string
rdb_last_cow_size: string
aof_pending_rewrite: string
used_memory_overhead: string
active_defrag_hits: string
tcp_port: string
uptime_in_days: string
used_memory_peak_perc: string
current_save_keys_processed: string
blocked_clients: string
total_reads_processed: string
expire_cycle_cpu_milliseconds: string
sync_partial_err: string
used_memory_scripts_human: string
aof_current_rewrite_time_sec: string
aof_enabled: string
process_supervised: string
master_repl_offset: string
used_memory_dataset: string
used_cpu_user: string
rdb_last_bgsave_status: string
tracking_total_keys: string
atomicvar_api: string
allocator_rss_ratio: string
client_recent_max_input_buffer: string
clients_in_timeout_table: string
aof_last_write_status: string
mem_allocator: string
used_memory_scripts: string
used_memory_peak: string
process_id: string
master_failover_state: string
errorstat_NOAUTH: string
used_cpu_sys: string
repl_backlog_size: string
connected_slaves: string
current_save_keys_total: string
gcc_version: string
total_system_memory_human: string
sync_full: string
connected_clients: string
module_fork_last_cow_size: string
total_writes_processed: string
allocator_active: string
total_net_output_bytes: string
pubsub_channels: string
current_fork_perc: string
active_defrag_key_hits: string
rdb_changes_since_last_save: string
instantaneous_input_kbps: string
used_memory_rss_human: string
configured_hz: string
expired_stale_perc: string
active_defrag_misses: string
used_cpu_sys_children: string
number_of_cached_scripts: string
sync_partial_ok: string
used_memory_lua_human: string
rdb_last_save_time: string
pubsub_patterns: string
slave_expires_tracked_keys: string
redis_git_sha1: string
used_memory_rss: string
rdb_last_bgsave_time_sec: string
os: string
mem_not_counted_for_evict: string
active_defrag_running: string
rejected_connections: string
aof_rewrite_buffer_length: string
total_forks: string
active_defrag_key_misses: string
allocator_allocated: string
aof_base_size: string
instantaneous_output_kbps: string
second_repl_offset: string
rdb_bgsave_in_progress: string
used_cpu_user_children: string
total_connections_received: string
migrate_cached_sockets: string
}
export interface RedisCommandStatsVO {
command: string
calls: number
usec: number
}
export interface RedisKeyInfo {
keyTemplate: string
keyType: string
valueType: string
timeoutType: number
timeout: number
memo: string
}

View File

@ -0,0 +1,62 @@
import { defHttp } from '@/config/axios'
import { getRefreshToken } from '@/utils/auth'
import type { UserLoginVO, TokenType, UserInfoVO } from './types'
export interface CodeImgResult {
captchaOnOff: boolean
img: string
uuid: string
}
export interface SmsCodeVO {
mobile: string
scene: number
}
export interface SmsLoginVO {
mobile: string
code: string
}
// 获取验证码
export const getCodeImgApi = () => {
return defHttp.get<CodeImgResult>({ url: '/system/captcha/get-image' })
}
// 登录
export const loginApi = (params: UserLoginVO) => {
return defHttp.post<TokenType>({ url: '/system/auth/login', params })
}
// 刷新访问令牌
export const refreshToken = () => {
return defHttp.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() })
}
// 使用租户名,获得租户编号
export const getTenantIdByNameApi = (name: string) => {
return defHttp.get({ url: '/system/tenant/get-id-by-name?name=' + name })
}
// 登出
export const loginOutApi = () => {
return defHttp.delete({ url: '/system/auth/logout' })
}
// 获取用户权限信息
export const getInfoApi = () => {
return defHttp.get<UserInfoVO>({ url: '/system/auth/get-permission-info' })
}
// 路由
export const getAsyncRoutesApi = () => {
return defHttp.get({ url: '/system/auth/list-menus' })
}
//获取登录验证码
export const sendSmsCodeApi = (params: SmsCodeVO) => {
return defHttp.post({ url: '/system/auth/send-sms-code', params })
}
// 短信验证码登录
export const smsLoginApi = (params: SmsLoginVO) => {
return defHttp.post({ url: '/system/auth/sms-login', params })
}

View File

@ -0,0 +1,43 @@
export type UserLoginVO = {
username: string
password: string
code: string
uuid: string
}
export type TokenType = {
id: number // 编号
accessToken: string // 访问令牌
refreshToken: string // 刷新令牌
userId: number // 用户编号
userType: number //用户类型
clientId: string //客户端编号
expiresTime: number //过期时间
}
export type UserVO = {
id: number
username: string
nickname: string
deptId: number
email: string
mobile: string
sex: number
avatar: string
loginIp: string
loginDate: string
}
export type UserInfoVO = {
permissions: []
roles: []
user: {
avatar: string
id: number
nickname: string
}
}
export type TentantNameVO = {
name: string
}

View File

@ -0,0 +1,46 @@
import { defHttp } from '@/config/axios'
import type { AppVO } from './types'
// 查询列表支付应用
export const getAppPageApi = ({ params }) => {
return defHttp.get<PageResult<AppVO>>({ url: '/pay/app/page', params })
}
// 查询详情支付应用
export const getAppApi = (id: number) => {
return defHttp.get<AppVO>({ url: '/pay/app/get?id=' + id })
}
// 新增支付应用
export const createAppApi = (params: AppVO) => {
return defHttp.post({ url: '/pay/app/create', params })
}
// 修改支付应用
export const updateAppApi = (params: AppVO) => {
return defHttp.put({ url: '/pay/app/update', params })
}
// 支付应用信息状态修改
export const changeAppStatusApi = (id: number, status: number) => {
const data = {
id,
status
}
return defHttp.put({ url: '/pay/app/update-status', data: data })
}
// 删除支付应用
export const deleteAppApi = (id: number) => {
return defHttp.delete({ url: '/pay/app/delete?id=' + id })
}
// 导出支付应用
export const exportAppApi = (params) => {
return defHttp.get({ url: '/pay/app/export-excel', params, responseType: 'blob' })
}
// 根据商ID称搜索应用列表
export const getAppListByMerchantIdApi = (merchantId: number) => {
return defHttp.get({ url: '/pay/app/list-merchant-id', params: { merchantId: merchantId } })
}

View File

@ -0,0 +1,11 @@
export type AppVO = {
id: number
name: string
status: number
remark: string
payNotifyUrl: string
refundNotifyUrl: string
merchantName: string
merchantId: number
createTime: string
}

View File

@ -0,0 +1,37 @@
import { defHttp } from '@/config/axios'
import type { ChannelVO } from './types'
// 查询列表支付渠道
export const getChannelPageApi = ({ params }) => {
return defHttp.get<PageResult<ChannelVO>>({ url: '/pay/channel/page', params })
}
// 查询详情支付渠道
export const getChannelApi = (merchantId: number, appId: string, code: string) => {
const params = {
merchantId: merchantId,
appId: appId,
code: code
}
return defHttp.get<ChannelVO>({ url: '/pay/channel/get-channel', params: params })
}
// 新增支付渠道
export const createChannelApi = (params: ChannelVO) => {
return defHttp.post({ url: '/pay/channel/create', params })
}
// 修改支付渠道
export const updateChannelApi = (params: ChannelVO) => {
return defHttp.put({ url: '/pay/channel/update', params })
}
// 删除支付渠道
export const deleteChannelApi = (id: number) => {
return defHttp.delete({ url: '/pay/channel/delete?id=' + id })
}
// 导出支付渠道
export const exportChannelApi = (params) => {
return defHttp.get({ url: '/pay/channel/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,11 @@
export type ChannelVO = {
id: number
code: string
config: string
status: number
remark: string
feeRate: number
merchantId: number
appId: number
createTime: string
}

View File

@ -0,0 +1,50 @@
import { defHttp } from '@/config/axios'
import type { MerchantVO } from './types'
// 查询列表支付商户
export const getMerchantPageApi = ({ params }) => {
return defHttp.get<PageResult<MerchantVO>>({ url: '/pay/merchant/page', params })
}
// 查询详情支付商户
export const getMerchantApi = (id: number) => {
return defHttp.get<MerchantVO>({ url: '/pay/merchant/get?id=' + id })
}
// 根据商户名称搜索商户列表
export const getMerchantListByNameApi = (name: string) => {
return defHttp.get<MerchantVO>({
url: '/pay/merchant/list-by-name?id=',
params: {
name: name
}
})
}
// 新增支付商户
export const createMerchantApi = (params: MerchantVO) => {
return defHttp.post({ url: '/pay/merchant/create', params })
}
// 修改支付商户
export const updateMerchantApi = (params: MerchantVO) => {
return defHttp.put({ url: '/pay/merchant/update', params })
}
// 删除支付商户
export const deleteMerchantApi = (id: number) => {
return defHttp.delete({ url: '/pay/merchant/delete?id=' + id })
}
// 导出支付商户
export const exportMerchantApi = (params) => {
return defHttp.get({ url: '/pay/merchant/export-excel', params, responseType: 'blob' })
}
// 支付商户状态修改
export const changeMerchantStatusApi = (id: number, status: number) => {
const data = {
id,
status
}
return defHttp.put({ url: '/pay/merchant/update-status', data: data })
}

View File

@ -0,0 +1,9 @@
export type MerchantVO = {
id: number
no: string
name: string
shortName: string
status: number
remark: string
createTime: string
}

View File

@ -0,0 +1,32 @@
import { defHttp } from '@/config/axios'
import type { OrderVO } from './types'
// 查询列表支付订单
export const getOrderPageApi = ({ params }) => {
return defHttp.get<PageResult<OrderVO>>({ url: '/pay/order/page', params })
}
// 查询详情支付订单
export const getOrderApi = (id: number) => {
return defHttp.get<OrderVO>({ url: '/pay/order/get?id=' + id })
}
// 新增支付订单
export const createOrderApi = (params: OrderVO) => {
return defHttp.post({ url: '/pay/order/create', params })
}
// 修改支付订单
export const updateOrderApi = (params: OrderVO) => {
return defHttp.put({ url: '/pay/order/update', params })
}
// 删除支付订单
export const deleteOrderApi = (id: number) => {
return defHttp.delete({ url: '/pay/order/delete?id=' + id })
}
// 导出支付订单
export const exportOrderApi = (params) => {
return defHttp.get({ url: '/pay/order/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,26 @@
export type OrderVO = {
id: number
merchantId: number
appId: number
channelId: number
channelCode: string
merchantOrderId: string
subject: string
body: string
notifyUrl: string
notifyStatus: number
amount: number
channelFeeRate: number
channelFeeAmount: number
status: number
userIp: string
expireTime: string
successTime: string
notifyTime: string
successExtensionId: number
refundStatus: number
refundTimes: number
refundAmount: number
channelUserId: string
channelOrderNo: string
}

View File

@ -0,0 +1,32 @@
import { defHttp } from '@/config/axios'
import type { RefundVO } from './types'
// 查询列表退款订单
export const getRefundPageApi = ({ params }) => {
return defHttp.get<PageResult<RefundVO>>({ url: '/pay/refund/page', params })
}
// 查询详情退款订单
export const getRefundApi = (id: number) => {
return defHttp.get<RefundVO>({ url: '/pay/refund/get?id=' + id })
}
// 新增退款订单
export const createRefundApi = (params: RefundVO) => {
return defHttp.post({ url: '/pay/refund/create', params })
}
// 修改退款订单
export const updateRefundApi = (params: RefundVO) => {
return defHttp.put({ url: '/pay/refund/update', params })
}
// 删除退款订单
export const deleteRefundApi = (id: number) => {
return defHttp.delete({ url: '/pay/refund/delete?id=' + id })
}
// 导出退款订单
export const exportRefundApi = (params) => {
return defHttp.get({ url: '/pay/refund/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,26 @@
export type RefundVO = {
id: number
merchantId: number
appId: number
channelId: number
channelCode: string
merchantOrderId: string
subject: string
body: string
notifyUrl: string
notifyStatus: number
amount: number
channelFeeRate: number
channelFeeAmount: number
status: number
userIp: string
expireTime: string
successTime: string
notifyTime: string
successExtensionId: number
refundStatus: number
refundTimes: number
refundAmount: number
channelUserId: string
channelOrderNo: string
}

View File

@ -0,0 +1,32 @@
import { defHttp } from '@/config/axios'
import type { DeptVO } from './types'
// 查询部门(精简)列表
export const listSimpleDeptApi = () => {
return defHttp.get({ url: '/system/dept/list-all-simple' })
}
// 查询部门列表
export const getDeptPageApi = ({ params }) => {
return defHttp.get<PageResult<DeptVO>>({ url: '/system/dept/list', params })
}
// 查询部门详情
export const getDeptApi = (id: number) => {
return defHttp.get<DeptVO>({ url: '/system/dept/get?id=' + id })
}
// 新增部门
export const createDeptApi = (params: DeptVO) => {
return defHttp.post({ url: '/system/dept/create', data: params })
}
// 修改部门
export const updateDeptApi = (params: DeptVO) => {
return defHttp.put({ url: '/system/dept/update', data: params })
}
// 删除部门
export const deleteDeptApi = (id: number) => {
return defHttp.delete({ url: '/system/dept/delete?id=' + id })
}

View File

@ -0,0 +1,7 @@
export type DeptVO = {
id: number
name: string
status: number
parentId: number
createTime: string
}

View File

@ -0,0 +1,36 @@
import { defHttp } from '@/config/axios'
import type { DictDataVO } from './types'
// 查询字典数据(精简)列表
export const listSimpleDictDataApi = () => {
return defHttp.get({ url: '/system/dict-data/list-all-simple' })
}
// 查询字典数据列表
export const getDictDataPageApi = ({ params }) => {
return defHttp.get<PageResult<DictDataVO>>({ url: '/system/dict-data/page', params })
}
// 查询字典数据详情
export const getDictDataApi = (id: number) => {
return defHttp.get({ url: '/system/dict-data/get?id=' + id })
}
// 新增字典数据
export const createDictDataApi = (params: DictDataVO) => {
return defHttp.post({ url: '/system/dict-data/create', params })
}
// 修改字典数据
export const updateDictDataApi = (params: DictDataVO) => {
return defHttp.put({ url: '/system/dict-data/update', params })
}
// 删除字典数据
export const deleteDictDataApi = (id: number) => {
return defHttp.delete({ url: '/system/dict-data/delete?id=' + id })
}
// 导出字典类型数据
export const exportDictDataApi = (params: DictDataVO) => {
return defHttp.get({ url: '/system/dict-data/export', params })
}

View File

@ -0,0 +1,36 @@
import { defHttp } from '@/config/axios'
import type { DictTypeVO } from './types'
// 查询字典(精简)列表
export const listSimpleDictTypeApi = () => {
return defHttp.get({ url: '/system/dict-type/list-all-simple' })
}
// 查询字典列表
export const getDictTypePageApi = ({ params }) => {
return defHttp.get<PageResult<DictTypeVO>>({ url: '/system/dict-type/page', params })
}
// 查询字典详情
export const getDictTypeApi = (id: number) => {
return defHttp.get({ url: '/system/dict-type/get?id=' + id })
}
// 新增字典
export const createDictTypeApi = (params: DictTypeVO) => {
return defHttp.post({ url: '/system/dict-type/create', params })
}
// 修改字典
export const updateDictTypeApi = (params: DictTypeVO) => {
return defHttp.put({ url: '/system/dict-type/update', params })
}
// 删除字典
export const deleteDictTypeApi = (id: number) => {
return defHttp.delete({ url: '/system/dict-type/delete?id=' + id })
}
// 导出字典类型
export const exportDictTypeApi = (params: DictTypeVO) => {
return defHttp.get({ url: '/system/dict-type/export', params })
}

View File

@ -0,0 +1,21 @@
export type DictTypeVO = {
id: number
name: string
type: string
status: number
remark: string
createTime: string
}
export type DictDataVO = {
id: number
sort: number
label: string
value: string
dictType: string
status: number
colorType: string
cssClass: string
remark: string
createTime: string
}

View File

@ -0,0 +1,31 @@
import { defHttp } from '@/config/axios'
import type { ErrorCodeVO } from './types'
// 查询错误码列表
export const getErrorCodePageApi = ({ params }) => {
return defHttp.get<PageResult<ErrorCodeVO>>({ url: '/system/error-code/page', params })
}
// 查询错误码详情
export const getErrorCodeApi = (id: number) => {
return defHttp.get<ErrorCodeVO>({ url: '/system/error-code/get?id=' + id })
}
// 新增错误码
export const createErrorCodeApi = (params: ErrorCodeVO) => {
return defHttp.post({ url: '/system/error-code/create', params })
}
// 修改错误码
export const updateErrorCodeApi = (params: ErrorCodeVO) => {
return defHttp.put({ url: '/system/error-code/update', params })
}
// 删除错误码
export const deleteErrorCodeApi = (id: number) => {
return defHttp.delete({ url: '/system/error-code/delete?id=' + id })
}
// 导出错误码
export const excelErrorCodeApi = (params) => {
return defHttp.get({ url: '/system/error-code/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,9 @@
export type ErrorCodeVO = {
id: number
type: number
applicationName: string
code: number
message: string
memo: string
createTime: string
}

View File

@ -0,0 +1,11 @@
import { defHttp } from '@/config/axios'
import type { LoginLogVO } from './types'
// 查询登录日志列表
export const getLoginLogPageApi = ({ params }) => {
return defHttp.get<PageResult<LoginLogVO>>({ url: '/system/login-log/page', params })
}
// 导出登录日志
export const exportLoginLogApi = (params) => {
return defHttp.get({ url: '/system/login-log/export', params, responseType: 'blob' })
}

View File

@ -0,0 +1,11 @@
export type LoginLogVO = {
id: number
logType: number
traceId: number
userType: number
username: string
status: number
userIp: string
userAgent: string
createTime: string
}

View File

@ -0,0 +1,31 @@
import { defHttp } from '@/config/axios'
import type { MenuVO } from './types'
// 查询菜单(精简)列表
export const listSimpleMenusApi = () => {
return defHttp.get({ url: '/system/menu/list-all-simple' })
}
// 查询菜单列表
export const getMenuListApi = (params) => {
return defHttp.get({ url: '/system/menu/list', params })
}
// 获取菜单详情
export const getMenuApi = (id: number) => {
return defHttp.get<MenuVO>({ url: '/system/menu/get?id=' + id })
}
// 新增菜单
export const createMenuApi = (params: MenuVO) => {
return defHttp.post({ url: '/system/menu/create', params })
}
// 修改菜单
export const updateMenuApi = (params: MenuVO) => {
return defHttp.put({ url: '/system/menu/update', params })
}
// 删除菜单
export const deleteMenuApi = (id: number) => {
return defHttp.delete({ url: '/system/menu/delete?id=' + id })
}

View File

@ -0,0 +1,15 @@
export type MenuVO = {
id: number
name: string
permission: string
type: number
sort: number
parentId: number
path: string
icon: string
component: string
status: number
visible: boolean
keepAlive: boolean
createTime: string
}

View File

@ -0,0 +1,27 @@
import { defHttp } from '@/config/axios'
import type { NoticeVO } from './types'
// 查询公告列表
export const getNoticePageApi = ({ params }) => {
return defHttp.get<PageResult<NoticeVO>>({ url: '/system/notice/page', params })
}
// 查询公告详情
export const getNoticeApi = (id: number) => {
return defHttp.get<NoticeVO>({ url: '/system/notice/get?id=' + id })
}
// 新增公告
export const createNoticeApi = (params: NoticeVO) => {
return defHttp.post({ url: '/system/notice/create', params })
}
// 修改公告
export const updateNoticeApi = (params: NoticeVO) => {
return defHttp.put({ url: '/system/notice/update', params })
}
// 删除公告
export const deleteNoticeApi = (id: number) => {
return defHttp.delete({ url: '/system/notice/delete?id=' + id })
}

View File

@ -0,0 +1,12 @@
export type NoticeVO = {
id: number
title: string
type: number
content: string
status: number
remark: string
creator: string
createTime: string
updater: string
updateTime: string
}

View File

@ -0,0 +1,27 @@
import { defHttp } from '@/config/axios'
import { OAuth2ClientVo } from './client.types'
// 查询 OAuth2列表
export const getOAuth2ClientPageApi = ({ params }) => {
return defHttp.get<PageResult<OAuth2ClientVo>>({ url: '/system/oauth2-client/page', params })
}
// 查询 OAuth2详情
export const getOAuth2ClientApi = (id: number) => {
return defHttp.get<OAuth2ClientVo>({ url: '/system/oauth2-client/get?id=' + id })
}
// 新增 OAuth2
export const createOAuth2ClientApi = (params: OAuth2ClientVo) => {
return defHttp.post({ url: '/system/oauth2-client/create', params })
}
// 修改 OAuth2
export const updateOAuth2ClientApi = (params: OAuth2ClientVo) => {
return defHttp.put({ url: '/system/oauth2-client/update', params })
}
// 删除 OAuth2
export const deleteOAuth2ClientApi = (id: number) => {
return defHttp.delete({ url: '/system/oauth2-client/delete?id=' + id })
}

View File

@ -0,0 +1,20 @@
export type OAuth2ClientVo = {
id: number
clientId: string
secret: string
name: string
logo: string
description: string
status: number
accessTokenValiditySeconds: number
refreshTokenValiditySeconds: number
redirectUris: string[]
autoApprove: boolean
authorizedGrantTypes: string[]
scopes: string[]
authorities: string[]
resourceIds: string[]
additionalInformation: string
isAdditionalInformationJson: boolean
createTime: string
}

View File

@ -0,0 +1,12 @@
import { defHttp } from '@/config/axios'
import { OAuth2TokenVo } from './token.types'
// 查询 token列表
export const getAccessTokenPageApi = ({ params }) => {
return defHttp.get<PageResult<OAuth2TokenVo>>({ url: '/system/oauth2-token/page', params })
}
// 删除 token
export const deleteAccessTokenApi = (accessToken: number) => {
return defHttp.delete({ url: '/system/oauth2-token/delete?accessToken=' + accessToken })
}

View File

@ -0,0 +1,10 @@
export type OAuth2TokenVo = {
id: number
accessToken: string
refreshToken: string
userId: number
userType: number
clientId: string
createTime: string
expiresTime: string
}

View File

@ -0,0 +1,11 @@
import { defHttp } from '@/config/axios'
import type { OperateLogVO } from './types'
// 查询操作日志列表
export const getOperateLogPageApi = ({ params }) => {
return defHttp.get<PageResult<OperateLogVO>>({ url: '/system/operate-log/page', params })
}
// 导出操作日志
export const exportOperateLogApi = (params) => {
return defHttp.get({ url: '/system/operate-log/export', params, responseType: 'blob' })
}

View File

@ -0,0 +1,22 @@
export type OperateLogVO = {
id: number
userNickname: string
traceId: string
userId: number
module: string
name: string
type: number
content: string
exts: object
requestMethod: string
requestUrl: string
userIp: string
userAgent: string
javaMethod: string
javaMethodArgs: string
startTime: string
duration: number
resultCode: number
resultMsg: string
resultData: string
}

View File

@ -0,0 +1,36 @@
import { defHttp } from '@/config/axios'
import type { PostVO } from './types'
// 查询岗位列表
export const getPostPageApi = ({ params }) => {
return defHttp.get<PageResult<PostVO>>({ url: '/system/post/page', params })
}
// 获取岗位精简信息列表
export const listSimplePostsApi = () => {
return defHttp.get<PostVO[]>({ url: '/system/post/list-all-simple' })
}
// 查询岗位详情
export const getPostApi = (id: number) => {
return defHttp.get<PostVO>({ url: '/system/post/get?id=' + id })
}
// 新增岗位
export const createPostApi = (params: PostVO) => {
return defHttp.post({ url: '/system/post/create', params })
}
// 修改岗位
export const updatePostApi = (params: PostVO) => {
return defHttp.put({ url: '/system/post/update', params })
}
// 删除岗位
export const deletePostApi = (id: number) => {
return defHttp.delete({ url: '/system/post/delete?id=' + id })
}
// 导出岗位
export const exportPostApi = (params) => {
return defHttp.get({ url: '/system/post/export', params, responseType: 'blob' })
}

View File

@ -0,0 +1,9 @@
export type PostVO = {
id: number
name: string
code: string
sort: number
status: number
remark: string
createTime: string
}

View File

@ -0,0 +1,32 @@
import { defHttp } from '@/config/axios'
import type { RoleVO } from './types'
// 查询角色列表
export const getRolePageApi = ({ params }) => {
return defHttp.get<PageResult<RoleVO>>({ url: '/system/role/page', params })
}
// 查询角色详情
export const getRoleApi = (id: number) => {
return defHttp.get<RoleVO>({ url: '/system/role/get?id=' + id })
}
// 新增角色
export const createRoleApi = (params: RoleVO) => {
return defHttp.post({ url: '/system/role/create', params })
}
// 修改角色
export const updateRoleApi = (params: RoleVO) => {
return defHttp.put({ url: '/system/role/update', params })
}
// 修改角色状态
export const updateRoleStatusApi = (params: RoleVO) => {
return defHttp.put({ url: '/system/role/update-status', params })
}
// 删除角色
export const deleteRoleApi = (id: number) => {
return defHttp.delete({ url: '/system/role/delete?id=' + id })
}

View File

@ -0,0 +1,9 @@
export type RoleVO = {
id: number
name: string
code: string
sort: number
status: number
type: number
createTime: string
}

View File

@ -0,0 +1,42 @@
import { defHttp } from '@/config/axios'
import type { SensitiveWordVO } from './types'
// 查询敏感词列表
export const getSensitiveWordPageApi = ({ params }) => {
return defHttp.get<PageResult<SensitiveWordVO>>({ url: '/system/sensitive-word/page', params })
}
// 查询敏感词详情
export const getSensitiveWordApi = (id: number) => {
return defHttp.get<SensitiveWordVO>({ url: '/system/sensitive-word/get?id=' + id })
}
// 新增敏感词
export const createSensitiveWordApi = (params: SensitiveWordVO) => {
return defHttp.post({ url: '/system/sensitive-word/create', params })
}
// 修改敏感词
export const updateSensitiveWordApi = (params: SensitiveWordVO) => {
return defHttp.put({ url: '/system/sensitive-word/update', params })
}
// 删除敏感词
export const deleteSensitiveWordApi = (id: number) => {
return defHttp.delete({ url: '/system/sensitive-word/delete?id=' + id })
}
// 导出敏感词
export const exportSensitiveWordApi = (params) => {
return defHttp.get({ url: '/system/sensitive-word/export', params, responseType: 'blob' })
}
// 获取所有敏感词的标签数组
export const getSensitiveWordTagsApi = () => {
return defHttp.get<SensitiveWordVO>({ url: '/system/sensitive-word/get-tags' })
}
// 获得文本所包含的不合法的敏感词数组
export const validateTextApi = (id: number) => {
return defHttp.get<SensitiveWordVO>({ url: '/system/sensitive-word/validate-text?' + id })
}

View File

@ -0,0 +1,9 @@
export type SensitiveWordVO = {
id: number
name: string
status: number
description: string
tags: string
type: number
createTime: string
}

View File

@ -0,0 +1,32 @@
import { defHttp } from '@/config/axios'
import type { SmsChannelVO } from './types'
// 查询短信渠道列表
export const getSmsChannelPageApi = ({ params }) => {
return defHttp.get<PageResult<SmsChannelVO>>({ url: '/system/sms-channel/page', params })
}
// 获得短信渠道精简列表
export function getSimpleSmsChannels() {
return defHttp.get({ url: '/system/sms-channel/list-all-simple' })
}
// 查询短信渠道详情
export const getSmsChannelApi = (id: number) => {
return defHttp.get<SmsChannelVO>({ url: '/system/sms-channel/get?id=' + id })
}
// 新增短信渠道
export const createSmsChannelApi = (params: SmsChannelVO) => {
return defHttp.post({ url: '/system/sms-channel/create', params })
}
// 修改短信渠道
export const updateSmsChannelApi = (params: SmsChannelVO) => {
return defHttp.put({ url: '/system/sms-channel/update', params })
}
// 删除短信渠道
export const deleteSmsChannelApi = (id: number) => {
return defHttp.delete({ url: '/system/sms-channel/delete?id=' + id })
}

View File

@ -0,0 +1,10 @@
export type SmsChannelVO = {
id: number
status: number
signature: string
remark: string
apiKey: string
apiSecret: string
callbackUrl: string
createTime: string
}

View File

@ -0,0 +1,12 @@
import { defHttp } from '@/config/axios'
import type { SmsLogVO } from './types'
// 查询短信日志列表
export const getSmsLogPageApi = ({ params }) => {
return defHttp.get<PageResult<SmsLogVO>>({ url: '/system/sms-log/page', params })
}
// 导出短信日志
export const exportSmsLogApi = (params) => {
return defHttp.get({ url: '/system/sms-log/export', params, responseType: 'blob' })
}

View File

@ -0,0 +1,9 @@
export type SmsLogVO = {
id: number
idchannelId: number
templateId: number
mobile: string
sendStatus: number
receiveStatus: number
createTime: string
}

View File

@ -0,0 +1,37 @@
import { defHttp } from '@/config/axios'
import type { SmsTemplateVO, SmsSendVO } from './types'
// 查询短信模板列表
export const getSmsTemplatePageApi = ({ params }) => {
return defHttp.get<PageResult<SmsTemplateVO>>({ url: '/system/sms-template/page', params })
}
// 查询短信模板详情
export const getSmsTemplateApi = (id: number) => {
return defHttp.get<SmsTemplateVO>({ url: '/system/sms-template/get?id=' + id })
}
// 新增短信模板
export const createSmsTemplateApi = (params: SmsTemplateVO) => {
return defHttp.post({ url: '/system/sms-template/create', params })
}
// 修改短信模板
export const updateSmsTemplateApi = (params: SmsTemplateVO) => {
return defHttp.put({ url: '/system/sms-template/update', params })
}
// 删除短信模板
export const deleteSmsTemplateApi = (id: number) => {
return defHttp.delete({ url: '/system/sms-template/delete?id=' + id })
}
// 发送短信
export function sendSms(params: SmsSendVO) {
return defHttp.post({ url: '/system/sms-template/send-sms', params })
}
// 导出短信模板
export const exportPostApi = (params) => {
return defHttp.get({ url: '/system/sms-template/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,19 @@
export type SmsTemplateVO = {
id: number
type: number
status: number
code: string
name: string
content: string
remark: string
apiTemplateId: string
channelId: number
channelCode: string
createTime: string
}
export type SmsSendVO = {
mobile: string
templateCode: string
templateParams: string
}

View File

@ -0,0 +1,32 @@
import { defHttp } from '@/config/axios'
import type { TenantVO } from './types'
// 查询租户列表
export const getTenantPageApi = ({ params }) => {
return defHttp.get<PageResult<TenantVO>>({ url: '/system/tenant/page', params })
}
// 查询租户详情
export const getTenantApi = (id: number) => {
return defHttp.get<TenantVO>({ url: '/system/tenant/get?id=' + id })
}
// 新增租户
export const createTenantApi = (params: TenantVO) => {
return defHttp.post({ url: '/system/tenant/create', params })
}
// 修改租户
export const updateTenantApi = (params: TenantVO) => {
return defHttp.put({ url: '/system/tenant/update', params })
}
// 删除租户
export const deleteTenantApi = (id: number) => {
return defHttp.delete({ url: '/system/tenant/delete?id=' + id })
}
// 导出租户
export const exportTenantApi = (params) => {
return defHttp.get({ url: '/system/tenant/export-excel', params, responseType: 'blob' })
}

View File

@ -0,0 +1,12 @@
export type TenantVO = {
id: number
name: string
packageId: number
contactName: string
contactMobile: string
accountCount: number
expireTime: string
domain: string
status: number
createTime: string
}

View File

@ -0,0 +1,33 @@
import { defHttp } from '@/config/axios'
import type { TenantPackageVO } from './types'
// 查询租户套餐列表
export const getTenantPackageTypePageApi = ({ params }) => {
return defHttp.get<PageResult<TenantPackageVO>>({ url: '/system/tenant-package/page', params })
}
// 获得租户
export const getTenantPackageApi = (id: number) => {
return defHttp.get<TenantPackageVO>({ url: '/system/tenant-package/get?id=' + id })
}
// 新增租户套餐
export const createTenantPackageTypeApi = (params: TenantPackageVO) => {
return defHttp.post({ url: '/system/tenant-package/create', params })
}
// 修改租户套餐
export const updateTenantPackageTypeApi = (params: TenantPackageVO) => {
return defHttp.put({ url: '/system/tenant-package/update', params })
}
// 删除租户套餐
export const deleteTenantPackageTypeApi = (id: number) => {
return defHttp.delete({ url: '/system/tenant-package/delete?id=' + id })
}
// // 获取租户套餐精简信息列表
export const getTenantPackageList = () => {
return defHttp.get({
url: '/system/tenant-package/get-simple-list'
})
}

View File

@ -0,0 +1,11 @@
export type TenantPackageVO = {
id: number
name: string
status: number
remark: string
creator: string
createTime: string
updater: string
updateTime: string
menuIds: string[]
}

View File

@ -0,0 +1,68 @@
import { defHttp } from '@/config/axios'
import type { UserVO } from './types'
// 查询用户管理列表
export const getUserPageApi = ({ params }) => {
return defHttp.get<PageResult<UserVO>>({ url: '/system/user/page', params })
}
// 查询用户详情
export const getUserApi = (id: number) => {
return defHttp.get<UserVO>({ url: '/system/user/get?id=' + id })
}
// 新增用户
export const createUserApi = (params: UserVO) => {
return defHttp.post({ url: '/system/user/create', params })
}
// 修改用户
export const updateUserApi = (params: UserVO) => {
return defHttp.put({ url: '/system/user/update', params })
}
// 删除用户
export const deleteUserApi = (id: number) => {
return defHttp.delete({ url: '/system/user/delete?id=' + id })
}
// 导出用户
export const exportUserApi = (params) => {
return defHttp.get({ url: '/system/user/export', params, responseType: 'blob' })
}
// 下载用户导入模板
export const importUserTemplateApi = () => {
return defHttp.get({ url: '/system/user/get-import-template', responseType: 'blob' })
}
// 用户密码重置
export const resetUserPwdApi = (userId: number, password: number) => {
const data = {
userId,
password
}
return defHttp.put({
url: '/system/user/resetPwd',
data: data
})
}
// 用户状态修改
export const updateUserStatusApi = (id: number, status: number) => {
const data = {
id,
status
}
return defHttp.put({ url: '/system/user/update-status', data: data })
}
// 查询授权角色
export const getAuthRoleApi = (userId: string) => {
return defHttp.get({ url: '/system/user/authRole/' + userId })
}
// 保存授权角色
export const updateAuthRoleApi = (data: any) => {
return defHttp.put({ url: '/system/user/authRole', params: data })
}

View File

@ -0,0 +1,28 @@
import { defHttp } from '@/config/axios'
import { ProfileVO } from './types'
// 查询用户个人信息
export const getUserProfileApi = () => {
return defHttp.get<ProfileVO>({ url: '/system/user/profile/get' })
}
// 修改用户个人信息
export const updateUserProfileApi = ({ params }) => {
return defHttp.put({ url: '/system/user/profile/update', params })
}
// 用户密码重置
export const updateUserPwdApi = (oldPassword: string, newPassword: string) => {
return defHttp.put({
url: '/system/user/profile/update-password',
params: {
oldPassword: oldPassword,
newPassword: newPassword
}
})
}
// 用户头像上传
export const uploadAvatarApi = (data) => {
return defHttp.put({ url: '/system/user/profile/update-avatar', data: data })
}

View File

@ -0,0 +1,42 @@
export type ProfileDept = {
id: number
name: string
}
export type ProfileRole = {
id: number
name: string
}
export type ProfilePost = {
id: number
name: string
}
export type SocialUser = {
id: number
type: number
openid: string
token: string
rawTokenInfo: string
nickname: string
avatar: string
rawUserInfo: string
code: string
state: string
}
export type ProfileVO = {
id: number
username: string
nickname: string
dept: ProfileDept
roles: ProfileRole[]
posts: ProfilePost[]
socialUsers: SocialUser[]
email: string
mobile: string
sex: number
avatar: string
status: number
remark: string
loginIp: string
loginDate: Date
createTime: Date
}

View File

@ -0,0 +1,16 @@
export type UserVO = {
id: number
username: string
nickname: string
deptId: number
postIds: string[]
email: string
mobile: string
sex: number
avatar: string
loginIp: string
status: number
remark: string
loginDate: string
createTime: string
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M115.147.062a13 13 0 0 1 4.94.945c1.55.63 2.907 1.526 4.069 2.688a13.148 13.148 0 0 1 2.761 4.069c.678 1.55 1.017 3.245 1.017 5.086v102.3c0 3.681-1.187 6.733-3.56 9.155-2.373 2.422-5.352 3.633-8.937 3.633H12.992c-3.875 0-7-1.26-9.373-3.779-2.373-2.518-3.56-5.667-3.56-9.445V12.704c0-3.39 1.163-6.345 3.488-8.863C5.872 1.32 8.972.062 12.847.062h102.3zM81.434 109.047c1.744 0 3.003-.412 3.778-1.235.775-.824 1.163-1.914 1.163-3.27 0-1.26-.388-2.325-1.163-3.197-.775-.872-2.034-1.307-3.778-1.307H72.57c.097-.194.145-.485.145-.872V27.09h9.01c1.743 0 2.954-.436 3.633-1.308.678-.872 1.017-1.938 1.017-3.197 0-1.26-.34-2.325-1.017-3.197-.679-.872-1.89-1.308-3.633-1.308H46.268c-1.743 0-2.954.436-3.632 1.308-.678.872-1.018 1.938-1.018 3.197 0 1.26.34 2.325 1.018 3.197.678.872 1.889 1.308 3.632 1.308h8.138v72.075c0 .193.024.339.073.436.048.096.072.242.072.436H46.56c-1.744 0-3.003.435-3.778 1.307-.775.872-1.163 1.938-1.163 3.197 0 1.356.388 2.446 1.163 3.27.775.823 2.034 1.235 3.778 1.235h34.875z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="5760" height="3040"><image width="5760" height="3040" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAFoAAAAvgAQMAAAC1QKagAAAABGdBTUEAALGPC/xhBQAAACBjSFJN AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEUsNEr///91v/yPAAAA AWJLR0QB/wIt3gAAAAd0SU1FB+YBBQYyN1c3BnEAAAhjSURBVHja7cExAQAAAMKg9U9tDB+gAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAACAtwFzzwABY3VrRQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wMS0wNVQwNjo1 MDo1MyswMDowMCfNlVoAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDEtMDVUMDY6NTA6NTQrMDA6 MDCTNxNoAAAAAElFTkSuQmCC"/></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M0 20.967v59.59c0 11.59 8.537 20.966 19.075 20.966h28.613l1 26.477L76.8 101.523h32.125c10.538 0 19.075-9.377 19.075-20.966v-59.59C128 9.377 119.463 0 108.925 0h-89.85C8.538 0 0 9.377 0 20.967zm82.325 33.1c0-5.524 4.013-9.935 9.037-9.935 5.026 0 9.038 4.41 9.038 9.934 0 5.524-4.025 9.934-9.038 9.934-5.024 0-9.037-4.41-9.037-9.934zm-27.613 0c0-5.524 4.013-9.935 9.038-9.935s9.037 4.41 9.037 9.934c0 5.524-4.025 9.934-9.037 9.934-5.025 0-9.038-4.41-9.038-9.934zm-27.1 0c0-5.524 4.013-9.935 9.038-9.935s9.038 4.41 9.038 9.934c0 5.524-4.026 9.934-9.05 9.934-5.013 0-9.025-4.41-9.025-9.934z"/></svg>

After

Width:  |  Height:  |  Size: 669 B

View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M54.122 127.892v-28.68H7.513V87.274h46.609v-12.4H7.513v-12.86h38.003L.099 0h22.6l32.556 45.07c3.617 5.144 6.44 9.611 8.487 13.385 1.788-3.05 4.89-7.779 9.301-14.186L103.93 0h24.01L82.385 62.013h38.34v12.862h-46.41v12.4h46.41v11.937h-46.41v28.68H54.123z"/></svg>

After

Width:  |  Height:  |  Size: 335 B

View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M95.648 118.762c0 5.035-3.563 9.121-7.979 9.121H7.98c-4.416 0-7.979-4.086-7.979-9.121C0 100.519 15.408 83.47 31.152 76.75c-9.099-6.43-15.216-17.863-15.216-30.987v-9.128c0-20.16 14.293-36.518 31.893-36.518s31.894 16.358 31.894 36.518v9.122c0 13.137-6.123 24.556-15.216 30.993 15.738 6.726 31.141 23.769 31.141 42.012z"/><path d="M106.032 118.252h15.867c3.376 0 6.101-3.125 6.101-6.972 0-13.957-11.787-26.984-23.819-32.123 6.955-4.919 11.638-13.66 11.638-23.704v-6.985c0-15.416-10.928-27.926-24.39-27.926-1.674 0-3.306.193-4.89.561 1.936 4.713 3.018 9.974 3.018 15.526v9.121c0 13.137-3.056 23.111-11.066 30.993 14.842 4.41 27.312 23.42 27.541 41.509z"/></svg>

After

Width:  |  Height:  |  Size: 731 B

View File

@ -0,0 +1 @@
<svg width="128" height="128" xmlns="http://www.w3.org/2000/svg"><path d="M42.913 101.36c1.642 0 3.198.332 4.667.996a12.28 12.28 0 0 1 3.89 2.772c1.123 1.184 1.987 2.582 2.592 4.193.605 1.612.908 3.318.908 5.118 0 1.8-.303 3.507-.908 5.118-.605 1.611-1.469 3.01-2.593 4.194a13.3 13.3 0 0 1-3.889 2.843 10.582 10.582 0 0 1-4.667 1.066c-1.729 0-3.306-.355-4.732-1.066a13.604 13.604 0 0 1-3.825-2.843c-1.123-1.185-1.988-2.583-2.593-4.194a14.437 14.437 0 0 1-.907-5.118c0-1.8.302-3.506.907-5.118.605-1.61 1.47-3.009 2.593-4.193a12.515 12.515 0 0 1 3.825-2.772c1.426-.664 3.003-.996 4.732-.996zm53.932.285c1.643 0 3.22.331 4.733.995a11.386 11.386 0 0 1 3.889 2.772c1.08 1.185 1.945 2.583 2.593 4.194.648 1.61.972 3.317.972 5.118 0 1.8-.324 3.506-.972 5.117-.648 1.611-1.513 3.01-2.593 4.194a12.253 12.253 0 0 1-3.89 2.843 11 11 0 0 1-4.732 1.066 10.58 10.58 0 0 1-4.667-1.066 12.478 12.478 0 0 1-3.824-2.843c-1.08-1.185-1.945-2.583-2.593-4.194a13.581 13.581 0 0 1-.973-5.117c0-1.801.325-3.507.973-5.118.648-1.611 1.512-3.01 2.593-4.194a11.559 11.559 0 0 1 3.824-2.772 11.212 11.212 0 0 1 4.667-.995zm21.781-80.747c2.42 0 4.3.355 5.64 1.066 1.34.71 2.29 1.587 2.852 2.63a6.427 6.427 0 0 1 .778 3.34c-.044 1.185-.195 2.204-.454 3.057-.26.853-.8 2.606-1.62 5.26a589.268 589.268 0 0 1-2.788 8.743 1236.373 1236.373 0 0 0-3.047 9.453c-.994 3.128-1.75 5.592-2.269 7.393-1.123 3.79-2.55 6.42-4.278 7.89-1.728 1.469-3.846 2.203-6.352 2.203H39.023l1.945 12.795h65.342c4.148 0 6.223 1.943 6.223 5.828 0 1.896-.41 3.53-1.232 4.905-.821 1.374-2.442 2.061-4.862 2.061H38.505c-1.729 0-3.176-.426-4.343-1.28-1.167-.852-2.14-1.966-2.917-3.34a21.277 21.277 0 0 1-1.88-4.478 44.128 44.128 0 0 1-1.102-4.55c-.087-.568-.324-1.942-.713-4.122-.39-2.18-.865-4.904-1.426-8.174l-1.88-10.947c-.692-4.027-1.383-8.079-2.075-12.154-1.642-9.572-3.5-20.234-5.574-31.986H6.87c-1.296 0-2.377-.356-3.24-1.067a9.024 9.024 0 0 1-2.14-2.558 10.416 10.416 0 0 1-1.167-3.2C.108 8.53 0 7.488 0 6.54c0-1.896.583-3.46 1.75-4.69C2.917.615 4.494 0 6.482 0h13.095c1.728 0 3.111.284 4.148.853 1.037.569 1.858 1.28 2.463 2.132a8.548 8.548 0 0 1 1.297 2.701c.26.948.475 1.754.648 2.417.173.758.346 1.825.519 3.199.173 1.374.345 2.772.518 4.193.26 1.706.519 3.507.778 5.403h88.678z"/></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,3 @@
import Backtop from './src/Backtop.vue'
export { Backtop }

View File

@ -0,0 +1,15 @@
<script setup lang="ts">
import { ElBacktop } from 'element-plus'
import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls, variables } = useDesign()
const prefixCls = getPrefixCls('backtop')
</script>
<template>
<ElBacktop
:class="`${prefixCls}-backtop`"
:target="`.${variables.namespace}-layout-content-scrollbar .${variables.elNamespace}-scrollbar__wrap`"
/>
</template>

View File

@ -0,0 +1,3 @@
import Breadcrumb from './src/Breadcrumb.vue'
export { Breadcrumb }

View File

@ -0,0 +1,127 @@
<script lang="tsx">
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
import { ref, watch, computed, unref, defineComponent, TransitionGroup } from 'vue'
import { useRouter } from 'vue-router'
import { usePermissionStore } from '@/store/modules/permission'
import { filterBreadcrumb } from './helper'
import { filter, treeToList } from '@/utils/tree'
import type { RouteLocationNormalizedLoaded, RouteMeta } from 'vue-router'
import { useI18n } from '@/hooks/web/useI18n'
import { Icon } from '@/components/Icon'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('breadcrumb')
const appStore = useAppStore()
// 面包屑图标
const breadcrumbIcon = computed(() => appStore.getBreadcrumbIcon)
export default defineComponent({
name: 'Breadcrumb',
setup() {
const { currentRoute } = useRouter()
const { t } = useI18n()
const levelList = ref<AppRouteRecordRaw[]>([])
const permissionStore = usePermissionStore()
const menuRouters = computed(() => {
const routers = permissionStore.getRouters
return filterBreadcrumb(routers)
})
const getBreadcrumb = () => {
const currentPath = currentRoute.value.path
levelList.value = filter<AppRouteRecordRaw>(unref(menuRouters), (node: AppRouteRecordRaw) => {
return node.path === currentPath
})
}
const renderBreadcrumb = () => {
const breadcrumbList = treeToList<AppRouteRecordRaw[]>(unref(levelList))
return breadcrumbList.map((v) => {
const disabled = v.redirect === 'noredirect'
const meta = v.meta as RouteMeta
return (
<ElBreadcrumbItem to={{ path: disabled ? '' : v.path }} key={v.name}>
{meta?.icon && breadcrumbIcon.value ? (
<>
<Icon icon={meta.icon} class="mr-[5px]"></Icon> {t(v?.meta?.title)}
</>
) : (
t(v?.meta?.title)
)}
</ElBreadcrumbItem>
)
})
}
watch(
() => currentRoute.value,
(route: RouteLocationNormalizedLoaded) => {
if (route.path.startsWith('/redirect/')) {
return
}
getBreadcrumb()
},
{
immediate: true
}
)
return () => (
<ElBreadcrumb separator="/" class={`${prefixCls} flex items-center h-full ml-[10px]`}>
<TransitionGroup appear enter-active-class="animate__animated animate__fadeInRight">
{renderBreadcrumb()}
</TransitionGroup>
</ElBreadcrumb>
)
}
})
</script>
<style lang="less" scoped>
@prefix-cls: ~'@{elNamespace}-breadcrumb';
.@{prefix-cls} {
:deep(&__item) {
display: flex;
.@{prefix-cls}__inner {
display: flex;
align-items: center;
color: var(--top-header-text-color);
&:hover {
color: var(--el-color-primary);
}
}
}
:deep(&__item):not(:last-child) {
.@{prefix-cls}__inner {
color: var(--top-header-text-color);
&:hover {
color: var(--el-color-primary);
}
}
}
:deep(&__item):last-child {
.@{prefix-cls}__inner {
color: var(--el-text-color-placeholder);
&:hover {
color: var(--el-text-color-placeholder);
}
}
}
}
</style>

View File

@ -0,0 +1,31 @@
import { pathResolve } from '@/utils/routerHelper'
import type { RouteMeta } from 'vue-router'
export const filterBreadcrumb = (
routes: AppRouteRecordRaw[],
parentPath = ''
): AppRouteRecordRaw[] => {
const res: AppRouteRecordRaw[] = []
for (const route of routes) {
const meta = route?.meta as RouteMeta
if (meta.hidden && !meta.canTo) {
continue
}
const data: AppRouteRecordRaw =
!meta.alwaysShow && route.children?.length === 1
? { ...route.children[0], path: pathResolve(route.path, route.children[0].path) }
: { ...route }
data.path = pathResolve(parentPath, data.path)
if (data.children) {
data.children = filterBreadcrumb(data.children, data.path)
}
if (data) {
res.push(data)
}
}
return res
}

View File

@ -0,0 +1,3 @@
import Collapse from './src/Collapse.vue'
export { Collapse }

View File

@ -0,0 +1,35 @@
<script setup lang="ts">
import { computed, unref } from 'vue'
import { useAppStore } from '@/store/modules/app'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('collapse')
defineProps({
color: propTypes.string.def('')
})
const appStore = useAppStore()
const collapse = computed(() => appStore.getCollapse)
const toggleCollapse = () => {
const collapsed = unref(collapse)
appStore.setCollapse(!collapsed)
}
</script>
<template>
<div :class="prefixCls">
<Icon
:size="18"
:icon="collapse ? 'ep:expand' : 'ep:fold'"
:color="color"
class="cursor-pointer"
@click="toggleCollapse"
/>
</div>
</template>

View File

@ -0,0 +1,3 @@
import ConfigGlobal from './src/ConfigGlobal.vue'
export { ConfigGlobal }

View File

@ -0,0 +1,62 @@
<script setup lang="ts">
import { provide, computed, watch, onMounted } from 'vue'
import { propTypes } from '@/utils/propTypes'
import { ElConfigProvider } from 'element-plus'
import { useLocaleStore } from '@/store/modules/locale'
import { useWindowSize } from '@vueuse/core'
import { useAppStore } from '@/store/modules/app'
import { setCssVar } from '@/utils'
import { useDesign } from '@/hooks/web/useDesign'
const { variables } = useDesign()
const appStore = useAppStore()
const props = defineProps({
size: propTypes.oneOf<ElememtPlusSize[]>(['default', 'small', 'large']).def('default')
})
provide('configGlobal', props)
// 初始化所有主题色
onMounted(() => {
appStore.setCssVarTheme()
})
const { width } = useWindowSize()
// 监听窗口变化
watch(
() => width.value,
(width: number) => {
if (width < 768) {
!appStore.getMobile ? appStore.setMobile(true) : undefined
setCssVar('--left-menu-min-width', '0')
appStore.setCollapse(true)
appStore.getLayout !== 'classic' ? appStore.setLayout('classic') : undefined
} else {
appStore.getMobile ? appStore.setMobile(false) : undefined
setCssVar('--left-menu-min-width', '64px')
}
},
{
immediate: true
}
)
// 多语言相关
const localeStore = useLocaleStore()
const currentLocale = computed(() => localeStore.currentLocale)
</script>
<template>
<ElConfigProvider
:namespace="variables.elNamespace"
:locale="currentLocale.elLocale"
:message="{ max: 1 }"
:size="size"
>
<slot></slot>
</ElConfigProvider>
</template>

View File

@ -0,0 +1,3 @@
import ContentDetailWrap from './src/ContentDetailWrap.vue'
export { ContentDetailWrap }

View File

@ -0,0 +1,59 @@
<script setup lang="ts">
import { ElCard } from 'element-plus'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
import { ref, onMounted, defineEmits } from 'vue'
import { Sticky } from '@/components/Sticky'
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('content-detail-wrap')
defineProps({
title: propTypes.string.def(''),
message: propTypes.string.def('')
})
const emit = defineEmits(['back'])
const offset = ref(85)
const contentDetailWrap = ref()
onMounted(() => {
offset.value = contentDetailWrap.value.getBoundingClientRect().top
})
</script>
<template>
<div :class="[`${prefixCls}-container`, 'relative bg-[#fff]']" ref="contentDetailWrap">
<Sticky :offset="offset">
<div
:class="[
`${prefixCls}-header`,
'flex border-bottom-1 h-50px items-center text-center bg-white pr-10px'
]"
>
<div :class="[`${prefixCls}-header__back`, 'flex pl-10px pr-10px ']">
<ElButton @click="emit('back')">
<Icon icon="ep:arrow-left" class="mr-5px" />
{{ t('common.back') }}
</ElButton>
</div>
<div :class="[`${prefixCls}-header__title`, 'flex flex-1 justify-center']">
<slot name="title">
<label class="text-16px font-700">{{ title }}</label>
</slot>
</div>
<div :class="[`${prefixCls}-header__right`, 'flex pl-10px pr-10px']">
<slot name="right"></slot>
</div>
</div>
</Sticky>
<div style="padding: var(--app-content-padding)">
<ElCard :class="[`${prefixCls}-body`, 'mb-20px']" shadow="never">
<div>
<slot></slot>
</div>
</ElCard>
</div>
</div>
</template>

View File

@ -0,0 +1,3 @@
import ContentWrap from './src/ContentWrap.vue'
export { ContentWrap }

View File

@ -0,0 +1,33 @@
<script setup lang="ts">
import { ElCard, ElTooltip } from 'element-plus'
import { propTypes } from '@/utils/propTypes'
import { useDesign } from '@/hooks/web/useDesign'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('content-wrap')
defineProps({
title: propTypes.string.def(''),
message: propTypes.string.def('')
})
</script>
<template>
<ElCard :class="[prefixCls, 'mb-20px']" shadow="never">
<template v-if="title" #header>
<div class="flex items-center">
<span class="text-16px font-700">{{ title }}</span>
<ElTooltip v-if="message" effect="dark" placement="right">
<template #content>
<div class="max-w-200px">{{ message }}</div>
</template>
<Icon class="ml-5px" icon="ep:question-filled" :size="14" />
</ElTooltip>
</div>
</template>
<div>
<slot></slot>
</div>
</ElCard>
</template>

View File

@ -0,0 +1,10 @@
import ContextMenu from './src/ContextMenu.vue'
import { ElDropdown } from 'element-plus'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
export interface ContextMenuExpose {
elDropdownMenuRef: ComponentRef<typeof ElDropdown>
tagItem: RouteLocationNormalizedLoaded
}
export { ContextMenu }

View File

@ -0,0 +1,72 @@
<script setup lang="ts">
import { ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus'
import { PropType, ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useDesign } from '@/hooks/web/useDesign'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('context-menu')
const { t } = useI18n()
const emit = defineEmits(['visibleChange'])
const props = defineProps({
schema: {
type: Array as PropType<contextMenuSchema[]>,
default: () => []
},
trigger: {
type: String as PropType<'click' | 'hover' | 'focus' | 'contextmenu'>,
default: 'contextmenu'
},
tagItem: {
type: Object as PropType<RouteLocationNormalizedLoaded>,
default: () => ({})
}
})
const command = (item: contextMenuSchema) => {
item.command && item.command(item)
}
const visibleChange = (visible: boolean) => {
emit('visibleChange', visible, props.tagItem)
}
const elDropdownMenuRef = ref<ComponentRef<typeof ElDropdown>>()
defineExpose({
elDropdownMenuRef,
tagItem: props.tagItem
})
</script>
<template>
<ElDropdown
ref="elDropdownMenuRef"
:class="prefixCls"
:trigger="trigger"
placement="bottom-start"
@command="command"
@visible-change="visibleChange"
popper-class="v-context-menu-popper"
>
<slot></slot>
<template #dropdown>
<ElDropdownMenu>
<ElDropdownItem
v-for="(item, index) in schema"
:key="`dropdown${index}`"
:divided="item.divided"
:disabled="item.disabled"
:command="item"
>
<Icon :icon="item.icon" /> {{ t(item.label) }}
</ElDropdownItem>
</ElDropdownMenu>
</template>
</ElDropdown>
</template>

Some files were not shown because too many files have changed in this diff Show More