提交新版本
BIN
.gitee/image/common/ai-feature.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
.gitee/image/common/ai-preview.gif
Normal file
|
After Width: | Height: | Size: 348 KiB |
BIN
.gitee/image/common/bpm-feature.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
.gitee/image/common/crm-feature.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
.gitee/image/common/erp-feature.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
.gitee/image/common/infra-feature.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
.gitee/image/common/mall-feature.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
.gitee/image/common/mall-preview.png
Normal file
|
After Width: | Height: | Size: 238 KiB |
BIN
.gitee/image/common/project-vs.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
.gitee/image/common/ruoyi-vue-pro-architecture.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
.gitee/image/common/ruoyi-vue-pro-biz.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
.gitee/image/common/system-feature.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
.gitee/image/common/yudao-cloud-architecture.png
Normal file
|
After Width: | Height: | Size: 201 KiB |
BIN
.gitee/image/common/yudao-roadmap.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
.gitee/image/demo/vben.png
Normal file
|
After Width: | Height: | Size: 196 KiB |
BIN
.gitee/image/wx-xingyu.png
Normal file
|
After Width: | Height: | Size: 495 KiB |
BIN
.gitee/image/工作流设计器-bpmn.jpg
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
.gitee/image/工作流设计器-simple.jpg
Normal file
|
After Width: | Height: | Size: 126 KiB |
172
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
name: Deploy Website on push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy-playground-ftp:
|
||||||
|
name: Deploy Push Playground Ftp
|
||||||
|
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Sed Config Base
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./playground/.env.production
|
||||||
|
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./playground/.env.production
|
||||||
|
cat ./playground/.env.production
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build:play
|
||||||
|
|
||||||
|
- name: Sync Playground files
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
|
username: ${{ secrets.WEB_PLAYGROUND_FTP_ACCOUNT }}
|
||||||
|
password: ${{ secrets.WEB_PLAYGROUND_FTP_PWSSWORD }}
|
||||||
|
local-dir: ./playground/dist/
|
||||||
|
|
||||||
|
deploy-docs-ftp:
|
||||||
|
name: Deploy Push Docs Ftp
|
||||||
|
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build:docs
|
||||||
|
|
||||||
|
- name: Sync Docs files
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
|
username: ${{ secrets.WEBSITE_FTP_ACCOUNT }}
|
||||||
|
password: ${{ secrets.WEBSITE_FTP_PASSWORD }}
|
||||||
|
local-dir: ./docs/.vitepress/dist/
|
||||||
|
|
||||||
|
deploy-antd-ftp:
|
||||||
|
name: Deploy Push Antd Ftp
|
||||||
|
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Sed Config Base
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-antd/.env.production
|
||||||
|
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-antd/.env.production
|
||||||
|
cat ./apps/web-antd/.env.production
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm run build:antd
|
||||||
|
|
||||||
|
- name: Sync files
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
|
username: ${{ secrets.WEB_ANTD_FTP_ACCOUNT }}
|
||||||
|
password: ${{ secrets.WEB_ANTD_FTP_PASSWORD }}
|
||||||
|
local-dir: ./apps/web-antd/dist/
|
||||||
|
|
||||||
|
deploy-ele-ftp:
|
||||||
|
name: Deploy Push Element Ftp
|
||||||
|
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Sed Config Base
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-ele/.env.production
|
||||||
|
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-ele/.env.production
|
||||||
|
cat ./apps/web-ele/.env.production
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm run build:ele
|
||||||
|
|
||||||
|
- name: Sync files
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
|
username: ${{ secrets.WEB_ELE_FTP_ACCOUNT }}
|
||||||
|
password: ${{ secrets.WEB_ELE_FTP_PASSWORD }}
|
||||||
|
local-dir: ./apps/web-ele/dist/
|
||||||
|
|
||||||
|
deploy-naive-ftp:
|
||||||
|
name: Deploy Push Naive Ftp
|
||||||
|
if: github.actor != 'dependabot[bot]' && !contains(github.event.head_commit.message, '[skip ci]') && github.repository == 'vbenjs/vue-vben-admin'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Sed Config Base
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sed -i "s#VITE_COMPRESS\s*=.*#VITE_COMPRESS = gzip#g" ./apps/web-naive/.env.production
|
||||||
|
sed -i "s#VITE_PWA\s*=.*#VITE_PWA = true#g" ./apps/web-naive/.env.production
|
||||||
|
cat ./apps/web-naive/.env.production
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: ./.github/actions/setup-node
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: pnpm run build:naive
|
||||||
|
|
||||||
|
- name: Sync files
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.6
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.PRO_FTP_HOST }}
|
||||||
|
username: ${{ secrets.WEB_NAIVE_FTP_ACCOUNT }}
|
||||||
|
password: ${{ secrets.WEB_NAIVE_FTP_PASSWORD }}
|
||||||
|
local-dir: ./apps/web-naive/dist/
|
||||||
|
|
||||||
|
rerun-on-failure:
|
||||||
|
name: Rerun on failure
|
||||||
|
needs:
|
||||||
|
- deploy-playground-ftp
|
||||||
|
- deploy-docs-ftp
|
||||||
|
- deploy-antd-ftp
|
||||||
|
- deploy-ele-ftp
|
||||||
|
- deploy-naive-ftp
|
||||||
|
if: failure() && fromJSON(github.run_attempt) < 10
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Retry ${{ fromJSON(github.run_attempt) }} of 10
|
||||||
|
env:
|
||||||
|
GH_REPO: ${{ github.repository }}
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}
|
||||||
52
.gitignore
vendored
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
dist.zip
|
||||||
|
dist.tar
|
||||||
|
dist.war
|
||||||
|
.nitro
|
||||||
|
.output
|
||||||
|
*-dist.zip
|
||||||
|
*-dist.tar
|
||||||
|
*-dist.war
|
||||||
|
coverage
|
||||||
|
*.local
|
||||||
|
**/.vitepress/cache
|
||||||
|
.cache
|
||||||
|
.turbo
|
||||||
|
.temp
|
||||||
|
dev-dist
|
||||||
|
.stylelintcache
|
||||||
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
|
.VSCodeCounter
|
||||||
|
**/backend-mock/data
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
vite.config.mts.*
|
||||||
|
vite.config.mjs.*
|
||||||
|
vite.config.js.*
|
||||||
|
vite.config.ts.*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
# .vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
.history
|
||||||
|
.cursor
|
||||||
13
.npmrc
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
registry=https://registry.npmmirror.com
|
||||||
|
public-hoist-pattern[]=lefthook
|
||||||
|
public-hoist-pattern[]=eslint
|
||||||
|
public-hoist-pattern[]=prettier
|
||||||
|
public-hoist-pattern[]=prettier-plugin-tailwindcss
|
||||||
|
public-hoist-pattern[]=stylelint
|
||||||
|
public-hoist-pattern[]=*postcss*
|
||||||
|
public-hoist-pattern[]=@commitlint/*
|
||||||
|
public-hoist-pattern[]=czg
|
||||||
|
|
||||||
|
strict-peer-dependencies=false
|
||||||
|
auto-install-peers=true
|
||||||
|
dedupe-peer-dependents=true
|
||||||
33
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"name": "vben admin antd dev",
|
||||||
|
"request": "launch",
|
||||||
|
"url": "http://localhost:5666",
|
||||||
|
"env": { "NODE_ENV": "development" },
|
||||||
|
"sourceMaps": true,
|
||||||
|
"webRoot": "${workspaceFolder}/apps/web-antd"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"name": "vben admin ele dev",
|
||||||
|
"request": "launch",
|
||||||
|
"url": "http://localhost:5777",
|
||||||
|
"env": { "NODE_ENV": "development" },
|
||||||
|
"sourceMaps": true,
|
||||||
|
"webRoot": "${workspaceFolder}/apps/web-ele"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"name": "vben admin naive dev",
|
||||||
|
"request": "launch",
|
||||||
|
"url": "http://localhost:5888",
|
||||||
|
"env": { "NODE_ENV": "development" },
|
||||||
|
"sourceMaps": true,
|
||||||
|
"webRoot": "${workspaceFolder}/apps/web-naive"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
228
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
{
|
||||||
|
"tailwindCSS.experimental.configFile": "internal/tailwind-config/src/index.ts",
|
||||||
|
// workbench
|
||||||
|
"workbench.list.smoothScrolling": true,
|
||||||
|
"workbench.startupEditor": "newUntitledFile",
|
||||||
|
"workbench.tree.indent": 10,
|
||||||
|
"workbench.editor.highlightModifiedTabs": true,
|
||||||
|
"workbench.editor.closeOnFileDelete": true,
|
||||||
|
"workbench.editor.limit.enabled": true,
|
||||||
|
"workbench.editor.limit.perEditorGroup": true,
|
||||||
|
"workbench.editor.limit.value": 5,
|
||||||
|
|
||||||
|
// editor
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.detectIndentation": false,
|
||||||
|
"editor.cursorBlinking": "expand",
|
||||||
|
"editor.largeFileOptimizations": true,
|
||||||
|
"editor.accessibilitySupport": "off",
|
||||||
|
"editor.cursorSmoothCaretAnimation": "on",
|
||||||
|
"editor.guides.bracketPairs": "active",
|
||||||
|
"editor.inlineSuggest.enabled": true,
|
||||||
|
"editor.suggestSelection": "recentlyUsedByPrefix",
|
||||||
|
"editor.acceptSuggestionOnEnter": "smart",
|
||||||
|
"editor.suggest.snippetsPreventQuickSuggestions": false,
|
||||||
|
"editor.stickyScroll.enabled": true,
|
||||||
|
"editor.hover.sticky": true,
|
||||||
|
"editor.suggest.insertMode": "replace",
|
||||||
|
"editor.bracketPairColorization.enabled": true,
|
||||||
|
"editor.autoClosingBrackets": "beforeWhitespace",
|
||||||
|
"editor.autoClosingDelete": "always",
|
||||||
|
"editor.autoClosingOvertype": "always",
|
||||||
|
"editor.autoClosingQuotes": "beforeWhitespace",
|
||||||
|
"editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:'\",.<>/?",
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": "explicit",
|
||||||
|
"source.fixAll.stylelint": "explicit",
|
||||||
|
"source.organizeImports": "never"
|
||||||
|
},
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"[html]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[css]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[scss]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[json]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[jsonc]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[vue]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
// extensions
|
||||||
|
"extensions.ignoreRecommendations": true,
|
||||||
|
|
||||||
|
// terminal
|
||||||
|
"terminal.integrated.cursorBlinking": true,
|
||||||
|
"terminal.integrated.persistentSessionReviveProcess": "never",
|
||||||
|
"terminal.integrated.tabs.enabled": true,
|
||||||
|
"terminal.integrated.scrollback": 10000,
|
||||||
|
"terminal.integrated.stickyScroll.enabled": true,
|
||||||
|
|
||||||
|
// files
|
||||||
|
"files.eol": "\n",
|
||||||
|
"files.insertFinalNewline": true,
|
||||||
|
"files.simpleDialog.enable": true,
|
||||||
|
"files.associations": {
|
||||||
|
"*.ejs": "html",
|
||||||
|
"*.art": "html",
|
||||||
|
"**/tsconfig.json": "jsonc",
|
||||||
|
"*.json": "jsonc",
|
||||||
|
"package.json": "json"
|
||||||
|
},
|
||||||
|
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.eslintcache": true,
|
||||||
|
"**/bower_components": true,
|
||||||
|
"**/.turbo": true,
|
||||||
|
"**/.idea": true,
|
||||||
|
"**/.vitepress": true,
|
||||||
|
"**/tmp": true,
|
||||||
|
"**/.git": true,
|
||||||
|
"**/.svn": true,
|
||||||
|
"**/.hg": true,
|
||||||
|
"**/CVS": true,
|
||||||
|
"**/.stylelintcache": true,
|
||||||
|
"**/.DS_Store": true,
|
||||||
|
"**/vite.config.mts.*": true,
|
||||||
|
"**/tea.yaml": true
|
||||||
|
},
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/.git/objects/**": true,
|
||||||
|
"**/.git/subtree-cache/**": true,
|
||||||
|
"**/.vscode/**": true,
|
||||||
|
"**/node_modules/**": true,
|
||||||
|
"**/tmp/**": true,
|
||||||
|
"**/bower_components/**": true,
|
||||||
|
"**/dist/**": true,
|
||||||
|
"**/yarn.lock": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"typescript.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo"],
|
||||||
|
|
||||||
|
// search
|
||||||
|
"search.searchEditor.singleClickBehaviour": "peekDefinition",
|
||||||
|
"search.followSymlinks": false,
|
||||||
|
// 在使用搜索功能时,将这些文件夹/文件排除在外
|
||||||
|
"search.exclude": {
|
||||||
|
"**/node_modules": true,
|
||||||
|
"**/*.log": true,
|
||||||
|
"**/*.log*": true,
|
||||||
|
"**/bower_components": true,
|
||||||
|
"**/dist": true,
|
||||||
|
"**/elehukouben": true,
|
||||||
|
"**/.git": true,
|
||||||
|
"**/.github": true,
|
||||||
|
"**/.gitignore": true,
|
||||||
|
"**/.svn": true,
|
||||||
|
"**/.DS_Store": true,
|
||||||
|
"**/.vitepress/cache": true,
|
||||||
|
"**/.idea": true,
|
||||||
|
"**/.vscode": false,
|
||||||
|
"**/.yarn": true,
|
||||||
|
"**/tmp": true,
|
||||||
|
"*.xml": true,
|
||||||
|
"out": true,
|
||||||
|
"dist": true,
|
||||||
|
"node_modules": true,
|
||||||
|
"CHANGELOG.md": true,
|
||||||
|
"**/pnpm-lock.yaml": true,
|
||||||
|
"**/yarn.lock": true,
|
||||||
|
"**/public/**": true
|
||||||
|
},
|
||||||
|
|
||||||
|
"debug.onTaskErrors": "debugAnyway",
|
||||||
|
"diffEditor.ignoreTrimWhitespace": false,
|
||||||
|
"npm.packageManager": "pnpm",
|
||||||
|
|
||||||
|
"css.validate": false,
|
||||||
|
"less.validate": false,
|
||||||
|
"scss.validate": false,
|
||||||
|
|
||||||
|
// extension
|
||||||
|
"emmet.showSuggestionsAsSnippets": true,
|
||||||
|
"emmet.triggerExpansionOnTab": false,
|
||||||
|
|
||||||
|
"errorLens.enabledDiagnosticLevels": ["warning", "error"],
|
||||||
|
"errorLens.excludeBySource": ["cSpell", "Grammarly", "eslint"],
|
||||||
|
|
||||||
|
"stylelint.enable": true,
|
||||||
|
"stylelint.packageManager": "pnpm",
|
||||||
|
"stylelint.validate": ["css", "less", "postcss", "scss", "vue"],
|
||||||
|
"stylelint.customSyntax": "postcss-html",
|
||||||
|
"stylelint.snippet": ["css", "less", "postcss", "scss", "vue"],
|
||||||
|
|
||||||
|
"typescript.inlayHints.enumMemberValues.enabled": true,
|
||||||
|
"typescript.preferences.preferTypeOnlyAutoImports": true,
|
||||||
|
"typescript.preferences.includePackageJsonAutoImports": "on",
|
||||||
|
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescriptreact",
|
||||||
|
"vue",
|
||||||
|
"html",
|
||||||
|
"markdown",
|
||||||
|
"json",
|
||||||
|
"jsonc",
|
||||||
|
"json5"
|
||||||
|
],
|
||||||
|
|
||||||
|
"tailwindCSS.experimental.classRegex": [
|
||||||
|
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
|
||||||
|
],
|
||||||
|
|
||||||
|
"github.copilot.enable": {
|
||||||
|
"*": false
|
||||||
|
},
|
||||||
|
|
||||||
|
"cssVariables.lookupFiles": ["packages/core/base/design/src/**/*.css"],
|
||||||
|
|
||||||
|
"i18n-ally.localesPaths": [
|
||||||
|
"packages/locales/src/langs",
|
||||||
|
"playground/src/locales/langs",
|
||||||
|
"apps/*/src/locales/langs"
|
||||||
|
],
|
||||||
|
"i18n-ally.pathMatcher": "{locale}/{namespace}.{ext}",
|
||||||
|
"i18n-ally.enabledParsers": ["json"],
|
||||||
|
"i18n-ally.sourceLanguage": "en",
|
||||||
|
"i18n-ally.displayLanguage": "zh-CN",
|
||||||
|
"i18n-ally.enabledFrameworks": ["vue", "react"],
|
||||||
|
"i18n-ally.keystyle": "nested",
|
||||||
|
"i18n-ally.sortKeys": true,
|
||||||
|
"i18n-ally.namespace": true,
|
||||||
|
|
||||||
|
// 控制相关文件嵌套展示
|
||||||
|
"explorer.fileNesting.enabled": true,
|
||||||
|
"explorer.fileNesting.expand": false,
|
||||||
|
"explorer.fileNesting.patterns": {
|
||||||
|
"*.ts": "$(capture).test.ts, $(capture).test.tsx, $(capture).spec.ts, $(capture).spec.tsx, $(capture).d.ts",
|
||||||
|
"*.tsx": "$(capture).test.ts, $(capture).test.tsx, $(capture).spec.ts, $(capture).spec.tsx,$(capture).d.ts",
|
||||||
|
"*.env": "$(capture).env.*",
|
||||||
|
"README.md": "README*,CHANGELOG*,LICENSE,CNAME",
|
||||||
|
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,.gitattributes,.gitignore,.gitpod.yml,.npmrc,.browserslistrc,.node-version,.git*,.tazerc.json",
|
||||||
|
"eslint.config.mjs": ".eslintignore,.prettierignore,.stylelintignore,.commitlintrc.*,.prettierrc.*,stylelint.config.*,.lintstagedrc.mjs,cspell.json,lefthook.yml",
|
||||||
|
"tailwind.config.mjs": "postcss.*"
|
||||||
|
},
|
||||||
|
"commentTranslate.hover.enabled": false,
|
||||||
|
"commentTranslate.multiLineMerge": true,
|
||||||
|
"vue.server.hybridMode": true,
|
||||||
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
|
"oxc.enable": false
|
||||||
|
}
|
||||||
240
README.md
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
# 严肃声明:现在、未来都不会有商业版本,所有代码全部开源
|
||||||
|
|
||||||
|
**「我喜欢写代码,乐此不疲」**
|
||||||
|
**「我喜欢做开源,以此为乐」**
|
||||||
|
|
||||||
|
我 🐶 在上海艰苦奋斗,早中晚在 top3 大厂认真搬砖,夜里为开源做贡献。
|
||||||
|
|
||||||
|
如果这个项目让你有所收获,记得 Star 关注哦,这对我是非常不错的鼓励与支持。
|
||||||
|
|
||||||
|
## 🐶 新手必读
|
||||||
|
|
||||||
|
- nodejs > 20.12.0 && pnpm > 10.14.0 (强制使用pnpm)
|
||||||
|
- 演示地址【Vue3 + element-plus】:<http://dashboard-vue3.yudao.iocoder.cn>
|
||||||
|
- 演示地址【Vue3 + vben5(ant-design-vue)】:<http://dashboard-vben.yudao.iocoder.cn>
|
||||||
|
- 演示地址【Vue2 + element-ui】:<http://dashboard.yudao.iocoder.cn>
|
||||||
|
- 启动文档:<https://doc.iocoder.cn/quick-start/>
|
||||||
|
- 视频教程:<https://doc.iocoder.cn/video/>
|
||||||
|
|
||||||
|
## 🐯 平台简介
|
||||||
|
|
||||||
|
**芋道**,以开发者为中心,打造中国第一流的快速开发平台,全部开源,个人与企业可 100% 免费使用。
|
||||||
|
|
||||||
|
- 采用最新 [vue-vben-admin](https://github.com/vbenjs/vue-vben-admin) v5 实现
|
||||||
|
- 支持 [Ant Design Vue](https://www.antdv.com/) | [Element Plus](https://element-plus.org/zh-CN/) | [Naive UI](https://www.naiveui.com/) | [TDesign](https://tdesign.tencent.com/) 多种免费开源的中后台模版,具备如下特性:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- **最新技术栈**:使用 Vue3、Vite6 等前端前沿技术开发
|
||||||
|
- **TypeScript**: 应用程序级 JavaScript 的语言
|
||||||
|
- **主题**: 提供多套主题色彩,可配置自定义主题
|
||||||
|
- **国际化**:内置完善的国际化方案
|
||||||
|
- **权限**:内置完善的动态路由权限生成方案
|
||||||
|
- **组件**:二次封装了多个常用的组件
|
||||||
|
- **示例**:内置丰富的示例
|
||||||
|
|
||||||
|
## [外包项目请联系【非项目需求请勿扫码,非客服,不解答项目问题】](https://www.shuduokeji.com)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 技术栈
|
||||||
|
|
||||||
|
| 框架 | 说明 | 版本 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [Vue](https://staging-cn.vuejs.org/) | vue框架 | 3.5.17 |
|
||||||
|
| [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 7.1.2 |
|
||||||
|
| [Ant Design Vue](https://www.antdv.com/) | Ant Design Vue | 4.2.6 |
|
||||||
|
| [Element Plus](https://element-plus.org/zh-CN/) | Element Plus | 2.10.2 |
|
||||||
|
| [Naive UI](https://www.naiveui.com/) | Naive UI | 2.42.0 |
|
||||||
|
| [TDesign](https://tdesign.tencent.com/) | TDesign | 1.17.1 |
|
||||||
|
| [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 超集 | 5.8.3 |
|
||||||
|
| [pinia](https://pinia.vuejs.org/) | Vue 存储库替代 vuex5 | 3.0.3 |
|
||||||
|
| [vueuse](https://vueuse.org/) | 常用工具集 | 13.4.0 |
|
||||||
|
| [vue-i18n](https://kazupon.github.io/vue-i18n/zh/introduction.html/) | 国际化 | 11.1.7 |
|
||||||
|
| [vue-router](https://router.vuejs.org/) | Vue 路由 | 4.5.1 |
|
||||||
|
| [Tailwind CSS](https://tailwindcss.com/) | 原子 CSS | 3.4.17 |
|
||||||
|
| [Iconify](https://iconify.design/) | 图标组件 | 5.0.0 |
|
||||||
|
| [Iconify](https://icon-sets.iconify.design/) | 在线图标库 | 2.2.354 |
|
||||||
|
| [TinyMCE](https://www.tiny.cloud/) | 富文本编辑器 | 6.1.0 |
|
||||||
|
| [Echarts](https://echarts.apache.org/) | 图表库 | 5.6.0 |
|
||||||
|
| [axios](https://axios-http.com/) | http客户端 | 1.10.0 |
|
||||||
|
| [dayjs](https://day.js.org/) | 日期处理库 | 1.11.13 |
|
||||||
|
| [vee-validate](https://vee-validate.logaretm.com/) | 表单验证 | 4.15.1 |
|
||||||
|
| [zod](https://zod.dev/) | 数据验证 | 3.25.67 |
|
||||||
|
|
||||||
|
## 🔥 后端架构
|
||||||
|
|
||||||
|
支持 Spring Boot、Spring Cloud 两种架构:
|
||||||
|
|
||||||
|
① Spring Boot 单体架构:<https://doc.iocoder.cn>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
② Spring Cloud 微服务架构:<https://cloud.iocoder.cn>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 内置功能
|
||||||
|
|
||||||
|
系统内置多种多种业务功能,可以用于快速你的业务系统:
|
||||||
|
|
||||||
|
系统内置多种多种业务功能,可以用于快速你的业务系统:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- 通用模块(必选):系统功能、基础设施
|
||||||
|
- 通用模块(可选):工作流程、支付系统、数据报表、会员中心
|
||||||
|
- 业务系统(按需):ERP 系统、CRM 系统、商城系统、微信公众号、AI 大模型
|
||||||
|
|
||||||
|
### 系统功能
|
||||||
|
|
||||||
|
| | 功能 | 描述 |
|
||||||
|
|----|-------|---------------------------------|
|
||||||
|
| | 用户管理 | 用户是系统操作者,该功能主要完成系统用户配置 |
|
||||||
|
| ⭐️ | 在线用户 | 当前系统中活跃用户状态监控,支持手动踢下线 |
|
||||||
|
| | 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 |
|
||||||
|
| | 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等,本地缓存提供性能 |
|
||||||
|
| | 部门管理 | 配置系统组织机构(公司、部门、小组),树结构展现支持数据权限 |
|
||||||
|
| | 岗位管理 | 配置系统用户所属担任职务 |
|
||||||
|
| 🚀 | 租户管理 | 配置系统租户,支持 SaaS 场景下的多租户功能 |
|
||||||
|
| 🚀 | 租户套餐 | 配置租户套餐,自定每个租户的菜单、操作、按钮的权限 |
|
||||||
|
| | 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 |
|
||||||
|
| 🚀 | 短信管理 | 短信渠道、短息模板、短信日志,对接阿里云、腾讯云等主流短信平台 |
|
||||||
|
| 🚀 | 邮件管理 | 邮箱账号、邮件模版、邮件发送日志,支持所有邮件平台 |
|
||||||
|
| 🚀 | 站内信 | 系统内的消息通知,提供站内信模版、站内信消息 |
|
||||||
|
| 🚀 | 操作日志 | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 |
|
||||||
|
| ⭐️ | 登录日志 | 系统登录日志记录查询,包含登录异常 |
|
||||||
|
| 🚀 | 错误码管理 | 系统所有错误码的管理,可在线修改错误提示,无需重启服务 |
|
||||||
|
| | 通知公告 | 系统通知公告信息发布维护 |
|
||||||
|
| 🚀 | 敏感词 | 配置系统敏感词,支持标签分组 |
|
||||||
|
| 🚀 | 应用管理 | 管理 SSO 单点登录的应用,支持多种 OAuth2 授权方式 |
|
||||||
|
| 🚀 | 地区管理 | 展示省份、城市、区镇等城市信息,支持 IP 对应城市 |
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 工作流程
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
基于 Flowable 构建,可支持信创(国产)数据库,满足中国特色流程操作:
|
||||||
|
|
||||||
|
| BPMN 设计器 | 钉钉/飞书设计器 |
|
||||||
|
| --- | --- |
|
||||||
|
|  |  |
|
||||||
|
|
||||||
|
> 历经头部企业生产验证,工作流引擎须标配仿钉钉/飞书 + BPMN 双设计器!!!
|
||||||
|
>
|
||||||
|
> 前者支持轻量配置简单流程,后者实现复杂场景深度编排
|
||||||
|
|
||||||
|
| 功能列表 | 功能描述 | 是否完成 |
|
||||||
|
|------------|-------------------------------------------------------------------------------------|------|
|
||||||
|
| SIMPLE 设计器 | 仿钉钉/飞书设计器,支持拖拽搭建表单流程,10 分钟快速完成审批流程配置 | ✅ |
|
||||||
|
| BPMN 设计器 | 基于 BPMN 标准开发,适配复杂业务场景,满足多层级审批及流程自动化需求 | ✅ |
|
||||||
|
| 会签 | 同一个审批节点设置多个人(如 A、B、C 三人,三人会同时收到待办任务),需全部同意之后,审批才可到下一审批节点 | ✅ |
|
||||||
|
| 或签 | 同一个审批节点设置多个人,任意一个人处理后,就能进入下一个节点 | ✅ |
|
||||||
|
| 依次审批 | (顺序会签)同一个审批节点设置多个人(如 A、B、C 三人),三人按顺序依次收到待办,即 A 先审批,A 提交后 B 才能审批,需全部同意之后,审批才可到下一审批节点 | ✅ |
|
||||||
|
| 抄送 | 将审批结果通知给抄送人,同一个审批默认排重,不重复抄送给同一人 | ✅ |
|
||||||
|
| 驳回 | (退回)将审批重置发送给某节点,重新审批。可驳回至发起人、上一节点、任意节点 | ✅ |
|
||||||
|
| 转办 | A 转给其 B 审批,B 审批后,进入下一节点 | ✅ |
|
||||||
|
| 委派 | A 转给其 B 审批,B 审批后,转给 A,A 继续审批后进入下一节点 | ✅ |
|
||||||
|
| 加签 | 允许当前审批人根据需要,自行增加当前节点的审批人,支持向前、向后加签 | ✅ |
|
||||||
|
| 减签 | (取消加签)在当前审批人操作之前,减少审批人 | ✅ |
|
||||||
|
| 撤销 | (取消流程)流程发起人,可以对流程进行撤销处理 | ✅ |
|
||||||
|
| 终止 | 系统管理员,在任意节点终止流程实例 | ✅ |
|
||||||
|
| 表单权限 | 支持拖拉拽配置表单,每个审批节点可配置只读、编辑、隐藏权限 | ✅ |
|
||||||
|
| 超时审批 | 配置超时审批时间,超时后自动触发审批通过、不通过、驳回等操作 | ✅ |
|
||||||
|
| 自动提醒 | 配置提醒时间,到达时间后自动触发短信、邮箱、站内信等通知提醒,支持自定义重复提醒频次 | ✅ |
|
||||||
|
| 父子流程 | 主流程设置子流程节点,子流程节点会自动触发子流程。子流程结束后,主流程才会执行(继续往下下执行),支持同步子流程、异步子流程 | ✅ |
|
||||||
|
| 条件分支 | (排它分支)用于在流程中实现决策,即根据条件选择一个分支执行 | ✅ |
|
||||||
|
| 并行分支 | 允许将流程分成多条分支,不进行条件判断,所有分支都会执行 | ✅ |
|
||||||
|
| 包容分支 | (条件分支 + 并行分支的结合体)允许基于条件选择多条分支执行,但如果没有任何一个分支满足条件,则可以选择默认分支 | ✅ |
|
||||||
|
| 路由分支 | 根据条件选择一个分支执行(重定向到指定配置节点),也可以选择默认分支执行(继续往下执行) | ✅ |
|
||||||
|
| 触发节点 | 执行到该节点,触发 HTTP 请求、HTTP 回调、更新数据、删除数据等 | ✅ |
|
||||||
|
| 延迟节点 | 执行到该节点,审批等待一段时间再执行,支持固定时长、固定日期等 | ✅ |
|
||||||
|
| 拓展设置 | 流程前置/后置通知,节点(任务)前置、后置通知,流程报表,自动审批去重,自定流程编号、标题、摘要,流程报表等 | ✅ |
|
||||||
|
|
||||||
|
### 支付系统
|
||||||
|
|
||||||
|
| | 功能 | 描述 |
|
||||||
|
| --- | -------- | -------------------------------------------------- |
|
||||||
|
| 🚀 | 应用信息 | 配置商户的应用信息,对接支付宝、微信等多个支付渠道 |
|
||||||
|
| 🚀 | 支付订单 | 查看用户发起的支付宝、微信等的【支付】订单 |
|
||||||
|
| 🚀 | 退款订单 | 查看用户发起的支付宝、微信等的【退款】订单 |
|
||||||
|
| 🚀 | 回调通知 | 查看支付回调业务的【支付】【退款】的通知结果 |
|
||||||
|
| 🚀 | 接入示例 | 提供接入支付系统的【支付】【退款】的功能实战 |
|
||||||
|
|
||||||
|
### 基础设施
|
||||||
|
|
||||||
|
| | 功能 | 描述 |
|
||||||
|
|----|-----------|----------------------------------------------|
|
||||||
|
| 🚀 | 代码生成 | 前后端代码的生成(Java、Vue、SQL、单元测试),支持 CRUD 下载 |
|
||||||
|
| 🚀 | 系统接口 | 基于 Swagger 自动生成相关的 RESTful API 接口文档 |
|
||||||
|
| 🚀 | 数据库文档 | 基于 Screw 自动生成数据库文档,支持导出 Word、HTML、MD 格式 |
|
||||||
|
| | 表单构建 | 拖动表单元素生成相应的 HTML 代码,支持导出 JSON、Vue 文件 |
|
||||||
|
| 🚀 | 配置管理 | 对系统动态配置常用参数,支持 SpringBoot 加载 |
|
||||||
|
| ⭐️ | 定时任务 | 在线(添加、修改、删除)任务调度包含执行结果日志 |
|
||||||
|
| 🚀 | 文件服务 | 支持将文件存储到 S3(MinIO、阿里云、腾讯云、七牛云)、本地、FTP、数据库等 |
|
||||||
|
| 🚀 | WebSocket | 提供 WebSocket 接入示例,支持一对一、一对多发送方式 |
|
||||||
|
| 🚀 | API 日志 | 包括 RESTful API 访问日志、异常日志两部分,方便排查 API 相关的问题 |
|
||||||
|
| | MySQL 监控 | 监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈 |
|
||||||
|
| | Redis 监控 | 监控 Redis 数据库的使用情况,使用的 Redis Key 管理 |
|
||||||
|
| 🚀 | 消息队列 | 基于 Redis 实现消息队列,Stream 提供集群消费,Pub/Sub 提供广播消费 |
|
||||||
|
| 🚀 | Java 监控 | 基于 Spring Boot Admin 实现 Java 应用的监控 |
|
||||||
|
| 🚀 | 链路追踪 | 接入 SkyWalking 组件,实现链路追踪 |
|
||||||
|
| 🚀 | 日志中心 | 接入 SkyWalking 组件,实现日志中心 |
|
||||||
|
| 🚀 | 服务保障 | 基于 Redis 实现分布式锁、幂等、限流功能,满足高并发场景 |
|
||||||
|
| 🚀 | 日志服务 | 轻量级日志中心,查看远程服务器的日志 |
|
||||||
|
| 🚀 | 单元测试 | 基于 JUnit + Mockito 实现单元测试,保证功能的正确性、代码的质量等 |
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### 数据报表
|
||||||
|
|
||||||
|
| | 功能 | 描述 |
|
||||||
|
| --- | ---------- | ------------------------------------ |
|
||||||
|
| 🚀 | 报表设计器 | 支持数据报表、图形报表、打印设计等 |
|
||||||
|
| 🚀 | 大屏设计器 | 拖拽生成数据大屏,内置几十种图表组件 |
|
||||||
|
|
||||||
|
### 微信公众号
|
||||||
|
|
||||||
|
| | 功能 | 描述 |
|
||||||
|
|----|--------|-------------------------------|
|
||||||
|
| 🚀 | 账号管理 | 配置接入的微信公众号,可支持多个公众号 |
|
||||||
|
| 🚀 | 数据统计 | 统计公众号的用户增减、累计用户、消息概况、接口分析等数据 |
|
||||||
|
| 🚀 | 粉丝管理 | 查看已关注、取关的粉丝列表,可对粉丝进行同步、打标签等操作 |
|
||||||
|
| 🚀 | 消息管理 | 查看粉丝发送的消息列表,可主动回复粉丝消息 |
|
||||||
|
| 🚀 | 模版消息 | 配置和发送模版消息,用于向粉丝推送通知类消息 |
|
||||||
|
| 🚀 | 自动回复 | 自动回复粉丝发送的消息,支持关注回复、消息回复、关键字回复 |
|
||||||
|
| 🚀 | 标签管理 | 对公众号的标签进行创建、查询、修改、删除等操作 |
|
||||||
|
| 🚀 | 菜单管理 | 自定义公众号的菜单,也可以从公众号同步菜单 |
|
||||||
|
| 🚀 | 素材管理 | 管理公众号的图片、语音、视频等素材,支持在线播放语音、视频 |
|
||||||
|
| 🚀 | 图文草稿箱 | 新增常用的图文素材到草稿箱,可发布到公众号 |
|
||||||
|
| 🚀 | 图文发表记录 | 查看已发布成功的图文素材,支持删除操作 |
|
||||||
|
|
||||||
|
### 商城系统
|
||||||
|
|
||||||
|
演示地址:<https://doc.iocoder.cn/mall-preview/>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### ERP 系统
|
||||||
|
|
||||||
|
演示地址:<https://doc.iocoder.cn/erp-preview/>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### CRM 系统
|
||||||
|
|
||||||
|
演示地址:<https://doc.iocoder.cn/crm-preview/>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### AI 大模型
|
||||||
|
|
||||||
|
演示地址:<https://doc.iocoder.cn/ai-preview/>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
35
apps/web-antd/.env
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# 应用标题
|
||||||
|
VITE_APP_TITLE=芋道管理系统
|
||||||
|
|
||||||
|
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
||||||
|
VITE_APP_NAMESPACE=yudao-vben-antd
|
||||||
|
|
||||||
|
# 对store进行加密的密钥,在将store持久化到localStorage时会使用该密钥进行加密
|
||||||
|
VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key
|
||||||
|
|
||||||
|
# 是否开启模拟数据
|
||||||
|
VITE_NITRO_MOCK=false
|
||||||
|
|
||||||
|
# 租户开关
|
||||||
|
VITE_APP_TENANT_ENABLE=true
|
||||||
|
|
||||||
|
# 验证码的开关
|
||||||
|
VITE_APP_CAPTCHA_ENABLE=false
|
||||||
|
|
||||||
|
# 文档地址的开关
|
||||||
|
VITE_APP_DOCALERT_ENABLE=true
|
||||||
|
|
||||||
|
# 百度统计
|
||||||
|
VITE_APP_BAIDU_CODE = e98f2eab6ceb8688bc6d8fc5332ff093
|
||||||
|
|
||||||
|
# GoView域名
|
||||||
|
VITE_GOVIEW_URL='http://127.0.0.1:3000'
|
||||||
|
|
||||||
|
# API 加解密
|
||||||
|
VITE_APP_API_ENCRYPT_ENABLE = true
|
||||||
|
VITE_APP_API_ENCRYPT_HEADER = X-Api-Encrypt
|
||||||
|
VITE_APP_API_ENCRYPT_ALGORITHM = AES
|
||||||
|
VITE_APP_API_ENCRYPT_REQUEST_KEY = 52549111389893486934626385991395
|
||||||
|
VITE_APP_API_ENCRYPT_RESPONSE_KEY = 96103715984234343991809655248883
|
||||||
|
# VITE_APP_API_ENCRYPT_REQUEST_KEY = MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCls2rIpnGdYnLFgz1XU13GbNQ5DloyPpvW00FPGjqn5Z6JpK+kDtVlnkhwR87iRrE5Vf2WNqRX6vzbLSgveIQY8e8oqGCb829myjf1MuI+ZzN4ghf/7tEYhZJGPI9AbfxFqBUzm+kR3/HByAI22GLT96WM26QiMK8n3tIP/yiLswIDAQAB
|
||||||
|
# VITE_APP_API_ENCRYPT_RESPONSE_KEY = MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOH8IfIFxL/MR9XIg1UDv5z1fGXQI93E8wrU4iPFovL/sEt9uSgSkjyidC2O7N+m7EKtoN6b1u7cEwXSkwf3kfK0jdWLSQaNpX5YshqXCBzbDfugDaxuyYrNA4/tIMs7mzZAk0APuRXB35Dmupou7Yw7TFW/7QhQmGfzeEKULQvnAgMBAAECgYAw8LqlQGyQoPv5p3gRxEMOCfgL0JzD3XBJKztiRd35RDh40Nx1ejgjW4dPioFwGiVWd2W8cAGHLzALdcQT2KDJh+T/tsd4SPmI6uSBBK6Ff2DkO+kFFcuYvfclQQKqxma5CaZOSqhgenacmgTMFeg2eKlY3symV6JlFNu/IKU42QJBAOhxAK/Eq3e61aYQV2JSguhMR3b8NXJJRroRs/QHEanksJtl+M+2qhkC9nQVXBmBkndnkU/l2tYcHfSBlAyFySMCQQD445tgm/J2b6qMQmuUGQAYDN8FIkHjeKmha+l/fv0igWm8NDlBAem91lNDIPBUzHL1X1+pcts5bjmq99YdOnhtAkAg2J8dN3B3idpZDiQbC8fd5bGPmdI/pSUudAP27uzLEjr2qrE/QPPGdwm2m7IZFJtK7kK1hKio6u48t/bg0iL7AkEAuUUs94h+v702Fnym+jJ2CHEkXvz2US8UDs52nWrZYiM1o1y4tfSHm8H8bv8JCAa9GHyriEawfBraILOmllFdLQJAQSRZy4wmlaG48MhVXodB85X+VZ9krGXZ2TLhz7kz9iuToy53l9jTkESt6L5BfBDCVdIwcXLYgK+8KFdHN5W7HQ==
|
||||||
71
apps/web-antd/package.json
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
"name": "@vben/web-antd",
|
||||||
|
"version": "5.5.9",
|
||||||
|
"homepage": "https://vben.pro",
|
||||||
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
||||||
|
"directory": "apps/web-antd"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"author": {
|
||||||
|
"name": "vben",
|
||||||
|
"email": "ann.vben@gmail.com",
|
||||||
|
"url": "https://github.com/anncwb"
|
||||||
|
},
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "pnpm vite build --mode production",
|
||||||
|
"build:analyze": "pnpm vite build --mode analyze",
|
||||||
|
"dev": "pnpm vite --mode development",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"typecheck": "vue-tsc --noEmit --skipLibCheck"
|
||||||
|
},
|
||||||
|
"imports": {
|
||||||
|
"#/*": "./src/*"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@form-create/ant-design-vue": "catalog:",
|
||||||
|
"@form-create/antd-designer": "catalog:",
|
||||||
|
"@tinymce/tinymce-vue": "catalog:",
|
||||||
|
"@vben/access": "workspace:*",
|
||||||
|
"@vben/common-ui": "workspace:*",
|
||||||
|
"@vben/constants": "workspace:*",
|
||||||
|
"@vben/hooks": "workspace:*",
|
||||||
|
"@vben/icons": "workspace:*",
|
||||||
|
"@vben/layouts": "workspace:*",
|
||||||
|
"@vben/locales": "workspace:*",
|
||||||
|
"@vben/plugins": "workspace:*",
|
||||||
|
"@vben/preferences": "workspace:*",
|
||||||
|
"@vben/request": "workspace:*",
|
||||||
|
"@vben/stores": "workspace:*",
|
||||||
|
"@vben/styles": "workspace:*",
|
||||||
|
"@vben/types": "workspace:*",
|
||||||
|
"@vben/utils": "workspace:*",
|
||||||
|
"@videojs-player/vue": "catalog:",
|
||||||
|
"@vueuse/core": "catalog:",
|
||||||
|
"@vueuse/integrations": "catalog:",
|
||||||
|
"ant-design-vue": "catalog:",
|
||||||
|
"benz-amr-recorder": "catalog:",
|
||||||
|
"bpmn-js": "catalog:",
|
||||||
|
"bpmn-js-properties-panel": "catalog:",
|
||||||
|
"bpmn-js-token-simulation": "catalog:",
|
||||||
|
"camunda-bpmn-moddle": "catalog:",
|
||||||
|
"cropperjs": "catalog:",
|
||||||
|
"dayjs": "catalog:",
|
||||||
|
"diagram-js": "catalog:",
|
||||||
|
"fast-xml-parser": "catalog:",
|
||||||
|
"highlight.js": "catalog:",
|
||||||
|
"pinia": "catalog:",
|
||||||
|
"steady-xml": "catalog:",
|
||||||
|
"tinymce": "catalog:",
|
||||||
|
"video.js": "catalog:",
|
||||||
|
"vue": "catalog:",
|
||||||
|
"vue-dompurify-html": "catalog:",
|
||||||
|
"vue-router": "catalog:",
|
||||||
|
"vue3-print-nb": "catalog:",
|
||||||
|
"vue3-signature": "catalog:",
|
||||||
|
"vuedraggable": "catalog:"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
apps/web-antd/public/wx-xingyu.png
Normal file
|
After Width: | Height: | Size: 495 KiB |
244
apps/web-antd/src/adapter/component/index.ts
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
/**
|
||||||
|
* 通用组件共同的使用的基础组件,原先放在 adapter/form 内部,限制了使用范围,这里提取出来,方便其他地方使用
|
||||||
|
* 可用于 vben-form、vben-modal、vben-drawer 等组件使用,
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { Component } from 'vue';
|
||||||
|
|
||||||
|
import type { BaseFormComponentType } from '@vben/common-ui';
|
||||||
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
|
import { defineAsyncComponent, defineComponent, h, ref } from 'vue';
|
||||||
|
|
||||||
|
import { ApiComponent, globalShareState, IconPicker } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
|
||||||
|
import { notification } from 'ant-design-vue';
|
||||||
|
|
||||||
|
import { Tinymce as RichTextarea } from '#/components/tinymce';
|
||||||
|
import { FileUpload, ImageUpload } from '#/components/upload';
|
||||||
|
|
||||||
|
const AutoComplete = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/auto-complete'),
|
||||||
|
);
|
||||||
|
const Button = defineAsyncComponent(() => import('ant-design-vue/es/button'));
|
||||||
|
const Cascader = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/cascader'),
|
||||||
|
);
|
||||||
|
const Checkbox = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/checkbox'),
|
||||||
|
);
|
||||||
|
const CheckboxGroup = defineAsyncComponent(() =>
|
||||||
|
import('ant-design-vue/es/checkbox').then((res) => res.CheckboxGroup),
|
||||||
|
);
|
||||||
|
const DatePicker = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/date-picker'),
|
||||||
|
);
|
||||||
|
const Divider = defineAsyncComponent(() => import('ant-design-vue/es/divider'));
|
||||||
|
const Input = defineAsyncComponent(() => import('ant-design-vue/es/input'));
|
||||||
|
const InputNumber = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/input-number'),
|
||||||
|
);
|
||||||
|
const InputPassword = defineAsyncComponent(() =>
|
||||||
|
import('ant-design-vue/es/input').then((res) => res.InputPassword),
|
||||||
|
);
|
||||||
|
const Mentions = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/mentions'),
|
||||||
|
);
|
||||||
|
const Radio = defineAsyncComponent(() => import('ant-design-vue/es/radio'));
|
||||||
|
const RadioGroup = defineAsyncComponent(() =>
|
||||||
|
import('ant-design-vue/es/radio').then((res) => res.RadioGroup),
|
||||||
|
);
|
||||||
|
const RangePicker = defineAsyncComponent(() =>
|
||||||
|
import('ant-design-vue/es/date-picker').then((res) => res.RangePicker),
|
||||||
|
);
|
||||||
|
const Rate = defineAsyncComponent(() => import('ant-design-vue/es/rate'));
|
||||||
|
const Select = defineAsyncComponent(() => import('ant-design-vue/es/select'));
|
||||||
|
const Space = defineAsyncComponent(() => import('ant-design-vue/es/space'));
|
||||||
|
const Switch = defineAsyncComponent(() => import('ant-design-vue/es/switch'));
|
||||||
|
const Textarea = defineAsyncComponent(() =>
|
||||||
|
import('ant-design-vue/es/input').then((res) => res.Textarea),
|
||||||
|
);
|
||||||
|
const TimePicker = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/time-picker'),
|
||||||
|
);
|
||||||
|
const TimeRangePicker = defineAsyncComponent(() =>
|
||||||
|
import('ant-design-vue/es/time-picker').then((res) => res.TimeRangePicker),
|
||||||
|
);
|
||||||
|
const TreeSelect = defineAsyncComponent(
|
||||||
|
() => import('ant-design-vue/es/tree-select'),
|
||||||
|
);
|
||||||
|
const Upload = defineAsyncComponent(() => import('ant-design-vue/es/upload'));
|
||||||
|
|
||||||
|
const withDefaultPlaceholder = <T extends Component>(
|
||||||
|
component: T,
|
||||||
|
type: 'input' | 'select',
|
||||||
|
componentProps: Recordable<any> = {},
|
||||||
|
) => {
|
||||||
|
return defineComponent({
|
||||||
|
name: component.name,
|
||||||
|
inheritAttrs: false,
|
||||||
|
setup: (props: any, { attrs, expose, slots }) => {
|
||||||
|
const placeholder =
|
||||||
|
props?.placeholder ||
|
||||||
|
attrs?.placeholder ||
|
||||||
|
$t(`ui.placeholder.${type}`);
|
||||||
|
// 透传组件暴露的方法
|
||||||
|
const innerRef = ref();
|
||||||
|
expose(
|
||||||
|
new Proxy(
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
get: (_target, key) => innerRef.value?.[key],
|
||||||
|
has: (_target, key) => key in (innerRef.value || {}),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return () =>
|
||||||
|
h(
|
||||||
|
component,
|
||||||
|
{ ...componentProps, placeholder, ...props, ...attrs, ref: innerRef },
|
||||||
|
slots,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 这里需要自行根据业务组件库进行适配,需要用到的组件都需要在这里类型说明
|
||||||
|
export type ComponentType =
|
||||||
|
| 'ApiCascader'
|
||||||
|
| 'ApiSelect'
|
||||||
|
| 'ApiTreeSelect'
|
||||||
|
| 'AutoComplete'
|
||||||
|
| 'Checkbox'
|
||||||
|
| 'CheckboxGroup'
|
||||||
|
| 'DatePicker'
|
||||||
|
| 'DefaultButton'
|
||||||
|
| 'Divider'
|
||||||
|
| 'FileUpload'
|
||||||
|
| 'IconPicker'
|
||||||
|
| 'ImageUpload'
|
||||||
|
| 'Input'
|
||||||
|
| 'InputNumber'
|
||||||
|
| 'InputPassword'
|
||||||
|
| 'Mentions'
|
||||||
|
| 'PrimaryButton'
|
||||||
|
| 'Radio'
|
||||||
|
| 'RadioGroup'
|
||||||
|
| 'RangePicker'
|
||||||
|
| 'Rate'
|
||||||
|
| 'RichTextarea'
|
||||||
|
| 'Select'
|
||||||
|
| 'Space'
|
||||||
|
| 'Switch'
|
||||||
|
| 'Textarea'
|
||||||
|
| 'TimePicker'
|
||||||
|
| 'TimeRangePicker'
|
||||||
|
| 'TreeSelect'
|
||||||
|
| 'Upload'
|
||||||
|
| BaseFormComponentType;
|
||||||
|
|
||||||
|
async function initComponentAdapter() {
|
||||||
|
const components: Partial<Record<ComponentType, Component>> = {
|
||||||
|
// 如果你的组件体积比较大,可以使用异步加载
|
||||||
|
// Button: () =>
|
||||||
|
// import('xxx').then((res) => res.Button),
|
||||||
|
ApiCascader: withDefaultPlaceholder(
|
||||||
|
{
|
||||||
|
...ApiComponent,
|
||||||
|
name: 'ApiCascader',
|
||||||
|
},
|
||||||
|
'select',
|
||||||
|
{
|
||||||
|
component: Cascader,
|
||||||
|
fieldNames: { label: 'label', value: 'value', children: 'children' },
|
||||||
|
loadingSlot: 'suffixIcon',
|
||||||
|
modelPropName: 'value',
|
||||||
|
optionsPropName: 'treeData',
|
||||||
|
visibleEvent: 'onVisibleChange',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ApiSelect: withDefaultPlaceholder(
|
||||||
|
{
|
||||||
|
...ApiComponent,
|
||||||
|
name: 'ApiSelect',
|
||||||
|
},
|
||||||
|
'select',
|
||||||
|
{
|
||||||
|
component: Select,
|
||||||
|
loadingSlot: 'suffixIcon',
|
||||||
|
visibleEvent: 'onDropdownVisibleChange',
|
||||||
|
modelPropName: 'value',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
ApiTreeSelect: withDefaultPlaceholder(
|
||||||
|
{
|
||||||
|
...ApiComponent,
|
||||||
|
name: 'ApiTreeSelect',
|
||||||
|
},
|
||||||
|
'select',
|
||||||
|
{
|
||||||
|
component: TreeSelect,
|
||||||
|
fieldNames: { label: 'label', value: 'value', children: 'children' },
|
||||||
|
loadingSlot: 'suffixIcon',
|
||||||
|
modelPropName: 'value',
|
||||||
|
optionsPropName: 'treeData',
|
||||||
|
visibleEvent: 'onVisibleChange',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
AutoComplete,
|
||||||
|
Checkbox,
|
||||||
|
CheckboxGroup,
|
||||||
|
DatePicker,
|
||||||
|
// 自定义默认按钮
|
||||||
|
DefaultButton: (props, { attrs, slots }) => {
|
||||||
|
return h(Button, { ...props, attrs, type: 'default' }, slots);
|
||||||
|
},
|
||||||
|
Divider,
|
||||||
|
IconPicker: withDefaultPlaceholder(IconPicker, 'select', {
|
||||||
|
iconSlot: 'addonAfter',
|
||||||
|
inputComponent: Input,
|
||||||
|
modelValueProp: 'value',
|
||||||
|
}),
|
||||||
|
Input: withDefaultPlaceholder(Input, 'input'),
|
||||||
|
InputNumber: withDefaultPlaceholder(InputNumber, 'input'),
|
||||||
|
InputPassword: withDefaultPlaceholder(InputPassword, 'input'),
|
||||||
|
Mentions: withDefaultPlaceholder(Mentions, 'input'),
|
||||||
|
// 自定义主要按钮
|
||||||
|
PrimaryButton: (props, { attrs, slots }) => {
|
||||||
|
return h(Button, { ...props, attrs, type: 'primary' }, slots);
|
||||||
|
},
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
|
RangePicker,
|
||||||
|
Rate,
|
||||||
|
Select: withDefaultPlaceholder(Select, 'select'),
|
||||||
|
Space,
|
||||||
|
Switch,
|
||||||
|
Textarea: withDefaultPlaceholder(Textarea, 'input'),
|
||||||
|
RichTextarea,
|
||||||
|
TimePicker,
|
||||||
|
TimeRangePicker,
|
||||||
|
TreeSelect: withDefaultPlaceholder(TreeSelect, 'select'),
|
||||||
|
Upload,
|
||||||
|
FileUpload,
|
||||||
|
ImageUpload,
|
||||||
|
};
|
||||||
|
|
||||||
|
// 将组件注册到全局共享状态中
|
||||||
|
globalShareState.setComponents(components);
|
||||||
|
|
||||||
|
// 定义全局共享状态中的消息提示
|
||||||
|
globalShareState.defineMessage({
|
||||||
|
// 复制成功消息提示
|
||||||
|
copyPreferencesSuccess: (title, content) => {
|
||||||
|
notification.success({
|
||||||
|
description: content,
|
||||||
|
message: title,
|
||||||
|
placement: 'bottomRight',
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export { initComponentAdapter };
|
||||||
69
apps/web-antd/src/adapter/form.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import type {
|
||||||
|
VbenFormSchema as FormSchema,
|
||||||
|
VbenFormProps,
|
||||||
|
} from '@vben/common-ui';
|
||||||
|
|
||||||
|
import type { ComponentType } from './component';
|
||||||
|
|
||||||
|
import { setupVbenForm, useVbenForm as useForm, z } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
|
import { isMobile } from '@vben/utils';
|
||||||
|
|
||||||
|
async function initSetupVbenForm() {
|
||||||
|
setupVbenForm<ComponentType>({
|
||||||
|
config: {
|
||||||
|
// ant design vue组件库默认都是 v-model:value
|
||||||
|
baseModelPropName: 'value',
|
||||||
|
|
||||||
|
// 一些组件是 v-model:checked 或者 v-model:fileList
|
||||||
|
modelPropNameMap: {
|
||||||
|
Checkbox: 'checked',
|
||||||
|
Radio: 'checked',
|
||||||
|
Switch: 'checked',
|
||||||
|
Upload: 'fileList',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defineRules: {
|
||||||
|
// 输入项目必填国际化适配
|
||||||
|
required: (value, _params, ctx) => {
|
||||||
|
if (value === undefined || value === null || value.length === 0) {
|
||||||
|
return $t('ui.formRules.required', [ctx.label]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
// 选择项目必填国际化适配
|
||||||
|
selectRequired: (value, _params, ctx) => {
|
||||||
|
if (value === undefined || value === null) {
|
||||||
|
return $t('ui.formRules.selectRequired', [ctx.label]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
// 手机号非必填
|
||||||
|
mobile: (value, _params, ctx) => {
|
||||||
|
if (value === undefined || value === null || value.length === 0) {
|
||||||
|
return true;
|
||||||
|
} else if (!isMobile(value)) {
|
||||||
|
return $t('ui.formRules.mobile', [ctx.label]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
// 手机号必填
|
||||||
|
mobileRequired: (value, _params, ctx) => {
|
||||||
|
if (value === undefined || value === null || value.length === 0) {
|
||||||
|
return $t('ui.formRules.required', [ctx.label]);
|
||||||
|
}
|
||||||
|
if (!isMobile(value)) {
|
||||||
|
return $t('ui.formRules.mobile', [ctx.label]);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const useVbenForm = useForm<ComponentType>;
|
||||||
|
|
||||||
|
export { initSetupVbenForm, useVbenForm, z };
|
||||||
|
|
||||||
|
export type VbenFormSchema = FormSchema<ComponentType>;
|
||||||
|
export type { VbenFormProps };
|
||||||
371
apps/web-antd/src/adapter/vxe-table.ts
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
||||||
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
|
import { h } from 'vue';
|
||||||
|
|
||||||
|
import { IconifyIcon } from '@vben/icons';
|
||||||
|
import { $te } from '@vben/locales';
|
||||||
|
import {
|
||||||
|
AsyncVxeColumn,
|
||||||
|
AsyncVxeTable,
|
||||||
|
createRequiredValidation,
|
||||||
|
setupVbenVxeTable,
|
||||||
|
useVbenVxeGrid,
|
||||||
|
} from '@vben/plugins/vxe-table';
|
||||||
|
import {
|
||||||
|
erpCountInputFormatter,
|
||||||
|
erpNumberFormatter,
|
||||||
|
fenToYuan,
|
||||||
|
formatFileSize,
|
||||||
|
formatPast2,
|
||||||
|
isFunction,
|
||||||
|
isString,
|
||||||
|
} from '@vben/utils';
|
||||||
|
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Image,
|
||||||
|
ImagePreviewGroup,
|
||||||
|
Popconfirm,
|
||||||
|
Switch,
|
||||||
|
Tag,
|
||||||
|
} from 'ant-design-vue';
|
||||||
|
|
||||||
|
import { DictTag } from '#/components/dict-tag';
|
||||||
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
|
import { useVbenForm } from './form';
|
||||||
|
|
||||||
|
setupVbenVxeTable({
|
||||||
|
configVxeTable: (vxeUI) => {
|
||||||
|
vxeUI.setConfig({
|
||||||
|
grid: {
|
||||||
|
align: 'center',
|
||||||
|
border: false,
|
||||||
|
columnConfig: {
|
||||||
|
resizable: true,
|
||||||
|
},
|
||||||
|
minHeight: 180,
|
||||||
|
formConfig: {
|
||||||
|
// 全局禁用vxe-table的表单配置,使用formOptions
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
toolbarConfig: {
|
||||||
|
import: false, // 是否导入
|
||||||
|
export: false, // 是否导出
|
||||||
|
refresh: true, // 是否刷新
|
||||||
|
print: false, // 是否打印
|
||||||
|
zoom: true, // 是否缩放
|
||||||
|
custom: true, // 是否自定义配置
|
||||||
|
},
|
||||||
|
customConfig: {
|
||||||
|
mode: 'modal',
|
||||||
|
},
|
||||||
|
proxyConfig: {
|
||||||
|
autoLoad: true,
|
||||||
|
response: {
|
||||||
|
result: 'list',
|
||||||
|
total: 'total',
|
||||||
|
},
|
||||||
|
showActiveMsg: true,
|
||||||
|
showResponseMsg: false,
|
||||||
|
},
|
||||||
|
pagerConfig: {
|
||||||
|
enabled: true,
|
||||||
|
},
|
||||||
|
sortConfig: {
|
||||||
|
multiple: true,
|
||||||
|
},
|
||||||
|
round: true,
|
||||||
|
showOverflow: true,
|
||||||
|
size: 'small',
|
||||||
|
} as VxeTableGridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格配置项可以用 cellRender: { name: 'CellImage' },
|
||||||
|
vxeUI.renderer.add('CellImage', {
|
||||||
|
renderTableDefault(_renderOpts, params) {
|
||||||
|
const { column, row } = params;
|
||||||
|
return h(Image, { src: row[column.field] });
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
vxeUI.renderer.add('CellImages', {
|
||||||
|
renderTableDefault(_renderOpts, params) {
|
||||||
|
const { column, row } = params;
|
||||||
|
if (column && column.field && row[column.field]) {
|
||||||
|
return h(ImagePreviewGroup, {}, () => {
|
||||||
|
return row[column.field].map((item: any) =>
|
||||||
|
h(Image, { src: item }),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格配置项可以用 cellRender: { name: 'CellLink' },
|
||||||
|
vxeUI.renderer.add('CellLink', {
|
||||||
|
renderTableDefault(renderOpts) {
|
||||||
|
const { props } = renderOpts;
|
||||||
|
return h(
|
||||||
|
Button,
|
||||||
|
{ size: 'small', type: 'link' },
|
||||||
|
{ default: () => props?.text },
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格配置项可以用 cellRender: { name: 'CellTag' },
|
||||||
|
vxeUI.renderer.add('CellTag', {
|
||||||
|
renderTableDefault(renderOpts, params) {
|
||||||
|
const { props } = renderOpts;
|
||||||
|
const { column, row } = params;
|
||||||
|
return h(Tag, { color: props?.color }, () => row[column.field]);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
vxeUI.renderer.add('CellTags', {
|
||||||
|
renderTableDefault(renderOpts, params) {
|
||||||
|
const { props } = renderOpts;
|
||||||
|
const { column, row } = params;
|
||||||
|
if (!row[column.field] || row[column.field].length === 0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
return h(
|
||||||
|
'div',
|
||||||
|
{ class: 'flex items-center justify-center' },
|
||||||
|
{
|
||||||
|
default: () =>
|
||||||
|
row[column.field].map((item: any) =>
|
||||||
|
h(Tag, { color: props?.color }, { default: () => item }),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格配置项可以用 cellRender: { name: 'CellDict', props:{dictType: ''} },
|
||||||
|
vxeUI.renderer.add('CellDict', {
|
||||||
|
renderTableDefault(renderOpts, params) {
|
||||||
|
const { props } = renderOpts;
|
||||||
|
const { column, row } = params;
|
||||||
|
if (!props) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// 使用 DictTag 组件替代原来的实现
|
||||||
|
return h(DictTag, {
|
||||||
|
type: props.type,
|
||||||
|
value: row[column.field]?.toString(),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表格配置项可以用 cellRender: { name: 'CellSwitch', props: { beforeChange: () => {} } },
|
||||||
|
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L97-L123
|
||||||
|
vxeUI.renderer.add('CellSwitch', {
|
||||||
|
renderTableDefault({ attrs, props }, { column, row }) {
|
||||||
|
const loadingKey = `__loading_${column.field}`;
|
||||||
|
const finallyProps = {
|
||||||
|
checkedChildren: $t('common.enabled'),
|
||||||
|
checkedValue: 1,
|
||||||
|
unCheckedChildren: $t('common.disabled'),
|
||||||
|
unCheckedValue: 0,
|
||||||
|
...props,
|
||||||
|
checked: row[column.field],
|
||||||
|
loading: row[loadingKey] ?? false,
|
||||||
|
'onUpdate:checked': onChange,
|
||||||
|
};
|
||||||
|
|
||||||
|
async function onChange(newVal: any) {
|
||||||
|
row[loadingKey] = true;
|
||||||
|
try {
|
||||||
|
const result = await attrs?.beforeChange?.(newVal, row);
|
||||||
|
if (result !== false) {
|
||||||
|
row[column.field] = newVal;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
row[loadingKey] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return h(Switch, finallyProps);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 注册表格的操作按钮渲染器 cellRender: { name: 'CellOperation', options: ['edit', 'delete'] }
|
||||||
|
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L125-L255
|
||||||
|
vxeUI.renderer.add('CellOperation', {
|
||||||
|
renderTableDefault({ attrs, options, props }, { column, row }) {
|
||||||
|
const defaultProps = { size: 'small', type: 'link', ...props };
|
||||||
|
let align = 'end';
|
||||||
|
switch (column.align) {
|
||||||
|
case 'center': {
|
||||||
|
align = 'center';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'left': {
|
||||||
|
align = 'start';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
align = 'end';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const presets: Recordable<Recordable<any>> = {
|
||||||
|
delete: {
|
||||||
|
danger: true,
|
||||||
|
text: $t('common.delete'),
|
||||||
|
},
|
||||||
|
edit: {
|
||||||
|
text: $t('common.edit'),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const operations: Array<Recordable<any>> = (
|
||||||
|
options || ['edit', 'delete']
|
||||||
|
)
|
||||||
|
.map((opt) => {
|
||||||
|
if (isString(opt)) {
|
||||||
|
return presets[opt]
|
||||||
|
? { code: opt, ...presets[opt], ...defaultProps }
|
||||||
|
: {
|
||||||
|
code: opt,
|
||||||
|
text: $te(`common.${opt}`) ? $t(`common.${opt}`) : opt,
|
||||||
|
...defaultProps,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return { ...defaultProps, ...presets[opt.code], ...opt };
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.map((opt) => {
|
||||||
|
const optBtn: Recordable<any> = {};
|
||||||
|
Object.keys(opt).forEach((key) => {
|
||||||
|
optBtn[key] = isFunction(opt[key]) ? opt[key](row) : opt[key];
|
||||||
|
});
|
||||||
|
return optBtn;
|
||||||
|
})
|
||||||
|
.filter((opt) => opt.show !== false);
|
||||||
|
|
||||||
|
function renderBtn(opt: Recordable<any>, listen = true) {
|
||||||
|
return h(
|
||||||
|
Button,
|
||||||
|
{
|
||||||
|
...props,
|
||||||
|
...opt,
|
||||||
|
icon: undefined,
|
||||||
|
onClick: listen
|
||||||
|
? () =>
|
||||||
|
attrs?.onClick?.({
|
||||||
|
code: opt.code,
|
||||||
|
row,
|
||||||
|
})
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
default: () => {
|
||||||
|
const content = [];
|
||||||
|
if (opt.icon) {
|
||||||
|
content.push(
|
||||||
|
h(IconifyIcon, { class: 'size-5', icon: opt.icon }),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
content.push(opt.text);
|
||||||
|
return content;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderConfirm(opt: Recordable<any>) {
|
||||||
|
return h(
|
||||||
|
Popconfirm,
|
||||||
|
{
|
||||||
|
getPopupContainer(el) {
|
||||||
|
return el.closest('tbody') || document.body;
|
||||||
|
},
|
||||||
|
placement: 'topLeft',
|
||||||
|
title: $t('ui.actionTitle.delete', [attrs?.nameTitle || '']),
|
||||||
|
...props,
|
||||||
|
...opt,
|
||||||
|
icon: undefined,
|
||||||
|
onConfirm: () => {
|
||||||
|
attrs?.onClick?.({
|
||||||
|
code: opt.code,
|
||||||
|
row,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
default: () => renderBtn({ ...opt }, false),
|
||||||
|
description: () =>
|
||||||
|
h(
|
||||||
|
'div',
|
||||||
|
{ class: 'truncate' },
|
||||||
|
$t('ui.actionMessage.deleteConfirm', [
|
||||||
|
row[attrs?.nameField || 'name'],
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const btns = operations.map((opt) =>
|
||||||
|
opt.code === 'delete' ? renderConfirm(opt) : renderBtn(opt),
|
||||||
|
);
|
||||||
|
return h(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
class: 'flex table-operations',
|
||||||
|
style: { justifyContent: align },
|
||||||
|
},
|
||||||
|
btns,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||||
|
// vxeUI.formats.add
|
||||||
|
|
||||||
|
vxeUI.formats.add('formatPast2', {
|
||||||
|
tableCellFormatMethod({ cellValue }) {
|
||||||
|
return formatPast2(cellValue);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// add by 星语:数量格式化,保留 3 位
|
||||||
|
vxeUI.formats.add('formatAmount3', {
|
||||||
|
tableCellFormatMethod({ cellValue }) {
|
||||||
|
return erpCountInputFormatter(cellValue);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// add by 星语:数量格式化,保留 2 位
|
||||||
|
vxeUI.formats.add('formatAmount2', {
|
||||||
|
tableCellFormatMethod({ cellValue }, digits = 2) {
|
||||||
|
return `${erpNumberFormatter(cellValue, digits)}`;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
vxeUI.formats.add('formatFenToYuanAmount', {
|
||||||
|
tableCellFormatMethod({ cellValue }, digits = 2) {
|
||||||
|
return `${erpNumberFormatter(fenToYuan(cellValue), digits)}`;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// add by 星语:文件大小格式化
|
||||||
|
vxeUI.formats.add('formatFileSize', {
|
||||||
|
tableCellFormatMethod({ cellValue }, digits = 2) {
|
||||||
|
return formatFileSize(cellValue, digits);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
useVbenForm,
|
||||||
|
});
|
||||||
|
|
||||||
|
export { createRequiredValidation, useVbenVxeGrid };
|
||||||
|
|
||||||
|
export const [VxeTable, VxeColumn] = [AsyncVxeTable, AsyncVxeColumn];
|
||||||
|
|
||||||
|
export * from '#/components/table-action';
|
||||||
|
|
||||||
|
export type * from '@vben/plugins/vxe-table';
|
||||||
74
apps/web-antd/src/api/ai/chat/conversation/index.ts
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
import type { PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiChatConversationApi {
|
||||||
|
export interface ChatConversation {
|
||||||
|
id: number; // ID 编号
|
||||||
|
userId: number; // 用户编号
|
||||||
|
title: string; // 对话标题
|
||||||
|
pinned: boolean; // 是否置顶
|
||||||
|
roleId: number; // 角色编号
|
||||||
|
modelId: number; // 模型编号
|
||||||
|
model: string; // 模型标志
|
||||||
|
temperature: number; // 温度参数
|
||||||
|
maxTokens: number; // 单条回复的最大 Token 数量
|
||||||
|
maxContexts: number; // 上下文的最大 Message 数量
|
||||||
|
createTime?: Date; // 创建时间
|
||||||
|
systemMessage?: string; // 角色设定
|
||||||
|
modelName?: string; // 模型名字
|
||||||
|
roleAvatar?: string; // 角色头像
|
||||||
|
modelMaxTokens?: string; // 模型的单条回复的最大 Token 数量
|
||||||
|
modelMaxContexts?: string; // 模型的上下文的最大 Message 数量
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得【我的】聊天对话 */
|
||||||
|
export function getChatConversationMy(id: number) {
|
||||||
|
return requestClient.get<AiChatConversationApi.ChatConversation>(
|
||||||
|
`/ai/chat/conversation/get-my?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增【我的】聊天对话 */
|
||||||
|
export function createChatConversationMy(
|
||||||
|
data: AiChatConversationApi.ChatConversation,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/ai/chat/conversation/create-my', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新【我的】聊天对话 */
|
||||||
|
export function updateChatConversationMy(
|
||||||
|
data: AiChatConversationApi.ChatConversation,
|
||||||
|
) {
|
||||||
|
return requestClient.put(`/ai/chat/conversation/update-my`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除【我的】聊天对话 */
|
||||||
|
export function deleteChatConversationMy(id: number) {
|
||||||
|
return requestClient.delete(`/ai/chat/conversation/delete-my?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除【我的】所有对话,置顶除外 */
|
||||||
|
export function deleteChatConversationMyByUnpinned() {
|
||||||
|
return requestClient.delete(`/ai/chat/conversation/delete-by-unpinned`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得【我的】聊天对话列表 */
|
||||||
|
export function getChatConversationMyList() {
|
||||||
|
return requestClient.get<AiChatConversationApi.ChatConversation[]>(
|
||||||
|
`/ai/chat/conversation/my-list`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得【我的】聊天对话列表 */
|
||||||
|
export function getChatConversationPage(params: any) {
|
||||||
|
return requestClient.get<
|
||||||
|
PageResult<AiChatConversationApi.ChatConversation[]>
|
||||||
|
>(`/ai/chat/conversation/page`, { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 管理员删除消息 */
|
||||||
|
export function deleteChatConversationByAdmin(id: number) {
|
||||||
|
return requestClient.delete(`/ai/chat/conversation/delete-by-admin?id=${id}`);
|
||||||
|
}
|
||||||
115
apps/web-antd/src/api/ai/chat/message/index.ts
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import type { PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { useAppConfig } from '@vben/hooks';
|
||||||
|
import { fetchEventSource } from '@vben/request';
|
||||||
|
import { useAccessStore } from '@vben/stores';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||||
|
const accessStore = useAccessStore();
|
||||||
|
|
||||||
|
export namespace AiChatMessageApi {
|
||||||
|
export interface ChatMessage {
|
||||||
|
id: number; // 编号
|
||||||
|
conversationId: number; // 对话编号
|
||||||
|
type: string; // 消息类型
|
||||||
|
userId: string; // 用户编号
|
||||||
|
roleId: string; // 角色编号
|
||||||
|
model: number; // 模型标志
|
||||||
|
modelId: number; // 模型编号
|
||||||
|
content: string; // 聊天内容
|
||||||
|
reasoningContent?: string; // 推理内容(深度思考)
|
||||||
|
tokens: number; // 消耗 Token 数量
|
||||||
|
segmentIds?: number[]; // 段落编号
|
||||||
|
segments?: {
|
||||||
|
content: string; // 段落内容
|
||||||
|
documentId: number; // 文档编号
|
||||||
|
documentName: string; // 文档名称
|
||||||
|
id: number; // 段落编号
|
||||||
|
}[];
|
||||||
|
webSearchPages?: WebSearchPage[]; // 联网搜索结果
|
||||||
|
attachmentUrls?: string[]; // 附件 URL 数组
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
roleAvatar: string; // 角色头像
|
||||||
|
userAvatar: string; // 用户头像
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 联网搜索页面接口 */
|
||||||
|
export interface WebSearchPage {
|
||||||
|
name: string; // 网站名称
|
||||||
|
icon: string; // 网站图标 URL
|
||||||
|
title: string; // 页面标题
|
||||||
|
url: string; // 页面 URL
|
||||||
|
snippet: string; // 简短描述
|
||||||
|
summary: string; // 内容摘要
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 消息列表 */
|
||||||
|
export function getChatMessageListByConversationId(
|
||||||
|
conversationId: null | number,
|
||||||
|
) {
|
||||||
|
return requestClient.get<AiChatMessageApi.ChatMessage[]>(
|
||||||
|
`/ai/chat/message/list-by-conversation-id?conversationId=${conversationId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 发送 Stream 消息 */
|
||||||
|
export function sendChatMessageStream(
|
||||||
|
conversationId: number,
|
||||||
|
content: string,
|
||||||
|
ctrl: any,
|
||||||
|
enableContext: boolean,
|
||||||
|
enableWebSearch: boolean,
|
||||||
|
onMessage: any,
|
||||||
|
onError: any,
|
||||||
|
onClose: any,
|
||||||
|
attachmentUrls?: string[],
|
||||||
|
) {
|
||||||
|
const token = accessStore.accessToken;
|
||||||
|
return fetchEventSource(`${apiURL}/ai/chat/message/send-stream`, {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
openWhenHidden: true,
|
||||||
|
body: JSON.stringify({
|
||||||
|
conversationId,
|
||||||
|
content,
|
||||||
|
useContext: enableContext,
|
||||||
|
useSearch: enableWebSearch,
|
||||||
|
attachmentUrls: attachmentUrls || [],
|
||||||
|
}),
|
||||||
|
onmessage: onMessage,
|
||||||
|
onerror: onError,
|
||||||
|
onclose: onClose,
|
||||||
|
signal: ctrl.signal,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除消息 */
|
||||||
|
export function deleteChatMessage(id: number) {
|
||||||
|
return requestClient.delete(`/ai/chat/message/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除指定对话的消息 */
|
||||||
|
export function deleteByConversationId(conversationId: number) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/ai/chat/message/delete-by-conversation-id?conversationId=${conversationId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得消息分页 */
|
||||||
|
export function getChatMessagePage(params: any) {
|
||||||
|
return requestClient.get<PageResult<AiChatMessageApi.ChatMessage>>(
|
||||||
|
'/ai/chat/message/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 管理员删除消息 */
|
||||||
|
export function deleteChatMessageByAdmin(id: number) {
|
||||||
|
return requestClient.delete(`/ai/chat/message/delete-by-admin?id=${id}`);
|
||||||
|
}
|
||||||
115
apps/web-antd/src/api/ai/image/index.ts
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiImageApi {
|
||||||
|
/** 绘图 */
|
||||||
|
export interface Image {
|
||||||
|
id: number; // 编号
|
||||||
|
userId: number;
|
||||||
|
platform: string; // 平台
|
||||||
|
model: string; // 模型
|
||||||
|
prompt: string; // 提示词
|
||||||
|
width: number; // 图片宽度
|
||||||
|
height: number; // 图片高度
|
||||||
|
status: number; // 状态
|
||||||
|
publicStatus: boolean; // 公开状态
|
||||||
|
picUrl: string; // 任务地址
|
||||||
|
errorMessage: string; // 错误信息
|
||||||
|
options: any; // 配置 Map<string, string>
|
||||||
|
taskId: number; // 任务编号
|
||||||
|
buttons: ImageMidjourneyButtons[]; // mj 操作按钮
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
finishTime: Date; // 完成时间
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImageMidjourneyButtons {
|
||||||
|
customId: string; // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识
|
||||||
|
emoji: string; // 图标 emoji
|
||||||
|
label: string; // Make Variations 文本
|
||||||
|
style: number; // 样式: 2(Primary)、3(Green)
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImageDrawReqVO {
|
||||||
|
prompt: string; // 提示词
|
||||||
|
modelId: number; // 模型
|
||||||
|
style: string; // 图像生成的风格
|
||||||
|
width: string; // 图片宽度
|
||||||
|
height: string; // 图片高度
|
||||||
|
options: object; // 绘制参数,Map<String, String>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImageMidjourneyImagineReqVO {
|
||||||
|
prompt: string; // 提示词
|
||||||
|
modelId: number; // 模型
|
||||||
|
base64Array?: string[]; // size不能为空
|
||||||
|
width: string; // 图片宽度
|
||||||
|
height: string; // 图片高度
|
||||||
|
version: string; // 版本
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImageMidjourneyAction {
|
||||||
|
id: number; // 图片编号
|
||||||
|
customId: string; // MJ::JOB::upsample::1::85a4b4c1-8835-46c5-a15c-aea34fad1862 动作标识
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取【我的】绘图分页 */
|
||||||
|
export function getImagePageMy(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiImageApi.Image>>('/ai/image/my-page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取【我的】绘图记录 */
|
||||||
|
export function getImageMy(id: number) {
|
||||||
|
return requestClient.get<AiImageApi.Image>(`/ai/image/get-my?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取【我的】绘图记录列表 */
|
||||||
|
export function getImageListMyByIds(ids: number[]) {
|
||||||
|
return requestClient.get<AiImageApi.Image[]>(`/ai/image/my-list-by-ids`, {
|
||||||
|
params: { ids: ids.join(',') },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 生成图片 */
|
||||||
|
export function drawImage(data: AiImageApi.ImageDrawReqVO) {
|
||||||
|
return requestClient.post(`/ai/image/draw`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除【我的】绘画记录 */
|
||||||
|
export function deleteImageMy(id: number) {
|
||||||
|
return requestClient.delete(`/ai/image/delete-my?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ================ midjourney 专属 ================ */
|
||||||
|
|
||||||
|
/** 【Midjourney】生成图片 */
|
||||||
|
export function midjourneyImagine(
|
||||||
|
data: AiImageApi.ImageMidjourneyImagineReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.post(`/ai/image/midjourney/imagine`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 【Midjourney】Action 操作(二次生成图片) */
|
||||||
|
export function midjourneyAction(data: AiImageApi.ImageMidjourneyAction) {
|
||||||
|
return requestClient.post(`/ai/image/midjourney/action`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ================ 绘图管理 ================ */
|
||||||
|
|
||||||
|
/** 查询绘画分页 */
|
||||||
|
export function getImagePage(params: any) {
|
||||||
|
return requestClient.get<AiImageApi.Image[]>(`/ai/image/page`, { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新绘画发布状态 */
|
||||||
|
export function updateImage(data: any) {
|
||||||
|
return requestClient.put(`/ai/image/update`, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除绘画 */
|
||||||
|
export function deleteImage(id: number) {
|
||||||
|
return requestClient.delete(`/ai/image/delete?id=${id}`);
|
||||||
|
}
|
||||||
53
apps/web-antd/src/api/ai/knowledge/document/index.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiKnowledgeDocumentApi {
|
||||||
|
export interface KnowledgeDocument {
|
||||||
|
id: number; // 编号
|
||||||
|
knowledgeId: number; // 知识库编号
|
||||||
|
name: string; // 文档名称
|
||||||
|
contentLength: number; // 字符数
|
||||||
|
tokens: number; // token 数
|
||||||
|
segmentMaxTokens: number; // 分片最大 token 数
|
||||||
|
retrievalCount: number; // 召回次数
|
||||||
|
status: number; // 是否启用
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询知识库文档分页 */
|
||||||
|
export function getKnowledgeDocumentPage(params: PageParam) {
|
||||||
|
return requestClient.get<
|
||||||
|
PageResult<AiKnowledgeDocumentApi.KnowledgeDocument>
|
||||||
|
>('/ai/knowledge/document/page', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询知识库文档详情 */
|
||||||
|
export function getKnowledgeDocument(id: number) {
|
||||||
|
return requestClient.get(`/ai/knowledge/document/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增知识库文档(单个) */
|
||||||
|
export function createKnowledge(data: any) {
|
||||||
|
return requestClient.post('/ai/knowledge/document/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增知识库文档(多个) */
|
||||||
|
export function createKnowledgeDocumentList(data: any) {
|
||||||
|
return requestClient.post('/ai/knowledge/document/create-list', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改知识库文档 */
|
||||||
|
export function updateKnowledgeDocument(data: any) {
|
||||||
|
return requestClient.put('/ai/knowledge/document/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改知识库文档状态 */
|
||||||
|
export function updateKnowledgeDocumentStatus(data: any) {
|
||||||
|
return requestClient.put('/ai/knowledge/document/update-status', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除知识库文档 */
|
||||||
|
export function deleteKnowledgeDocument(id: number) {
|
||||||
|
return requestClient.delete(`/ai/knowledge/document/delete?id=${id}`);
|
||||||
|
}
|
||||||
51
apps/web-antd/src/api/ai/knowledge/knowledge/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiKnowledgeKnowledgeApi {
|
||||||
|
export interface Knowledge {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 知识库名称
|
||||||
|
description: string; // 知识库描述
|
||||||
|
embeddingModelId: number; // 嵌入模型编号,高质量模式时维护
|
||||||
|
topK: number; // topK
|
||||||
|
similarityThreshold: number; // 相似度阈值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询知识库分页 */
|
||||||
|
export function getKnowledgePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiKnowledgeKnowledgeApi.Knowledge>>(
|
||||||
|
'/ai/knowledge/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询知识库详情 */
|
||||||
|
export function getKnowledge(id: number) {
|
||||||
|
return requestClient.get<AiKnowledgeKnowledgeApi.Knowledge>(
|
||||||
|
`/ai/knowledge/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增知识库 */
|
||||||
|
export function createKnowledge(data: AiKnowledgeKnowledgeApi.Knowledge) {
|
||||||
|
return requestClient.post('/ai/knowledge/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改知识库 */
|
||||||
|
export function updateKnowledge(data: AiKnowledgeKnowledgeApi.Knowledge) {
|
||||||
|
return requestClient.put('/ai/knowledge/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除知识库 */
|
||||||
|
export function deleteKnowledge(id: number) {
|
||||||
|
return requestClient.delete(`/ai/knowledge/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取知识库简单列表 */
|
||||||
|
export function getSimpleKnowledgeList() {
|
||||||
|
return requestClient.get<AiKnowledgeKnowledgeApi.Knowledge[]>(
|
||||||
|
'/ai/knowledge/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
81
apps/web-antd/src/api/ai/knowledge/segment/index.ts
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiKnowledgeSegmentApi {
|
||||||
|
export interface KnowledgeSegment {
|
||||||
|
id: number; // 编号
|
||||||
|
documentId: number; // 文档编号
|
||||||
|
knowledgeId: number; // 知识库编号
|
||||||
|
vectorId: string; // 向量库编号
|
||||||
|
content: string; // 切片内容
|
||||||
|
contentLength: number; // 切片内容长度
|
||||||
|
tokens: number; // token 数量
|
||||||
|
retrievalCount: number; // 召回次数
|
||||||
|
status: number; // 文档状态
|
||||||
|
createTime: number; // 创建时间
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询知识库分段分页 */
|
||||||
|
export function getKnowledgeSegmentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiKnowledgeSegmentApi.KnowledgeSegment>>(
|
||||||
|
'/ai/knowledge/segment/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询知识库分段详情 */
|
||||||
|
export function getKnowledgeSegment(id: number) {
|
||||||
|
return requestClient.get<AiKnowledgeSegmentApi.KnowledgeSegment>(
|
||||||
|
`/ai/knowledge/segment/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增知识库分段 */
|
||||||
|
export function createKnowledgeSegment(
|
||||||
|
data: AiKnowledgeSegmentApi.KnowledgeSegment,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/ai/knowledge/segment/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改知识库分段 */
|
||||||
|
export function updateKnowledgeSegment(
|
||||||
|
data: AiKnowledgeSegmentApi.KnowledgeSegment,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/ai/knowledge/segment/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改知识库分段状态 */
|
||||||
|
export function updateKnowledgeSegmentStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/ai/knowledge/segment/update-status', {
|
||||||
|
id,
|
||||||
|
status,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除知识库分段 */
|
||||||
|
export function deleteKnowledgeSegment(id: number) {
|
||||||
|
return requestClient.delete(`/ai/knowledge/segment/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 切片内容 */
|
||||||
|
export function splitContent(url: string, segmentMaxTokens: number) {
|
||||||
|
return requestClient.get('/ai/knowledge/segment/split', {
|
||||||
|
params: { url, segmentMaxTokens },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取文档处理列表 */
|
||||||
|
export function getKnowledgeSegmentProcessList(documentIds: number[]) {
|
||||||
|
return requestClient.get('/ai/knowledge/segment/get-process-list', {
|
||||||
|
params: { documentIds: documentIds.join(',') },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索知识库分段 */
|
||||||
|
export function searchKnowledgeSegment(params: any) {
|
||||||
|
return requestClient.get('/ai/knowledge/segment/search', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
64
apps/web-antd/src/api/ai/mindmap/index.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import { useAppConfig } from '@vben/hooks';
|
||||||
|
import { fetchEventSource } from '@vben/request';
|
||||||
|
import { useAccessStore } from '@vben/stores';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||||
|
const accessStore = useAccessStore();
|
||||||
|
|
||||||
|
export namespace AiMindmapApi {
|
||||||
|
export interface MindMap {
|
||||||
|
id: number; // 编号
|
||||||
|
userId: number; // 用户编号
|
||||||
|
prompt: string; // 生成内容提示
|
||||||
|
generatedContent: string; // 生成的思维导图内容
|
||||||
|
platform: string; // 平台
|
||||||
|
model: string; // 模型
|
||||||
|
errorMessage: string; // 错误信息
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AiMindMapGenerateReqVO {
|
||||||
|
prompt: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 生成思维导图 Stream */
|
||||||
|
export function generateMindMap({
|
||||||
|
data,
|
||||||
|
onClose,
|
||||||
|
onMessage,
|
||||||
|
onError,
|
||||||
|
ctrl,
|
||||||
|
}: {
|
||||||
|
ctrl: AbortController;
|
||||||
|
data: AiMindmapApi.AiMindMapGenerateReqVO;
|
||||||
|
onClose?: (...args: any[]) => void;
|
||||||
|
onError?: (...args: any[]) => void;
|
||||||
|
onMessage?: (res: any) => void;
|
||||||
|
}) {
|
||||||
|
const token = accessStore.accessToken;
|
||||||
|
return fetchEventSource(`${apiURL}/ai/mind-map/generate-stream`, {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
openWhenHidden: true,
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
onmessage: onMessage,
|
||||||
|
onerror: onError,
|
||||||
|
onclose: onClose,
|
||||||
|
signal: ctrl.signal,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询思维导图分页 */
|
||||||
|
export function getMindMapPage(params: any) {
|
||||||
|
return requestClient.get(`/ai/mind-map/page`, { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除思维导图 */
|
||||||
|
export function deleteMindMap(id: number) {
|
||||||
|
return requestClient.delete(`/ai/mind-map/delete?id=${id}`);
|
||||||
|
}
|
||||||
49
apps/web-antd/src/api/ai/model/apiKey/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiModelApiKeyApi {
|
||||||
|
export interface ApiKey {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 名称
|
||||||
|
apiKey: string; // 密钥
|
||||||
|
platform: string; // 平台
|
||||||
|
url: string; // 自定义 API 地址
|
||||||
|
status: number; // 状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询 API 密钥分页 */
|
||||||
|
export function getApiKeyPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiModelApiKeyApi.ApiKey>>(
|
||||||
|
'/ai/api-key/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得 API 密钥列表 */
|
||||||
|
export function getApiKeySimpleList() {
|
||||||
|
return requestClient.get<AiModelApiKeyApi.ApiKey[]>(
|
||||||
|
'/ai/api-key/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询 API 密钥详情 */
|
||||||
|
export function getApiKey(id: number) {
|
||||||
|
return requestClient.get<AiModelApiKeyApi.ApiKey>(`/ai/api-key/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增 API 密钥 */
|
||||||
|
export function createApiKey(data: AiModelApiKeyApi.ApiKey) {
|
||||||
|
return requestClient.post('/ai/api-key/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改 API 密钥 */
|
||||||
|
export function updateApiKey(data: AiModelApiKeyApi.ApiKey) {
|
||||||
|
return requestClient.put('/ai/api-key/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除 API 密钥 */
|
||||||
|
export function deleteApiKey(id: number) {
|
||||||
|
return requestClient.delete(`/ai/api-key/delete?id=${id}`);
|
||||||
|
}
|
||||||
85
apps/web-antd/src/api/ai/model/chatRole/index.ts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiModelChatRoleApi {
|
||||||
|
export interface ChatRole {
|
||||||
|
id: number; // 角色编号
|
||||||
|
modelId: number; // 模型编号
|
||||||
|
name: string; // 角色名称
|
||||||
|
avatar: string; // 角色头像
|
||||||
|
category: string; // 角色类别
|
||||||
|
sort: number; // 角色排序
|
||||||
|
description: string; // 角色描述
|
||||||
|
systemMessage: string; // 角色设定
|
||||||
|
welcomeMessage: string; // 角色设定
|
||||||
|
publicStatus: boolean; // 是否公开
|
||||||
|
status: number; // 状态
|
||||||
|
knowledgeIds?: number[]; // 引用的知识库 ID 列表
|
||||||
|
toolIds?: number[]; // 引用的工具 ID 列表
|
||||||
|
}
|
||||||
|
|
||||||
|
// AI 聊天角色 分页请求
|
||||||
|
export interface ChatRolePageReqVO {
|
||||||
|
name?: string; // 角色名称
|
||||||
|
category?: string; // 角色类别
|
||||||
|
publicStatus: boolean; // 是否公开
|
||||||
|
pageNo: number; // 是否公开
|
||||||
|
pageSize: number; // 是否公开
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询聊天角色分页 */
|
||||||
|
export function getChatRolePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiModelChatRoleApi.ChatRole>>(
|
||||||
|
'/ai/chat-role/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询聊天角色详情 */
|
||||||
|
export function getChatRole(id: number) {
|
||||||
|
return requestClient.get<AiModelChatRoleApi.ChatRole>(
|
||||||
|
`/ai/chat-role/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增聊天角色 */
|
||||||
|
export function createChatRole(data: AiModelChatRoleApi.ChatRole) {
|
||||||
|
return requestClient.post('/ai/chat-role/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改聊天角色 */
|
||||||
|
export function updateChatRole(data: AiModelChatRoleApi.ChatRole) {
|
||||||
|
return requestClient.put('/ai/chat-role/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除聊天角色 */
|
||||||
|
export function deleteChatRole(id: number) {
|
||||||
|
return requestClient.delete(`/ai/chat-role/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取 my role */
|
||||||
|
export function getMyPage(params: AiModelChatRoleApi.ChatRolePageReqVO) {
|
||||||
|
return requestClient.get('/ai/chat-role/my-page', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取角色分类 */
|
||||||
|
export function getCategoryList() {
|
||||||
|
return requestClient.get('/ai/chat-role/category-list');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建角色 */
|
||||||
|
export function createMy(data: AiModelChatRoleApi.ChatRole) {
|
||||||
|
return requestClient.post('/ai/chat-role/create-my', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新角色 */
|
||||||
|
export function updateMy(data: AiModelChatRoleApi.ChatRole) {
|
||||||
|
return requestClient.put('/ai/chat-role/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除角色 my */
|
||||||
|
export function deleteMy(id: number) {
|
||||||
|
return requestClient.delete(`/ai/chat-role/delete-my?id=${id}`);
|
||||||
|
}
|
||||||
56
apps/web-antd/src/api/ai/model/model/index.ts
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiModelModelApi {
|
||||||
|
export interface Model {
|
||||||
|
id: number; // 编号
|
||||||
|
keyId: number; // API 秘钥编号
|
||||||
|
name: string; // 模型名字
|
||||||
|
model: string; // 模型标识
|
||||||
|
platform: string; // 模型平台
|
||||||
|
type: number; // 模型类型
|
||||||
|
sort: number; // 排序
|
||||||
|
status: number; // 状态
|
||||||
|
temperature?: number; // 温度参数
|
||||||
|
maxTokens?: number; // 单条回复的最大 Token 数量
|
||||||
|
maxContexts?: number; // 上下文的最大 Message 数量
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询模型分页 */
|
||||||
|
export function getModelPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiModelModelApi.Model>>(
|
||||||
|
'/ai/model/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得模型列表 */
|
||||||
|
export function getModelSimpleList(type?: number) {
|
||||||
|
return requestClient.get<AiModelModelApi.Model[]>('/ai/model/simple-list', {
|
||||||
|
params: {
|
||||||
|
type,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询模型详情 */
|
||||||
|
export function getModel(id: number) {
|
||||||
|
return requestClient.get<AiModelModelApi.Model>(`/ai/model/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增模型 */
|
||||||
|
export function createModel(data: AiModelModelApi.Model) {
|
||||||
|
return requestClient.post('/ai/model/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改模型 */
|
||||||
|
export function updateModel(data: AiModelModelApi.Model) {
|
||||||
|
return requestClient.put('/ai/model/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除模型 */
|
||||||
|
export function deleteModel(id: number) {
|
||||||
|
return requestClient.delete(`/ai/model/delete?id=${id}`);
|
||||||
|
}
|
||||||
44
apps/web-antd/src/api/ai/model/tool/index.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiModelToolApi {
|
||||||
|
export interface Tool {
|
||||||
|
id: number; // 工具编号
|
||||||
|
name: string; // 工具名称
|
||||||
|
description: string; // 工具描述
|
||||||
|
status: number; // 状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询工具分页 */
|
||||||
|
export function getToolPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiModelToolApi.Tool>>('/ai/tool/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询工具详情 */
|
||||||
|
export function getTool(id: number) {
|
||||||
|
return requestClient.get<AiModelToolApi.Tool>(`/ai/tool/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增工具 */
|
||||||
|
export function createTool(data: AiModelToolApi.Tool) {
|
||||||
|
return requestClient.post('/ai/tool/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改工具 */
|
||||||
|
export function updateTool(data: AiModelToolApi.Tool) {
|
||||||
|
return requestClient.put('/ai/tool/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除工具 */
|
||||||
|
export function deleteTool(id: number) {
|
||||||
|
return requestClient.delete(`/ai/tool/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取工具简单列表 */
|
||||||
|
export function getToolSimpleList() {
|
||||||
|
return requestClient.get<AiModelToolApi.Tool[]>('/ai/tool/simple-list');
|
||||||
|
}
|
||||||
44
apps/web-antd/src/api/ai/music/index.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiMusicApi {
|
||||||
|
// AI 音乐
|
||||||
|
export interface Music {
|
||||||
|
id: number; // 编号
|
||||||
|
userId: number; // 用户编号
|
||||||
|
title: string; // 音乐名称
|
||||||
|
lyric: string; // 歌词
|
||||||
|
imageUrl: string; // 图片地址
|
||||||
|
audioUrl: string; // 音频地址
|
||||||
|
videoUrl: string; // 视频地址
|
||||||
|
status: number; // 音乐状态
|
||||||
|
gptDescriptionPrompt: string; // 描述词
|
||||||
|
prompt: string; // 提示词
|
||||||
|
platform: string; // 模型平台
|
||||||
|
model: string; // 模型
|
||||||
|
generateMode: number; // 生成模式
|
||||||
|
tags: string; // 音乐风格标签
|
||||||
|
duration: number; // 音乐时长
|
||||||
|
publicStatus: boolean; // 是否发布
|
||||||
|
taskId: string; // 任务id
|
||||||
|
errorMessage: string; // 错误信息
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询音乐分页 */
|
||||||
|
export function getMusicPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiMusicApi.Music>>(`/ai/music/page`, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新音乐 */
|
||||||
|
export function updateMusic(data: any) {
|
||||||
|
return requestClient.put('/ai/music/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除音乐 */
|
||||||
|
export function deleteMusic(id: number) {
|
||||||
|
return requestClient.delete(`/ai/music/delete?id=${id}`);
|
||||||
|
}
|
||||||
49
apps/web-antd/src/api/ai/workflow/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AiWorkflowApi {
|
||||||
|
/** 工作流 */
|
||||||
|
export interface Workflow {
|
||||||
|
id?: number; // 编号
|
||||||
|
name: string; // 工作流名称
|
||||||
|
code: string; // 工作流标识
|
||||||
|
graph: string; // 工作流模型 JSON 数据
|
||||||
|
remark?: string; // 备注
|
||||||
|
status: number; // 状态
|
||||||
|
createTime?: Date; // 创建时间
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询工作流管理列表 */
|
||||||
|
export function getWorkflowPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<AiWorkflowApi.Workflow>>(
|
||||||
|
'/ai/workflow/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询工作流详情 */
|
||||||
|
export function getWorkflow(id: number) {
|
||||||
|
return requestClient.get<AiWorkflowApi.Workflow>(`/ai/workflow/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增工作流 */
|
||||||
|
export function createWorkflow(data: AiWorkflowApi.Workflow) {
|
||||||
|
return requestClient.post('/ai/workflow/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改工作流 */
|
||||||
|
export function updateWorkflow(data: AiWorkflowApi.Workflow) {
|
||||||
|
return requestClient.put('/ai/workflow/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除工作流 */
|
||||||
|
export function deleteWorkflow(id: number) {
|
||||||
|
return requestClient.delete(`/ai/workflow/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 测试工作流 */
|
||||||
|
export function testWorkflow(data: any) {
|
||||||
|
return requestClient.post('/ai/workflow/test', data);
|
||||||
|
}
|
||||||
79
apps/web-antd/src/api/ai/write/index.ts
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import type { AiWriteTypeEnum } from '@vben/constants';
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { useAppConfig } from '@vben/hooks';
|
||||||
|
import { fetchEventSource } from '@vben/request';
|
||||||
|
import { useAccessStore } from '@vben/stores';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||||
|
const accessStore = useAccessStore();
|
||||||
|
|
||||||
|
export namespace AiWriteApi {
|
||||||
|
export interface Write {
|
||||||
|
id?: number;
|
||||||
|
type: AiWriteTypeEnum.REPLY | AiWriteTypeEnum.WRITING; // 1:撰写 2:回复
|
||||||
|
prompt: string; // 写作内容提示 1。撰写 2回复
|
||||||
|
originalContent: string; // 原文
|
||||||
|
length: number; // 长度
|
||||||
|
format: number; // 格式
|
||||||
|
tone: number; // 语气
|
||||||
|
language: number; // 语言
|
||||||
|
userId?: number; // 用户编号
|
||||||
|
platform?: string; // 平台
|
||||||
|
model?: string; // 模型
|
||||||
|
generatedContent?: string; // 生成的内容
|
||||||
|
errorMessage?: string; // 错误信息
|
||||||
|
createTime?: Date; // 创建时间
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AiWritePageReqVO extends PageParam {
|
||||||
|
userId?: number; // 用户编号
|
||||||
|
type?: AiWriteTypeEnum; // 写作类型
|
||||||
|
platform?: string; // 平台
|
||||||
|
createTime?: [string, string]; // 创建时间
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 写作 Stream */
|
||||||
|
export function writeStream({
|
||||||
|
data,
|
||||||
|
onClose,
|
||||||
|
onMessage,
|
||||||
|
onError,
|
||||||
|
ctrl,
|
||||||
|
}: {
|
||||||
|
ctrl: AbortController;
|
||||||
|
data: Partial<AiWriteApi.Write>;
|
||||||
|
onClose?: (...args: any[]) => void;
|
||||||
|
onError?: (...args: any[]) => void;
|
||||||
|
onMessage?: (res: any) => void;
|
||||||
|
}) {
|
||||||
|
const token = accessStore.accessToken;
|
||||||
|
return fetchEventSource(`${apiURL}/ai/write/generate-stream`, {
|
||||||
|
method: 'post',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
},
|
||||||
|
openWhenHidden: true,
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
onmessage: onMessage,
|
||||||
|
onerror: onError,
|
||||||
|
onclose: onClose,
|
||||||
|
signal: ctrl.signal,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取写作列表 */
|
||||||
|
export function getWritePage(params: AiWriteApi.AiWritePageReqVO) {
|
||||||
|
return requestClient.get<PageResult<AiWriteApi.Write>>(`/ai/write/page`, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除写作记录 */
|
||||||
|
export function deleteWrite(id: number) {
|
||||||
|
return requestClient.delete(`/ai/write/delete`, { params: { id } });
|
||||||
|
}
|
||||||
60
apps/web-antd/src/api/bpm/category/index.ts
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmCategoryApi {
|
||||||
|
/** 流程分类 */
|
||||||
|
export interface Category {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
status: number;
|
||||||
|
description?: string;
|
||||||
|
sort: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程分类分页 */
|
||||||
|
export async function getCategoryPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmCategoryApi.Category>>(
|
||||||
|
'/bpm/category/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程分类详情 */
|
||||||
|
export async function getCategory(id: number) {
|
||||||
|
return requestClient.get<BpmCategoryApi.Category>(
|
||||||
|
`/bpm/category/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增流程分类 */
|
||||||
|
export async function createCategory(data: BpmCategoryApi.Category) {
|
||||||
|
return requestClient.post<number>('/bpm/category/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改流程分类 */
|
||||||
|
export async function updateCategory(data: BpmCategoryApi.Category) {
|
||||||
|
return requestClient.put<boolean>('/bpm/category/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除流程分类 */
|
||||||
|
export async function deleteCategory(id: number) {
|
||||||
|
return requestClient.delete<boolean>(`/bpm/category/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程分类列表 */
|
||||||
|
export async function getCategorySimpleList() {
|
||||||
|
return requestClient.get<BpmCategoryApi.Category[]>(
|
||||||
|
`/bpm/category/simple-list`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量修改流程分类的排序 */
|
||||||
|
export async function updateCategorySortBatch(ids: number[]) {
|
||||||
|
const params = ids.join(',');
|
||||||
|
return requestClient.put<boolean>(
|
||||||
|
`/bpm/category/update-sort-batch?ids=${params}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
64
apps/web-antd/src/api/bpm/definition/index.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { BpmModelApi } from '#/api/bpm/model';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmProcessDefinitionApi {
|
||||||
|
/** 流程定义 */
|
||||||
|
export interface ProcessDefinition {
|
||||||
|
id: string;
|
||||||
|
key?: string;
|
||||||
|
version: number;
|
||||||
|
name: string;
|
||||||
|
category: string;
|
||||||
|
description: string;
|
||||||
|
deploymentTime: number;
|
||||||
|
suspensionState: number;
|
||||||
|
modelType: number;
|
||||||
|
modelId: string;
|
||||||
|
formType?: number;
|
||||||
|
formId?: number;
|
||||||
|
formName?: string;
|
||||||
|
formCustomCreatePath?: string;
|
||||||
|
bpmnXml?: string;
|
||||||
|
simpleModel?: string;
|
||||||
|
formFields?: string[];
|
||||||
|
icon?: string;
|
||||||
|
startUsers?: BpmModelApi.UserInfo[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程定义 */
|
||||||
|
export async function getProcessDefinition(id?: string, key?: string) {
|
||||||
|
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinition>(
|
||||||
|
'/bpm/process-definition/get',
|
||||||
|
{
|
||||||
|
params: { id, key },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 分页查询流程定义 */
|
||||||
|
export async function getProcessDefinitionPage(params: PageParam) {
|
||||||
|
return requestClient.get<
|
||||||
|
PageResult<BpmProcessDefinitionApi.ProcessDefinition>
|
||||||
|
>('/bpm/process-definition/page', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程定义列表 */
|
||||||
|
export async function getProcessDefinitionList(params: any) {
|
||||||
|
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinition[]>(
|
||||||
|
'/bpm/process-definition/list',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程定义列表(简单列表) */
|
||||||
|
export async function getSimpleProcessDefinitionList() {
|
||||||
|
return requestClient.get<
|
||||||
|
PageResult<BpmProcessDefinitionApi.ProcessDefinition>
|
||||||
|
>('/bpm/process-definition/simple-list');
|
||||||
|
}
|
||||||
48
apps/web-antd/src/api/bpm/form/index.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmFormApi {
|
||||||
|
/** 流程表单 */
|
||||||
|
export interface Form {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
conf: string;
|
||||||
|
fields: string[];
|
||||||
|
status: number;
|
||||||
|
remark: string;
|
||||||
|
createTime: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取表单分页列表 */
|
||||||
|
export async function getFormPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmFormApi.Form>>('/bpm/form/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取表单详情 */
|
||||||
|
export async function getForm(id: number) {
|
||||||
|
return requestClient.get<BpmFormApi.Form>(`/bpm/form/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建表单 */
|
||||||
|
export async function createForm(data: BpmFormApi.Form) {
|
||||||
|
return requestClient.post('/bpm/form/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新表单 */
|
||||||
|
export async function updateForm(data: BpmFormApi.Form) {
|
||||||
|
return requestClient.put('/bpm/form/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除表单 */
|
||||||
|
export async function deleteForm(id: number) {
|
||||||
|
return requestClient.delete(`/bpm/form/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取表单简单列表 */
|
||||||
|
export async function getFormSimpleList() {
|
||||||
|
return requestClient.get<BpmFormApi.Form[]>('/bpm/form/simple-list');
|
||||||
|
}
|
||||||
111
apps/web-antd/src/api/bpm/model/index.ts
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmModelApi {
|
||||||
|
/** 流程模型 */
|
||||||
|
export interface Model {
|
||||||
|
id: number;
|
||||||
|
key: string;
|
||||||
|
name: string;
|
||||||
|
icon?: string;
|
||||||
|
description: string;
|
||||||
|
category: string;
|
||||||
|
formName: string;
|
||||||
|
formType: number;
|
||||||
|
formId: number;
|
||||||
|
formCustomCreatePath: string;
|
||||||
|
formCustomViewPath: string;
|
||||||
|
processDefinition: ProcessDefinition;
|
||||||
|
status: number;
|
||||||
|
remark: string;
|
||||||
|
createTime: string;
|
||||||
|
bpmnXml: string;
|
||||||
|
startUsers?: UserInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 流程定义 */
|
||||||
|
export interface ProcessDefinition {
|
||||||
|
id: string;
|
||||||
|
key?: string;
|
||||||
|
version: number;
|
||||||
|
deploymentTime: number;
|
||||||
|
suspensionState: number;
|
||||||
|
formType?: number;
|
||||||
|
formCustomViewPath?: string;
|
||||||
|
formFields?: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 用户信息 */
|
||||||
|
export interface UserInfo {
|
||||||
|
id: number;
|
||||||
|
nickname: string;
|
||||||
|
avatar?: string;
|
||||||
|
deptId?: number;
|
||||||
|
deptName?: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 模型分类信息 */
|
||||||
|
export interface ModelCategoryInfo {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
modelList: BpmModelApi.Model[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取流程模型列表 */
|
||||||
|
export async function getModelList(name?: string) {
|
||||||
|
return requestClient.get<BpmModelApi.Model[]>('/bpm/model/list', {
|
||||||
|
params: { name },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取流程模型详情 */
|
||||||
|
export async function getModel(id: string) {
|
||||||
|
return requestClient.get<BpmModelApi.Model>(`/bpm/model/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新流程模型 */
|
||||||
|
export async function updateModel(data: BpmModelApi.Model) {
|
||||||
|
return requestClient.put('/bpm/model/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量修改流程模型排序 */
|
||||||
|
export async function updateModelSortBatch(ids: number[]) {
|
||||||
|
const params = ids.join(',');
|
||||||
|
return requestClient.put<boolean>(
|
||||||
|
`/bpm/model/update-sort-batch?ids=${params}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新流程模型的 BPMN XML */
|
||||||
|
export async function updateModelBpmn(data: BpmModelApi.Model) {
|
||||||
|
return requestClient.put('/bpm/model/update-bpmn', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新流程模型状态 */
|
||||||
|
export async function updateModelState(id: number, state: number) {
|
||||||
|
const data = {
|
||||||
|
id,
|
||||||
|
state,
|
||||||
|
};
|
||||||
|
return requestClient.put('/bpm/model/update-state', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建流程模型 */
|
||||||
|
export async function createModel(data: BpmModelApi.Model) {
|
||||||
|
return requestClient.post('/bpm/model/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除流程模型 */
|
||||||
|
export async function deleteModel(id: number) {
|
||||||
|
return requestClient.delete(`/bpm/model/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 部署流程模型 */
|
||||||
|
export async function deployModel(id: number) {
|
||||||
|
return requestClient.post(`/bpm/model/deploy?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 清理流程模型 */
|
||||||
|
export async function cleanModel(id: number) {
|
||||||
|
return requestClient.delete(`/bpm/model/clean?id=${id}`);
|
||||||
|
}
|
||||||
55
apps/web-antd/src/api/bpm/processExpression/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmProcessExpressionApi {
|
||||||
|
/** 流程表达式 */
|
||||||
|
export interface ProcessExpression {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 表达式名字
|
||||||
|
status: number; // 表达式状态
|
||||||
|
expression: string; // 表达式
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程表达式分页 */
|
||||||
|
export async function getProcessExpressionPage(params: PageParam) {
|
||||||
|
return requestClient.get<
|
||||||
|
PageResult<BpmProcessExpressionApi.ProcessExpression>
|
||||||
|
>('/bpm/process-expression/page', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程表达式详情 */
|
||||||
|
export async function getProcessExpression(id: number) {
|
||||||
|
return requestClient.get<BpmProcessExpressionApi.ProcessExpression>(
|
||||||
|
`/bpm/process-expression/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增流程表达式 */
|
||||||
|
export async function createProcessExpression(
|
||||||
|
data: BpmProcessExpressionApi.ProcessExpression,
|
||||||
|
) {
|
||||||
|
return requestClient.post<number>('/bpm/process-expression/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改流程表达式 */
|
||||||
|
export async function updateProcessExpression(
|
||||||
|
data: BpmProcessExpressionApi.ProcessExpression,
|
||||||
|
) {
|
||||||
|
return requestClient.put<boolean>('/bpm/process-expression/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除流程表达式 */
|
||||||
|
export async function deleteProcessExpression(id: number) {
|
||||||
|
return requestClient.delete<boolean>(
|
||||||
|
`/bpm/process-expression/delete?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出流程表达式 */
|
||||||
|
export async function exportProcessExpression(params: any) {
|
||||||
|
return requestClient.download('/bpm/process-expression/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
221
apps/web-antd/src/api/bpm/processInstance/index.ts
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
import type {
|
||||||
|
BpmCandidateStrategyEnum,
|
||||||
|
BpmNodeTypeEnum,
|
||||||
|
} from '@vben/constants';
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { BpmTaskApi } from '../task';
|
||||||
|
|
||||||
|
import type { BpmModelApi } from '#/api/bpm/model';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmProcessInstanceApi {
|
||||||
|
/** 流程实例 */
|
||||||
|
export interface ProcessInstance {
|
||||||
|
businessKey: string;
|
||||||
|
category: string;
|
||||||
|
categoryName?: string;
|
||||||
|
createTime: string;
|
||||||
|
endTime: string;
|
||||||
|
fields: string[];
|
||||||
|
formVariables: Record<string, any>;
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
processDefinition?: BpmModelApi.ProcessDefinition;
|
||||||
|
processDefinitionId: string;
|
||||||
|
remark: string;
|
||||||
|
result: number;
|
||||||
|
startTime?: Date;
|
||||||
|
startUser?: User;
|
||||||
|
status: number;
|
||||||
|
summary?: {
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
}[];
|
||||||
|
tasks?: BpmProcessInstanceApi.Task[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 流程实例的任务 */
|
||||||
|
export interface Task {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
assigneeUser?: User;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 流程实例的用户信息 */
|
||||||
|
export interface User {
|
||||||
|
id: number;
|
||||||
|
nickname: string;
|
||||||
|
avatar: string;
|
||||||
|
deptName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 审批详情 */
|
||||||
|
export interface ApprovalDetailRespVO {
|
||||||
|
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[];
|
||||||
|
formFieldsPermission: any;
|
||||||
|
processDefinition: BpmModelApi.ProcessDefinition;
|
||||||
|
processInstance: BpmProcessInstanceApi.ProcessInstance;
|
||||||
|
status: number;
|
||||||
|
todoTask: BpmTaskApi.Task;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 审批详情的节点信息 */
|
||||||
|
export interface ApprovalNodeInfo {
|
||||||
|
candidateStrategy?: BpmCandidateStrategyEnum;
|
||||||
|
candidateUsers?: User[];
|
||||||
|
endTime?: Date;
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
nodeType: BpmNodeTypeEnum;
|
||||||
|
startTime?: Date;
|
||||||
|
status: number;
|
||||||
|
processInstanceId?: string;
|
||||||
|
tasks: ApprovalTaskInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 审批详情的节点的任务 */
|
||||||
|
export interface ApprovalTaskInfo {
|
||||||
|
id: number;
|
||||||
|
assigneeUser: User;
|
||||||
|
ownerUser: User;
|
||||||
|
reason: string;
|
||||||
|
signPicUrl: string;
|
||||||
|
status: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 抄送流程实例 */
|
||||||
|
export interface ProcessInstanceCopyRespVO {
|
||||||
|
activityId: string;
|
||||||
|
activityName: string;
|
||||||
|
createTime: number;
|
||||||
|
createUser: User;
|
||||||
|
id: number;
|
||||||
|
processInstanceId: string;
|
||||||
|
processInstanceName: string;
|
||||||
|
processInstanceStartTime: number;
|
||||||
|
reason: string;
|
||||||
|
startUser: User;
|
||||||
|
summary: {
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
}[];
|
||||||
|
taskId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 流程实例的打印数据响应 */
|
||||||
|
export interface ProcessPrintDataRespVO {
|
||||||
|
printTemplateEnable: boolean;
|
||||||
|
printTemplateHtml?: string;
|
||||||
|
processInstance: ProcessInstance;
|
||||||
|
tasks: {
|
||||||
|
description: string;
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
signPicUrl?: string;
|
||||||
|
}[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询我的流程实例分页 */
|
||||||
|
export async function getProcessInstanceMyPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||||
|
'/bpm/process-instance/my-page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询管理员流程实例分页 */
|
||||||
|
export async function getProcessInstanceManagerPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||||
|
'/bpm/process-instance/manager-page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增流程实例 */
|
||||||
|
export async function createProcessInstance(data: any) {
|
||||||
|
return requestClient.post<BpmProcessInstanceApi.ProcessInstance>(
|
||||||
|
'/bpm/process-instance/create',
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 申请人主动取消流程实例 */
|
||||||
|
export async function cancelProcessInstanceByStartUser(
|
||||||
|
id: number,
|
||||||
|
reason: string,
|
||||||
|
) {
|
||||||
|
return requestClient.delete<boolean>(
|
||||||
|
'/bpm/process-instance/cancel-by-start-user',
|
||||||
|
{
|
||||||
|
data: { id, reason },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 管理员取消流程实例 */
|
||||||
|
export async function cancelProcessInstanceByAdmin(id: number, reason: string) {
|
||||||
|
return requestClient.delete<boolean>(
|
||||||
|
'/bpm/process-instance/cancel-by-admin',
|
||||||
|
{
|
||||||
|
data: { id, reason },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程实例详情 */
|
||||||
|
export async function getProcessInstance(id: number) {
|
||||||
|
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||||
|
`/bpm/process-instance/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询复制流程实例分页 */
|
||||||
|
export async function getProcessInstanceCopyPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||||
|
'/bpm/process-instance/copy/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新流程实例 */
|
||||||
|
export async function updateProcessInstance(
|
||||||
|
data: BpmProcessInstanceApi.ProcessInstance,
|
||||||
|
) {
|
||||||
|
return requestClient.put<BpmProcessInstanceApi.ProcessInstance>(
|
||||||
|
'/bpm/process-instance/update',
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取审批详情 */
|
||||||
|
export async function getApprovalDetail(params: any) {
|
||||||
|
return requestClient.get<BpmProcessInstanceApi.ApprovalDetailRespVO>(
|
||||||
|
`/bpm/process-instance/get-approval-detail`,
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取下一个执行的流程节点 */
|
||||||
|
export async function getNextApprovalNodes(params: any) {
|
||||||
|
return requestClient.get<BpmProcessInstanceApi.ApprovalNodeInfo[]>(
|
||||||
|
`/bpm/process-instance/get-next-approval-nodes`,
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取流程实例 BPMN 模型视图 */
|
||||||
|
export async function getProcessInstanceBpmnModelView(id: string) {
|
||||||
|
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||||
|
`/bpm/process-instance/get-bpmn-model-view?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取流程实例打印数据 */
|
||||||
|
export async function getProcessInstancePrintData(id: string) {
|
||||||
|
return requestClient.get<BpmProcessInstanceApi.ProcessPrintDataRespVO>(
|
||||||
|
`/bpm/process-instance/get-print-data?processInstanceId=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
50
apps/web-antd/src/api/bpm/processListener/index.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmProcessListenerApi {
|
||||||
|
/** 流程监听器 */
|
||||||
|
export interface ProcessListener {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 监听器名字
|
||||||
|
type: string; // 监听器类型
|
||||||
|
status: number; // 监听器状态
|
||||||
|
event: string; // 监听事件
|
||||||
|
valueType: string; // 监听器值类型
|
||||||
|
value: string; // 监听器值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程监听器分页 */
|
||||||
|
export async function getProcessListenerPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmProcessListenerApi.ProcessListener>>(
|
||||||
|
'/bpm/process-listener/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询流程监听器详情 */
|
||||||
|
export async function getProcessListener(id: number) {
|
||||||
|
return requestClient.get<BpmProcessListenerApi.ProcessListener>(
|
||||||
|
`/bpm/process-listener/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增流程监听器 */
|
||||||
|
export async function createProcessListener(
|
||||||
|
data: BpmProcessListenerApi.ProcessListener,
|
||||||
|
) {
|
||||||
|
return requestClient.post<number>('/bpm/process-listener/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改流程监听器 */
|
||||||
|
export async function updateProcessListener(
|
||||||
|
data: BpmProcessListenerApi.ProcessListener,
|
||||||
|
) {
|
||||||
|
return requestClient.put<boolean>('/bpm/process-listener/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除流程监听器 */
|
||||||
|
export async function deleteProcessListener(id: number) {
|
||||||
|
return requestClient.delete<boolean>(`/bpm/process-listener/delete?id=${id}`);
|
||||||
|
}
|
||||||
106
apps/web-antd/src/api/bpm/task/index.ts
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { BpmProcessInstanceApi } from '../processInstance';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmTaskApi {
|
||||||
|
/** 流程任务 */
|
||||||
|
export interface Task {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 监听器名字
|
||||||
|
type: string; // 监听器类型
|
||||||
|
status: number; // 监听器状态
|
||||||
|
event: string; // 监听事件
|
||||||
|
valueType: string; // 监听器值类型
|
||||||
|
processInstance?: BpmProcessInstanceApi.ProcessInstance; // 流程实例
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询待办任务分页 */
|
||||||
|
export async function getTaskTodoPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmTaskApi.Task>>('/bpm/task/todo-page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询已办任务分页 */
|
||||||
|
export async function getTaskDonePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmTaskApi.Task>>('/bpm/task/done-page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询任务管理分页 */
|
||||||
|
export async function getTaskManagerPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmTaskApi.Task>>(
|
||||||
|
'/bpm/task/manager-page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 审批任务 */
|
||||||
|
export const approveTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/approve', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 驳回任务 */
|
||||||
|
export const rejectTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/reject', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 根据流程实例 ID 查询任务列表 */
|
||||||
|
export const getTaskListByProcessInstanceId = async (id: string) => {
|
||||||
|
return await requestClient.get(
|
||||||
|
`/bpm/task/list-by-process-instance-id?processInstanceId=${id}`,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取所有可退回的节点 */
|
||||||
|
export const getTaskListByReturn = async (id: string) => {
|
||||||
|
return await requestClient.get(`/bpm/task/list-by-return?id=${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 退回任务 */
|
||||||
|
export const returnTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/return', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 委派任务 */
|
||||||
|
export const delegateTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/delegate', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 转派任务 */
|
||||||
|
export const transferTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/transfer', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 加签任务 */
|
||||||
|
export const signCreateTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/create-sign', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 减签任务 */
|
||||||
|
export const signDeleteTask = async (data: any) => {
|
||||||
|
return await requestClient.delete('/bpm/task/delete-sign', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 抄送任务 */
|
||||||
|
export const copyTask = async (data: any) => {
|
||||||
|
return await requestClient.put('/bpm/task/copy', data);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 获取加签任务列表 */
|
||||||
|
export const getChildrenTaskList = async (id: string) => {
|
||||||
|
return await requestClient.get(
|
||||||
|
`/bpm/task/list-by-parent-task-id?parentTaskId=${id}`,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 撤回任务 */
|
||||||
|
export const withdrawTask = async (taskId: string) => {
|
||||||
|
return await requestClient.put('/bpm/task/withdraw', null, {
|
||||||
|
params: { taskId },
|
||||||
|
});
|
||||||
|
};
|
||||||
53
apps/web-antd/src/api/bpm/userGroup/index.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace BpmUserGroupApi {
|
||||||
|
/** 用户组 */
|
||||||
|
export interface UserGroup {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
userIds: number[];
|
||||||
|
status: number;
|
||||||
|
remark: string;
|
||||||
|
createTime: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询用户组分页 */
|
||||||
|
export async function getUserGroupPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<BpmUserGroupApi.UserGroup>>(
|
||||||
|
'/bpm/user-group/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询用户组详情 */
|
||||||
|
export async function getUserGroup(id: number) {
|
||||||
|
return requestClient.get<BpmUserGroupApi.UserGroup>(
|
||||||
|
`/bpm/user-group/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增用户组 */
|
||||||
|
export async function createUserGroup(data: BpmUserGroupApi.UserGroup) {
|
||||||
|
return requestClient.post<number>('/bpm/user-group/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改用户组 */
|
||||||
|
export async function updateUserGroup(data: BpmUserGroupApi.UserGroup) {
|
||||||
|
return requestClient.put<boolean>('/bpm/user-group/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除用户组 */
|
||||||
|
export async function deleteUserGroup(id: number) {
|
||||||
|
return requestClient.delete<boolean>(`/bpm/user-group/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询用户组列表 */
|
||||||
|
export async function getUserGroupSimpleList() {
|
||||||
|
return requestClient.get<BpmUserGroupApi.UserGroup[]>(
|
||||||
|
`/bpm/user-group/simple-list`,
|
||||||
|
);
|
||||||
|
}
|
||||||
161
apps/web-antd/src/api/core/auth.ts
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
import type { AuthPermissionInfo } from '@vben/types';
|
||||||
|
|
||||||
|
import { baseRequestClient, requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace AuthApi {
|
||||||
|
/** 登录接口参数 */
|
||||||
|
export interface LoginParams {
|
||||||
|
password?: string;
|
||||||
|
username?: string;
|
||||||
|
captchaVerification?: string;
|
||||||
|
// 绑定社交登录时,需要传递如下参数
|
||||||
|
socialType?: number;
|
||||||
|
socialCode?: string;
|
||||||
|
socialState?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 登录接口返回值 */
|
||||||
|
export interface LoginResult {
|
||||||
|
accessToken: string;
|
||||||
|
refreshToken: string;
|
||||||
|
userId: number;
|
||||||
|
expiresTime: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 租户信息返回值 */
|
||||||
|
export interface TenantResult {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 手机验证码获取接口参数 */
|
||||||
|
export interface SmsCodeParams {
|
||||||
|
mobile: string;
|
||||||
|
scene: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 手机验证码登录接口参数 */
|
||||||
|
export interface SmsLoginParams {
|
||||||
|
mobile: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 注册接口参数 */
|
||||||
|
export interface RegisterParams {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
captchaVerification: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置密码接口参数 */
|
||||||
|
export interface ResetPasswordParams {
|
||||||
|
password: string;
|
||||||
|
mobile: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 社交快捷登录接口参数 */
|
||||||
|
export interface SocialLoginParams {
|
||||||
|
type: number;
|
||||||
|
code: string;
|
||||||
|
state: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 登录 */
|
||||||
|
export async function loginApi(data: AuthApi.LoginParams) {
|
||||||
|
return requestClient.post<AuthApi.LoginResult>('/system/auth/login', data, {
|
||||||
|
headers: {
|
||||||
|
isEncrypt: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 刷新 accessToken */
|
||||||
|
export async function refreshTokenApi(refreshToken: string) {
|
||||||
|
return baseRequestClient.post(
|
||||||
|
`/system/auth/refresh-token?refreshToken=${refreshToken}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 退出登录 */
|
||||||
|
export async function logoutApi(accessToken: string) {
|
||||||
|
return baseRequestClient.post(
|
||||||
|
'/system/auth/logout',
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${accessToken}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取权限信息 */
|
||||||
|
export async function getAuthPermissionInfoApi() {
|
||||||
|
return requestClient.get<AuthPermissionInfo>(
|
||||||
|
'/system/auth/get-permission-info',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取租户列表 */
|
||||||
|
export async function getTenantSimpleList() {
|
||||||
|
return requestClient.get<AuthApi.TenantResult[]>(
|
||||||
|
`/system/tenant/simple-list`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 使用租户域名,获得租户信息 */
|
||||||
|
export async function getTenantByWebsite(website: string) {
|
||||||
|
return requestClient.get<AuthApi.TenantResult>(
|
||||||
|
`/system/tenant/get-by-website?website=${website}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取验证码 */
|
||||||
|
export async function getCaptcha(data: any) {
|
||||||
|
return baseRequestClient.post('/system/captcha/get', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 校验验证码 */
|
||||||
|
export async function checkCaptcha(data: any) {
|
||||||
|
return baseRequestClient.post('/system/captcha/check', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取登录验证码 */
|
||||||
|
export async function sendSmsCode(data: AuthApi.SmsCodeParams) {
|
||||||
|
return requestClient.post('/system/auth/send-sms-code', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 短信验证码登录 */
|
||||||
|
export async function smsLogin(data: AuthApi.SmsLoginParams) {
|
||||||
|
return requestClient.post('/system/auth/sms-login', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 注册 */
|
||||||
|
export async function register(data: AuthApi.RegisterParams) {
|
||||||
|
return requestClient.post('/system/auth/register', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 通过短信重置密码 */
|
||||||
|
export async function smsResetPassword(data: AuthApi.ResetPasswordParams) {
|
||||||
|
return requestClient.post('/system/auth/reset-password', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 社交授权的跳转 */
|
||||||
|
export async function socialAuthRedirect(type: number, redirectUri: string) {
|
||||||
|
return requestClient.get('/system/auth/social-auth-redirect', {
|
||||||
|
params: {
|
||||||
|
type,
|
||||||
|
redirectUri,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 社交快捷登录 */
|
||||||
|
export async function socialLogin(data: AuthApi.SocialLoginParams) {
|
||||||
|
return requestClient.post<AuthApi.LoginResult>(
|
||||||
|
'/system/auth/social-login',
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
128
apps/web-antd/src/api/crm/business/index.ts
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmBusinessApi {
|
||||||
|
/** 商机信息 */
|
||||||
|
export interface Business {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
customerId: number;
|
||||||
|
customerName?: string;
|
||||||
|
followUpStatus: boolean;
|
||||||
|
contactLastTime: Date;
|
||||||
|
contactNextTime: Date;
|
||||||
|
ownerUserId: number;
|
||||||
|
ownerUserName?: string; // 负责人的用户名称
|
||||||
|
ownerUserDept?: string; // 负责人的部门名称
|
||||||
|
statusTypeId: number;
|
||||||
|
statusTypeName?: string;
|
||||||
|
statusId: number;
|
||||||
|
statusName?: string;
|
||||||
|
endStatus: number;
|
||||||
|
endRemark: string;
|
||||||
|
dealTime: Date;
|
||||||
|
totalProductPrice: number;
|
||||||
|
totalPrice: number;
|
||||||
|
discountPercent: number;
|
||||||
|
status?: number;
|
||||||
|
remark: string;
|
||||||
|
creator: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人名称
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
updateTime: Date; // 更新时间
|
||||||
|
products?: BusinessProduct[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机产品信息 */
|
||||||
|
export interface BusinessProduct {
|
||||||
|
id: number;
|
||||||
|
productId: number;
|
||||||
|
productName: string;
|
||||||
|
productNo: string;
|
||||||
|
productUnit: number;
|
||||||
|
productPrice: number;
|
||||||
|
businessPrice: number;
|
||||||
|
count: number;
|
||||||
|
totalPrice: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机更新状态请求 */
|
||||||
|
export interface BusinessUpdateStatusReqVO {
|
||||||
|
id: number;
|
||||||
|
statusId: number | undefined;
|
||||||
|
endStatus: number | undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询商机列表 */
|
||||||
|
export function getBusinessPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||||
|
'/crm/business/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询商机列表,基于指定客户 */
|
||||||
|
export function getBusinessPageByCustomer(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||||
|
'/crm/business/page-by-customer',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询商机详情 */
|
||||||
|
export function getBusiness(id: number) {
|
||||||
|
return requestClient.get<CrmBusinessApi.Business>(
|
||||||
|
`/crm/business/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得商机列表(精简) */
|
||||||
|
export function getSimpleBusinessList() {
|
||||||
|
return requestClient.get<CrmBusinessApi.Business[]>(
|
||||||
|
'/crm/business/simple-all-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增商机 */
|
||||||
|
export function createBusiness(data: CrmBusinessApi.Business) {
|
||||||
|
return requestClient.post('/crm/business/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改商机 */
|
||||||
|
export function updateBusiness(data: CrmBusinessApi.Business) {
|
||||||
|
return requestClient.put('/crm/business/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改商机状态 */
|
||||||
|
export function updateBusinessStatus(
|
||||||
|
data: CrmBusinessApi.BusinessUpdateStatusReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/crm/business/update-status', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除商机 */
|
||||||
|
export function deleteBusiness(id: number) {
|
||||||
|
return requestClient.delete(`/crm/business/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出商机 */
|
||||||
|
export function exportBusiness(params: any) {
|
||||||
|
return requestClient.download('/crm/business/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 联系人关联商机列表 */
|
||||||
|
export function getBusinessPageByContact(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmBusinessApi.Business>>(
|
||||||
|
'/crm/business/page-by-contact',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机转移 */
|
||||||
|
export function transferBusiness(data: CrmPermissionApi.BusinessTransferReqVO) {
|
||||||
|
return requestClient.put('/crm/business/transfer', data);
|
||||||
|
}
|
||||||
95
apps/web-antd/src/api/crm/business/status/index.ts
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmBusinessStatusApi {
|
||||||
|
/** 商机状态组信息 */
|
||||||
|
export interface BusinessStatus {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
deptIds?: number[];
|
||||||
|
deptNames?: string[];
|
||||||
|
creator?: string;
|
||||||
|
createTime?: Date;
|
||||||
|
statuses?: BusinessStatusType[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机状态信息 */
|
||||||
|
export interface BusinessStatusType {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
percent: number;
|
||||||
|
[x: string]: any;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 默认商机状态 */
|
||||||
|
export const DEFAULT_STATUSES = [
|
||||||
|
{
|
||||||
|
endStatus: 1,
|
||||||
|
key: '结束',
|
||||||
|
name: '赢单',
|
||||||
|
percent: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
endStatus: 2,
|
||||||
|
key: '结束',
|
||||||
|
name: '输单',
|
||||||
|
percent: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
endStatus: 3,
|
||||||
|
key: '结束',
|
||||||
|
name: '无效',
|
||||||
|
percent: 0,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
/** 查询商机状态组列表 */
|
||||||
|
export function getBusinessStatusPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmBusinessStatusApi.BusinessStatus>>(
|
||||||
|
'/crm/business-status/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增商机状态组 */
|
||||||
|
export function createBusinessStatus(
|
||||||
|
data: CrmBusinessStatusApi.BusinessStatus,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/crm/business-status/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改商机状态组 */
|
||||||
|
export function updateBusinessStatus(
|
||||||
|
data: CrmBusinessStatusApi.BusinessStatus,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/crm/business-status/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询商机状态类型详情 */
|
||||||
|
export function getBusinessStatus(id: number) {
|
||||||
|
return requestClient.get<CrmBusinessStatusApi.BusinessStatus>(
|
||||||
|
`/crm/business-status/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除商机状态 */
|
||||||
|
export function deleteBusinessStatus(id: number) {
|
||||||
|
return requestClient.delete(`/crm/business-status/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得商机状态组列表 */
|
||||||
|
export function getBusinessStatusTypeSimpleList() {
|
||||||
|
return requestClient.get<CrmBusinessStatusApi.BusinessStatus[]>(
|
||||||
|
'/crm/business-status/type-simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得商机阶段列表 */
|
||||||
|
export function getBusinessStatusSimpleList(typeId: number) {
|
||||||
|
return requestClient.get<CrmBusinessStatusApi.BusinessStatusType[]>(
|
||||||
|
'/crm/business-status/status-simple-list',
|
||||||
|
{ params: { typeId } },
|
||||||
|
);
|
||||||
|
}
|
||||||
86
apps/web-antd/src/api/crm/clue/index.ts
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmClueApi {
|
||||||
|
/** 线索信息 */
|
||||||
|
export interface Clue {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 线索名称
|
||||||
|
followUpStatus: boolean; // 跟进状态
|
||||||
|
contactLastTime: Date; // 最后跟进时间
|
||||||
|
contactLastContent: string; // 最后跟进内容
|
||||||
|
contactNextTime: Date; // 下次联系时间
|
||||||
|
ownerUserId: number; // 负责人的用户编号
|
||||||
|
ownerUserName?: string; // 负责人的用户名称
|
||||||
|
ownerUserDept?: string; // 负责人的部门名称
|
||||||
|
transformStatus: boolean; // 转化状态
|
||||||
|
customerId: number; // 客户编号
|
||||||
|
customerName?: string; // 客户名称
|
||||||
|
mobile: string; // 手机号
|
||||||
|
telephone: string; // 电话
|
||||||
|
qq: string; // QQ
|
||||||
|
wechat: string; // wechat
|
||||||
|
email: string; // email
|
||||||
|
areaId: number; // 所在地
|
||||||
|
areaName?: string; // 所在地名称
|
||||||
|
detailAddress: string; // 详细地址
|
||||||
|
industryId: number; // 所属行业
|
||||||
|
level: number; // 客户等级
|
||||||
|
source: number; // 客户来源
|
||||||
|
remark: string; // 备注
|
||||||
|
creator: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人名称
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
updateTime: Date; // 更新时间
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询线索列表 */
|
||||||
|
export function getCluePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmClueApi.Clue>>('/crm/clue/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询线索详情 */
|
||||||
|
export function getClue(id: number) {
|
||||||
|
return requestClient.get<CrmClueApi.Clue>(`/crm/clue/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增线索 */
|
||||||
|
export function createClue(data: CrmClueApi.Clue) {
|
||||||
|
return requestClient.post('/crm/clue/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改线索 */
|
||||||
|
export function updateClue(data: CrmClueApi.Clue) {
|
||||||
|
return requestClient.put('/crm/clue/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除线索 */
|
||||||
|
export function deleteClue(id: number) {
|
||||||
|
return requestClient.delete(`/crm/clue/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出线索 */
|
||||||
|
export function exportClue(params: any) {
|
||||||
|
return requestClient.download('/crm/clue/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 线索转移 */
|
||||||
|
export function transferClue(data: CrmPermissionApi.BusinessTransferReqVO) {
|
||||||
|
return requestClient.put('/crm/clue/transfer', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 线索转化为客户 */
|
||||||
|
export function transformClue(id: number) {
|
||||||
|
return requestClient.put(`/crm/clue/transform?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得分配给我的、待跟进的线索数量 */
|
||||||
|
export function getFollowClueCount() {
|
||||||
|
return requestClient.get<number>('/crm/clue/follow-count');
|
||||||
|
}
|
||||||
140
apps/web-antd/src/api/crm/contact/index.ts
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmContactApi {
|
||||||
|
/** 联系人信息 */
|
||||||
|
export interface Contact {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 联系人名称
|
||||||
|
customerId: number; // 客户编号
|
||||||
|
customerName?: string; // 客户名称
|
||||||
|
contactLastTime: Date; // 最后跟进时间
|
||||||
|
contactLastContent: string; // 最后跟进内容
|
||||||
|
contactNextTime: Date; // 下次联系时间
|
||||||
|
ownerUserId: number; // 负责人的用户编号
|
||||||
|
ownerUserName?: string; // 负责人的用户名称
|
||||||
|
ownerUserDept?: string; // 负责人的部门名称
|
||||||
|
mobile: string; // 手机号
|
||||||
|
telephone: string; // 电话
|
||||||
|
qq: string; // QQ
|
||||||
|
wechat: string; // wechat
|
||||||
|
email: string; // email
|
||||||
|
areaId: number; // 所在地
|
||||||
|
areaName?: string; // 所在地名称
|
||||||
|
detailAddress: string; // 详细地址
|
||||||
|
sex: number; // 性别
|
||||||
|
master: boolean; // 是否主联系人
|
||||||
|
post: string; // 职务
|
||||||
|
parentId: number; // 上级联系人编号
|
||||||
|
parentName?: string; // 上级联系人名称
|
||||||
|
remark: string; // 备注
|
||||||
|
creator: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人名称
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
updateTime: Date; // 更新时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 联系人商机关联请求 */
|
||||||
|
export interface ContactBusinessReqVO {
|
||||||
|
contactId: number;
|
||||||
|
businessIds: number[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机联系人关联请求 */
|
||||||
|
export interface BusinessContactReqVO {
|
||||||
|
businessId: number;
|
||||||
|
contactIds: number[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询联系人列表 */
|
||||||
|
export function getContactPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||||
|
'/crm/contact/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询联系人列表,基于指定客户 */
|
||||||
|
export function getContactPageByCustomer(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||||
|
'/crm/contact/page-by-customer',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询联系人列表,基于指定商机 */
|
||||||
|
export function getContactPageByBusiness(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmContactApi.Contact>>(
|
||||||
|
'/crm/contact/page-by-business',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询联系人详情 */
|
||||||
|
export function getContact(id: number) {
|
||||||
|
return requestClient.get<CrmContactApi.Contact>(`/crm/contact/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增联系人 */
|
||||||
|
export function createContact(data: CrmContactApi.Contact) {
|
||||||
|
return requestClient.post('/crm/contact/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改联系人 */
|
||||||
|
export function updateContact(data: CrmContactApi.Contact) {
|
||||||
|
return requestClient.put('/crm/contact/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除联系人 */
|
||||||
|
export function deleteContact(id: number) {
|
||||||
|
return requestClient.delete(`/crm/contact/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出联系人 */
|
||||||
|
export function exportContact(params: any) {
|
||||||
|
return requestClient.download('/crm/contact/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得联系人列表(精简) */
|
||||||
|
export function getSimpleContactList() {
|
||||||
|
return requestClient.get<CrmContactApi.Contact[]>(
|
||||||
|
'/crm/contact/simple-all-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量新增联系人商机关联 */
|
||||||
|
export function createContactBusinessList(
|
||||||
|
data: CrmContactApi.ContactBusinessReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/crm/contact/create-business-list', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量新增商机联系人关联 */
|
||||||
|
export function createBusinessContactList(
|
||||||
|
data: CrmContactApi.BusinessContactReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/crm/contact/create-business-list2', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 解除联系人商机关联 */
|
||||||
|
export function deleteContactBusinessList(
|
||||||
|
data: CrmContactApi.ContactBusinessReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.delete('/crm/contact/delete-business-list', { data });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 解除商机联系人关联 */
|
||||||
|
export function deleteBusinessContactList(
|
||||||
|
data: CrmContactApi.BusinessContactReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.delete('/crm/contact/delete-business-list2', { data });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 联系人转移 */
|
||||||
|
export function transferContact(data: CrmPermissionApi.BusinessTransferReqVO) {
|
||||||
|
return requestClient.put('/crm/contact/transfer', data);
|
||||||
|
}
|
||||||
133
apps/web-antd/src/api/crm/contract/index.ts
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmContractApi {
|
||||||
|
/** 合同信息 */
|
||||||
|
export interface Contract {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
no: string;
|
||||||
|
customerId: number;
|
||||||
|
customerName?: string;
|
||||||
|
businessId: number;
|
||||||
|
businessName: string;
|
||||||
|
contactLastTime: Date;
|
||||||
|
ownerUserId: number;
|
||||||
|
ownerUserName?: string;
|
||||||
|
ownerUserDeptName?: string;
|
||||||
|
processInstanceId: number;
|
||||||
|
auditStatus: number;
|
||||||
|
orderDate: Date;
|
||||||
|
startTime: Date;
|
||||||
|
endTime: Date;
|
||||||
|
totalProductPrice: number;
|
||||||
|
discountPercent: number;
|
||||||
|
totalPrice: number;
|
||||||
|
totalReceivablePrice: number;
|
||||||
|
signContactId: number;
|
||||||
|
signContactName?: string;
|
||||||
|
signUserId: number;
|
||||||
|
signUserName: string;
|
||||||
|
remark: string;
|
||||||
|
createTime?: Date;
|
||||||
|
creator: string;
|
||||||
|
creatorName: string;
|
||||||
|
updateTime?: Date;
|
||||||
|
products?: ContractProduct[];
|
||||||
|
contactName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 合同产品信息 */
|
||||||
|
export interface ContractProduct {
|
||||||
|
id: number;
|
||||||
|
productId: number;
|
||||||
|
productName: string;
|
||||||
|
productNo: string;
|
||||||
|
productUnit: number;
|
||||||
|
productPrice: number;
|
||||||
|
contractPrice: number;
|
||||||
|
count: number;
|
||||||
|
totalPrice: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询合同列表 */
|
||||||
|
export function getContractPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||||
|
'/crm/contract/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询合同列表,基于指定客户 */
|
||||||
|
export function getContractPageByCustomer(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||||
|
'/crm/contract/page-by-customer',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询合同列表,基于指定商机 */
|
||||||
|
export function getContractPageByBusiness(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmContractApi.Contract>>(
|
||||||
|
'/crm/contract/page-by-business',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询合同详情 */
|
||||||
|
export function getContract(id: number) {
|
||||||
|
return requestClient.get<CrmContractApi.Contract>(
|
||||||
|
`/crm/contract/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询合同下拉列表 */
|
||||||
|
export function getContractSimpleList(customerId: number) {
|
||||||
|
return requestClient.get<CrmContractApi.Contract[]>(
|
||||||
|
`/crm/contract/simple-list?customerId=${customerId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增合同 */
|
||||||
|
export function createContract(data: CrmContractApi.Contract) {
|
||||||
|
return requestClient.post('/crm/contract/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改合同 */
|
||||||
|
export function updateContract(data: CrmContractApi.Contract) {
|
||||||
|
return requestClient.put('/crm/contract/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除合同 */
|
||||||
|
export function deleteContract(id: number) {
|
||||||
|
return requestClient.delete(`/crm/contract/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出合同 */
|
||||||
|
export function exportContract(params: any) {
|
||||||
|
return requestClient.download('/crm/contract/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交审核 */
|
||||||
|
export function submitContract(id: number) {
|
||||||
|
return requestClient.put(`/crm/contract/submit?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 合同转移 */
|
||||||
|
export function transferContract(data: CrmPermissionApi.BusinessTransferReqVO) {
|
||||||
|
return requestClient.put('/crm/contract/transfer', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得待审核合同数量 */
|
||||||
|
export function getAuditContractCount() {
|
||||||
|
return requestClient.get<number>('/crm/contract/audit-count');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得即将到期(提醒)的合同数量 */
|
||||||
|
export function getRemindContractCount() {
|
||||||
|
return requestClient.get<number>('/crm/contract/remind-count');
|
||||||
|
}
|
||||||
154
apps/web-antd/src/api/crm/customer/index.ts
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { CrmPermissionApi } from '#/api/crm/permission';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmCustomerApi {
|
||||||
|
/** 客户信息 */
|
||||||
|
export interface Customer {
|
||||||
|
id: number; // 编号
|
||||||
|
name: string; // 客户名称
|
||||||
|
followUpStatus: boolean; // 跟进状态
|
||||||
|
contactLastTime: Date; // 最后跟进时间
|
||||||
|
contactLastContent: string; // 最后跟进内容
|
||||||
|
contactNextTime: Date; // 下次联系时间
|
||||||
|
ownerUserId: number; // 负责人的用户编号
|
||||||
|
ownerUserName?: string; // 负责人的用户名称
|
||||||
|
ownerUserDept?: string; // 负责人的部门名称
|
||||||
|
ownerUserDeptName?: string; // 负责人的部门名称
|
||||||
|
lockStatus?: boolean;
|
||||||
|
dealStatus?: boolean;
|
||||||
|
mobile: string; // 手机号
|
||||||
|
telephone: string; // 电话
|
||||||
|
qq: string; // QQ
|
||||||
|
wechat: string; // wechat
|
||||||
|
email: string; // email
|
||||||
|
areaId: number; // 所在地
|
||||||
|
areaName?: string; // 所在地名称
|
||||||
|
detailAddress: string; // 详细地址
|
||||||
|
industryId: number; // 所属行业
|
||||||
|
level: number; // 客户等级
|
||||||
|
source: number; // 客户来源
|
||||||
|
remark: string; // 备注
|
||||||
|
creator: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人名称
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
updateTime: Date; // 更新时间
|
||||||
|
poolDay?: number; // 距离进入公海天数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户导入请求 */
|
||||||
|
export interface CustomerImportReqVO {
|
||||||
|
ownerUserId: number;
|
||||||
|
file: File;
|
||||||
|
updateSupport: boolean;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询客户列表 */
|
||||||
|
export function getCustomerPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmCustomerApi.Customer>>(
|
||||||
|
'/crm/customer/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询客户详情 */
|
||||||
|
export function getCustomer(id: number) {
|
||||||
|
return requestClient.get<CrmCustomerApi.Customer>(
|
||||||
|
`/crm/customer/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增客户 */
|
||||||
|
export function createCustomer(data: CrmCustomerApi.Customer) {
|
||||||
|
return requestClient.post('/crm/customer/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改客户 */
|
||||||
|
export function updateCustomer(data: CrmCustomerApi.Customer) {
|
||||||
|
return requestClient.put('/crm/customer/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除客户 */
|
||||||
|
export function deleteCustomer(id: number) {
|
||||||
|
return requestClient.delete(`/crm/customer/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出客户 */
|
||||||
|
export function exportCustomer(params: any) {
|
||||||
|
return requestClient.download('/crm/customer/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 下载客户导入模板 */
|
||||||
|
export function importCustomerTemplate() {
|
||||||
|
return requestClient.download('/crm/customer/get-import-template');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导入客户 */
|
||||||
|
export function importCustomer(data: CrmCustomerApi.CustomerImportReqVO) {
|
||||||
|
return requestClient.upload('/crm/customer/import', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户精简信息列表 */
|
||||||
|
export function getCustomerSimpleList() {
|
||||||
|
return requestClient.get<CrmCustomerApi.Customer[]>(
|
||||||
|
'/crm/customer/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户转移 */
|
||||||
|
export function transferCustomer(data: CrmPermissionApi.BusinessTransferReqVO) {
|
||||||
|
return requestClient.put('/crm/customer/transfer', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 锁定/解锁客户 */
|
||||||
|
export function lockCustomer(id: number, lockStatus: boolean) {
|
||||||
|
return requestClient.put('/crm/customer/lock', { id, lockStatus });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 领取公海客户 */
|
||||||
|
export function receiveCustomer(ids: number[]) {
|
||||||
|
return requestClient.put('/crm/customer/receive', { ids: ids.join(',') });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 分配公海给对应负责人 */
|
||||||
|
export function distributeCustomer(ids: number[], ownerUserId: number) {
|
||||||
|
return requestClient.put('/crm/customer/distribute', { ids, ownerUserId });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户放入公海 */
|
||||||
|
export function putCustomerPool(id: number) {
|
||||||
|
return requestClient.put(`/crm/customer/put-pool?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新客户的成交状态 */
|
||||||
|
export function updateCustomerDealStatus(id: number, dealStatus: boolean) {
|
||||||
|
return requestClient.put(
|
||||||
|
`/crm/customer/update-deal-status?id=${id}&dealStatus=${dealStatus}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 进入公海客户提醒的客户列表 */
|
||||||
|
export function getPutPoolRemindCustomerPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmCustomerApi.Customer>>(
|
||||||
|
'/crm/customer/put-pool-remind-page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得待进入公海客户数量 */
|
||||||
|
export function getPutPoolRemindCustomerCount() {
|
||||||
|
return requestClient.get<number>('/crm/customer/put-pool-remind-count');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得今日需联系客户数量 */
|
||||||
|
export function getTodayContactCustomerCount() {
|
||||||
|
return requestClient.get<number>('/crm/customer/today-contact-count');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得分配给我、待跟进的线索数量的客户数量 */
|
||||||
|
export function getFollowCustomerCount() {
|
||||||
|
return requestClient.get<number>('/crm/customer/follow-count');
|
||||||
|
}
|
||||||
53
apps/web-antd/src/api/crm/followup/index.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmFollowUpApi {
|
||||||
|
/** 跟进记录信息 */
|
||||||
|
export interface FollowUpRecord {
|
||||||
|
id: number; // 编号
|
||||||
|
bizType: number; // 数据类型
|
||||||
|
bizId: number; // 数据编号
|
||||||
|
type: number; // 跟进类型
|
||||||
|
content: string; // 跟进内容
|
||||||
|
picUrls: string[]; // 图片
|
||||||
|
fileUrls: string[]; // 附件
|
||||||
|
nextTime: Date; // 下次联系时间
|
||||||
|
businessIds: number[]; // 关联的商机编号数组
|
||||||
|
businesses: Business[]; // 关联的商机数组
|
||||||
|
contactIds: number[]; // 关联的联系人编号数组
|
||||||
|
contacts: Contact[]; // 关联的联系人数组
|
||||||
|
creator: string;
|
||||||
|
creatorName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 关联商机信息 */
|
||||||
|
export interface Business {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 关联联系人信息 */
|
||||||
|
export interface Contact {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询跟进记录分页 */
|
||||||
|
export function getFollowUpRecordPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmFollowUpApi.FollowUpRecord>>(
|
||||||
|
'/crm/follow-up-record/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增跟进记录 */
|
||||||
|
export function createFollowUpRecord(data: CrmFollowUpApi.FollowUpRecord) {
|
||||||
|
return requestClient.post('/crm/follow-up-record/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除跟进记录 */
|
||||||
|
export function deleteFollowUpRecord(id: number) {
|
||||||
|
return requestClient.delete(`/crm/follow-up-record/delete?id=${id}`);
|
||||||
|
}
|
||||||
35
apps/web-antd/src/api/crm/operateLog/index.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import type { PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import type { SystemOperateLogApi } from '#/api/system/operate-log';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmOperateLogApi {
|
||||||
|
/** 操作日志信息 */
|
||||||
|
export interface OperateLog {
|
||||||
|
id: number;
|
||||||
|
bizType: number;
|
||||||
|
bizId: number;
|
||||||
|
type: number;
|
||||||
|
content: string;
|
||||||
|
creator: string;
|
||||||
|
creatorName?: string;
|
||||||
|
createTime: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 操作日志查询请求 */
|
||||||
|
export interface OperateLogQueryReqVO {
|
||||||
|
bizType: number;
|
||||||
|
bizId: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得操作日志 */
|
||||||
|
export function getOperateLogPage(
|
||||||
|
params: CrmOperateLogApi.OperateLogQueryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<PageResult<SystemOperateLogApi.OperateLog>>(
|
||||||
|
'/crm/operate-log/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
85
apps/web-antd/src/api/crm/permission/index.ts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmPermissionApi {
|
||||||
|
/** 数据权限信息 */
|
||||||
|
export interface Permission {
|
||||||
|
id?: number; // 数据权限编号
|
||||||
|
ids?: number[];
|
||||||
|
userId?: number; // 用户编号
|
||||||
|
bizType: number; // Crm 类型
|
||||||
|
bizId: number; // Crm 类型数据编号
|
||||||
|
level: number; // 权限级别
|
||||||
|
toBizTypes?: number[]; // 同时添加至
|
||||||
|
deptName?: string; // 部门名称
|
||||||
|
nickname?: string; // 用户昵称
|
||||||
|
postNames?: string[]; // 岗位名称数组
|
||||||
|
createTime?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 数据权限转移请求 */
|
||||||
|
export interface BusinessTransferReqVO {
|
||||||
|
id: number; // 模块编号
|
||||||
|
newOwnerUserId: number; // 新负责人的用户编号
|
||||||
|
oldOwnerPermissionLevel?: number; // 老负责人加入团队后的权限级别
|
||||||
|
toBizTypes?: number[]; // 转移客户时,需要额外有【联系人】【商机】【合同】的 checkbox 选择
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 权限列表请求 */
|
||||||
|
export interface PermissionListReqVO {
|
||||||
|
bizId: number; // 模块数据编号
|
||||||
|
bizType: number; // 模块类型
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 业务类型枚举
|
||||||
|
*/
|
||||||
|
export enum BizTypeEnum {
|
||||||
|
CRM_BUSINESS = 4, // 商机
|
||||||
|
CRM_CLUE = 1, // 线索
|
||||||
|
CRM_CONTACT = 3, // 联系人
|
||||||
|
CRM_CONTRACT = 5, // 合同
|
||||||
|
CRM_CUSTOMER = 2, // 客户
|
||||||
|
CRM_PRODUCT = 6, // 产品
|
||||||
|
CRM_RECEIVABLE = 7, // 回款
|
||||||
|
CRM_RECEIVABLE_PLAN = 8, // 回款计划
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM 数据权限级别枚举
|
||||||
|
*/
|
||||||
|
export enum PermissionLevelEnum {
|
||||||
|
OWNER = 1, // 负责人
|
||||||
|
READ = 2, // 只读
|
||||||
|
WRITE = 3, // 读写
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得数据权限列表(查询团队成员列表) */
|
||||||
|
export function getPermissionList(
|
||||||
|
params: CrmPermissionApi.PermissionListReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmPermissionApi.Permission[]>(
|
||||||
|
'/crm/permission/list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建数据权限(新增团队成员) */
|
||||||
|
export function createPermission(data: CrmPermissionApi.Permission) {
|
||||||
|
return requestClient.post('/crm/permission/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 编辑数据权限(修改团队成员权限级别) */
|
||||||
|
export function updatePermission(data: CrmPermissionApi.Permission) {
|
||||||
|
return requestClient.put('/crm/permission/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除数据权限(删除团队成员) */
|
||||||
|
export function deletePermissionBatch(ids: number[]) {
|
||||||
|
return requestClient.delete(`/crm/permission/delete?ids=${ids.join(',')}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除自己的数据权限(退出团队) */
|
||||||
|
export function deleteSelfPermission(id: number) {
|
||||||
|
return requestClient.delete(`/crm/permission/delete-self?id=${id}`);
|
||||||
|
}
|
||||||
57
apps/web-antd/src/api/crm/product/index.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmProductApi {
|
||||||
|
/** 产品信息 */
|
||||||
|
export interface Product {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
no: string;
|
||||||
|
unit: number;
|
||||||
|
price: number;
|
||||||
|
status: number;
|
||||||
|
categoryId: number;
|
||||||
|
categoryName?: string;
|
||||||
|
description: string;
|
||||||
|
ownerUserId: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品列表 */
|
||||||
|
export function getProductPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmProductApi.Product>>(
|
||||||
|
'/crm/product/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得产品精简列表 */
|
||||||
|
export function getProductSimpleList() {
|
||||||
|
return requestClient.get<CrmProductApi.Product[]>('/crm/product/simple-list');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品详情 */
|
||||||
|
export function getProduct(id: number) {
|
||||||
|
return requestClient.get<CrmProductApi.Product>(`/crm/product/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增产品 */
|
||||||
|
export function createProduct(data: CrmProductApi.Product) {
|
||||||
|
return requestClient.post('/crm/product/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改产品 */
|
||||||
|
export function updateProduct(data: CrmProductApi.Product) {
|
||||||
|
return requestClient.put('/crm/product/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除产品 */
|
||||||
|
export function deleteProduct(id: number) {
|
||||||
|
return requestClient.delete(`/crm/product/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出产品 */
|
||||||
|
export function exportProduct(params: any) {
|
||||||
|
return requestClient.download('/crm/product/export-excel', { params });
|
||||||
|
}
|
||||||
90
apps/web-antd/src/api/crm/receivable/index.ts
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmReceivableApi {
|
||||||
|
/** 回款信息 */
|
||||||
|
export interface Receivable {
|
||||||
|
id: number;
|
||||||
|
no: string;
|
||||||
|
planId?: number;
|
||||||
|
period?: number;
|
||||||
|
customerId?: number;
|
||||||
|
customerName?: string;
|
||||||
|
contractId?: number;
|
||||||
|
contract?: Contract;
|
||||||
|
auditStatus: number;
|
||||||
|
processInstanceId: number;
|
||||||
|
returnTime: Date;
|
||||||
|
returnType: number;
|
||||||
|
price: number;
|
||||||
|
ownerUserId: number;
|
||||||
|
ownerUserName?: string;
|
||||||
|
remark: string;
|
||||||
|
creator: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人名称
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
updateTime: Date; // 更新时间
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 合同信息 */
|
||||||
|
export interface Contract {
|
||||||
|
id?: number;
|
||||||
|
name?: string;
|
||||||
|
no: string;
|
||||||
|
totalPrice: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款列表 */
|
||||||
|
export function getReceivablePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||||
|
'/crm/receivable/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款列表,基于指定客户 */
|
||||||
|
export function getReceivablePageByCustomer(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||||
|
'/crm/receivable/page-by-customer',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款详情 */
|
||||||
|
export function getReceivable(id: number) {
|
||||||
|
return requestClient.get<CrmReceivableApi.Receivable>(
|
||||||
|
`/crm/receivable/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增回款 */
|
||||||
|
export function createReceivable(data: CrmReceivableApi.Receivable) {
|
||||||
|
return requestClient.post('/crm/receivable/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改回款 */
|
||||||
|
export function updateReceivable(data: CrmReceivableApi.Receivable) {
|
||||||
|
return requestClient.put('/crm/receivable/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除回款 */
|
||||||
|
export function deleteReceivable(id: number) {
|
||||||
|
return requestClient.delete(`/crm/receivable/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出回款 */
|
||||||
|
export function exportReceivable(params: any) {
|
||||||
|
return requestClient.download('/crm/receivable/export-excel', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交审核 */
|
||||||
|
export function submitReceivable(id: number) {
|
||||||
|
return requestClient.put(`/crm/receivable/submit?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得待审核回款数量 */
|
||||||
|
export function getAuditReceivableCount() {
|
||||||
|
return requestClient.get<number>('/crm/receivable/audit-count');
|
||||||
|
}
|
||||||
98
apps/web-antd/src/api/crm/receivable/plan/index.ts
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmReceivablePlanApi {
|
||||||
|
/** 回款计划信息 */
|
||||||
|
export interface Plan {
|
||||||
|
id: number;
|
||||||
|
period: number;
|
||||||
|
receivableId: number;
|
||||||
|
price: number;
|
||||||
|
returnTime: Date;
|
||||||
|
remindDays: number;
|
||||||
|
returnType: number;
|
||||||
|
remindTime: Date;
|
||||||
|
customerId: number;
|
||||||
|
customerName?: string;
|
||||||
|
contractId?: number;
|
||||||
|
contractNo?: string;
|
||||||
|
ownerUserId: number;
|
||||||
|
ownerUserName?: string;
|
||||||
|
remark: string;
|
||||||
|
creator: string;
|
||||||
|
creatorName?: string;
|
||||||
|
createTime: Date;
|
||||||
|
updateTime: Date;
|
||||||
|
receivable?: {
|
||||||
|
price: number;
|
||||||
|
returnTime: Date;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款计划列表 */
|
||||||
|
export function getReceivablePlanPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||||
|
'/crm/receivable-plan/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款计划列表(按客户) */
|
||||||
|
export function getReceivablePlanPageByCustomer(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||||
|
'/crm/receivable-plan/page-by-customer',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款计划详情 */
|
||||||
|
export function getReceivablePlan(id: number) {
|
||||||
|
return requestClient.get<CrmReceivablePlanApi.Plan>(
|
||||||
|
'/crm/receivable-plan/get',
|
||||||
|
{ params: { id } },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询回款计划下拉数据 */
|
||||||
|
export function getReceivablePlanSimpleList(
|
||||||
|
customerId: number,
|
||||||
|
contractId: number,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmReceivablePlanApi.Plan[]>(
|
||||||
|
'/crm/receivable-plan/simple-list',
|
||||||
|
{
|
||||||
|
params: { customerId, contractId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增回款计划 */
|
||||||
|
export function createReceivablePlan(data: CrmReceivablePlanApi.Plan) {
|
||||||
|
return requestClient.post('/crm/receivable-plan/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改回款计划 */
|
||||||
|
export function updateReceivablePlan(data: CrmReceivablePlanApi.Plan) {
|
||||||
|
return requestClient.put('/crm/receivable-plan/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除回款计划 */
|
||||||
|
export function deleteReceivablePlan(id: number) {
|
||||||
|
return requestClient.delete('/crm/receivable-plan/delete', {
|
||||||
|
params: { id },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出回款计划 Excel */
|
||||||
|
export function exportReceivablePlan(params: any) {
|
||||||
|
return requestClient.download('/crm/receivable-plan/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得待回款提醒数量 */
|
||||||
|
export function getReceivablePlanRemindCount() {
|
||||||
|
return requestClient.get<number>('/crm/receivable-plan/remind-count');
|
||||||
|
}
|
||||||
277
apps/web-antd/src/api/crm/statistics/customer.ts
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmStatisticsCustomerApi {
|
||||||
|
/** 客户统计请求 */
|
||||||
|
export interface CustomerSummaryReqVO {
|
||||||
|
times: string[];
|
||||||
|
interval: number;
|
||||||
|
deptId: number;
|
||||||
|
userId: number;
|
||||||
|
userIds: number[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户总量分析(按日期)响应 */
|
||||||
|
export interface CustomerSummaryByDateRespVO {
|
||||||
|
time: string;
|
||||||
|
customerCreateCount: number;
|
||||||
|
customerDealCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户总量分析(按用户)响应 */
|
||||||
|
export interface CustomerSummaryByUserRespVO {
|
||||||
|
ownerUserName: string;
|
||||||
|
customerCreateCount: number;
|
||||||
|
customerDealCount: number;
|
||||||
|
contractPrice: number;
|
||||||
|
receivablePrice: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户跟进次数分析(按日期)响应 */
|
||||||
|
export interface FollowUpSummaryByDateRespVO {
|
||||||
|
time: string;
|
||||||
|
followUpRecordCount: number;
|
||||||
|
followUpCustomerCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户跟进次数分析(按用户)响应 */
|
||||||
|
export interface FollowUpSummaryByUserRespVO {
|
||||||
|
ownerUserName: string;
|
||||||
|
followupRecordCount: number;
|
||||||
|
followupCustomerCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户跟进方式统计响应 */
|
||||||
|
export interface FollowUpSummaryByTypeRespVO {
|
||||||
|
followUpType: string;
|
||||||
|
followUpRecordCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 合同摘要信息响应 */
|
||||||
|
export interface CustomerContractSummaryRespVO {
|
||||||
|
customerName: string;
|
||||||
|
contractName: string;
|
||||||
|
totalPrice: number;
|
||||||
|
receivablePrice: number;
|
||||||
|
customerType: string;
|
||||||
|
customerSource: string;
|
||||||
|
ownerUserName: string;
|
||||||
|
creatorUserName: string;
|
||||||
|
createTime: Date;
|
||||||
|
orderDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户公海分析(按日期)响应 */
|
||||||
|
export interface PoolSummaryByDateRespVO {
|
||||||
|
time: string;
|
||||||
|
customerPutCount: number;
|
||||||
|
customerTakeCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户公海分析(按用户)响应 */
|
||||||
|
export interface PoolSummaryByUserRespVO {
|
||||||
|
ownerUserName: string;
|
||||||
|
customerPutCount: number;
|
||||||
|
customerTakeCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户成交周期(按日期)响应 */
|
||||||
|
export interface CustomerDealCycleByDateRespVO {
|
||||||
|
time: string;
|
||||||
|
customerDealCycle: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户成交周期(按用户)响应 */
|
||||||
|
export interface CustomerDealCycleByUserRespVO {
|
||||||
|
ownerUserName: string;
|
||||||
|
customerDealCycle: number;
|
||||||
|
customerDealCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户成交周期(按地区)响应 */
|
||||||
|
export interface CustomerDealCycleByAreaRespVO {
|
||||||
|
areaName: string;
|
||||||
|
customerDealCycle: number;
|
||||||
|
customerDealCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户成交周期(按产品)响应 */
|
||||||
|
export interface CustomerDealCycleByProductRespVO {
|
||||||
|
productName: string;
|
||||||
|
customerDealCycle: number;
|
||||||
|
customerDealCount: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDatas(activeTabName: any, params: any) {
|
||||||
|
switch (activeTabName) {
|
||||||
|
case 'conversionStat': {
|
||||||
|
return getContractSummary(params);
|
||||||
|
}
|
||||||
|
case 'customerSummary': {
|
||||||
|
return getCustomerSummaryByUser(params);
|
||||||
|
}
|
||||||
|
case 'dealCycleByArea': {
|
||||||
|
return getCustomerDealCycleByArea(params);
|
||||||
|
}
|
||||||
|
case 'dealCycleByProduct': {
|
||||||
|
return getCustomerDealCycleByProduct(params);
|
||||||
|
}
|
||||||
|
case 'dealCycleByUser': {
|
||||||
|
return getCustomerDealCycleByUser(params);
|
||||||
|
}
|
||||||
|
case 'followUpSummary': {
|
||||||
|
return getFollowUpSummaryByUser(params);
|
||||||
|
}
|
||||||
|
case 'followUpType': {
|
||||||
|
return getFollowUpSummaryByType(params);
|
||||||
|
}
|
||||||
|
case 'poolSummary': {
|
||||||
|
return getPoolSummaryByUser(params);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getChartDatas(activeTabName: any, params: any) {
|
||||||
|
switch (activeTabName) {
|
||||||
|
case 'conversionStat': {
|
||||||
|
return getCustomerSummaryByDate(params);
|
||||||
|
}
|
||||||
|
case 'customerSummary': {
|
||||||
|
return getCustomerSummaryByDate(params);
|
||||||
|
}
|
||||||
|
case 'dealCycleByArea': {
|
||||||
|
return getCustomerDealCycleByArea(params);
|
||||||
|
}
|
||||||
|
case 'dealCycleByProduct': {
|
||||||
|
return getCustomerDealCycleByProduct(params);
|
||||||
|
}
|
||||||
|
case 'dealCycleByUser': {
|
||||||
|
return getCustomerDealCycleByUser(params);
|
||||||
|
}
|
||||||
|
case 'followUpSummary': {
|
||||||
|
return getFollowUpSummaryByDate(params);
|
||||||
|
}
|
||||||
|
case 'followUpType': {
|
||||||
|
return getFollowUpSummaryByType(params);
|
||||||
|
}
|
||||||
|
case 'poolSummary': {
|
||||||
|
return getPoolSummaryByDate(params);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户总量分析(按日期) */
|
||||||
|
export function getCustomerSummaryByDate(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerSummaryByDateRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-customer-summary-by-date', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户总量分析(按用户) */
|
||||||
|
export function getCustomerSummaryByUser(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerSummaryByUserRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-customer-summary-by-user', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户跟进次数分析(按日期) */
|
||||||
|
export function getFollowUpSummaryByDate(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.FollowUpSummaryByDateRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-follow-up-summary-by-date', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户跟进次数分析(按用户) */
|
||||||
|
export function getFollowUpSummaryByUser(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.FollowUpSummaryByUserRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-follow-up-summary-by-user', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户跟进方式统计数 */
|
||||||
|
export function getFollowUpSummaryByType(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.FollowUpSummaryByTypeRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-follow-up-summary-by-type', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 合同摘要信息(客户转化率页面) */
|
||||||
|
export function getContractSummary(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerContractSummaryRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-contract-summary', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户公海分析(按日期) */
|
||||||
|
export function getPoolSummaryByDate(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmStatisticsCustomerApi.PoolSummaryByDateRespVO[]>(
|
||||||
|
'/crm/statistics-customer/get-pool-summary-by-date',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户公海分析(按用户) */
|
||||||
|
export function getPoolSummaryByUser(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmStatisticsCustomerApi.PoolSummaryByUserRespVO[]>(
|
||||||
|
'/crm/statistics-customer/get-pool-summary-by-user',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户成交周期(按日期) */
|
||||||
|
export function getCustomerDealCycleByDate(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerDealCycleByDateRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-customer-deal-cycle-by-date', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户成交周期(按用户) */
|
||||||
|
export function getCustomerDealCycleByUser(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerDealCycleByUserRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-customer-deal-cycle-by-user', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户成交周期(按地区) */
|
||||||
|
export function getCustomerDealCycleByArea(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerDealCycleByAreaRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-customer-deal-cycle-by-area', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户成交周期(按产品) */
|
||||||
|
export function getCustomerDealCycleByProduct(
|
||||||
|
params: CrmStatisticsCustomerApi.CustomerSummaryReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsCustomerApi.CustomerDealCycleByProductRespVO[]
|
||||||
|
>('/crm/statistics-customer/get-customer-deal-cycle-by-product', { params });
|
||||||
|
}
|
||||||
100
apps/web-antd/src/api/crm/statistics/funnel.ts
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
import type { PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmStatisticsFunnelApi {
|
||||||
|
/** 销售漏斗统计数据响应 */
|
||||||
|
export interface FunnelSummaryRespVO {
|
||||||
|
customerCount: number; // 客户数
|
||||||
|
businessCount: number; // 商机数
|
||||||
|
businessWinCount: number; // 赢单数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机分析(按日期)响应 */
|
||||||
|
export interface BusinessSummaryByDateRespVO {
|
||||||
|
time: string; // 时间
|
||||||
|
businessCreateCount: number; // 商机数
|
||||||
|
totalPrice: number | string; // 商机金额
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 商机转化率分析(按日期)响应 */
|
||||||
|
export interface BusinessInversionRateSummaryByDateRespVO {
|
||||||
|
time: string; // 时间
|
||||||
|
businessCount: number; // 商机数量
|
||||||
|
businessWinCount: number; // 赢单商机数
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDatas(activeTabName: any, params: any) {
|
||||||
|
switch (activeTabName) {
|
||||||
|
case 'businessInversionRateSummary': {
|
||||||
|
return getBusinessPageByDate(params);
|
||||||
|
}
|
||||||
|
case 'businessSummary': {
|
||||||
|
return getBusinessPageByDate(params);
|
||||||
|
}
|
||||||
|
case 'funnel': {
|
||||||
|
return getBusinessSummaryByEndStatus(params);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getChartDatas(activeTabName: any, params: any) {
|
||||||
|
switch (activeTabName) {
|
||||||
|
case 'businessInversionRateSummary': {
|
||||||
|
return getBusinessInversionRateSummaryByDate(params);
|
||||||
|
}
|
||||||
|
case 'businessSummary': {
|
||||||
|
return getBusinessSummaryByDate(params);
|
||||||
|
}
|
||||||
|
case 'funnel': {
|
||||||
|
return getFunnelSummary(params);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取销售漏斗统计数据 */
|
||||||
|
export function getFunnelSummary(params: any) {
|
||||||
|
return requestClient.get<CrmStatisticsFunnelApi.FunnelSummaryRespVO>(
|
||||||
|
'/crm/statistics-funnel/get-funnel-summary',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取商机结束状态统计 */
|
||||||
|
export function getBusinessSummaryByEndStatus(params: any) {
|
||||||
|
return requestClient.get<Record<string, number>>(
|
||||||
|
'/crm/statistics-funnel/get-business-summary-by-end-status',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取新增商机分析(按日期) */
|
||||||
|
export function getBusinessSummaryByDate(params: any) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsFunnelApi.BusinessSummaryByDateRespVO[]
|
||||||
|
>('/crm/statistics-funnel/get-business-summary-by-date', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取商机转化率分析(按日期) */
|
||||||
|
export function getBusinessInversionRateSummaryByDate(params: any) {
|
||||||
|
return requestClient.get<
|
||||||
|
CrmStatisticsFunnelApi.BusinessInversionRateSummaryByDateRespVO[]
|
||||||
|
>('/crm/statistics-funnel/get-business-inversion-rate-summary-by-date', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取商机列表(按日期) */
|
||||||
|
export function getBusinessPageByDate(params: any) {
|
||||||
|
return requestClient.get<PageResult<any>>(
|
||||||
|
'/crm/statistics-funnel/get-business-page-by-date',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
48
apps/web-antd/src/api/crm/statistics/performance.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmStatisticsPerformanceApi {
|
||||||
|
/** 员工业绩统计请求 */
|
||||||
|
export interface PerformanceReqVO {
|
||||||
|
times: string[];
|
||||||
|
deptId: number;
|
||||||
|
userId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 员工业绩统计响应 */
|
||||||
|
export interface PerformanceRespVO {
|
||||||
|
time: string;
|
||||||
|
currentMonthCount: number;
|
||||||
|
lastMonthCount: number;
|
||||||
|
lastYearCount: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 员工获得合同金额统计 */
|
||||||
|
export function getContractPricePerformance(
|
||||||
|
params: CrmStatisticsPerformanceApi.PerformanceReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmStatisticsPerformanceApi.PerformanceRespVO[]>(
|
||||||
|
'/crm/statistics-performance/get-contract-price-performance',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 员工获得回款统计 */
|
||||||
|
export function getReceivablePricePerformance(
|
||||||
|
params: CrmStatisticsPerformanceApi.PerformanceReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmStatisticsPerformanceApi.PerformanceRespVO[]>(
|
||||||
|
'/crm/statistics-performance/get-receivable-price-performance',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 员工获得签约合同数量统计 */
|
||||||
|
export function getContractCountPerformance(
|
||||||
|
params: CrmStatisticsPerformanceApi.PerformanceReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.get<CrmStatisticsPerformanceApi.PerformanceRespVO[]>(
|
||||||
|
'/crm/statistics-performance/get-contract-count-performance',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
89
apps/web-antd/src/api/crm/statistics/portrait.ts
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
import type { PageParam } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmStatisticsPortraitApi {
|
||||||
|
/** 客户基础统计响应 */
|
||||||
|
export interface CustomerBaseRespVO {
|
||||||
|
customerCount: number;
|
||||||
|
dealCount: number;
|
||||||
|
dealPortion: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户行业统计响应 */
|
||||||
|
export interface CustomerIndustryRespVO extends CustomerBaseRespVO {
|
||||||
|
industryId: number;
|
||||||
|
industryPortion: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户来源统计响应 */
|
||||||
|
export interface CustomerSourceRespVO extends CustomerBaseRespVO {
|
||||||
|
source: number;
|
||||||
|
sourcePortion: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户级别统计响应 */
|
||||||
|
export interface CustomerLevelRespVO extends CustomerBaseRespVO {
|
||||||
|
level: number;
|
||||||
|
levelPortion: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 客户地区统计响应 */
|
||||||
|
export interface CustomerAreaRespVO extends CustomerBaseRespVO {
|
||||||
|
areaId: number;
|
||||||
|
areaName: string;
|
||||||
|
areaPortion: number | string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDatas(activeTabName: any, params: any) {
|
||||||
|
switch (activeTabName) {
|
||||||
|
case 'area': {
|
||||||
|
return getCustomerArea(params);
|
||||||
|
}
|
||||||
|
case 'industry': {
|
||||||
|
return getCustomerIndustry(params);
|
||||||
|
}
|
||||||
|
case 'level': {
|
||||||
|
return getCustomerLevel(params);
|
||||||
|
}
|
||||||
|
case 'source': {
|
||||||
|
return getCustomerSource(params);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户行业统计数据 */
|
||||||
|
export function getCustomerIndustry(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsPortraitApi.CustomerIndustryRespVO[]>(
|
||||||
|
'/crm/statistics-portrait/get-customer-industry-summary',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户来源统计数据 */
|
||||||
|
export function getCustomerSource(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsPortraitApi.CustomerSourceRespVO[]>(
|
||||||
|
'/crm/statistics-portrait/get-customer-source-summary',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户级别统计数据 */
|
||||||
|
export function getCustomerLevel(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsPortraitApi.CustomerLevelRespVO[]>(
|
||||||
|
'/crm/statistics-portrait/get-customer-level-summary',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取客户地区统计数据 */
|
||||||
|
export function getCustomerArea(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsPortraitApi.CustomerAreaRespVO[]>(
|
||||||
|
'/crm/statistics-portrait/get-customer-area-summary',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
108
apps/web-antd/src/api/crm/statistics/rank.ts
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
import type { PageParam } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace CrmStatisticsRankApi {
|
||||||
|
/** 排行统计响应 */
|
||||||
|
export interface RankRespVO {
|
||||||
|
count: number;
|
||||||
|
nickname: string;
|
||||||
|
deptName: string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getDatas(activeTabName: any, params: any) {
|
||||||
|
switch (activeTabName) {
|
||||||
|
case 'contactCountRank': {
|
||||||
|
return getContactsCountRank(params);
|
||||||
|
}
|
||||||
|
case 'contractCountRank': {
|
||||||
|
return getContractCountRank(params);
|
||||||
|
}
|
||||||
|
case 'contractPriceRank': {
|
||||||
|
return getContractPriceRank(params);
|
||||||
|
}
|
||||||
|
case 'customerCountRank': {
|
||||||
|
return getCustomerCountRank(params);
|
||||||
|
}
|
||||||
|
case 'followCountRank': {
|
||||||
|
return getFollowCountRank(params);
|
||||||
|
}
|
||||||
|
case 'followCustomerCountRank': {
|
||||||
|
return getFollowCustomerCountRank(params);
|
||||||
|
}
|
||||||
|
case 'productSalesRank': {
|
||||||
|
return getProductSalesRank(params);
|
||||||
|
}
|
||||||
|
case 'receivablePriceRank': {
|
||||||
|
return getReceivablePriceRank(params);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得合同排行榜 */
|
||||||
|
export function getContractPriceRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-contract-price-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得回款排行榜 */
|
||||||
|
export function getReceivablePriceRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-receivable-price-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 签约合同排行 */
|
||||||
|
export function getContractCountRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-contract-count-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 产品销量排行 */
|
||||||
|
export function getProductSalesRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-product-sales-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增客户数排行 */
|
||||||
|
export function getCustomerCountRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-customer-count-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增联系人数排行 */
|
||||||
|
export function getContactsCountRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-contacts-count-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 跟进次数排行 */
|
||||||
|
export function getFollowCountRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-follow-count-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 跟进客户数排行 */
|
||||||
|
export function getFollowCustomerCountRank(params: PageParam) {
|
||||||
|
return requestClient.get<CrmStatisticsRankApi.RankRespVO[]>(
|
||||||
|
'/crm/statistics-rank/get-follow-customer-count-rank',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
61
apps/web-antd/src/api/erp/finance/account/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpAccountApi {
|
||||||
|
/** 结算账户信息 */
|
||||||
|
export interface Account {
|
||||||
|
id?: number; // 结算账户编号
|
||||||
|
no: string; // 账户编码
|
||||||
|
remark: string; // 备注
|
||||||
|
status: number; // 开启状态
|
||||||
|
sort: number; // 排序
|
||||||
|
defaultStatus: boolean; // 是否默认
|
||||||
|
name: string; // 账户名称
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询结算账户分页 */
|
||||||
|
export function getAccountPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpAccountApi.Account>>(
|
||||||
|
'/erp/account/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询结算账户精简列表 */
|
||||||
|
export function getAccountSimpleList() {
|
||||||
|
return requestClient.get<ErpAccountApi.Account[]>('/erp/account/simple-list');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询结算账户详情 */
|
||||||
|
export function getAccount(id: number) {
|
||||||
|
return requestClient.get<ErpAccountApi.Account>(`/erp/account/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增结算账户 */
|
||||||
|
export function createAccount(data: ErpAccountApi.Account) {
|
||||||
|
return requestClient.post('/erp/account/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改结算账户 */
|
||||||
|
export function updateAccount(data: ErpAccountApi.Account) {
|
||||||
|
return requestClient.put('/erp/account/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改结算账户默认状态 */
|
||||||
|
export function updateAccountDefaultStatus(id: number, defaultStatus: boolean) {
|
||||||
|
return requestClient.put('/erp/account/update-default-status', null, {
|
||||||
|
params: { id, defaultStatus },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除结算账户 */
|
||||||
|
export function deleteAccount(id: number) {
|
||||||
|
return requestClient.delete(`/erp/account/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出结算账户 Excel */
|
||||||
|
export function exportAccount(params: any) {
|
||||||
|
return requestClient.download('/erp/account/export-excel', { params });
|
||||||
|
}
|
||||||
95
apps/web-antd/src/api/erp/finance/payment/index.ts
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpFinancePaymentApi {
|
||||||
|
/** 付款单信息 */
|
||||||
|
export interface FinancePayment {
|
||||||
|
id?: number; // 付款单编号
|
||||||
|
no: string; // 付款单号
|
||||||
|
supplierId?: number; // 供应商编号
|
||||||
|
supplierName?: string; // 供应商名称
|
||||||
|
paymentTime?: Date; // 付款时间
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
discountPrice: number; // 优惠金额
|
||||||
|
paymentPrice: number; // 实际付款金额
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
fileUrl?: string; // 附件
|
||||||
|
accountId?: number; // 付款账户
|
||||||
|
accountName?: string; // 账户名称
|
||||||
|
financeUserId?: number; // 财务人员
|
||||||
|
financeUserName?: string; // 财务人员姓名
|
||||||
|
creator?: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人姓名
|
||||||
|
items?: FinancePaymentItem[]; // 付款明细
|
||||||
|
bizNo?: string; // 业务单号
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 付款单项 */
|
||||||
|
export interface FinancePaymentItem {
|
||||||
|
id?: number;
|
||||||
|
row_id?: number; // 前端使用的临时 ID
|
||||||
|
bizId: number; // 业务ID
|
||||||
|
bizType: number; // 业务类型
|
||||||
|
bizNo: string; // 业务编号
|
||||||
|
totalPrice: number; // 应付金额
|
||||||
|
paidPrice: number; // 已付金额
|
||||||
|
paymentPrice: number; // 本次付款
|
||||||
|
remark?: string; // 备注
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询付款单分页 */
|
||||||
|
export function getFinancePaymentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpFinancePaymentApi.FinancePayment>>(
|
||||||
|
'/erp/finance-payment/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询付款单详情 */
|
||||||
|
export function getFinancePayment(id: number) {
|
||||||
|
return requestClient.get<ErpFinancePaymentApi.FinancePayment>(
|
||||||
|
`/erp/finance-payment/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增付款单 */
|
||||||
|
export function createFinancePayment(
|
||||||
|
data: ErpFinancePaymentApi.FinancePayment,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/erp/finance-payment/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改付款单 */
|
||||||
|
export function updateFinancePayment(
|
||||||
|
data: ErpFinancePaymentApi.FinancePayment,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/erp/finance-payment/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新付款单的状态 */
|
||||||
|
export function updateFinancePaymentStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/finance-payment/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除付款单 */
|
||||||
|
export function deleteFinancePayment(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/finance-payment/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出付款单 Excel */
|
||||||
|
export function exportFinancePayment(params: any) {
|
||||||
|
return requestClient.download('/erp/finance-payment/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
95
apps/web-antd/src/api/erp/finance/receipt/index.ts
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpFinanceReceiptApi {
|
||||||
|
/** 收款单项 */
|
||||||
|
export interface FinanceReceiptItem {
|
||||||
|
id?: number;
|
||||||
|
row_id?: number; // 前端使用的临时 ID
|
||||||
|
bizId: number; // 业务ID
|
||||||
|
bizType: number; // 业务类型
|
||||||
|
bizNo: string; // 业务编号
|
||||||
|
totalPrice: number; // 应收金额
|
||||||
|
receiptedPrice: number; // 已收金额
|
||||||
|
receiptPrice: number; // 本次收款
|
||||||
|
remark?: string; // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 收款单信息 */
|
||||||
|
export interface FinanceReceipt {
|
||||||
|
id?: number; // 收款单编号
|
||||||
|
no: string; // 收款单号
|
||||||
|
customerId: number; // 客户编号
|
||||||
|
customerName?: string; // 客户名称
|
||||||
|
receiptTime: Date; // 收款时间
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
discountPrice: number; // 优惠金额
|
||||||
|
receiptPrice: number; // 实际收款金额
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
fileUrl?: string; // 附件
|
||||||
|
accountId?: number; // 收款账户
|
||||||
|
accountName?: string; // 账户名称
|
||||||
|
financeUserId?: number; // 财务人员
|
||||||
|
financeUserName?: string; // 财务人员姓名
|
||||||
|
creator?: string; // 创建人
|
||||||
|
creatorName?: string; // 创建人姓名
|
||||||
|
items?: FinanceReceiptItem[]; // 收款明细
|
||||||
|
bizNo?: string; // 业务单号
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询收款单分页 */
|
||||||
|
export function getFinanceReceiptPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpFinanceReceiptApi.FinanceReceipt>>(
|
||||||
|
'/erp/finance-receipt/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询收款单详情 */
|
||||||
|
export function getFinanceReceipt(id: number) {
|
||||||
|
return requestClient.get<ErpFinanceReceiptApi.FinanceReceipt>(
|
||||||
|
`/erp/finance-receipt/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增收款单 */
|
||||||
|
export function createFinanceReceipt(
|
||||||
|
data: ErpFinanceReceiptApi.FinanceReceipt,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/erp/finance-receipt/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改收款单 */
|
||||||
|
export function updateFinanceReceipt(
|
||||||
|
data: ErpFinanceReceiptApi.FinanceReceipt,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/erp/finance-receipt/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新收款单的状态 */
|
||||||
|
export function updateFinanceReceiptStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/finance-receipt/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除收款单 */
|
||||||
|
export function deleteFinanceReceipt(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/finance-receipt/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出收款单 Excel */
|
||||||
|
export function exportFinanceReceipt(params: any) {
|
||||||
|
return requestClient.download('/erp/finance-receipt/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
62
apps/web-antd/src/api/erp/product/category/index.ts
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpProductCategoryApi {
|
||||||
|
/** 产品分类信息 */
|
||||||
|
export interface ProductCategory {
|
||||||
|
id?: number; // 分类编号
|
||||||
|
parentId?: number; // 父分类编号
|
||||||
|
name: string; // 分类名称
|
||||||
|
code?: string; // 分类编码
|
||||||
|
sort?: number; // 分类排序
|
||||||
|
status?: number; // 开启状态
|
||||||
|
children?: ProductCategory[]; // 子分类
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品分类列表 */
|
||||||
|
export function getProductCategoryList(params?: any) {
|
||||||
|
return requestClient.get<ErpProductCategoryApi.ProductCategory[]>(
|
||||||
|
'/erp/product-category/list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品分类精简列表 */
|
||||||
|
export function getProductCategorySimpleList() {
|
||||||
|
return requestClient.get<ErpProductCategoryApi.ProductCategory[]>(
|
||||||
|
'/erp/product-category/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品分类详情 */
|
||||||
|
export function getProductCategory(id: number) {
|
||||||
|
return requestClient.get<ErpProductCategoryApi.ProductCategory>(
|
||||||
|
`/erp/product-category/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增产品分类 */
|
||||||
|
export function createProductCategory(
|
||||||
|
data: ErpProductCategoryApi.ProductCategory,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/erp/product-category/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改产品分类 */
|
||||||
|
export function updateProductCategory(
|
||||||
|
data: ErpProductCategoryApi.ProductCategory,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/erp/product-category/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除产品分类 */
|
||||||
|
export function deleteProductCategory(id: number) {
|
||||||
|
return requestClient.delete(`/erp/product-category/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出产品分类 Excel */
|
||||||
|
export function exportProductCategory(params: any) {
|
||||||
|
return requestClient.download('/erp/product-category/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
61
apps/web-antd/src/api/erp/product/product/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpProductApi {
|
||||||
|
/** 产品信息 */
|
||||||
|
export interface Product {
|
||||||
|
id?: number; // 产品编号
|
||||||
|
name: string; // 产品名称
|
||||||
|
barCode: string; // 产品条码
|
||||||
|
categoryId: number; // 产品类型编号
|
||||||
|
unitId: number; // 单位编号
|
||||||
|
unitName?: string; // 单位名字
|
||||||
|
status: number; // 产品状态
|
||||||
|
standard: string; // 产品规格
|
||||||
|
remark: string; // 产品备注
|
||||||
|
expiryDay: number; // 保质期天数
|
||||||
|
weight: number; // 重量(kg)
|
||||||
|
purchasePrice: number; // 采购价格,单位:元
|
||||||
|
salePrice: number; // 销售价格,单位:元
|
||||||
|
minPrice: number; // 最低价格,单位:元
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品分页 */
|
||||||
|
export function getProductPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpProductApi.Product>>(
|
||||||
|
'/erp/product/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品精简列表 */
|
||||||
|
export function getProductSimpleList() {
|
||||||
|
return requestClient.get<ErpProductApi.Product[]>('/erp/product/simple-list');
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品详情 */
|
||||||
|
export function getProduct(id: number) {
|
||||||
|
return requestClient.get<ErpProductApi.Product>(`/erp/product/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增产品 */
|
||||||
|
export function createProduct(data: ErpProductApi.Product) {
|
||||||
|
return requestClient.post('/erp/product/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改产品 */
|
||||||
|
export function updateProduct(data: ErpProductApi.Product) {
|
||||||
|
return requestClient.put('/erp/product/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除产品 */
|
||||||
|
export function deleteProduct(id: number) {
|
||||||
|
return requestClient.delete(`/erp/product/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出产品 Excel */
|
||||||
|
export function exportProduct(params: any) {
|
||||||
|
return requestClient.download('/erp/product/export-excel', { params });
|
||||||
|
}
|
||||||
54
apps/web-antd/src/api/erp/product/unit/index.ts
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpProductUnitApi {
|
||||||
|
/** 产品单位信息 */
|
||||||
|
export interface ProductUnit {
|
||||||
|
id?: number; // 单位编号
|
||||||
|
name: string; // 单位名字
|
||||||
|
status: number; // 单位状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品单位分页 */
|
||||||
|
export function getProductUnitPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpProductUnitApi.ProductUnit>>(
|
||||||
|
'/erp/product-unit/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品单位精简列表 */
|
||||||
|
export function getProductUnitSimpleList() {
|
||||||
|
return requestClient.get<ErpProductUnitApi.ProductUnit[]>(
|
||||||
|
'/erp/product-unit/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品单位详情 */
|
||||||
|
export function getProductUnit(id: number) {
|
||||||
|
return requestClient.get<ErpProductUnitApi.ProductUnit>(
|
||||||
|
`/erp/product-unit/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增产品单位 */
|
||||||
|
export function createProductUnit(data: ErpProductUnitApi.ProductUnit) {
|
||||||
|
return requestClient.post('/erp/product-unit/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改产品单位 */
|
||||||
|
export function updateProductUnit(data: ErpProductUnitApi.ProductUnit) {
|
||||||
|
return requestClient.put('/erp/product-unit/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除产品单位 */
|
||||||
|
export function deleteProductUnit(id: number) {
|
||||||
|
return requestClient.delete(`/erp/product-unit/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出产品单位 Excel */
|
||||||
|
export function exportProductUnit(params: any) {
|
||||||
|
return requestClient.download('/erp/product-unit/export-excel', { params });
|
||||||
|
}
|
||||||
100
apps/web-antd/src/api/erp/purchase/in/index.ts
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpPurchaseInApi {
|
||||||
|
/** 采购入库信息 */
|
||||||
|
export interface PurchaseIn {
|
||||||
|
id?: number; // 入库工单编号
|
||||||
|
no?: string; // 采购入库号
|
||||||
|
supplierId?: number; // 供应商编号
|
||||||
|
inTime?: Date; // 入库时间
|
||||||
|
totalCount?: number; // 合计数量
|
||||||
|
totalPrice?: number; // 合计金额,单位:元
|
||||||
|
status?: number; // 状态
|
||||||
|
remark?: string; // 备注
|
||||||
|
outCount?: number; // 采购出库数量
|
||||||
|
returnCount?: number; // 采购退货数量
|
||||||
|
discountPercent?: number; // 折扣百分比
|
||||||
|
discountPrice?: number; // 折扣金额
|
||||||
|
paymentPrice?: number; // 实际支付金额
|
||||||
|
otherPrice?: number; // 其他费用
|
||||||
|
totalProductPrice?: number; // 合计商品金额
|
||||||
|
taxPrice?: number; // 合计税额
|
||||||
|
items?: PurchaseInItem[]; // 采购入库明细
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 采购项信息 */
|
||||||
|
export interface PurchaseInItem {
|
||||||
|
count?: number;
|
||||||
|
id?: number;
|
||||||
|
orderItemId?: number;
|
||||||
|
productBarCode?: string;
|
||||||
|
productId?: number;
|
||||||
|
productName: string;
|
||||||
|
productPrice: number;
|
||||||
|
productUnitId?: number;
|
||||||
|
productUnitName?: string;
|
||||||
|
totalProductPrice?: number;
|
||||||
|
remark: string;
|
||||||
|
stockCount?: number;
|
||||||
|
taxPercent?: number;
|
||||||
|
taxPrice?: number;
|
||||||
|
totalPrice?: number;
|
||||||
|
warehouseId?: number;
|
||||||
|
inCount?: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询采购入库分页 */
|
||||||
|
export function getPurchaseInPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpPurchaseInApi.PurchaseIn>>(
|
||||||
|
'/erp/purchase-in/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询采购入库详情 */
|
||||||
|
export function getPurchaseIn(id: number) {
|
||||||
|
return requestClient.get<ErpPurchaseInApi.PurchaseIn>(
|
||||||
|
`/erp/purchase-in/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增采购入库 */
|
||||||
|
export function createPurchaseIn(data: ErpPurchaseInApi.PurchaseIn) {
|
||||||
|
return requestClient.post('/erp/purchase-in/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改采购入库 */
|
||||||
|
export function updatePurchaseIn(data: ErpPurchaseInApi.PurchaseIn) {
|
||||||
|
return requestClient.put('/erp/purchase-in/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新采购入库的状态 */
|
||||||
|
export function updatePurchaseInStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/purchase-in/update-status', null, {
|
||||||
|
params: {
|
||||||
|
id,
|
||||||
|
status,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除采购入库 */
|
||||||
|
export function deletePurchaseIn(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/purchase-in/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出采购入库 Excel */
|
||||||
|
export function exportPurchaseIn(params: any) {
|
||||||
|
return requestClient.download('/erp/purchase-in/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
97
apps/web-antd/src/api/erp/purchase/order/index.ts
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpPurchaseOrderApi {
|
||||||
|
/** 采购订单信息 */
|
||||||
|
export interface PurchaseOrder {
|
||||||
|
id?: number; // 订单工单编号
|
||||||
|
no?: string; // 采购订单号
|
||||||
|
supplierId?: number; // 供应商编号
|
||||||
|
supplierName?: string; // 供应商名称
|
||||||
|
orderTime?: Date | string; // 订单时间
|
||||||
|
totalCount?: number; // 合计数量
|
||||||
|
totalPrice?: number; // 合计金额,单位:元
|
||||||
|
totalProductPrice?: number; // 产品金额,单位:元
|
||||||
|
discountPercent?: number; // 优惠率,百分比
|
||||||
|
discountPrice?: number; // 优惠金额,单位:元
|
||||||
|
depositPrice?: number; // 定金金额,单位:元
|
||||||
|
accountId?: number; // 结算账户编号
|
||||||
|
status?: number; // 状态
|
||||||
|
remark?: string; // 备注
|
||||||
|
fileUrl?: string; // 附件地址
|
||||||
|
inCount?: number; // 采购入库数量
|
||||||
|
count?: number; // 数量
|
||||||
|
returnCount?: number; // 采购退货数量
|
||||||
|
inStatus?: number; // 入库状态
|
||||||
|
returnStatus?: number; // 退货状态
|
||||||
|
productNames?: string; // 产品名称列表
|
||||||
|
creatorName?: string; // 创建人名称
|
||||||
|
createTime?: Date; // 创建时间
|
||||||
|
items?: PurchaseOrderItem[]; // 订单项列表
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 采购订单项信息 */
|
||||||
|
export interface PurchaseOrderItem {
|
||||||
|
id?: number; // 订单项编号
|
||||||
|
orderId?: number; // 采购订单编号
|
||||||
|
productId?: number; // 产品编号
|
||||||
|
productName?: string; // 产品名称
|
||||||
|
productBarCode?: string; // 产品条码
|
||||||
|
productUnitId?: number; // 产品单位编号
|
||||||
|
productUnitName?: string; // 产品单位名称
|
||||||
|
productPrice?: number; // 产品单价,单位:元
|
||||||
|
totalProductPrice?: number; // 产品总价,单位:元
|
||||||
|
count?: number; // 数量
|
||||||
|
totalPrice?: number; // 总价,单位:元
|
||||||
|
taxPercent?: number; // 税率,百分比
|
||||||
|
taxPrice?: number; // 税额,单位:元
|
||||||
|
totalTaxPrice?: number; // 含税总价,单位:元
|
||||||
|
remark?: string; // 备注
|
||||||
|
stockCount?: number; // 库存数量(显示字段)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询采购订单分页 */
|
||||||
|
export function getPurchaseOrderPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpPurchaseOrderApi.PurchaseOrder>>(
|
||||||
|
'/erp/purchase-order/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询采购订单详情 */
|
||||||
|
export function getPurchaseOrder(id: number) {
|
||||||
|
return requestClient.get<ErpPurchaseOrderApi.PurchaseOrder>(
|
||||||
|
`/erp/purchase-order/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增采购订单 */
|
||||||
|
export function createPurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) {
|
||||||
|
return requestClient.post('/erp/purchase-order/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改采购订单 */
|
||||||
|
export function updatePurchaseOrder(data: ErpPurchaseOrderApi.PurchaseOrder) {
|
||||||
|
return requestClient.put('/erp/purchase-order/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新采购订单的状态 */
|
||||||
|
export function updatePurchaseOrderStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/purchase-order/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除采购订单 */
|
||||||
|
export function deletePurchaseOrder(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/purchase-order/delete', {
|
||||||
|
params: { ids: ids.join(',') },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出采购订单 Excel */
|
||||||
|
export function exportPurchaseOrder(params: any) {
|
||||||
|
return requestClient.download('/erp/purchase-order/export-excel', { params });
|
||||||
|
}
|
||||||
96
apps/web-antd/src/api/erp/purchase/return/index.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
import type { PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpPurchaseReturnApi {
|
||||||
|
/** 采购退货信息 */
|
||||||
|
export interface PurchaseReturn {
|
||||||
|
id?: number; // 采购退货编号
|
||||||
|
no?: string; // 采购退货号
|
||||||
|
supplierId?: number; // 供应商编号
|
||||||
|
returnTime?: Date; // 退货时间
|
||||||
|
totalCount?: number; // 合计数量
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
discountPercent?: number; // 折扣百分比
|
||||||
|
discountPrice?: number; // 折扣金额
|
||||||
|
status?: number; // 状态
|
||||||
|
remark?: string; // 备注
|
||||||
|
totalTaxPrice?: number; // 合计税额
|
||||||
|
otherPrice?: number; // 其他费用
|
||||||
|
items?: PurchaseReturnItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 采购退货项 */
|
||||||
|
export interface PurchaseReturnItem {
|
||||||
|
count?: number;
|
||||||
|
id?: number;
|
||||||
|
orderItemId?: number;
|
||||||
|
productBarCode?: string;
|
||||||
|
productId?: number;
|
||||||
|
productName: string;
|
||||||
|
productPrice: number;
|
||||||
|
productUnitId?: number;
|
||||||
|
productUnitName?: string;
|
||||||
|
totalProductPrice?: number;
|
||||||
|
remark: string;
|
||||||
|
stockCount?: number;
|
||||||
|
taxPercent?: number;
|
||||||
|
taxPrice?: number;
|
||||||
|
totalPrice?: number;
|
||||||
|
warehouseId?: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询采购退货分页 */
|
||||||
|
export function getPurchaseReturnPage(params: any) {
|
||||||
|
return requestClient.get<PageResult<ErpPurchaseReturnApi.PurchaseReturn>>(
|
||||||
|
'/erp/purchase-return/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询采购退货详情 */
|
||||||
|
export function getPurchaseReturn(id: number) {
|
||||||
|
return requestClient.get<ErpPurchaseReturnApi.PurchaseReturn>(
|
||||||
|
`/erp/purchase-return/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增采购退货 */
|
||||||
|
export function createPurchaseReturn(
|
||||||
|
data: ErpPurchaseReturnApi.PurchaseReturn,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/erp/purchase-return/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改采购退货 */
|
||||||
|
export function updatePurchaseReturn(
|
||||||
|
data: ErpPurchaseReturnApi.PurchaseReturn,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/erp/purchase-return/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新采购退货的状态 */
|
||||||
|
export function updatePurchaseReturnStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/purchase-return/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除采购退货 */
|
||||||
|
export function deletePurchaseReturn(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/purchase-return/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出采购退货 Excel */
|
||||||
|
export function exportPurchaseReturn(params: any) {
|
||||||
|
return requestClient.download('/erp/purchase-return/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
66
apps/web-antd/src/api/erp/purchase/supplier/index.ts
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpSupplierApi {
|
||||||
|
/** 供应商信息 */
|
||||||
|
export interface Supplier {
|
||||||
|
id?: number; // 供应商编号
|
||||||
|
name: string; // 供应商名称
|
||||||
|
contact: string; // 联系人
|
||||||
|
mobile: string; // 手机号码
|
||||||
|
telephone: string; // 联系电话
|
||||||
|
email: string; // 电子邮箱
|
||||||
|
fax: string; // 传真
|
||||||
|
remark: string; // 备注
|
||||||
|
status: number; // 开启状态
|
||||||
|
sort: number; // 排序
|
||||||
|
taxNo: string; // 纳税人识别号
|
||||||
|
taxPercent: number; // 税率
|
||||||
|
bankName: string; // 开户行
|
||||||
|
bankAccount: string; // 开户账号
|
||||||
|
bankAddress: string; // 开户地址
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询供应商分页 */
|
||||||
|
export function getSupplierPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpSupplierApi.Supplier>>(
|
||||||
|
'/erp/supplier/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得供应商精简列表 */
|
||||||
|
export function getSupplierSimpleList() {
|
||||||
|
return requestClient.get<ErpSupplierApi.Supplier[]>(
|
||||||
|
'/erp/supplier/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询供应商详情 */
|
||||||
|
export function getSupplier(id: number) {
|
||||||
|
return requestClient.get<ErpSupplierApi.Supplier>(
|
||||||
|
`/erp/supplier/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增供应商 */
|
||||||
|
export function createSupplier(data: ErpSupplierApi.Supplier) {
|
||||||
|
return requestClient.post('/erp/supplier/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改供应商 */
|
||||||
|
export function updateSupplier(data: ErpSupplierApi.Supplier) {
|
||||||
|
return requestClient.put('/erp/supplier/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除供应商 */
|
||||||
|
export function deleteSupplier(id: number) {
|
||||||
|
return requestClient.delete(`/erp/supplier/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出供应商 Excel */
|
||||||
|
export function exportSupplier(params: any) {
|
||||||
|
return requestClient.download('/erp/supplier/export-excel', { params });
|
||||||
|
}
|
||||||
66
apps/web-antd/src/api/erp/sale/customer/index.ts
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpCustomerApi {
|
||||||
|
/** 客户信息 */
|
||||||
|
export interface Customer {
|
||||||
|
id?: number; // 客户编号
|
||||||
|
name: string; // 客户名称
|
||||||
|
contact: string; // 联系人
|
||||||
|
mobile: string; // 手机号码
|
||||||
|
telephone: string; // 联系电话
|
||||||
|
email: string; // 电子邮箱
|
||||||
|
fax: string; // 传真
|
||||||
|
remark: string; // 备注
|
||||||
|
status: number; // 开启状态
|
||||||
|
sort: number; // 排序
|
||||||
|
taxNo: string; // 纳税人识别号
|
||||||
|
taxPercent: number; // 税率
|
||||||
|
bankName: string; // 开户行
|
||||||
|
bankAccount: string; // 开户账号
|
||||||
|
bankAddress: string; // 开户地址
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询客户分页 */
|
||||||
|
export function getCustomerPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpCustomerApi.Customer>>(
|
||||||
|
'/erp/customer/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询客户精简列表 */
|
||||||
|
export function getCustomerSimpleList() {
|
||||||
|
return requestClient.get<ErpCustomerApi.Customer[]>(
|
||||||
|
'/erp/customer/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询客户详情 */
|
||||||
|
export function getCustomer(id: number) {
|
||||||
|
return requestClient.get<ErpCustomerApi.Customer>(
|
||||||
|
`/erp/customer/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增客户 */
|
||||||
|
export function createCustomer(data: ErpCustomerApi.Customer) {
|
||||||
|
return requestClient.post('/erp/customer/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改客户 */
|
||||||
|
export function updateCustomer(data: ErpCustomerApi.Customer) {
|
||||||
|
return requestClient.put('/erp/customer/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除客户 */
|
||||||
|
export function deleteCustomer(id: number) {
|
||||||
|
return requestClient.delete(`/erp/customer/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出客户 Excel */
|
||||||
|
export function exportCustomer(params: any) {
|
||||||
|
return requestClient.download('/erp/customer/export-excel', { params });
|
||||||
|
}
|
||||||
98
apps/web-antd/src/api/erp/sale/order/index.ts
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpSaleOrderApi {
|
||||||
|
/** 销售订单信息 */
|
||||||
|
export interface SaleOrder {
|
||||||
|
id?: number; // 订单工单编号
|
||||||
|
no: string; // 销售订单号
|
||||||
|
customerId: number; // 客户编号
|
||||||
|
accountId?: number; // 收款账户编号
|
||||||
|
orderTime: Date; // 订单时间
|
||||||
|
totalCount: number; // 合计数量
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
outCount: number; // 销售出库数量
|
||||||
|
fileUrl?: string; // 附件地址
|
||||||
|
inCount?: number; // 采购入库数量
|
||||||
|
returnCount: number; // 销售退货数量
|
||||||
|
totalProductPrice?: number; // 产品金额,单位:元
|
||||||
|
discountPercent?: number; // 优惠率,百分比
|
||||||
|
discountPrice?: number; // 优惠金额,单位:元
|
||||||
|
depositPrice?: number; // 定金金额,单位:元
|
||||||
|
items?: SaleOrderItem[]; // 销售订单产品明细列表
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 销售订单项 */
|
||||||
|
export interface SaleOrderItem {
|
||||||
|
id?: number; // 订单项编号
|
||||||
|
orderId?: number; // 采购订单编号
|
||||||
|
productId?: number; // 产品编号
|
||||||
|
productName?: string; // 产品名称
|
||||||
|
productBarCode?: string; // 产品条码
|
||||||
|
productUnitId?: number; // 产品单位编号
|
||||||
|
productUnitName?: string; // 产品单位名称
|
||||||
|
productPrice?: number; // 产品单价,单位:元
|
||||||
|
totalProductPrice?: number; // 产品总价,单位:元
|
||||||
|
count?: number; // 数量
|
||||||
|
totalPrice?: number; // 总价,单位:元
|
||||||
|
taxPercent?: number; // 税率,百分比
|
||||||
|
taxPrice?: number; // 税额,单位:元
|
||||||
|
totalTaxPrice?: number; // 含税总价,单位:元
|
||||||
|
remark?: string; // 备注
|
||||||
|
stockCount?: number; // 库存数量(显示字段)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售订单分页 */
|
||||||
|
export function getSaleOrderPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpSaleOrderApi.SaleOrder>>(
|
||||||
|
'/erp/sale-order/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售订单详情 */
|
||||||
|
export function getSaleOrder(id: number) {
|
||||||
|
return requestClient.get<ErpSaleOrderApi.SaleOrder>(
|
||||||
|
`/erp/sale-order/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售订单项列表 */
|
||||||
|
export function getSaleOrderItemListByOrderId(orderId: number) {
|
||||||
|
return requestClient.get<ErpSaleOrderApi.SaleOrderItem[]>(
|
||||||
|
`/erp/sale-order/item/list-by-order-id?orderId=${orderId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增销售订单 */
|
||||||
|
export function createSaleOrder(data: ErpSaleOrderApi.SaleOrder) {
|
||||||
|
return requestClient.post('/erp/sale-order/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改销售订单 */
|
||||||
|
export function updateSaleOrder(data: ErpSaleOrderApi.SaleOrder) {
|
||||||
|
return requestClient.put('/erp/sale-order/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新销售订单的状态 */
|
||||||
|
export function updateSaleOrderStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/sale-order/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除销售订单 */
|
||||||
|
export function deleteSaleOrder(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/sale-order/delete', {
|
||||||
|
params: { ids: ids.join(',') },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出销售订单 Excel */
|
||||||
|
export function exportSaleOrder(params: any) {
|
||||||
|
return requestClient.download('/erp/sale-order/export-excel', { params });
|
||||||
|
}
|
||||||
95
apps/web-antd/src/api/erp/sale/out/index.ts
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpSaleOutApi {
|
||||||
|
/** 销售出库信息 */
|
||||||
|
export interface SaleOut {
|
||||||
|
id?: number; // 销售出库编号
|
||||||
|
no?: string; // 销售出库号
|
||||||
|
customerId?: number; // 客户编号
|
||||||
|
saleUserId?: number; // 客户编号
|
||||||
|
outTime?: Date; // 出库时间
|
||||||
|
totalCount?: number; // 合计数量
|
||||||
|
totalPrice?: number; // 合计金额,单位:元
|
||||||
|
status?: number; // 状态
|
||||||
|
remark?: string; // 备注
|
||||||
|
discountPercent?: number; // 折扣百分比
|
||||||
|
discountPrice?: number; // 折扣金额
|
||||||
|
otherPrice?: number; // 其他费用
|
||||||
|
totalProductPrice?: number; // 合计商品金额
|
||||||
|
taxPrice?: number; // 合计税额
|
||||||
|
totalTaxPrice?: number; // 合计税额
|
||||||
|
fileUrl?: string; // 附件地址
|
||||||
|
items?: SaleOutItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 销售出库项 */
|
||||||
|
export interface SaleOutItem {
|
||||||
|
count?: number;
|
||||||
|
id?: number;
|
||||||
|
orderItemId?: number;
|
||||||
|
productBarCode?: string;
|
||||||
|
productId?: number;
|
||||||
|
productName: string;
|
||||||
|
productPrice: number;
|
||||||
|
productUnitId?: number;
|
||||||
|
productUnitName?: string;
|
||||||
|
totalProductPrice?: number;
|
||||||
|
remark: string;
|
||||||
|
stockCount?: number;
|
||||||
|
taxPercent?: number;
|
||||||
|
taxPrice?: number;
|
||||||
|
totalPrice?: number;
|
||||||
|
warehouseId?: number;
|
||||||
|
outCount?: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售出库分页 */
|
||||||
|
export function getSaleOutPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpSaleOutApi.SaleOut>>(
|
||||||
|
'/erp/sale-out/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售出库详情 */
|
||||||
|
export function getSaleOut(id: number) {
|
||||||
|
return requestClient.get<ErpSaleOutApi.SaleOut>(`/erp/sale-out/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增销售出库 */
|
||||||
|
export function createSaleOut(data: ErpSaleOutApi.SaleOut) {
|
||||||
|
return requestClient.post('/erp/sale-out/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改销售出库 */
|
||||||
|
export function updateSaleOut(data: ErpSaleOutApi.SaleOut) {
|
||||||
|
return requestClient.put('/erp/sale-out/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新销售出库的状态 */
|
||||||
|
export function updateSaleOutStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/sale-out/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除销售出库 */
|
||||||
|
export function deleteSaleOut(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/sale-out/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出销售出库 Excel */
|
||||||
|
export function exportSaleOut(params: any) {
|
||||||
|
return requestClient.download('/erp/sale-out/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
96
apps/web-antd/src/api/erp/sale/return/index.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpSaleReturnApi {
|
||||||
|
/** 销售退货信息 */
|
||||||
|
export interface SaleReturn {
|
||||||
|
id?: number; // 销售退货编号
|
||||||
|
no?: string; // 销售退货号
|
||||||
|
customerId?: number; // 客户编号
|
||||||
|
returnTime?: Date; // 退货时间
|
||||||
|
totalCount?: number; // 合计数量
|
||||||
|
totalPrice?: number; // 合计金额,单位:元
|
||||||
|
status?: number; // 状态
|
||||||
|
remark?: string; // 备注
|
||||||
|
discountPercent?: number; // 折扣百分比
|
||||||
|
discountPrice?: number; // 折扣金额
|
||||||
|
otherPrice?: number; // 其他费用
|
||||||
|
totalProductPrice?: number; // 合计商品金额
|
||||||
|
taxPrice?: number; // 合计税额
|
||||||
|
totalTaxPrice?: number; // 合计税额
|
||||||
|
fileUrl?: string; // 附件地址
|
||||||
|
items?: SaleReturnItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 销售退货项 */
|
||||||
|
export interface SaleReturnItem {
|
||||||
|
count?: number;
|
||||||
|
id?: number;
|
||||||
|
orderItemId?: number;
|
||||||
|
productBarCode?: string;
|
||||||
|
productId?: number;
|
||||||
|
productName: string;
|
||||||
|
productPrice: number;
|
||||||
|
productUnitId?: number;
|
||||||
|
productUnitName?: string;
|
||||||
|
totalProductPrice?: number;
|
||||||
|
remark: string;
|
||||||
|
stockCount?: number;
|
||||||
|
taxPercent?: number;
|
||||||
|
taxPrice?: number;
|
||||||
|
totalPrice?: number;
|
||||||
|
warehouseId?: number;
|
||||||
|
returnCount?: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售退货分页 */
|
||||||
|
export function getSaleReturnPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpSaleReturnApi.SaleReturn>>(
|
||||||
|
'/erp/sale-return/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询销售退货详情 */
|
||||||
|
export function getSaleReturn(id: number) {
|
||||||
|
return requestClient.get<ErpSaleReturnApi.SaleReturn>(
|
||||||
|
`/erp/sale-return/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增销售退货 */
|
||||||
|
export function createSaleReturn(data: ErpSaleReturnApi.SaleReturn) {
|
||||||
|
return requestClient.post('/erp/sale-return/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改销售退货 */
|
||||||
|
export function updateSaleReturn(data: ErpSaleReturnApi.SaleReturn) {
|
||||||
|
return requestClient.put('/erp/sale-return/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新销售退货的状态 */
|
||||||
|
export function updateSaleReturnStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/sale-return/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除销售退货 */
|
||||||
|
export function deleteSaleReturn(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/sale-return/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出销售退货 Excel */
|
||||||
|
export function exportSaleReturn(params: any) {
|
||||||
|
return requestClient.download('/erp/sale-return/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
31
apps/web-antd/src/api/erp/statistics/purchase/index.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpPurchaseStatisticsApi {
|
||||||
|
/** 采购全局统计 */
|
||||||
|
export interface PurchaseSummaryRespVO {
|
||||||
|
todayPrice: number; // 今日采购金额
|
||||||
|
yesterdayPrice: number; // 昨日采购金额
|
||||||
|
monthPrice: number; // 本月采购金额
|
||||||
|
yearPrice: number; // 今年采购金额
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 采购时间段统计 */
|
||||||
|
export interface PurchaseTimeSummaryRespVO {
|
||||||
|
time: string; // 时间
|
||||||
|
price: number; // 采购金额
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得采购统计 */
|
||||||
|
export function getPurchaseSummary() {
|
||||||
|
return requestClient.get<ErpPurchaseStatisticsApi.PurchaseSummaryRespVO>(
|
||||||
|
'/erp/purchase-statistics/summary',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得采购时间段统计 */
|
||||||
|
export function getPurchaseTimeSummary() {
|
||||||
|
return requestClient.get<
|
||||||
|
ErpPurchaseStatisticsApi.PurchaseTimeSummaryRespVO[]
|
||||||
|
>('/erp/purchase-statistics/time-summary');
|
||||||
|
}
|
||||||
31
apps/web-antd/src/api/erp/statistics/sale/index.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpSaleStatisticsApi {
|
||||||
|
/** 销售全局统计 */
|
||||||
|
export interface SaleSummaryRespVO {
|
||||||
|
todayPrice: number; // 今日销售金额
|
||||||
|
yesterdayPrice: number; // 昨日销售金额
|
||||||
|
monthPrice: number; // 本月销售金额
|
||||||
|
yearPrice: number; // 今年销售金额
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 销售时间段统计 */
|
||||||
|
export interface SaleTimeSummaryRespVO {
|
||||||
|
time: string; // 时间
|
||||||
|
price: number; // 销售金额
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得销售统计 */
|
||||||
|
export function getSaleSummary() {
|
||||||
|
return requestClient.get<ErpSaleStatisticsApi.SaleSummaryRespVO>(
|
||||||
|
'/erp/sale-statistics/summary',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得销售时间段统计 */
|
||||||
|
export function getSaleTimeSummary() {
|
||||||
|
return requestClient.get<ErpSaleStatisticsApi.SaleTimeSummaryRespVO[]>(
|
||||||
|
'/erp/sale-statistics/time-summary',
|
||||||
|
);
|
||||||
|
}
|
||||||
87
apps/web-antd/src/api/erp/stock/check/index.ts
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpStockCheckApi {
|
||||||
|
/** 库存盘点单信息 */
|
||||||
|
export interface StockCheck {
|
||||||
|
id?: number; // 盘点编号
|
||||||
|
no: string; // 盘点单号
|
||||||
|
checkTime: Date; // 盘点时间
|
||||||
|
totalCount: number; // 合计数量
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
fileUrl?: string; // 附件
|
||||||
|
productNames?: string; // 产品信息
|
||||||
|
creatorName?: string; // 创建人
|
||||||
|
items?: StockCheckItem[]; // 盘点产品清单
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 库存盘点项 */
|
||||||
|
export interface StockCheckItem {
|
||||||
|
id?: number; // 编号
|
||||||
|
warehouseId?: number; // 仓库编号
|
||||||
|
productId?: number; // 产品编号
|
||||||
|
productName?: string; // 产品名称
|
||||||
|
productUnitId?: number; // 产品单位编号
|
||||||
|
productUnitName?: string; // 产品单位名称
|
||||||
|
productBarCode?: string; // 产品条码
|
||||||
|
count?: number; // 盈亏数量
|
||||||
|
actualCount?: number; // 实际库存
|
||||||
|
productPrice?: number; // 产品单价
|
||||||
|
totalPrice?: number; // 总价
|
||||||
|
stockCount?: number; // 账面库存
|
||||||
|
remark?: string; // 备注
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询库存盘点单分页 */
|
||||||
|
export function getStockCheckPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpStockCheckApi.StockCheck>>(
|
||||||
|
'/erp/stock-check/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询库存盘点单详情 */
|
||||||
|
export function getStockCheck(id: number) {
|
||||||
|
return requestClient.get<ErpStockCheckApi.StockCheck>(
|
||||||
|
`/erp/stock-check/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增库存盘点单 */
|
||||||
|
export function createStockCheck(data: ErpStockCheckApi.StockCheck) {
|
||||||
|
return requestClient.post('/erp/stock-check/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改库存盘点单 */
|
||||||
|
export function updateStockCheck(data: ErpStockCheckApi.StockCheck) {
|
||||||
|
return requestClient.put('/erp/stock-check/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新库存盘点单的状态 */
|
||||||
|
export function updateStockCheckStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/stock-check/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除库存盘点 */
|
||||||
|
export function deleteStockCheck(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/stock-check/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出库存盘点单 Excel */
|
||||||
|
export function exportStockCheck(params: any) {
|
||||||
|
return requestClient.download('/erp/stock-check/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
86
apps/web-antd/src/api/erp/stock/in/index.ts
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpStockInApi {
|
||||||
|
/** 其它入库单信息 */
|
||||||
|
export interface StockIn {
|
||||||
|
id?: number; // 入库编号
|
||||||
|
no: string; // 入库单号
|
||||||
|
supplierId: number; // 供应商编号
|
||||||
|
supplierName?: string; // 供应商名称
|
||||||
|
inTime: Date; // 入库时间
|
||||||
|
totalCount: number; // 合计数量
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
fileUrl?: string; // 附件
|
||||||
|
productNames?: string; // 产品信息
|
||||||
|
creatorName?: string; // 创建人
|
||||||
|
items?: StockInItem[]; // 入库产品清单
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 其它入库单产品信息 */
|
||||||
|
export interface StockInItem {
|
||||||
|
id?: number; // 编号
|
||||||
|
warehouseId: number; // 仓库编号
|
||||||
|
productId: number; // 产品编号
|
||||||
|
productName?: string; // 产品名称
|
||||||
|
productUnitId?: number; // 产品单位编号
|
||||||
|
productUnitName?: string; // 产品单位名称
|
||||||
|
productBarCode?: string; // 产品条码
|
||||||
|
count: number; // 数量
|
||||||
|
productPrice: number; // 产品单价
|
||||||
|
totalPrice: number; // 总价
|
||||||
|
stockCount?: number; // 库存数量
|
||||||
|
remark?: string; // 备注
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询其它入库单分页 */
|
||||||
|
export function getStockInPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpStockInApi.StockIn>>(
|
||||||
|
'/erp/stock-in/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询其它入库单详情 */
|
||||||
|
export function getStockIn(id: number) {
|
||||||
|
return requestClient.get<ErpStockInApi.StockIn>(`/erp/stock-in/get?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增其它入库单 */
|
||||||
|
export function createStockIn(data: ErpStockInApi.StockIn) {
|
||||||
|
return requestClient.post('/erp/stock-in/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改其它入库单 */
|
||||||
|
export function updateStockIn(data: ErpStockInApi.StockIn) {
|
||||||
|
return requestClient.put('/erp/stock-in/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新其它入库单的状态 */
|
||||||
|
export function updateStockInStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/stock-in/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除其它入库单 */
|
||||||
|
export function deleteStockIn(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/stock-in/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出其它入库单 Excel */
|
||||||
|
export function exportStockIn(params: any) {
|
||||||
|
return requestClient.download('/erp/stock-in/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
87
apps/web-antd/src/api/erp/stock/move/index.ts
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpStockMoveApi {
|
||||||
|
/** 库存调拨单信息 */
|
||||||
|
export interface StockMove {
|
||||||
|
id?: number; // 调拨编号
|
||||||
|
no: string; // 调拨单号
|
||||||
|
outTime: Date; // 调拨时间
|
||||||
|
totalCount: number; // 合计数量
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
fileUrl?: string; // 附件
|
||||||
|
fromWarehouseId?: number; // 来源仓库编号
|
||||||
|
createTime: Date; // 创建时间
|
||||||
|
creator: string; // 创建人
|
||||||
|
creatorName: string; // 创建人名称
|
||||||
|
productNames: string; // 产品名称
|
||||||
|
items?: StockMoveItem[]; // 子表信息
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 库存调拨单子表信息 */
|
||||||
|
export interface StockMoveItem {
|
||||||
|
count: number; // 数量
|
||||||
|
fromWarehouseId?: number; // 来源仓库ID
|
||||||
|
id?: number; // ID
|
||||||
|
productBarCode: string; // 产品条形码
|
||||||
|
productId?: number; // 产品ID
|
||||||
|
productName?: string; // 产品名称
|
||||||
|
productPrice: number; // 产品单价
|
||||||
|
productUnitName?: string; // 产品单位
|
||||||
|
remark?: string; // 备注
|
||||||
|
stockCount: number; // 库存数量
|
||||||
|
toWarehouseId?: number; // 目标仓库ID
|
||||||
|
totalPrice?: number; // 总价
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询库存调拨单分页 */
|
||||||
|
export function getStockMovePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpStockMoveApi.StockMove>>(
|
||||||
|
'/erp/stock-move/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询库存调拨单详情 */
|
||||||
|
export function getStockMove(id: number) {
|
||||||
|
return requestClient.get<ErpStockMoveApi.StockMove>(
|
||||||
|
`/erp/stock-move/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增库存调拨单 */
|
||||||
|
export function createStockMove(data: ErpStockMoveApi.StockMove) {
|
||||||
|
return requestClient.post('/erp/stock-move/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改库存调拨单 */
|
||||||
|
export function updateStockMove(data: ErpStockMoveApi.StockMove) {
|
||||||
|
return requestClient.put('/erp/stock-move/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新库存调拨单的状态 */
|
||||||
|
export function updateStockMoveStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/stock-move/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除库存调拨单 */
|
||||||
|
export function deleteStockMove(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/stock-move/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出库存调拨单 Excel */
|
||||||
|
export function exportStockMove(params: any) {
|
||||||
|
return requestClient.download('/erp/stock-move/export-excel', { params });
|
||||||
|
}
|
||||||
85
apps/web-antd/src/api/erp/stock/out/index.ts
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpStockOutApi {
|
||||||
|
/** 其它出库单信息 */
|
||||||
|
export interface StockOut {
|
||||||
|
id?: number; // 出库编号
|
||||||
|
no: string; // 出库单号
|
||||||
|
customerId: number; // 客户编号
|
||||||
|
outTime: Date; // 出库时间
|
||||||
|
totalCount: number; // 合计数量
|
||||||
|
totalPrice: number; // 合计金额,单位:元
|
||||||
|
status: number; // 状态
|
||||||
|
remark: string; // 备注
|
||||||
|
fileUrl?: string; // 附件
|
||||||
|
items?: StockOutItem[]; // 出库产品清单
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 其它出库单产品信息 */
|
||||||
|
export interface StockOutItem {
|
||||||
|
id?: number; // 编号
|
||||||
|
warehouseId?: number; // 仓库编号
|
||||||
|
productId?: number; // 产品编号
|
||||||
|
productName?: string; // 产品名称
|
||||||
|
productUnitId?: number; // 产品单位编号
|
||||||
|
productUnitName?: string; // 产品单位名称
|
||||||
|
productBarCode?: string; // 产品条码
|
||||||
|
count: number; // 数量
|
||||||
|
productPrice: number; // 产品单价
|
||||||
|
totalPrice: number; // 总价
|
||||||
|
stockCount?: number; // 库存数量
|
||||||
|
remark?: string; // 备注
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询其它出库单分页 */
|
||||||
|
export function getStockOutPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpStockOutApi.StockOut>>(
|
||||||
|
'/erp/stock-out/page',
|
||||||
|
{
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询其它出库单详情 */
|
||||||
|
export function getStockOut(id: number) {
|
||||||
|
return requestClient.get<ErpStockOutApi.StockOut>(
|
||||||
|
`/erp/stock-out/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增其它出库单 */
|
||||||
|
export function createStockOut(data: ErpStockOutApi.StockOut) {
|
||||||
|
return requestClient.post('/erp/stock-out/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改其它出库单 */
|
||||||
|
export function updateStockOut(data: ErpStockOutApi.StockOut) {
|
||||||
|
return requestClient.put('/erp/stock-out/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新其它出库单的状态 */
|
||||||
|
export function updateStockOutStatus(id: number, status: number) {
|
||||||
|
return requestClient.put('/erp/stock-out/update-status', null, {
|
||||||
|
params: { id, status },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除其它出库单 */
|
||||||
|
export function deleteStockOut(ids: number[]) {
|
||||||
|
return requestClient.delete('/erp/stock-out/delete', {
|
||||||
|
params: {
|
||||||
|
ids: ids.join(','),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出其它出库单 Excel */
|
||||||
|
export function exportStockOut(params: any) {
|
||||||
|
return requestClient.download('/erp/stock-out/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
31
apps/web-antd/src/api/erp/stock/record/index.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpStockRecordApi {
|
||||||
|
/** 产品库存明细 */
|
||||||
|
export interface StockRecord {
|
||||||
|
id?: number; // 编号
|
||||||
|
productId: number; // 产品编号
|
||||||
|
warehouseId: number; // 仓库编号
|
||||||
|
count: number; // 出入库数量
|
||||||
|
totalCount: number; // 总库存量
|
||||||
|
bizType: number; // 业务类型
|
||||||
|
bizId: number; // 业务编号
|
||||||
|
bizItemId: number; // 业务项编号
|
||||||
|
bizNo: string; // 业务单号
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品库存明细分页 */
|
||||||
|
export function getStockRecordPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpStockRecordApi.StockRecord>>(
|
||||||
|
'/erp/stock-record/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出产品库存明细 Excel */
|
||||||
|
export function exportStockRecord(params: any) {
|
||||||
|
return requestClient.download('/erp/stock-record/export-excel', { params });
|
||||||
|
}
|
||||||
51
apps/web-antd/src/api/erp/stock/stock/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpStockApi {
|
||||||
|
/** 产品库存信息 */
|
||||||
|
export interface Stock {
|
||||||
|
id?: number; // 编号
|
||||||
|
productId: number; // 产品编号
|
||||||
|
warehouseId: number; // 仓库编号
|
||||||
|
count: number; // 库存数量
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 产品库存查询参数 */
|
||||||
|
export interface StockQueryReqVO {
|
||||||
|
productId: number;
|
||||||
|
warehouseId: number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询产品库存分页 */
|
||||||
|
export function getStockPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpStockApi.Stock>>('/erp/stock/page', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得产品库存数量 */
|
||||||
|
export function getStockCount(productId: number, warehouseId?: number) {
|
||||||
|
const params: any = { productId };
|
||||||
|
if (warehouseId !== undefined) {
|
||||||
|
params.warehouseId = warehouseId;
|
||||||
|
}
|
||||||
|
return requestClient.get<number>('/erp/stock/get-count', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出产品库存 Excel */
|
||||||
|
export function exportStock(params: any) {
|
||||||
|
return requestClient.download('/erp/stock/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取库存数量 */
|
||||||
|
export function getWarehouseStockCount(params: ErpStockApi.StockQueryReqVO) {
|
||||||
|
return requestClient.get<number>('/erp/stock/get-count', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
71
apps/web-antd/src/api/erp/stock/warehouse/index.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace ErpWarehouseApi {
|
||||||
|
/** 仓库信息 */
|
||||||
|
export interface Warehouse {
|
||||||
|
id?: number; // 仓库编号
|
||||||
|
name: string; // 仓库名称
|
||||||
|
address: string; // 仓库地址
|
||||||
|
sort: number; // 排序
|
||||||
|
remark: string; // 备注
|
||||||
|
principal: string; // 负责人
|
||||||
|
warehousePrice: number; // 仓储费,单位:元
|
||||||
|
truckagePrice: number; // 搬运费,单位:元
|
||||||
|
status: number; // 开启状态
|
||||||
|
defaultStatus: boolean; // 是否默认
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询仓库分页 */
|
||||||
|
export function getWarehousePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<ErpWarehouseApi.Warehouse>>(
|
||||||
|
'/erp/warehouse/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询仓库精简列表 */
|
||||||
|
export function getWarehouseSimpleList() {
|
||||||
|
return requestClient.get<ErpWarehouseApi.Warehouse[]>(
|
||||||
|
'/erp/warehouse/simple-list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询仓库详情 */
|
||||||
|
export function getWarehouse(id: number) {
|
||||||
|
return requestClient.get<ErpWarehouseApi.Warehouse>(
|
||||||
|
`/erp/warehouse/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增仓库 */
|
||||||
|
export function createWarehouse(data: ErpWarehouseApi.Warehouse) {
|
||||||
|
return requestClient.post('/erp/warehouse/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改仓库 */
|
||||||
|
export function updateWarehouse(data: ErpWarehouseApi.Warehouse) {
|
||||||
|
return requestClient.put('/erp/warehouse/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改仓库默认状态 */
|
||||||
|
export function updateWarehouseDefaultStatus(
|
||||||
|
id: number,
|
||||||
|
defaultStatus: boolean,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/erp/warehouse/update-default-status', null, {
|
||||||
|
params: { id, defaultStatus },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除仓库 */
|
||||||
|
export function deleteWarehouse(id: number) {
|
||||||
|
return requestClient.delete(`/erp/warehouse/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出仓库 Excel */
|
||||||
|
export function exportWarehouse(params: any) {
|
||||||
|
return requestClient.download('/erp/warehouse/export-excel', { params });
|
||||||
|
}
|
||||||
168
apps/web-antd/src/api/infra/codegen/index.ts
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraCodegenApi {
|
||||||
|
/** 代码生成表定义 */
|
||||||
|
export interface CodegenTable {
|
||||||
|
id: number;
|
||||||
|
tableId: number;
|
||||||
|
isParentMenuIdValid: boolean;
|
||||||
|
dataSourceConfigId: number;
|
||||||
|
scene: number;
|
||||||
|
tableName: string;
|
||||||
|
tableComment: string;
|
||||||
|
remark: string;
|
||||||
|
moduleName: string;
|
||||||
|
businessName: string;
|
||||||
|
className: string;
|
||||||
|
classComment: string;
|
||||||
|
author: string;
|
||||||
|
createTime: Date;
|
||||||
|
updateTime: Date;
|
||||||
|
templateType: number;
|
||||||
|
parentMenuId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 代码生成字段定义 */
|
||||||
|
export interface CodegenColumn {
|
||||||
|
id: number;
|
||||||
|
tableId: number;
|
||||||
|
columnName: string;
|
||||||
|
dataType: string;
|
||||||
|
columnComment: string;
|
||||||
|
nullable: number;
|
||||||
|
primaryKey: number;
|
||||||
|
ordinalPosition: number;
|
||||||
|
javaType: string;
|
||||||
|
javaField: string;
|
||||||
|
dictType: string;
|
||||||
|
example: string;
|
||||||
|
createOperation: number;
|
||||||
|
updateOperation: number;
|
||||||
|
listOperation: number;
|
||||||
|
listOperationCondition: string;
|
||||||
|
listOperationResult: number;
|
||||||
|
htmlType: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 数据库表定义 */
|
||||||
|
export interface DatabaseTable {
|
||||||
|
name: string;
|
||||||
|
comment: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 代码生成详情 */
|
||||||
|
export interface CodegenDetail {
|
||||||
|
table: CodegenTable;
|
||||||
|
columns: CodegenColumn[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 代码预览 */
|
||||||
|
export interface CodegenPreview {
|
||||||
|
filePath: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 更新代码生成请求 */
|
||||||
|
export interface CodegenUpdateReqVO {
|
||||||
|
table: any | CodegenTable;
|
||||||
|
columns: CodegenColumn[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 创建代码生成请求 */
|
||||||
|
export interface CodegenCreateListReqVO {
|
||||||
|
dataSourceConfigId?: number;
|
||||||
|
tableNames: string[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询列表代码生成表定义 */
|
||||||
|
export function getCodegenTableList(dataSourceConfigId: number) {
|
||||||
|
return requestClient.get<InfraCodegenApi.CodegenTable[]>(
|
||||||
|
'/infra/codegen/table/list?',
|
||||||
|
{
|
||||||
|
params: { dataSourceConfigId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询列表代码生成表定义 */
|
||||||
|
export function getCodegenTablePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<InfraCodegenApi.CodegenTable>>(
|
||||||
|
'/infra/codegen/table/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询详情代码生成表定义 */
|
||||||
|
export function getCodegenTable(tableId: number) {
|
||||||
|
return requestClient.get<InfraCodegenApi.CodegenDetail>(
|
||||||
|
'/infra/codegen/detail',
|
||||||
|
{
|
||||||
|
params: { tableId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改代码生成表定义 */
|
||||||
|
export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReqVO) {
|
||||||
|
return requestClient.put('/infra/codegen/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 基于数据库的表结构,同步数据库的表和字段定义 */
|
||||||
|
export function syncCodegenFromDB(tableId: number) {
|
||||||
|
return requestClient.put(
|
||||||
|
'/infra/codegen/sync-from-db',
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
params: { tableId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 预览生成代码 */
|
||||||
|
export function previewCodegen(tableId: number) {
|
||||||
|
return requestClient.get<InfraCodegenApi.CodegenPreview[]>(
|
||||||
|
'/infra/codegen/preview',
|
||||||
|
{
|
||||||
|
params: { tableId },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 下载生成代码 */
|
||||||
|
export function downloadCodegen(tableId: number) {
|
||||||
|
return requestClient.download('/infra/codegen/download', {
|
||||||
|
params: { tableId },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得表定义 */
|
||||||
|
export function getSchemaTableList(params: any) {
|
||||||
|
return requestClient.get<InfraCodegenApi.DatabaseTable[]>(
|
||||||
|
'/infra/codegen/db/table/list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 基于数据库的表结构,创建代码生成器的表定义 */
|
||||||
|
export function createCodegenList(
|
||||||
|
data: InfraCodegenApi.CodegenCreateListReqVO,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/infra/codegen/create-list', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除代码生成表定义 */
|
||||||
|
export function deleteCodegenTable(tableId: number) {
|
||||||
|
return requestClient.delete('/infra/codegen/delete', {
|
||||||
|
params: { tableId },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除代码生成表定义 */
|
||||||
|
export function deleteCodegenTableList(tableIds: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/codegen/delete-list?tableIds=${tableIds.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
53
apps/web-antd/src/api/infra/data-source-config/index.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace InfraDataSourceConfigApi {
|
||||||
|
/** 数据源配置信息 */
|
||||||
|
export interface DataSourceConfig {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
url: string;
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
createTime?: Date;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询数据源配置列表 */
|
||||||
|
export function getDataSourceConfigList() {
|
||||||
|
return requestClient.get<InfraDataSourceConfigApi.DataSourceConfig[]>(
|
||||||
|
'/infra/data-source-config/list',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询数据源配置详情 */
|
||||||
|
export function getDataSourceConfig(id: number) {
|
||||||
|
return requestClient.get<InfraDataSourceConfigApi.DataSourceConfig>(
|
||||||
|
`/infra/data-source-config/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增数据源配置 */
|
||||||
|
export function createDataSourceConfig(
|
||||||
|
data: InfraDataSourceConfigApi.DataSourceConfig,
|
||||||
|
) {
|
||||||
|
return requestClient.post('/infra/data-source-config/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改数据源配置 */
|
||||||
|
export function updateDataSourceConfig(
|
||||||
|
data: InfraDataSourceConfigApi.DataSourceConfig,
|
||||||
|
) {
|
||||||
|
return requestClient.put('/infra/data-source-config/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除数据源配置 */
|
||||||
|
export function deleteDataSourceConfig(id: number) {
|
||||||
|
return requestClient.delete(`/infra/data-source-config/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除数据源配置 */
|
||||||
|
export function deleteDataSourceConfigList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/data-source-config/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
61
apps/web-antd/src/api/infra/demo/demo01/index.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo01ContactApi {
|
||||||
|
/** 示例联系人信息 */
|
||||||
|
export interface Demo01Contact {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生年
|
||||||
|
description?: string; // 简介
|
||||||
|
avatar: string; // 头像
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询示例联系人分页 */
|
||||||
|
export function getDemo01ContactPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo01ContactApi.Demo01Contact>>(
|
||||||
|
'/infra/demo01-contact/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询示例联系人详情 */
|
||||||
|
export function getDemo01Contact(id: number) {
|
||||||
|
return requestClient.get<Demo01ContactApi.Demo01Contact>(
|
||||||
|
`/infra/demo01-contact/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增示例联系人 */
|
||||||
|
export function createDemo01Contact(data: Demo01ContactApi.Demo01Contact) {
|
||||||
|
return requestClient.post('/infra/demo01-contact/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改示例联系人 */
|
||||||
|
export function updateDemo01Contact(data: Demo01ContactApi.Demo01Contact) {
|
||||||
|
return requestClient.put('/infra/demo01-contact/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除示例联系人 */
|
||||||
|
export function deleteDemo01Contact(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo01-contact/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除示例联系人 */
|
||||||
|
export function deleteDemo01ContactList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo01-contact/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出示例联系人 */
|
||||||
|
export function exportDemo01Contact(params: any) {
|
||||||
|
return requestClient.download('/infra/demo01-contact/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
48
apps/web-antd/src/api/infra/demo/demo02/index.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo02CategoryApi {
|
||||||
|
/** 示例分类信息 */
|
||||||
|
export interface Demo02Category {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
parentId?: number; // 父级编号
|
||||||
|
children?: Demo02Category[];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询示例分类列表 */
|
||||||
|
export function getDemo02CategoryList(params: any) {
|
||||||
|
return requestClient.get<Demo02CategoryApi.Demo02Category[]>(
|
||||||
|
'/infra/demo02-category/list',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询示例分类详情 */
|
||||||
|
export function getDemo02Category(id: number) {
|
||||||
|
return requestClient.get<Demo02CategoryApi.Demo02Category>(
|
||||||
|
`/infra/demo02-category/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增示例分类 */
|
||||||
|
export function createDemo02Category(data: Demo02CategoryApi.Demo02Category) {
|
||||||
|
return requestClient.post('/infra/demo02-category/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改示例分类 */
|
||||||
|
export function updateDemo02Category(data: Demo02CategoryApi.Demo02Category) {
|
||||||
|
return requestClient.put('/infra/demo02-category/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除示例分类 */
|
||||||
|
export function deleteDemo02Category(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo02-category/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出示例分类 */
|
||||||
|
export function exportDemo02Category(params: any) {
|
||||||
|
return requestClient.download('/infra/demo02-category/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
168
apps/web-antd/src/api/infra/demo/demo03/erp/index.ts
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo03StudentApi {
|
||||||
|
/** 学生课程信息 */
|
||||||
|
export interface Demo03Course {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
score?: number; // 分数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生班级信息 */
|
||||||
|
export interface Demo03Grade {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
teacher?: string; // 班主任
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生信息 */
|
||||||
|
export interface Demo03Student {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生日期
|
||||||
|
description?: string; // 简介
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生分页 */
|
||||||
|
export function getDemo03StudentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||||
|
'/infra/demo03-student-erp/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生详情 */
|
||||||
|
export function getDemo03Student(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||||
|
`/infra/demo03-student-erp/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增学生 */
|
||||||
|
export function createDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.post('/infra/demo03-student-erp/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生 */
|
||||||
|
export function updateDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.put('/infra/demo03-student-erp/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生 */
|
||||||
|
export function deleteDemo03Student(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo03-student-erp/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生 */
|
||||||
|
export function deleteDemo03StudentList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出学生 */
|
||||||
|
export function exportDemo03Student(params: any) {
|
||||||
|
return requestClient.download('/infra/demo03-student-erp/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生课程) ====================
|
||||||
|
|
||||||
|
/** 获得学生课程分页 */
|
||||||
|
export function getDemo03CoursePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Course>>(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/page`,
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 新增学生课程 */
|
||||||
|
export function createDemo03Course(data: Demo03StudentApi.Demo03Course) {
|
||||||
|
return requestClient.post(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/create`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生课程 */
|
||||||
|
export function updateDemo03Course(data: Demo03StudentApi.Demo03Course) {
|
||||||
|
return requestClient.put(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/update`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生课程 */
|
||||||
|
export function deleteDemo03Course(id: number) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/delete?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生课程 */
|
||||||
|
export function deleteDemo03CourseList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得学生课程 */
|
||||||
|
export function getDemo03Course(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Course>(
|
||||||
|
`/infra/demo03-student-erp/demo03-course/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生班级) ====================
|
||||||
|
|
||||||
|
/** 获得学生班级分页 */
|
||||||
|
export function getDemo03GradePage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Grade>>(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/page`,
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/** 新增学生班级 */
|
||||||
|
export function createDemo03Grade(data: Demo03StudentApi.Demo03Grade) {
|
||||||
|
return requestClient.post(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/create`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生班级 */
|
||||||
|
export function updateDemo03Grade(data: Demo03StudentApi.Demo03Grade) {
|
||||||
|
return requestClient.put(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/update`,
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生班级 */
|
||||||
|
export function deleteDemo03Grade(id: number) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/delete?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生班级 */
|
||||||
|
export function deleteDemo03GradeList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获得学生班级 */
|
||||||
|
export function getDemo03Grade(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Grade>(
|
||||||
|
`/infra/demo03-student-erp/demo03-grade/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
96
apps/web-antd/src/api/infra/demo/demo03/inner/index.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
import type { Dayjs } from 'dayjs';
|
||||||
|
|
||||||
|
import type { PageParam, PageResult } from '@vben/request';
|
||||||
|
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
export namespace Demo03StudentApi {
|
||||||
|
/** 学生课程信息 */
|
||||||
|
export interface Demo03Course {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
score?: number; // 分数
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生班级信息 */
|
||||||
|
export interface Demo03Grade {
|
||||||
|
id: number; // 编号
|
||||||
|
studentId?: number; // 学生编号
|
||||||
|
name?: string; // 名字
|
||||||
|
teacher?: string; // 班主任
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 学生信息 */
|
||||||
|
export interface Demo03Student {
|
||||||
|
id: number; // 编号
|
||||||
|
name?: string; // 名字
|
||||||
|
sex?: number; // 性别
|
||||||
|
birthday?: Dayjs | string; // 出生日期
|
||||||
|
description?: string; // 简介
|
||||||
|
demo03courses?: Demo03Course[];
|
||||||
|
demo03grade?: Demo03Grade;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生分页 */
|
||||||
|
export function getDemo03StudentPage(params: PageParam) {
|
||||||
|
return requestClient.get<PageResult<Demo03StudentApi.Demo03Student>>(
|
||||||
|
'/infra/demo03-student-inner/page',
|
||||||
|
{ params },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 查询学生详情 */
|
||||||
|
export function getDemo03Student(id: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Student>(
|
||||||
|
`/infra/demo03-student-inner/get?id=${id}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 新增学生 */
|
||||||
|
export function createDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.post('/infra/demo03-student-inner/create', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改学生 */
|
||||||
|
export function updateDemo03Student(data: Demo03StudentApi.Demo03Student) {
|
||||||
|
return requestClient.put('/infra/demo03-student-inner/update', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除学生 */
|
||||||
|
export function deleteDemo03Student(id: number) {
|
||||||
|
return requestClient.delete(`/infra/demo03-student-inner/delete?id=${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量删除学生 */
|
||||||
|
export function deleteDemo03StudentList(ids: number[]) {
|
||||||
|
return requestClient.delete(
|
||||||
|
`/infra/demo03-student-inner/delete-list?ids=${ids.join(',')}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出学生 */
|
||||||
|
export function exportDemo03Student(params: any) {
|
||||||
|
return requestClient.download('/infra/demo03-student-inner/export-excel', {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生课程) ====================
|
||||||
|
|
||||||
|
/** 获得学生课程列表 */
|
||||||
|
export function getDemo03CourseListByStudentId(studentId: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Course[]>(
|
||||||
|
`/infra/demo03-student-inner/demo03-course/list-by-student-id?studentId=${studentId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(学生班级) ====================
|
||||||
|
|
||||||
|
/** 获得学生班级 */
|
||||||
|
export function getDemo03GradeByStudentId(studentId: number) {
|
||||||
|
return requestClient.get<Demo03StudentApi.Demo03Grade>(
|
||||||
|
`/infra/demo03-student-inner/demo03-grade/get-by-student-id?studentId=${studentId}`,
|
||||||
|
);
|
||||||
|
}
|
||||||