Compare commits

...

56 Commits

Author SHA1 Message Date
wangxuefeng
99015ecbd2 chore: 更新底层引擎 2025-03-07 21:01:56 +08:00
wangxuefeng
db10bb6a6c feat: 设计器可获取天梯 token 2025-03-07 14:46:22 +08:00
wangxuefeng
8d0c890061 chore: 剔除跟登陆相关的无用逻辑 2025-03-07 10:08:16 +08:00
wangxuefeng
9d25cddcb3 feat: 用户通过天梯登陆 2025-03-07 10:06:58 +08:00
wangxuefeng
0852dd98f0 chore: 完成天梯登陆与登出 2025-03-06 17:58:47 +08:00
wangxuefeng
9b2c728d4c chore: 悦码v1增加环境配置 2025-03-06 10:28:14 +08:00
wangxuefeng
eecc2b1893 chore: 规范化常量配置 2025-03-05 18:30:41 +08:00
wangxuefeng
261dd5bb67 chore: 增加环境配置 2025-03-05 18:03:59 +08:00
wangxuefeng
47c9ec1aba feat: platform 接入天梯登陆的 依赖 2025-03-05 17:55:51 +08:00
wangxuefeng
dd69823a00 feat: 可通过配置入参来初始化编辑器 2025-03-05 14:34:40 +08:00
wangxuefeng
4f920b0ac2 chore: 统一包名为 y-code 前缀 2025-03-05 14:19:52 +08:00
wangxuefeng
3dabfbd3be chore: 统一升级 vite 依赖,增加预发布构建指令 2025-03-05 14:16:34 +08:00
wangxuefeng
1d7b28160a feat: 低代码平台的页面使用低代码平台自身来制作 2025-03-05 14:06:43 +08:00
wangxuefeng
2d202cd6d7 feat: 增加应用跟项目列表,包含增删改查功能 2025-03-04 19:05:07 +08:00
wangxuefeng
a78d892a57 feat: 渲染器实现异端请求 2025-03-04 15:01:54 +08:00
wangxuefeng
6fc133bb7d feat: 低代码平台增加应用列表 2025-03-04 14:46:19 +08:00
wangxuefeng
09ff94c188 chore: 调整环境配置 2025-03-03 18:39:15 +08:00
wangxuefeng
7c6a86edf6 chore: 统一各 app 的构建目录 2025-03-03 18:22:24 +08:00
wangxuefeng
7fb8f5b7f8 chore(designer): 统一构建目录到根目录 2025-03-03 17:41:47 +08:00
wangxuefeng
faa23bec88 chore(designer): 增加环境变量配置 2025-03-03 17:07:36 +08:00
wangxuefeng
e758bc3692 chore(renderer): 更新编译配置 2025-03-03 15:58:47 +08:00
wangxuefeng
e559b00716 chore: 更新构建配置,解决报错 2025-03-01 18:53:19 +08:00
wangxuefeng
8d979fe1e0 chore: 更新配置 2025-03-01 18:38:56 +08:00
wangxuefeng
c05abc92c1 chore: 删除用不上的配置文件 2025-03-01 18:14:31 +08:00
wangxuefeng
76ffef36cd feat:物料的 CRUD 功能完成 2025-03-01 18:14:09 +08:00
wangxuefeng
e052752694 feat: 低代码文件编辑历史记录 crud 功能完成 2025-03-01 15:38:53 +08:00
wangxuefeng
5c4aa42ecf chore: 渲染端通过 api 获取数据 2025-03-01 13:54:58 +08:00
wangxuefeng
50fed4a7dc chore: 最重要的 file 增删改查添加成功 2025-03-01 10:42:49 +08:00
wangxuefeng
384ea1f547 chore: 更新低代码引擎依赖,file 增删改查完成 2025-03-01 10:06:57 +08:00
wangxuefeng
9e012947fb chore: 更新依赖 2025-02-28 20:46:19 +08:00
wangxuefeng
cc6a1e6bc1 chore: 更新部分接口 2025-02-28 20:38:51 +08:00
wangxuefeng
2fa8ed74e5 chore: 新增一批接口 2025-02-28 17:14:32 +08:00
wangxuefeng
a835e266b5 chore: 请求目录模块化 2025-02-27 18:15:08 +08:00
wangxuefeng
dd3a590142 chore: 更新 lock 文件 2025-02-27 16:54:58 +08:00
wangxuefeng
0c0ce0697f chore: 批量更新 vtj 低代码引擎依赖 2025-02-27 16:40:08 +08:00
wangxuefeng
8e6d5887ac Revert "chore: 批量升级 axios 依赖,剔除无用的模板代码"
This reverts commit 51e1e3877a4a3c0859db5e758410321fc0bd8afc.
2025-02-27 16:24:41 +08:00
wangxuefeng
51e1e3877a chore: 批量升级 axios 依赖,剔除无用的模板代码 2025-02-27 16:03:02 +08:00
wangxuefeng
f7468bde86 chore: vtj 依赖更新,微应用集成 postmate 2025-02-26 17:26:19 +08:00
wangxuefeng
11018965bd fix: 修复渲染器无法调用 project 内定义的 api 2025-02-25 11:39:45 +08:00
wangxuefeng
e695a4bf4a feat: 编辑器预览功能 2025-02-20 17:38:00 +08:00
wangxuefeng
b15a13a223 chore: 配置全局删除依赖命令 2025-02-20 16:02:01 +08:00
wangxuefeng
af044793ab chore: 自定义低代码请求服务初始化 2025-02-20 11:56:06 +08:00
wangxuefeng
16b80fbcd8 chore: 子应用批更新 pnpm 约束版本号为 10.4.1 2025-02-20 10:38:59 +08:00
wangxuefeng
2dee199577 chore: 定义悦码版本为预发布 2.0.0-1 2025-02-20 10:36:47 +08:00
wangxuefeng
f9c02f8c85 chore: 约束 pnpm 至 10.4.1 2025-02-20 10:35:51 +08:00
wangxuefeng
19da7ce0dd chore: 整体优化 2025-02-19 21:15:15 +08:00
wangxuefeng
52a32bb31e chore: 增加 low-code-help 功能命令,让开发人员更傻瓜地利用工程 2025-02-19 16:29:42 +08:00
wangxuefeng
c3ebe3e15c chore: 工程能力增强,可交互式使用常用功能 2025-02-19 15:22:48 +08:00
wangxuefeng
eab709f94f refactor: 悦码项目重构 2025-02-19 13:42:56 +08:00
wangxuefeng
c8c9406fd5 chore: 更新 lock 文件 2025-02-10 19:05:02 +08:00
wangxuefeng
7af9b6b9e6 chore: 添加 semantic-release 配置实现自动化发布管理 2025-02-06 18:41:32 +08:00
wangxuefeng
e193238a54 chore: Update project version and theme configuration 2025-02-06 16:26:15 +08:00
wangxuefeng
7205868368 chore: 调整为紧凑布局,展示更多内容 2025-02-06 15:28:36 +08:00
wangxuefeng
38f9e74cdf chore: antd 全局改为紧凑布局 2025-02-06 11:54:13 +08:00
wangxuefeng
2cc93d4262 chore: 工程优化与构建工具迁移为 farm 2025-02-05 17:38:53 +08:00
wangxuefeng
dd8f7b52d2 chore: lodash 改为 lodash-es, 采用按需引入的方式使用 2025-02-05 15:12:26 +08:00
535 changed files with 47525 additions and 12486 deletions

8
.env Normal file
View File

@ -0,0 +1,8 @@
# 项目名称
VITE_APP_TITLE = Admin
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# enable mock in production
VITE_MOCK_IN_PROD = true

11
.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
# https://docs.github.com/cn/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# Automatically normalize line endings (to LF) for all text-based files.
* text=auto eol=lf
# Declare files that will always have CRLF line endings on checkout.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.{ico,png,jpg,jpeg,gif,webp,svg,woff,woff2} binary

44
.gitignore vendored
View File

@ -1,25 +1,41 @@
# Logs
logs
*.log
node_modules
.DS_Store
dist
.cache
.turbo
.nx
.nx/cache
tests/server/static
tests/server/static/upload
.local
# local env files
.env.local
.env.*.local
.eslintcache
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
*pnpm-debug.log*
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
# .vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
localSet.js
# auto generate file
types/auto-imports.d.ts
types/components.d.ts
# Turbo
.turbo
dist/
.eslintrc-auto-import.json

23
.npmrc
View File

@ -1 +1,22 @@
registry=http://sy-registry.shiyue.com
# 使用淘宝镜像源
registry = https://registry.npmmirror.com
@sy:registry=http://sy-registry.shiyue.com
# 根据需要提升含有以下的依赖包到根 node_modules 目录下
public-hoist-pattern[]=husky
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=@eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=lint-staged
public-hoist-pattern[]=*stylelint*
public-hoist-pattern[]=@commitlint*
public-hoist-pattern[]=core-js
# 提升所有依赖到根 node_modules 目录下,相当于 public-hoist-pattern[]=*,与上面一种方式一般二选一使用
# 极不推荐用这样的方式解决依赖问题,这样没有充分利用 pnpm 依赖访问安全性的优势,又走回了 npm / yarn 的老路。
# shamefully-hoist=true
enable-pre-post-scripts=true
engine-strict=true
package-manager-strict=false
strict-peer-dependencies=false

View File

@ -1,7 +0,0 @@
{
"recommendations": [
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint"
]
}

View File

@ -0,0 +1,3 @@
低代码相关接口文档: https://developer.shiyuegame.com/showdoc/web/#/231?page_id=15660
密码shiyuegame

8
apps/designer/.env Normal file
View File

@ -0,0 +1,8 @@
# 通用环境配置
ENV = 'development'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# base api url
VITE_BASE_API_URL = ''

View File

@ -0,0 +1,17 @@
# 只在开发模式中被载入
VITE_NODE_ENV = 'development'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# 前端可见变量(必须以 VITE_ 开头)
VITE_PORT = 10011
# VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
VITE_DEBUG_MODE = true
Y_CODE_PLATFORM_URL = 'https://localhost:10010/'
Y_CODE_DESIGNER_URL = 'https://localhost:10011/'
Y_CODE_RENDERER_URL = 'https://localhost:10012/'

View File

@ -0,0 +1,12 @@
# 只在生产模式中被载入
VITE_NODE_ENV = 'production'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
Y_CODE_PLATFORM_URL = 'https://y-code-platform.shiyuegame.com/'
Y_CODE_DESIGNER_URL = 'https://y-code-designer.shiyuegame.com/'
Y_CODE_RENDERER_URL = 'https://y-code-renderer.shiyuegame.com/'

View File

@ -0,0 +1,12 @@
# 只在预发布模式中被载入
VITE_NODE_ENV = 'staging'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# base api url
VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
Y_CODE_PLATFORM_URL = 'https://y-code-platform-pre.shiyue.com/'
Y_CODE_DESIGNER_URL = 'https://y-code-designer-pre.shiyue.com/'
Y_CODE_RENDERER_URL = 'https://y-code-renderer-pre.shiyue.com/'

33
apps/designer/.gitignore vendored Normal file
View File

@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.history
# Project
package-lock.json
yarn-lock.json
pnpm-lock.yaml
tsconfig.tsbuildinfo
node_modules
coverage
dist
dist-ssr
*.local
.vtj/logs
.vtj/histories

22
apps/designer/.npmrc Normal file
View File

@ -0,0 +1,22 @@
# 使用淘宝镜像源
registry = https://registry.npmmirror.com
@sy:registry=http://sy-registry.shiyue.com
# 根据需要提升含有以下的依赖包到根 node_modules 目录下
# public-hoist-pattern[]=husky
# public-hoist-pattern[]=*eslint*
# public-hoist-pattern[]=@eslint*
# public-hoist-pattern[]=*prettier*
# public-hoist-pattern[]=lint-staged
# public-hoist-pattern[]=*stylelint*
# public-hoist-pattern[]=@commitlint*
# public-hoist-pattern[]=core-js
# 提升所有依赖到根 node_modules 目录下,相当于 public-hoist-pattern[]=*,与上面一种方式一般二选一使用
# 极不推荐用这样的方式解决依赖问题,这样没有充分利用 pnpm 依赖访问安全性的优势,又走回了 npm / yarn 的老路。
# shamefully-hoist=true
enable-pre-post-scripts=true
engine-strict=true
package-manager-strict=false

