初版提交

This commit is contained in:
凌尛 2026-06-15 14:30:37 +08:00
commit bf82e71e85
536 changed files with 92492 additions and 0 deletions

21
.editorconfig Normal file
View File

@ -0,0 +1,21 @@
# 告诉EditorConfig插件这是根文件不用继续往上查找
root = true
# 匹配全部文件
[*]
# 缩进风格可选space、tab
indent_style = space
# 缩进的空格数
indent_size = 2
# 设置字符集
charset = utf-8
# 结尾换行符可选lf、cr、crlf
end_of_line = lf
# 在文件结尾插入新行
trim_trailing_whitespace = true
# 删除一行中的前后空格
insert_final_newline = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

36
.env.development Normal file
View File

@ -0,0 +1,36 @@
# 页面标题
VITE_APP_TITLE = 书海寻源-ERP
# 开发环境配置
VITE_APP_ENV = 'development'
# 开发环境
#VITE_APP_BASE_API = 'https://test.api.buzhiyushu.cn'
VITE_APP_BASE_API = '/dev-api'
# 应用访问路径 例如使用前缀 /admin/
VITE_APP_CONTEXT_PATH = '/'
# 监控地址
VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
# SnailJob 控制台地址
VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job'
VITE_APP_PORT = 82
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
VITE_APP_ENCRYPT = true
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE='
# 客户端id
VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
# websocket 开关 默认使用sse推送
VITE_APP_WEBSOCKET = false
# sse 开关
VITE_APP_SSE = true

39
.env.production Normal file
View File

@ -0,0 +1,39 @@
# 页面标题
VITE_APP_TITLE = 与书同行
# 生产环境配置
VITE_APP_ENV = 'production'
# 应用访问路径 例如使用前缀 /admin/
VITE_APP_CONTEXT_PATH = '/'
# 监控地址
VITE_APP_MONITOR_ADMIN = '/admin/applications'
# SnailJob 控制台地址
VITE_APP_SNAILJOB_ADMIN = '/snail-job'
# 生产环境
#VITE_APP_BASE_API = 'https://test.api.buzhiyushu.cn'
VITE_APP_BASE_API = '/prod-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip
VITE_APP_PORT = 82
# 接口加密功能开关(如需关闭 后端也必须对应关闭)
VITE_APP_ENCRYPT = true
# 接口加密传输 RSA 公钥与后端解密私钥对应 如更换需前后端一同更换
VITE_APP_RSA_PUBLIC_KEY = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ=='
# 接口响应解密 RSA 私钥与后端加密公钥对应 如更换需前后端一同更换
VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE='
# 客户端id
VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
# websocket 开关 默认使用sse推送
VITE_APP_WEBSOCKET = false
# sse 开关
VITE_APP_SSE = true

312
.eslintrc-auto-import.json Normal file
View File

@ -0,0 +1,312 @@
{
"globals": {
"ComponentInternalInstance": true,
"TransferKey": true,
"ElFormRules": true,
"CheckboxValueType": true,
"PropType": true,
"DateModelType": true,
"UploadFile": true,
"ElFormInstance": true,
"ElTableInstance": true,
"ElTreeInstance": true,
"ElTreeSelectInstance": true,
"ElSelectInstance": true,
"ElUploadInstance": true,
"ElCardInstance": true,
"ElDialogInstance": true,
"ElInputInstance": true,
"ElInputNumberInstance": true,
"ElRadioInstance": true,
"ElRadioGroupInstance": true,
"ElRadioButtonInstance": true,
"ElCheckboxInstance": true,
"ElCheckboxGroupInstance": true,
"ElSwitchInstance": true,
"ElDatePickerInstance": true,
"ElTimePickerInstance": true,
"ElTimeSelectInstance": true,
"ElScrollbarInstance": true,
"ElCascaderInstance": true,
"ElColorPickerInstance": true,
"ElRateInstance": true,
"ElSliderInstance": true,
"useRouter": true,
"useRoute": true,
"EffectScope": true,
"ElTable": true,
"ElSelect": true,
"ElUpload": true,
"ElForm": true,
"ElTree": true,
"ElMessage": true,
"ElMessageBox": true,
"asyncComputed": true,
"autoResetRef": true,
"computed": true,
"computedAsync": true,
"computedEager": true,
"computedInject": true,
"computedWithControl": true,
"controlledComputed": true,
"controlledRef": true,
"createApp": true,
"createEventHook": true,
"createGlobalState": true,
"createInjectionState": true,
"createReactiveFn": true,
"createSharedComposable": true,
"createUnrefFn": true,
"customRef": true,
"debouncedRef": true,
"debouncedWatch": true,
"defineAsyncComponent": true,
"defineComponent": true,
"eagerComputed": true,
"effectScope": true,
"extendRef": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"ignorableWatch": true,
"inject": true,
"isDefined": true,
"isProxy": true,
"isReactive": true,
"isReadonly": true,
"isRef": true,
"makeDestructurable": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onClickOutside": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onKeyStroke": true,
"onLongPress": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onStartTyping": true,
"onUnmounted": true,
"onUpdated": true,
"pausableWatch": true,
"provide": true,
"reactify": true,
"reactifyObject": true,
"reactive": true,
"reactiveComputed": true,
"reactiveOmit": true,
"reactivePick": true,
"readonly": true,
"ref": true,
"refAutoReset": true,
"refDebounced": true,
"refDefault": true,
"refThrottled": true,
"refWithControl": true,
"resolveComponent": true,
"resolveDirective": true,
"resolveRef": true,
"resolveUnref": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"syncRef": true,
"syncRefs": true,
"templateRef": true,
"throttledRef": true,
"throttledWatch": true,
"toRaw": true,
"toReactive": true,
"toRef": true,
"toRefs": true,
"triggerRef": true,
"tryOnBeforeMount": true,
"tryOnBeforeUnmount": true,
"tryOnMounted": true,
"tryOnScopeDispose": true,
"tryOnUnmounted": true,
"unref": true,
"unrefElement": true,
"until": true,
"useActiveElement": true,
"useArrayEvery": true,
"useArrayFilter": true,
"useArrayFind": true,
"useArrayFindIndex": true,
"useArrayFindLast": true,
"useArrayJoin": true,
"useArrayMap": true,
"useArrayReduce": true,
"useArraySome": true,
"useArrayUnique": true,
"useAsyncQueue": true,
"useAsyncState": true,
"useAttrs": true,
"useBase64": true,
"useBattery": true,
"useBluetooth": true,
"useBreakpoints": true,
"useBroadcastChannel": true,
"useBrowserLocation": true,
"useCached": true,
"useClipboard": true,
"useCloned": true,
"useColorMode": true,
"useConfirmDialog": true,
"useCounter": true,
"useCssModule": true,
"useCssVar": true,
"useCssVars": true,
"useCurrentElement": true,
"useCycleList": true,
"useDark": true,
"useDateFormat": true,
"useDebounce": true,
"useDebounceFn": true,
"useDebouncedRefHistory": true,
"useDeviceMotion": true,
"useDeviceOrientation": true,
"useDevicePixelRatio": true,
"useDevicesList": true,
"useDisplayMedia": true,
"useDocumentVisibility": true,
"useDraggable": true,
"useDropZone": true,
"useElementBounding": true,
"useElementByPoint": true,
"useElementHover": true,
"useElementSize": true,
"useElementVisibility": true,
"useEventBus": true,
"useEventListener": true,
"useEventSource": true,
"useEyeDropper": true,
"useFavicon": true,
"useFetch": true,
"useFileDialog": true,
"useFileSystemAccess": true,
"useFocus": true,
"useFocusWithin": true,
"useFps": true,
"useFullscreen": true,
"useGamepad": true,
"useGeolocation": true,
"useIdle": true,
"useImage": true,
"useInfiniteScroll": true,
"useIntersectionObserver": true,
"useInterval": true,
"useIntervalFn": true,
"useKeyModifier": true,
"useLastChanged": true,
"useLocalStorage": true,
"useMagicKeys": true,
"useManualRefHistory": true,
"useMediaControls": true,
"useMediaQuery": true,
"useMemoize": true,
"useMemory": true,
"useMounted": true,
"useMouse": true,
"useMouseInElement": true,
"useMousePressed": true,
"useMutationObserver": true,
"useNavigatorLanguage": true,
"useNetwork": true,
"useNow": true,
"useObjectUrl": true,
"useOffsetPagination": true,
"useOnline": true,
"usePageLeave": true,
"useParallax": true,
"usePermission": true,
"usePointer": true,
"usePointerLock": true,
"usePointerSwipe": true,
"usePreferredColorScheme": true,
"usePreferredContrast": true,
"usePreferredDark": true,
"usePreferredLanguages": true,
"usePreferredReducedMotion": true,
"usePrevious": true,
"useRafFn": true,
"useRefHistory": true,
"useResizeObserver": true,
"useScreenOrientation": true,
"useScreenSafeArea": true,
"useScriptTag": true,
"useScroll": true,
"useScrollLock": true,
"useSessionStorage": true,
"useShare": true,
"useSlots": true,
"useSorted": true,
"useSpeechRecognition": true,
"useSpeechSynthesis": true,
"useStepper": true,
"useStorage": true,
"useStorageAsync": true,
"useStyleTag": true,
"useSupported": true,
"useSwipe": true,
"useTemplateRefsList": true,
"useTextDirection": true,
"useTextSelection": true,
"useTextareaAutosize": true,
"useThrottle": true,
"useThrottleFn": true,
"useThrottledRefHistory": true,
"useTimeAgo": true,
"useTimeout": true,
"useTimeoutFn": true,
"useTimeoutPoll": true,
"useTimestamp": true,
"useTitle": true,
"useToNumber": true,
"useToString": true,
"useToggle": true,
"useTransition": true,
"useUrlSearchParams": true,
"useUserMedia": true,
"useVModel": true,
"useVModels": true,
"useVibrate": true,
"useVirtualList": true,
"useWakeLock": true,
"useWebNotification": true,
"useWebSocket": true,
"useWebWorker": true,
"useWebWorkerFn": true,
"useWindowFocus": true,
"useWindowScroll": true,
"useWindowSize": true,
"watch": true,
"watchArray": true,
"watchAtMost": true,
"watchDebounced": true,
"watchEffect": true,
"watchIgnorable": true,
"watchOnce": true,
"watchPausable": true,
"watchPostEffect": true,
"watchSyncEffect": true,
"watchThrottled": true,
"watchTriggerable": true,
"watchWithFilter": true,
"whenever": true,
"ImportOption": true,
"TreeType": true,
"FieldOption": true,
"PageData": true,
"storeToRefs": true,
"DictDataOption": true,
"UploadOption": true
}
}

29
.gitignore vendored Normal file
View File

@ -0,0 +1,29 @@
.DS_Store
.history
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
pnpm-lock.yaml
# 编译生成的文件
auto-imports.d.ts
components.d.ts

9
.prettierignore Normal file
View File

@ -0,0 +1,9 @@
/dist/*
.local
.output.js
/node_modules/**
**/*.svg
**/*.sh
/public/*

20
.prettierrc Normal file
View File

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

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2019 RuoYi-Vue-Plus
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

36
README.en.md Normal file
View File

@ -0,0 +1,36 @@
# zhishu-ui
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

76
README.md Normal file
View File

@ -0,0 +1,76 @@
## 平台简介
- 本仓库为前端技术栈 [Vue3](https://v3.cn.vuejs.org) + [TS](https://www.typescriptlang.org/) + [Element Plus](https://element-plus.org/zh-CN) + [Vite](https://cn.vitejs.dev) 版本。
- 成员项目: 基于 vben5(ant-design-vue) 的前端项目 [ruoyi-plus-vben5](https://gitee.com/dapppp/ruoyi-plus-vben5)
- 配套后端代码仓库地址
- [RuoYi-Vue-Plus 5.X(注意版本号)](https://gitee.com/dromara/RuoYi-Vue-Plus)
- [RuoYi-Cloud-Plus 2.X(注意版本号)](https://gitee.com/dromara/RuoYi-Cloud-Plus)
## 前端运行
```bash
# 克隆项目
git clone https://gitee.com/JavaLionLi/plus-ui.git
# 安装依赖
npm install --registry=https://registry.npmmirror.com
# 启动服务
npm run dev
# 构建生产环境
npm run build:prod
# 前端访问地址 http://localhost:80
```
## 本框架与RuoYi的业务差异
| 业务 | 功能说明 | 本框架 | RuoYi |
| ------------ | ------------------------------------------------------------- | ------ | ----------------------------- |
| 租户管理 | 系统内租户的管理 如:租户套餐、过期时间、用户数量、企业信息等 | 支持 | 无 |
| 租户套餐管理 | 系统内租户所能使用的套餐管理 如:套餐内所包含的菜单等 | 支持 | 无 |
| 用户管理 | 用户的管理配置 如:新增用户、分配用户所属部门、角色、岗位等 | 支持 | 支持 |
| 部门管理 | 配置系统组织机构(公司、部门、小组) 树结构展现支持数据权限 | 支持 | 支持 |
| 岗位管理 | 配置系统用户所属担任职务 | 支持 | 支持 |
| 菜单管理 | 配置系统菜单、操作权限、按钮权限标识等 | 支持 | 支持 |
| 角色管理 | 角色菜单权限分配、设置角色按机构进行数据范围权限划分 | 支持 | 支持 |
| 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | 支持 | 支持 |
| 参数管理 | 对系统动态配置常用参数 | 支持 | 支持 |
| 通知公告 | 系统通知公告信息发布维护 | 支持 | 支持 |
| 操作日志 | 系统正常操作日志记录和查询 系统异常信息日志记录和查询 | 支持 | 支持 |
| 登录日志 | 系统登录日志记录查询包含登录异常 | 支持 | 支持 |
| 文件管理 | 系统文件展示、上传、下载、删除等管理 | 支持 | 无 |
| 文件配置管理 | 系统文件上传、下载所需要的配置信息动态添加、修改、删除等管理 | 支持 | 无 |
| 在线用户管理 | 已登录系统的在线用户信息监控与强制踢出操作 | 支持 | 支持 |
| 定时任务 | 运行报表、任务管理(添加、修改、删除)、日志管理、执行器管理等 | 支持 | 仅支持任务与日志管理 |
| 代码生成 | 多数据源前后端代码的生成java、html、xml、sql支持CRUD下载 | 支持 | 仅支持单数据源 |
| 系统接口 | 根据业务代码自动生成相关的api接口文档 | 支持 | 支持 |
| 服务监控 | 监视集群系统CPU、内存、磁盘、堆栈、在线日志、Spring相关配置等 | 支持 | 仅支持单机CPU、内存、磁盘监控 |
| 缓存监控 | 对系统的缓存信息查询,命令统计等。 | 支持 | 支持 |
| 在线构建器 | 拖动表单元素生成相应的HTML代码。 | 支持 | 支持 |
| 使用案例 | 系统的一些功能案例 | 支持 | 不支持 |
## 演示图例
| | |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| ![输入图片说明](https://foruda.gitee.com/images/1680077524361362822/270bb429_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680077619939771291/989bf9b6_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680077681751513929/1c27c5bd_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680077721559267315/74d63e23_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680077765638904515/1b75d4a6_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078026375951297/eded7a4b_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078237104531207/0eb1b6a7_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078254306078709/5931e22f_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078287971528493/0b9af60a_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078308138770249/8d3b6696_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078352553634393/db5ef880_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078378238393374/601e4357_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078414983206024/2aae27c1_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078446738419874/ecce7d59_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078475971341775/149e8634_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078491666717143/3fadece7_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078558863188826/fb8ced2a_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078574561685461/ae68a0b2_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078594932772013/9d8bfec6_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078626493093532/fcfe4ff6_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078643608812515/0295bd4f_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078685196286463/d7612c81_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078703877318597/56fce0bc_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078716586545643/b6dbd68f_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078734103217688/eb1e6aa6_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078759131415480/73c525d8_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078779416197879/75e3ed02_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078802329118061/77e10915_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078893627848351/34a1c342_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078928175016986/f126ec4a_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078941718318363/b68a0f72_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680078963175518631/3bb769a1_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680078982294090567/b31c343d_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680079000642440444/77ca82a9_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680079020995074177/03b7d52e_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680079039367822173/76811806_1766278.png '屏幕截图') |
| ![输入图片说明](https://foruda.gitee.com/images/1680079274333484664/4dfdc7c0_1766278.png '屏幕截图') | ![输入图片说明](https://foruda.gitee.com/images/1680079290467458224/d6715fcf_1766278.png '屏幕截图') |

12
bin/build.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 打包Web工程生成dist文件。
echo.
%~d0
cd %~dp0
cd ..
yarn build:prod
pause

12
bin/package.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 安装Web工程生成node_modules文件。
echo.
%~d0
cd %~dp0
cd ..
yarn --registry=https://registry.npmmirror.com
pause

12
bin/run-web.bat Normal file
View File

@ -0,0 +1,12 @@
@echo off
echo.
echo [信息] 使用 Vite 命令运行 Web 工程。
echo.
%~d0
cd %~dp0
cd ..
yarn dev
pause

BIN
dist.rar Normal file

Binary file not shown.

BIN
dist.zip Normal file

Binary file not shown.

86
eslint.config.js Normal file
View File

@ -0,0 +1,86 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';
import { readFile } from 'node:fs/promises';
import prettier from 'eslint-plugin-prettier';
/**
* https://blog.csdn.net/sayUonly/article/details/123482912
* 自动导入的配置
*/
const autoImportFile = new URL('./.eslintrc-auto-import.json', import.meta.url);
const autoImportGlobals = JSON.parse(await readFile(autoImportFile, 'utf8'));
/** @type {import('eslint').Linter.Config[]} */
export default [
{
/**
* 不需要.eslintignore文件 而是在这里配置
*/
ignores: [
'*.sh',
'node_modules',
'*.md',
'*.woff',
'*.ttf',
'.vscode',
'.idea',
'dist',
'/public',
'/docs',
'.husky',
'.local',
'/bin',
'.eslintrc.cjs',
'prettier.config.js',
'src/assets',
'tailwind.config.js'
]
},
{ files: ['**/*.{js,mjs,cjs,ts,vue}'] },
{
languageOptions: {
globals: globals.browser
}
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser
}
}
},
{
languageOptions: {
globals: {
// 自动导入的配置 undef
...autoImportGlobals.globals,
DialogOption: 'readonly',
LayoutSetting: 'readonly'
}
},
plugins: { prettier },
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-this-alias': 'off',
// vue
'vue/multi-word-component-names': 'off',
'vue/valid-define-props': 'off',
'vue/no-v-model-argument': 'off',
'prefer-rest-params': 'off',
// prettier
'prettier/prettier': 'error',
// 允许使用空Object类型 {}
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
}
}
];