20
apps/designer/.prettierrc Normal file
View File

@ -0,0 +1,20 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"bracketSameLine": true,
"endOfLine": "lf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": true,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false,
"vueIndentScriptAndStyle": false
}

5
apps/designer/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"vue.volar"
]
}

18
apps/designer/index.html Normal file
View File

@ -0,0 +1,18 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="/logo.svg" type="image/x-icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
http-equiv="Cache-Control"
content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>VTJ Web Project Template</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

View File

@ -0,0 +1,45 @@
{
"name": "@sy/y-code-designer",
"description": "低代码编辑器",
"private": true,
"version": "1.0.0-1",
"type": "module",
"scripts": {
"setup": "npm install --unsafe-perm --registry=https://registry.npmmirror.com",
"dev": "cross-env vite --mode development",
"build": "vite build --mode production",
"build:staging": "vite build --mode staging",
"preview": "vite preview",
"clean": "rimraf node_modules"
},
"dependencies": {
"@vtj/core": "^0.10.10",
"@vtj/designer": "0.10.10",
"@vtj/icons": "0.10.10",
"@vtj/local": "^0.10.10",
"@vtj/materials": "^0.10.10",
"@vtj/node": "0.10.2",
"@vtj/pro": "^0.10.10",
"@vtj/renderer": "^0.10.10",
"@vtj/ui": "^0.10.10",
"@vtj/utils": "0.10.10",
"@vtj/web": "^0.10.10",
"axios": "^1.8.1",
"element-plus": "^2.9.4",
"licia-es": "^1.46.0",
"pinia": "^3.0.1",
"pinia-plugin-persistedstate": "^4.2.0",
"postmate": "^1.5.2",
"unplugin-auto-import": "^19.1.1",
"vue": "~3.5.13",
"vue-router": "~4.5.0"
},
"devDependencies": {
"@sy/vite-plugin-http2-proxy": "workspace:*",
"@vtj/cli": "^0.10.2",
"vite": "^6.2.0",
"vite-plugin-mkcert": "^1.17.6",
"vitest": "^3.0.7"
},
"packageManager": "pnpm@10.4.1"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711803009570" class="icon" viewBox="0 0 1280 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1500" width="320" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M557.85 1023l-122-35.4c-12.8-3.6-20-17-16.4-29.8L692.45 17.4c3.6-12.8 17-20 29.8-16.4l122 35.4c12.8 3.6 20 17 16.4 29.8L587.65 1006.6c-3.8 12.8-17 20.2-29.8 16.4z m-228-224.4l87-92.8c9.2-9.8 8.6-25.4-1.6-34.4L234.05 512l181.2-159.4c10.2-9 11-24.6 1.6-34.4l-87-92.8c-9-9.6-24.2-10.2-34-1L7.65 494.4c-10.2 9.4-10.2 25.6 0 35l288.2 270.2c9.8 9.2 25 8.8 34-1z m654.4 1.2l288.2-270.2c10.2-9.4 10.2-25.6 0-35L984.25 224.2c-9.6-9-24.8-8.6-34 1L863.25 318c-9.2 9.8-8.6 25.4 1.6 34.4L1046.05 512l-181.2 159.4c-10.2 9-11 24.6-1.6 34.4l87 92.8c9 9.8 24.2 10.2 34 1.2z" fill="#0157fe" p-id="1501"></path></svg>

After

Width:  |  Height:  |  Size: 931 B

View File

@ -0,0 +1,7 @@
import { rm } from 'fs/promises';
console.log('开始清理...');
await rm('node_modules', { recursive: true, force: true });
await rm('dist', { recursive: true, force: true });
await rm('package-lock.json', { recursive: true, force: true });
await rm('pnpm-lock.yaml', { recursive: true, force: true });
console.log('开始完成!');

12
apps/designer/src/App.vue Normal file
View File

@ -0,0 +1,12 @@
<template>
<el-config-provider :locale="zhCn">
<Suspense>
<router-view></router-view>
</Suspense>
</el-config-provider>
</template>
<script lang="ts" setup>
import { ElConfigProvider } from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711803009570" class="icon" viewBox="0 0 1280 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1500" width="320" height="256" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M557.85 1023l-122-35.4c-12.8-3.6-20-17-16.4-29.8L692.45 17.4c3.6-12.8 17-20 29.8-16.4l122 35.4c12.8 3.6 20 17 16.4 29.8L587.65 1006.6c-3.8 12.8-17 20.2-29.8 16.4z m-228-224.4l87-92.8c9.2-9.8 8.6-25.4-1.6-34.4L234.05 512l181.2-159.4c10.2-9 11-24.6 1.6-34.4l-87-92.8c-9-9.6-24.2-10.2-34-1L7.65 494.4c-10.2 9.4-10.2 25.6 0 35l288.2 270.2c9.8 9.2 25 8.8 34-1z m654.4 1.2l288.2-270.2c10.2-9.4 10.2-25.6 0-35L984.25 224.2c-9.6-9-24.8-8.6-34 1L863.25 318c-9.2 9.8-8.6 25.4 1.6 34.4L1046.05 512l-181.2 159.4c-10.2 9-11 24.6-1.6 34.4l87 92.8c9 9.8 24.2 10.2 34 1.2z" fill="#0157fe" p-id="1501"></path></svg>

After

Width:  |  Height:  |  Size: 931 B

88
apps/designer/src/auto-imports.d.ts vendored Normal file
View File

@ -0,0 +1,88 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createPinia: typeof import('pinia')['createPinia']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const defineStore: typeof import('pinia')['defineStore']
const effectScope: typeof import('vue')['effectScope']
const getActivePinia: typeof import('pinia')['getActivePinia']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const mapActions: typeof import('pinia')['mapActions']
const mapGetters: typeof import('pinia')['mapGetters']
const mapState: typeof import('pinia')['mapState']
const mapStores: typeof import('pinia')['mapStores']
const mapWritableState: typeof import('pinia')['mapWritableState']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const setActivePinia: typeof import('pinia')['setActivePinia']
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const storeToRefs: typeof import('pinia')['storeToRefs']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useId: typeof import('vue')['useId']
const useLink: typeof import('vue-router')['useLink']
const useModel: typeof import('vue')['useModel']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSlots: typeof import('vue')['useSlots']
const useTemplateRef: typeof import('vue')['useTemplateRef']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
const watchPostEffect: typeof import('vue')['watchPostEffect']
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
}
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}

View File

@ -0,0 +1,2 @@
// @ts-ignore
export const currentEnv = __APP_ENV__;

View File

@ -0,0 +1 @@
export * from './env';

View File

@ -0,0 +1 @@
export const ACCESS_STORAGE_KEY = 'RRO_IDE_ACCESS_STORAGE__';

28
apps/designer/src/env.d.ts vendored Normal file
View File

@ -0,0 +1,28 @@
/// <reference types="vite/client" />
declare module '*.vue' {
import type { DefineComponent } from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}
declare namespace NodeJS {
interface ProcessEnv {
[key: string]: any;
}
}
declare module global {
interface Window {}
}
declare module 'vue' {
interface ComponentCustomProperties {
$uploader: any;
$reqeust: any;
$apis: any;
$libs: any;
}
}
export {};

View File

@ -0,0 +1,21 @@
import instance from './instance';
export const getApiList = async () => {
const response = await instance.get('/api/v1/api');
return response.data;
};
export const createApi = async (data: any) => {
const response = await instance.post('/api/v1/api', data);
return response.data;
};
export const updateApi = async (id: string, data: any) => {
const response = await instance.put(`/api/v1/api/${id}`, data);
return response.data;
};
export const deleteApi = async (id: string) => {
const response = await instance.delete(`/api/v1/api/${id}`);
return response.data;
};

View File

@ -0,0 +1,21 @@
import instance from './instance';
export const getApplicationList = async () => {
const response = await instance.get('/api/v1/applications');
return response.data;
};
export const createApplication = async (data: any) => {
const response = await instance.post('/api/v1/applications', data);
return response.data;
};
export const updateApplication = async (id: string, data: any) => {
const response = await instance.put(`/api/v1/applications/${id}`, data);
return response.data;
};
export const deleteApplication = async (id: string) => {
const response = await instance.delete(`/api/v1/applications/${id}`);
return response.data;
};

View File

@ -0,0 +1,21 @@
import instance from './instance';
export const getBlockList = async () => {
const response = await instance.get('/api/v1/blocks');
return response.data;
};
export const createBlock = async (data: any) => {
const response = await instance.post('/api/v1/blocks', data);
return response.data;
};
export const updateBlock = async (id: string, data: any) => {
const response = await instance.put(`/api/v1/blocks/${id}`, data);
return response.data;
};
export const deleteBlock = async (id: string) => {
const response = await instance.delete(`/api/v1/blocks/${id}`);
return response.data;
};

View File

@ -0,0 +1,91 @@
import { type BlockSchema } from '@vtj/core';
import instance from './instance';
import { fi } from 'element-plus/es/locale/index.mjs';
export type LowCodeFileSchema = {
project_id: number;
publish: boolean;
active: boolean;
dsl: BlockSchema;
file_path?: string;
file_id?: string;
};
function transformFile(file: LowCodeFileSchema): LowCodeFileSchema {
return {
project_id: file.project_id,
publish: file.publish,
active: file.active,
// @ts-ignore
dsl: JSON.stringify(file.dsl),
file_path: file.file_path,
file_id: file.file_id
};
}
export const getFileList = async () => {
const response = await instance.get('/api/v1/files');
return response.data;
};
export const getFile = async (id: string) => {
const response = await instance.get(`/api/v1/files/${id}`);
return response.data;
};
export const createFile = async (data: LowCodeFileSchema) => {
const response = await instance.post('/api/v1/files', transformFile(data));
return response.data;
};
export const updateFile = async (id: string, data: LowCodeFileSchema) => {
const response = await instance.put(
`/api/v1/files/${id}`,
transformFile(data)
);
return response.data;
};
type PublishResponse = {
code: string;
data: object;
id?: string;
message: string;
};
export const deleteFile = async (id: string) => {
const response = await instance.delete(`/api/v1/files/${id}`);
return response.data;
};
/**
*
* @param {number} projectId - ID
* @returns {Promise<any>} Promise对象
* @example
* // 发布项目ID为123的所有文件
* await publishAllFile(123)
*/
export const publishAllFile = async (
projectId: number
): Promise<PublishResponse> => {
const response = await instance.post('/api/v1/files/publish', {
project_id: projectId
});
return response.data;
};
/**
*
* @param {string} fileId - ID
* @returns {Promise<any>} Promise对象
* @example
* // 发布文件ID为45tnbgeme的文件
* await publishFile('45tnbgeme')
*/
export const publishFile = async (fileId: string): Promise<PublishResponse> => {
const response = await instance.post('/api/v1/files/publish-file', {
file_id: fileId
});
return response.data;
};

View File

@ -0,0 +1,76 @@
import instance from './instance';
import { type HistorySchema } from '@vtj/core';
export type LowCodeHistorySchema = {
project_id: number;
file_id: string;
history_id: string;
id?: string;
dsl?: HistorySchema;
};
function transformHistoryData(data: LowCodeHistorySchema) {
return {
...data,
dsl: JSON.stringify(data.dsl || {})
};
}
export type HistoriesResponse = {
code: number;
data: {
list: Array<{
id: number;
project_id: number;
file_id: string;
history_id: string;
dsl: Record<string, any>;
created_at: string;
updated_at: string;
}>;
total: number;
};
message: string;
};
export type GetHistoriesParams = {
project_id: number;
file_id: string;
page?: number;
per_page?: number;
};
export const getHistories = async (params: GetHistoriesParams) => {
const response = await instance.get<HistoriesResponse>('/api/v1/histories', {
params: {
project_id: params.project_id,
file_id: params.file_id,
...(params.page && { page: params.page }),
...(params.per_page && { per_page: params.per_page })
}
});
return response.data;
};
export const getHistory = async (id: string) => {
const response = await instance.get(`/api/v1/histories/${id}`);
return response.data;
};
export const createHistory = async (data: LowCodeHistorySchema) => {
const response = await instance.post(
'/api/v1/histories',
transformHistoryData(data)
);
return response.data;
};
export const updateHistory = async (id: string, data: any) => {
const response = await instance.put(`/api/v1/histories/${id}`, data);
return response.data;
};
export const deleteHistory = async (id: string) => {
const response = await instance.delete(`/api/v1/histories/${id}`);
return response.data;
};

View File

@ -0,0 +1,7 @@
export * from './api';
export * from './block';
export * from './file';
export * from './materials';
export * from './project';
export * from './application';
export * from './history';

View File

@ -0,0 +1,30 @@
import axios from 'axios';
const apiBase = import.meta.env.VITE_BASE_API_URL;
// 创建独立实例
const instance = axios.create({
baseURL: apiBase // 基础URL直接放在实例配置中
});
// 请求拦截器改为使用实例
instance.interceptors.request.use(
(config) => {
// 可在此处添加统一请求头等配置
return config;
},
(error) => {
return Promise.reject(error);
}
);
instance.interceptors.response.use(
(response) => {
return response.data;
},
(error) => {
return Promise.reject(error);
}
);
// 导出实例
export default instance;

View File

@ -0,0 +1,112 @@
import { type MaterialDescription } from '@vtj/core';
import instance from './instance';
// 定义响应类型
interface MaterialResponse {
code: number;
data: MaterialData | MaterialData[];
message: string;
}
/** 创建物料请求参数 */
interface CreateMaterialRequest {
project_id: number;
value: string;
}
/** 创建物料响应类型 */
interface CreateMaterialResponse {
code: number;
data: { id: string };
message: string;
}
/** 删除物料响应类型 */
interface DeleteMaterialResponse {
code: number;
data: { id: string };
message: string;
}
/**
*
* @param params
* @returns
*/
export const getMaterialsList = async (
params?: Record<string, any>
): Promise<MaterialResponse> => {
const response = await instance.get('/api/v1/materials', { params });
return response.data;
};
/**
* ID获取单个物料
* @param id ID
* @returns
*/
export const getMaterials = async (id: number): Promise<MaterialResponse> => {
const response = await instance.get(`/api/v1/materials/${id}`);
return response.data;
};
type MaterialData = {
project_id: number;
value: Record<string, MaterialDescription>;
// 从原interface合并的字段
id?: number;
name?: string;
created_at?: string;
updated_at?: string;
};
function transformMaterialData(data: MaterialData) {
return {
...data,
value: JSON.stringify(data.value)
};
}
/**
*
* @param data value JSON
* @example
* postMaterials({ project_id: 1, value: '{"Authorization": "Bearer token"}' })
*/
export const postMaterials = async (
data: MaterialData
): Promise<CreateMaterialResponse> => {
const response = await instance.post(
'/api/v1/materials',
transformMaterialData(data)
);
return response.data;
};
/**
*
* @param data
* @returns
*/
export const updateMaterials = async (data: MaterialData): Promise<any> => {
const response = await instance.put(
'/api/v1/materials',
transformMaterialData(data)
);
return response.data;
};
/**
*
* @param project_id ID
* @returns
* @example
* deleteMaterial('123').then(() => console.log('删除成功'))
*/
export const deleteMaterials = async (
project_id: number
): Promise<DeleteMaterialResponse> => {
const response = await instance.delete(`/api/v1/materials/${project_id}`);
return response.data;
};

View File

@ -0,0 +1,28 @@
import instance from './instance';
export const getProjectList = async (data?: Record<string, any>) => {
const response = await instance.get('/api/v1/projects', {
params: data
});
return response.data;
};
export const getProject = async (id: string) => {
const response = await instance.get(`/api/v1/projects/${id}`);
return response.data;
};
export const createProject = async (data: any) => {
const response = await instance.post('/api/v1/projects', data);
return response.data;
};
export const updateProject = async (id: string, data: any) => {
const response = await instance.put(`/api/v1/projects/${id}`, data);
return response.data;
};
export const deleteProject = async (id: string) => {
const response = await instance.delete(`/api/v1/projects/${id}`);
return response.data;
};

20
apps/designer/src/main.ts Normal file
View File

@ -0,0 +1,20 @@
import { createApp } from 'vue';
import { createPersistedState } from 'pinia-plugin-persistedstate';
import router from './router';
import App from './App.vue';
import './style/index.scss';
import { pinia } from './store';
// 添加持久化插件
pinia.use(
createPersistedState({
auto: true, // 自动持久化所有 store
storage: localStorage
})
);
const app = createApp(App);
app.use(router);
app.use(pinia);
app.mount('#app');

View File

@ -0,0 +1,31 @@
import { createRouter, createWebHashHistory } from 'vue-router';
const routes = [
{
path: '/',
name: 'home',
component: () => import('@/views/index.vue')
},
{
path: '/preview/:id',
name: 'preview',
component: () => import('@/views/preview.vue')
},
{
path: '/unauthorized',
name: 'Unauthorized',
component: () => import('@/views/unauthorized.vue')
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: () => import('@/views/not-found.vue')
}
];
const router = createRouter({
history: createWebHashHistory(),
routes
});
export default router;

View File

@ -0,0 +1,249 @@
// @ts-nocheck
import {
type ProjectSchema,
type BlockSchema,
type HistorySchema,
type HistoryItem,
type MaterialDescription,
type ExtensionConfig,
type PageFile,
type BlockFile,
type NodeFromPlugin,
ProjectModel,
HistoryModel
} from '@vtj/core';
import { mapToObject, Storage } from '@vtj/utils';
import { BaseService } from '@vtj/renderer';
import { isEmpty } from 'licia-es';
import {
getProject,
updateProject,
createFile,
updateFile as updateLowCodeFile,
getFile as getLowCodeFile,
deleteFile as deleteLowCodeFile,
getHistory as getLowCodeHistory,
deleteHistory as deleteLowCodeHistory,
createHistory as createLowCodeHistory,
getHistories as getLowCodeHistories,
publishFile as publishLowCodeFile,
publishAllFile as publishLowCodeAllFile,
getMaterials as getLowCodeMaterials,
postMaterials as postLowCodeMaterials,
updateMaterials as updateLowCodeMaterials,
deleteMaterials as deleteLowCodeMaterials
} from '@/io';
const storage = new Storage({
type: 'local',
expired: 0
});
const stringifyFields = [
'config',
'pages',
'dependencies',
'blocks',
'apis',
'meta'
];
let initProject: ProjectSchema;
export class LowCodeService extends BaseService {
public async init(project: ProjectSchema): Promise<ProjectSchema> {
console.log('init', project);
initProject = project;
const remoteProject = await getProject(initProject.id);
const arrayFields = ['pages', 'blocks', 'apis', 'meta', 'dependencies'];
arrayFields.forEach((field) => {
if (isEmpty(remoteProject[field])) {
remoteProject[field] = [];
}
});
console.log('remoteProject', remoteProject);
const model = new ProjectModel(remoteProject);
console.log('model', model || { id: initProject.id });
const dsl = model.toDsl();
return Promise.resolve(dsl);
}
public getExtension(): Promise<ExtensionConfig | undefined> {
const extension = storage.get('extension');
console.log('ExtensionConfig', extension);
return Promise.resolve(extension as ExtensionConfig | undefined);
}
public async saveProject(project: ProjectSchema): Promise<boolean> {
const newProject = {
...project,
...Object.fromEntries(
Object.entries(project)
.filter(([key]) => stringifyFields.includes(key))
.map(([key, value]) => [key, JSON.stringify(value)])
)
};
// 剔除引擎自行添加的 id避免接口更新冲突报错
Reflect.deleteProperty(newProject, 'id');
await updateProject(initProject.id, newProject);
return Promise.resolve(true);
}
public getPluginMaterial(
from: NodeFromPlugin
): Promise<MaterialDescription | null> {
return Promise.resolve(null);
}
// TODO: 物料存储只有在发布为其他端 (比如 uinapp) 时才有用,当前版本时不需要的,暂且保留
public async saveMaterials(
project: ProjectSchema,
materials: Map<string, MaterialDescription>
): Promise<boolean> {
const materialData = mapToObject(materials);
// storage.save(`materials_${project.id}`, materialData);
// console.log('saveMaterials', materialData);
// @ts-ignore
const existMaterials = await getLowCodeMaterials(project?.id);
if (existMaterials) {
// 更新物料
await updateLowCodeMaterials({
project_id: project?.id,
value: materialData
});
} else {
// 创建物料
await postLowCodeMaterials({
project_id: project?.id,
value: materialData
});
}
// @ts-ignore
// await deleteLowCodeMaterials(project.id);
return Promise.resolve(true);
}
public async saveFile(file: BlockSchema): Promise<boolean> {
console.log('saveFile', file);
if (file.id) {
const existFile = await getLowCodeFile(file.id);
if (existFile.file_id) {
return updateLowCodeFile(file.id, {
...existFile,
dsl: file
})
.then(() => {
return Promise.resolve(true);
})
.catch((err) => {
return Promise.reject(err);
});
} else {
return createFile({
project_id: initProject.id,
publish: false,
active: true,
dsl: file,
file_id: file.id
})
.then(() => {
return Promise.resolve(true);
})
.catch((err) => {
return Promise.reject(err);
});
}
}
return Promise.resolve(false);
}
public async getFile(id: string): Promise<BlockSchema> {
return getLowCodeFile(id).then((lowCodeFile) => {
if (lowCodeFile.dsl) {
return Promise.resolve(lowCodeFile.dsl as BlockSchema);
} else {
return Promise.reject(null);
}
});
}
public async removeFile(id: string): Promise<boolean> {
return deleteLowCodeFile(id).then(() => Promise.resolve(true));
}
public async saveHistory(history: HistorySchema): Promise<boolean> {
return Promise.resolve(true);
}
public api = (type: string, data: any): Promise<any> => {
// console.log('api', type, data);
return Promise.resolve(true);
};
protected uploader = (file: File, projectId: string): Promise<any> => {
// console.log('uploader', file, projectId);
return Promise.resolve(true);
};
// TODO: 做成数据库存储后没啥用,保留就行
public removeHistory(id: string): Promise<boolean> {
// console.log('removeHistory', id);
return Promise.resolve(true);
}
public async getHistory(fileId: string): Promise<HistorySchema> {
const histories = await getLowCodeHistories({
project_id: initProject.id,
file_id: fileId,
per_page: 50
});
const formatDsl = {
id: histories.list[0].file_id,
items: histories.list.map((item) => {
return {
...item,
id: item.history_id,
label: item.created_at
};
})
};
const history = new HistoryModel(formatDsl);
return Promise.resolve(history.toDsl());
}
public async getHistoryItem(fId: string, id: string): Promise<HistoryItem> {
const history = await getLowCodeHistory(id);
return Promise.resolve(history);
}
public async saveHistoryItem(
fileId: string,
historyItem: HistoryItem
): Promise<boolean> {
await createLowCodeHistory({
project_id: initProject.id,
file_id: fileId,
history_id: historyItem.id,
dsl: historyItem.dsl as HistorySchema
});
return Promise.resolve(true);
}
public async removeHistoryItem(fId: string, ids: string[]): Promise<boolean> {
await Promise.all(ids.map((id) => deleteLowCodeHistory(id)));
return Promise.resolve(true);
}
public publish(project: ProjectSchema): Promise<boolean> {
return publishLowCodeAllFile(Number(project.id)).then((res) => {
return Promise.resolve(true);
});
}
public publishFile(
project: ProjectSchema,
file: PageFile | BlockFile
): Promise<boolean> {
return publishLowCodeFile(file.id).then((res) => {
return Promise.resolve(true);
});
}
}