242
html/ie.html Normal file

File diff suppressed because one or more lines are too long

304
index.html Normal file
View File

@ -0,0 +1,304 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="icon" href="/favicon.ico" />
<title>与书同行</title>
<script src="https://pfile.pddpic.com/galerie-go/open_sdk/pc.202102201613.js" type="text/javascript"></script>
<!-- 引入 JsBarcode -->
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js"></script>
<!-- 引入 pdf工具 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.4.120/pdf.min.js"></script>
<!--[if lt IE 11
]><script>
window.location.href = '/html/ie.html';
</script><!
[endif]-->
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
}
.chromeframe {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
#loader-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 999999;
}
#loader {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #fff;
-webkit-animation: spin 2s linear infinite;
-ms-animation: spin 2s linear infinite;
-moz-animation: spin 2s linear infinite;
-o-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
z-index: 1001;
}
#loader:before {
content: '';
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #fff;
-webkit-animation: spin 3s linear infinite;
-moz-animation: spin 3s linear infinite;
-o-animation: spin 3s linear infinite;
-ms-animation: spin 3s linear infinite;
animation: spin 3s linear infinite;
}
#loader:after {
content: '';
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #fff;
-moz-animation: spin 1.5s linear infinite;
-o-animation: spin 1.5s linear infinite;
-ms-animation: spin 1.5s linear infinite;
-webkit-animation: spin 1.5s linear infinite;
animation: spin 1.5s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
#loader-wrapper .loader-section {
position: fixed;
top: 0;
width: 51%;
height: 100%;
background: #7171c6;
z-index: 1000;
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
#loader-wrapper .loader-section.section-left {
left: 0;
}
#loader-wrapper .loader-section.section-right {
right: 0;
}
.loaded #loader-wrapper .loader-section.section-left {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.loaded #loader-wrapper .loader-section.section-right {
-webkit-transform: translateX(100%);
-ms-transform: translateX(100%);
transform: translateX(100%);
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.loaded #loader {
opacity: 0;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.loaded #loader-wrapper {
visibility: hidden;
-webkit-transform: translateY(-100%);
-ms-transform: translateY(-100%);
transform: translateY(-100%);
-webkit-transition: all 0.3s 1s ease-out;
transition: all 0.3s 1s ease-out;
}
.no-js #loader-wrapper {
display: none;
}
.no-js h1 {
color: #222222;
}
#loader-wrapper .load_title {
font-family: 'Open Sans';
color: #fff;
font-size: 19px;
width: 100%;
text-align: center;
z-index: 9999999999999;
position: absolute;
top: 60%;
opacity: 1;
line-height: 30px;
}
#loader-wrapper .load_title span {
font-weight: normal;
font-style: italic;
font-size: 13px;
color: #fff;
opacity: 0.5;
}
</style>
</head>
<body>
<div id="app">
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div class="load_title">正在加载系统资源,请耐心等待</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
<script>
// 设置超时检测
setTimeout(function () {
// 如果5秒后页面仍在加载中尝试恢复会话
if (document.querySelector('#loader-wrapper')) {
console.log('页面加载时间过长,尝试恢复会话...');
// 获取URL参数或localStorage中的token
const urlParams = new URLSearchParams(window.location.search);
const accessToken = urlParams.get('accessToken') || localStorage.getItem('accessToken') || localStorage.getItem('pddToken');
if (accessToken) {
console.log('找到token正在设置cookie并刷新页面...');
// 设置多个cookie以确保兼容性
document.cookie = `accessToken=${accessToken}; path=/; max-age=86400; secure`;
document.cookie = `pddToken=${accessToken}; path=/; max-age=86400; secure`;
document.cookie = `pati=${accessToken}; path=/; secure`;
// 同时更新localStorage
localStorage.setItem('accessToken', accessToken);
localStorage.setItem('pddToken', accessToken);
// 检查是否在注册页面
if (window.location.pathname.includes('/register')) {
console.log('当前在注册页面正在处理PDD参数...');
// 获取其他PDD参数
const pddMallId = urlParams.get('pddMallId') || localStorage.getItem('pddMallId');
const pddMallName = urlParams.get('pddMallName') || localStorage.getItem('pddMallName');
const type = urlParams.get('type') || localStorage.getItem('pddType');
const skuSpec = urlParams.get('skuSpec') || localStorage.getItem('skuSpec');
// 保存到localStorage
if (pddMallId) localStorage.setItem('pddMallId', pddMallId);
if (pddMallName) {
try {
const decodedName = decodeURIComponent(pddMallName);
localStorage.setItem('pddMallName', decodedName);
} catch (e) {
localStorage.setItem('pddMallName', pddMallName);
}
}
if (type) localStorage.setItem('pddType', type);
if (skuSpec) {
try {
const decodedSpec = decodeURIComponent(skuSpec);
localStorage.setItem('skuSpec', decodedSpec);
} catch (e) {
localStorage.setItem('skuSpec', skuSpec);
}
}
}
// 刷新页面
window.location.reload();
} else {
console.log('未找到token尝试重定向到登录页...');
// 如果不在登录或注册页面,重定向到登录页
if (!window.location.pathname.includes('/login') && !window.location.pathname.includes('/register')) {
window.location.href = '/login';
} else {
// 如果已经在登录或注册页面,只需刷新
window.location.reload();
}
}
}
}, 5000);
// 添加全局错误处理
window.addEventListener('error', function (e) {
console.error('捕获到页面错误:', e);
// 记录错误并尝试恢复
const accessToken = localStorage.getItem('accessToken') || localStorage.getItem('pddToken');
if (accessToken) {
document.cookie = `accessToken=${accessToken}; path=/; secure`;
document.cookie = `pddToken=${accessToken}; path=/; secure`;
console.log('尝试恢复会话...');
}
});
</script>
</body>
</html>

BIN
kefuweixin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

98
package.json Normal file
View File

@ -0,0 +1,98 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"name": "ruoyi-vue-plus",
"version": "5.3.0",
"description": "与书同行",
"author": "LionLi",
"license": "MIT",
"type": "module",
"scripts": {
"dev": "vite serve --mode development",
"build:prod": "vite build --mode production",
"build:dev": "vite build --mode development",
"preview": "vite preview",
"lint:eslint": "eslint",
"lint:eslint:fix": "eslint --fix",
"prettier": "prettier --write ."
},
"repository": {
"type": "git",
"url": "https://gitee.com/JavaLionLi/plus-ui.git"
},
"dependencies": {
"@element-plus/icons-vue": "2.3.1",
"@highlightjs/vue-plugin": "2.1.0",
"@vueup/vue-quill": "1.2.0",
"@vueuse/core": "11.3.0",
"@zxing/browser": "^0.1.5",
"@zxing/library": "^0.21.3",
"animate.css": "4.1.1",
"await-to-js": "3.0.0",
"axios": "1.7.8",
"blueimp-md5": "^2.19.0",
"crypto-js": "4.2.0",
"diagram-js": "12.3.0",
"didi": "9.0.2",
"echarts": "5.5.0",
"el-table-horizontal-scroll": "^1.2.5",
"element-china-area-data": "^6.1.0",
"element-plus": "2.8.8",
"file-saver": "2.0.5",
"fuse.js": "7.0.0",
"highlight.js": "11.9.0",
"image-conversion": "2.1.1",
"js-cookie": "3.0.5",
"jsencrypt": "3.3.2",
"nprogress": "0.2.0",
"pdf-lib": "^1.17.1",
"pinia": "2.2.6",
"qrcode-vue": "^1.2.0",
"qrcode.vue": "^3.6.0",
"screenfull": "6.0.2",
"vue": "3.5.13",
"vue-barcode": "^1.3.0",
"vue-cropper": "1.1.1",
"vue-i18n": "10.0.5",
"vue-json-pretty": "2.4.0",
"vue-router": "4.4.5",
"vue-types": "5.1.3",
"vuedraggable": "^4.1.0",
"vxe-table": "4.5.22"
},
"devDependencies": {
"@eslint/js": "9.15.0",
"@iconify/json": "2.2.276",
"@types/blueimp-md5": "^2.18.2",
"@types/crypto-js": "4.2.2",
"@types/file-saver": "2.0.7",
"@types/js-cookie": "3.0.6",
"@types/node": "18.18.2",
"@types/nprogress": "0.2.3",
"@unocss/preset-attributify": "0.64.1",
"@unocss/preset-icons": "0.64.1",
"@unocss/preset-uno": "0.64.1",
"@vitejs/plugin-vue": "5.0.4",
"@vue/compiler-sfc": "3.4.23",
"autoprefixer": "10.4.18",
"eslint": "9.15.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "9.31.0",
"fast-glob": "3.3.2",
"globals": "15.12.0",
"postcss": "8.4.36",
"prettier": "3.2.5",
"sass": "1.72.0",
"typescript": "5.7.2",
"typescript-eslint": "8.16.0",
"unocss": "0.64.1",
"unplugin-auto-import": "0.17.5",
"unplugin-icons": "0.18.5",
"unplugin-vue-components": "0.26.0",
"unplugin-vue-setup-extend-plus": "1.0.1",
"vite": "5.4.11",
"vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1",
"vitest": "1.5.0",
"vue-tsc": "2.0.13"
}
}

682
public/1.html Normal file
View File