View File

@ -0,0 +1,60 @@
import { ref, computed } from 'vue';
import axios from 'axios';
import { createPinia, defineStore } from 'pinia';
// 创建 pinia 实例
export const pinia = createPinia();
// 用户模块 store
export const useUserStore = defineStore('user', () => {
// 状态定义
const token = ref<string>(localStorage.getItem('y-code-access-token') || '');
const userProfile = ref<null>(null);
// getter 计算属性
const isLoggedIn = computed(() => !!token.value);
// 同步 action
const setToken = (newToken: string) => {
token.value = newToken;
localStorage.setItem('y-code-access-token', newToken);
};
// 清理方法
const logout = () => {
token.value = '';
userProfile.value = null;
localStorage.removeItem('y-code-access-token');
};
return {
token,
userProfile,
isLoggedIn,
setToken,
logout
};
});
// 应用配置 store
export const useAppStore = defineStore('app', () => {
const theme = ref<'light' | 'dark'>('light');
const sidebarCollapsed = ref(false);
// 持久化配置
const persist = {
paths: ['theme', 'sidebarCollapsed'],
storage: localStorage
};
const toggleTheme = () => {
theme.value = theme.value === 'light' ? 'dark' : 'light';
};
return {
theme,
sidebarCollapsed,
toggleTheme,
persist
};
});

View File

@ -0,0 +1,15 @@
@use '@vtj/web/src/index.scss';
html,
body,
#app {
padding: 0;
margin: 0;
font-size: 14px;
height: 100%;
overflow: hidden;
}
#vtjLink {
display: none;
}

View File

@ -0,0 +1,81 @@
import * as Vue from 'vue';
import * as core from '@vtj/core';
import * as VtjUtils from '@vtj/utils';
import * as VtjUI from '@vtj/ui';
import * as designer from '@vtj/designer';
import * as renderer from '@vtj/renderer';
import * as VtjIcons from '@vtj/icons';
import * as ElementPlus from 'element-plus';
import type { ExtensionConfig } from '@vtj/core';
import type { EngineOptions } from '@vtj/designer';
export type ExtensionOptions = ExtensionConfig;
export type ExtensionFactory = (
config: ExtensionConfig
) => Partial<EngineOptions> | void;
export interface ExtensionOutput {
options: Partial<EngineOptions>;
adapters: Record<string, any>;
}
export class Extension {
private urls: string[] = [];
private library: string = '';
private params: any[] = [];
private __BASE_PATH__: string = '/';
private __adapters__: Record<string, any> = {};
constructor(private options: ExtensionOptions) {
const __VTJ_PRO__ = {
...core,
...designer,
...renderer
};
(window as any).Vue = Vue;
(window as any).__VTJ_PRO__ = __VTJ_PRO__;
(window as any).VtjUtils = VtjUtils;
(window as any).VtjIcons = VtjIcons;
(window as any).VtjUI = VtjUI;
(window as any).ElementPlus = ElementPlus;
const {
urls = [],
library,
params = [],
__BASE_PATH__ = '/',
__adapters__ = {}
} = options || {};
this.urls = urls;
this.library = library;
this.params = params;
this.__BASE_PATH__ = __BASE_PATH__;
this.__adapters__ = __adapters__;
}
async load(): Promise<ExtensionOutput> {
let options: Partial<EngineOptions> = {};
if (this.library) {
const base = this.__BASE_PATH__;
const css = this.urls
.filter((n) => renderer.isCSSUrl(n))
.map((n) => `${base}${n}`);
const scripts: string[] = this.urls
.filter((n) => renderer.isJSUrl(n))
.map((n) => `${base}${n}`);
renderer.loadCssUrl(css);
if (scripts.length) {
const output = await renderer
.loadScriptUrl(scripts, this.library)
.catch(() => null);
if (output && typeof output === 'function') {
options = output.call(output, this.options, this.params);
} else {
options = output || {};
}
}
}
return {
options,
adapters: this.__adapters__
};
}
}

View File

@ -0,0 +1,10 @@
import 'element-plus/theme-chalk/dark/css-vars.css';
import 'element-plus/theme-chalk/index.css';
// import 'vxe-table/es/style.min.css';
import '@vtj/ui/dist/style.css';
import '@vtj/icons/dist/style.css';
export * from '@vtj/core';
export * from '@vtj/designer';
export * from '@vtj/renderer';
export * from './extension';

View File

@ -0,0 +1,74 @@
<script lang="ts" setup>
import { ref } from 'vue';
import Postmate from 'postmate';
import { Engine, widgetManager } from '@vtj/pro';
import { request, jsonp } from '@vtj/utils';
import { useUserStore } from '@/store';
import { LowCodeService } from '@/service';
const container = ref();
const service = new LowCodeService();
const userStore = useUserStore();
onMounted(async () => {
//
const model = {
name: '',
url: '',
applicationId: -1,
projectId: -1,
accessToken: ''
};
const handshake = new Postmate.Model({});
await handshake.then((parent) => {
parent.emit('sync-context', 'y-code-designer is ready');
Object.assign(model, parent.model);
// console.log('get parent model', model);
userStore.setToken(model.accessToken);
request.useRequest((req) => {
req.headers.set('Authorization', `Bearer ${model.accessToken}`);
return req;
});
const engine = new Engine({
container,
service,
project: {
// @ts-ignore
id: model.projectId,
name: model.name
},
adapter: {
request,
jsonp
}
});
widgetManager.set('Previewer', {
props: {
path: (block: any) => {
const pathname = location.pathname;
return `${pathname}#/preview/${block.id}`;
}
}
});
widgetManager.set('Templates', {
invisible: true
});
});
});
</script>
<template>
<div
class="designer-container"
ref="container"
:token="userStore.token"></div>
</template>
<style scoped>
.designer-container {
height: 100%;
width: 100%;
}
</style>

View File

@ -0,0 +1,10 @@
<template>
<XContainer class="not-found" fit justify="center">
<ElEmpty description="找不到页面【404】"></ElEmpty>
</XContainer>
</template>
<script lang="ts" setup>
import { XContainer } from '@vtj/web';
import { ElEmpty } from 'element-plus';
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,45 @@
<template>
<component v-if="renderer" :is="renderer" v-bind="$attrs"></component>
</template>
<script lang="ts" setup>
import { ref, getCurrentInstance } from 'vue';
import { useRoute } from 'vue-router';
import { createProvider, ContextMode } from '@vtj/pro';
import { LowCodeService } from '@/service';
import { request, jsonp } from '@vtj/utils';
import { useUserStore } from '@/store';
const userStore = useUserStore();
const service = new LowCodeService();
request.useRequest((req) => {
req.headers.set('Authorization', `Bearer ${userStore.token}`);
return req;
});
const { provider, onReady } = createProvider({
mode: ContextMode.Runtime,
service,
project: {
// @ts-ignore
id: 4
},
adapter: {
request,
jsonp
},
dependencies: {
Vue: () => import('vue'),
VueRouter: () => import('vue-router'),
ElementPlus: () => import('element-plus')
}
});
const route = useRoute();
const renderer = ref();
const instance = getCurrentInstance();
onReady(async () => {
instance?.appContext.app.use(provider);
renderer.value = await provider.getRenderComponent(
route.params.id.toString()
);
});
</script>

View File

@ -0,0 +1,10 @@
<template>
<XContainer class="unauthorized" fit justify="center">
<ElEmpty description="无权限访问该页面"></ElEmpty>
</XContainer>
</template>
<script lang="ts" setup>
import { XContainer } from '@vtj/ui';
import { ElEmpty } from 'element-plus';
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,27 @@
{
"extends": "./node_modules/@vtj/cli/config/tsconfig.web.json",
"compilerOptions": {
"noUnusedLocals": false,
"noUnusedParameters": false,
"baseUrl": "./",
"paths": {
"@/*": [
"src/*"
],
"$vtj/*": [
".vtj/*"
]
}
},
"include": [
"src"
],
"exclude": [
".vtj",
],
"references": [
{
"path": "./tsconfig.node.json"
}
]
}

View File

@ -0,0 +1,13 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": [
"vite.config.ts",
"proxy.config.ts"
]
}

View File

@ -0,0 +1,55 @@
import { defineConfig, loadEnv } from 'vite';
import { createViteConfig } from '@vtj/cli';
import { createDevTools } from '@vtj/local';
import http2Proxy from '@sy/vite-plugin-http2-proxy';
import mkcert from 'vite-plugin-mkcert';
import AutoImport from 'unplugin-auto-import/vite';
import path from 'path';
const config = createViteConfig({
// proxy,
plugins: [
createDevTools(),
http2Proxy(),
mkcert(),
AutoImport({
imports: [
'vue',
'pinia',
'vue-router',
{
from: 'pinia',
imports: ['storeToRefs', 'defineStore'],
type: true
}
],
dts: 'src/auto-imports.d.ts', // 生成类型声明文件
eslintrc: {
enabled: true // 生成 eslint 配置
}
})
]
});
// @ts-ignore
export default defineConfig(({ mode }) => {
console.log('mode', mode);
// 加载环境变量(支持 .env.development/.env.production
const env = loadEnv(mode, process.cwd(), ['VITE_', 'VTJ_', 'SY_', 'Y_CODE_']);
return {
...config,
server: {
https: true,
port: env.VITE_PORT,
host: true
},
define: {
// 注入环境变量到客户端
__APP_ENV__: JSON.stringify(env)
}
// build: {
// outDir: path.resolve(process.cwd(), '../../dist/designer'),
// emptyOutDir: true // 构建前清空目录
// }
};
});

View File

@ -0,0 +1,5 @@
> 1%
last 2 versions
not dead
not ie 11
chrome 79

View File

@ -0,0 +1,19 @@
.DS_Store
node_modules/
dist/
.vscode/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
tests/**/coverage/
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

8
apps/platform/.env Normal file
View File

@ -0,0 +1,8 @@
# 项目名称
VITE_APP_TITLE = Admin
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# enable mock in production
VITE_MOCK_IN_PROD = true

View File

@ -0,0 +1,18 @@
# 只在开发模式中被载入
VITE_NODE_ENV = 'development'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# 前端可见变量(必须以 VITE_ 开头)
VITE_PORT = 10010
VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
# VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
VITE_DEBUG_MODE = true
Y_CODE_PLATFORM_URL = 'https://localhost:10010/'
Y_CODE_DESIGNER_URL = 'https://localhost:10011/'
Y_CODE_RENDERER_URL = 'https://localhost:10012/'
Y_CODE_V1_URL = 'https://localhost:10013/'

View File

@ -0,0 +1,12 @@
# 只在生产模式中被载入
VITE_NODE_ENV = 'production'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
VITE_BASE_API_URL = 'https://custom-chart-api.shiyuegame.com/'
Y_CODE_PLATFORM_URL = 'https://y-code-platform.shiyuegame.com/'
Y_CODE_DESIGNER_URL = 'https://y-code-designer.shiyuegame.com/'
Y_CODE_RENDERER_URL = 'https://y-code-renderer.shiyuegame.com/'
Y_CODE_V1_URL = 'https://custom-chart.shiyuegame.com/'

View File

@ -0,0 +1,13 @@
# 只在预发布模式中被载入
VITE_NODE_ENV = 'staging'
# 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path
VITE_BASE_URL = /
# base api url
VITE_BASE_API_URL = 'https://custom-chart-pre-api.shiyue.com/'
Y_CODE_PLATFORM_URL = 'https://y-code-platform-pre.shiyue.com/'
Y_CODE_DESIGNER_URL = 'https://y-code-designer-pre.shiyue.com/'
Y_CODE_RENDERER_URL = 'https://y-code-renderer-pre.shiyue.com/'
Y_CODE_V1_URL = 'https://custom-chart.shiyue.com/'

11
apps/platform/.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
# https://docs.github.com/cn/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
# Automatically normalize line endings (to LF) for all text-based files.
* text=auto eol=lf
# Declare files that will always have CRLF line endings on checkout.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.{ico,png,jpg,jpeg,gif,webp,svg,woff,woff2} binary

35
apps/platform/.gitignore vendored Normal file
View File

@ -0,0 +1,35 @@
node_modules
.DS_Store
dist
.cache
.turbo
.nx
.nx/cache
tests/server/static
tests/server/static/upload
.local
# local env files
.env.local
.env.*.local
.eslintcache
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
*pnpm-debug.log*
# Editor directories and files
.idea
# .vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# auto generate file
types/auto-imports.d.ts
types/components.d.ts

22
apps/platform/.npmrc Normal file
View File

@ -0,0 +1,22 @@
# 使用淘宝镜像源
registry = https://registry.npmmirror.com
@sy:registry=http://sy-registry.shiyue.com
# 根据需要提升含有以下的依赖包到根 node_modules 目录下
# public-hoist-pattern[]=husky
# public-hoist-pattern[]=*eslint*
# public-hoist-pattern[]=@eslint*
# public-hoist-pattern[]=*prettier*
# public-hoist-pattern[]=lint-staged
# public-hoist-pattern[]=*stylelint*
# public-hoist-pattern[]=@commitlint*
# public-hoist-pattern[]=core-js
# 提升所有依赖到根 node_modules 目录下,相当于 public-hoist-pattern[]=*,与上面一种方式一般二选一使用
# 极不推荐用这样的方式解决依赖问题,这样没有充分利用 pnpm 依赖访问安全性的优势,又走回了 npm / yarn 的老路。
# shamefully-hoist=true
enable-pre-post-scripts=true
engine-strict=true
package-manager-strict=false

View File