@ -0,0 +1,682 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>电商数据看板 · 今日真实</title>
<!-- 使用 ECharts 5 -->
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Microsoft YaHei', sans-serif; }
body {
background: #0a1020;
overflow: hidden;
color: #fff;
}
.dashboard {
width: 100vw;
height: 100vh;
padding: 20px;
display: flex;
flex-direction: column;
background: #0a1020;
gap: 20px;
}
/* 顶部KPI行 */
.kpi-row {
margin-top: 30px;
margin-bottom: 65px;
display: flex;
gap: 18px;
height: 130px;
}
.kpi-card {
flex: 1;
background: rgba(20, 32, 55, 0.8);
backdrop-filter: blur(5px);
border: 1px solid #2a4a99;
border-radius: 24px;
padding: 20px;
border-bottom: 4px solid #2a4a99;
box-shadow: 0 10px 30px -10px #000;
}
.kpi-card.today {
border-bottom-color: #ffb347;
background: rgba(32, 58, 106, 0.8);
}
.kpi-label {
font-size: 15px;
color: #aac0ff;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 6px;
}
.dot {
width: 10px;
height: 10px;
border-radius: 10px;
background: #ffb347;
box-shadow: 0 0 10px #ffb347;
}
.kpi-value {
font-size: 46px;
font-weight: 700;
line-height: 1;
color: #fff;
text-shadow: 0 0 15px #4d7eff;
}
.kpi-sub {
font-size: 13px;
color: #99b0e0;
margin-top: 8px;
padding-left: 8px;
border-left: 3px solid #ffb347;
}
/* 图表区域 - 网格布局 */
.charts-grid {
flex: 1;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: auto 1fr;
gap: 20px;
min-height: 0;
}
.chart-card {
background: rgba(15, 25, 45, 0.8);
backdrop-filter: blur(5px);
border: 1px solid #2a4a99;
border-radius: 24px;
padding: 16px;
display: flex;
flex-direction: column;
}
.chart-title {
font-size: 16px;
color: #c0d0ff;
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 8px;
}
.chart-title .dot {
width: 8px;
height: 8px;
background: #4fe0b0;
box-shadow: 0 0 10px #4fe0b0;
}
.chart-container {
margin-top: 40px;
flex: 1;
width: 100%;
min-height: 300px;
}
/* 右侧面板特殊处理 */
.span-2 {
grid-column: span 2;
}
/* 城市列表 */
.city-list {
list-style: none;
height: 100%;
overflow-y: auto;
padding-right: 5px;
}
.city-item {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #2a4a99;
font-size: 14px;
color: #d0e0ff;
}
.city-item span:last-child {
background: #1e3a7a;
padding: 2px 12px;
border-radius: 20px;
font-size: 13px;
}
/* 滚动条 */
.city-list::-webkit-scrollbar {
width: 4px;
}
.city-list::-webkit-scrollbar-track {
background: #1a2a4a;
}
.city-list::-webkit-scrollbar-thumb {
background: #3a6ab0;
border-radius: 2px;
}
/* 底部标记 */
.footer-note {
grid-column: span 3;
text-align: center;
color: #7a98d0;
font-size: 13px;
border-top: 1px dashed #2a4a99;
padding-top: 20px;
margin-top: 30px;
}
.glow { color: #ffb347; font-weight: 600; }
</style>
</head>
<body>
<div class="dashboard">
<!-- 顶部KPI: 今日订单唯一真实 -->
<div class="kpi-row">
<div class="kpi-card today">
<div class="kpi-label">📅 今日订单 </div>
<div class="kpi-value" id="todayOrder">0</div>
<!-- <div class="kpi-sub">📦 唯一真实数据,固定不变</div> -->
</div>
<div class="kpi-card">
<div class="kpi-label">💰 今日总额</div>
<div class="kpi-value" id="todayAmount">0</div>
<!-- <div class="kpi-sub">⬆️ 客单价 ¥698</div> -->
</div>
<div class="kpi-card">
<div class="kpi-label">📅 本月订单</div>
<div class="kpi-value" id="totalOrder">0</div>
<!-- <div class="kpi-sub">📊 环比 +8.1%</div> -->
</div>
<div class="kpi-card">
<div class="kpi-label">💰 本月总额</div>
<div class="kpi-value" id="totalAmount">0</div>
<!-- <div class="kpi-sub">🚚 履约率 93.8%</div> -->
</div>
</div>
<!-- 图表网格区域 -->
<div class="charts-grid">
<!-- 图表1: 订单展示 -->
<div class="chart-card">
<div class="chart-title"><span class="dot"></span> 订单展示</div>
<ul class="city-list" id="cityRankList"></ul>
</div>
<!-- 图表2: 小时分布 -->
<div class="chart-card">
<div class="chart-title"><span class="dot"></span> 小时订单分布</div>
<div class="chart-container" id="hourChart"></div>
</div>
<!-- 图表3: 客单价区间 -->
<div class="chart-card">
<div class="chart-title"><span class="dot"></span> 客单价区间</div>
<div class="chart-container" id="priceChart"></div>
</div>
<!-- 底部说明 -->
<div class="footer-note">
<span class="glow">⚡ 今日订单: <span id="todayOnlySpan">0</span> </span> · 数据每小时自动更新
</div>
</div>
</div>
<script>
(function() {
// ================= 真实今日订单 =================
let TODAY_REAL = 15728;
let userId = '';
// 全局变量用于存储用户ID
window.userId = '';
console.log('1.html脚本开始执行');
// 接收来自父窗口的用户ID
function handleMessage(event) {
console.log('接收到消息:', event.data);
if (event.data && event.data.userId) {
window.userId = event.data.userId;
console.log('接收到用户ID:', window.userId);
// 收到用户ID后立即获取所有数据
fetchOrderCount();
fetchTodaySale(); // 启用
fetchMonthCount(); // 启用
fetchMonthSale(); // 启用
fetchOrderDisplay(); // 启用
fetchHourOrder(); // 启用小时订单分布数据
fetchOrderAmount(); // 启用客单价区间数据
} else if (event.data) {
console.log('消息数据中没有userId字段:', event.data);
}
}
// 绑定消息事件监听器
console.log('绑定message事件监听器');
window.addEventListener('message', handleMessage);
// 测试:手动触发一次,验证监听器是否工作
setTimeout(() => {
console.log('测试检查message事件监听器是否绑定');
console.log('当前window.userId:', window.userId);
}, 1500);
// 暴露全局方法,让父窗口直接调用
window.setUserId = function(id) {
console.log('通过全局方法设置用户ID:', id);
window.userId = id;
fetchOrderCount();
fetchTodaySale(); // 启用
fetchMonthCount(); // 启用
fetchMonthSale(); // 启用
fetchOrderDisplay(); // 启用
fetchHourOrder(); // 启用小时订单分布数据
fetchOrderAmount(); // 启用客单价区间数据
};
// 从API获取订单总数
async function fetchOrderCount() {
try {
console.log('开始获取订单总数...');
console.log('当前用户ID:', window.userId);
// 构建请求URL包含用户ID参数
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/todayCount/${window.userId}`;
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
TODAY_REAL = await response.json();
console.log('获取订单总数成功:', TODAY_REAL);
document.getElementById('todayOrder').innerText = TODAY_REAL.toLocaleString();
document.getElementById('todayOnlySpan').innerText = TODAY_REAL.toLocaleString();
} else {
console.error('获取订单总数失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取订单总数异常:', error);
}
}
// 从API获取今日交易总额
async function fetchTodaySale() {
try {
console.log('开始获取今日交易总额...');
console.log('当前用户ID:', window.userId);
// 构建请求URL包含用户ID参数
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/todaySale/${window.userId}`;
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
const totalSale = await response.json();
console.log('获取今日交易总额成功:', totalSale);
// 后台返回单位是分,转换为元
const totalSaleInYuan = parseFloat(totalSale) / 100;
// 格式化显示,单位为元
const formattedAmount = totalSaleInYuan.toLocaleString('zh-CN', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
document.getElementById('todayAmount').innerText = `¥ ${formattedAmount}`;
} else {
console.error('获取今日交易总额失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取今日交易总额异常:', error);
}
}
// 从API获取本月订单总数
async function fetchMonthCount() {
try {
console.log('开始获取本月订单总数...');
console.log('当前用户ID:', window.userId);
// 构建请求URL包含用户ID参数
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/totalCount/${window.userId}`;
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
const monthCount = await response.json();
console.log('获取本月订单总数成功:', monthCount);
document.getElementById('totalOrder').innerText = monthCount.toLocaleString();
} else {
console.error('获取本月订单总数失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取本月订单总数异常:', error);
}
}
// 从API获取本月交易总额
async function fetchMonthSale() {
try {
console.log('开始获取本月交易总额...');
console.log('当前用户ID:', window.userId);
// 构建请求URL包含用户ID参数
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/totalSale/${window.userId}`;
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
const totalSale = await response.json();
console.log('获取本月交易总额成功:', totalSale);
// 后台返回单位是分,转换为元
const totalSaleInYuan = parseFloat(totalSale) / 100;
// 格式化显示,单位为元
const formattedAmount = totalSaleInYuan.toLocaleString('zh-CN', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
document.getElementById('totalAmount').innerText = `¥ ${formattedAmount}`;
} else {
console.error('获取本月交易总额失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取本月交易总额异常:', error);
}
}
// 初始化时不立即调用等待接收用户ID后再调用
// fetchOrderCount();
// 随机函数
function random(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
// ================= 刷新卡片假数据 =================
function refreshCards() {
document.getElementById('totalOrder').innerText = random(330000, 480000).toLocaleString();
document.getElementById('totalAmount').innerText = random(18000, 53000).toLocaleString();
let total = random(21000000, 35000000).toLocaleString('zh-CN', {
minimumFractionDigits: 2,
maximumFractionDigits: 2
});
document.getElementById('todayAmount').innerText = '¥ ' + total;
}
// refreshCards(); // 暂时注释掉,等待真实数据
// ================= 城市排行数据 =================
async function fetchOrderDisplay() {
try {
console.log('开始获取订单展示数据...');
console.log('当前用户ID:', window.userId);
// 构建请求URL根据后台API签名需要传递路径参数和查询参数
// 路径参数id为用户ID查询参数id为1触发外部接口调用shopIdList为空列表
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/orderDisplay/${window.userId}`;
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
const data = await response.json();
console.log('获取订单展示数据成功:', data);
updateCityRank(data);
} else {
console.error('获取订单展示数据失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取订单展示数据异常:', error);
}
}
// ================= 小时订单分布数据 =================
async function fetchHourOrder() {
try {
console.log('开始获取小时订单分布数据...');
console.log('当前用户ID:', window.userId);
// 检查用户ID是否存在
if (!window.userId) {
console.error('用户ID不存在无法获取小时订单分布数据');
return;
}
// 构建请求URL
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/hourOrder/${window.userId}`;
console.log('请求URL:', url);
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
const data = await response.json();
console.log('获取小时订单分布数据成功:', data);
updateHourChart(data);
} else {
console.error('获取小时订单分布数据失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取小时订单分布数据异常:', error);
}
}
// ================= 客单价区间数据 =================
async function fetchOrderAmount() {
try {
console.log('开始获取客单价区间数据...');
console.log('当前用户ID:', window.userId);
// 检查用户ID是否存在
if (!window.userId) {
console.error('用户ID不存在无法获取客单价区间数据');
return;
}
// 构建请求URL
const url = `https://api.buzhiyushu.cn/zhishu/shopOrder/orderAmount/${window.userId}`;
console.log('请求URL:', url);
const response = await fetch(url);
console.log('请求状态:', response.status, response.statusText);
if (response.ok) {
const data = await response.json();
console.log('获取客单价区间数据成功:', data);
updatePriceChart(data);
} else {
console.error('获取客单价区间数据失败,响应状态:', response.status);
}
} catch (error) {
console.error('获取客单价区间数据异常:', error);
}
}
function updateCityRank(data) {
const listEl = document.getElementById('cityRankList');
// 转换为数组并排序
const cityData = Object.entries(data)
.map(([name, value]) => ({ name, value }))
.sort((a, b) => b.value - a.value);
let html = '';
cityData.slice(0, 10).forEach(item => {
html += `<li class="city-item"><span>${item.name}</span><span>${item.value.toLocaleString()} 单</span></li>`;
});
listEl.innerHTML = html;
}
// 初始化时不立即调用等待接收用户ID后再调用
// fetchOrderDisplay();
// ================= 初始化所有图表 =================
// 小时分布
let hourChart;
// 客单价区间
let priceChart;
// 初始化图表实例
function initChartInstances() {
if (document.getElementById('hourChart')) {
hourChart = echarts.init(document.getElementById('hourChart'));
console.log('小时订单分布图表实例初始化成功');
} else {
console.error('小时订单分布图表容器不存在');
}
if (document.getElementById('priceChart')) {
priceChart = echarts.init(document.getElementById('priceChart'));
console.log('客单价区间图表实例初始化成功');
} else {
console.error('客单价区间图表容器不存在');
}
}
// 页面加载完成后初始化图表实例
window.addEventListener('load', initChartInstances);
// 通用图表主题配置
const chartTheme = {
backgroundColor: 'transparent',
textStyle: { color: '#c0d0ff' },
grid: { left: '5%', right: '5%', top: 30, bottom: 15, containLabel: true },
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
xAxis: {
axisLine: { lineStyle: { color: '#2a4a99' } },
axisLabel: { color: '#99b0e0' }
},
yAxis: {
axisLine: { lineStyle: { color: '#2a4a99' } },
axisLabel: { color: '#99b0e0' },
splitLine: { lineStyle: { color: '#1a2a4a', type: 'dashed' } }
},
legend: { textStyle: { color: '#c0d0ff' } }
};
// 更新小时分布
function updateHourChart(data = null) {
const hours = Array.from({ length: 24 }, (_, i) => i + '时');
let orderData = Array(24).fill(0); // 初始化24小时数据为0
if (data) {
// 使用API返回的真实数据
for (const [key, value] of Object.entries(data)) {
// 解析键格式:"2026-02-26 00:00"
const hourMatch = key.match(/\s(\d{2}):\d{2}$/);
if (hourMatch) {
const hour = parseInt(hourMatch[1]);
if (hour >= 0 && hour < 24) {
orderData[hour] = value;
}
}
}
} else {
// 模拟数据当API调用失败时使用
for (let i = 0; i < 24; i++) {
// 模拟白天订单多
if (i >= 9 && i <= 21) {
orderData[i] = random(3000, 6000);
} else {
orderData[i] = random(500, 2000);
}
}
}
hourChart.setOption({
...chartTheme,
xAxis: { ...chartTheme.xAxis, data: hours },
yAxis: { ...chartTheme.yAxis, name: '订单量' },
series: [{
type: 'line',
data: orderData,
smooth: true,
lineStyle: { color: '#6b8cff', width: 2 },
areaStyle: { color: 'rgba(107, 140, 255, 0.2)' },
symbol: 'none'
}]
});
}
// 更新客单价区间
function updatePriceChart(data = null) {
const ranges = ['0-10元', '10-30元', '30-50元', '50-100元', '100元以上'];
let chartData = [];
if (data) {
// 使用API返回的真实数据
// 确保数据按顺序对应各个区间
chartData = ranges.map(range => data[range] || 0);
} else {
// 模拟数据当API调用失败时使用
chartData = ranges.map(() => random(10, 40));
}
priceChart.setOption({
...chartTheme,
xAxis: { ...chartTheme.xAxis, data: ranges },
yAxis: { ...chartTheme.yAxis, name: '订单数' },
series: [{
type: 'bar',
data: chartData,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#ffb347' },
{ offset: 1, color: '#ff8a4a' }
]),
borderRadius: [4, 4, 0, 0]
},
barWidth: 20
}]
});
}
// 初始化所有图表
function initAllCharts() {
// 确保图表实例已经初始化
if (!hourChart || !priceChart) {
console.error('图表实例未初始化,无法更新图表');
return;
}
if (window.userId) {
fetchHourOrder(); // 调用API获取小时订单分布数据
fetchOrderAmount(); // 调用API获取客单价区间数据
} else {
// 如果用户ID不存在使用模拟数据初始化图表
updateHourChart();
updatePriceChart();
}
}
// 页面加载完成后初始化所有图表
window.addEventListener('load', function() {
// 等待图表实例初始化完成
setTimeout(initAllCharts, 100);
});
// 窗口自适应
window.addEventListener('resize', () => {
if (hourChart) {
hourChart.resize();
}
if (priceChart) {
priceChart.resize();
}
});
// ================= 定时刷新所有数据 =================
setInterval(() => {
refreshCards();
// 更新所有数据
fetchOrderCount();
fetchTodaySale(); // 启用
fetchMonthCount(); // 启用
fetchMonthSale(); // 启用
fetchOrderDisplay(); // 启用
fetchHourOrder(); // 启用小时订单分布数据
fetchOrderAmount(); // 启用客单价区间数据
// 不再需要单独调用updatePriceChart因为fetchOrderAmount会调用它
}, 3600000); // 每小时刷新一次3600000毫秒
})();
</script>
</body>
</html>

BIN
public/favicon-log.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

BIN
public/kefuweixin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Binary file not shown.

BIN
public/utilFile/CLodop.zip Normal file

Binary file not shown.

Binary file not shown.

165
src/App.vue Normal file
View File

@ -0,0 +1,165 @@
<template>
<el-config-provider :locale="appStore.locale" :size="appStore.size">
<router-view />
</el-config-provider>
</template>
<script setup lang="ts">
import useSettingsStore from '@/store/modules/settings';
import { handleThemeStyle } from '@/utils/theme';
import useAppStore from '@/store/modules/app';
import router from '@/router';
const appStore = useAppStore();
// URLlocalStorage
const urlParams = new URLSearchParams(window.location.search);
const currentPath = window.location.pathname;
// console.log(':', currentPath);
// console.log('URL:', Object.fromEntries(urlParams.entries()));
// token
const token = urlParams.get('token');
if (token) {
localStorage.setItem('token', token);
// pddToken使
localStorage.setItem('pddToken', token);
// console.log('token:', token);
}
//
const code = urlParams.get('code');
if (code) {
localStorage.setItem('inviteCode', code);
// console.log(':', code);
}
//
const pddMallId = urlParams.get('pddMallId');
if (pddMallId) {
localStorage.setItem('pddMallId', pddMallId);
// console.log('pddMallId:', pddMallId);
}
const pddMallName = urlParams.get('pddMallName');
if (pddMallName) {
try {
// URL
const decodedPddMallName = decodeURIComponent(pddMallName);
localStorage.setItem('pddMallName', decodedPddMallName);
// console.log('pddMallName:', decodedPddMallName);
} catch (e) {
console.error('解码店铺名称失败:', e);
localStorage.setItem('pddMallName', pddMallName);
}
}
const skuSpec = urlParams.get('skuSpec');
if (skuSpec) {
try {
// URL
const decodedSkuSpec = decodeURIComponent(skuSpec);
localStorage.setItem('skuSpec', decodedSkuSpec);
// console.log('skuSpec:', decodedSkuSpec);
} catch (e) {
console.error('解码skuSpec名称失败:', e);
localStorage.setItem('skuSpec', skuSpec);
}
}
const type = urlParams.get('type');
if (type) {
localStorage.setItem('pddType', type);
}
// token
const pddToken = urlParams.get('accessToken');
if (pddToken) {
// 使accessToken
localStorage.setItem('accessToken', pddToken);
localStorage.setItem('pddToken', pddToken); //
// cookiedomain
document.cookie = `accessToken=${pddToken}; path=/; max-age=86400; secure`;
document.cookie = `pddToken=${pddToken}; path=/; max-age=86400; secure`;
document.cookie = `pati=${pddToken}; path=/; max-age=86400; secure`;
console.log('已设置accessToken cookie:', pddToken);
}
// URL
if ((token || code) && !currentPath.includes('/register')) {
// console.log('URL');
window.history.replaceState(null, '', window.location.pathname);
} else {
// console.log('URL');
}
// cookie/session
const checkAndSetCookies = () => {
// pddToken
const hasPddToken = localStorage.getItem('pddToken') || document.cookie.includes('pddToken=');
if (!hasPddToken && window.location.pathname.includes('/register')) {
console.log('未检测到pddToken正在创建...');
// URLaccessToken
const accessToken = urlParams.get('accessToken');
if (accessToken) {
// localStorage
localStorage.setItem('pddToken', accessToken);
// cookie7
const expiryDate = new Date();
expiryDate.setDate(expiryDate.getDate() + 7);
document.cookie = `pddToken=${accessToken}; expires=${expiryDate.toUTCString()}; path=/`;
console.log('已创建pddToken:', accessToken);
} else {
// URLaccessTokentoken
const tempToken = 'temp_' + Math.random().toString(36).substring(2, 15);
localStorage.setItem('pddToken', tempToken);
document.cookie = `pddToken=${tempToken}; path=/`;
console.log('已创建临时token:', tempToken);
}
}
};
//
checkAndSetCookies();
//
// console.log('localStorage:');
// console.log('- token:', localStorage.getItem('token'));
// console.log('- pddToken:', localStorage.getItem('pddToken'));
// console.log('- inviteCode:', localStorage.getItem('inviteCode'));
// console.log('- pddMallId:', localStorage.getItem('pddMallId'));
// console.log('- pddMallName:', localStorage.getItem('pddMallName'));
// console.log('- pddType:', localStorage.getItem('pddType'));
// console.log('- skuSpec:', localStorage.getItem('skuSpec'));
onMounted(() => {
const isWeChat=isWeChatBrowser();
console.log(isWeChat)
if(isWeChat){
//404
router.push({ name: 'NotFound' }) // name NotFound
return //
}
nextTick(() => {
//
handleThemeStyle(useSettingsStore().theme);
});
});
//
function isWeChatBrowser() {
const ua = navigator.userAgent.toLowerCase();
//
return /micromessenger/i.test(ua) && !/wxwork/i.test(ua);
}
</script>

48
src/animate.ts Normal file
View File

@ -0,0 +1,48 @@
// 前缀
const animatePrefix = 'animate__animated ';
// 开启随机动画 随机动画值
const animateList: string[] = [
animatePrefix + 'animate__pulse',
animatePrefix + 'animate__rubberBand',
animatePrefix + 'animate__bounceIn',
animatePrefix + 'animate__bounceInLeft',
animatePrefix + 'animate__fadeIn',
animatePrefix + 'animate__fadeInLeft',
animatePrefix + 'animate__fadeInDown',
animatePrefix + 'animate__fadeInUp',
animatePrefix + 'animate__flipInX',
animatePrefix + 'animate__lightSpeedInLeft',
animatePrefix + 'animate__rotateInDownLeft',
animatePrefix + 'animate__rollIn',
animatePrefix + 'animate__rotateInDownLeft',
animatePrefix + 'animate__zoomIn',
animatePrefix + 'animate__zoomInDown',
animatePrefix + 'animate__slideInLeft',
animatePrefix + 'animate__lightSpeedIn'
];
// 关闭随机动画后的默认效果
const defaultAnimate = animatePrefix + 'animate__fadeIn';
// 搜索隐藏显示动画
const searchAnimate = {
enter: '',
leave: ''
};
// 菜单搜索动画
const menuSearchAnimate = {
enter: animatePrefix + 'animate__fadeIn',
leave: animatePrefix + 'animate__fadeOut'
};
// logo动画
const logoAnimate = {
enter: animatePrefix + 'animate__fadeIn',
leave: animatePrefix + 'animate__fadeOut'
};
export default {
animateList,
defaultAnimate,
searchAnimate,
menuSearchAnimate,
logoAnimate
};

View File

@ -0,0 +1,62 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DemoVO, DemoForm, DemoQuery } from '@/api/demo/demo/types';
/**
*
* @param query
* @returns {*}
*/
export const listDemo = (query?: DemoQuery): AxiosPromise<DemoVO[]> => {
return request({
url: '/demo/demo/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getDemo = (id: string | number): AxiosPromise<DemoVO> => {
return request({
url: '/demo/demo/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addDemo = (data: DemoForm) => {
return request({
url: '/demo/demo',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateDemo = (data: DemoForm) => {
return request({
url: '/demo/demo',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delDemo = (id: string | number | Array<string | number>) => {
return request({
url: '/demo/demo/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,90 @@
export interface DemoVO {
/**
*
*/
id: string | number;
/**
* id
*/
deptId: string | number;
/**
* id
*/
userId: string | number;
/**
*
*/
orderNum: number;
/**
* key键
*/
testKey: string;
/**
*
*/
value: string;
}
export interface DemoForm extends BaseEntity {
/**
*
*/
id?: string | number;
/**
* id
*/
deptId?: string | number;
/**
* id
*/
userId?: string | number;
/**
*
*/
orderNum?: number;
/**
* key键
*/
testKey?: string;
/**
*
*/
value?: string;
}
export interface DemoQuery extends PageQuery {
/**
* id
*/
deptId?: string | number;
/**
* id
*/
userId?: string | number;
/**
*
*/
orderNum?: number;
/**
* key键
*/
testKey?: string;
/**
*
*/
value?: string;
}

View File

@ -0,0 +1,62 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TreeVO, TreeForm, TreeQuery } from '@/api/demo/tree/types';
/**
*
* @param query
* @returns {*}
*/
export const listTree = (query?: TreeQuery): AxiosPromise<TreeVO[]> => {
return request({
url: '/demo/tree/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getTree = (id: string | number): AxiosPromise<TreeVO> => {
return request({
url: '/demo/tree/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addTree = (data: TreeForm) => {
return request({
url: '/demo/tree',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateTree = (data: TreeForm) => {
return request({
url: '/demo/tree',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delTree = (id: string | number | Array<string | number>) => {
return request({
url: '/demo/tree/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,80 @@
export interface TreeVO {
/**
*
*/
id: string | number;
/**
* id
*/
parentId: string | number;
/**
* id
*/
deptId: string | number;
/**
* id
*/
userId: string | number;
/**
*
*/
treeName: string;
/**
*
*/
children: TreeVO[];
}
export interface TreeForm extends BaseEntity {
/**
*
*/
id?: string | number;
/**
* id
*/
parentId?: string | number;
/**
* id
*/
deptId?: string | number;
/**
* id
*/
userId?: string | number;
/**
*
*/
treeName?: string;
}
export interface TreeQuery {
/**
* id
*/
parentId?: string | number;
/**
* id
*/
deptId?: string | number;
/**
* id
*/
userId?: string | number;
/**
*
*/
treeName?: string;
}

113
src/api/login.ts Normal file
View File

@ -0,0 +1,113 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LoginData, LoginResult, VerifyCodeResult, TenantInfo } from './types';
import { UserInfo } from '@/api/system/user/types';
// pc端固定客户端授权id
const clientId = import.meta.env.VITE_APP_CLIENT_ID;
/**
* @param data {LoginData}
* @returns
*/
export function login(data: LoginData): AxiosPromise<LoginResult> {
const params = {
...data,
clientId: data.clientId || clientId,
grantType: data.grantType || 'password'
};
return request({
url: '/auth/login',
headers: {
isToken: false,
isEncrypt: true,
repeatSubmit: false
},
method: 'post',
data: params
});
}
// 注册方法
export function register(data: any) {
const params = {
...data,
clientId: clientId,
grantType: 'password'
};
return request({
url: '/auth/register',
headers: {
isToken: false,
isEncrypt: true,
repeatSubmit: false
},
method: 'post',
data: params
});
}
/**
*
*/
export function logout() {
if (import.meta.env.VITE_APP_SSE === 'true') {
request({
url: '/resource/sse/close',
method: 'get'
});
}
return request({
url: '/auth/logout',
method: 'post'
});
}
/**
*
*/
export function getCodeImg(): AxiosPromise<VerifyCodeResult> {
return request({
url: '/auth/code',
headers: {
isToken: false
},
method: 'get',
timeout: 20000
});
}
/**
*
*/
export function callback(data: LoginData): AxiosPromise<any> {
const LoginData = {
...data,
clientId: clientId,
grantType: 'social'
};
return request({
url: '/auth/social/callback',
method: 'post',
data: LoginData
});
}
// 获取用户详细信息
export function getInfo(): AxiosPromise<UserInfo> {
return request({
url: '/system/user/getInfo',
method: 'get'
});
}
// 获取租户列表
export function getTenantList(isToken: boolean): AxiosPromise<TenantInfo> {
return request({
url: '/auth/tenant/list',
headers: {
isToken: isToken
},
method: 'get'
});
}

11
src/api/menu.ts Normal file
View File

@ -0,0 +1,11 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { RouteRecordRaw } from 'vue-router';
// 获取路由
export function getRouters(): AxiosPromise<RouteRecordRaw[]> {
return request({
url: '/system/menu/getRouters',
method: 'get'
});
}

59
src/api/monitor/cache/index.ts vendored Normal file
View File

@ -0,0 +1,59 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CacheVO } from './types';
// 查询缓存详细
export function getCache(): AxiosPromise<CacheVO> {
return request({
url: '/monitor/cache',
method: 'get'
});
}
// 查询缓存名称列表
export function listCacheName() {
return request({
url: '/monitor/cache/getNames',
method: 'get'
});
}
// 查询缓存键名列表
export function listCacheKey(cacheName: string) {
return request({
url: '/monitor/cache/getKeys/' + cacheName,
method: 'get'
});
}
// 查询缓存内容
export function getCacheValue(cacheName: string, cacheKey: string) {
return request({
url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey,
method: 'get'
});
}
// 清理指定名称缓存
export function clearCacheName(cacheName: string) {
return request({
url: '/monitor/cache/clearCacheName/' + cacheName,
method: 'delete'
});
}
// 清理指定键名缓存
export function clearCacheKey(cacheName: string, cacheKey: string) {
return request({
url: '/monitor/cache/clearCacheKey/' + cacheName + '/' + cacheKey,
method: 'delete'
});
}
// 清理全部缓存
export function clearCacheAll() {
return request({
url: '/monitor/cache/clearCacheAll',
method: 'delete'
});
}

7
src/api/monitor/cache/types.ts vendored Normal file
View File

@ -0,0 +1,7 @@
export interface CacheVO {
commandStats: Array<{ name: string; value: string }>;
dbSize: number;
info: { [key: string]: string };
}

View File

@ -0,0 +1,36 @@
import request from '@/utils/request';
import { LoginInfoQuery, LoginInfoVO } from './types';
import { AxiosPromise } from 'axios';
// 查询登录日志列表
export function list(query: LoginInfoQuery): AxiosPromise<LoginInfoVO[]> {
return request({
url: '/monitor/logininfor/list',
method: 'get',
params: query
});
}
// 删除登录日志
export function delLoginInfo(infoId: string | number | Array<string | number>) {
return request({
url: '/monitor/logininfor/' + infoId,
method: 'delete'
});
}
// 解锁用户登录状态
export function unlockLoginInfo(userName: string | Array<string>) {
return request({
url: '/monitor/logininfor/unlock/' + userName,
method: 'get'
});
}
// 清空登录日志
export function cleanLoginInfo() {
return request({
url: '/monitor/logininfor/clean',
method: 'delete'
});
}

View File

@ -0,0 +1,20 @@
export interface LoginInfoVO {
infoId: string | number;
tenantId: string | number;
userName: string;
status: string;
ipaddr: string;
loginLocation: string;
browser: string;
os: string;
msg: string;
loginTime: string;
}
export interface LoginInfoQuery extends PageQuery {
ipaddr: string;
userName: string;
status: string;
orderByColumn: string;
isAsc: string;
}

View File

@ -0,0 +1,36 @@
import request from '@/utils/request';
import { OnlineQuery, OnlineVO } from './types';
import { AxiosPromise } from 'axios';
// 查询在线用户列表
export function list(query: OnlineQuery): AxiosPromise<OnlineVO[]> {
return request({
url: '/monitor/online/list',
method: 'get',
params: query
});
}
// 强退用户
export function forceLogout(tokenId: string) {
return request({
url: '/monitor/online/' + tokenId,
method: 'delete'
});
}
// 获取当前用户登录在线设备
export function getOnline() {
return request({
url: '/monitor/online',
method: 'get'
});
}
// 删除当前在线设备
export function delOnline(tokenId: string) {
return request({
url: '/monitor/online/myself/' + tokenId,
method: 'delete'
});
}

View File

@ -0,0 +1,15 @@
export interface OnlineQuery extends PageQuery {
ipaddr: string;
userName: string;
}
export interface OnlineVO extends BaseEntity {
tokenId: string;
deptName: string;
userName: string;
ipaddr: string;
loginLocation: string;
browser: string;
os: string;
loginTime: number;
}

View File

@ -0,0 +1,28 @@
import request from '@/utils/request';
import { OperLogQuery, OperLogVO } from './types';
import { AxiosPromise } from 'axios';
// 查询操作日志列表
export function list(query: OperLogQuery): AxiosPromise<OperLogVO[]> {
return request({
url: '/monitor/operlog/list',
method: 'get',
params: query
});
}
// 删除操作日志
export function delOperlog(operId: string | number | Array<string | number>) {
return request({
url: '/monitor/operlog/' + operId,
method: 'delete'
});
}
// 清空操作日志
export function cleanOperlog() {
return request({
url: '/monitor/operlog/clean',
method: 'delete'
});
}

View File

@ -0,0 +1,53 @@
export interface OperLogQuery extends PageQuery {
operIp: string;
title: string;
operName: string;
businessType: string;
status: string;
orderByColumn: string;
isAsc: string;
}
export interface OperLogVO extends BaseEntity {
operId: string | number;
tenantId: string;
title: string;
businessType: number;
businessTypes: number[] | undefined;
method: string;
requestMethod: string;
operatorType: number;
operName: string;
deptName: string;
operUrl: string;
operIp: string;
operLocation: string;
operParam: string;
jsonResult: string;
status: number;
errorMsg: string;
operTime: string;
costTime: number;
}
export interface OperLogForm {
operId: number | string | undefined;
tenantId: string | number | undefined;
title: string;
businessType: number;
businessTypes: number[] | undefined;
method: string;
requestMethod: string;
operatorType: number;
operName: string;
deptName: string;
operUrl: string;
operIp: string;
operLocation: string;
operParam: string;
jsonResult: string;
status: number;
errorMsg: string;
operTime: string;
costTime: number;
}

View File

@ -0,0 +1,80 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ClientVO, ClientForm, ClientQuery } from '@/api/system/client/types';
/**
*
* @param query
* @returns {*}
*/
export const listClient = (query?: ClientQuery): AxiosPromise<ClientVO[]> => {
return request({
url: '/system/client/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getClient = (id: string | number): AxiosPromise<ClientVO> => {
return request({
url: '/system/client/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addClient = (data: ClientForm) => {
return request({
url: '/system/client',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateClient = (data: ClientForm) => {
return request({
url: '/system/client',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delClient = (id: string | number | Array<string | number>) => {
return request({
url: '/system/client/' + id,
method: 'delete'
});
};
/**
*
* @param clientId id
* @param status
*/
export function changeStatus(clientId: string, status: string) {
const data = {
clientId,
status
};
return request({
url: '/system/client/changeStatus',
method: 'put',
data: data
});
}

View File

@ -0,0 +1,135 @@
export interface ClientVO {
/**
* id
*/
id: string | number;
/**
* id
*/
clientId: string;
/**
* key
*/
clientKey: string;
/**
*
*/
clientSecret: string;
/**
*
*/
grantTypeList: string[];
/**
*
*/
deviceType: string;
/**
* token活跃超时时间
*/
activeTimeout: number;
/**
* token固定超时
*/
timeout: number;
/**
* 0 1
*/
status: string;
}
export interface ClientForm extends BaseEntity {
/**
* id
*/
id?: string | number;
/**
* id
*/
clientId?: string | number;
/**
* key
*/
clientKey?: string;
/**
*
*/
clientSecret?: string;
/**
*
*/
grantTypeList?: string[];
/**
*
*/
deviceType?: string;
/**
* token活跃超时时间
*/
activeTimeout?: number;
/**
* token固定超时
*/
timeout?: number;
/**
* 0 1
*/
status?: string;
}
export interface ClientQuery extends PageQuery {
/**
* id
*/
clientId?: string | number;
/**
* key
*/
clientKey?: string;
/**
*
*/
clientSecret?: string;
/**
*
*/
grantType?: string;
/**
*
*/
deviceType?: string;
/**
* token活跃超时时间
*/
activeTimeout?: number;
/**
* token固定超时
*/
timeout?: number;
/**
* 0 1
*/
status?: string;
}

View File

@ -0,0 +1,74 @@
import request from '@/utils/request';
import { ConfigForm, ConfigQuery, ConfigVO } from './types';
import { AxiosPromise } from 'axios';
// 查询参数列表
export function listConfig(query: ConfigQuery): AxiosPromise<ConfigVO[]> {
return request({
url: '/system/config/list',
method: 'get',
params: query
});
}
// 查询参数详细
export function getConfig(configId: string | number): AxiosPromise<ConfigVO> {
return request({
url: '/system/config/' + configId,
method: 'get'
});
}
// 根据参数键名查询参数值
export function getConfigKey(configKey: string): AxiosPromise<string> {
return request({
url: '/system/config/configKey/' + configKey,
method: 'get'
});
}
// 新增参数配置
export function addConfig(data: ConfigForm) {
return request({
url: '/system/config',
method: 'post',
data: data
});
}
// 修改参数配置
export function updateConfig(data: ConfigForm) {
return request({
url: '/system/config',
method: 'put',
data: data
});
}
// 修改参数配置
export function updateConfigByKey(key: string, value: any) {
return request({
url: '/system/config/updateByKey',
method: 'put',
data: {
configKey: key,
configValue: value
}
});
}
// 删除参数配置
export function delConfig(configId: string | number | Array<string | number>) {
return request({
url: '/system/config/' + configId,
method: 'delete'
});
}
// 刷新参数缓存
export function refreshCache() {
return request({
url: '/system/config/refreshCache',
method: 'delete'
});
}

View File

@ -0,0 +1,23 @@
export interface ConfigVO extends BaseEntity {
configId: number | string;
configName: string;
configKey: string;
configValue: string;
configType: string;
remark: string;
}
export interface ConfigForm {
configId: number | string | undefined;
configName: string;
configKey: string;
configValue: string;
configType: string;
remark: string;
}
export interface ConfigQuery extends PageQuery {
configName: string;
configKey: string;
configType: string;
}

View File

@ -0,0 +1,73 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {DeptForm, DeptQuery, DeptTreeVO, DeptVO} from './types';
// 查询部门列表
export const listDept = (query?: DeptQuery) => {
return request({
url: '/system/dept/list',
method: 'get',
params: query
});
};
/**
* deptIds查询部门
* @param deptIds
*/
export const optionSelect = (deptIds: (number | string)[]): AxiosPromise<DeptVO[]> => {
return request({
url: '/system/dept/optionselect?deptIds=' + deptIds,
method: 'get'
});
};
// 查询部门列表(排除节点)
export const listDeptExcludeChild = (deptId: string | number): AxiosPromise<DeptVO[]> => {
return request({
url: '/system/dept/list/exclude/' + deptId,
method: 'get'
});
};
// 查询部门详细
export const getDept = (deptId: string | number): AxiosPromise<DeptVO> => {
return request({
url: '/system/dept/' + deptId,
method: 'get'
});
};
// 查询部门下拉树结构
export const treeselect = (): AxiosPromise<DeptTreeVO[]> => {
return request({
url: '/system/dept/treeselect',
method: 'get'
});
};
// 新增部门
export const addDept = (data: DeptForm) => {
return request({
url: '/system/dept',
method: 'post',
data: data
});
};
// 修改部门
export const updateDept = (data: DeptForm) => {
return request({
url: '/system/dept',
method: 'put',
data: data
});
};
// 删除部门
export const delDept = (deptId: number | string) => {
return request({
url: '/system/dept/' + deptId,
method: 'delete'
});
};

View File

@ -0,0 +1,60 @@
/**
*
*/
export interface DeptQuery extends PageQuery {
deptName?: string;
deptCategory?: string;
status?: number;
}
/**
*
*/
export interface DeptVO extends BaseEntity {
id: number | string;
parentName: string;
parentId: number | string;
children: DeptVO[];
deptId: number | string;
deptName: string;
deptCategory: string;
orderNum: number;
leader: string;
phone: string;
email: string;
status: string;
delFlag: string;
ancestors: string;
menuId: string | number;
}
/**
*
*/
export interface DeptTreeVO extends BaseEntity {
id: number | string;
label: string;
parentId: number | string;
weight: number;
children: DeptTreeVO[];
disabled: boolean;
}
/**
*
*/
export interface DeptForm {
parentName?: string;
parentId?: number | string;
children?: DeptForm[];
deptId?: number | string;
deptName?: string;
deptCategory?: string;
orderNum?: number;
leader?: string;
phone?: string;
email?: string;
status?: string;
delFlag?: string;
ancestors?: string;
}

View File

@ -0,0 +1,53 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DictDataForm, DictDataQuery, DictDataVO } from './types';
// 根据字典类型查询字典数据信息
export function getDicts(dictType: string): AxiosPromise<DictDataVO[]> {
return request({
url: '/system/dict/data/type/' + dictType,
method: 'get'
});
}
// 查询字典数据列表
export function listData(query: DictDataQuery): AxiosPromise<DictDataVO[]> {
return request({
url: '/system/dict/data/list',
method: 'get',
params: query
});
}
// 查询字典数据详细
export function getData(dictCode: string | number): AxiosPromise<DictDataVO> {
return request({
url: '/system/dict/data/' + dictCode,
method: 'get'
});
}
// 新增字典数据
export function addData(data: DictDataForm) {
return request({
url: '/system/dict/data',
method: 'post',
data: data
});
}
// 修改字典数据
export function updateData(data: DictDataForm) {
return request({
url: '/system/dict/data',
method: 'put',
data: data
});
}
// 删除字典数据
export function delData(dictCode: string | number | Array<string | number>) {
return request({
url: '/system/dict/data/' + dictCode,
method: 'delete'
});
}

View File

@ -0,0 +1,26 @@
export interface DictDataQuery extends PageQuery {
dictName: string;
dictType: string;
dictLabel: string;
}
export interface DictDataVO extends BaseEntity {
dictCode: string;
dictLabel: string;
dictValue: string;
cssClass: string;
listClass: ElTagType;
dictSort: number;
remark: string;
}
export interface DictDataForm {
dictType?: string;
dictCode: string | undefined;
dictLabel: string;
dictValue: string;
cssClass: string;
listClass: ElTagType;
dictSort: number;
remark: string;
}

View File

@ -0,0 +1,62 @@
import request from '@/utils/request';
import { DictTypeForm, DictTypeVO, DictTypeQuery } from './types';
import { AxiosPromise } from 'axios';
// 查询字典类型列表
export function listType(query: DictTypeQuery): AxiosPromise<DictTypeVO[]> {
return request({
url: '/system/dict/type/list',
method: 'get',
params: query
});
}
// 查询字典类型详细
export function getType(dictId: number | string): AxiosPromise<DictTypeVO> {
return request({
url: '/system/dict/type/' + dictId,
method: 'get'
});
}
// 新增字典类型
export function addType(data: DictTypeForm) {
return request({
url: '/system/dict/type',
method: 'post',
data: data
});
}
// 修改字典类型
export function updateType(data: DictTypeForm) {
return request({
url: '/system/dict/type',
method: 'put',
data: data
});
}
// 删除字典类型
export function delType(dictId: string | number | Array<string | number>) {
return request({
url: '/system/dict/type/' + dictId,
method: 'delete'
});
}
// 刷新字典缓存
export function refreshCache() {
return request({
url: '/system/dict/type/refreshCache',
method: 'delete'
});
}
// 获取字典选择框列表
export function optionselect(): AxiosPromise<DictTypeVO[]> {
return request({
url: '/system/dict/type/optionselect',
method: 'get'
});
}

View File

@ -0,0 +1,18 @@
export interface DictTypeVO extends BaseEntity {
dictId: number | string;
dictName: string;
dictType: string;
remark: string;
}
export interface DictTypeForm {
dictId: number | string | undefined;
dictName: string;
dictType: string;
remark: string;
}
export interface DictTypeQuery extends PageQuery {
dictName: string;
dictType: string;
}

View File

@ -0,0 +1,70 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MenuQuery, MenuVO, MenuForm, MenuTreeOption, RoleMenuTree } from './types';
// 查询菜单列表
export const listMenu = (query?: MenuQuery): AxiosPromise<MenuVO[]> => {
return request({
url: '/system/menu/list',
method: 'get',
params: query
});
};
// 查询菜单详细
export const getMenu = (menuId: string | number): AxiosPromise<MenuVO> => {
return request({
url: '/system/menu/' + menuId,
method: 'get'
});
};
// 查询菜单下拉树结构
export const treeselect = (): AxiosPromise<MenuTreeOption[]> => {
return request({
url: '/system/menu/treeselect',
method: 'get'
});
};
// 根据角色ID查询菜单下拉树结构
export const roleMenuTreeselect = (roleId: string | number): AxiosPromise<RoleMenuTree> => {
return request({
url: '/system/menu/roleMenuTreeselect/' + roleId,
method: 'get'
});
};
// 根据角色ID查询菜单下拉树结构
export const tenantPackageMenuTreeselect = (packageId: string | number): AxiosPromise<RoleMenuTree> => {
return request({
url: '/system/menu/tenantPackageMenuTreeselect/' + packageId,
method: 'get'
});
};
// 新增菜单
export const addMenu = (data: MenuForm) => {
return request({
url: '/system/menu',
method: 'post',
data: data
});
};
// 修改菜单
export const updateMenu = (data: MenuForm) => {
return request({
url: '/system/menu',
method: 'put',
data: data
});
};
// 删除菜单
export const delMenu = (menuId: string | number) => {
return request({
url: '/system/menu/' + menuId,
method: 'delete'
});
};

View File

@ -0,0 +1,69 @@
import { MenuTypeEnum } from '@/enums/MenuTypeEnum';
/**
*
*/
export interface MenuTreeOption {
id: string | number;
label: string;
parentId: string | number;
weight: number;
children?: MenuTreeOption[];
}
export interface RoleMenuTree {
menus: MenuTreeOption[];
checkedKeys: string[];
}
/**
*
*/
export interface MenuQuery {
keywords?: string;
menuName?: string;
status?: string;
}
/**
*
*/
export interface MenuVO extends BaseEntity {
parentName: string;
parentId: string | number;
children: MenuVO[];
menuId: string | number;
menuName: string;
orderNum: number;
path: string;
component: string;
queryParam: string;
isFrame: string;
isCache: string;
menuType: MenuTypeEnum;
visible: string;
status: string;
icon: string;
remark: string;
}
export interface MenuForm {
parentName?: string;
parentId?: string | number;
children?: MenuForm[];
menuId?: string | number;
menuName: string;
orderNum: number;
path: string;
component?: string;
queryParam?: string;
isFrame?: string;
isCache?: string;
menuType?: MenuTypeEnum;
visible?: string;
status?: string;
icon?: string;
remark?: string;
query?: string;
perms?: string;
}

View File

@ -0,0 +1,45 @@
import request from '@/utils/request';
import { NoticeForm, NoticeQuery, NoticeVO } from './types';
import { AxiosPromise } from 'axios';
// 查询公告列表
export function listNotice(query: NoticeQuery): AxiosPromise<NoticeVO[]> {
return request({
url: '/system/notice/list',
method: 'get',
params: query
});
}
// 查询公告详细
export function getNotice(noticeId: string | number): AxiosPromise<NoticeVO> {
return request({
url: '/system/notice/' + noticeId,
method: 'get'
});
}
// 新增公告
export function addNotice(data: NoticeForm) {
return request({
url: '/system/notice',
method: 'post',
data: data
});
}
// 修改公告
export function updateNotice(data: NoticeForm) {
return request({
url: '/system/notice',
method: 'put',
data: data
});
}
// 删除公告
export function delNotice(noticeId: string | number | Array<string | number>) {
return request({
url: '/system/notice/' + noticeId,
method: 'delete'
});
}

View File

@ -0,0 +1,26 @@
export interface NoticeVO extends BaseEntity {
noticeId: number;
noticeTitle: string;
noticeType: string;
noticeContent: string;
status: string;
remark: string;
createByName: string;
}
export interface NoticeQuery extends PageQuery {
noticeTitle: string;
createByName: string;
status: string;
noticeType: string;
}
export interface NoticeForm {
noticeId: number | string | undefined;
noticeTitle: string;
noticeType: string;
noticeContent: string;
status: string;
remark: string;
createByName: string;
}

View File

@ -0,0 +1,28 @@
import request from '@/utils/request';
import { OssQuery, OssVO } from './types';
import { AxiosPromise } from 'axios';
// 查询OSS对象存储列表
export function listOss(query: OssQuery): AxiosPromise<OssVO[]> {
return request({
url: '/resource/oss/list',
method: 'get',
params: query
});
}
// 查询OSS对象基于id串
export function listByIds(ossId: string | number): AxiosPromise<OssVO[]> {
return request({
url: '/resource/oss/listByIds/' + ossId,
method: 'get'
});
}
// 删除OSS对象存储
export function delOss(ossId: string | number | Array<string | number>) {
return request({
url: '/resource/oss/' + ossId,
method: 'delete'
});
}

View File

@ -0,0 +1,22 @@
export interface OssVO extends BaseEntity {
ossId: string | number;
fileName: string;
originalName: string;
fileSuffix: string;
url: string;
createByName: string;
service: string;
}
export interface OssQuery extends PageQuery {
fileName: string;
originalName: string;
fileSuffix: string;
createTime: string;
service: string;
orderByColumn: string;
isAsc: string;
}
export interface OssForm {
file: undefined | string;
}

View File

@ -0,0 +1,60 @@
import request from '@/utils/request';
import { OssConfigForm, OssConfigQuery, OssConfigVO } from './types';
import { AxiosPromise } from 'axios';
// 查询对象存储配置列表
export function listOssConfig(query: OssConfigQuery): AxiosPromise<OssConfigVO[]> {
return request({
url: '/resource/oss/config/list',
method: 'get',
params: query
});
}
// 查询对象存储配置详细
export function getOssConfig(ossConfigId: string | number): AxiosPromise<OssConfigVO> {
return request({
url: '/resource/oss/config/' + ossConfigId,
method: 'get'
});
}
// 新增对象存储配置
export function addOssConfig(data: OssConfigForm) {
return request({
url: '/resource/oss/config',
method: 'post',
data: data
});
}
// 修改对象存储配置
export function updateOssConfig(data: OssConfigForm) {
return request({
url: '/resource/oss/config',
method: 'put',
data: data
});
}
// 删除对象存储配置
export function delOssConfig(ossConfigId: string | number | Array<string | number>) {
return request({
url: '/resource/oss/config/' + ossConfigId,
method: 'delete'
});
}
// 对象存储状态修改
export function changeOssConfigStatus(ossConfigId: string | number, status: string, configKey: string) {
const data = {
ossConfigId,
status,
configKey
};
return request({
url: '/resource/oss/config/changeStatus',
method: 'put',
data: data
});
}

View File

@ -0,0 +1,38 @@
export interface OssConfigVO extends BaseEntity {
ossConfigId: number | string;
configKey: string;
accessKey: string;
secretKey: string;
bucketName: string;
prefix: string;
endpoint: string;
domain: string;
isHttps: string;
region: string;
status: string;
ext1: string;
remark: string;
accessPolicy: string;
}
export interface OssConfigQuery extends PageQuery {
configKey: string;
bucketName: string;
status: string;
}
export interface OssConfigForm {
ossConfigId: string | number | undefined;
configKey: string;
accessKey: string;
secretKey: string;
bucketName: string;
prefix: string;
endpoint: string;
domain: string;
isHttps: string;
accessPolicy: string;
region: string;
status: string;
remark: string;
}

View File

@ -0,0 +1,58 @@
import request from '@/utils/request';
import { PostForm, PostQuery, PostVO } from './types';
import { AxiosPromise } from 'axios';
// 查询岗位列表
export function listPost(query: PostQuery): AxiosPromise<PostVO[]> {
return request({
url: '/system/post/list',
method: 'get',
params: query
});
}
// 查询岗位详细
export function getPost(postId: string | number): AxiosPromise<PostVO> {
return request({
url: '/system/post/' + postId,
method: 'get'
});
}
// 获取岗位选择框列表
export function optionselect(deptId?: number | string, postIds?: (number | string)[]): AxiosPromise<PostVO[]> {
return request({
url: '/system/post/optionselect',
method: 'get',
params: {
postIds: postIds,
deptId: deptId
}
});
}
// 新增岗位
export function addPost(data: PostForm) {
return request({
url: '/system/post',
method: 'post',
data: data
});
}
// 修改岗位
export function updatePost(data: PostForm) {
return request({
url: '/system/post',
method: 'put',
data: data
});
}
// 删除岗位
export function delPost(postId: string | number | (string | number)[]) {
return request({
url: '/system/post/' + postId,
method: 'delete'
});
}

View File

@ -0,0 +1,31 @@
export interface PostVO extends BaseEntity {
postId: number | string;
deptId: number | string;
postCode: string;
postName: string;
postCategory: string;
deptName: string;
postSort: number;
status: string;
remark: string;
}
export interface PostForm {
postId: number | string | undefined;
deptId: number | string | undefined;
postCode: string;
postName: string;
postCategory: string;
postSort: number;
status: string;
remark: string;
}
export interface PostQuery extends PageQuery {
deptId: number | string;
belongDeptId: number | string;
postCode: string;
postName: string;
postCategory: string;
status: string;
}

View File

@ -0,0 +1,160 @@
import { UserVO } from '@/api/system/user/types';
import { UserQuery } from '@/api/system/user/types';
import { AxiosPromise } from 'axios';
import { RoleQuery, RoleVO, RoleDeptTree } from './types';
import request from '@/utils/request';
export const listRole = (query: RoleQuery): AxiosPromise<RoleVO[]> => {
return request({
url: '/system/role/list',
method: 'get',
params: query
});
};
/**
* roleIds查询角色
* @param roleIds
*/
export const optionSelect = (roleIds: (number | string)[]): AxiosPromise<RoleVO[]> => {
return request({
url: '/system/role/optionselect?roleIds=' + roleIds,
method: 'get'
});
};
/**
*
*/
export const getRole = (roleId: string | number): AxiosPromise<RoleVO> => {
return request({
url: '/system/role/' + roleId,
method: 'get'
});
};
/**
*
*/
export const addRole = (data: any) => {
return request({
url: '/system/role',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateRole = (data: any) => {
return request({
url: '/system/role',
method: 'put',
data: data
});
};
/**
*
*/
export const dataScope = (data: any) => {
return request({
url: '/system/role/dataScope',
method: 'put',
data: data
});
};
/**
*
*/
export const changeRoleStatus = (roleId: string | number, status: string) => {
const data = {
roleId,
status
};
return request({
url: '/system/role/changeStatus',
method: 'put',
data: data
});
};
/**
*
*/
export const delRole = (roleId: Array<string | number> | string | number) => {
return request({
url: '/system/role/' + roleId,
method: 'delete'
});
};
/**
*
*/
export const allocatedUserList = (query: UserQuery): AxiosPromise<UserVO[]> => {
return request({
url: '/system/role/authUser/allocatedList',
method: 'get',
params: query
});
};
/**
*
*/
export const unallocatedUserList = (query: UserQuery): AxiosPromise<UserVO[]> => {
return request({
url: '/system/role/authUser/unallocatedList',
method: 'get',
params: query
});
};
/**
*
*/
export const authUserCancel = (data: any) => {
return request({
url: '/system/role/authUser/cancel',
method: 'put',
data: data
});
};
/**
*
*/
export const authUserCancelAll = (data: any) => {
return request({
url: '/system/role/authUser/cancelAll',
method: 'put',
params: data
});
};
/**
*
*/
export const authUserSelectAll = (data: any) => {
return request({
url: '/system/role/authUser/selectAll',
method: 'put',
params: data
});
};
// 根据角色ID查询部门树结构
export const deptTreeSelect = (roleId: string | number): AxiosPromise<RoleDeptTree> => {
return request({
url: '/system/role/deptTree/' + roleId,
method: 'get'
});
};
export default {
optionSelect,
listRole
};

View File

@ -0,0 +1,52 @@
/**
*
*/
export interface DeptTreeOption {
id: string;
label: string;
parentId: string;
weight: number;
children?: DeptTreeOption[];
}
export interface RoleDeptTree {
checkedKeys: string[];
depts: DeptTreeOption[];
}
export interface RoleVO extends BaseEntity {
roleId: string | number;
roleName: string;
roleKey: string;
roleSort: number;
dataScope: string;
menuCheckStrictly: boolean;
deptCheckStrictly: boolean;
status: string;
delFlag: string;
remark?: any;
flag: boolean;
menuIds?: Array<string | number>;
deptIds?: Array<string | number>;
admin: boolean;
}
export interface RoleQuery extends PageQuery {
roleName: string;
roleKey: string;
status: string;
}
export interface RoleForm {
roleName: string;
roleKey: string;
roleSort: number;
status: string;
menuCheckStrictly: boolean;
deptCheckStrictly: boolean;
remark: string;
dataScope?: string;
roleId: string | undefined;
menuIds: Array<string | number>;
deptIds: Array<string | number>;
}

View File

@ -0,0 +1,28 @@
import request from '@/utils/request';
// 绑定账号
export function authBinding(source: string, tenantId: string) {
return request({
url: '/auth/binding/' + source,
method: 'get',
params: {
tenantId: tenantId,
domain: window.location.host
}
});
}
// 解绑账号
export function authUnlock(authId: string) {
return request({
url: '/auth/unlock/' + authId,
method: 'delete'
});
}
//获取授权列表
export function getAuthList() {
return request({
url: '/system/social/list',
method: 'get'
});
}

View File

@ -0,0 +1,111 @@
import request from '@/utils/request';
import { TenantForm, TenantQuery, TenantVO } from './types';
import { AxiosPromise } from 'axios';
// 查询租户列表
export function listTenant(query: TenantQuery): AxiosPromise<TenantVO[]> {
return request({
url: '/system/tenant/list',
method: 'get',
params: query
});
}
// 查询租户详细
export function getTenant(id: string | number): AxiosPromise<TenantVO> {
return request({
url: '/system/tenant/' + id,
method: 'get'
});
}
// 新增租户
export function addTenant(data: TenantForm) {
return request({
url: '/system/tenant',
method: 'post',
headers: {
isEncrypt: true,
repeatSubmit: false
},
data: data
});
}
// 修改租户
export function updateTenant(data: TenantForm) {
return request({
url: '/system/tenant',
method: 'put',
data: data
});
}
// 租户状态修改
export function changeTenantStatus(id: string | number, tenantId: string | number, status: string) {
const data = {
id,
tenantId,
status
};
return request({
url: '/system/tenant/changeStatus',
method: 'put',
data: data
});
}
// 删除租户
export function delTenant(id: string | number | Array<string | number>) {
return request({
url: '/system/tenant/' + id,
method: 'delete'
});
}
// 动态切换租户
export function dynamicTenant(tenantId: string | number) {
return request({
url: '/system/tenant/dynamic/' + tenantId,
method: 'get'
});
}
// 清除动态租户
export function dynamicClear() {
return request({
url: '/system/tenant/dynamic/clear',
method: 'get'
});
}
// 同步租户套餐
export function syncTenantPackage(tenantId: string | number, packageId: string | number) {
const data = {
tenantId,
packageId
};
return request({
url: '/system/tenant/syncTenantPackage',
method: 'get',
params: data
});
}
// 同步租户字典
export function syncTenantDict() {
return request({
url: '/system/tenant/syncTenantDict',
method: 'get'
});
}
// 前往拼多多授权页面
export function toPddGetCode(){
return request({
url:'/huidiao/pdd/toPddGetCode',
method:'get'
})
}

View File

@ -0,0 +1,46 @@
export interface TenantVO extends BaseEntity {
id: number | string;
tenantId: number | string;
username: string;
contactUserName: string;
contactPhone: string;
companyName: string;
licenseNumber: string;
address: string;
domain: string;
intro: string;
remark: string;
packageId: string | number;
expireTime: string;
accountCount: number;
status: string;
}
export interface TenantQuery extends PageQuery {
tenantId: string | number;
contactUserName: string;
contactPhone: string;
companyName: string;
}
export interface TenantForm {
id: number | string | undefined;
tenantId: number | string | undefined;
username: string;
password: string;
contactUserName: string;
contactPhone: string;
companyName: string;
licenseNumber: string;
domain: string;
address: string;
intro: string;
remark: string;
packageId: string | number;
expireTime: string;
accountCount: number;
status: string;
}

View File

@ -0,0 +1,67 @@
import request from '@/utils/request';
import { TenantPkgForm, TenantPkgQuery, TenantPkgVO } from './types';
import { AxiosPromise } from 'axios';
// 查询租户套餐列表
export function listTenantPackage(query?: TenantPkgQuery): AxiosPromise<TenantPkgVO[]> {
return request({
url: '/system/tenant/package/list',
method: 'get',
params: query
});
}
// 查询租户套餐下拉选列表
export function selectTenantPackage(): AxiosPromise<TenantPkgVO[]> {
return request({
url: '/system/tenant/package/selectList',
method: 'get'
});
}
// 查询租户套餐详细
export function getTenantPackage(packageId: string | number): AxiosPromise<TenantPkgVO> {
return request({
url: '/system/tenant/package/' + packageId,
method: 'get'
});
}
// 新增租户套餐
export function addTenantPackage(data: TenantPkgForm) {
return request({
url: '/system/tenant/package',
method: 'post',
data: data
});
}
// 修改租户套餐
export function updateTenantPackage(data: TenantPkgForm) {
return request({
url: '/system/tenant/package',
method: 'put',
data: data
});
}
// 租户套餐状态修改
export function changePackageStatus(packageId: number | string, status: string) {
const data = {
packageId,
status
};
return request({
url: '/system/tenant/package/changeStatus',
method: 'put',
data: data
});
}
// 删除租户套餐
export function delTenantPackage(packageId: string | number | Array<string | number>) {
return request({
url: '/system/tenant/package/' + packageId,
method: 'delete'
});
}

View File

@ -0,0 +1,20 @@
export interface TenantPkgVO extends BaseEntity {
packageId: string | number;
packageName: string;
menuIds: string;
remark: string;
menuCheckStrictly: boolean;
status: string;
}
export interface TenantPkgQuery extends PageQuery {
packageName: string;
}
export interface TenantPkgForm {
packageId: string | number | undefined;
packageName: string;
menuIds: string;
remark: string;
menuCheckStrictly: boolean;
}

View File

@ -0,0 +1,309 @@
import {DeptTreeVO, DeptVO} from './../dept/types';
import { RoleVO } from '@/api/system/role/types';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserForm, UserQuery, UserVO, UserInfoVO } from './types';
import { parseStrEmpty } from '@/utils/ruoyi';
import { checkPermi } from '@/utils/permission';
import { getConfigKey } from '@/api/system/config';
import { get } from 'node_modules/axios/index.cjs';
/**
*
* @param query
*/
export const listUser = (query: UserQuery): AxiosPromise<UserVO[]> => {
return request({
url: '/system/user/list',
method: 'get',
params: query
});
};
/**
* ids查询用户
* @param userIds
*/
export const optionSelect = (userIds: (number | string)[]): AxiosPromise<UserVO[]> => {
return request({
url: '/system/user/optionselect?userIds=' + userIds,
method: 'get'
});
};
/**
*
* @param userId
*/
export const getUser = (userId?: string | number): AxiosPromise<UserInfoVO> => {
return request({
url: '/system/user/' + parseStrEmpty(userId),
method: 'get'
});
};
/**
*
*/
export const addUser = (data: UserForm) => {
return request({
url: '/system/user',
method: 'post',
data: data
});
};
/**
*
*/
export const updateUser = (data: UserForm) => {
return request({
url: '/system/user',
method: 'put',
data: data
});
};
/**
*
* @param userId ID
*/
export const delUser = (userId: Array<string | number> | string | number) => {
return request({
url: '/system/user/' + userId,
method: 'delete'
});
};
/**
*
* @param userId ID
* @param password
*/
export const resetUserPwd = (userId: string | number, password: string) => {
const data = {
userId,
password
};
return request({
url: '/system/user/resetPwd',
method: 'put',
headers: {
isEncrypt: true,
repeatSubmit: false
},
data: data
});
};
/**
*
* @param userId ID
* @param status
*/
export const changeUserStatus = (userId: number | string, status: string) => {
const data = {
userId,
status
};
return request({
url: '/system/user/changeStatus',
method: 'put',
data: data
});
};
/**
*
*/
export const getUserProfile = (): AxiosPromise<UserInfoVO> => {
return request({
url: '/system/user/profile',
method: 'get'
});
};
/**
*
* @returns
*/
export const getUserWarehouseNameList = () => {
return request({
url: '/system/user/getUserWarehouseNameList',
method: 'get'
});
}
/**
*
* @return
*/
export const getUserWarehouseName = () => {
return request({
url: '/system/user/getUserWarehouseName',
method: 'get'
});
}
/**
*
* @param warehouseName
* @returns
*/
export const editUserWarehouseName = (warehouseName) => {
return request({
url: '/system/user/editUserWarehouseName?warehouseName='+warehouseName,
method: 'put'
});
}
/**
*
* @param data
*/
export const updateUserProfile = (data: UserForm) => {
return request({
url: '/system/user/profile',
method: 'put',
data: data
});
};
/**
*
* @param oldPassword
* @param newPassword
*/
export const updateUserPwd = (oldPassword: string, newPassword: string) => {
const data = {
oldPassword,
newPassword
};
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
headers: {
isEncrypt: true,
repeatSubmit: false
},
data: data
});
};
/**
*
* @param data
*/
export const uploadAvatar = (data: FormData) => {
return request({
url: '/system/user/profile/avatar',
method: 'post',
data: data
});
};
/**
*
* @param userId ID
*/
export const getAuthRole = (userId: string | number): AxiosPromise<{ user: UserVO; roles: RoleVO[] }> => {
return request({
url: '/system/user/authRole/' + userId,
method: 'get'
});
};
/**
*
* @param data ID
*/
export const updateAuthRole = (data: { userId: string; roleIds: string }) => {
return request({
url: '/system/user/authRole',
method: 'put',
params: data
});
};
/**
*
* @param deptId
*/
export const listUserByDeptId = (deptId: string | number): AxiosPromise<UserVO[]> => {
return request({
url: '/system/user/list/dept/' + deptId,
method: 'get'
});
};
/**
*
*/
export const deptTreeSelect = (): AxiosPromise<DeptTreeVO[]> => {
return request({
url: '/system/user/deptTree',
method: 'get'
});
};
export const setWhiteList = (ips) =>{
return request({
url: '/zhishu/whiteList/setWhiteList?ips='+ips,
method: 'post'
});
}
export const selectAll = () => {
return request({
url: '/zhishu/whiteList/selectAll',
method: 'get'
});
}
/**
*
*/
export const verifyMember = () => {
const data = {
name:"",
role:""
};
if(checkPermi(['user:member:ordinary'])){
// 会员
data.name = '会员'
data.role = 'user:member:ordinary'
}else if(checkPermi(['user:member:vip'])){
// VIP
data.name = 'VIP'
data.role = 'user:member:vip'
}else{
// 普通用户
data.name = '普通用户'
}
return data;
}
export default {
listUser,
getUser,
optionSelect,
addUser,
updateUser,
delUser,
resetUserPwd,
changeUserStatus,
getUserProfile,
updateUserProfile,
updateUserPwd,
uploadAvatar,
getAuthRole,
updateAuthRole,
deptTreeSelect,
listUserByDeptId,
setWhiteList,
selectAll
};

View File

@ -0,0 +1,17 @@
// import {DeptTreeVO, DeptVO} from './../dept/types';
// import { RoleVO } from '@/api/system/role/types';
// import request from '@/utils/request';
// import { AxiosPromise } from 'axios';
// import { UserForm, UserQuery, UserVO, UserInfoVO } from './types';
// import { parseStrEmpty } from '@/utils/ruoyi';
//addNewUser
import { NewUserForm } from '@/api/system/user/newuser/types';
import request from '@/utils/request';
export const addNewUser = (data: NewUserForm) => {
return request({
url: '/system/newUser',
method: 'post',
data: data
});
};

View File

@ -0,0 +1,84 @@
// export interface UserForm {
// id?: string;
// userId?: string;
// deptId?: number;
// userName: string;
// nickName?: string;
// password: string;
// phonenumber?: string;
// email?: string;
// sex?: string;
// status: string;
// remark?: string;
// postIds: string[];
// roleIds: string[];
// }
export interface NewUserForm{
/**
*
*/
companyName?: string,
/**
*
*/
contactPerson?: string,
/**
*
*/
contactPhone?: string,
/**
*
*/
email?: string,
/**
*
*/
companyType?: string,
/**
*
*/
cardIdentity?:string,
/**
*
*/
licenseName?:string,
/**
*
*/
licenseNumber?:string,
/**
*
*/
license?: string,
/**
*
*/
remark?: string,
/**
*
*/
adress?:string,
/**
*
*/
businessLicense?:string,
/**
*
*/
licenseTime?:string,
/**
*
*/
businessLicenseTime?:string,
}

View File

@ -0,0 +1,87 @@
import { RoleVO } from '@/api/system/role/types';
import { PostVO } from '@/api/system/post/types';
/**
*
*/
export interface UserInfo {
user: UserVO;
roles: string[];
permissions: string[];
}
/**
*
*/
export interface UserQuery extends PageQuery {
userName?: string;
phonenumber?: string;
status?: string;
deptId?: string | number;
roleId?: string | number;
roleKey?: string;
}
/**
*
*/
export interface UserVO extends BaseEntity {
userId: string | number;
tenantId: string;
deptId: number;
userName: string;
nickName: string;
userType: string;
email: string;
phonenumber: string;
sex: string;
avatar: string;
status: string;
delFlag: string;
loginIp: string;
loginDate: string;
remark: string;
deptName: string;
roles: RoleVO[];
roleIds: any;
postIds: any;
roleId: any;
admin: boolean;
roleKey: string;
}
/**
*
*/
export interface UserForm {
id?: string;
userId?: string;
deptId?: number;
userName: string;
nickName?: string;
password: string;
phonenumber?: string;
email?: string;
sex?: string;
status: string;
remark?: string;
postIds: string[];
roleIds: string[];
roleKey?: string;
}
export interface UserInfoVO {
user: UserVO;
roles: RoleVO[];
roleIds: string[];
posts: PostVO[];
postIds: string[];
roleGroup: string;
postGroup: string;
}
export interface ResetPwdForm {
oldPassword: string;
newPassword: string;
confirmPassword: string;
}

86
src/api/tool/gen/index.ts Normal file
View File

@ -0,0 +1,86 @@
import request from '@/utils/request';
import { DbTableQuery, DbTableVO, TableQuery, TableVO, GenTableVO, DbTableForm } from './types';
import { AxiosPromise } from 'axios';
// 查询生成表数据
export const listTable = (query: TableQuery): AxiosPromise<TableVO[]> => {
return request({
url: '/tool/gen/list',
method: 'get',
params: query
});
};
// 查询db数据库列表
export const listDbTable = (query: DbTableQuery): AxiosPromise<DbTableVO[]> => {
return request({
url: '/tool/gen/db/list',
method: 'get',
params: query
});
};
// 查询表详细信息
export const getGenTable = (tableId: string | number): AxiosPromise<GenTableVO> => {
return request({
url: '/tool/gen/' + tableId,
method: 'get'
});
};
// 修改代码生成信息
export const updateGenTable = (data: DbTableForm): AxiosPromise<GenTableVO> => {
return request({
url: '/tool/gen',
method: 'put',
data: data
});
};
// 导入表
export const importTable = (data: { tables: string; dataName: string }): AxiosPromise<GenTableVO> => {
return request({
url: '/tool/gen/importTable',
method: 'post',
params: data
});
};
// 预览生成代码
export const previewTable = (tableId: string | number) => {
return request({
url: '/tool/gen/preview/' + tableId,
method: 'get'
});
};
// 删除表数据
export const delTable = (tableId: string | number | Array<string | number>) => {
return request({
url: '/tool/gen/' + tableId,
method: 'delete'
});
};
// 生成代码(自定义路径)
export const genCode = (tableId: string | number) => {
return request({
url: '/tool/gen/genCode/' + tableId,
method: 'get'
});
};
// 同步数据库
export const synchDb = (tableId: string | number) => {
return request({
url: '/tool/gen/synchDb/' + tableId,
method: 'get'
});
};
// 获取数据源名称
export const getDataNames = () => {
return request({
url: '/tool/gen/getDataNames',
method: 'get'
});
};

180
src/api/tool/gen/types.ts Normal file
View File

@ -0,0 +1,180 @@
export interface TableVO extends BaseEntity {
createDept: number | string;
tableId: string | number;
dataName: string;
tableName: string;
tableComment: string;
subTableName?: any;
subTableFkName?: any;
className: string;
tplCategory: string;
packageName: string;
moduleName: string;
businessName: string;
functionName: string;
functionAuthor: string;
genType: string;
genPath: string;
pkColumn?: any;
columns?: any;
options?: any;
remark?: any;
treeCode?: any;
treeParentCode?: any;
treeName?: any;
menuIds?: any;
parentMenuId?: any;
parentMenuName?: any;
tree: boolean;
crud: boolean;
}
export interface TableQuery extends PageQuery {
tableName: string;
tableComment: string;
dataName: string;
}
export interface DbColumnVO extends BaseEntity {
createDept?: any;
columnId?: any;
tableId?: any;
columnName?: any;
columnComment?: any;
columnType?: any;
javaType?: any;
javaField?: any;
isPk?: any;
isIncrement?: any;
isRequired?: any;
isInsert?: any;
isEdit?: any;
isList?: any;
isQuery?: any;
queryType?: any;
htmlType?: any;
dictType?: any;
sort?: any;
increment: boolean;
capJavaField?: any;
usableColumn: boolean;
superColumn: boolean;
list: boolean;
pk: boolean;
insert: boolean;
edit: boolean;
query: boolean;
required: boolean;
}
export interface DbTableVO {
createDept?: any;
tableId?: any;
tableName: string;
tableComment: string;
subTableName?: any;
subTableFkName?: any;
className?: any;
tplCategory?: any;
packageName?: any;
moduleName?: any;
businessName?: any;
functionName?: any;
functionAuthor?: any;
genType?: any;
genPath?: any;
pkColumn?: any;
columns: DbColumnVO[];
options?: any;
remark?: any;
treeCode?: any;
treeParentCode?: any;
treeName?: any;
menuIds?: any;
parentMenuId?: any;
parentMenuName?: any;
tree: boolean;
crud: boolean;
}
export interface DbTableQuery extends PageQuery {
dataName: string;
tableName: string;
tableComment: string;
}
export interface GenTableVO {
info: DbTableVO;
rows: DbColumnVO[];
tables: DbTableVO[];
}
export interface DbColumnForm extends BaseEntity {
createDept: number;
columnId: string;
tableId: string;
columnName: string;
columnComment: string;
columnType: string;
javaType: string;
javaField: string;
isPk: string;
isIncrement: string;
isRequired: string;
isInsert?: any;
isEdit: string;
isList: string;
isQuery?: any;
queryType: string;
htmlType: string;
dictType: string;
sort: number;
increment: boolean;
capJavaField: string;
usableColumn: boolean;
superColumn: boolean;
list: boolean;
pk: boolean;
insert: boolean;
edit: boolean;
query: boolean;
required: boolean;
}
export interface DbParamForm {
treeCode?: any;
treeName?: any;
treeParentCode?: any;
parentMenuId: string;
}
export interface DbTableForm extends BaseEntity {
createDept?: any;
tableId: string | string;
tableName: string;
tableComment: string;
subTableName?: any;
subTableFkName?: any;
className: string;
tplCategory: string;
packageName: string;
moduleName: string;
businessName: string;
functionName: string;
functionAuthor: string;
genType: string;
genPath: string;
pkColumn?: any;
columns: DbColumnForm[];
options: string;
remark?: any;
treeCode?: any;
treeParentCode?: any;
treeName?: any;
menuIds?: any;
parentMenuId: string;
parentMenuName?: any;
tree: boolean;
crud: boolean;
params: DbParamForm;
}

View File

@ -0,0 +1,101 @@
// product.ts
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
/**
*
* @param warehouseCode xx-xx-xx-xx-xx-xx
* @param barcode
*/
export const getProductByBarcode = (
barcode: string
): AxiosPromise<ProductVO[]> => {
return request({
url: '/zhishu/shopGoods/info',
method: 'get',
params: {
barcode
}
});
};
/**
* ID查询库存信息
* @param productId ID
*/
export const getStockInfo = (
productId: string,
warehouseCode: string
): AxiosPromise<{ stock: number; price: number }> => {
return request({
url: `/zhishu/shopGoods/stock`,
method: 'get',
params: {
productId,
warehouseCode
}
});
};
/**
*
* @param formData ID
* @param photos
*/
export const submitProduct = (
formData: FormData,
photos: PhotoItem[]
): AxiosPromise<void> => {
return request({
url: '/zhishu/shopGoods/submit',
method: 'post',
data: formData,
})
}
// ==================== 类型定义文件 types.ts ====================
/**
*
*/
export interface ProductQuery {
warehouseCode: string; // 标准库号格式xx-xx-xx-xx-xx-xx
barcode: string;
}
/**
*
*/
export interface ProductVO {
id: string;
name: string;
barcode: string;
price: number;
stock: number;
condition: number;
warehouseCode: string;
}
/**
*
*/
export interface ProductForm extends ProductVO {
// 继承自ProductVO包含所有字段
}
/**
*
*/
export interface PhotoItem {
file: File;
preview: string; // 本地预览URL
}
/**
*
*/
export interface ProductListResponse {
list: ProductVO[];
total: number;
}

69
src/api/types.ts Normal file
View File

@ -0,0 +1,69 @@
/**
*
*/
export type RegisterForm = {
tenantId: string;
username: string;
phoneNumber:string;
password: string;
confirmPassword?: string;
code?: string;
uuid?: string;
userType?: string;
inviteCode: string;
pddMallId?: string;
pddMallName?: string;
pddType?: string;
accessToken?: string;
skuSpec?: string;
};
/**
*
*/
export interface LoginData {
tenantId?: string;
username?: string;
phoneNumber?: string;
password?: string;
rememberMe?: boolean;
socialCode?: string;
socialState?: string;
source?: string;
code?: string;
uuid?: string;
login_code?: string;
token?: string;
clientId: string;
grantType: string;
}
/**
*
*/
export interface LoginResult {
access_token: string;
}
/**
*
*/
export interface VerifyCodeResult {
captchaEnabled: boolean;
uuid?: string;
img?: string;
}
/**
*
*/
export interface TenantVO {
companyName: string;
domain: any;
tenantId: string;
}
export interface TenantInfo {
tenantEnabled: boolean;
voList: TenantVO[];
}

View File

@ -0,0 +1,76 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CategoryVO, CategoryForm, CategoryQuery, CategoryTreeVO } from '@/api/workflow/category/types';
/**
*
* @param query
* @returns {*}
*/
export const listCategory = (query?: CategoryQuery): AxiosPromise<CategoryVO[]> => {
return request({
url: '/workflow/category/list',
method: 'get',
params: query
});
};
/**
*
* @param categoryId
*/
export const getCategory = (categoryId: string | number): AxiosPromise<CategoryVO> => {
return request({
url: '/workflow/category/' + categoryId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addCategory = (data: CategoryForm) => {
return request({
url: '/workflow/category',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateCategory = (data: CategoryForm) => {
return request({
url: '/workflow/category',
method: 'put',
data: data
});
};
/**
*
* @param categoryId
*/
export const delCategory = (categoryId: string | number | Array<string | number>) => {
return request({
url: '/workflow/category/' + categoryId,
method: 'delete'
});
};
/**
*
* @param query id
* @returns
*/
export const categoryTree = (query?: CategoryForm): AxiosPromise<CategoryTreeVO[]> => {
return request({
url: `/workflow/category/categoryTree`,
method: 'get',
params: query
});
};

View File

@ -0,0 +1,72 @@
export interface CategoryTreeVO {
id: number | string;
label: string;
parentId: number | string;
weight: number;
children: CategoryTreeVO[];
}
export interface CategoryVO {
/**
* ID
*/
categoryId: string | number;
/**
* id
*/
parentId: string | number;
/**
*
*/
categoryName: string;
/**
*
*/
orderNum: number;
/**
*
*/
createTime: string;
/**
*
*/
children: CategoryVO[];
}
export interface CategoryForm extends BaseEntity {
/**
* ID
*/
categoryId?: string | number;
/**
*
*/
categoryName?: string;
/**
* id
*/
parentId?: string | number;
/**
*
*/
orderNum?: number;
}
export interface CategoryQuery {
/**
*
*/
categoryName?: string;
}

View File

@ -0,0 +1,170 @@
import request from '@/utils/request';
import { FlowDefinitionQuery, definitionXmlVO, FlowDefinitionForm, FlowDefinitionVo } from '@/api/workflow/definition/types';
import { AxiosPromise } from 'axios';
/**
*
* @param query id
* @returns
*/
export const listDefinition = (query: FlowDefinitionQuery): AxiosPromise<FlowDefinitionVo[]> => {
return request({
url: `/workflow/definition/list`,
method: 'get',
params: query
});
};
/**
*
* @param query id
* @returns
*/
export const unPublishList = (query: FlowDefinitionQuery): AxiosPromise<FlowDefinitionVo[]> => {
return request({
url: `/workflow/definition/unPublishList`,
method: 'get',
params: query
});
};
/**
* id获取xml
* @param definitionId id
* @returns
*/
export const definitionXml = (definitionId: string): AxiosPromise<definitionXmlVO> => {
return request({
url: `/workflow/definition/definitionXml/${definitionId}`,
method: 'get'
});
};
/**
*
* @param id id
* @returns
*/
export const deleteDefinition = (id: string | string[]) => {
return request({
url: `/workflow/definition/${id}`,
method: 'delete'
});
};
/**
* /
* @param definitionId id
* @param activityStatus
* @returns
*/
export const active = (definitionId: string, activityStatus: boolean) => {
return request({
url: `/workflow/definition/active/${definitionId}`,
method: 'put',
params: {
active: activityStatus
}
});
};
/**
* zip或xml部署流程定义
* @returns
*/
export function importDef(data: any) {
return request({
url: '/workflow/definition/importDef',
method: 'post',
data: data,
headers: {
repeatSubmit: false
}
});
}
/**
*
* @param id id
* @returns
*/
export const publish = (id: string) => {
return request({
url: `/workflow/definition/publish/${id}`,
method: 'put'
});
};
/**
*
* @param id id
* @returns
*/
export const unPublish = (id: string) => {
return request({
url: `/workflow/definition/unPublish/${id}`,
method: 'put'
});
};
/**
* xml字符串
* @param id id
* @returns
*/
export const xmlString = (id: string) => {
return request({
url: `/workflow/definition/xmlString/${id}`,
method: 'get'
});
};
/**
*
* @param data
* @returns
*/
export const add = (data: FlowDefinitionForm) => {
return request({
url: `/workflow/definition`,
method: 'post',
data: data
});
};
/**
*
* @param data
* @returns
*/
export const edit = (data: FlowDefinitionForm) => {
return request({
url: `/workflow/definition`,
method: 'put',
data: data
});
};
/**
*
* @param id
* @returns
*/
export const getInfo = (id: number | string) => {
return request({
url: `/workflow/definition/${id}`,
method: 'get'
});
};
/**
*
* @param id id
* @returns
*/
export const copy = (id: string) => {
return request({
url: `/workflow/definition/copy/${id}`,
method: 'post'
});
};

View File

@ -0,0 +1,31 @@
export interface FlowDefinitionQuery extends PageQuery {
flowCode?: string;
flowName?: string;
category: string | number;
isPublish?: number;
}
export interface FlowDefinitionVo {
id: string;
flowName: string;
flowCode: string;
formPath: string;
version: string;
isPublish: number;
activityStatus: number;
createTime: Date;
updateTime: Date;
}
export interface FlowDefinitionForm {
id: string;
flowName: string;
flowCode: string;
category: string;
formPath: string;
}
export interface definitionXmlVO {
xml: string[];
xmlStr: string;
}

View File

@ -0,0 +1,101 @@
import request from '@/utils/request';
import { FlowInstanceQuery, FlowInstanceVO } from '@/api/workflow/instance/types';
import { AxiosPromise } from 'axios';
/**
*
* @param query
* @returns {*}
*/
export const pageByRunning = (query: FlowInstanceQuery): AxiosPromise<FlowInstanceVO[]> => {
return request({
url: '/workflow/instance/pageByRunning',
method: 'get',
params: query
});
};
/**
*
* @param query
* @returns {*}
*/
export const pageByFinish = (query: FlowInstanceQuery): AxiosPromise<FlowInstanceVO[]> => {
return request({
url: '/workflow/instance/pageByFinish',
method: 'get',
params: query
});
};
/**
* id获取历史流程图
*/
export const flowImage = (businessId: string | number) => {
return request({
url: `/workflow/instance/flowImage/${businessId}` + '?t' + Math.random(),
method: 'get'
});
};
/**
*
* @param query
* @returns {*}
*/
export const pageByCurrent = (query: FlowInstanceQuery): AxiosPromise<FlowInstanceVO[]> => {
return request({
url: '/workflow/instance/pageByCurrent',
method: 'get',
params: query
});
};
/**
*
* @param data
* @returns
*/
export const cancelProcessApply = (data: any) => {
return request({
url: `/workflow/instance/cancelProcessApply`,
method: 'put',
data: data
});
};
/**
*
* @param instanceId id
* @returns
*/
export const instanceVariable = (instanceId: string | number) => {
return request({
url: `/workflow/instance/instanceVariable/${instanceId}`,
method: 'get'
});
};
/**
*
* @param instanceIds id
* @returns
*/
export const deleteByInstanceIds = (instanceIds: Array<string | number> | string | number) => {
return request({
url: `/workflow/instance/deleteByInstanceIds/${instanceIds}`,
method: 'delete'
});
};
/**
*
* @param data
* @returns
*/
export const invalid = (data: any) => {
return request({
url: `/workflow/instance/invalid`,
method: 'post',
data: data
});
};

View File

@ -0,0 +1,26 @@
import { FlowTaskVO } from '@/api/workflow/task/types';
export interface FlowInstanceQuery extends PageQuery {
category?: string | number;
nodeName?: string;
flowCode?: string;
flowName?: string;
createByIds?: string[] | number[];
businessId?: string;
}
export interface FlowInstanceVO extends BaseEntity {
id: string | number;
definitionId: string;
flowName: string;
flowCode: string;
version: string;
businessId: string;
activityStatus: number;
tenantId: string;
createTime: string;
createBy: string;
flowStatus: string;
flowStatusName: string;
flowTaskList: FlowTaskVO[];
}

View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LeaveVO, LeaveQuery, LeaveForm } from '@/api/workflow/leave/types';
/**
*
* @param query
* @returns {*}
*/
export const listLeave = (query?: LeaveQuery): AxiosPromise<LeaveVO[]> => {
return request({
url: '/workflow/leave/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getLeave = (id: string | number): AxiosPromise<LeaveVO> => {
return request({
url: '/workflow/leave/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addLeave = (data: LeaveForm): AxiosPromise<LeaveVO> => {
return request({
url: '/workflow/leave',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateLeave = (data: LeaveForm): AxiosPromise<LeaveVO> => {
return request({
url: '/workflow/leave',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delLeave = (id: string | number | Array<string | number>) => {
return request({
url: '/workflow/leave/' + id,
method: 'delete'
});
};

View File

@ -0,0 +1,24 @@
export interface LeaveVO {
id: string | number;
leaveType: string;
startDate: string;
endDate: string;
leaveDays: number;
remark: string;
status?: string;
}
export interface LeaveForm extends BaseEntity {
id?: string | number;
leaveType?: string;
startDate?: string;
endDate?: string;
leaveDays?: number;
remark?: string;
status?: string;
}
export interface LeaveQuery extends PageQuery {
startLeaveDays?: number;
endLeaveDays?: number;
}

View File

@ -0,0 +1,180 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { TaskQuery, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
/**
*
* @param query
* @returns {*}
*/
export const pageByTaskWait = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
return request({
url: '/workflow/task/pageByTaskWait',
method: 'get',
params: query
});
};
/**
*
* @param query
* @returns {*}
*/
export const pageByTaskFinish = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
return request({
url: '/workflow/task/pageByTaskFinish',
method: 'get',
params: query
});
};
/**
*
* @param query
* @returns {*}
*/
export const pageByTaskCopy = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
return request({
url: '/workflow/task/pageByTaskCopy',
method: 'get',
params: query
});
};
/**
*
* @param query
* @returns {*}
*/
export const pageByAllTaskWait = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
return request({
url: '/workflow/task/pageByAllTaskWait',
method: 'get',
params: query
});
};
/**
*
* @param query
* @returns {*}
*/
export const pageByAllTaskFinish = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
return request({
url: '/workflow/task/pageByAllTaskFinish',
method: 'get',
params: query
});
};
/**
*
* @param data
* @returns {*}
*/
export const startWorkFlow = (data: object): any => {
return request({
url: '/workflow/task/startWorkFlow',
method: 'post',
data: data
});
};
/**
*
* @param data
* @returns {*}
*/
export const completeTask = (data: object) => {
return request({
url: '/workflow/task/completeTask',
method: 'post',
data: data
});
};
/**
*
* @param data
* @returns {*}
*/
export const backProcess = (data: any): any => {
return request({
url: '/workflow/task/backProcess',
method: 'post',
data: data
});
};
/**
*
* @param taskId
* @returns
*/
export const getTask = (taskId: string) => {
return request({
url: '/workflow/task/getTask/' + taskId,
method: 'get'
});
};
/**
*
* @param taskIdList
* @param userId
* @returns
*/
export const updateAssignee = (taskIdList: Array<string>, userId: string) => {
return request({
url: `/workflow/task/updateAssignee/${userId}`,
method: 'put',
data: taskIdList
});
};
/**
*
* @returns
*/
export const terminationTask = (data: any) => {
return request({
url: `/workflow/task/terminationTask`,
method: 'post',
data: data
});
};
/**
*
* @returns
*/
export const getBackTaskNode = (definitionId: string, nodeCode: string) => {
return request({
url: `/workflow/task/getBackTaskNode/${definitionId}/${nodeCode}`,
method: 'get'
});
};
/**
* delegateTask transferTask addSignature reductionSignature
* @returns
*/
export const taskOperation = (data: TaskOperationBo, operation: string) => {
return request({
url: `/workflow/task/taskOperation/${operation}`,
method: 'post',
data: data
});
};
/**
*
* @param taskId id
* @returns
*/
export const currentTaskAllUser = (taskId: string | number) => {
return request({
url: `/workflow/task/currentTaskAllUser/${taskId}`,
method: 'get'
});
};

View File

@ -0,0 +1,48 @@
export interface TaskQuery extends PageQuery {
nodeName?: string;
flowCode?: string;
flowName?: string;
createByIds?: string[] | number[];
}
export interface ParticipantVo {
groupIds?: string[] | number[];
candidate: string[] | number[];
candidateName: string[];
claim: boolean;
}
export interface FlowTaskVO {
id: string | number;
createTime?: Date;
updateTime?: Date;
tenantId?: string;
definitionId?: string;
instanceId: string;
flowName: string;
businessId: string;
nodeCode: string;
nodeName: string;
flowCode: string;
flowStatus: string;
formCustom: string;
formPath: string;
nodeType: number;
nodeRatio: string | number;
version?: string;
}
export interface VariableVo {
key: string;
value: string;
}
export interface TaskOperationBo {
//委派/转办人的用户ID必填准对委派/转办人操作)
userId?: string;
//加签/减签人的用户ID列表必填针对加签/减签操作)
userIds?: string[];
//任务ID必填
taskId: string | number;
//意见或备注信息(可选)
message?: string;
}

View File

@ -0,0 +1,15 @@
import { RouterJumpVo } from '@/api/workflow/workflowCommon/types';
export default {
routerJump(routerJumpVo: RouterJumpVo, proxy) {
proxy.$tab.closePage(proxy.$route);
proxy.$router.push({
path: routerJumpVo.formPath,
query: {
id: routerJumpVo.businessId,
type: routerJumpVo.type,
taskId: routerJumpVo.taskId
}
});
}
};

View File

@ -0,0 +1,13 @@
export interface RouterJumpVo {
businessId: string;
taskId: string | number;
type: string;
formCustom: string;
formPath: string;
}
export interface StartProcessBo {
businessId: string | number;
flowCode: string;
variables: any;
}

View File

@ -0,0 +1,17 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AccountVO, AccountForm, AccountQuery } from '@/api/zhishu/account/types';
/**
*
* @param query
* @returns {*}
*/
export const listAccount = (query?: AccountQuery): AxiosPromise<AccountVO[]> => {
return request({
url: '/zhishu/account/list',
method: 'get',
params: query
});
};

View File

@ -0,0 +1,331 @@
/**
* VO
* Java中的 Account
*/
export interface AccountVO {
/**
* ID
*/
id: number;
/**
*
*/
accountNo: string;
/**
* id
*/
aboutId: number;
/**
* 0- 1225 1221 pdd 1222
*/
type: number;
/**
* 1- 2-
*/
tradeType: number;
/**
* wechat/alipay/...
*/
payType: string;
/**
*
*/
totalAmount: number;
/**
* ID
*/
getById: number;
/**
* ID
*/
setById: number;
/**
* 0- 1- 2- 3- 4-
*/
tradeStatus: number;
/**
*
*/
retryCount: number;
/**
*
*/
note: string;
/**
* JSON
*/
extendJson: string;
/**
*
*/
createdBy: number;
/**
*
*/
createdTime: number;
/**
*
*/
updatedBy: number;
/**
*
*/
updatedTime: number;
/**
* 0- 1-
*/
isDel: number;
/**
*
*/
balance: number;
}
/**
* Form
* /
*/
export interface AccountForm extends BaseEntity {
/**
* ID
*/
id?: number;
/**
*
*/
accountNo?: string;
/**
* id
*/
aboutId?: number;
/**
* 0- 1225 1221 pdd 1222
*/
type?: number;
/**
* 1- 2-
*/
tradeType?: number;
/**
* wechat/alipay/...
*/
payType?: string;
/**
*
*/
totalAmount?: number;
/**
* ID
*/
getById?: number;
/**
* ID
*/
setById?: number;
/**
* 0- 1- 2- 3- 4-
*/
tradeStatus?: number;
/**
*
*/
retryCount?: number;
/**
*
*/
note?: string;
/**
* JSON
*/
extendJson?: string;
/**
*
*/
createdBy?: number;
/**
*
*/
createdTime?: number;
/**
*
*/
updatedBy?: number;
/**
*
*/
updatedTime?: number;
/**
* 0- 1-
*/
isDel?: number;
/**
*
*/
balance?: number;
}
/**
* Query
* /
*/
export interface AccountQuery extends PageQuery {
/**
*
*/
accountNo?: string;
/**
* id
*/
aboutId?: number;
/**
* 0- 1225 1221 pdd 1222
*/
type?: number;
/**
* 1- 2-
*/
tradeType?: number;
/**
* wechat/alipay/...
*/
payType?: string;
/**
* ID
*/
getById?: number;
/**
* ID
*/
setById?: number;
/**
* 0- 1- 2- 3- 4-
*/
tradeStatus?: number;
/**
* 0- 1-
*/
isDel?: number;
/**
*
*/
minTotalAmount?: number;
/**
*
*/
maxTotalAmount?: number;
/**
*
*/
minBalance?: number;
/**
*
*/
maxBalance?: number;
/**
*
*/
params?: {
/**
*
*/
beginTime?: number;
/**
*
*/
endTime?: number;
};
}
// 补充基础类型定义(如果项目中已有可删除)
/**
*
*/
interface BaseEntity {
/**
*
*/
createBy?: string | number;
/**
*
*/
createTime?: number;
/**
*
*/
updateBy?: string | number;
/**
*
*/
updateTime?: number;
}
/**
*
*/
interface PageQuery {
/**
*
*/
pageNum?: number;
/**
*
*/
pageSize?: number;
/**
*
*/
orderByColumn?: string;
/**
* asc/desc
*/
isAsc?: string;
}

View File

@ -0,0 +1,79 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AuditVO, AuditForm, AuditQuery, AuditParams, SendFailed } from '@/api/zhishu/audit/types';
/**
*
* @param query
* @returns {*}
*/
export const listAudit = (query?: AuditQuery): AxiosPromise<AuditVO[]> => {
return request({
url: '/zhishu/audit/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getAudit = (id: string | number): AxiosPromise<AuditVO> => {
return request({
url: '/zhishu/audit/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addAudit = (data: AuditForm) => {
return request({
url: '/zhishu/audit',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateAudit = (data: AuditForm) => {
return request({
url: '/zhishu/audit',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delAudit = (id: string | number | Array<string | number>) => {
return request({
url: '/zhishu/audit/' + id,
method: 'delete'
});
};
export const UpdateStatus=(data:AuditParams)=>{
return request({
url: '/zhishu/audit/updateStatus',
method: 'put',
data: data
});
};
export const SendFailedInFo=(data:SendFailed)=>{
return request({
url: '/zhishu/audit/failSend',
method: 'post',
data: data
});
}

View File

@ -0,0 +1,194 @@
export interface AuditVO {
/**
* ID
*/
id: string | number;
/**
* ID
*/
userId: string | number;
/**
* ID
*/
adminId: string | number;
/**
* 0 1 2)
*/
status: string;
/**
*
*/
companyName : string;
/**
*
*/
companyType : string;
/**
*
*/
contactPerson : string;
/**
*
*/
contactPhone : string;
/**
*
*/
email : string;
/**
*
*/
license : string;
/**
*
*/
remark : string;
/**
*
*/
userName : string;
}
export interface AuditForm extends BaseEntity {
/**
* ID
*/
userId?: string | number;
/**
*
*/
userName?: string;
/**
* ID
*/
adminId?: string | number;
/**
* 0 1 2)
*/
status?: string;
/**
*
*/
companyName?: string;
/**
*
*/
companyType?: string;
/**
*
*/
contactPerson?: string;
/**
*
*/
contactPhone?: string;
/**
*
*/
email?: string;
/**
*
*/
license?: string;
/**
*
*/
remark?: string;
}
export interface AuditQuery extends PageQuery {
/**
* ID
*/
userId?: string | number;
/**
*
*/
userName?: string;
/**
* ID
*/
adminId?: string | number;
/**
* 0 1)
*/
status?: string;
/**
*
*/
companyName?: string;
/**
*
*/
companyType?: string;
/**
*
*/
contactPerson?: string;
/**
*
*/
contactPhone?: string;
/**
*
*/
email?: string;
/**
*
*/
license?: string;
/**
*
*/
remark?: string;
/**
*
*/
params?: any;
}
// 定义接口规范请求参数
export interface AuditParams {
id: number | string
status: '0' | '1'
}
export interface SendFailed{
id: number | string
status: '0' | '1'
remark: string
}

View File

@ -0,0 +1,57 @@
import { ref, reactive } from 'vue';
export default function () {
let table_column: any = reactive([
{
label: '书名',
align: 'center',
prop: 'bookName',
width: '200'
},
{
label: '图片',
align: 'center',
prop: 'bookPic'
},
{
label: 'isbn',
align: 'center',
prop: 'isbn'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
},
{
label: 'selection',
align: 'center',
prop: 'bookName'
}
]);
}

View File

@ -0,0 +1,236 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
BaseInfoVO,
BaseInfoForm,
BaseInfoQuery,
IllDataUpSet,
AdvSalesSearch,
userVoMap,
CheckStatusResponse,
BookBaseInfoBo
} from '@/api/zhishu/baseInfo/types';
import { UserRechargeForm } from '@/api/zhishu/userRecharge/types';
/**
*
* @param query
* @returns {*}
*/
export const listBaseInfo = (query?: BaseInfoQuery): AxiosPromise<BaseInfoVO[]> => {
return request({
url: '/zhishu/baseInfo/list',
method: 'get',
params: query,
withCredentials: true // 关键配置
});
};
// https://test.centerbook.buzhiyushu.cn/api/bookBase/getBookBaseInfo
// http://119.45.237.193:9009/api/bookBase/getBookBaseInfo
//
/**
*
* @param id
*/
export const getBaseInfo = (id: string | number): AxiosPromise<BaseInfoVO> => {
return request({
url: '/zhishu/baseInfo/' + id,
method: 'get'
});
};
/**
* ISBN获取官图
* @param isbn
*/
export const getBookPicByISBN = (isbn: string): Promise<{ localPath: string; isbn: string }> => {
return request({
url: '/zhishu/baseInfo/getBookPicByISBN',
method: 'get',
params: { isbn },
timeout: 10000
})
.then((response) => {
// 后端返回的是 R<Map<String, String>> 格式
if (response.code === 200 && response.data) {
return {
localPath: response.data.localPath || '',
isbn: response.data.isbn || isbn
};
}
return { localPath: '', isbn };
})
.catch((error) => {
console.error(`获取官图失败 (ISBN: ${isbn}):`, error);
return { localPath: '', isbn };
});
};
/**
*
* @param data
*/
export const addBaseInfo = (data: BaseInfoForm) => {
return request({
url: '/zhishu/baseInfo',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateBaseInfo = (data: BaseInfoForm) => {
return request({
url: '/zhishu/baseInfo',
method: 'put',
data: data
});
};
// /zhishu/baseInfo
/**
*
* @param id
*/
export const delBaseInfo = (id: string | number | Array<string | number>) => {
return request({
url: '/zhishu/baseInfo/' + id,
method: 'delete'
});
};
// 批量修改违规书号
export const updateBaseIllgeData = (data: IllDataUpSet) => {
return request({
url: '/zhishu/baseInfo/batchUpdateIll',
// url: 'https://119.45.237.193:9004/api/books/setIllInfo',
method: 'put',
data: data
});
};
/**
*
* @param query
* @returns {*}
*/
export const linkEncry = (query?: BaseInfoQuery): AxiosPromise<string> => {
return request({
url: '/zhishu/baseInfo/pricingLink',
method: 'get',
params: query
});
};
//获取销量信息
// export const saleSearch = (isbn: string): AxiosPromise<AdvSalesSearch> => {
// return request({
// url: `https://gather.buzhiyushu.cn/api/price/querySalesFromDB/${isbn}`,
// method: 'get',
// headers: {
// 'Content-Type': 'application/json',
// },
// withCredentials: false // 必须关闭!除非后端明确需要
// });
// };
// 链接到负载均衡B中心书库
export const getUseriSVip = (type: number): AxiosPromise<boolean> => {
return request({
// url: 'http://119.45.237.193:9004/api/user/vipInfo',
url: '/zhishu/baseInfo/user/vipInfo/' + type,
method: 'get'
});
};
// 按钮充值
export const postRecharge = (data: UserRechargeForm) => {
return request({
url: '/zhishu/baseInfo/buttonUserRecharge',
method: 'post',
data: data
});
};
//扣除余额
export const setBalance = (): AxiosPromise<userVoMap> => {
return request({
url: '/zhishu/baseInfo/setBalance',
method: 'get'
});
};
// 页面充值
export const pageRecharge = (data: UserRechargeForm) => {
return request({
url: '/zhishu/baseInfo/userRecharge',
method: 'post',
data: data
});
};
//页面图片展示
export const getImage = (isbn: number): AxiosPromise<userVoMap> => {
return request({
url: '/zhishu/baseInfo/getImageDeit/' + isbn,
method: 'get'
});
};
/**
*
* @param type 0--
*/
export const checkStatus = (type: string): AxiosPromise<CheckStatusResponse> => {
return request({
url: '/zhishu/baseInfo/checkStatus',
method: 'get',
params: { type }
});
};
/**
* isbn查询图书
* @param isbn
*/
export const getBookDataByIsbn = (isbn: string): AxiosPromise<CheckStatusResponse> => {
return request({
url: `/zhishu/baseInfo/getBookDataByIsbn/${isbn}`,
method: 'get'
});
};
/**
*
*/
export const updateBookData = (data: BookBaseInfoBo) => {
return request({
url: '/zhishu/baseInfo/updateBookData',
method: 'post',
data: data
});
};
/**
*
*/
export const processImage = (data: FormData): Promise<any> => {
return request({
url: '/zhishu/baseInfo/processImage',
method: 'post',
data: data
});
};
/**
* id删除数据
*/
export const deleteBookData = (id: string | number) => {
return request({
url: '/zhishu/baseInfo/detectById/' + id,
method: 'post'
});
};

View File

@ -0,0 +1,602 @@
export interface BaseInfoVO {
/**
* id
*/
id: string | number;
/**
*
*/
bookName: string;
/**
*
*/
bookPic: {
localPath?: string;
pddPath?: string;
pddResponse?: string;
} | string;
/**
* URL
*/
officialPicUrl?: string;
/**
*
*/
bookPicS?: {
localPath?: string;
pddPath?: string;
pddResponse?: string;
} | string;
/**
* ibsn
*/
isbn: string;
/**
*
*/
author: string;
/**
*
*/
editor: string;
//targetDSN := "proxy_main:Long6166@@!@tcp(127.0.0.1:6033)/main?charset=utf8mb4&parseTime=True&loc=Local"
/**
*
*/
bindingLayout: string;
/**
*
*/
publisher: string;
/**
*
*/
edition: string;
/**
*
*/
format: string;
/**
*
*/
languages: string;
/**
*
*/
publicationTime: string;
/**
*
*/
printTime: string;
/**
*
*/
paper: string;
/**
*
*/
pages: string;
/**
*
*/
wordage: string;
/**
*
*/
fixPrice: string;
/**
*
*/
buyCount: string;
/**
*
*/
sellCount: string;
/**
*
*/
content: string;
/**
*
*/
remark: string;
/**
* min1
*/
min1: number | string;
/**
* max1
*/
max1: number | string;
/**
*min1
*/
min2: number | string;
/**
*max1
*/
max2: number | string;
/**
*
*/
buy_counts: number | string;
/**
*
*/
sell_counts: number | string;
/**
*
*/
publication_times: number | string;
/**
*
*/
vioBook: number;
/**
*
*/
bookSet: number;
/**
* 1=0=
*/
isSuit?: number;
/**
*
*/
onenumMbooks: number;
/**
*
*/
ill_publisher: number;
//销量7天
daySale7: number;
//销量15天
daySale15: number;
//销量30天
daySale30: number;
//销量60天
daySale60: number;
//销量90天
daySale90: number;
//销量180天
daySale180: number;
//销量365天
daySale365: number;
//今年销量
thisYearSale: number;
//去年销量
lastYearSale: number;
//总销量
totalSale: number;
salesData: AdvSalesSearch;
//分类
category: string;
}
export interface BaseInfoForm extends BaseEntity {
/**
* id
*/
id?: string | number;
/**
*
*/
bookName?: string;
/**
*
*/
bookPic?: string;
/**
* ibsn
*/
isbn?: string;
/**
*
*/
author?: string;
/**
*
*/
editor?: string;
/**
*
*/
bindingLayout?: string;
/**
*
*/
publisher?: string;
/**
*
*/
edition?: string;
/**
*
*/
format?: string;
/**
*
*/
languages?: string;
/**
*
*/
publicationTime?: string;
/**
*
*/
printTime?: string;
/**
*
*/
paper?: string;
/**
*
*/
pages?: string;
/**
*
*/
wordage?: string;
/**
*
*/
fixPrice?: string;
/**
*
*/
buyCount?: string;
/**
*
*/
sellCount?: string;
/**
*
*/
content?: string;
/**
*
*/
remark?: string;
/**
*
*/
vioBook: number;
/**
*
*/
bookSet: number;
/**
*
*/
onenumMbooks: number;
/**
*
*/
illPublisher: number;
}
export interface BaseInfoQuery extends PageQuery {
/**
*
*/
bookName?: string;
/**
*
*/
bookPic?: string;
/**
* ibsn
*/
isbn?: string;
/**
*
*/
author?: string;
/**
* 0=, 1=, 3=
*/
shopType?: number;
/**
* 0=, 1=
*/
is_return?: number;
/**
* 0=, 1=
*/
is_filter?: number;
/**
* 1=9787, 0=9787
*/
categoryType?: number;
/**
* 1=, 0=
*/
picType?: number;
/**
*
*/
isSuit?: number;
/**
*
*/
editor?: string;
/**
*
*/
bindingLayout?: string;
/**
*
*/
publisher?: string;
/**
*
*/
edition?: string;
/**
*
*/
format?: string;
/**
*
*/
languages?: string;
/**
*
*/
publicationTime?: string;
/**
*
*/
publication?: string;
/**
*
*/
printTime?: string;
/**
*
*/
paper?: string;
/**
*
*/
pages?: string;
/**
*
*/
wordage?: string;
/**
*
*/
fixPrice?: string;
/**
*
*/
buyCounts?: string;
/**
*
*/
sellCounts?: string;
/**
*
*/
content?: string;
/**
*
*/
params?: any;
/**
*
*/
publicationStartTime?: string;
/**
*
*/
publicationEndTime?: string;
}
export interface IllDataUpSet {
ids?: number[];
vioBook?: number;
bookSet?: number;
onenumMbooks?: number;
illPublisher?: number;
illAuthor?: number;
}
export interface AdvSalesSearch {
isbn?: number | string;
daySale7?: number;
daySale15?: number;
daySale30?: number;
daySale60?: number;
daySale90?: number;
daySale180?: number;
daySale365?: number;
thisYearSale?: number;
lastYearSale?: number;
sale?: number;
soldOut1?: string;
soldOut2?: string;
soldOut3?: string;
soldOut4?: string;
soldOut5?: string;
soldOut6?: string;
soldOut7?: string;
soldOut8?: string;
shipmentCycle?: string;
}
export type userVoMap = Record<string, object>;
/**
*
*/
export interface CheckStatusResponse {
/**
*
*/
code: number;
/**
* VIP用户
*/
isVip: boolean;
/**
*
*/
expirationDate: number;
/**
*
*/
msg: string;
}
export interface BookBaseInfoBo {
id?: string;
isbn: string;
bookName?: string;
bookPic?: string;
bookPicS?: string;
bookPicB?: string;
bookPicW?: string;
author?: string;
editor?: string;
bindingLayout?: string;
publisher?: string;
edition?: string;
format?: string;
languages?: string;
publicationTime?: string;
printTime?: string;
paper?: string;
pages?: string;
wordage?: string;
fixPrice?: number | string;
content?: string;
remark?: string;
category?: string;
picType?: string;
categoryType?: string;
isSuit?: string;
buyCounts?: number | string;
sellCounts?: number | string;
vioBook?: number;
bookSet?: number;
onenumMbooks?: number;
illPublisher?: number;
illAuthor?: number;
daySale7?: number;
daySale15?: number;
daySale30?: number;
daySale60?: number;
daySale90?: number;
daySale180?: number;
daySale365?: number;
thisYearSale?: number;
lastYearSale?: number;
totalSale?: number;
updateTime?: string;
picSmall?: string;
picLarge?: string;
picSmallS?: string;
picLargeS?: string;
shopIds?: number[];
shopNames?: string[];
ispricing?: boolean;
saleSelect?: number;
}

View File

@ -0,0 +1,72 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BookAuditVO, BookAuditForm, BookAuditQuery, BookAudit } from '@/api/zhishu/bookAudit/types';
import { AuditParams } from '@/api/zhishu/audit/types';
/**
*
* @param query
* @returns {*}
*/
export const listBookAudit = (query?: BookAuditQuery): AxiosPromise<BookAuditVO[]> => {
return request({
url: '/zhishu/bookAudit/list',
method: 'get',
params: query
});
};
/**
*
* @param id
*/
export const getBookAudit = (id: string | number): AxiosPromise<BookAuditVO> => {
return request({
url: '/zhishu/bookAudit/' + id,
method: 'get'
});
};
/**
*
* @param data
*/
export const addBookAudit = (data: BookAuditForm) => {
return request({
url: '/zhishu/bookAudit',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateBookAudit = (data: BookAuditForm) => {
return request({
url: '/zhishu/bookAudit',
method: 'put',
data: data
});
};
/**
*
* @param id
*/
export const delBookAudit = (id: string | number | Array<string | number>) => {
return request({
url: '/zhishu/bookAudit/' + id,
method: 'delete'
});
};
export const UpdateBookStatus=(data:BookAudit)=>{
return request({
url: '/zhishu/bookAudit/updateStatus',
method: 'put',
data: data
});
};

View File

@ -0,0 +1,179 @@
export interface BookAuditVO {
/**
* id
*/
id: string | number;
/**
* id
*/
userId: string | number;
/**
*
*/
productId: string | number;
/**
*
*/
goodsName: string;
/**
* isbn
*/
isbn: string;
/**
*
*/
artNo: string;
/**
*
*/
price: number;
/**
*
*/
conditionCode: string;
/**
*
*/
itemNumber: string;
/**
* (0 1 2 )
*/
status: string;
/**
*
*/
inventory: number;
/**
*
*/
bookPic:string;
}
export interface BookAuditForm extends BaseEntity {
/**
* id
*/
userId?: string | number;
/**
*
*/
productId?: string | number;
/**
*
*/
goodsName?: string;
/**
* isbn
*/
isbn?: string;
/**
*
*/
artNo?: string;
/**
*
*/
conditionCode?: string;
/**
*
*/
itemNumber?: string;
/**
* (0 1 2 )
*/
status?: string;
/**
*
*/
inventory?: number;
/**
*
*/
bookPic?:string;
}
export interface BookAuditQuery extends PageQuery {
/**
* id
*/
userId?: string | number;
/**
*
*/
productId?: string | number;
/**
*
*/
goodsName?: string;
/**
* isbn
*/
isbn?: string;
/**
*
*/
artNo?: string;
/**
*
*/
conditionCode?: string;
/**
*
*/
itemNumber?: string;
/**
* (0 1 2 )
*/
status?: string;
/**
*
*/
inventory?: number;
/**
*
*/
params?: any;
/**
*
*/
bookPic?:string;
}
// 定义接口规范请求参数
export interface BookAudit {
id: number | string
status: '0' | '1'
}

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