@ -0,0 +1,81 @@
# 1.1.0 (2022-09-02)
### Bug Fixes
- :bug: router navigation bug ([b550a7a](https://github.com/buqiyuan/vite-vue3-admin/commit/b550a7a01b486cfd161ccb8efd7bca9a0ed35627))
- :bug:生成路由出错问题 ([917e3f0](https://github.com/buqiyuan/vite-vue3-admin/commit/917e3f07209851a3df0b7e220e38df4df7612a68))
- :bug:修复某些权限码传参错误 ([47071ef](https://github.com/buqiyuan/vite-vue3-admin/commit/47071efa7beb2e210151405e2a1c7e74d6dff4f1))
- :bug:fix BASE_URL to VITE_BASE_URL ([3d32e82](https://github.com/buqiyuan/vite-vue3-admin/commit/3d32e82b838aea3c8a928989d2aa55c5d125a8ab))
- 面包屑导航和弹窗拖拽后宽度问题 ([ae96559](https://github.com/buqiyuan/vite-vue3-admin/commit/ae96559fb82a87908a40b425701eaa0ee1993aa7))
- 删除一些多余的旧代码 ([9eaa568](https://github.com/buqiyuan/vite-vue3-admin/commit/9eaa568a104e7ab1980c0d2069cbedddb4a4934b))
- add menu type judgment ([144a539](https://github.com/buqiyuan/vite-vue3-admin/commit/144a53942a9229cb5e0286ae3452b644d66621e6))
- **component:** :bug:修复 dynamicTable ts 类型错误 ([58b9275](https://github.com/buqiyuan/vite-vue3-admin/commit/58b9275758625f583aed644923431df72acb9687))
- **components:** [dynamic-table] initial fetchData did not carry the default value ([3aaedcf](https://github.com/buqiyuan/vite-vue3-admin/commit/3aaedcf3c0551477e05dec85fb86d4e5af62b193))
- **components:** [dynamic-table] parameter missing ([1e306d7](https://github.com/buqiyuan/vite-vue3-admin/commit/1e306d77d205cc9fe69fb19d860f5e014e8accc8))
- **dynamic-table:** add onChangeParams param for dataRequest ([f381c79](https://github.com/buqiyuan/vite-vue3-admin/commit/f381c793529b6711994e001d29d1b8e6dc016631))
- fix the aformPropsKeys ([#22](https://github.com/buqiyuan/vite-vue3-admin/issues/22)) ([e1c21be](https://github.com/buqiyuan/vite-vue3-admin/commit/e1c21bea3dddee1fefc9465142f390b0252ebcb4))
- invalid regular expression in safari ([3939f82](https://github.com/buqiyuan/vite-vue3-admin/commit/3939f8229561959cb46982f64c54f4348258a1bd)), closes [#20](https://github.com/buqiyuan/vite-vue3-admin/issues/20)
- isAsyncFunction ([71aca13](https://github.com/buqiyuan/vite-vue3-admin/commit/71aca13b8055cd38c9f49a4d370c935312fa4d6f))
- **pages:** about page link issues ([62c840c](https://github.com/buqiyuan/vite-vue3-admin/commit/62c840ccec3aa4b4237a182d750db933797c1c92))
- **projects:** 修复 tabs-view 下拉菜单溢出 ([a43353d](https://github.com/buqiyuan/vite-vue3-admin/commit/a43353dc89f8395278b6988f7a2dd8c372ff0d7f))
- remove topLevelAwait usage ([6653da6](https://github.com/buqiyuan/vite-vue3-admin/commit/6653da65f7a6d9738a39c955fb4dcb6d4f553235))
- router redirect error when logout ([4073cb6](https://github.com/buqiyuan/vite-vue3-admin/commit/4073cb651b3bf45c16ce5f965fb7dddd3fab3bcd))
- **router:** 第一次进入页面缓存失效问题 ([1b79adc](https://github.com/buqiyuan/vite-vue3-admin/commit/1b79adc072c1c9b6518cc4c05846dfd47c954989))
- **schema-form:** update props issue ([ff1da5e](https://github.com/buqiyuan/vite-vue3-admin/commit/ff1da5e4f9723392f8af6a5286131f8cbf3c2bf8))
- some css style issues ([9db10b0](https://github.com/buqiyuan/vite-vue3-admin/commit/9db10b058c8ba212cf51c94c10d2f37705ff7112))
- some route file path error ([c89b131](https://github.com/buqiyuan/vite-vue3-admin/commit/c89b131d77c0ee8036813a2d377774bb854c652d))
- some ts type issue ([60ea702](https://github.com/buqiyuan/vite-vue3-admin/commit/60ea702d7fe9cc88f85c07cdb0cd6fe5f3c56669))
- svg can not loaded ([6aec46a](https://github.com/buqiyuan/vite-vue3-admin/commit/6aec46a00412a2b02e4090faca6722717a739550))
- **utils:** [is] always false of isPromise ([8479111](https://github.com/buqiyuan/vite-vue3-admin/commit/84791110a87ab48f131c91e73508c2547fff8b25))
- xlsx.js not default export in new versions [#8](https://github.com/buqiyuan/vite-vue3-admin/issues/8) ([a0b0fc8](https://github.com/buqiyuan/vite-vue3-admin/commit/a0b0fc8c78e1cf75e5ed7e48aee03dc7ce364db4))
### Features
- 表格列设置工具栏 ([a934e12](https://github.com/buqiyuan/vite-vue3-admin/commit/a934e123426fab27fcbfbf47181f3355f584974a))
- 当前用户角色权限变更时实时更新权限菜单 ([89918a2](https://github.com/buqiyuan/vite-vue3-admin/commit/89918a2195b119f480f498d420bb29016d557846))
- 服务监控页面 ([0c3d61f](https://github.com/buqiyuan/vite-vue3-admin/commit/0c3d61fbdf4b0ecb1375990c06f5b039bed37085))
- 全局挂载 Reflect 反射对象 ([f6f4675](https://github.com/buqiyuan/vite-vue3-admin/commit/f6f4675fba8e94b8b8bb67eff79d1205e3b06fff))
- 新增按钮权限 ([5538d38](https://github.com/buqiyuan/vite-vue3-admin/commit/5538d387925b7bd53f332643903f9e4cacad0908))
- **components:** [dynamic-table] cell support defaultEditable ([125bb08](https://github.com/buqiyuan/vite-vue3-admin/commit/125bb08ef2563f4dd4f3883da679e739e3f80bad))
- **components:** [dynamic-table] support cell edit ([4411b0e](https://github.com/buqiyuan/vite-vue3-admin/commit/4411b0e49feeb93b3d1034fc038c9a778d7312af))
- **components:** [ProjectSetting] add layout mode ([815b0c2](https://github.com/buqiyuan/vite-vue3-admin/commit/815b0c2cdc063a848b88cfe35519b0755b279282))
- edit-row-table support save loading ([4d0eea6](https://github.com/buqiyuan/vite-vue3-admin/commit/4d0eea6d30d8b09d30cafb6e3bb4b80bb806c675))
- support for nested routes ([9d9e1d8](https://github.com/buqiyuan/vite-vue3-admin/commit/9d9e1d856f01e0164c88a18583957d20ace95654))
- **tools:** :art: add project config drawer ([c1f0de0](https://github.com/buqiyuan/vite-vue3-admin/commit/c1f0de05f25bbbadbcbc9f4a105e8d721b008bbb))
- update basic-form demo ([27f95ec](https://github.com/buqiyuan/vite-vue3-admin/commit/27f95ec4e7c1b57fca5af379165960167aea2e1b))
- **views:** add about page ([0a34802](https://github.com/buqiyuan/vite-vue3-admin/commit/0a34802b7ef2d2727df4b3b769bd4d664ace2bfa))
### Performance Improvements
- **tableColumns:** customRender is easy ([#10](https://github.com/buqiyuan/vite-vue3-admin/issues/10)) ([e069f3c](https://github.com/buqiyuan/vite-vue3-admin/commit/e069f3c164f92e414638cb2f681013c7dc7727a0))
- use vite-plugin-style-import replace unplugin-vue-components [#5](https://github.com/buqiyuan/vite-vue3-admin/issues/5) ([10540eb](https://github.com/buqiyuan/vite-vue3-admin/commit/10540eb1de36f4cd6048f86e5b0363109d571760))
## 1.0.2 (2022-03-15)
### Bug Fixes
- :bug: router navigation bug ([b550a7a](https://github.com/buqiyuan/vite-vue3-admin/commit/b550a7a01b486cfd161ccb8efd7bca9a0ed35627))
- :bug:生成路由出错问题 ([917e3f0](https://github.com/buqiyuan/vite-vue3-admin/commit/917e3f07209851a3df0b7e220e38df4df7612a68))
- :bug:修复某些权限码传参错误 ([47071ef](https://github.com/buqiyuan/vite-vue3-admin/commit/47071efa7beb2e210151405e2a1c7e74d6dff4f1))
- :bug:fix BASE_URL to VITE_BASE_URL ([3d32e82](https://github.com/buqiyuan/vite-vue3-admin/commit/3d32e82b838aea3c8a928989d2aa55c5d125a8ab))
- 面包屑导航和弹窗拖拽后宽度问题 ([ae96559](https://github.com/buqiyuan/vite-vue3-admin/commit/ae96559fb82a87908a40b425701eaa0ee1993aa7))
- 删除一些多余的旧代码 ([9eaa568](https://github.com/buqiyuan/vite-vue3-admin/commit/9eaa568a104e7ab1980c0d2069cbedddb4a4934b))
- **component:** :bug:修复 dynamicTable ts 类型错误 ([58b9275](https://github.com/buqiyuan/vite-vue3-admin/commit/58b9275758625f583aed644923431df72acb9687))
- remove topLevelAwait usage ([6653da6](https://github.com/buqiyuan/vite-vue3-admin/commit/6653da65f7a6d9738a39c955fb4dcb6d4f553235))
- **router:** 第一次进入页面缓存失效问题 ([1b79adc](https://github.com/buqiyuan/vite-vue3-admin/commit/1b79adc072c1c9b6518cc4c05846dfd47c954989))
- some route file path error ([c89b131](https://github.com/buqiyuan/vite-vue3-admin/commit/c89b131d77c0ee8036813a2d377774bb854c652d))
- svg can not loaded ([6aec46a](https://github.com/buqiyuan/vite-vue3-admin/commit/6aec46a00412a2b02e4090faca6722717a739550))
- xlsx.js not default export in new versions [#8](https://github.com/buqiyuan/vite-vue3-admin/issues/8) ([a0b0fc8](https://github.com/buqiyuan/vite-vue3-admin/commit/a0b0fc8c78e1cf75e5ed7e48aee03dc7ce364db4))
### Features
- 表格列设置工具栏 ([a934e12](https://github.com/buqiyuan/vite-vue3-admin/commit/a934e123426fab27fcbfbf47181f3355f584974a))
- 服务监控页面 ([0c3d61f](https://github.com/buqiyuan/vite-vue3-admin/commit/0c3d61fbdf4b0ecb1375990c06f5b039bed37085))
- 全局挂载 Reflect 反射对象 ([f6f4675](https://github.com/buqiyuan/vite-vue3-admin/commit/f6f4675fba8e94b8b8bb67eff79d1205e3b06fff))
- 新增按钮权限 ([5538d38](https://github.com/buqiyuan/vite-vue3-admin/commit/5538d387925b7bd53f332643903f9e4cacad0908))
- **views:** add about page ([0a34802](https://github.com/buqiyuan/vite-vue3-admin/commit/0a34802b7ef2d2727df4b3b769bd4d664ace2bfa))
### Performance Improvements
- **tableColumns:** customRender is easy ([#10](https://github.com/buqiyuan/vite-vue3-admin/issues/10)) ([e069f3c](https://github.com/buqiyuan/vite-vue3-admin/commit/e069f3c164f92e414638cb2f681013c7dc7727a0))
- use vite-plugin-style-import replace unplugin-vue-components [#5](https://github.com/buqiyuan/vite-vue3-admin/issues/5) ([10540eb](https://github.com/buqiyuan/vite-vue3-admin/commit/10540eb1de36f4cd6048f86e5b0363109d571760))

29
apps/platform/Dockerfile Normal file
View File

@ -0,0 +1,29 @@
# https://stackoverflow.com/questions/53681522/share-variable-in-multi-stage-dockerfile-arg-before-from-not-substituted
ARG PROJECT_DIR=/vue3-antdv-admin
FROM node:20-slim as builder
ARG PROJECT_DIR
WORKDIR $PROJECT_DIR
# 安装pnpm
RUN npm install -g pnpm
COPY . ./
# 安装依赖
# 若网络不通,可以使用淘宝源
# RUN pnpm config set registry https://registry.npmmirror.com
RUN pnpm install
# 构建项目
ENV VITE_BASE_URL=/
RUN pnpm build
FROM nginx:alpine as production
ARG PROJECT_DIR
COPY --from=builder $PROJECT_DIR/dist/ /usr/share/nginx/html
# COPY --from=builder $PROJECT_DIR/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

3
apps/platform/README.md Normal file
View File

@ -0,0 +1,3 @@
# 因为项目接入了天梯登陆,使用前需要申请天梯的悦码权限
天梯地址 https://auth-pro.shiyue.com/

View File

@ -0,0 +1,34 @@
/** @type {import("@commitlint/types").UserConfig} */
export default {
ignores: [(commit) => commit.includes('init')],
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [1, 'always'],
'header-max-length': [2, 'always', 108],
'subject-empty': [2, 'never'],
'type-empty': [2, 'never'],
'subject-case': [0],
'type-enum': [
2,
'always',
[
'feat',
'fix',
'perf',
'style',
'docs',
'test',
'refactor',
'build',
'ci',
'chore',
'revert',
'wip',
'workflow',
'types',
'release',
],
],
},
};

View File

@ -0,0 +1,15 @@
version: '3'
services:
vue3-antdv-admin:
# 从当前路径构建镜像
build:
context: .
dockerfile: Dockerfile
target: production
image: buqiyuan/vue3-antdv-admin:latest
ports:
- '80:80'
env_file:
- .env
- .env.production

View File

@ -0,0 +1,206 @@
import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import * as parserVue from 'vue-eslint-parser';
import configPrettier from 'eslint-config-prettier';
import pluginPrettier from 'eslint-plugin-prettier';
import pluginImport from 'eslint-plugin-import';
import { defineFlatConfig } from 'eslint-define-config';
import * as parserTypeScript from '@typescript-eslint/parser';
import pluginTypeScript from '@typescript-eslint/eslint-plugin';
import unusedImports from 'eslint-plugin-unused-imports';
export default defineFlatConfig([
{
...js.configs.recommended,
plugins: {
prettier: pluginPrettier,
},
rules: {
...configPrettier.rules,
...pluginPrettier.configs.recommended.rules,
'no-debugger': 'off',
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
},
{
files: ['**/*.?([cm])ts', '**/*.?([cm])tsx'],
languageOptions: {
parser: parserTypeScript,
parserOptions: {
sourceType: 'module',
},
},
plugins: {
'@typescript-eslint': pluginTypeScript,
},
rules: {
...pluginTypeScript.configs.strict.rules,
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-as-const': 'warn',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/consistent-type-imports': [
'error',
{ disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' },
],
'@typescript-eslint/prefer-literal-enum-member': ['error', { allowBitwiseExpressions: true }],
},
},
{
files: ['**/*.d.ts'],
rules: {
'eslint-comments/no-unlimited-disable': 'off',
'import/no-duplicates': 'off',
'unused-imports/no-unused-vars': 'off',
},
},
{
files: ['**/*.?([cm])js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['**/*.vue'],
languageOptions: {
parser: parserVue,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
extraFileExtensions: ['.vue'],
parser: parserTypeScript,
sourceType: 'module',
},
},
plugins: {
vue: pluginVue,
},
processor: pluginVue.processors['.vue'],
rules: {
...pluginVue.configs.base.rules,
...pluginVue.configs['vue3-essential'].rules,
...pluginVue.configs['vue3-recommended'].rules,
'no-undef': 'off',
'no-unused-vars': 'off',
'vue/no-v-html': 'off',
'vue/require-default-prop': 'off',
'vue/require-explicit-emits': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-setup-props-reactivity-loss': 'off',
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'always',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
},
},
{
files: ['**/*.vue', '**/*.?([cm])ts', '**/*.?([cm])tsx'],
plugins: {
import: pluginImport,
'unused-imports': unusedImports,
},
rules: {
'import/first': 'error',
'import/no-duplicates': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
pathGroups: [
{
pattern: 'vue',
group: 'external',
position: 'before',
},
{
pattern: '@vue/**',
group: 'external',
position: 'before',
},
{
pattern: 'ant-design-vue',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['type'],
},
],
'unused-imports/no-unused-imports': 'error',
// 如需保存时自动删除未引用代码,可注释掉该规则
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
},
},
{
linterOptions: {
reportUnusedDisableDirectives: 'off',
},
ignores: [
'src/assets/**',
'*.sh',
'node_modules',
'*.md',
'*.woff',
'*.ttf',
'.vscode',
'.idea',
'dist',
'/public',
'/docs',
'.husky',
'.local',
'/bin',
'Dockerfile',
],
},
]);

17
apps/platform/index.html Normal file
View File

@ -0,0 +1,17 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="referrer" content="origin" />
<link rel="icon" href="/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"
/>
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

View File

@ -0,0 +1,8 @@
/** @type {import('lint-staged').Config} */
export default {
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.json': ['prettier --write'],
'*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix --allow-empty-input'],
'*.{scss,less,styl,html}': ['stylelint --fix --allow-empty-input', 'prettier --write'],
'*.md': ['prettier --write'],
};

View File

@ -0,0 +1,104 @@
import { generateService } from '@umijs/openapi';
import type { RequestOptions } from './src/utils/request';
const re = /controller[-_ .](\w)/gi;
// swagger-typescript-api
generateService({
schemaPath: 'http://127.0.0.1:7001/api-docs-json',
serversPath: './src/api/backend',
requestOptionsType: 'RequestOptions',
// 自定义网络请求函数路径
requestImportStatement: `
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from "@/utils/request";
`,
hook: {
afterOpenApiDataInited(openAPIData) {
const schemas = openAPIData.components?.schemas;
if (schemas) {
Object.values(schemas).forEach((schema) => {
if ('$ref' in schema) {
return;
}
if (schema.properties) {
Object.values(schema.properties).forEach((prop) => {
if ('$ref' in prop) {
return;
}
// 匡正文件上传的参数类型
if (prop.format === 'binary') {
prop.type = 'object';
}
});
}
});
}
return openAPIData;
},
// @ts-ignore
customFunctionName(operationObject, apiPath) {
const { operationId } = operationObject;
if (!operationId) {
console.warn('[Warning] no operationId', apiPath);
return;
}
const funcName = operationId.replace(re, (_all, letter) => letter.toUpperCase());
operationObject.operationId = funcName;
return funcName;
},
// @ts-ignore
customFileNames(operationObject, apiPath) {
const { operationId } = operationObject;
if (!operationId) {
console.warn('[Warning] no operationId', apiPath);
return;
}
const controllerName = operationId.split(re)[0];
const moduleName = operationObject.tags?.[0].split(' - ')[0];
// 移除 query 参数的默认值
operationObject.parameters?.forEach((param) => {
if ('in' in param && param.in === 'query' && param.schema) {
if (!('$ref' in param.schema) && param.schema.default) {
Reflect.deleteProperty(param.schema, 'default');
}
}
});
if (moduleName === controllerName) {
return [controllerName];
} else if (moduleName && moduleName !== controllerName) {
return [`${moduleName}_${controllerName}`];
}
return;
},
customType(schemaObject, namespace, defaultGetType) {
const type = defaultGetType(schemaObject, namespace);
// 提取出 data 的类型
const regex = /API\.ResOp & { 'data'\?: (.+); }/;
return type.replace(regex, '$1');
},
customOptionsDefaultValue(data): RequestOptions {
const { summary } = data;
if (summary?.startsWith('创建') || summary?.startsWith('新增')) {
return { successMsg: '创建成功' };
} else if (summary?.startsWith('更新')) {
return { successMsg: '更新成功' };
} else if (summary?.startsWith('删除')) {
return { successMsg: '删除成功' };
}
return {};
},
},
});

128
apps/platform/package.json Normal file
View File

@ -0,0 +1,128 @@
{
"name": "@sy/y-code-platform",
"version": "1.0.0-1",
"packageManager": "pnpm@10.4.1",
"type": "module",
"engines": {
"node": ">=20",
"pnpm": ">=9.0.2"
},
"author": {
"name": "wangxuefeng",
"email": "wangxuefeng@shiyue.com"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "cross-env vite --mode development",
"build": "vite build --mode production",
"build:staging": "vite build --mode staging",
"preview": "vite preview",
"preview:watch": "npm run build:watch && vite preview",
"clean:cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
"test:gzip": "npx http-server dist --cors --gzip -c-1",
"test:br": "npx http-server dist --cors --brotli -c-1",
"clean:lock": "rimraf pnpm-lock.yaml && rimraf package.lock.json",
"clean:lib": "rimraf node_modules",
"clean": "rimraf node_modules"
},
"dependencies": {
"@ant-design/icons-vue": "~7.0.1",
"@iconify/vue": "^4.3.0",
"@iframe-resizer/parent": "^5.3.3",
"@sy/unified-login": "1.0.29",
"@sy/y-code-renderer-adapter": "workspace:*",
"@tanstack/query-core": "^5.66.4",
"@tanstack/vue-query": "^5.66.9",
"@vue/runtime-core": "^3.5.13",
"@vueuse/core": "~11.1.0",
"ant-design-vue": "~4.2.6",
"axios": "~1.8.1",
"core-js": "^3.40.0",
"crypto-js": "^4.2.0",
"dayjs": "~1.11.13",
"file-saver": "~2.0.5",
"licia-es": "^1.46.0",
"lodash-es": "~4.17.21",
"mitt": "~3.0.1",
"nprogress": "1.0.0-1",
"pinia": "~2.2.8",
"pinia-plugin-persistedstate": "^4.2.0",
"postmate": "^1.5.2",
"qs": "~6.13.1",
"sortablejs": "~1.15.6",
"vue": "~3.5.13",
"vue-i18n": "^11.1.1",
"vue-router": "~4.4.5",
"vue-types": "~6.0.0",
"vue-virtual-scroller": "2.0.0-beta.8",
"wujie-vue3": "^1.0.25",
"xlsx": "~0.18.5"
},
"devDependencies": {
"@commitlint/cli": "~19.5.0",
"@commitlint/config-conventional": "~19.5.0",
"@iconify-json/ant-design": "^1.2.5",
"@iconify-json/ep": "^1.2.2",
"@iconify/json": "^2.2.307",
"@sy/low-code-shared": "workspace:*",
"@sy/vite-plugin-http2-proxy": "workspace:*",
"@sy/y-code-designer": "workspace:*",
"@types/crypto-js": "^4.2.2",
"@types/lodash-es": "~4.17.12",
"@types/node": "~22.7.9",
"@types/qs": "^6.9.18",
"@types/sortablejs": "^1.15.8",
"@typescript-eslint/eslint-plugin": "~8.11.0",
"@typescript-eslint/parser": "~8.11.0",
"@umijs/openapi": "^1.13.0",
"@vitejs/plugin-vue": "~5.1.5",
"@vitejs/plugin-vue-jsx": "~4.1.1",
"@vue/tsconfig": "^0.7.0",
"commitizen": "~4.3.1",
"conventional-changelog-cli": "~4.1.0",
"cross-env": "~7.0.3",
"eslint": "~9.13.0",
"eslint-config-prettier": "~9.1.0",
"eslint-define-config": "~2.1.0",
"eslint-plugin-import": "~2.31.0",
"eslint-plugin-prettier": "~5.2.3",
"eslint-plugin-unused-imports": "^4.1.4",
"eslint-plugin-vue": "~9.29.1",
"less": "~4.2.2",
"lint-staged": "~15.2.11",
"msw": "^2.7.0",
"postcss": "~8.4.49",
"postcss-html": "~1.8.0",
"postcss-less": "~6.0.0",
"prettier": "~3.5.3",
"rimraf": "~6.0.1",
"stylelint": "~16.10.0",
"stylelint-config-property-sort-order-smacss": "^10.0.0",
"stylelint-config-recommended": "~14.0.1",
"stylelint-config-recommended-vue": "~1.5.0",
"stylelint-config-standard": "~36.0.1",
"stylelint-order": "~6.0.4",
"stylelint-prettier": "^5.0.3",
"typescript": "~5.8.2",
"unocss": "^65.5.0",
"unplugin-vue-components": "~0.27.5",
"vite": "~6.2.0",
"vite-plugin-checker": "~0.8.0",
"vite-plugin-inspect": "^10.2.1",
"vite-plugin-mkcert": "^1.17.6",
"vite-plugin-svg-icons": "~2.0.1",
"vite-plugin-vue-inspector": "^5.3.1",
"vue-eslint-parser": "~10.1.1",
"vue-tsc": "~2.2.8"
},
"keywords": [
"vue",
"ant-design-vue",
"vue3",
"ts",
"tsx",
"admin",
"typescript"
],
"target": "web"
}

View File

@ -0,0 +1,11 @@
/** @type {import('prettier').Config} */
export default {
printWidth: 100,
semi: true,
vueIndentScriptAndStyle: true,
singleQuote: true,
trailingComma: 'all',
proseWrap: 'never',
htmlWhitespaceSensitivity: 'strict',
endOfLine: 'auto',
};

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because one or more lines are too long

35
apps/platform/src/App.vue Normal file
View File

@ -0,0 +1,35 @@
<template>
<ProConfigProvider
:theme="{
algorithm: [compactAlgorithm],
}"
>
<Suspense>
<router-view v-slot="{ Component }">
<transition>
<keep-alive v-if="route.meta.keepAlive">
<component :is="Component" v-if="route.meta.keepAlive" :key="route.path" />
</keep-alive>
<component :is="Component" v-else :key="route.path" />
</transition>
</router-view>
</Suspense>
<LockScreen />
</ProConfigProvider>
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import { theme } from 'ant-design-vue';
import { useUserStore } from '@/store/modules/user';
import { LockScreen } from '@/components/basic/lockscreen';
const route = useRoute();
const userStore = useUserStore();
userStore.login();
const { compactAlgorithm } = theme;
</script>

View File

@ -0,0 +1,64 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 账户登出 GET /api/account/logout */
export async function accountLogout(options?: RequestOptions) {
return request<any>('/api/account/logout', {
method: 'GET',
...(options || {}),
});
}
/** 获取菜单列表 GET /api/account/menus */
export async function accountMenu(options?: RequestOptions) {
return request<API.AccountMenus[]>('/api/account/menus', {
method: 'GET',
...(options || {}),
});
}
/** 更改账户密码 POST /api/account/password */
export async function accountPassword(body: API.PasswordUpdateDto, options?: RequestOptions) {
return request<any>('/api/account/password', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 获取权限列表 GET /api/account/permissions */
export async function accountPermissions(options?: RequestOptions) {
return request<string[]>('/api/account/permissions', {
method: 'GET',
...(options || {}),
});
}
/** 获取账户资料 GET /api/account/profile */
export async function accountProfile(options?: RequestOptions) {
return request<API.AccountInfo>('/api/account/profile', {
method: 'GET',
...(options || {}),
});
}
/** 更改账户资料 PUT /api/account/update */
export async function accountUpdate(body: API.AccountUpdateDto, options?: RequestOptions) {
return request<any>('/api/account/update', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}

View File

@ -0,0 +1,32 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 登录 POST /api/auth/login */
export async function authLogin(body: API.LoginDto, options?: RequestOptions) {
return request<API.LoginToken>('/api/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 注册 POST /api/auth/register */
export async function authRegister(body: API.RegisterDto, options?: RequestOptions) {
return request<any>('/api/auth/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}

View File

@ -0,0 +1,20 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 发送邮箱验证码 POST /api/auth/email/send */
export async function emailSendEmailCode(body: API.SendEmailCodeDto, options?: RequestOptions) {
return request<any>('/api/auth/email/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}

View File

@ -0,0 +1,82 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取Todo列表 GET /api/todos */
export async function todoList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TodoListParams,
options?: RequestOptions,
) {
return request<API.TodoEntity[]>('/api/todos', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 创建Todo POST /api/todos */
export async function todoCreate(body: API.TodoDto, options?: RequestOptions) {
return request<any>('/api/todos', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 获取Todo详情 GET /api/todos/${param0} */
export async function todoInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TodoInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.TodoEntity>(`/api/todos/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新Todo PUT /api/todos/${param0} */
export async function todoUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TodoUpdateParams,
body: API.TodoUpdateDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/todos/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除Todo DELETE /api/todos/${param0} */
export async function todoDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TodoDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/todos/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}

View File

@ -0,0 +1,23 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取登录图片验证码 GET /api/auth/captcha/img */
export async function captchaCaptchaByImg(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.CaptchaCaptchaByImgParams,
options?: RequestOptions,
) {
return request<API.ImageCaptcha>('/api/auth/captcha/img', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

View File

@ -0,0 +1,73 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 此处后端没有提供注释 GET /api/health/database */
export async function healthCheckDatabase(options?: RequestOptions) {
return request<{
status?: string;
info?: Record<string, any>;
error?: Record<string, any>;
details?: Record<string, any>;
}>('/api/health/database', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/health/disk */
export async function healthCheckDisk(options?: RequestOptions) {
return request<{
status?: string;
info?: Record<string, any>;
error?: Record<string, any>;
details?: Record<string, any>;
}>('/api/health/disk', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/health/memory-heap */
export async function healthCheckMemoryHeap(options?: RequestOptions) {
return request<{
status?: string;
info?: Record<string, any>;
error?: Record<string, any>;
details?: Record<string, any>;
}>('/api/health/memory-heap', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/health/memory-rss */
export async function healthCheckMemoryRss(options?: RequestOptions) {
return request<{
status?: string;
info?: Record<string, any>;
error?: Record<string, any>;
details?: Record<string, any>;
}>('/api/health/memory-rss', {
method: 'GET',
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/health/network */
export async function healthCheckNetwork(options?: RequestOptions) {
return request<{
status?: string;
info?: Record<string, any>;
error?: Record<string, any>;
details?: Record<string, any>;
}>('/api/health/network', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,54 @@
// @ts-ignore
/* eslint-disable */
// API 更新时间:
// API 唯一标识:
import * as auth from './auth';
import * as account from './account';
import * as captcha from './captcha';
import * as authEmail from './authEmail';
import * as systemUser from './systemUser';
import * as systemRole from './systemRole';
import * as systemMenu from './systemMenu';
import * as systemParamConfig from './systemParamConfig';
import * as systemLog from './systemLog';
import * as systemDept from './systemDept';
import * as systemDictType from './systemDictType';
import * as systemDictItem from './systemDictItem';
import * as systemTask from './systemTask';
import * as systemOnline from './systemOnline';
import * as systemSse from './systemSse';
import * as systemServe from './systemServe';
import * as toolsStorage from './toolsStorage';
import * as systemEmail from './systemEmail';
import * as toolsUpload from './toolsUpload';
import * as health from './health';
import * as netDiskManage from './netDiskManage';
import * as netDiskOverview from './netDiskOverview';
import * as businessTodo from './businessTodo';
import * as user from './user';
export default {
auth,
account,
captcha,
authEmail,
systemUser,
systemRole,
systemMenu,
systemParamConfig,
systemLog,
systemDept,
systemDictType,
systemDictItem,
systemTask,
systemOnline,
systemSse,
systemServe,
toolsStorage,
systemEmail,
toolsUpload,
health,
netDiskManage,
netDiskOverview,
businessTodo,
user,
};

View File

@ -0,0 +1,133 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 复制文件或文件夹,支持批量 POST /api/netdisk/manage/copy */
export async function netDiskManageCopy(body: API.FileOpDto, options?: RequestOptions) {
return request<any>('/api/netdisk/manage/copy', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 剪切文件或文件夹,支持批量 POST /api/netdisk/manage/cut */
export async function netDiskManageCut(body: API.FileOpDto, options?: RequestOptions) {
return request<any>('/api/netdisk/manage/cut', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 删除文件或文件夹 POST /api/netdisk/manage/delete */
export async function netDiskManageDelete(body: API.DeleteDto, options?: RequestOptions) {
return request<any>('/api/netdisk/manage/delete', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '删除成功' }),
});
}
/** 获取下载链接,不支持下载文件夹 GET /api/netdisk/manage/download */
export async function netDiskManageDownload(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.NetDiskManageDownloadParams,
options?: RequestOptions,
) {
return request<string>('/api/netdisk/manage/download', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 获取文件详细信息 GET /api/netdisk/manage/info */
export async function netDiskManageInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.NetDiskManageInfoParams,
options?: RequestOptions,
) {
return request<API.SFileInfoDetail>('/api/netdisk/manage/info', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 获取文件列表 GET /api/netdisk/manage/list */
export async function netDiskManageList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.NetDiskManageListParams,
options?: RequestOptions,
) {
return request<API.SFileList>('/api/netdisk/manage/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 添加文件备注 POST /api/netdisk/manage/mark */
export async function netDiskManageMark(body: API.MarkFileDto, options?: RequestOptions) {
return request<any>('/api/netdisk/manage/mark', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 创建文件夹,支持多级 POST /api/netdisk/manage/mkdir */
export async function netDiskManageMkdir(body: API.MKDirDto, options?: RequestOptions) {
return request<any>('/api/netdisk/manage/mkdir', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 重命名文件或文件夹 POST /api/netdisk/manage/rename */
export async function netDiskManageRename(body: API.RenameDto, options?: RequestOptions) {
return request<any>('/api/netdisk/manage/rename', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 获取上传Token无Token前端无法上传 GET /api/netdisk/manage/token */
export async function netDiskManageToken(options?: RequestOptions) {
return request<API.UploadToken>('/api/netdisk/manage/token', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,16 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取网盘空间数据统计 GET /api/netdisk/overview/desc */
export async function netDiskOverviewSpace(options?: RequestOptions) {
return request<API.OverviewSpaceInfo>('/api/netdisk/overview/desc', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,82 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取部门列表 GET /api/system/depts */
export async function deptList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DeptListParams,
options?: RequestOptions,
) {
return request<API.DeptEntity[]>('/api/system/depts', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 创建部门 POST /api/system/depts */
export async function deptCreate(body: API.DeptDto, options?: RequestOptions) {
return request<any>('/api/system/depts', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 查询部门信息 GET /api/system/depts/${param0} */
export async function deptInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DeptInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.DeptEntity>(`/api/system/depts/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新部门 PUT /api/system/depts/${param0} */
export async function deptUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DeptUpdateParams,
body: API.DeptDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/depts/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除部门 DELETE /api/system/depts/${param0} */
export async function deptDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DeptDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/depts/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}

View File

@ -0,0 +1,91 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取字典项列表 GET /api/system/dict-item */
export async function dictItemList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictItemListParams,
options?: RequestOptions,
) {
return request<{
items?: API.DictItemEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/dict-item', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新增字典项 POST /api/system/dict-item */
export async function dictItemCreate(body: API.DictItemDto, options?: RequestOptions) {
return request<any>('/api/system/dict-item', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 查询字典项信息 GET /api/system/dict-item/${param0} */
export async function dictItemInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictItemInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.DictItemEntity>(`/api/system/dict-item/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新字典项 POST /api/system/dict-item/${param0} */
export async function dictItemUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictItemUpdateParams,
body: API.DictItemDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/dict-item/${param0}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除指定的字典项 DELETE /api/system/dict-item/${param0} */
export async function dictItemDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictItemDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/dict-item/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}

View File

@ -0,0 +1,99 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取字典类型列表 GET /api/system/dict-type */
export async function dictTypeList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictTypeListParams,
options?: RequestOptions,
) {
return request<{
items?: API.DictTypeEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/dict-type', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新增字典类型 POST /api/system/dict-type */
export async function dictTypeCreate(body: API.DictTypeDto, options?: RequestOptions) {
return request<any>('/api/system/dict-type', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 查询字典类型信息 GET /api/system/dict-type/${param0} */
export async function dictTypeInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictTypeInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.DictTypeEntity>(`/api/system/dict-type/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新字典类型 POST /api/system/dict-type/${param0} */
export async function dictTypeUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictTypeUpdateParams,
body: API.DictTypeDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/dict-type/${param0}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除指定的字典类型 DELETE /api/system/dict-type/${param0} */
export async function dictTypeDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DictTypeDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/dict-type/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}
/** 一次性获取所有的字典类型(不分页) GET /api/system/dict-type/select-options */
export async function dictTypeGetAll(options?: RequestOptions) {
return request<API.DictTypeEntity[]>('/api/system/dict-type/select-options', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,20 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 发送邮件 POST /api/tools/email/send */
export async function emailSend(body: API.EmailSendDto, options?: RequestOptions) {
return request<any>('/api/tools/email/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}

View File

@ -0,0 +1,80 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 查询验证码日志列表 GET /api/system/log/captcha/list */
export async function logCaptchaList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.LogCaptchaListParams,
options?: RequestOptions,
) {
return request<{
items?: API.CaptchaLogEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/log/captcha/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 查询登录日志列表 GET /api/system/log/login/list */
export async function logLoginLogPage(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.LogLoginLogPageParams,
options?: RequestOptions,
) {
return request<{
items?: API.LoginLogInfo[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/log/login/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 查询任务日志列表 GET /api/system/log/task/list */
export async function logTaskList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.LogTaskListParams,
options?: RequestOptions,
) {
return request<{
items?: API.TaskLogEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/log/task/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

View File

@ -0,0 +1,90 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取所有菜单列表 GET /api/system/menus */
export async function menuList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.MenuListParams,
options?: RequestOptions,
) {
return request<API.MenuItemInfo[]>('/api/system/menus', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新增菜单或权限 POST /api/system/menus */
export async function menuCreate(body: API.MenuDto, options?: RequestOptions) {
return request<any>('/api/system/menus', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 获取菜单或权限信息 GET /api/system/menus/${param0} */
export async function menuInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.MenuInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/menus/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新菜单或权限 PUT /api/system/menus/${param0} */
export async function menuUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.MenuUpdateParams,
body: API.MenuUpdateDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/menus/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除菜单或权限 DELETE /api/system/menus/${param0} */
export async function menuDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.MenuDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/menus/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}
/** 获取后端定义的所有权限集 GET /api/system/menus/permissions */
export async function menuGetPermissions(options?: RequestOptions) {
return request<string[]>('/api/system/menus/permissions', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,28 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 下线指定在线用户 POST /api/system/online/kick */
export async function onlineKick(body: API.KickDto, options?: RequestOptions) {
return request<any>('/api/system/online/kick', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 查询当前在线用户 GET /api/system/online/list */
export async function onlineList(options?: RequestOptions) {
return request<API.OnlineUserInfo[]>('/api/system/online/list', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,91 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取参数配置列表 GET /api/system/param-config */
export async function paramConfigList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ParamConfigListParams,
options?: RequestOptions,
) {
return request<{
items?: API.ParamConfigEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/param-config', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新增参数配置 POST /api/system/param-config */
export async function paramConfigCreate(body: API.ParamConfigDto, options?: RequestOptions) {
return request<any>('/api/system/param-config', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 查询参数配置信息 GET /api/system/param-config/${param0} */
export async function paramConfigInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ParamConfigInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.ParamConfigEntity>(`/api/system/param-config/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新参数配置 POST /api/system/param-config/${param0} */
export async function paramConfigUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ParamConfigUpdateParams,
body: API.ParamConfigDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/param-config/${param0}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除指定的参数配置 DELETE /api/system/param-config/${param0} */
export async function paramConfigDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.ParamConfigDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/param-config/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}

View File

@ -0,0 +1,91 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取角色列表 GET /api/system/roles */
export async function roleList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.RoleListParams,
options?: RequestOptions,
) {
return request<{
items?: API.RoleEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/roles', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新增角色 POST /api/system/roles */
export async function roleCreate(body: API.RoleDto, options?: RequestOptions) {
return request<any>('/api/system/roles', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 获取角色信息 GET /api/system/roles/${param0} */
export async function roleInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.RoleInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.RoleInfo>(`/api/system/roles/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新角色 PUT /api/system/roles/${param0} */
export async function roleUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.RoleUpdateParams,
body: API.RoleUpdateDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/roles/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除角色 DELETE /api/system/roles/${param0} */
export async function roleDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.RoleDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/roles/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}

View File

@ -0,0 +1,16 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取服务器运行信息 GET /api/system/serve/stat */
export async function serveStat(options?: RequestOptions) {
return request<API.ServeStatInfo>('/api/system/serve/stat', {
method: 'GET',
...(options || {}),
});
}

View File

@ -0,0 +1,22 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 服务端推送消息 GET /api/sse/${param0} */
export async function sseSse(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.SseSseParams,
options?: RequestOptions,
) {
const { uid: param0, ...queryParams } = params;
return request<Record<string, any>>(`/api/sse/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}

View File

@ -0,0 +1,133 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取任务列表 GET /api/system/tasks */
export async function taskList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskListParams,
options?: RequestOptions,
) {
return request<{
items?: API.TaskEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/tasks', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 添加任务 POST /api/system/tasks */
export async function taskCreate(body: API.TaskDto, options?: RequestOptions) {
return request<any>('/api/system/tasks', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 查询任务详细信息 GET /api/system/tasks/${param0} */
export async function taskInfo(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskInfoParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.TaskEntity>(`/api/system/tasks/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新任务 PUT /api/system/tasks/${param0} */
export async function taskUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskUpdateParams,
body: API.TaskUpdateDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/tasks/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除任务 DELETE /api/system/tasks/${param0} */
export async function taskDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/tasks/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}
/** 手动执行一次任务 PUT /api/system/tasks/${param0}/once */
export async function taskOnce(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskOnceParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/tasks/${param0}/once`, {
method: 'PUT',
params: { ...queryParams },
...(options || {}),
});
}
/** 启动任务 PUT /api/system/tasks/${param0}/start */
export async function taskStart(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskStartParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/tasks/${param0}/start`, {
method: 'PUT',
params: { ...queryParams },
...(options || {}),
});
}
/** 停止任务 PUT /api/system/tasks/${param0}/stop */
export async function taskStop(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.TaskStopParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/tasks/${param0}/stop`, {
method: 'PUT',
params: { ...queryParams },
...(options || {}),
});
}

View File

@ -0,0 +1,110 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 获取用户列表 GET /api/system/users */
export async function userList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.UserListParams,
options?: RequestOptions,
) {
return request<{
items?: API.UserEntity[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/system/users', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 新增用户 POST /api/system/users */
export async function userCreate(body: API.UserDto, options?: RequestOptions) {
return request<any>('/api/system/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '创建成功' }),
});
}
/** 查询用户 GET /api/system/users/${param0} */
export async function userRead(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.UserReadParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<API.UserEntity>(`/api/system/users/${param0}`, {
method: 'GET',
params: { ...queryParams },
...(options || {}),
});
}
/** 更新用户 PUT /api/system/users/${param0} */
export async function userUpdate(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.UserUpdateParams,
body: API.UserUpdateDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/users/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || { successMsg: '更新成功' }),
});
}
/** 删除用户 DELETE /api/system/users/${param0} */
export async function userDelete(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.UserDeleteParams,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/users/${param0}`, {
method: 'DELETE',
params: { ...queryParams },
...(options || { successMsg: '删除成功' }),
});
}
/** 更改用户密码 POST /api/system/users/${param0}/password */
export async function userPassword(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.UserPasswordParams,
body: API.UserPasswordDto,
options?: RequestOptions,
) {
const { id: param0, ...queryParams } = params;
return request<any>(`/api/system/users/${param0}/password`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
params: { ...queryParams },
data: body,
...(options || {}),
});
}

View File

@ -0,0 +1,44 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 删除文件 POST /api/tools/storage/delete */
export async function storageDelete(body: API.StorageDeleteDto, options?: RequestOptions) {
return request<any>('/api/tools/storage/delete', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || { successMsg: '删除成功' }),
});
}
/** 获取本地存储列表 GET /api/tools/storage/list */
export async function storageList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.StorageListParams,
options?: RequestOptions,
) {
return request<{
items?: API.StorageInfo[];
meta?: {
itemCount?: number;
totalItems?: number;
itemsPerPage?: number;
totalPages?: number;
currentPage?: number;
};
}>('/api/tools/storage/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}

View File

@ -0,0 +1,40 @@
// @ts-ignore
/* eslint-disable */
/**
* @umijs/openapi openapi.config.ts
* */
import { request, type RequestOptions } from '@/utils/request';
/** 上传 POST /api/tools/upload */
export async function uploadUpload(body: API.FileUploadDto, file?: File, options?: RequestOptions) {
const formData = new FormData();
if (file) {
formData.append('file', file);
}
Object.keys(body).forEach((ele) => {
const item = (body as any)[ele];
if (item !== undefined && item !== null) {
if (typeof item === 'object' && !(item instanceof File)) {
if (item instanceof Array) {
item.forEach((f) => formData.append(ele, f || ''));
} else {
formData.append(ele, JSON.stringify(item));
}
} else {
formData.append(ele, item);
}
}
});
return request<any>('/api/tools/upload', {
method: 'POST',
data: formData,
requestType: 'form',
...(options || {}),
});
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
import { request } from '@/utils/request';
enum Api {
Login = '/boyanghu/iotree-service/platform/login',
}
/**
* @description:
*/
export interface LoginParams {
phone: string;
type: number; // 0短信 1密码
code?: string;
password?: string;
}
/**
* @description:
*/
export function loginApi(params: LoginParams) {
return request({
url: Api.Login,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
data: params,
});
}

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